From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: Fix wrong KVM_GET_LAPIC Date: Wed, 20 Aug 2008 10:10:57 +0300 Message-ID: <48ABC381.4090600@qumranet.com> References: <200808181115.40534.sheng.yang@intel.com> <200808201212.09946.amit.shah@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Yang, Sheng" , kvm@vger.kernel.org To: Amit Shah Return-path: Received: from il.qumranet.com ([212.179.150.194]:58521 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751990AbYHTHK7 (ORCPT ); Wed, 20 Aug 2008 03:10:59 -0400 In-Reply-To: <200808201212.09946.amit.shah@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: Amit Shah wrote: > * On Monday 18 Aug 2008 08:45:40 Yang, Sheng wrote: > >> From a8ca7dd8f5fe0125e7b7d0a21f5caddacd754911 Mon Sep 17 00:00:00 2001 >> From: Sheng Yang >> Date: Mon, 18 Aug 2008 11:04:22 +0800 >> Subject: [PATCH] KVM: Fix wrong KVM_GET_LAPIC >> >> Which caused migration fail in recent commits. >> >> Signed-off-by: Sheng Yang >> --- >> arch/x86/kvm/x86.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c >> index ee005a6..4a03375 100644 >> --- a/arch/x86/kvm/x86.c >> +++ b/arch/x86/kvm/x86.c >> @@ -1555,7 +1555,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp, >> if (r) >> goto out; >> r = -EFAULT; >> - if (copy_to_user(argp, &lapic, sizeof lapic)) >> + if (copy_to_user(argp, lapic, sizeof(struct kvm_lapic_state))) >> > > We're passing the structure instead of the pointer 'lapic' is now a pointer to a struct kvm_lapic_state. > and this leads to build > break with the tip on kvm.git. > > Builds for me. Please double check. > What's the point of this change anyway? > Fixing save/restore, which got broken by the stack usage reduction patches. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic.