From patchwork Sat Jul 11 01:19:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 6769621 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 11A35C05AC for ; Sat, 11 Jul 2015 01:22:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39EAD207F9 for ; Sat, 11 Jul 2015 01:22:17 +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 23C7C207F2 for ; Sat, 11 Jul 2015 01:22:16 +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 1ZDjSW-0000pX-7O; Sat, 11 Jul 2015 01:20:04 +0000 Received: from mailout4.w2.samsung.com ([211.189.100.14] helo=usmailout4.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZDjST-0000RR-8d for linux-arm-kernel@lists.infradead.org; Sat, 11 Jul 2015 01:20:02 +0000 Received: from uscpsbgex3.samsung.com (u124.gpu85.samsung.co.kr [203.254.195.124]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NRA00CQYUCPGH50@usmailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2015 21:19:38 -0400 (EDT) X-AuditID: cbfec37c-f796c6d000006809-f5-55a06f298ff9 Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex3.samsung.com (USCPEXMTA) with SMTP id 96.59.26633.92F60A55; Fri, 10 Jul 2015 21:19:37 -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 <0NRA00LBHUCP6ZF0@usmmp1.samsung.com>; Fri, 10 Jul 2015 21:19:37 -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; Fri, 10 Jul 2015 18:19:37 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org Subject: [PATCH v4 2/2] keep arm vfp/simd exit handling consistent with arm64 Date: Fri, 10 Jul 2015 18:19:07 -0700 Message-id: <1436577547-5646-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1436577547-5646-1-git-send-email-m.smarduch@samsung.com> References: <1436577547-5646-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.24.65] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t9hX13N/AWhBuenW1q8eP2P0WLO1EKL j6eOs1tsenyN1eLvnX9sDqwea+atYfS4c20Pm8f5TWuYPTYvqff4vEkugDWKyyYlNSezLLVI 3y6BK2PyvHXsBb+5Kz7uvMTWwLiOs4uRk0NCwETi863F7BC2mMSFe+vZuhi5OIQEljFKnHv+ jB3CaWKS+Ph2MQuEc4FRomn3AbAWNgFdif33NoLZIgKhEtf/NjKB2MwCGRKzn/4DiwsL+Er8 evmEFcRmEVCVaDzbyQZi8wq4SkxbuhZoKAfQagWJOZNsQMKcAm4SBx8uBisXAip5+PEII0S5 oMSPyffAypkFJCSef1aCKFGV2HbzOSPEFEWJeR+YJjAKzULSMAuhYQEj0ypGsdLi5ILipPTU CmO94sTc4tK8dL3k/NxNjJAQr9nBeO+rzSFGAQ5GJR7eALb5oUKsiWXFlbmHGCU4mJVEeOfI LwgV4k1JrKxKLcqPLyrNSS0+xCjNwaIkzishKRcqJJCeWJKanZpakFoEk2Xi4JRqYFxZVWCc 6ZfB3aiu2eSSI1m97cmXgtO+EkH7p9Utzj99/kte5fQKqyczRZ8L8UesvKIhfI9v/kSF94ob cvtuzLlSN9n0Y5hhv07IUc0zkS4/p2g2Zl7/d+lqouyayL9Pwm6+8NET/vz75sNFHfNtN05c qN3+dIvAzy+NsbqSXz/NbfGRW+sye58SS3FGoqEWc1FxIgCmzAEkbQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150710_182001_393605_4E7BADF0 X-CRM114-Status: GOOD ( 10.26 ) X-Spam-Score: -7.5 (-------) 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=-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, 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 568494d..900ef6d 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S @@ -361,10 +361,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. @@ -378,7 +374,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 */ @@ -409,6 +408,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 @@ -477,7 +480,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.