瀏覽代碼

xen/enlighten: Fix compile warnings and set cx to known value.

We get:
linux/arch/x86/xen/enlighten.c: In function ‘xen_start_kernel’:
linux/arch/x86/xen/enlighten.c:226: warning: ‘cx’ may be used uninitialized in this function
linux/arch/x86/xen/enlighten.c:240: note: ‘cx’ was declared here

and the cx is really not set but passed in the xen_cpuid instruction
which masks the value with returned masked_ecx from cpuid. This
can potentially lead to invalid data being stored in cx.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Konrad Rzeszutek Wilk 13 年之前
父節點
當前提交
5e28783013
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      arch/x86/xen/enlighten.c

+ 1 - 0
arch/x86/xen/enlighten.c

@@ -251,6 +251,7 @@ static void __init xen_init_cpuid_mask(void)
 			~((1 << X86_FEATURE_APIC) |  /* disable local APIC */
 			~((1 << X86_FEATURE_APIC) |  /* disable local APIC */
 			  (1 << X86_FEATURE_ACPI));  /* disable ACPI */
 			  (1 << X86_FEATURE_ACPI));  /* disable ACPI */
 	ax = 1;
 	ax = 1;
+	cx = 0;
 	xen_cpuid(&ax, &bx, &cx, &dx);
 	xen_cpuid(&ax, &bx, &cx, &dx);
 
 
 	xsave_mask =
 	xsave_mask =