From patchwork Tue Oct 6 02:33:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 7333091 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 260A89F2F7 for ; Tue, 6 Oct 2015 02:36:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 466E8206E7 for ; Tue, 6 Oct 2015 02:36:57 +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 24E16206D6 for ; Tue, 6 Oct 2015 02:36:56 +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 1ZjI4h-0006sw-Hy; Tue, 06 Oct 2015 02:33:55 +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 1ZjI4c-0006oP-HF for linux-arm-kernel@lists.infradead.org; Tue, 06 Oct 2015 02:33:51 +0000 Received: from uscpsbgex1.samsung.com (u122.gpu85.samsung.co.kr [203.254.195.122]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVS00KAP1RRPK70@usmailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 05 Oct 2015 22:33:27 -0400 (EDT) X-AuditID: cbfec37a-f79c96d000005f02-64-561332f79453 Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex1.samsung.com (USCPEXMTA) with SMTP id 5D.1E.24322.7F233165; Mon, 5 Oct 2015 22:33: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 <0NVS00MM61RQ3I10@usmmp1.samsung.com>; Mon, 05 Oct 2015 22:33: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; Mon, 5 Oct 2015 19:33:26 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v2 1/2] add hooks for armv8 fp/simd lazy switch Date: Mon, 05 Oct 2015 19:33:13 -0700 Message-id: <1444098794-19244-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1444098794-19244-1-git-send-email-m.smarduch@samsung.com> References: <1444098794-19244-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.28.253] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKLMWRmVeSWpSXmKPExsVy+t9hX93vRsJhBmv2i1o03f/BavHi9T9G izlTCy0+njrObrHp8TVWi793/rE5sHmsmbeG0aPlyFtWjzvX9rB5nN+0htlj85J6j8+b5ALY orhsUlJzMstSi/TtErgyFu02KFjBUzFr9kTmBsaDXF2MnBwSAiYSB369ZoewxSQu3FvP1sXI xSEksIxRYu6EJlYIp4lJYsPT3UwQzgVGieaue4wgLWwCuhL7720EaxcRCJWYsvw1WBGzQCuj xK3l81lAEsIC9hLfvh5mBbFZBFQlFn7ZBmbzCrhJ9M09zwKxW07i5LHJYHFOAXeJzgeT2EBs IaCa9e8/M0PUC0r8mHwPqJ4DaIGExPPPShAlqhLbbj5nBAlLCChJ7NiuPYFRaBaShlkIDQsY mVYxipUWJxcUJ6WnVhjqFSfmFpfmpesl5+duYoQEftUOxjtfbQ4xCnAwKvHwStwUChNiTSwr rsw9xCjBwawkwvuTSzhMiDclsbIqtSg/vqg0J7X4EKM0B4uSOO8CCblQIYH0xJLU7NTUgtQi mCwTB6dUA2OW4M5rmUnZd1cW+YQf/3LiaED8xKefu557dZnsaV8S1u3zunEy57WKXIY+aV+p OUwO+pv1V9zglezfV7tU5+e7W367zpfa5XXscwkV2H+x9F2lesacadtc9OI9SzfkBcwuur21 8H/jkd50hnbZnzWZi4+vDX9fu+7+kZ43THEzZfUOu4qsC1ZiKc5INNRiLipOBAD9KHa0eAIA AA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151005_193350_778597_8D77900D X-CRM114-Status: GOOD ( 11.73 ) 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, antonios.motakis@huawei.com, 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, T_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 4562459..03f25d0 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h @@ -157,6 +157,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));