Skip to contentSkip to conversation

cs 19927 crashes during boot with debug=y

PATCH New George Dunlap 4 participants 8 messages Jul 14, 2009 – Jul 15, 2009

lore
Share & tools
lore
#0 lore raw

I pulled up to tip recently, and got the panic below. I was building with debug=y; changing it to debug=n made it go away.

I did a binary search, and found that cs 19927 was the culprit. Not sure why yet; I'll look into it tomorrow (if someone hasn't fixed it already).

-George

(XEN) CPU1: Intel Genuine Intel(R) CPU @ 2.40GHz stepping 04
(XEN) Total of 2 processors activated.
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 0
(XEN) RIP: e008:[<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) RFLAGS: 0000000000010206 CONTEXT: hypervisor

(XEN) rax: 0000000000002000   rbx: 00000000ffffffff   rcx: ffff828c8024a840
(XEN) rdx: 0000000000000002   rsi: ffff828c8024a838   rdi: ffff828c80210a2c
(XEN) rbp: ffff828c80277e08   rsp: ffff828c80277d78   r8:  0000000000000004
(XEN) r9:  0000000000000004   r10: 0000000000000001   r11: 0000000000000001
(XEN) r12: ffff828c802120c0   r13: 0000000000000020   r14: 0000000000000002
(XEN) r15: ffff828c8024a840   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 00000000cf27c000   cr2: ffff828c8024c838
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff828c80277d78:
(XEN)    0000000000002000 ffff828c8024a838 ffff828c80277f18 0000002080277f28
(XEN)    0000000000000004 ffff83012fff1ca0 ffff83012fff1c30 ffff828c802b6f14
(XEN)    00000000000026f0 ffff828c8024a298 00000000000022f0 ffff828c802b6f60
(XEN)    ffff828c802b6f08 ffff828c80277f28 000000000001e000 0000000000002000
(XEN)    0000000000000011 0000000000100000 ffff828c80277f18 ffff828c8023c0e7
(XEN)    0000000000000000 0000000000000000 ffff828c80227675 ffffffffc0270000
(XEN)    ffff8300cf27cff8 ffff8300cf27dff8 0000000000227610 0000000000000000
(XEN)    0000000000000000 0000000000000000 ffff83000008bfc0 ffff83000008bf40
(XEN)    0000000000a115f8 0000000000000000 ffff83000008bf40 000000000008bf40
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000001000000 0000000800000000 000000010000006e
(XEN)    0000000000000003 00000000000002f8 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000067eac ffff828c801000b5 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) Xen call trace:
(XEN) [<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) [<ffff828c8023c0e7>] __start_xen+0x420f/0x4668
(XEN)
(XEN) Pagetable walk from ffff828c8024c838:

(XEN)  L4[0x105] = 00000000cf282027 5555555555555555
(XEN)  L3[0x032] = 00000000cf283027 5555555555555555
(XEN)  L2[0x001] = 000000012fffc063 5555555555555555
(XEN)  L1[0x04c] = 00000000cf24c262 5555555555555555

(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) FATAL PAGE FAULT
(XEN) [error_code=0002]
(XEN) Faulting linear address: ffff828c8024c838
(XEN) ****************************************

#1 lore raw

That's one of Jan's patches (cc'ed him). I haven't tried booting a debug build since that went in actually. Probably this straightforwardly has to do with accessing cpu maps of not-present cpus, and accessing a memguarded area.

Reminds me I should make debug=y the default again in xen-unstable...

-- Keir

Quoted 65 lines · George Dunlap

I pulled up to tip recently, and got the panic below. I was building with debug=y; changing it to debug=n made it go away.

I did a binary search, and found that cs 19927 was the culprit. Not sure why yet; I'll look into it tomorrow (if someone hasn't fixed it already).

-George

(XEN) CPU1: Intel Genuine Intel(R) CPU @ 2.40GHz stepping 04
(XEN) Total of 2 processors activated.
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 0
(XEN) RIP: e008:[<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) RFLAGS: 0000000000010206 CONTEXT: hypervisor

(XEN) rax: 0000000000002000   rbx: 00000000ffffffff   rcx: ffff828c8024a840
(XEN) rdx: 0000000000000002   rsi: ffff828c8024a838   rdi: ffff828c80210a2c
(XEN) rbp: ffff828c80277e08   rsp: ffff828c80277d78   r8:  0000000000000004
(XEN) r9:  0000000000000004   r10: 0000000000000001   r11: 0000000000000001
(XEN) r12: ffff828c802120c0   r13: 0000000000000020   r14: 0000000000000002
(XEN) r15: ffff828c8024a840   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 00000000cf27c000   cr2: ffff828c8024c838
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff828c80277d78:
(XEN)    0000000000002000 ffff828c8024a838 ffff828c80277f18 0000002080277f28
(XEN)    0000000000000004 ffff83012fff1ca0 ffff83012fff1c30 ffff828c802b6f14
(XEN)    00000000000026f0 ffff828c8024a298 00000000000022f0 ffff828c802b6f60
(XEN)    ffff828c802b6f08 ffff828c80277f28 000000000001e000 0000000000002000
(XEN)    0000000000000011 0000000000100000 ffff828c80277f18 ffff828c8023c0e7
(XEN)    0000000000000000 0000000000000000 ffff828c80227675 ffffffffc0270000
(XEN)    ffff8300cf27cff8 ffff8300cf27dff8 0000000000227610 0000000000000000
(XEN)    0000000000000000 0000000000000000 ffff83000008bfc0 ffff83000008bf40
(XEN)    0000000000a115f8 0000000000000000 ffff83000008bf40 000000000008bf40
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000001000000 0000000800000000 000000010000006e
(XEN)    0000000000000003 00000000000002f8 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000067eac ffff828c801000b5 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) Xen call trace:
(XEN) [<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) [<ffff828c8023c0e7>] __start_xen+0x420f/0x4668
(XEN)
(XEN) Pagetable walk from ffff828c8024c838:

(XEN)  L4[0x105] = 00000000cf282027 5555555555555555
(XEN)  L3[0x032] = 00000000cf283027 5555555555555555
(XEN)  L2[0x001] = 000000012fffc063 5555555555555555
(XEN)  L1[0x04c] = 00000000cf24c262 5555555555555555

(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) FATAL PAGE FAULT
(XEN) [error_code=0002]
(XEN) Faulting linear address: ffff828c8024c838
(XEN) ****************************************

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#2 lore raw

So how about always debug=y for unstable tree, while debug=n for the release tree like 3.3/3.4?

--jyh

Quoted 87 lines · [email protected] wrote:

That's one of Jan's patches (cc'ed him). I haven't tried booting a debug
build since that went in actually. Probably this straightforwardly has to do
with accessing cpu maps of not-present cpus, and accessing a memguarded area.

Reminds me I should make debug=y the default again in xen-unstable...

-- Keir

Quoted 62 lines · George Dunlap

I pulled up to tip recently, and got the panic below. I was building with debug=y; changing it to debug=n made it go away.

I did a binary search, and found that cs 19927 was the culprit. Not sure why yet; I'll look into it tomorrow (if someone hasn't fixed it already).

-George

(XEN) CPU1: Intel Genuine Intel(R) CPU @ 2.40GHz
stepping 04 (XEN) Total of 2 processors activated.
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 0 (XEN) RIP: e008:[<ffff828c8023cbca>]
smp_prepare_cpus+0x56f/0x825 (XEN) RFLAGS: 0000000000010206
CONTEXT: hypervisor (XEN) rax: 0000000000002000 rbx:
00000000ffffffff rcx: ffff828c8024a840 (XEN) rdx: 0000000000000002
rsi: ffff828c8024a838 rdi: ffff828c80210a2c (XEN) rbp:
ffff828c80277e08 rsp: ffff828c80277d78 r8: 0000000000000004
(XEN) r9: 0000000000000004 r10: 0000000000000001 r11:
0000000000000001 (XEN) r12: ffff828c802120c0 r13: 0000000000000020
r14: 0000000000000002 (XEN) r15: ffff828c8024a840 cr0:
000000008005003b cr4: 00000000000026f0 (XEN) cr3: 00000000cf27c000
cr2: ffff828c8024c838 (XEN) ds: 0000 es: 0000 fs: 0000 gs:
0000 ss: 0000 cs: e008 (XEN) Xen stack trace from
rsp=ffff828c80277d78: (XEN) 0000000000002000 ffff828c8024a838
ffff828c80277f18 0000002080277f28 (XEN) 0000000000000004
ffff83012fff1ca0 ffff83012fff1c30 ffff828c802b6f14 (XEN) 00000000000026f0 ffff828c8024a298 00000000000022f0 ffff828c802b6f60
(XEN) ffff828c802b6f08 ffff828c80277f28 000000000001e000
0000000000002000 (XEN) 0000000000000011 0000000000100000
ffff828c80277f18 ffff828c8023c0e7 (XEN) 0000000000000000
0000000000000000 ffff828c80227675 ffffffffc0270000 (XEN) ffff8300cf27cff8 ffff8300cf27dff8 0000000000227610 0000000000000000
(XEN) 0000000000000000 0000000000000000 ffff83000008bfc0
ffff83000008bf40 (XEN) 0000000000a115f8 0000000000000000
ffff83000008bf40 000000000008bf40 (XEN) 0000000000000000
0000000000000000 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000001000000 0000000800000000 000000010000006e
(XEN) 0000000000000003 00000000000002f8 0000000000000000
0000000000000000 (XEN) 0000000000000000 0000000000000000
0000000000000000 0000000000000000 (XEN) 0000000000067eac
ffff828c801000b5 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) 0000000000000000 0000000000000000 0000000000000000
0000000000000000 (XEN) 0000000000000000 0000000000000000
0000000000000000 0000000000000000 (XEN) 0000000000000000
0000000000000000 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) 0000000000000000 0000000000000000 0000000000000000
0000000000000000 (XEN) Xen call trace: (XEN) [<ffff828c8023cbca>]

smp_prepare_cpus+0x56f/0x825 (XEN)    [<ffff828c8023c0e7>]
__start_xen+0x420f/0x4668 (XEN) (XEN) Pagetable walk from
ffff828c8024c838: (XEN)  L4[0x105] = 00000000cf282027
5555555555555555 (XEN)  L3[0x032] = 00000000cf283027
5555555555555555 (XEN)  L2[0x001] = 000000012fffc063
5555555555555555 (XEN)  L1[0x04c] = 00000000cf24c262

5555555555555555 (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) FATAL PAGE FAULT (XEN) [error_code=0002] (XEN) Faulting linear
address: ffff828c8024c838 (XEN)
****************************************

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

That is the plan, I reverted back to debug=n during 3.4.0 stabilisation, but forgot to revert the reversion.

-- Keir

Quoted 93 lines · Yunhong

So how about always debug=y for unstable tree, while debug=n for the release tree like 3.3/3.4?

--jyh

Quoted 87 lines · [email protected] wrote:

That's one of Jan's patches (cc'ed him). I haven't tried booting a debug
build since that went in actually. Probably this straightforwardly has to do
with accessing cpu maps of not-present cpus, and accessing a memguarded area.

Reminds me I should make debug=y the default again in xen-unstable...

-- Keir

Quoted 62 lines · George Dunlap

I pulled up to tip recently, and got the panic below. I was building with debug=y; changing it to debug=n made it go away.

I did a binary search, and found that cs 19927 was the culprit. Not sure why yet; I'll look into it tomorrow (if someone hasn't fixed it already).

-George

(XEN) CPU1: Intel Genuine Intel(R) CPU @ 2.40GHz
stepping 04 (XEN) Total of 2 processors activated.
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 0 (XEN) RIP: e008:[<ffff828c8023cbca>]
smp_prepare_cpus+0x56f/0x825 (XEN) RFLAGS: 0000000000010206
CONTEXT: hypervisor (XEN) rax: 0000000000002000 rbx:
00000000ffffffff rcx: ffff828c8024a840 (XEN) rdx: 0000000000000002
rsi: ffff828c8024a838 rdi: ffff828c80210a2c (XEN) rbp:
ffff828c80277e08 rsp: ffff828c80277d78 r8: 0000000000000004
(XEN) r9: 0000000000000004 r10: 0000000000000001 r11:
0000000000000001 (XEN) r12: ffff828c802120c0 r13: 0000000000000020
r14: 0000000000000002 (XEN) r15: ffff828c8024a840 cr0:
000000008005003b cr4: 00000000000026f0 (XEN) cr3: 00000000cf27c000
cr2: ffff828c8024c838 (XEN) ds: 0000 es: 0000 fs: 0000 gs:
0000 ss: 0000 cs: e008 (XEN) Xen stack trace from
rsp=ffff828c80277d78: (XEN) 0000000000002000 ffff828c8024a838
ffff828c80277f18 0000002080277f28 (XEN) 0000000000000004
ffff83012fff1ca0 ffff83012fff1c30 ffff828c802b6f14 (XEN) 00000000000026f0 ffff828c8024a298 00000000000022f0 ffff828c802b6f60
(XEN) ffff828c802b6f08 ffff828c80277f28 000000000001e000
0000000000002000 (XEN) 0000000000000011 0000000000100000
ffff828c80277f18 ffff828c8023c0e7 (XEN) 0000000000000000
0000000000000000 ffff828c80227675 ffffffffc0270000 (XEN) ffff8300cf27cff8 ffff8300cf27dff8 0000000000227610 0000000000000000
(XEN) 0000000000000000 0000000000000000 ffff83000008bfc0
ffff83000008bf40 (XEN) 0000000000a115f8 0000000000000000
ffff83000008bf40 000000000008bf40 (XEN) 0000000000000000
0000000000000000 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000001000000 0000000800000000 000000010000006e
(XEN) 0000000000000003 00000000000002f8 0000000000000000
0000000000000000 (XEN) 0000000000000000 0000000000000000
0000000000000000 0000000000000000 (XEN) 0000000000067eac
ffff828c801000b5 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) 0000000000000000 0000000000000000 0000000000000000
0000000000000000 (XEN) 0000000000000000 0000000000000000
0000000000000000 0000000000000000 (XEN) 0000000000000000
0000000000000000 0000000000000000 0000000000000000 (XEN) 0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN) 0000000000000000 0000000000000000 0000000000000000
0000000000000000 (XEN) Xen call trace: (XEN) [<ffff828c8023cbca>]

smp_prepare_cpus+0x56f/0x825 (XEN)    [<ffff828c8023c0e7>]
__start_xen+0x420f/0x4668 (XEN) (XEN) Pagetable walk from
ffff828c8024c838: (XEN)  L4[0x105] = 00000000cf282027
5555555555555555 (XEN)  L3[0x032] = 00000000cf283027
5555555555555555 (XEN)  L2[0x001] = 000000012fffc063
5555555555555555 (XEN)  L1[0x04c] = 00000000cf24c262

5555555555555555 (XEN) (XEN) **************************************** (XEN) Panic on CPU 0: (XEN) FATAL PAGE FAULT (XEN) [error_code=0002] (XEN) Faulting linear
address: ffff828c8024c838 (XEN)
****************************************

Quoted 4 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#4 lore raw
In reply to George Dunlap

Just by looking at the code I spotted one place that needs fixing:

	for (cpu = 0; cpu < NR_CPUS; cpu++) {
		cpus_clear(per_cpu(cpu_sibling_map, cpu));
		cpus_clear(per_cpu(cpu_core_map, cpu));
	}

which clearly needs to be using for_each_possible_cpu(). (Huh, this is still named for_each_cpu() - Keir, shouldn't we get this in sync with the Linux naming?)

But I'll better actually run a debug build before submitting a patch, in case there are more such cases.

Jan

Quoted 1 line
Quoted 1 line
Quoted 1 line

George Dunlap <[email protected]> 14.07.09 21:05 >>>

I pulled up to tip recently, and got the panic below. I was building with debug=y; changing it to debug=n made it go away.

I did a binary search, and found that cs 19927 was the culprit. Not sure why yet; I'll look into it tomorrow (if someone hasn't fixed it already).

-George

(XEN) CPU1: Intel Genuine Intel(R) CPU @ 2.40GHz stepping 04
(XEN) Total of 2 processors activated.
(XEN) ----[ Xen-3.5-unstable x86_64 debug=y Tainted: C ]----
(XEN) CPU: 0
(XEN) RIP: e008:[<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) RFLAGS: 0000000000010206 CONTEXT: hypervisor

(XEN) rax: 0000000000002000   rbx: 00000000ffffffff   rcx: ffff828c8024a840
(XEN) rdx: 0000000000000002   rsi: ffff828c8024a838   rdi: ffff828c80210a2c
(XEN) rbp: ffff828c80277e08   rsp: ffff828c80277d78   r8:  0000000000000004
(XEN) r9:  0000000000000004   r10: 0000000000000001   r11: 0000000000000001
(XEN) r12: ffff828c802120c0   r13: 0000000000000020   r14: 0000000000000002
(XEN) r15: ffff828c8024a840   cr0: 000000008005003b   cr4: 00000000000026f0
(XEN) cr3: 00000000cf27c000   cr2: ffff828c8024c838
(XEN) ds: 0000   es: 0000   fs: 0000   gs: 0000   ss: 0000   cs: e008
(XEN) Xen stack trace from rsp=ffff828c80277d78:
(XEN)    0000000000002000 ffff828c8024a838 ffff828c80277f18 0000002080277f28
(XEN)    0000000000000004 ffff83012fff1ca0 ffff83012fff1c30 ffff828c802b6f14
(XEN)    00000000000026f0 ffff828c8024a298 00000000000022f0 ffff828c802b6f60
(XEN)    ffff828c802b6f08 ffff828c80277f28 000000000001e000 0000000000002000
(XEN)    0000000000000011 0000000000100000 ffff828c80277f18 ffff828c8023c0e7
(XEN)    0000000000000000 0000000000000000 ffff828c80227675 ffffffffc0270000
(XEN)    ffff8300cf27cff8 ffff8300cf27dff8 0000000000227610 0000000000000000
(XEN)    0000000000000000 0000000000000000 ffff83000008bfc0 ffff83000008bf40
(XEN)    0000000000a115f8 0000000000000000 ffff83000008bf40 000000000008bf40
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000001000000 0000000800000000 000000010000006e
(XEN)    0000000000000003 00000000000002f8 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000067eac ffff828c801000b5 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000
(XEN)    0000000000000000 0000000000000000 0000000000000000 0000000000000000

(XEN) Xen call trace:
(XEN) [<ffff828c8023cbca>] smp_prepare_cpus+0x56f/0x825
(XEN) [<ffff828c8023c0e7>] __start_xen+0x420f/0x4668
(XEN)
(XEN) Pagetable walk from ffff828c8024c838:

(XEN)  L4[0x105] = 00000000cf282027 5555555555555555
(XEN)  L3[0x032] = 00000000cf283027 5555555555555555
(XEN)  L2[0x001] = 000000012fffc063 5555555555555555
(XEN)  L1[0x04c] = 00000000cf24c262 5555555555555555

(XEN)
(XEN) ****************************************
(XEN) Panic on CPU 0:
(XEN) FATAL PAGE FAULT
(XEN) [error_code=0002]
(XEN) Faulting linear address: ffff828c8024c838
(XEN) ****************************************

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#5 lore raw
Quoted 10 lines · Jan Beulich

Just by looking at the code I spotted one place that needs fixing:

for (cpu = 0; cpu < NR_CPUS; cpu++) {
cpus_clear(per_cpu(cpu_sibling_map, cpu));
cpus_clear(per_cpu(cpu_core_map, cpu));
}

which clearly needs to be using for_each_possible_cpu(). (Huh, this is still named for_each_cpu() - Keir, shouldn't we get this in sync with the Linux naming?)

Feel free to submit patches for both issues. I too prefer the new Linux name.

-- Keir

#6 lore raw

Sweet, that fixed it. Thanks.
-George

Quoted 25 lines · Keir Fraser
Quoted 10 lines · Jan Beulich

Just by looking at the code I spotted one place that needs fixing:

for (cpu = 0; cpu < NR_CPUS; cpu++) {
cpus_clear(per_cpu(cpu_sibling_map, cpu));
cpus_clear(per_cpu(cpu_core_map, cpu));
}

which clearly needs to be using for_each_possible_cpu(). (Huh, this is still named for_each_cpu() - Keir, shouldn't we get this in sync with the Linux naming?)

Feel free to submit patches for both issues. I too prefer the new Linux name.

 -- Keir

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#7 lore raw

PATCH 1/1 x86: Re: cs 19927 crashes during boot with debug=y

In reply to George Dunlap

Fix an oversight of c/s 19927 - per-CPU data accesses must not be iterated over using NR_CPUS bound loops.

xen/arch/x86/smpboot.c +1 -1
@@ -1163,7 +1163,7 @@ static void __init smp_boot_cpus(unsigne
 	 * construct cpu_sibling_map, so that we can tell sibling CPUs
 	 * efficiently.
 	 */
-	for (cpu = 0; cpu < NR_CPUS; cpu++) {
+	for_each_cpu(cpu) {
 		cpus_clear(per_cpu(cpu_sibling_map, cpu));
 		cpus_clear(per_cpu(cpu_core_map, cpu));
 	}