From patchwork Wed Sep 24 20:43:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 393113 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 2B7841401DB for ; Thu, 25 Sep 2014 06:47:38 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753812AbaIXUr3 (ORCPT ); Wed, 24 Sep 2014 16:47:29 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47904 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752603AbaIXUnm (ORCPT ); Wed, 24 Sep 2014 16:43:42 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6527FAD63; Wed, 24 Sep 2014 20:43:39 +0000 (UTC) From: Alexander Graf To: kvm-ppc@vger.kernel.org Cc: kvm@vger.kernel.org, pbonzini@redhat.com, Bharat Bhushan Subject: [PULL 06/24] KVM: PPC: BOOKE: Add one reg interface for DBSR Date: Wed, 24 Sep 2014 22:43:20 +0200 Message-Id: <1411591418-56061-7-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1411591418-56061-1-git-send-email-agraf@suse.de> References: <1411591418-56061-1-git-send-email-agraf@suse.de> Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org From: Bharat Bhushan Signed-off-by: Bharat Bhushan Signed-off-by: Alexander Graf --- arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kvm/booke.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index e0e49db..3ca357a 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h @@ -557,6 +557,7 @@ struct kvm_get_htab_header { #define KVM_REG_PPC_DABRX (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xb8) #define KVM_REG_PPC_WORT (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xb9) #define KVM_REG_PPC_SPRG9 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xba) +#define KVM_REG_PPC_DBSR (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbb) /* Transactional Memory checkpointed state: * This is all GPRs, all VSX regs and a subset of SPRs diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index e47de01..074b7fc 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c @@ -1494,6 +1494,9 @@ int kvm_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) case KVM_REG_PPC_DAC2: val = get_reg_val(reg->id, vcpu->arch.dbg_reg.dac2); break; + case KVM_REG_PPC_DBSR: + val = get_reg_val(reg->id, vcpu->arch.dbsr); + break; case KVM_REG_PPC_EPR: { u32 epr = kvmppc_get_epr(vcpu); val = get_reg_val(reg->id, epr); @@ -1564,6 +1567,9 @@ int kvm_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu, struct kvm_one_reg *reg) case KVM_REG_PPC_DAC2: vcpu->arch.dbg_reg.dac2 = set_reg_val(reg->id, val); break; + case KVM_REG_PPC_DBSR: + vcpu->arch.dbsr = set_reg_val(reg->id, val); + break; case KVM_REG_PPC_EPR: { u32 new_epr = set_reg_val(reg->id, val); kvmppc_set_epr(vcpu, new_epr);