From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 14/15] KVM: PPC: Add OSI hypercall interface Date: Tue, 09 Mar 2010 15:00:03 +0200 Message-ID: <4B964653.6010903@redhat.com> References: <1268071402-27112-1-git-send-email-agraf@suse.de> <1268071402-27112-15-git-send-email-agraf@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org To: Alexander Graf Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44243 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751857Ab0CINAH (ORCPT ); Tue, 9 Mar 2010 08:00:07 -0500 In-Reply-To: <1268071402-27112-15-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: On 03/08/2010 08:03 PM, Alexander Graf wrote: > MOL uses its own hypercall interface to call back into userspace when > the guest wants to do something. > > So let's implement that as an exit reason, specify it with a CAP and > only really use it when userspace wants us to. > > The only user of it so far is MOL. > > Signed-off-by: Alexander Graf > > --- > > v1 -> v2: > > - Add documentation for OSI exit struct > --- > Documentation/kvm/api.txt | 13 +++++++++++++ > arch/powerpc/include/asm/kvm_book3s.h | 5 +++++ > arch/powerpc/include/asm/kvm_host.h | 2 ++ > arch/powerpc/kvm/book3s.c | 24 ++++++++++++++++++------ > arch/powerpc/kvm/powerpc.c | 12 ++++++++++++ > include/linux/kvm.h | 6 ++++++ > 6 files changed, 56 insertions(+), 6 deletions(-) > > diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt > index 6a19ab6..b2129e8 100644 > --- a/Documentation/kvm/api.txt > +++ b/Documentation/kvm/api.txt > @@ -932,6 +932,19 @@ s390 specific. > > powerpc specific. > > + /* KVM_EXIT_OSI */ > + struct { > + __u64 gprs[32]; > + } osi; > + > +MOL uses a special hypercall interface it calls 'OSI'. To enable it, we catch > +hypercalls and exit with this exit struct that contains all the guest gprs. > + > +If exit_reason is KVM_EXIT_OSI, then the vcpu has triggered such a hypercall. > +Userspace can now handle the hypercall and when it's done modify the gprs as > +necessary. Upon guest entry all guest GPRs will then be replaced by the values > +in this struct. > + > That's migration unsafe. There may not be next guest entry on this host. Is using KVM_[GS]ET_REGS problematic for some reason? -- error compiling committee.c: too many arguments to function