Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

xen: fix incorrect vcpu_register_vcpu_info hypercall argument

The kernel's copy of struct vcpu_register_vcpu_info was out of date,
at best causing the hypercall to fail and the guest kernel to fall
back to the old mechanism, or worse, causing random memory corruption.

[ Stable folks: applies to 2.6.23 ]

Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Stable Kernel <stable@kernel.org>
Cc: Morten =?utf-8?q?B=C3=B8geskov?= <xen-users@morten.bogeskov.dk>
Cc: Mark Williamson <mark.williamson@cl.cam.ac.uk>

authored by

Jeremy Fitzhardinge and committed by
Jeremy Fitzhardinge
e3d26976 fb1d8404

+4 -3
+1 -1
arch/x86/xen/enlighten.c
··· 113 113 info.mfn = virt_to_mfn(vcpup); 114 114 info.offset = offset_in_page(vcpup); 115 115 116 - printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %x, offset %d\n", 116 + printk(KERN_DEBUG "trying to map vcpu_info %d at %p, mfn %llx, offset %d\n", 117 117 cpu, vcpup, info.mfn, info.offset); 118 118 119 119 /* Check to see if the hypervisor will put the vcpu_info
+3 -2
include/xen/interface/vcpu.h
··· 160 160 */ 161 161 #define VCPUOP_register_vcpu_info 10 /* arg == struct vcpu_info */ 162 162 struct vcpu_register_vcpu_info { 163 - uint32_t mfn; /* mfn of page to place vcpu_info */ 164 - uint32_t offset; /* offset within page */ 163 + uint64_t mfn; /* mfn of page to place vcpu_info */ 164 + uint32_t offset; /* offset within page */ 165 + uint32_t rsvd; /* unused */ 165 166 }; 166 167 167 168 #endif /* __XEN_PUBLIC_VCPU_H__ */