Re: [PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC

2015-08-05 Thread Catalin Marinas
On Wed, Jul 08, 2015 at 05:19:10PM +0100, Marc Zyngier wrote: --- /dev/null +++ b/arch/arm64/kvm/vhe-macros.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2015 - ARM Ltd + * Author: Marc Zyngier marc.zyng...@arm.com + * + * This program is free software; you can redistribute it and/or modify +

Re: [PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC

2015-07-10 Thread Paolo Bonzini
On 08/07/2015 19:54, Marc Zyngier wrote: Alternatively, I could move it to arch/arm64/include/asm (renamed to kvm_vhe_macros.h?), which would solve this issue. I just gave it a go, and that seems sensible enough. Yes, that would do. Alternatively: * create kvm_hyp_macros.h and put more

[PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC

2015-07-08 Thread Marc Zyngier
With VHE, the host never issues an HVC instruction to get into the KVM code, as we can simply branch there. Use runtime code patching to simplify things a bit. Signed-off-by: Marc Zyngier marc.zyng...@arm.com --- arch/arm64/kvm/hyp.S| 43 ---

Re: [PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC

2015-07-08 Thread Paolo Bonzini
On 08/07/2015 18:19, Marc Zyngier wrote: +/* Hack to allow stringification of macros... */ +#define __S__(a,args...) __stringify(a, ##args) +#define _S_(a,args...) __S__(a, args) + +.macro ifnvhe nonvhe vhe + alternative_insn\nonvhe, \vhe,

Re: [PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC

2015-07-08 Thread Marc Zyngier
On 08/07/15 18:14, Paolo Bonzini wrote: On 08/07/2015 18:19, Marc Zyngier wrote: +/* Hack to allow stringification of macros... */ +#define __S__(a,args...)__stringify(a, ##args) +#define _S_(a,args...) __S__(a, args) + +.macro ifnvhe nonvhe vhe +alternative_insn