Skip to content

Commit 62f4211

Browse files
author
Mamatha Inamdar
committed
powerpc/pseries: Enable hvpipe with ibm,set-system-parameter RTAS
JIRA: https://issues.redhat.com/browse/RHEL-101959 commit 39a08a4 Author: Haren Myneni <haren@linux.ibm.com> Date: Tue Sep 9 01:44:00 2025 -0700 powerpc/pseries: Enable hvpipe with ibm,set-system-parameter RTAS The partition uses “Hypervisor Pipe OS Enablement Notification” system parameter token (value = 64) to enable / disable hvpipe in the hypervisor. Once hvpipe is enabled, the hypervisor notifies OS if the payload is pending for that partition from any source. This system parameter token takes 1 byte length of data with 1 = Enable and 0 = Disable. Enable hvpipe in the hypervisor with ibm,set-system-parameter RTAS after registering hvpipe event source interrupt. Signed-off-by: Haren Myneni <haren@linux.ibm.com> Tested-by: Shashank MS <shashank.gowda@in.ibm.com> Reviewed-by: Mahesh Salgaonkar <mahesh@linux.ibm.com> Reviewed-by: Tyrel Datwyler <tyreld@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20250909084402.1488456-9-haren@linux.ibm.com Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
1 parent ddd5bb9 commit 62f4211

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

arch/powerpc/include/asm/papr-sysparm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ typedef struct {
2121
#define PAPR_SYSPARM_COOP_MEM_OVERCOMMIT_ATTRS mk_papr_sysparm(44)
2222
#define PAPR_SYSPARM_TLB_BLOCK_INVALIDATE_ATTRS mk_papr_sysparm(50)
2323
#define PAPR_SYSPARM_LPAR_NAME mk_papr_sysparm(55)
24+
#define PAPR_SYSPARM_HVPIPE_ENABLE mk_papr_sysparm(64)
2425

2526
/**
2627
* struct papr_sysparm_buf - RTAS work area layout for system parameter functions.

arch/powerpc/platforms/pseries/papr-hvpipe.c

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <asm/machdep.h>
1616
#include <asm/rtas.h>
1717
#include <asm/rtas-work-area.h>
18+
#include <asm/papr-sysparm.h>
1819
#include <uapi/asm/papr-hvpipe.h>
1920
#include "pseries.h"
2021
#include "papr-hvpipe.h"
@@ -648,6 +649,32 @@ static irqreturn_t hvpipe_event_interrupt(int irq, void *dev_id)
648649
return IRQ_HANDLED;
649650
}
650651

652+
/*
653+
* Enable hvpipe by system parameter set with parameter
654+
* token = 64 and with 1 byte buffer data:
655+
* 0 = hvpipe not in use/disable
656+
* 1 = hvpipe in use/enable
657+
*/
658+
static int set_hvpipe_sys_param(u8 val)
659+
{
660+
struct papr_sysparm_buf *buf;
661+
int ret;
662+
663+
buf = papr_sysparm_buf_alloc();
664+
if (!buf)
665+
return -ENOMEM;
666+
667+
buf->len = cpu_to_be16(1);
668+
buf->val[0] = val;
669+
ret = papr_sysparm_set(PAPR_SYSPARM_HVPIPE_ENABLE, buf);
670+
if (ret)
671+
pr_err("Can not enable hvpipe %d\n", ret);
672+
673+
papr_sysparm_buf_free(buf);
674+
675+
return ret;
676+
}
677+
651678
static int __init enable_hvpipe_IRQ(void)
652679
{
653680
struct device_node *np;
@@ -705,8 +732,11 @@ static int __init papr_hvpipe_init(void)
705732
}
706733

707734
ret = enable_hvpipe_IRQ();
708-
if (!ret)
709-
ret = misc_register(&papr_hvpipe_dev);
735+
if (!ret) {
736+
ret = set_hvpipe_sys_param(1);
737+
if (!ret)
738+
ret = misc_register(&papr_hvpipe_dev);
739+
}
710740

711741
if (!ret) {
712742
pr_info("hvpipe feature is enabled\n");

0 commit comments

Comments
 (0)