From: Sasha Levin Subject: [RFC 01/10] KVM: reintroduce hc_gpa Date: Wed, 6 Jun 2012 13:00:09 +0200 Message-ID: <1338980418-2519-1-git-send-email-levinsasha928@gmail.com> Cc: kvm@vger.kernel.org, Sasha Levin To: avi@redhat.com, mtosatti@redhat.com, gregkh@linuxfoundation.org, sjenning@linux.vnet.ibm.com, dan.magenheimer@oracle.com, konrad.wilk@oracle.com Return-path: Received: from mail-ob0-f174.google.com ([209.85.214.174]:45091 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751784Ab2FFK7Y (ORCPT ); Wed, 6 Jun 2012 06:59:24 -0400 Received: by obbtb18 with SMTP id tb18so10130959obb.19 for ; Wed, 06 Jun 2012 03:59:23 -0700 (PDT) Sender: kvm-owner@vger.kernel.org List-ID: While PV MMU is dead and gone, we'll still want to pass gpa from guest to host, and to do that properly we'll need to revive hc_gpa which died during the great PV MMU massacre of 3.2. Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 185a2b8..675dfb8 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -4993,6 +4993,15 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) return 1; } +static inline gpa_t hc_gpa(struct kvm_vcpu *vcpu, unsigned long a0, + unsigned long a1) +{ + if (is_long_mode(vcpu)) + return a0; + else + return a0 | ((gpa_t)a1 << 32); +} + int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) { unsigned long nr, a0, a1, a2, a3, ret; -- 1.7.8.6