Skip to contentSkip to conversation

-cpu host breaks linux guest boot

Qemu-devel Luiz Capitulino 4 participants 8 messages Nov 24, 2011 – Nov 28, 2011

lore
Share & tools
lore
#0 lore raw

Avi,

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity <[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Not sure if this is important, but here's procinfo information about one of my host's cpus:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz
stepping : 6
cpu MHz : 2801.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5585.87
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

#1 lore raw
Quoted 2 lines · Luiz Capitulino

Avi,

I have the same panic and the same bisection result. It doesn't happen with recent (3.2.0 rc1 and rc3) kernels.

Quoted 51 lines

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity <[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Not sure if this is important, but here's procinfo information about one of my host's cpus:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz
stepping : 6
cpu MHz : 2801.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5585.87
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

#2 lore raw
Quoted 6 lines · On Fri, 25 Nov 2011 16:12:37 +0200 Alon Levy <[email protected]> wrote:
Quoted 2 lines · Luiz Capitulino

Avi,

I have the same panic and the same bisection result. It doesn't happen with recent (3.2.0 rc1 and rc3) kernels.

Would be nice to test a recent kernel with 66e3dd9 reverted. It'll be funny if it fails :)

Quoted 53 lines
Quoted 52 lines

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity <[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Not sure if this is important, but here's procinfo information about one of my host's cpus:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz
stepping : 6
cpu MHz : 2801.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5585.87
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

#3 lore raw
Quoted 4 lines · Luiz Capitulino
Quoted 1 line · On Fri, 25 Nov 2011 16:12:37 +0200 Alon Levy <[email protected]> wrote:

On Thu, Nov 24, 2011 at 04:03:55PM -0200, Luiz Capitulino wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Avi,

I have the same panic and the same bisection result. It doesn't happen with recent (3.2.0 rc1 and rc3) kernels.

Would be nice to test a recent kernel with 66e3dd9 reverted. It'll be funny if it fails :)

It doesn't - a recent kernel doesn't care. I'm using 3.2.0-rc3 (f1e652b).

With 66e3dd9 reverted:
3.2.0 (66e3dd9 but also an rc1 commit I used before rebasing yesterday)
passes
3.1.0-5 passes
3.1.1-1 passes

Normally (not reverted):
3.2.0 (66e3dd9) passes
3.1.0-5 fails
3.1.1-1 fails

Quoted 55 lines
Quoted 54 lines
Quoted 53 lines

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity <[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Not sure if this is important, but here's procinfo information about one of my host's cpus:

processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 23
model name : Intel(R) Core(TM)2 Duo CPU T9600 @ 2.80GHz
stepping : 6
cpu MHz : 2801.000
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm tpr_shadow vnmi flexpriority
bogomips : 5585.87
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

#4 lore raw
In reply to Luiz Capitulino
Quoted 16 lines · Luiz Capitulino

Avi,

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13
Quoted 9 lines

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity <[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Strange, since it looks like cpuid 1 (ebx) returns the correct APIC ID.

Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about.

Signature · 1 line
error compiling committee.c: too many arguments to function
#5 lore raw
Quoted 24 lines · Avi Kivity
Quoted 23 lines · Luiz Capitulino

Avi,

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity<[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200
Quoted 8 lines
Quoted 2 lines

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Strange, since it looks like cpuid 1 (ebx) returns the correct APIC ID.

Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about.

Ack.

Regards,

Anthony Liguori

Quoted 1 line
#6 lore raw
Quoted 28 lines · On Sun, 27 Nov 2011 11:13:59 -0600 Anthony Liguori <[email protected]>…
Quoted 27 lines · Avi Kivity
Quoted 25 lines · Luiz Capitulino

Avi,

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity<[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Quoted 7 lines
Quoted 5 lines

Strange, since it looks like cpuid 1 (ebx) returns the correct APIC ID.

Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about.

Ack.

Anthony, are you going to revert it yourself or do you prefer a patch? I can provide it if needed...

Quoted 7 lines

Regards,

Anthony Liguori

Quoted 1 line
#7 lore raw
Quoted 33 lines · Luiz Capitulino
Quoted 30 lines · On Sun, 27 Nov 2011 11:13:59 -0600 Anthony Liguori<[email protected]>…
Quoted 29 lines · Avi Kivity
Quoted 16 lines · Luiz Capitulino

Avi,

I'm getting the following panic very early on boot on a F16 VM (latest qemu.git head 40897c9):

[    0.068018] Kernel panic - not syncing: Boot APIC ID in local APIC unexpected (-1 vs 0)
[    0.070006] Pid: 1, comm: swapper Not tainted 3.1.0-7.fc16.x86_64 #1
[    0.071004] Call Trace:
[    0.072035]  [<ffffffff814acb8e>] panic+0x91/0x1a5
[    0.073027]  [<ffffffff81b831ca>] native_smp_prepare_cpus+0x24c/0x300
[    0.075010]  [<ffffffff81b76c0d>] kernel_init+0x85/0x158
[    0.075993]  [<ffffffff810527eb>] ? schedule_tail+0x27/0x6c
[    0.076017]  [<ffffffff814be5f4>] kernel_thread_helper+0x4/0x10
[    0.077022]  [<ffffffff81b76b88>] ? start_kernel+0x3b6/0x3b6
[    0.078009]  [<ffffffff814be5f0>] ? gs_change+0x13/0x13
Quoted 9 lines

After some debugging and I found out that this only happens when '-cpu host' is passed, and according to git bisect it's caused by the following commit:

commit 66e3dd9282141b5ae75637c9676002cf3ceeb988

Author: Avi Kivity<[email protected]>
Date:   Wed Nov 9 15:44:36 2011 +0200

i386: derive '-cpu host' from KVM_GET_SUPPORTED_CPUID

Strange, since it looks like cpuid 1 (ebx) returns the correct APIC ID.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Anthony, I think we should revert that commit and refactor cpuid for 1.1. The logic is spread over too many places which makes it hard to reason about.

Ack.

Anthony, are you going to revert it yourself or do you prefer a patch? I can provide it if needed...

I'll revert it.

Regards,

Anthony Liguori

Quoted 9 lines
Quoted 8 lines

Regards,

Anthony Liguori

Quoted 1 line