From patchwork Wed Aug 6 06:38:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bharat Bhushan X-Patchwork-Id: 4683801 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CC185C0338 for ; Wed, 6 Aug 2014 06:42:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F17DD20117 for ; Wed, 6 Aug 2014 06:42:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EFAE20115 for ; Wed, 6 Aug 2014 06:42:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754855AbaHFGmO (ORCPT ); Wed, 6 Aug 2014 02:42:14 -0400 Received: from mail-bl2lp0203.outbound.protection.outlook.com ([207.46.163.203]:4061 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754848AbaHFGmM (ORCPT ); Wed, 6 Aug 2014 02:42:12 -0400 Received: from BY2PR03CA070.namprd03.prod.outlook.com (10.141.249.43) by BY2PR03MB569.namprd03.prod.outlook.com (10.141.142.153) with Microsoft SMTP Server (TLS) id 15.0.995.14; Wed, 6 Aug 2014 06:41:50 +0000 Received: from BY2FFO11FD022.protection.gbl (2a01:111:f400:7c0c::101) by BY2PR03CA070.outlook.office365.com (2a01:111:e400:2c5d::43) with Microsoft SMTP Server (TLS) id 15.0.995.14 via Frontend Transport; Wed, 6 Aug 2014 06:41:50 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD022.mail.protection.outlook.com (10.1.15.211) with Microsoft SMTP Server (TLS) id 15.0.990.10 via Frontend Transport; Wed, 6 Aug 2014 06:41:50 +0000 Received: from kvm.ap.freescale.net (kvm.ap.freescale.net [10.232.14.24]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s766fVYE024194; Tue, 5 Aug 2014 23:41:48 -0700 From: Bharat Bhushan To: , CC: , , , Bharat Bhushan Subject: [PATCH 6/7 v3] KVM: PPC: BOOKE: Add one reg interface for DBSR Date: Wed, 6 Aug 2014 12:08:56 +0530 Message-ID: <1407307137-5083-7-git-send-email-Bharat.Bhushan@freescale.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1407307137-5083-1-git-send-email-Bharat.Bhushan@freescale.com> References: <1407307137-5083-1-git-send-email-Bharat.Bhushan@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(199002)(189002)(79102001)(229853001)(68736004)(104016003)(50226001)(107046002)(87286001)(87936001)(80022001)(46102001)(69596002)(76482001)(48376002)(50466002)(85306004)(20776003)(81156004)(47776003)(106466001)(64706001)(105606002)(77982001)(95666004)(81542001)(81342001)(77156001)(36756003)(19580395003)(84676001)(6806004)(44976005)(21056001)(83322001)(19580405001)(99396002)(88136002)(74502001)(83072002)(85852003)(104166001)(74662001)(31966008)(575784001)(86362001)(93916002)(26826002)(92726001)(92566001)(102836001)(62966002)(76176999)(97736001)(4396001)(50986999)(89996001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB569; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; LANG:; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID: X-Forefront-PRVS: 02951C14DC Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=Bharat.Bhushan@freescale.com; X-OriginatorOrg: freescale.com Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Bharat Bhushan --- v2->v3 - New patch 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);