diff mbox

[GIT,PULL] KVM fixes for 4.10 merge window

Message ID 0df8ceac-deeb-d3c2-630c-30f84d363873@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

xinhui Dec. 17, 2016, 3:09 a.m. UTC
在 2016/12/17 03:42, Linus Torvalds 写道:
> On Fri, Dec 16, 2016 at 8:57 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>   git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus
>
> This piece-of-shit branch has obviously never been even compile-tested:
>
>   arch/x86/kernel/kvm.c: In function ‘__kvm_vcpu_is_preempted’:
>   arch/x86/kernel/kvm.c:596:14: error: ‘struct kvm_steal_time’ has no
> member named ‘preempted’
>
hi, Linus
	oh, my bad also. I introduce this struct member and use it in same patch.
Better to separate tem into two patches. I make one fix patch below. sorry again.

Hi, Paolo
	I have known where is th problem, I think if we can set this ->preempted later after preempted_enable()
or just introduce something like write_guest_nosleep (per cpu memory section in guest, so there is no page_fault or any other cannot sleep problems)?

thanks
xinhui
-----------------
 From d4fa3ea0b8b6f3e5ff511604a4a6665d1cbb74c3 Mon Sep 17 00:00:00 2001
From: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Date: Sat, 17 Dec 2016 02:56:33 -0500
Subject: [PATCH] kvm: fix compile issue

we revert commit 0b9f6c4615c993d2b552e0d2bd1ade49b56e5beb which calls
sleep function while preempt_disable on host part. But we remove struct
kvm_steal_time::preempted too. This casues compile problem as both guest
and host code use it.

Fix it by adding struct kvm_steal_time::preempted back.

Signed-off-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
---
  arch/x86/include/uapi/asm/kvm_para.h | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Paolo Bonzini Dec. 17, 2016, 8:24 a.m. UTC | #1
----- Original Message -----
> From: "Pan Xinhui" <xinhui@linux.vnet.ibm.com>
> To: "Linus Torvalds" <torvalds@linux-foundation.org>, "Paolo Bonzini" <pbonzini@redhat.com>
> Cc: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>, "Radim Krčmář" <rkrcmar@redhat.com>, "KVM list"
> <kvm@vger.kernel.org>
> Sent: Saturday, December 17, 2016 4:09:16 AM
> Subject: Re: [GIT PULL] KVM fixes for 4.10 merge window
> 
> 
> 
> 在 2016/12/17 03:42, Linus Torvalds 写道:
> > On Fri, Dec 16, 2016 at 8:57 AM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >>
> >>   git://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus
> >
> > This piece-of-shit branch has obviously never been even compile-tested:
> >
> >   arch/x86/kernel/kvm.c: In function ‘__kvm_vcpu_is_preempted’:
> >   arch/x86/kernel/kvm.c:596:14: error: ‘struct kvm_steal_time’ has no
> > member named ‘preempted’
> >
> hi, Linus
> 	oh, my bad also. I introduce this struct member and use it in same patch.
> Better to separate tem into two patches. I make one fix patch below. sorry
> again.

Hi Xinhui, don't worry it's purely my fault. :)

> 	I have known where is th problem, I think if we can set this ->preempted
> 	later after preempted_enable()
> or just introduce something like write_guest_nosleep (per cpu memory section
> in guest, so there is no page_fault or any other cannot sleep problems)?

Yes there is already kvm_read_guest_inatomic, we can add an equivalent one
for writes.  It will be for 4.11 anyway, so there's time.

Paolo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/x86/include/uapi/asm/kvm_para.h b/arch/x86/include/uapi/asm/kvm_para.h
index 94dc8ca..1421a65 100644
--- a/arch/x86/include/uapi/asm/kvm_para.h
+++ b/arch/x86/include/uapi/asm/kvm_para.h
@@ -45,7 +45,9 @@  struct kvm_steal_time {
  	__u64 steal;
  	__u32 version;
  	__u32 flags;
-	__u32 pad[12];
+	__u8  preempted;
+	__u8  u8_pad[3];
+	__u32 pad[11];
  };
  
  #define KVM_STEAL_ALIGNMENT_BITS 5