Sebastian Herbszt
2010-Mar-21 20:55 UTC
[syslinux] [PATCH] gpllib: fix call to CPUID function 4
Only call CPUID function 4 if cpuid_level indicates its availability. Signed-off-by: Sebastian Herbszt <herbszt at gmx.de> diff --git a/com32/gpllib/cpuid.c b/com32/gpllib/cpuid.c index fa21204..f33e895 100644 --- a/com32/gpllib/cpuid.c +++ b/com32/gpllib/cpuid.c @@ -232,8 +232,10 @@ void generic_identify(struct cpuinfo_x86 *c) } break; case X86_VENDOR_INTEL: - cpuid(0x4, &eax, &ebx, &ecx, &edx); - c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1; + if (c->cpuid_level >= 0x00000004) { + cpuid(0x4, &eax, &ebx, &ecx, &edx); + c->x86_num_cores = ((eax & 0xfc000000) >> 26) + 1; + } break; default: c->x86_num_cores = 1;