lkml.org 
[lkml]   [2015]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCHv3 08/11] arm64: Check for selected granule support
From
Date
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 ((aa64mmfr0_el1 & 0xf) != ID_AA64MMFR0_TGRAN_SUPPORTED) {
>> + pr_efi_err(sys_table_arg, PAGE_SIZE_STR" granule not supported by the CPU\n");
>> + return EFI_UNSUPPORTED;
>> + }
>
>
> This is definitely an improvement over my original hack job.
>
> I would like to add, that I actually think this should be in a new function
> "check_kernel_compatibility" (or whatever) that is called before handle_kernel_image.
>
> That is because I don't really think it belongs in handle_kernel_image which is
> focused on relocation. Plus, if you add another function, you can avoid the
> "Failed to relocate kernel" error that comes out following the granule not supported message.
> Further, checks like this in the future will have a place to live.
>
> Of course you will then need a matching stubbed out function for the normal arm kernel as well.


OK, I will drop it from this series then and can be worked as a separate patch.

Thanks
Suzuki



\
 
 \ /
  Last update: 2015-10-15 17:21    [W:0.070 / U:0.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site