Message ID | 1483943091-1364-21-git-send-email-jintack@cs.columbia.edu (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56AA460757 for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:32:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44DFE2808F for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:32:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 371182811C; Mon, 9 Jan 2017 06:32:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C0A932808F for <patchwork-linux-arm@patchwork.kernel.org>; Mon, 9 Jan 2017 06:32:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cQTVh-0004nb-HD; Mon, 09 Jan 2017 06:32:49 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQTPY-0002bh-GP for linux-arm-kernel@bombadil.infradead.org; Mon, 09 Jan 2017 06:26:28 +0000 Received: from outprodmail02.cc.columbia.edu ([128.59.72.51]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cQTPV-0005EM-Sr for linux-arm-kernel@lists.infradead.org; Mon, 09 Jan 2017 06:26:27 +0000 Received: from hazelnut (hazelnut.cc.columbia.edu [128.59.213.250]) by outprodmail02.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v096Od09005146 for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:25:59 -0500 Received: from hazelnut (localhost.localdomain [127.0.0.1]) by hazelnut (Postfix) with ESMTP id 675AE80 for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:25:59 -0500 (EST) Received: from sendprodmail03.cc.columbia.edu (sendprodmail03.cc.columbia.edu [128.59.72.15]) by hazelnut (Postfix) with ESMTP id 3F4D888 for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:25:59 -0500 (EST) Received: from mail-qk0-f200.google.com (mail-qk0-f200.google.com [209.85.220.200]) by sendprodmail03.cc.columbia.edu (8.14.4/8.14.4) with ESMTP id v096Pxe4056986 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for <linux-arm-kernel@lists.infradead.org>; Mon, 9 Jan 2017 01:25:59 -0500 Received: by mail-qk0-f200.google.com with SMTP id x64so109015514qkb.5 for <linux-arm-kernel@lists.infradead.org>; Sun, 08 Jan 2017 22:25:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fqZch1u3aONP/+4lUVeo7g1fyxDeEV+8wy2L+wTgjqI=; b=BS1vu+Wj/LtURJkK7OgA3ojlRhoVKm6XwSPKswIdI85gZ3Ej4gDJQTFEkg5E3IPtQ3 NFWkXIMAootWK1IP+aF3M6+MqaJsLg1TKtSE9Mc+fG4G6zQX0xTr2c7LF9XIvkkZ+joF O3/DOhXkC8PMtdmcWZywwBO2h7/DYMidbj7AnVXZqQkic+0Tpu/ZOYfESdbHXQBY3yIY JNbRCcnaBYilrutInBprOeUas9Y4ikyYdl1G3J8atVsGabdSG5sIa+9ObUMzKqRxFdEY scbWl/R1zaVtUiSc/dJVZDA6k1muM2Y6nRVLddW3/iq86EkraUqnsQitmhAV3tVidIOP xduA== X-Gm-Message-State: AIkVDXK7JpfhB74MT6FFnIZcSbRhb9BTM7gUTR1HMxNvmk15E1akuj4Kr2ig8RD2fEZvf28E8dFKHISMOMNU9zYpEpWawTRJ1Zd15opR/2NiCyIYK2iEotq5bRSZVV7qbVuSQnjT8yLGfMtL88J6KHK2IZmGQzP2I99wcw== X-Received: by 10.200.56.76 with SMTP id r12mr77475925qtb.2.1483943158902; Sun, 08 Jan 2017 22:25:58 -0800 (PST) X-Received: by 10.200.56.76 with SMTP id r12mr77475898qtb.2.1483943158752; Sun, 08 Jan 2017 22:25:58 -0800 (PST) Received: from jintack.cs.columbia.edu ([2001:18d8:ffff:16:21a:4aff:feaa:f900]) by smtp.gmail.com with ESMTPSA id h3sm8623257qtc.6.2017.01.08.22.25.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 Jan 2017 22:25:57 -0800 (PST) From: Jintack Lim <jintack@cs.columbia.edu> To: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, rkrcmar@redhat.com, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, vladimir.murzin@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, james.morse@arm.com, lorenzo.pieralisi@arm.com, kevin.brodsky@arm.com, wcohen@redhat.com, shankerd@codeaurora.org, geoff@infradead.org, andre.przywara@arm.com, eric.auger@redhat.com, anna-maria@linutronix.de, shihwei@cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC 20/55] KVM: arm64: Forward CPACR_EL1 traps to the guest hypervisor Date: Mon, 9 Jan 2017 01:24:16 -0500 Message-Id: <1483943091-1364-21-git-send-email-jintack@cs.columbia.edu> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483943091-1364-1-git-send-email-jintack@cs.columbia.edu> References: <1483943091-1364-1-git-send-email-jintack@cs.columbia.edu> X-No-Spam-Score: Local X-Scanned-By: MIMEDefang 2.78 on 128.59.72.15 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170109_012626_228520_64EFF3A5 X-CRM114-Status: GOOD ( 11.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: jintack@cs.columbia.edu MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 321ecbc..e66f40d 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -951,6 +951,11 @@ static bool access_cpacr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, const struct sys_reg_desc *r) { + /* Forward this trap to the guest hypervisor if it expects */ + if (!vcpu_mode_el2(vcpu) && + (vcpu_el2_reg(vcpu, CPTR_EL2) & CPTR_EL2_TCPAC)) + return kvm_inject_nested_sync(vcpu, kvm_vcpu_get_hsr(vcpu)); + access_rw(p, &vcpu_sys_reg(vcpu, r->reg)); return true; }
Forward CPACR_EL1 traps to the guest hypervisor if it has configured the virtual CPTR_EL2 to do so. Signed-off-by: Jintack Lim <jintack@cs.columbia.edu> --- arch/arm64/kvm/sys_regs.c | 5 +++++ 1 file changed, 5 insertions(+)