Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-10 Thread Christoffer Dall
On Thu, Oct 09, 2014 at 02:36:26PM +0100, Catalin Marinas wrote: > On Thu, Oct 09, 2014 at 12:01:37PM +0100, Christoffer Dall wrote: > > On Wed, Oct 08, 2014 at 10:47:04AM +0100, Catalin Marinas wrote: > > > On Tue, Oct 07, 2014 at 08:39:54PM +0100, Christoffer Dall wrote: > > > > +static inline in

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-09 Thread Catalin Marinas
On Thu, Oct 09, 2014 at 12:01:37PM +0100, Christoffer Dall wrote: > On Wed, Oct 08, 2014 at 10:47:04AM +0100, Catalin Marinas wrote: > > On Tue, Oct 07, 2014 at 08:39:54PM +0100, Christoffer Dall wrote: > > > +static inline int kvm_prealloc_hwpgd(struct kvm *kvm, pgd_t *pgd) > > > +{ > > > +

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-09 Thread Christoffer Dall
On Wed, Oct 08, 2014 at 10:47:04AM +0100, Catalin Marinas wrote: > On Tue, Oct 07, 2014 at 08:39:54PM +0100, Christoffer Dall wrote: > > I came up with the following based on your feedback, but I personally > > don't find it a lot easier to read than what I had already. Suggestions > > are welcome

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Marc Zyngier
On 08/10/14 10:47, Christoffer Dall wrote: > On Wed, Oct 08, 2014 at 10:34:31AM +0100, Marc Zyngier wrote: >> On 07/10/14 20:39, Christoffer Dall wrote: >>> On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: On 07/10/14 11:48, Catalin Marinas wrote: > On Mon, Oct 06, 2014 at 09:

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Christoffer Dall
On Tue, Oct 07, 2014 at 02:40:27PM +0100, Marc Zyngier wrote: > Hi Christoffer, > > On 06/10/14 21:30, Christoffer Dall wrote: > > This patch adds the necessary support for all host kernel PGSIZE and > > VA_SPACE configuration options for both EL2 and the Stage-2 page tables. > > > > However, for

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Christoffer Dall
On Wed, Oct 08, 2014 at 10:34:31AM +0100, Marc Zyngier wrote: > On 07/10/14 20:39, Christoffer Dall wrote: > > On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: > >> On 07/10/14 11:48, Catalin Marinas wrote: > >>> On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: >

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Catalin Marinas
On Tue, Oct 07, 2014 at 08:39:54PM +0100, Christoffer Dall wrote: > I came up with the following based on your feedback, but I personally > don't find it a lot easier to read than what I had already. Suggestions > are welcome: At least PTRS_PER_S2_PGD and KVM_PREALLOC_LEVEL are clearer to me as f

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Marc Zyngier
On 07/10/14 20:39, Christoffer Dall wrote: > On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: >> On 07/10/14 11:48, Catalin Marinas wrote: >>> On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: +/** + * kvm_prealloc_hwpgd - allocate inital table for VTTBR

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-07 Thread Christoffer Dall
On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: > On 07/10/14 11:48, Catalin Marinas wrote: > > On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: > >> +/** > >> + * kvm_prealloc_hwpgd - allocate inital table for VTTBR > >> + * @kvm: The KVM struct pointer for the

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-07 Thread Marc Zyngier
Hi Christoffer, On 06/10/14 21:30, Christoffer Dall wrote: > This patch adds the necessary support for all host kernel PGSIZE and > VA_SPACE configuration options for both EL2 and the Stage-2 page tables. > > However, for 40bit and 42bit PARange systems, the architecture mandates > that VTCR_EL2.

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-07 Thread Marc Zyngier
On 07/10/14 11:48, Catalin Marinas wrote: > On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: >> +/** >> + * kvm_prealloc_hwpgd - allocate inital table for VTTBR >> + * @kvm: The KVM struct pointer for the VM. >> + * @pgd: The kernel pseudo pgd >> + * >> + * When the ker

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-07 Thread Catalin Marinas
On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: > +/** > + * kvm_prealloc_hwpgd - allocate inital table for VTTBR > + * @kvm: The KVM struct pointer for the VM. > + * @pgd: The kernel pseudo pgd > + * > + * When the kernel uses more levels of page tables than the guest

[PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-06 Thread Christoffer Dall
This patch adds the necessary support for all host kernel PGSIZE and VA_SPACE configuration options for both EL2 and the Stage-2 page tables. However, for 40bit and 42bit PARange systems, the architecture mandates that VTCR_EL2.SL0 is maximum 1, resulting in fewer levels of stage-2 pagge tables th