From owner-svn-src-all@FreeBSD.ORG Fri Sep 20 04:35:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 9916C872; Fri, 20 Sep 2013 04:35:10 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 86F712CB7; Fri, 20 Sep 2013 04:35:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8K4ZAPb070041; Fri, 20 Sep 2013 04:35:10 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8K4ZAaP070039; Fri, 20 Sep 2013 04:35:10 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201309200435.r8K4ZAaP070039@svn.freebsd.org> From: "Justin T. Gibbs" Date: Fri, 20 Sep 2013 04:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r255725 - head/sys/i386/xen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Sep 2013 04:35:10 -0000 Author: gibbs Date: Fri Sep 20 04:35:09 2013 New Revision: 255725 URL: http://svnweb.freebsd.org/changeset/base/255725 Log: sys/i386/xen/mp_machdep.c: sys/i386/xen/mptable.c: Set PCPU apic_id and acpi_id fields in a fasion compatible with both UP and SMP configurations. Suggested by: jhb Submitted by: Roger Pau Monné Sponsored by: Citrix Systems R&D Reviewed by: gibbs Approved by: re (blanket Xen) MFC after: 2 weeks Modified: head/sys/i386/xen/mp_machdep.c head/sys/i386/xen/mptable.c Modified: head/sys/i386/xen/mp_machdep.c ============================================================================== --- head/sys/i386/xen/mp_machdep.c Fri Sep 20 04:30:18 2013 (r255724) +++ head/sys/i386/xen/mp_machdep.c Fri Sep 20 04:35:09 2013 (r255725) @@ -251,9 +251,6 @@ cpu_add(u_int apic_id, char boot_cpu) if (bootverbose) printf("SMP: Added CPU %d (%s)\n", apic_id, boot_cpu ? "BSP" : "AP"); - - /* Set the ACPI id (it is needed by VCPU operations) */ - pcpu_find(apic_id)->pc_acpi_id = apic_id; } void @@ -786,6 +783,13 @@ start_all_aps(void) dpcpu_init((void *)kmem_malloc(kernel_arena, DPCPU_SIZE, M_WAITOK | M_ZERO), bootAP); pc->pc_apic_id = cpu_apic_ids[bootAP]; + /* + * The i386 PV port uses the apic_id as vCPU id, but the + * PVHVM port needs to use the acpi_id, so set it for PV + * also in order to work with shared devices between PV + * and PVHVM. + */ + pc->pc_acpi_id = cpu_apic_ids[bootAP]; pc->pc_prvspace = pc; pc->pc_curthread = 0; Modified: head/sys/i386/xen/mptable.c ============================================================================== --- head/sys/i386/xen/mptable.c Fri Sep 20 04:30:18 2013 (r255724) +++ head/sys/i386/xen/mptable.c Fri Sep 20 04:35:09 2013 (r255725) @@ -87,6 +87,8 @@ static int mptable_setup_local(void) { + PCPU_SET(apic_id, 0); + PCPU_SET(acpi_id, 0); return (0); }