[PATCH v3 3/9] powerpc/pseries: Add papr-hvpipe char driver for HVPIPE interfaces
Tyrel Datwyler
tyreld at linux.ibm.com
Sat Aug 30 05:44:52 AEST 2025
On 8/28/25 4:08 PM, Haren Myneni wrote:
> The hypervisor provides ibm,send-hvpipe-msg and
> ibm,receive-hvpipe-msg RTAS calls which can be used by the
> partition to communicate through an inband hypervisor channel with
> different external sources such as Hardware Management Console
> (HMC). The information exchanged, whether it be messages, raw or
> formatted data, etc., is only known to between applications in the
> OS and the source (HMC). This patch adds papr-hvpipe character
> driver and provides the standard interfaces such as open / ioctl/
> read / write to user space for exchanging information with HMC
> using send/recevive HVPIPE RTAS functions.
>
> PAPR (7.3.32 Hypervisor Pipe Information Exchange) defines the
> HVPIPE usage:
> - The hypervisor has one HVPIPE per partition for all sources.
> - OS can determine this feature’s availability by detecting the
> “ibm,hypervisor-pipe-capable” property in the /rtas node of the
> device tree.
> - Each source is represented by the source ID which is used in
> send / recv HVPIPE RTAS. (Ex: source ID is the target for the
> payload in send RTAS).
> - Return status of ibm,send-hvpipe-msg can be considered as
> delivered the payload.
> - Return status of ibm,receive-hvpipe-msg can be considered as
> ACK to source.
> - The hypervisor generates hvpipe message event interrupt when
> the partition has the payload to receive.
>
> Provide the interfaces to the user space with /dev/papr-hvpipe
> character device using the following programming model:
>
> int devfd = open("/dev/papr-hvpipe")
> int fd = ioctl(devfd, PAPR_HVPIPE_IOC_CREATE_HANDLE, &srcID);
> - Restrict the user space to use the same source ID and do not
> expect more than one process access with the same source.
> char *buf = malloc(size);
> - SIZE should be 4K and the buffer contains header and the
> payload.
> length = write(fd, buf, size);
> - OS issues ibm,send-hvpipe-msg RTAS and returns the RTAS status
> to the user space.
> ret = poll(fd,...)
> - The HVPIPE event message IRQ wakes up for any waiting FDs.
> length = read(fd, buf, size);
> - OS issues ibm,receive-hvpipe-msg to receive payload from the
> hypervisor.
> release(fd);
> - OS issues ibm,receive-hvpipe-msg if any payload is pending so
> that pipe is not blocked.
>
> The actual implementation of these calls are added in the
> next patches.
>
> Signed-off-by: Haren Myneni <haren at linux.ibm.com>
> Reviewed-by: Mahesh Salgaonkar <mahesh at linux.ibm.com>
> Tested-by: Shashank MS <shashank.gowda at in.ibm.com>
> ---
Reviewed-by: Tyrel Datwyler <tyreld at linux.ibm.com>
More information about the Linuxppc-dev
mailing list