Re: [PATCH] arm64: KVM: set right LR register value for 32 bit guest when inject abort

2017-10-14 Thread gengdongjiu
Hi Marc, On 2017/10/13 23:12, Marc Zyngier wrote: > On 13/10/17 15:29, gengdongjiu wrote: >> Hi Marc, >> Thank you very much for your time to review it. >> >>> On 12/10/17 17:44, Dongjiu Geng wrote: When a exception is trapped to EL2, hardware uses ELR_ELx to hold the current fault

Re: [PATCH 5/5] KVM: arm/arm64: kvm_arch_vcpu_runnable: don't miss injected irqs

2017-10-14 Thread Christoffer Dall
On Fri, Sep 29, 2017 at 01:30:41PM +0200, Andrew Jones wrote: > When the vPMU is in use if a VCPU's perf event overflow handler > were to fire after the VCPU started waiting, then the wake up > done by the kvm_vcpu_kick() call in the handler would do nothing, > as no "pmu overflow" state is

Re: [PATCH 3/5] KVM: arm/arm64: factor out common wfe/wfi emulation code

2017-10-14 Thread Christoffer Dall
On Fri, Sep 29, 2017 at 01:30:39PM +0200, Andrew Jones wrote: > Before we add more common code to the wfi emulation, let's first > factor out everything common. > > Signed-off-by: Andrew Jones > --- > arch/arm/include/asm/kvm_host.h | 2 ++ > arch/arm/kvm/handle_exit.c

Re: [PATCH 4/5] KVM: arm/arm64: improve kvm_arch_vcpu_runnable

2017-10-14 Thread Christoffer Dall
On Fri, Sep 29, 2017 at 01:30:40PM +0200, Andrew Jones wrote: > Conceptually, kvm_arch_vcpu_runnable() should be "not waiting, > or waiting for interrupts and interrupts are pending", > > !waiting-uninterruptable && > (!waiting-for-interrupts || interrupts-pending) > > but the implementation

Re: [PATCH 2/5] KVM: arm/arm64: replace power_off with mp_state=STOPPED

2017-10-14 Thread Christoffer Dall
On Fri, Sep 29, 2017 at 01:30:38PM +0200, Andrew Jones wrote: > This prepares for more MP states to be used. > > Signed-off-by: Andrew Jones > --- > arch/arm/include/asm/kvm_host.h | 6 -- > arch/arm64/include/asm/kvm_host.h | 6 -- > virt/kvm/arm/arm.c

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-14 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 10:27:36AM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Fri, Oct 06, 2017 at 12:39:21PM +0100, Alex Bennée wrote: > >> The system state of KVM when using userspace emulation is not complete > >> until we return into KVM_RUN. To handle

Re: [PATCH v1 2/2] kvm: arm64: handle single-step of userspace mmio instructions

2017-10-14 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 10:23:21AM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Fri, Oct 06, 2017 at 02:45:35PM +0100, Alex Bennée wrote: > >> > >> Julien Thierry writes: > >> > >> > On 06/10/17 12:39, Alex Bennée wrote: > >> >> The

Re: [PATCH v1 1/2] KVM: arm64: handle single-stepping trapped instructions

2017-10-14 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 10:15:09AM +0100, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Fri, Oct 06, 2017 at 12:39:20PM +0100, Alex Bennée wrote: > >> If we are using guest debug to single-step the guest we need to ensure > >> we exit after emulating the