Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Christoffer Dall
On Thu, Feb 22, 2018 at 10:56:41AM +0100, Andrew Jones wrote: > On Thu, Feb 22, 2018 at 10:10:34AM +0100, Christoffer Dall wrote: > > On Wed, Feb 21, 2018 at 06:32:00PM +0100, Andrew Jones wrote: > > > > > > Besides my confusion on motivation, it looks good to me > > > > > > > In that case,

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Andrew Jones
On Thu, Feb 22, 2018 at 10:10:34AM +0100, Christoffer Dall wrote: > On Wed, Feb 21, 2018 at 06:32:00PM +0100, Andrew Jones wrote: > > > > Besides my confusion on motivation, it looks good to me > > > > In that case, unless there's an argument that the code has become too > hard to understand,

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Andrew Jones
On Thu, Feb 22, 2018 at 10:02:48AM +0100, Christoffer Dall wrote: > On Wed, Feb 21, 2018 at 11:34:07AM +, Marc Zyngier wrote: > > On Thu, 15 Feb 2018 21:02:55 +, > > Christoffer Dall wrote: > > > @@ -138,13 +138,15 @@ alternative_else_nop_endif > > > > > > el1_irq: > > > stp x0,

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Marc Zyngier
On Thu, 22 Feb 2018 09:02:48 +, Christoffer Dall wrote: > > On Wed, Feb 21, 2018 at 11:34:07AM +, Marc Zyngier wrote: > > On Thu, 15 Feb 2018 21:02:55 +, > > Christoffer Dall wrote: > > > > > > We already have the percpu area for the host cpu state, which points to > > > the VCPU, so

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Christoffer Dall
On Wed, Feb 21, 2018 at 06:32:00PM +0100, Andrew Jones wrote: > On Thu, Feb 15, 2018 at 10:02:55PM +0100, 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 stack on > > every context

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Christoffer Dall
On Wed, Feb 21, 2018 at 11:34:07AM +, Marc Zyngier wrote: > On Thu, 15 Feb 2018 21:02:55 +, > 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 stack on > > every

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-22 Thread Christoffer Dall
On Mon, Feb 19, 2018 at 03:50:20PM +, Julien Grall wrote: > Hi Christoffer, > > On 15/02/18 21:02, 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 stack on > >every context

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-21 Thread Andrew Jones
On Thu, Feb 15, 2018 at 10:02:55PM +0100, 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 stack on > every context switch. We can be a little more clever and just use > tpidr_el2 for

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-21 Thread Marc Zyngier
On Thu, 15 Feb 2018 21:02:55 +, 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 stack on > every context switch. We can be a little more clever and just use > tpidr_el2 for the

Re: [PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-19 Thread Julien Grall
Hi Christoffer, On 15/02/18 21:02, 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 stack on every context switch. We can be a little more clever and just use tpidr_el2 for the percpu

[PATCH v4 03/40] KVM: arm64: Avoid storing the vcpu pointer on the stack

2018-02-15 Thread Christoffer Dall
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 stack on every context switch. We can be a little more clever and just use tpidr_el2 for the percpu offset and load the VCPU pointer from the host context. This