From patchwork Tue Jun 16 21:50:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 6620641 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DE0F1C0020 for ; Tue, 16 Jun 2015 21:54:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1649820804 for ; Tue, 16 Jun 2015 21:54:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2765620801 for ; Tue, 16 Jun 2015 21:54:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4ymg-00066n-1D; Tue, 16 Jun 2015 21:52:42 +0000 Received: from mailout1.w2.samsung.com ([211.189.100.11] helo=usmailout1.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Z4ymP-0005rJ-1z for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2015 21:52:25 +0000 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQ200HUC4QRKL30@mailout1.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 16 Jun 2015 17:52:03 -0400 (EDT) X-AuditID: cbfec37b-f79926d0000060e9-47-55809a830ee7 Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id 9A.25.24809.38A90855; Tue, 16 Jun 2015 17:52:03 -0400 (EDT) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQ200BMK4QR6X30@usmmp1.samsung.com>; Tue, 16 Jun 2015 17:52:03 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.145.24.31) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 16 Jun 2015 14:52:02 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org Subject: [PATCH v2 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64 Date: Tue, 16 Jun 2015 14:50:52 -0700 Message-id: <1434491452-19177-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1434491452-19177-1-git-send-email-m.smarduch@samsung.com> References: <1434491452-19177-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.24.31] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t9hX93mWQ2hBmemGVq8X9bDaPHi9T9G izlTCy0+njrObrHp8TVWi793/rFZvPx4gsWB3WPNvDWMHneu7WHzOL9pDbPH5iX1Hp83yQWw RnHZpKTmZJalFunbJXBlPL20hKVgDlfFxdNrWRoYZ3B0MXJySAiYSHSums4CYYtJXLi3nq2L kYtDSGAZo8TiA+tZIJwmJokbhw4wQzgXGCX23rzLDtLCJqArsf/eRjBbRCBU4vrfRiYQm1lg BqNEa2seiC0sECmxYfth1i5GDg4WAVWJ/nXeIGFeATeJY8ufsoOEJQQUJOZMsgEJcwq4SzTc XAs2UQioZNrP34wQ5YISPybfYwEpZxaQkHj+WQmiRFVi283njBD3K0rcOj+faQKj0CwkHbMQ OhYwMq1iFCstTi4oTkpPrTDSK07MLS7NS9dLzs/dxAgJ++odjHe/2hxiFOBgVOLhnWneECrE mlhWXJl7iFGCg1lJhDd8MlCINyWxsiq1KD++qDQntfgQozQHi5I47x0JuVAhgfTEktTs1NSC 1CKYLBMHp1QDo9OShJik29fUD/oqOcc4nXVgeT7xg+cVx3f9X3tXMd5glezf+PlpeLokt441 f8L1RqsvwcuUrrsdXjst/sqHY5+OvlM11T4ttnRDfU1AeUG09PXevY3Cqm018ZO/nW7NqWNL POneq2Ksc+g969+talVrHNW2r1Tv80gp6HJN3PLkLfutu+X1SizFGYmGWsxFxYkAaiaQ+HcC AAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150616_145225_228016_1F1F36BE X-CRM114-Status: UNSURE ( 7.05 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) Cc: catalin.marinas@arm.com, will.deacon@arm.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Mario Smarduch X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 After enhancing arm64 FP/SIMD exit handling, FP/SIMD exit branch is moved to guest trap handling. This keeps exiting handling flow between both architectures consistent. Signed-off-by: Mario Smarduch --- arch/arm/kvm/interrupts.S | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index 79caf79..fca2c56 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S @@ -363,10 +363,6 @@ hyp_hvc: @ Check syndrome register mrc p15, 4, r1, c5, c2, 0 @ HSR lsr r0, r1, #HSR_EC_SHIFT -#ifdef CONFIG_VFPv3 - cmp r0, #HSR_EC_CP_0_13 - beq switch_to_guest_vfp -#endif cmp r0, #HSR_EC_HVC bne guest_trap @ Not HVC instr. @@ -406,6 +402,12 @@ THUMB( orr lr, #1) 1: eret guest_trap: +#ifdef CONFIG_VFPv3 + /* Guest accessed VFP/SIMD registers, save host, restore Guest */ + cmp r0, #HSR_EC_CP_0_13 + beq switch_to_guest_fpsimd +#endif + load_vcpu @ Load VCPU pointer to r0 str r1, [vcpu, #VCPU_HSR] @@ -478,7 +480,7 @@ guest_trap: * inject an undefined exception to the guest. */ #ifdef CONFIG_VFPv3 -switch_to_guest_vfp: +switch_to_guest_fpsimd: load_vcpu @ Load VCPU pointer to r0 push {r3-r7}