From: Christoffer Dall <christoffer.dall@linaro.org> To: Mario Smarduch <m.smarduch@samsung.com> Cc: kvm@vger.kernel.org, marc.zyngier@arm.com, catalin.marinas@arm.com, will.deacon@arm.com, pbonzini@redhat.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state Date: Sun, 5 Jul 2015 21:27:59 +0200 [thread overview] Message-ID: <20150705192759.GA3869@cbox> (raw) In-Reply-To: <1435203028-23142-2-git-send-email-m.smarduch@samsung.com> On Wed, Jun 24, 2015 at 08:30:26PM -0700, Mario Smarduch wrote: > 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 <m.smarduch@samsung.com> > --- > 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*/ why capitalize guest? missing space at the end of the line. I don't really understand what the semantics of this field is by just lookint at this patch. I would probably define a u32 flags field in stead and define a patch akin to what we do for the debug registers and call it 'vfp_dirty', and in a comment for the flag offset define say something like: The vfp_dirty flag must be set if the host VFP register state is modified. > + 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)); > -- > 1.7.9.5 >
WARNING: multiple messages have this Message-ID (diff)
From: christoffer.dall@linaro.org (Christoffer Dall) To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state Date: Sun, 5 Jul 2015 21:27:59 +0200 [thread overview] Message-ID: <20150705192759.GA3869@cbox> (raw) In-Reply-To: <1435203028-23142-2-git-send-email-m.smarduch@samsung.com> On Wed, Jun 24, 2015 at 08:30:26PM -0700, Mario Smarduch wrote: > 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 <m.smarduch@samsung.com> > --- > 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*/ why capitalize guest? missing space at the end of the line. I don't really understand what the semantics of this field is by just lookint at this patch. I would probably define a u32 flags field in stead and define a patch akin to what we do for the debug registers and call it 'vfp_dirty', and in a comment for the flag offset define say something like: The vfp_dirty flag must be set if the host VFP register state is modified. > + 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)); > -- > 1.7.9.5 >
next prev parent reply other threads:[~2015-07-05 19:27 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-06-25 3:30 [PATCH 0/3] arm: KVM: VFP lazy switch in KVM Host Mode may save upto 98% Mario Smarduch 2015-06-25 3:30 ` Mario Smarduch 2015-06-25 3:30 ` [PATCH 1/3] arm: KVM: define headers and offsets to mange VFP state Mario Smarduch 2015-06-25 3:30 ` Mario Smarduch 2015-07-05 19:27 ` Christoffer Dall [this message] 2015-07-05 19:27 ` Christoffer Dall 2015-07-06 17:50 ` Mario Smarduch 2015-07-06 17:50 ` Mario Smarduch 2015-06-25 3:30 ` [PATCH 2/3] arm: KVM: Implement lazy VFP switching outside of Hyp Mode Mario Smarduch 2015-06-25 3:30 ` Mario Smarduch 2015-07-05 19:34 ` Christoffer Dall 2015-07-05 19:34 ` Christoffer Dall 2015-07-06 17:54 ` Mario Smarduch 2015-07-06 17:54 ` Mario Smarduch 2015-07-07 15:27 ` Christoffer Dall 2015-07-07 15:27 ` Christoffer Dall 2015-06-25 3:30 ` [PATCH 3/3] arm: KVM: Add VFP lazy switch hooks in Host KVM Mario Smarduch 2015-06-25 3:30 ` Mario Smarduch 2015-07-05 19:37 ` Christoffer Dall 2015-07-05 19:37 ` Christoffer Dall 2015-07-06 18:35 ` Mario Smarduch 2015-07-06 18:35 ` Mario Smarduch 2015-06-28 17:57 ` [PATCH 0/3] arm: KVM: VFP lazy switch in KVM Host Mode may save upto 98% Mario Smarduch 2015-06-28 17:57 ` Mario Smarduch 2015-07-05 19:37 ` Christoffer Dall 2015-07-05 19:37 ` Christoffer Dall 2015-07-06 18:43 ` Mario Smarduch 2015-07-06 18:43 ` Mario Smarduch
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20150705192759.GA3869@cbox \ --to=christoffer.dall@linaro.org \ --cc=catalin.marinas@arm.com \ --cc=kvm@vger.kernel.org \ --cc=kvmarm@lists.cs.columbia.edu \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=m.smarduch@samsung.com \ --cc=marc.zyngier@arm.com \ --cc=pbonzini@redhat.com \ --cc=will.deacon@arm.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.