"Aneesh Kumar K.V" <aneesh.ku...@linux.ibm.com> writes: >>> >>>> /* >>>> * Let's assume 32 pkeys on P8 bare metal, if its not >>>> defined by device >>>> * tree. We make this exception since skiboot forgot to >>>> expose this >>>> * property on power8. >>>> */ >>>> if (!firmware_has_feature(FW_FEATURE_LPAR) && >>>> - cpu_has_feature(CPU_FTRS_POWER8)) >>>> + early_cpu_has_feature(CPU_FTRS_POWER8)) >>>> pkeys_total = 32; >>> >>> That's not how cpu_has_feature() works, we'll need to fix that. >>> >>> cheers >>> >> >> I did a separate patch to handle that which switch the above to >> >> /* >> * Let's assume 32 pkeys on P8/P9 bare metal, if its not >> defined by device >> * tree. We make this exception since skiboot forgot to expose >> this >> * property on power8/9. >> */ >> if (!firmware_has_feature(FW_FEATURE_LPAR) && >> (early_cpu_has_feature(CPU_FTR_ARCH_207S) || >> early_cpu_has_feature(CPU_FTR_ARCH_300))) >> pkeys_total = 32; >> > > We should do a PVR check here i guess.
Yes, the ARCH features don't work because P10 will have both of those enabled. > ret = of_scan_flat_dt(dt_scan_storage_keys, &pkeys_total); > if (ret == 0) { > > /* > * Let's assume 32 pkeys on P8/P9 bare metal, if its not > defined by device > * tree. We make this exception since skiboot forgot to expose > this > * property on power8/9. Well, it does expose it on Power9 after v6.6, but most P9 systems have an older firmware than that. And also the kernel has been enabling that on Power9 because of the CPU_FTRS_POWER8 bug, so this is not actually a behaviour change. > */ > if (!firmware_has_feature(FW_FEATURE_LPAR) && > (pvr_version_is(PVR_POWER8) || pvr_version_is(PVR_POWER9))) > pkeys_total = 32; > } You need PVR_POWER8E and PVR_POWER8NVL as well. cheers