[Skiboot] [PATCH v2] core/init: Add ibm, processor-storage-keys property to /cpus DT node.

Michael Ellerman mpe at ellerman.id.au
Tue Sep 19 19:30:47 AEST 2017


Thiago Jung Bauermann <bauerman at linux.vnet.ibm.com> writes:
> Ram Pai <linuxram at us.ibm.com> writes:
>> On Fri, Sep 08, 2017 at 07:31:02PM -0300, Thiago Jung Bauermann wrote:
>>> diff --git a/core/init.c b/core/init.c
>>> index 8951e17b4c90..4a6f9155511d 100644
>>> --- a/core/init.c
>>> +++ b/core/init.c
>>> @@ -563,6 +563,22 @@ void __noreturn load_and_boot_kernel(bool is_reboot)
>>>  	start_kernel(kernel_entry, fdt, mem_top);
>>>  }
>>> 
>>> +static void storage_keys_fixup(void)
>>> +{
>>> +	/* P7 doesn't support instruction access keys. */
>>> +	const u32 insn_keys = (proc_gen == proc_gen_p7) ? 0 : 32;
>> 		
>> theortically we should be checking for earlier gens too.   right?
>> It should be
>> 	const u32 insn_keys = (proc_gen <= proc_gen_p7) ? 0 : 32;
>
> Theoretically yes, but if you look at the definition of the proc_gen enum:
>
>     /* Processor generation */
>     enum proc_gen {
>             proc_gen_unknown,
>             proc_gen_p7,		/* P7 and P7+ */
>             proc_gen_p8,
>             proc_gen_p9,
>     };
>     extern enum proc_gen proc_gen;
>
> In practice skiboot doesn't support anything older than a P7.

Even P7 is not "supported", just "it might work if you're lucky" type of
supported.

So arguably we shouldn't even advertise keys there, because no one is
likely to test it. But it's probably fine to do so, and if someone ever
tries it they can report bugs then.

cheers


More information about the Skiboot mailing list