Re: [PATCH 05/37] KVM: Record the executing ioctl number on the vcpu struct

2017-10-13 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 8:38 PM, Radim Krčmář wrote: > 2017-10-13 19:31+0200, Christoffer Dall: >> On Fri, Oct 13, 2017 at 07:13:07PM +0200, Radim Krčmář wrote: >> > I think that other (special) callsites of vcpu_load()/vcpu_put() have a >> > well defined IOCTL that can be

Re: [PATCH 05/37] KVM: Record the executing ioctl number on the vcpu struct

2017-10-13 Thread Radim Krčmář
2017-10-13 19:31+0200, Christoffer Dall: > On Fri, Oct 13, 2017 at 07:13:07PM +0200, Radim Krčmář wrote: > > I think that other (special) callsites of vcpu_load()/vcpu_put() have a > > well defined IOCTL that can be used instead of vcpu->ioctl, so we could > > just pass the ioctl value all the way

Re: [PATCH v3 11/28] arm64/sve: Core task context handling

2017-10-13 Thread Dave Martin
On Fri, Oct 13, 2017 at 02:57:37PM +0100, Catalin Marinas wrote: > On Thu, Oct 12, 2017 at 05:05:07PM +0100, Dave P Martin wrote: > > On Wed, Oct 11, 2017 at 05:15:58PM +0100, Catalin Marinas wrote: > > > On Tue, Oct 10, 2017 at 07:38:28PM +0100, Dave P Martin wrote: > > > > diff --git

Re: [PATCH v2] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 04:00:18PM +0200, Andrew Jones wrote: > On Fri, Oct 13, 2017 at 03:17:34PM +0200, Christoffer Dall wrote: > > We currently allocate an entry dynamically, but we never check if the > > allocation actually succeeded. We actually don't need a dynamic > > allocation, because

Re: [PATCH v3 26/28] arm64/sve: Add documentation

2017-10-13 Thread Dave Martin
On Fri, Oct 13, 2017 at 03:24:21PM +0100, Catalin Marinas wrote: > On Tue, Oct 10, 2017 at 07:38:43PM +0100, Dave P Martin wrote: [...] > > +* If the SVE context is too big to fit in sigcontext.__reserved[], then > > extra > > + space is allocated on the stack, an extra_context record is

Re: [PATCH 05/37] KVM: Record the executing ioctl number on the vcpu struct

2017-10-13 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 07:13:07PM +0200, Radim Krčmář wrote: > 2017-10-12 12:41+0200, Christoffer Dall: > > Some architectures may decide to do different things during > > kvm_arch_vcpu_load depending on the ioctl being executed. For example, > > arm64 is about to do significant work in vcpu

Re: [PATCH v3 26/28] arm64/sve: Add documentation

2017-10-13 Thread Dave Martin
On Fri, Oct 13, 2017 at 03:24:21PM +0100, Catalin Marinas wrote: > On Tue, Oct 10, 2017 at 07:38:43PM +0100, Dave P Martin wrote: > > +4. Signal handling > > +--- > > + > > +* A new signal frame record sve_context encodes the SVE registers on signal > > + delivery. [1] > > + > >

Re: [PATCH 05/37] KVM: Record the executing ioctl number on the vcpu struct

2017-10-13 Thread Radim Krčmář
2017-10-12 12:41+0200, Christoffer Dall: > Some architectures may decide to do different things during > kvm_arch_vcpu_load depending on the ioctl being executed. For example, > arm64 is about to do significant work in vcpu load/put when running a > vcpu, but not when doing things like

Re: [PATCH v3 15/20] KVM: arm64: Set an impdef ESR for Virtual-SError using VSESR_EL2.

2017-10-13 Thread James Morse
Hi gengdongjiu, On 13/10/17 10:25, gengdongjiu wrote: > After checking this patch, I think my patch[1] already include this > logic(only a little > difference). Your kvm_handle_guest_sei() is similar to where this series ends up, but the purpose of this patch is to keep KVMs existing behaviour.

Re: [PATCH v3 04/13] arm64: alternatives: use tpidr_el2 on VHE hosts

2017-10-13 Thread James Morse
Hi Catalin, On 13/10/17 16:31, Catalin Marinas wrote: > On Fri, Sep 22, 2017 at 07:26:05PM +0100, James Morse wrote: >> diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c >> index cd52d365d1f0..8e4c7da2b126 100644 >> --- a/arch/arm64/kernel/cpufeature.c >> +++

Re: [PATCH v3 22/28] arm64/sve: KVM: Prevent guests from using SVE

2017-10-13 Thread Dave Martin
On Fri, Oct 13, 2017 at 03:21:59PM +0100, Marc Zyngier wrote: > On 13/10/17 15:15, Dave Martin wrote: > > On Thu, Oct 12, 2017 at 12:28:32PM +0100, Marc Zyngier wrote: > >> On 12/10/17 12:04, Dave Martin wrote: > >>> On Wed, Oct 11, 2017 at 05:28:06PM +0100, Marc Zyngier wrote: > [+

Re: [PATCH v3 19/28] arm64/sve: ptrace and ELF coredump support

2017-10-13 Thread Dave Martin
On Thu, Oct 12, 2017 at 06:06:32PM +0100, Catalin Marinas wrote: > On Tue, Oct 10, 2017 at 07:38:36PM +0100, Dave P Martin wrote: > > @@ -702,6 +737,211 @@ static int system_call_set(struct task_struct *target, > > return ret; > > } > > > > +#ifdef CONFIG_ARM64_SVE > > + > > +static void

Re: [PATCH v3 08/13] arm64: Add vmap_stack header file

2017-10-13 Thread Catalin Marinas
On Fri, Sep 22, 2017 at 07:26:09PM +0100, James Morse wrote: > diff --git a/arch/arm64/include/asm/vmap_stack.h > b/arch/arm64/include/asm/vmap_stack.h > new file mode 100644 > index ..f41d043cac31 > --- /dev/null > +++ b/arch/arm64/include/asm/vmap_stack.h > @@ -0,0 +1,41 @@ > +/* >

Re: [PATCH v3 04/13] arm64: alternatives: use tpidr_el2 on VHE hosts

2017-10-13 Thread Catalin Marinas
On Fri, Sep 22, 2017 at 07:26:05PM +0100, James Morse wrote: > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index cd52d365d1f0..8e4c7da2b126 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -865,6 +865,7 @@ static const

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

2017-10-13 Thread Marc Zyngier
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 instruction address. If KVM wants to inject a abort to

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

2017-10-13 Thread gengdongjiu
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 instruction address. If KVM wants to inject a abort to > > 32 bit guest, it needs to set the LR

Re: [PATCH v3 13/28] arm64/sve: Signal handling support

2017-10-13 Thread Dave Martin
On Fri, Oct 13, 2017 at 12:17:19PM +0100, Catalin Marinas wrote: > On Thu, Oct 12, 2017 at 05:11:57PM +0100, Dave P Martin wrote: > > On Wed, Oct 11, 2017 at 05:40:52PM +0100, Catalin Marinas wrote: > > > On Tue, Oct 10, 2017 at 07:38:30PM +0100, Dave P Martin wrote: > > > > diff --git

Re: [PATCH v3 26/28] arm64/sve: Add documentation

2017-10-13 Thread Catalin Marinas
On Tue, Oct 10, 2017 at 07:38:43PM +0100, Dave P Martin wrote: > +4. Signal handling > +--- > + > +* A new signal frame record sve_context encodes the SVE registers on signal > + delivery. [1] > + > +* This record is supplementary to fpsimd_context. The FPSR and FPCR >

Re: [PATCH v3 22/28] arm64/sve: KVM: Prevent guests from using SVE

2017-10-13 Thread Marc Zyngier
On 13/10/17 15:15, Dave Martin wrote: > On Thu, Oct 12, 2017 at 12:28:32PM +0100, Marc Zyngier wrote: >> On 12/10/17 12:04, Dave Martin wrote: >>> On Wed, Oct 11, 2017 at 05:28:06PM +0100, Marc Zyngier wrote: [+ Christoffer] On 10/10/17 19:38, Dave Martin wrote: > Until KVM has

Re: [PATCH v2] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Andrew Jones
On Fri, Oct 13, 2017 at 03:17:34PM +0200, Christoffer Dall wrote: > We currently allocate an entry dynamically, but we never check if the > allocation actually succeeded. We actually don't need a dynamic > allocation, because we know the maximum size of an ITS table entry, so > we can simply use

Re: [PATCH v3 11/28] arm64/sve: Core task context handling

2017-10-13 Thread Catalin Marinas
On Thu, Oct 12, 2017 at 05:05:07PM +0100, Dave P Martin wrote: > On Wed, Oct 11, 2017 at 05:15:58PM +0100, Catalin Marinas wrote: > > On Tue, Oct 10, 2017 at 07:38:28PM +0100, Dave P Martin wrote: > > > diff --git a/arch/arm64/include/asm/processor.h > > > b/arch/arm64/include/asm/processor.h > >

Re: [PATCH v2] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Marc Zyngier
On 13/10/17 14:17, Christoffer Dall wrote: > We currently allocate an entry dynamically, but we never check if the > allocation actually succeeded. We actually don't need a dynamic > allocation, because we know the maximum size of an ITS table entry, so > we can simply use an allocation on the

[PATCH v2] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Christoffer Dall
We currently allocate an entry dynamically, but we never check if the allocation actually succeeded. We actually don't need a dynamic allocation, because we know the maximum size of an ITS table entry, so we can simply use an allocation on the stack. Cc: Signed-off-by:

Re: [PATCH] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Marc Zyngier
On 13/10/17 12:57, Christoffer Dall wrote: > On Fri, Oct 13, 2017 at 12:00:50PM +0100, Marc Zyngier wrote: >> On 13/10/17 11:52, Christoffer Dall wrote: >>> We currently allocate an entry dynamically, but we never check if the >>> allocation actually succeeded. We actually don't need a dynamic

Re: [PATCH] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Christoffer Dall
On Fri, Oct 13, 2017 at 12:00:50PM +0100, Marc Zyngier wrote: > On 13/10/17 11:52, Christoffer Dall wrote: > > We currently allocate an entry dynamically, but we never check if the > > allocation actually succeeded. We actually don't need a dynamic > > allocation, because we know the maximum size

Re: [PATCH 01/37] KVM: arm64: Avoid storing the vcpu pointer on the stack

2017-10-13 Thread Marc Zyngier
On 12/10/17 18:02, Christoffer Dall wrote: > On Thu, Oct 12, 2017 at 04:49:44PM +0100, Marc Zyngier wrote: >> On 12/10/17 11:41, Christoffer Dall wrote: >>> We already have the percpu area for the host cpu state, which points to >>> the VCPU, so there's no need to store the VCPU pointer on the

Re: [PATCH v3 13/28] arm64/sve: Signal handling support

2017-10-13 Thread Catalin Marinas
On Thu, Oct 12, 2017 at 05:11:57PM +0100, Dave P Martin wrote: > On Wed, Oct 11, 2017 at 05:40:52PM +0100, Catalin Marinas wrote: > > On Tue, Oct 10, 2017 at 07:38:30PM +0100, Dave P Martin wrote: > > > diff --git a/arch/arm64/kernel/fpsimd.c b/arch/arm64/kernel/fpsimd.c > > > index

[PATCH] KVM: arm64: its: Fix missing dynamic allocation check in scan_its_table

2017-10-13 Thread Christoffer Dall
We currently allocate an entry dynamically, but we never check if the allocation actually succeeded. We actually don't need a dynamic allocation, because we know the maximum size of an ITS table entry, so we can simply use an allocation on the stack. Cc: Signed-off-by:

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

2017-10-13 Thread Christoffer Dall
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 system state of KVM when using userspace emulation is not complete > >> until we return into KVM_RUN. To handle mmio related

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

2017-10-13 Thread Christoffer Dall
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 mmio related updates we wait > until they have been committed and then schedule our KVM_EXIT_DEBUG. > > I've introduced a

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

2017-10-13 Thread Christoffer Dall
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 instruction. This only affects > instructions completely emulated by the kernel. For userspace emulated > instructions we need to exit