From patchwork Thu Jul 16 21:29:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 6811561 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C5B029F2E8 for ; Thu, 16 Jul 2015 21:33:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EAC4D20684 for ; Thu, 16 Jul 2015 21:33:21 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1A477205F4 for ; Thu, 16 Jul 2015 21:33:21 +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 1ZFqk2-0000Fs-9e; Thu, 16 Jul 2015 21:30:54 +0000 Received: from mailout3.w2.samsung.com ([211.189.100.13] helo=usmailout3.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZFqjn-00008y-Mo for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2015 21:30:40 +0000 Received: from uscpsbgex4.samsung.com (u125.gpu85.samsung.co.kr [203.254.195.125]) by usmailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRL004T7NQRSL60@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2015 17:30:27 -0400 (EDT) X-AuditID: cbfec37d-f79746d0000068cf-e6-55a82273fb5b Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex4.samsung.com (USCPEXMTA) with SMTP id 2F.D1.26831.37228A55; Thu, 16 Jul 2015 17:30:27 -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 <0NRL0063LNQQY870@usmmp1.samsung.com>; Thu, 16 Jul 2015 17:30:27 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.145.24.65) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Thu, 16 Jul 2015 14:30:26 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org Subject: [PATCH v4 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64 Date: Thu, 16 Jul 2015 14:29:38 -0700 Message-id: <1437082178-11039-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1437082178-11039-1-git-send-email-m.smarduch@samsung.com> References: <1437082178-11039-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.24.65] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrJLMWRmVeSWpSXmKPExsVy+t9hX91ipRWhBvP/CFq8eP2P0WLO1EKL j6eOs1tsenyN1eLvnX9sDqwea+atYfS4c20Pm8f5TWuYPTYvqff4vEkugDWKyyYlNSezLLVI 3y6BK+Nm13LWgt/cFc9mf2VuYFzH2cXIySEhYCLRc/84M4QtJnHh3nq2LkYuDiGBZYwSl6a/ Y4ZwmpgkHry9zwLhXGCUmHT3AitIC5uArsT+exvZQWwRgVCJ638bmUBsZoEMidlP/4HFhQUi JTY8uc4CYrMIqEr8WHcUzOYVcJNYtu8BkM0BtFpBYs4kG5Awp4C7xJYpq9lBwkJAJSvmV0JU C0r8mHwPrJpZQELi+WclkLAQ0MBtN58zQgxRlJj3gWkCo9AsJA2zEBoWMDKtYhQrLU4uKE5K T60w0StOzC0uzUvXS87P3cQICfDaHYz3v9ocYhTgYFTi4eX4vSxUiDWxrLgy9xCjBAezkgjv LP4VoUK8KYmVValF+fFFpTmpxYcYpTlYlMR5IyTlQoUE0hNLUrNTUwtSi2CyTBycUg2MJY+K uwTWrmwtLvyoa1pwpXb5CaO0GWXrdIx6J6eckVbMiLrw0OfBkUC+9jUBR2Zvc/36/xm/ecSu T8GeJRt/bvz15/DpQ7ci12R+Mm09N5FVhTlNmfnSbJkGxruz802ezWpq1xMqFfgctOqwtOGH 2ckrZjBmdwTt/jCxqGE95/OtIk/zOAJ4lFiKMxINtZiLihMBxCP4zmwCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150716_143039_823451_5BE40E74 X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -8.2 (--------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, Mario Smarduch Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.5 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, ARMv7 VFP exit branch is moved to guest trap handling. This allows us to keep exit handling flow between both architectures consistent. Signed-off-by: Mario Smarduch --- arch/arm/kvm/interrupts.S | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index 79caf79..b245b4e 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. @@ -380,7 +376,10 @@ hyp_hvc: cmp r2, #0 bne guest_trap @ Guest called HVC -host_switch_to_hyp: + /* + * Getting here means host called HVC, we shift parameters and branch + * to Hyp function. + */ pop {r0, r1, r2} /* Check for __hyp_get_vectors */ @@ -411,6 +410,10 @@ guest_trap: @ Check if we need the fault information lsr r1, r1, #HSR_EC_SHIFT +#ifdef CONFIG_VFPv3 + cmp r1, #HSR_EC_CP_0_13 + beq switch_to_guest_vfp +#endif cmp r1, #HSR_EC_IABT mrceq p15, 4, r2, c6, c0, 2 @ HIFAR beq 2f @@ -479,7 +482,6 @@ guest_trap: */ #ifdef CONFIG_VFPv3 switch_to_guest_vfp: - load_vcpu @ Load VCPU pointer to r0 push {r3-r7} @ NEON/VFP used. Turn on VFP access.