svn commit: r196270 - in stable/8/sys: . amd64/include/xen
cddl/contrib/opensolaris contrib/dev/acpica contrib/pf
dev/ata dev/cxgb dev/xen/netfront dev/xen/xenpci ia64/ia64
modules/dtrace/dtnfsclie...
Marcel Moolenaar
marcel at FreeBSD.org
Sun Aug 16 02:12:14 UTC 2009
Author: marcel
Date: Sun Aug 16 02:12:13 2009
New Revision: 196270
URL: http://svn.freebsd.org/changeset/base/196270
Log:
MFC rev 196268:
Decouple ACPI CPU Ids from FreeBSD's cpuid. The ACPI Ids can be
sparse, which causes a kernel assert.
Approved by: re (kensmith)
Modified:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/ata/ (props changed)
stable/8/sys/dev/cxgb/ (props changed)
stable/8/sys/dev/xen/netfront/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
stable/8/sys/ia64/ia64/genassym.c
stable/8/sys/ia64/ia64/machdep.c
stable/8/sys/ia64/ia64/mp_machdep.c
stable/8/sys/modules/dtrace/dtnfsclient/ (props changed)
stable/8/sys/modules/ip6_mroute_mod/ (props changed)
stable/8/sys/modules/ipmi/ipmi_linux/ (props changed)
stable/8/sys/netinet/ipfw/ip_dummynet.c (props changed)
stable/8/sys/netinet/ipfw/ip_fw2.c (props changed)
stable/8/sys/netinet/ipfw/ip_fw_nat.c (props changed)
stable/8/sys/netinet/ipfw/ip_fw_pfil.c (props changed)
stable/8/sys/netipx/spx_reass.c (props changed)
stable/8/sys/xen/evtchn.h (props changed)
stable/8/sys/xen/hypervisor.h (props changed)
stable/8/sys/xen/xen_intr.h (props changed)
Modified: stable/8/sys/ia64/ia64/genassym.c
==============================================================================
--- stable/8/sys/ia64/ia64/genassym.c Sun Aug 16 01:48:46 2009 (r196269)
+++ stable/8/sys/ia64/ia64/genassym.c Sun Aug 16 02:12:13 2009 (r196270)
@@ -91,7 +91,6 @@ ASSYM(MC_SPECIAL_RNAT, offsetof(mcontext
ASSYM(PAGE_SHIFT, PAGE_SHIFT);
ASSYM(PAGE_SIZE, PAGE_SIZE);
-ASSYM(PC_CPUID, offsetof(struct pcpu, pc_cpuid));
ASSYM(PC_CURRENT_PMAP, offsetof(struct pcpu, pc_current_pmap));
ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread));
ASSYM(PC_IDLETHREAD, offsetof(struct pcpu, pc_idlethread));
Modified: stable/8/sys/ia64/ia64/machdep.c
==============================================================================
--- stable/8/sys/ia64/ia64/machdep.c Sun Aug 16 01:48:46 2009 (r196269)
+++ stable/8/sys/ia64/ia64/machdep.c Sun Aug 16 02:12:13 2009 (r196270)
@@ -424,7 +424,11 @@ void
cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size)
{
- pcpu->pc_acpi_id = cpuid;
+ /*
+ * Set pc_acpi_id to "uninitialized".
+ * See sys/dev/acpica/acpi_cpu.c
+ */
+ pcpu->pc_acpi_id = 0xffffffff;
}
void
Modified: stable/8/sys/ia64/ia64/mp_machdep.c
==============================================================================
--- stable/8/sys/ia64/ia64/mp_machdep.c Sun Aug 16 01:48:46 2009 (r196269)
+++ stable/8/sys/ia64/ia64/mp_machdep.c Sun Aug 16 02:12:13 2009 (r196270)
@@ -208,31 +208,25 @@ cpu_mp_add(u_int acpiid, u_int apicid, u
struct pcpu *pc;
u_int64_t lid;
void *dpcpu;
-
- /* Ignore any processor numbers outside our range */
- if (acpiid > mp_maxid)
- return;
-
- KASSERT((all_cpus & (1UL << acpiid)) == 0,
- ("%s: cpu%d already in CPU map", __func__, acpiid));
+ u_int cpuid;
lid = LID_SAPIC_SET(apicid, apiceid);
+ cpuid = ((ia64_get_lid() & LID_SAPIC_MASK) == lid) ? 0 : smp_cpus++;
- if ((ia64_get_lid() & LID_SAPIC_MASK) == lid) {
- KASSERT(acpiid == 0,
- ("%s: the BSP must be cpu0", __func__));
- }
+ KASSERT((all_cpus & (1UL << cpuid)) == 0,
+ ("%s: cpu%d already in CPU map", __func__, acpiid));
- if (acpiid != 0) {
+ if (cpuid != 0) {
pc = (struct pcpu *)malloc(sizeof(*pc), M_SMP, M_WAITOK);
+ pcpu_init(pc, cpuid, sizeof(*pc));
dpcpu = (void *)kmem_alloc(kernel_map, DPCPU_SIZE);
- pcpu_init(pc, acpiid, sizeof(*pc));
- dpcpu_init(dpcpu, acpiid);
+ dpcpu_init(dpcpu, cpuid);
} else
pc = pcpup;
+ pc->pc_acpi_id = acpiid;
pc->pc_lid = lid;
- all_cpus |= (1UL << acpiid);
+ all_cpus |= (1UL << cpuid);
}
void
@@ -244,8 +238,8 @@ cpu_mp_announce()
for (i = 0; i <= mp_maxid; i++) {
pc = pcpu_find(i);
if (pc != NULL) {
- printf("cpu%d: SAPIC Id=%x, SAPIC Eid=%x", i,
- LID_SAPIC_ID(pc->pc_lid),
+ printf("cpu%d: ACPI Id=%x, SAPIC Id=%x, SAPIC Eid=%x",
+ i, pc->pc_acpi_id, LID_SAPIC_ID(pc->pc_lid),
LID_SAPIC_EID(pc->pc_lid));
if (i == 0)
printf(" (BSP)\n");
@@ -305,7 +299,9 @@ cpu_mp_unleash(void *dummy)
SLIST_FOREACH(pc, &cpuhead, pc_allcpu) {
cpus++;
if (pc->pc_awake) {
- kproc_create(ia64_store_mca_state, (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0, "mca %u", pc->pc_cpuid);
+ kproc_create(ia64_store_mca_state,
+ (void*)((uintptr_t)pc->pc_cpuid), NULL, 0, 0,
+ "mca %u", pc->pc_cpuid);
smp_cpus++;
}
}
More information about the svn-src-stable
mailing list