[PATCH v3 14/41] KVM: arm64: Introduce VHE-specific kvm_vcpu_run

Christoffer Dall christoffer.dall at linaro.org
Tue Feb 13 00:52:45 PST 2018


On Fri, Feb 09, 2018 at 05:34:05PM +0000, Julien Grall wrote:
> Hi Christoffer,
> 
> On 01/12/2018 12:07 PM, Christoffer Dall wrote:
> >So far this is just a copy of the legacy non-VHE switch function, but we
> >will start reworking these functions in separate directions to work on
> >VHE and non-VHE in the most optimal way in later patches.
> >
> >Reviewed-by: Marc Zyngier <marc.zyngier at arm.com>
> >Signed-off-by: Christoffer Dall <christoffer.dall at linaro.org>
> >---
> >  arch/arm/include/asm/kvm_asm.h   |  5 +++-
> >  arch/arm/kvm/hyp/switch.c        |  2 +-
> >  arch/arm64/include/asm/kvm_asm.h |  4 ++-
> >  arch/arm64/kvm/hyp/switch.c      | 58 +++++++++++++++++++++++++++++++++++++++-
> >  virt/kvm/arm/arm.c               |  5 +++-
> >  5 files changed, 69 insertions(+), 5 deletions(-)
> >
> >diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h
> >index 36dd2962a42d..4ac717276543 100644
> >--- a/arch/arm/include/asm/kvm_asm.h
> >+++ b/arch/arm/include/asm/kvm_asm.h
> >@@ -70,7 +70,10 @@ extern void __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu);
> >  extern void __kvm_timer_set_cntvoff(u32 cntvoff_low, u32 cntvoff_high);
> >-extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
> >+/* no VHE on 32-bit :( */
> >+static inline int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu) { return 0; }
> 
> Should we return an error or add a BUG() to catch potential use of this
> function?
> 

That definitely can't hurt.

Thanks,
-Christoffer



More information about the linux-arm-kernel mailing list