Subject: Re: [PATCH 2/3] powerpc/mm: Rename hpte_init_lpar() & put fallback in a header

From: Michael Ellerman <[email-masked]>
Date: Mon, 25 Jul 2016 20:36:12 +1000

Benjamin Herrenschmidt <[email-masked]> writes:

> On Mon, 2016-07-25 at 15:33 +1000, Michael Ellerman wrote:
>> When we detect a PS3 we set both PS3_LV1 and LPAR at the same time,
>> so
>> there should be no way they can get out of sync, other than due to a
>> bug in the code.
>
> I thought I had changed PS3 to no longer set LPAR ?

Nope:

FW_FEATURE_PS3_POSSIBLE = FW_FEATURE_LPAR | FW_FEATURE_PS3_LV1,

...

#ifdef CONFIG_PPC_PS3
	/* Identify PS3 firmware */
	if (of_flat_dt_is_compatible(of_get_flat_dt_root(), "sony,ps3"))
		powerpc_firmware_features |= FW_FEATURE_PS3_POSSIBLE;
#endif

> I like having a flag that basically says PAPR and that's pretty much
> what LPAR is, in fact I think I've been using it elsewhere with that
> meaning

That would be nice, but these look fishy at least:

arch/powerpc/platforms/cell/spu_manage.c:       if (!firmware_has_feature(FW_FEATURE_LPAR))
arch/powerpc/platforms/cell/spu_manage.c:       if (!firmware_has_feature(FW_FEATURE_LPAR)) {
arch/powerpc/platforms/cell/spu_manage.c:       if (!firmware_has_feature(FW_FEATURE_LPAR))
arch/powerpc/platforms/pasemi/iommu.c:      !firmware_has_feature(FW_FEATURE_LPAR)) {
drivers/net/ethernet/pasemi/pasemi_mac.c:       return firmware_has_feature(FW_FEATURE_LPAR);

cheers