From patchwork Fri Jun 25 23:25:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 108178 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5PNPfRm001582 for ; Fri, 25 Jun 2010 23:25:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756877Ab0FYXZi (ORCPT ); Fri, 25 Jun 2010 19:25:38 -0400 Received: from cantor2.suse.de ([195.135.220.15]:54788 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756699Ab0FYXZU (ORCPT ); Fri, 25 Jun 2010 19:25:20 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) by mx2.suse.de (Postfix) with ESMTP id F120F89FC6; Sat, 26 Jun 2010 01:25:14 +0200 (CEST) From: Alexander Graf To: kvm-ppc@vger.kernel.org Cc: KVM list , linuxppc-dev Subject: [PATCH 15/26] KVM: PPC: Expose magic page support to guest Date: Sat, 26 Jun 2010 01:25:03 +0200 Message-Id: <1277508314-915-16-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1277508314-915-1-git-send-email-agraf@suse.de> References: <1277508314-915-1-git-send-email-agraf@suse.de> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 25 Jun 2010 23:25:42 +0000 (UTC) diff --git a/arch/powerpc/include/asm/kvm_para.h b/arch/powerpc/include/asm/kvm_para.h index c7305d7..9f8efa4 100644 --- a/arch/powerpc/include/asm/kvm_para.h +++ b/arch/powerpc/include/asm/kvm_para.h @@ -43,6 +43,8 @@ struct kvm_vcpu_arch_shared { #define KVM_SC_MAGIC_R3 0x4b564d52 /* "KVMR" */ #define KVM_SC_MAGIC_R4 0x554c455a /* "ULEZ" */ +#define KVM_FEATURE_MAGIC_PAGE 1 + #ifdef __KERNEL__ static inline int kvm_para_available(void) diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index fe7a1c8..1d28a81 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -60,8 +60,19 @@ int kvmppc_kvm_pv(struct kvm_vcpu *vcpu) } switch (nr) { + case KVM_HC_PPC_MAP_MAGIC_PAGE: + { + vcpu->arch.magic_page_pa = param1; + vcpu->arch.magic_page_ea = param2; + + r = 0; + break; + } case KVM_HC_FEATURES: r = 0; +#if !defined(CONFIG_KVM_440) /* XXX missing bits on 440 */ + r |= (1 << KVM_FEATURE_MAGIC_PAGE); +#endif break; default: r = -KVM_ENOSYS;