[x86-core2] "CPU ISA level is lower than required" issue with glibc 2.33
Romain Naour
romain.naour@gmail.com
Mon Feb 22 22:17:59 GMT 2021
Hello,
When testing glibc 2.33 with x86-core2 toolchain, the system doesn't boot due to
a kernel panic:
Run /sbin/init as init process
/lib/libc.so.6: CPU ISA level is lower than required
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
This is due to a new isa level check added by this commit:
"x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717]"
https://sourceware.org/git/?p=glibc.git;a=commit;h=ecce11aa0752735c4fd730da6e7c9e0b98e12fb8
Before the glibc version bump the Buildroot defconfig was working.
Here is the qemu command line used to boot the system:
qemu-system-i386 -M pc -cpu core2duo -kernel bzImage -drive
file=rootfs.ext2,if=virtio,format=raw -append 'rootwait root=/dev/vda
console=tty1 console=ttyS0' -net nic,model=virtio -net user -serial stdio
The boot succeed as soon as we use a newer microarchitecture like Broadwell,
Nehalem, SandyBridge, Skylake on the Qemu command line.
It seems l->l_x86_isa_1_needed and cpu_features->isa_1 [1] are not agree about
GNU_PROPERTY_X86_ISA_1_V2 when core2duo is used.
Indeed the gnu.propery report GNU_PROPERTY_X86_ISA_1_V2 in the libc binary:
$ readelf -n [...]/staging/lib/libc-2.33.so
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000010 NT_GNU_PROPERTY_TYPE_0
Properties: <procesor-specific type 0xc0008002 data: 03 00 00 00 >
This is because ISA_LEVEL is set with ISA_BASELINE and ISA_V2 [2]
But get_isa_level() doesn't use the same condition to detect
GNU_PROPERTY_X86_ISA_1_V2 [3]
If I remove the condition to define ISA_V2 with 0, the system boot.
$ readelf -n [...]/staging/lib/libc-2.33.so
Displaying notes found in: .note.gnu.property
Owner Data size Description
GNU 0x00000024 NT_GNU_PROPERTY_TYPE_0
Properties: <procesor-specific type 0xc0008002 data: 01 00 00 00 >
x86 feature used: x86, x87, XMM
<procesor-specific type 0xc0010002 data: 03 00 00 00 >
Here is the cpuinfo reported at runtime under Qemu with a working system:
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T7700 @ 2.40GHz
stepping : 11
microcode : 0x1
cpu MHz : 1991.966
cache size : 16384 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36
clflush acpi mmx fxsr sse sse2 syscall nx lm constant_tsc rep_good nopl cpuid
pni monitor ssse3 cx16 hypervisor lahf_lm pti
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs
itlb_multihit
bogomips : 3983.93
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
The issue doesn't seems specific to core2 architecture.
Can you have a look?
[1]
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/dl-prop.h;h=56bd020b3c0c2a96bce47fc9ce4665063becd2d6;hb=ecce11aa0752735c4fd730da6e7c9e0b98e12fb8#l53
[2]
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/isa-level.c;h=aaf524cb56c99cb43044fef3cac5b54f8d7dff9f;hb=ecce11aa0752735c4fd730da6e7c9e0b98e12fb8#l64
[3]
https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86/get-isa-level.h;h=a86e1e8941cc8f65e83b47ead6872fc823db8e16;hb=ecce11aa0752735c4fd730da6e7c9e0b98e12fb8#l38
Best regards,
Romain
More information about the Libc-alpha
mailing list