From patchwork Thu Jun 25 03:30:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 6672021 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 892669F72C for ; Thu, 25 Jun 2015 03:34:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F5572060A for ; Thu, 25 Jun 2015 03:34:29 +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 506EF205F4 for ; Thu, 25 Jun 2015 03:34:28 +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 1Z7xtA-0004vh-CM; Thu, 25 Jun 2015 03:31:44 +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 1Z7xsZ-0004lC-T1 for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2015 03:31:08 +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 <0NQH001F7DR9ZU30@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 24 Jun 2015 23:30:45 -0400 (EDT) X-AuditID: cbfec37b-f79926d0000060e9-81-558b75e4ef48 Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id 2C.92.24809.4E57B855; Wed, 24 Jun 2015 23:30:45 -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 <0NQH00IL6DR8IAA0@usmmp1.samsung.com>; Wed, 24 Jun 2015 23:30:44 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.160.11.3) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 24 Jun 2015 20:30:44 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, christoffer.dall@linaro.org Subject: [PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state Date: Wed, 24 Jun 2015 20:30:26 -0700 Message-id: <1435203028-23142-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1435203028-23142-1-git-send-email-m.smarduch@samsung.com> References: <1435203028-23142-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.160.11.3] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrPLMWRmVeSWpSXmKPExsVy+t9hX92npd2hBk/WsVm8X9bDaPHi9T9G izlTCy0+njrObrHp8TVWi793/rFZ7N/2j9Xi5ccTLA4cHmvmrWH0uHNtD5vH+U1rmD02L6n3 eL/vKpvH501yAWxRXDYpqTmZZalF+nYJXBmrDj9gL3gkUHH16BHGBsYNfF2MHBwSAiYS61aw dzFyApliEhfurWfrYuTiEBJYxijx93gPlNPEJPGj/RwrhHOeUeLc7/lsIC1sAroS++9tBGsX EQiVuP63kQmkiFlgLaPEhe0nmUESwgI+Eqdud4I1sAioSty+0cEKYvMKuEm8WHWRGeIMBYk5 k2xAwpwC7hJfNu8AKxcCKpnxcwpUuaDEj8n3WEDKmQUkJJ5/VoIoUZXYdvM5I8QHChI/V61n nMAoNAtJxyyEjgWMTKsYxUqLkwuKk9JTK4z0ihNzi0vz0vWS83M3MUKioXoH492vNocYBTgY lXh4K2y7Q4VYE8uKK3MPMUpwMCuJ8DYGAIV4UxIrq1KL8uOLSnNSiw8xSnOwKInz3pGQCxUS SE8sSc1OTS1ILYLJMnFwSjUwTu/27pvY+7J/at4t7fk7XjtU8RZWsW9RuT6z6vaVAv2ef4sW b/7/tVf9X4rktY79j4zenvvreLvu1I+f+wuErtpvP/nFdqUGz3QVrZPXg5+62t4IFQhaf6jx l69DrbDcfaZ/L+cur4zJ9YiPuOu+mFeHO/9QrXuyrETOmkn+3+u/JFlKt7VNUmIpzkg01GIu Kk4EAMgprYmCAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150624_203108_088049_AF84EBDA X-CRM114-Status: GOOD ( 11.52 ) X-Spam-Score: -8.3 (--------) Cc: kvm@vger.kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, pbonzini@redhat.com, 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 Define the required kvm_vcpu_arch fields, and offsets to manage VFP state. And declary Hyp interface function to switch VFP registers. Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 3 +++ arch/arm/kernel/asm-offsets.c | 1 + 3 files changed, 5 insertions(+) diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 25410b2..08dda8c 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h @@ -97,6 +97,7 @@ extern char __kvm_hyp_code_end[]; extern void __kvm_flush_vm_context(void); extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa); extern void __kvm_tlb_flush_vmid(struct kvm *kvm); +extern void __kvm_restore_host_vfp_state(struct kvm_vcpu *vcpu); extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); #endif diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index d71607c..22cea72 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -111,6 +111,9 @@ struct kvm_vcpu_arch { /* Interrupt related fields */ u32 irq_lines; /* IRQ and FIQ levels */ + /* Track if VFP registers are occupied by Guest while in KVM host mode*/ + u32 vfp_guest_saved; + /* 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..35093d0 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c @@ -191,6 +191,7 @@ int main(void) DEFINE(VCPU_HPFAR, offsetof(struct kvm_vcpu, arch.fault.hpfar)); DEFINE(VCPU_HYP_PC, offsetof(struct kvm_vcpu, arch.fault.hyp_pc)); DEFINE(VCPU_VGIC_CPU, offsetof(struct kvm_vcpu, arch.vgic_cpu)); + DEFINE(VCPU_VFP_SAVED, offsetof(struct kvm_vcpu, arch.vfp_guest_saved)); DEFINE(VGIC_V2_CPU_HCR, offsetof(struct vgic_cpu, vgic_v2.vgic_hcr)); DEFINE(VGIC_V2_CPU_VMCR, offsetof(struct vgic_cpu, vgic_v2.vgic_vmcr)); DEFINE(VGIC_V2_CPU_MISR, offsetof(struct vgic_cpu, vgic_v2.vgic_misr));