From patchwork Tue Sep 22 23:34:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 7246301 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 38C37BEEC1 for ; Tue, 22 Sep 2015 23:38:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 677EC209B3 for ; Tue, 22 Sep 2015 23:38:09 +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 94E27209C6 for ; Tue, 22 Sep 2015 23:38:08 +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 1ZeX5Y-0007qI-8W; Tue, 22 Sep 2015 23:35:08 +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 1ZeX5L-00070y-Q5 for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 23:34:56 +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 <0NV300C08QTGBLC0@mailout1.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 22 Sep 2015 19:34:28 -0400 (EDT) X-AuditID: cbfec37b-f79926d0000060e9-17-5601e583739e Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id 0E.A8.24809.385E1065; Tue, 22 Sep 2015 19:34:28 -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 <0NV300AYSQTF90C0@usmmp1.samsung.com>; Tue, 22 Sep 2015 19:34:27 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.145.28.253) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 22 Sep 2015 16:34:27 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [RFT - PATCH v2 1/2] add hooks for armv8 fp/simd lazy switch Date: Tue, 22 Sep 2015 16:34:02 -0700 Message-id: <1442964843-11953-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1442964843-11953-1-git-send-email-m.smarduch@samsung.com> References: <1442964843-11953-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.28.253] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t9hX92Wp4xhBrc3s1m8eP2P0WLO1EKL j6eOs1tsenyN1eLvnX9sDqwea+atYfS4c20Pm8f5TWuYPTYvqff4vEkugDWKyyYlNSezLLVI 3y6BK+Pv8X7GghU8FbsbF7I2MB7k6mLk5JAQMJFofTGFEcIWk7hwbz1bFyMXh5DAMkaJL3/e s4IkhASamCS+n+aHSFxklHh04SNYB5uArsT+exvZQWwRgVCJKctfM4HYzAIZErOf/gOLCwu4 SnQdhqhhEVCVePbnGpjNK+AmMaXtJTvEZjmJk8cmgy3jFHCXWPR6JiPEYjeJ3et3skLUC0r8 mHyPpYuRA2i+hMTzz0oQJaoS224+ZwQJSwgoSezYrj2BUWgWkoZZCA0LGJlWMYqVFicXFCel p1YY6RUn5haX5qXrJefnbmKEhHj1Dsa7X20OMQpwMCrx8Hr0MYQJsSaWFVfmHmKU4GBWEuHV 28UYJsSbklhZlVqUH19UmpNafIhRmoNFSZz3joRcqJBAemJJanZqakFqEUyWiYNTqoFRdcKa ciG2paWeKRXlD0795pnGeUnjSOxz5mkR8jFP1l2PntDjKyphc8FJek4kW7DHz5IK0/dd31I/ Mp16uydRqMm2aObWBVtvzzD0/vfg9ayt7z2r/wesEPq/2YBvms7j50GSyl9CKwPq7PpruWxn HNXhr+/uOxX+taJyae9Va4Pe3aLz/+5SYinOSDTUYi4qTgQAfsYNFW0CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150922_163455_936925_8FA8B0DE X-CRM114-Status: GOOD ( 11.23 ) X-Spam-Score: -6.9 (------) 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.2 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 This patch adds hooks to support fp/simd lazy switch. A vcpu flag to track fp/simd state, and flag offset in vcpu structure. Signed-off-by: Mario Smarduch --- arch/arm64/include/asm/kvm_host.h | 3 +++ arch/arm64/kernel/asm-offsets.c | 1 + 2 files changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 415938d..f4665e5 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -161,6 +161,9 @@ struct kvm_vcpu_arch { /* Interrupt related fields */ u64 irq_lines; /* IRQ and FIQ levels */ + /* Track fp/simd lazy switch */ + u32 vfp_lazy; + /* Cache some mmu pages needed inside spinlock regions */ struct kvm_mmu_memory_cache mmu_page_cache; diff --git a/arch/arm64/kernel/asm-offsets.c b/arch/arm64/kernel/asm-offsets.c index 8d89cf8..8311da4 100644 --- a/arch/arm64/kernel/asm-offsets.c +++ b/arch/arm64/kernel/asm-offsets.c @@ -124,6 +124,7 @@ int main(void) DEFINE(VCPU_HCR_EL2, offsetof(struct kvm_vcpu, arch.hcr_el2)); DEFINE(VCPU_MDCR_EL2, offsetof(struct kvm_vcpu, arch.mdcr_el2)); DEFINE(VCPU_IRQ_LINES, offsetof(struct kvm_vcpu, arch.irq_lines)); + DEFINE(VCPU_VFP_LAZY, offsetof(struct kvm_vcpu, arch.vfp_lazy)); DEFINE(VCPU_HOST_CONTEXT, offsetof(struct kvm_vcpu, arch.host_cpu_context)); DEFINE(VCPU_HOST_DEBUG_STATE, offsetof(struct kvm_vcpu, arch.host_debug_state)); DEFINE(VCPU_TIMER_CNTV_CTL, offsetof(struct kvm_vcpu, arch.timer_cpu.cntv_ctl));