From patchwork Thu Jun 25 00:04:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 6671201 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 D3E339F380 for ; Thu, 25 Jun 2015 00:07:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F33652047D for ; Thu, 25 Jun 2015 00:07:40 +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 1C5D320453 for ; Thu, 25 Jun 2015 00:07:40 +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 1Z7ufl-0001RF-2O; Thu, 25 Jun 2015 00:05:41 +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 1Z7ufP-00006K-99 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2015 00:05:20 +0000 Received: from uscpsbgex4.samsung.com (u125.gpu85.samsung.co.kr [203.254.195.125]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQH00H2X486MR30@usmailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2015 20:04:54 -0400 (EDT) X-AuditID: cbfec37d-f79746d0000068cf-c2-558b45a67397 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex4.samsung.com (USCPEXMTA) with SMTP id 8E.F1.26831.6A54B855; Wed, 24 Jun 2015 20:04:54 -0400 (EDT) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NQH008UF486V260@usmmp2.samsung.com>; Wed, 24 Jun 2015 20:04:54 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.160.11.5) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 24 Jun 2015 17:04:53 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org Subject: [PATCH v3 2/2] arm: KVM: keep arm vfp/simd exit handling consistent with arm64 Date: Wed, 24 Jun 2015 17:04:12 -0700 Message-id: <1435190652-5831-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1435190652-5831-1-git-send-email-m.smarduch@samsung.com> References: <1435190652-5831-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.160.11.5] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrCLMWRmVeSWpSXmKPExsVy+t9hP91lrt2hBo/myFu8X9bDaPHi9T9G izlTCy0+njrObrHp8TVWi793/rFZvPx4gsWB3WPNvDWMHneu7WHzOL9pDbPH5iX1Hp83yQWw RnHZpKTmZJalFunbJXBlnLx6ibHgP3fFvXM9zA2MGzi7GDk5JARMJNYe7WWFsMUkLtxbz9bF yMUhJLCMUWLHzD2sEE4Tk8SmNfMZQaqEBM4zSmzYXANiswnoSuy/t5EdxBYRCJW4/reRCcRm FpjBKNHamgdiCwtESux8d4UNxGYRUJWYuPsW2DZeAVeJzX9eAdVzAG1WkJgzyQYkzCngJrHr yU9miFWuEvun3YQqF5T4MfkeC0g5s4CExPPPShAlqhLbbj5nhLhfQWLptZ2sExiFZiHpmIXQ sYCRaRWjWGlxckFxUnpqhYlecWJucWleul5yfu4mRkjY1+5gvP/V5hCjAAejEg9vhW13qBBr YllxZe4hRgkOZiUR3hwnoBBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeCEm5UCGB9MSS1OzU1ILU IpgsEwenVAOj/+OlZy1aigWnXPuUuffZQm0Ww6CPnJcX56/Yut5n2v+v84/ubjR4UNr8QGd9 7c2Tok7751RONBA+2ZDWqnvyWW0W69Vj8lGbp1rfbXF7opr5IZr1afHng3OM/NYKWT/vWHNL a9/HoP1NTW3nEmf0yZ/abzz75bfDTKrrjs4uu2CQ1yGnOD1okxJLcUaioRZzUXEiAJAJYW53 AgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150624_170519_455511_053F79F2 X-CRM114-Status: GOOD ( 11.10 ) X-Spam-Score: -8.3 (--------) 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=-5.6 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 Reviewed-by: Christoffer Dall --- 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.