From patchwork Sat Sep 26 23:43:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 7272861 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 A08BF9F39B for ; Sat, 26 Sep 2015 23:46:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2B0B208D0 for ; Sat, 26 Sep 2015 23:46:43 +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 D24AF208B8 for ; Sat, 26 Sep 2015 23:46:42 +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 1Zfz8u-0007fO-Bs; Sat, 26 Sep 2015 23:44:36 +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 1Zfz8k-0007Y4-E3 for linux-arm-kernel@lists.infradead.org; Sat, 26 Sep 2015 23:44:27 +0000 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) by usmailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NVB00BNV5XMAU80@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 26 Sep 2015 19:44:10 -0400 (EDT) X-AuditID: cbfec37b-f79926d0000060e9-ae-56072dca8aae Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id C3.90.24809.ACD27065; Sat, 26 Sep 2015 19:44:10 -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 <0NVB00AZG5XM9T40@usmmp1.samsung.com>; Sat, 26 Sep 2015 19:44:10 -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; Sat, 26 Sep 2015 16:44:09 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v2 1/2] KVM/arm: add hooks for armv7 fp/simd lazy switch support Date: Sat, 26 Sep 2015 16:43:28 -0700 Message-id: <1443311009-4811-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1443311009-4811-1-git-send-email-m.smarduch@samsung.com> References: <1443311009-4811-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.145.28.253] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsVy+t9hX91TuuxhBhfmqlg03f/BavHi9T9G izlTCy0+njrObrHp8TVWi793/rE5sHmsmbeG0aPlyFtWjzvX9rB5nN+0htlj85J6j8+b5ALY orhsUlJzMstSi/TtErgyWlf+Zy3Yw1Nxa0M7awPjCa4uRk4OCQETiYtnprNC2GISF+6tZwOx hQSWMUpcWMfZxcgFZDcxSXS9a2WFcC4ySnx8vw2sg01AV2L/vY3sILaIQKjElOWvmUCKmAVa GSVuLZ/PApIQFgiQmPHzFFgDi4CqxM/TWxlBbF4BV4ltN7+wQayWkzh5bDJQDQcHp4CbxNPl aSCmEFDJy458iGpBiR+T77GAhJkFJCSef1aCuFMVaMhzRpCwhICSxI7t2hMYhWYhaZiF0LCA kWkVo1hpcXJBcVJ6aoWRXnFibnFpXrpecn7uJkZI0FfvYLz71eYQowAHoxIPr8If1jAh1sSy 4srcQ4wSHMxKIryiP9jChHhTEiurUovy44tKc1KLDzFKc7AoifPekZALFRJITyxJzU5NLUgt gskycXBKNTC6tGnasUurRi62d5XgjvGZvyzIpckhkW+Ks7uK28+N7z903n24zp3xXnlL9s6b B3r+rtCLXfkvMW3VTsVfefM5Dx6Zc+LZmq98YjvW/ts2T910++dnpheMIhJd5s5/enhB3VN7 NkkG4aimndrHl3/t/P5qU5Vhs0jT8lvcXpOSfzZYvDTK1dioxFKckWioxVxUnAgAnGPXkHYC AAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150926_164426_566726_181E1477 X-CRM114-Status: UNSURE ( 9.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -7.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=-5.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 vcpu fields to track lazy state, save host FPEXC, and offsets to fields. Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_host.h | 6 ++++++ arch/arm/kernel/asm-offsets.c | 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index dcba0fa..194a8ef 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -111,6 +111,12 @@ struct kvm_vcpu_arch { /* Interrupt related fields */ u32 irq_lines; /* IRQ and FIQ levels */ + /* Track fp/simd lazy switch state */ + u32 vfp_lazy; + + /* Save host FPEXC register to restore on vcpu put */ + u32 saved_fpexc; + /* Exception Information */ struct kvm_vcpu_fault_info fault; diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 871b826..e1c3a41 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -186,6 +186,8 @@ int main(void) DEFINE(VCPU_CPSR, offsetof(struct kvm_vcpu, arch.regs.usr_regs.ARM_cpsr)); DEFINE(VCPU_HCR, offsetof(struct kvm_vcpu, arch.hcr)); DEFINE(VCPU_IRQ_LINES, offsetof(struct kvm_vcpu, arch.irq_lines)); + DEFINE(VCPU_VFP_LAZY, offsetof(struct kvm_vcpu, arch.vfp_lazy)); + DEFINE(VCPU_VFP_FPEXC, offsetof(struct kvm_vcpu, arch.saved_fpexc)); DEFINE(VCPU_HSR, offsetof(struct kvm_vcpu, arch.fault.hsr)); DEFINE(VCPU_HxFAR, offsetof(struct kvm_vcpu, arch.fault.hxfar)); DEFINE(VCPU_HPFAR, offsetof(struct kvm_vcpu, arch.fault.hpfar));