Re: [PATCH v3 10/18] powerpc/vas, nx-842: Define and use chip_to_vas_id()
From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2017-11-22 11:56:59
Also in:
lkml
Josh Boyer [off-list ref] writes:
On Tue, Nov 7, 2017 at 9:23 PM, Sukadev Bhattiprolu [off-list ref] wrote:
...
quoted
diff --git a/arch/powerpc/platforms/powernv/vas.c b/arch/powerpc/platforms/powernv/vas.c index abb7090..cd9a733 100644 --- a/arch/powerpc/platforms/powernv/vas.c +++ b/arch/powerpc/platforms/powernv/vas.c@@ -123,6 +123,17 @@ struct vas_instance *find_vas_instance(int vasid) return NULL; } +int chip_to_vas_id(int chipid) +{ + int cpu; + + for_each_possible_cpu(cpu) { + if (cpu_to_chip_id(cpu) == chipid) + return per_cpu(cpu_vas_id, cpu); + } + return -1; +} +Likely need an EXPORT_SYMBOL here?
Yep.
quoted
diff --git a/drivers/crypto/nx/nx-842-powernv.c b/drivers/crypto/nx/nx-842-powernv.c index 874ddf5..eb221ed 100644 --- a/drivers/crypto/nx/nx-842-powernv.c +++ b/drivers/crypto/nx/nx-842-powernv.cDid anyone test this driver built as a module with this commit included?
Clearly not. I build allmodconfig: http://kisskb.ellerman.id.au/kisskb/buildresult/13207275/ Which was green. But that doesn't enable this driver because it depends on PPC_VAS, which depends on PPC_64K_PAGES, and allmodconfig chooses 4K pages because that's the default in Kconfig. I've added a config with allmodconfig + 64K pages to catch this in future: http://kisskb.ellerman.id.au/kisskb/buildresult/13213014/ And we should probably flip 64K pages to be the default for 64-bit Book3S as well, all contemporary CPUs are designed for it. cheers