Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-16 Thread Ard Biesheuvel
On 15 October 2015 at 17:11, Mark Rutland wrote: > On Thu, Oct 15, 2015 at 09:47:53AM -0500, Jeremy Linton wrote: >> On 10/15/2015 06:25 AM, Suzuki K. Poulose wrote: >> >+/* >> >+ * Check to see if the CPU supports the requested pagesize >> >+ */ >> >+asm volatile("mrs %0, ID_AA64M

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-16 Thread Ard Biesheuvel
On 15 October 2015 at 14:58, Suzuki K. Poulose wrote: > On 15/10/15 13:37, Mark Rutland wrote: >> >> On Thu, Oct 15, 2015 at 12:25:33PM +0100, Suzuki K. Poulose wrote: >>> >>> On Thu, Oct 15, 2015 at 11:45:15AM +0100, Mark Rutland wrote: On Wed, Oct 14, 2015 at 04:13:47PM -0500, Jeremy L

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Mark Rutland
On Thu, Oct 15, 2015 at 09:47:53AM -0500, Jeremy Linton wrote: > On 10/15/2015 06:25 AM, Suzuki K. Poulose wrote: > >+/* > >+ * Check to see if the CPU supports the requested pagesize > >+ */ > >+asm volatile("mrs %0, ID_AA64MMFR0_EL1" : "=r" (aa64mmfr0_el1)); > >+aa64mmfr0_el1

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Suzuki K. Poulose
On 15/10/15 15:47, Jeremy Linton wrote: On 10/15/2015 06:25 AM, Suzuki K. Poulose wrote: +/* + * Check to see if the CPU supports the requested pagesize + */ +asm volatile("mrs %0, ID_AA64MMFR0_EL1" : "=r" (aa64mmfr0_el1)); +aa64mmfr0_el1 >>= ID_AA64MMFR0_TGRAN_SHIFT; +if

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Jeremy Linton
On 10/15/2015 06:25 AM, Suzuki K. Poulose wrote: + /* +* Check to see if the CPU supports the requested pagesize +*/ + asm volatile("mrs %0, ID_AA64MMFR0_EL1" : "=r" (aa64mmfr0_el1)); + aa64mmfr0_el1 >>= ID_AA64MMFR0_TGRAN_SHIFT; + if ((aa64mmfr0_el1 & 0xf)

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Suzuki K. Poulose
On 15/10/15 13:37, Mark Rutland wrote: On Thu, Oct 15, 2015 at 12:25:33PM +0100, Suzuki K. Poulose wrote: On Thu, Oct 15, 2015 at 11:45:15AM +0100, Mark Rutland wrote: On Wed, Oct 14, 2015 at 04:13:47PM -0500, Jeremy Linton wrote: On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: 8>---

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Mark Rutland
On Thu, Oct 15, 2015 at 12:25:33PM +0100, Suzuki K. Poulose wrote: > On Thu, Oct 15, 2015 at 11:45:15AM +0100, Mark Rutland wrote: > > On Wed, Oct 14, 2015 at 04:13:47PM -0500, Jeremy Linton wrote: > > > On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: > > > > > > >+ * Checks if the selected granu

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Suzuki K. Poulose
On Thu, Oct 15, 2015 at 11:45:15AM +0100, Mark Rutland wrote: > On Wed, Oct 14, 2015 at 04:13:47PM -0500, Jeremy Linton wrote: > > On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: > > > > >+ * Checks if the selected granule size is supported by the CPU. > > >+ * If it doesn't park the CPU > > > >

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Mark Rutland
On Wed, Oct 14, 2015 at 04:13:47PM -0500, Jeremy Linton wrote: > On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: > > >+ * Checks if the selected granule size is supported by the CPU. > >+ * If it doesn't park the CPU > > The problem is when you park the boot CPU. > > I think for EFI there is a

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Mark Rutland
> >>+#define id_aa64mmfr0_tgran_shift ID_AA64MMFR0_TGRAN64_SHIFT > >>+#define id_aa64mmfr0_tgran_on ID_AA64MMFR0_TGRAN64_ON > >>+ > >>+#else > >>+ > >>+#define id_aa64mmfr0_tgran_shift ID_AA64MMFR0_TGRAN4_SHIFT > >>+#define id_aa64mmfr0_tgran_on ID_AA64MMFR0_TGRAN4_ON

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Suzuki K. Poulose
On 14/10/15 22:13, Jeremy Linton wrote: On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: + * Checks if the selected granule size is supported by the CPU. + * If it doesn't park the CPU The problem is when you park the boot CPU. I think for EFI there is a slightly better error mechanism. This

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-15 Thread Suzuki K. Poulose
On 14/10/15 18:24, Mark Rutland wrote: - * other registers depend on the function called upon completion + * Other registers depend on the function called upon completion. + * + * Checks if the selected granule size is supported by the CPU. + * If it doesn't park the CPU Nit: "If it isn't, par

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-14 Thread Jeremy Linton
On 10/14/2015 06:20 AM, Suzuki K. Poulose wrote: + * Checks if the selected granule size is supported by the CPU. + * If it doesn't park the CPU The problem is when you park the boot CPU. I think for EFI there is a slightly better error mechanism. This tweak will print an error and return to

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-14 Thread Mark Rutland
On Wed, Oct 14, 2015 at 06:24:18PM +0100, Mark Rutland wrote: > > @@ -613,10 +614,28 @@ ENDPROC(__secondary_switched) > > * x0 = SCTLR_EL1 value for turning on the MMU. > > * x27 = *virtual* address to jump to upon completion > > * > > - * other registers depend on the function called upon

Re: [PATCHv3 08/11] arm64: Check for selected granule support

2015-10-14 Thread Mark Rutland
> @@ -613,10 +614,28 @@ ENDPROC(__secondary_switched) > * x0 = SCTLR_EL1 value for turning on the MMU. > * x27 = *virtual* address to jump to upon completion > * > - * other registers depend on the function called upon completion > + * Other registers depend on the function called upon com