From patchwork Sat Nov 9 11:05:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 289984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B03BF2C00C6 for ; Sat, 9 Nov 2013 22:06:07 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753336Ab3KILFy (ORCPT ); Sat, 9 Nov 2013 06:05:54 -0500 Received: from ozlabs.org ([203.10.76.45]:39114 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642Ab3KILF2 (ORCPT ); Sat, 9 Nov 2013 06:05:28 -0500 Received: from iris.au.ibm.com (ppp121-45-192-22.lns20.cbr1.internode.on.net [121.45.192.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPSA id 0969F2C00E3; Sat, 9 Nov 2013 22:05:21 +1100 (EST) From: Paul Mackerras To: Alexander Graf Cc: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Subject: [PATCH 13/15] KVM: PPC: Book3S HV: Add H_SET_MODE DAWR/X setting Date: Sat, 9 Nov 2013 22:05:01 +1100 Message-Id: <1383995103-24732-14-git-send-email-paulus@samba.org> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1383995103-24732-1-git-send-email-paulus@samba.org> References: <1383995103-24732-1-git-send-email-paulus@samba.org> Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Michael Neuling This add setting the DAWR/X via the H_SET_MODE hcall. This is set per vcpu. Signed-off-by: Michael Neuling --- arch/powerpc/kvm/book3s_hv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 0c309d9..3bafc6f 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c @@ -568,6 +568,16 @@ static int kvmppc_h_set_mode(struct kvm_vcpu *vcpu, unsigned long mflags, int n; switch (resource) { + case H_SET_MODE_RESOURCE_SET_DAWR: + if (!kvmppc_power8_compatible(vcpu)) + return H_P2; + if (mflags) + return H_UNSUPPORTED_FLAG_START; + if (value2 & DABRX_HYP) + return H_P4; + vcpu->arch.dawr = value1; + vcpu->arch.dawrx = value2; + return H_SUCCESS; case H_SET_MODE_RESOURCE_ADDR_TRANS_MODE: if (!kvmppc_power8_compatible(vcpu)) return H_P2;