public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM: Fix wrong KVM_GET_LAPIC
@ 2008-08-18  3:15 Yang, Sheng
  2008-08-18 10:08 ` Avi Kivity
  2008-08-20  6:42 ` Amit Shah
  0 siblings, 2 replies; 5+ messages in thread
From: Yang, Sheng @ 2008-08-18  3:15 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

From a8ca7dd8f5fe0125e7b7d0a21f5caddacd754911 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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 <sheng.yang@intel.com>
---
 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)))
 			goto out;
 		r = 0;
 		break;
--
1.5.4.5


[-- Attachment #2: 0001-KVM-Fix-wrong-KVM_GET_LAPIC.patch --]
[-- Type: text/x-diff, Size: 807 bytes --]

From a8ca7dd8f5fe0125e7b7d0a21f5caddacd754911 Mon Sep 17 00:00:00 2001
From: Sheng Yang <sheng.yang@intel.com>
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 <sheng.yang@intel.com>
---
 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)))
 			goto out;
 		r = 0;
 		break;
-- 
1.5.4.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: Fix wrong KVM_GET_LAPIC
  2008-08-18  3:15 [PATCH] KVM: Fix wrong KVM_GET_LAPIC Yang, Sheng
@ 2008-08-18 10:08 ` Avi Kivity
  2008-08-20  6:42 ` Amit Shah
  1 sibling, 0 replies; 5+ messages in thread
From: Avi Kivity @ 2008-08-18 10:08 UTC (permalink / raw)
  To: Yang, Sheng; +Cc: kvm

Yang, Sheng wrote:
> From a8ca7dd8f5fe0125e7b7d0a21f5caddacd754911 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang@intel.com>
> Date: Mon, 18 Aug 2008 11:04:22 +0800
> Subject: [PATCH] KVM: Fix wrong KVM_GET_LAPIC
>
> Which caused migration fail in recent commits.
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: Fix wrong KVM_GET_LAPIC
  2008-08-18  3:15 [PATCH] KVM: Fix wrong KVM_GET_LAPIC Yang, Sheng
  2008-08-18 10:08 ` Avi Kivity
@ 2008-08-20  6:42 ` Amit Shah
  2008-08-20  7:10   ` Avi Kivity
  1 sibling, 1 reply; 5+ messages in thread
From: Amit Shah @ 2008-08-20  6:42 UTC (permalink / raw)
  To: Yang, Sheng; +Cc: Avi Kivity, kvm

* On Monday 18 Aug 2008 08:45:40 Yang, Sheng wrote:
> From a8ca7dd8f5fe0125e7b7d0a21f5caddacd754911 Mon Sep 17 00:00:00 2001
> From: Sheng Yang <sheng.yang@intel.com>
> 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 <sheng.yang@intel.com>
> ---
>  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 and this leads to build 
break with the tip on kvm.git.

What's the point of this change anyway?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: Fix wrong KVM_GET_LAPIC
  2008-08-20  6:42 ` Amit Shah
@ 2008-08-20  7:10   ` Avi Kivity
  2008-08-20  9:17     ` Amit Shah
  0 siblings, 1 reply; 5+ messages in thread
From: Avi Kivity @ 2008-08-20  7:10 UTC (permalink / raw)
  To: Amit Shah; +Cc: Yang, Sheng, kvm

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 <sheng.yang@intel.com>
>> 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 <sheng.yang@intel.com>
>> ---
>>  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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] KVM: Fix wrong KVM_GET_LAPIC
  2008-08-20  7:10   ` Avi Kivity
@ 2008-08-20  9:17     ` Amit Shah
  0 siblings, 0 replies; 5+ messages in thread
From: Amit Shah @ 2008-08-20  9:17 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Yang, Sheng, kvm

* On Wednesday 20 Aug 2008 12:40:57 Avi Kivity wrote:
> 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 <sheng.yang@intel.com>
> >> 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 <sheng.yang@intel.com>
> >> ---
> >>  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.

Looks like some git problem; git pull from your repo into my branch says 
everything is uptodate (git merge also says the same thing). However, my 
branch still has the older struct (where lapic is not a pointer). git log 
shows the relevant commit. git checkout -f doesn't help either. I'm still to 
figure out how to resolve this.

> > 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.

Thanks; without the stack reduction patch, this just looked to me like adding 
a build break and not changing anything else.

Amit.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-08-20  9:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-18  3:15 [PATCH] KVM: Fix wrong KVM_GET_LAPIC Yang, Sheng
2008-08-18 10:08 ` Avi Kivity
2008-08-20  6:42 ` Amit Shah
2008-08-20  7:10   ` Avi Kivity
2008-08-20  9:17     ` Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox