Skip to content

Commit f82cdc3

Browse files
ruscurmpe
authored andcommitted
powerpc/pseries: Avoid hcall in plpks_is_available() on non-pseries
plpks_is_available() can be called on any platform via kexec but calls _plpks_get_config() which makes a hcall, which will only work on pseries. Fix this by returning early in plpks_is_available() if hcalls aren't possible. Fixes: 119da30 ("powerpc/pseries: Expose PLPKS config values, support additional fields") Reported-by: Murphy Zhou <[email protected]> Signed-off-by: Russell Currey <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent bec4646 commit f82cdc3

File tree

1 file changed

+4
-0
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+4
-0
lines changed

arch/powerpc/platforms/pseries/plpks.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <asm/hvcall.h>
2323
#include <asm/machdep.h>
2424
#include <asm/plpks.h>
25+
#include <asm/firmware.h>
2526

2627
static u8 *ospassword;
2728
static u16 ospasswordlength;
@@ -377,6 +378,9 @@ bool plpks_is_available(void)
377378
{
378379
int rc;
379380

381+
if (!firmware_has_feature(FW_FEATURE_LPAR))
382+
return false;
383+
380384
rc = _plpks_get_config();
381385
if (rc)
382386
return false;

0 commit comments

Comments
 (0)