xen: xen_init_cpuid_mask: Zero cx before calling xen_cpuid
Subsystems (2)
PATCH 1/1 xen: xen_init_cpuid_mask: Zero cx before calling xen_cpuid
CPUID function 1 doesn't use cx, but xen_cpuid doesn't know that, resulting in this warning:
arch/x86/xen/enlighten.c: In function ‘xen_start_kernel’:arch/x86/xen/enlighten.c:192: warning: ‘cx’ may be used uninitialized in this function arch/x86/xen/enlighten.c:205: note: ‘cx’ was declared here
Set cx = 0 to avoid this warning. This seems preferable to implementing a xen_cpuid_nocount without the input constraint for cx, and either of those seem preferable to just ignoring the warning.
---
Build-tested only.
arch/x86/xen/enlighten.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/x86/xen/enlighten.c +1 -0
@@ -215,6 +215,7 @@ static __init void xen_init_cpuid_mask(void) (1 << X86_FEATURE_ACPI)); /* disable ACPI */ ax =1 ; + cx =0 ;xen_cpuid (&ax, &bx, &cx, &dx);/* cpuid claims we support xsave; try enabling it to see what happens */
Signature · 1 line
1.5.6.5
Jeremy Fitzhardinge
AppliedQuoted 11 lines · Josh Triplett
CPUID function 1 doesn't use cx, but
xen_cpuiddoesn't know that, resulting in this warning:
arch/x86/xen/enlighten.c: In function ‘xen_start_kernel’:arch/x86/xen/enlighten.c:192: warning: ‘cx’ may be used uninitialized in this functionarch/x86/xen/enlighten.c:205: note: ‘cx’ was declared hereSet cx = 0 to avoid this warning. This seems preferable to implementing a
xen_cpuid_nocountwithout the input constraint for cx, and either of those seem preferable to just ignoring the warning.
Thanks, applied.
J