Skip to content

Commit 0061533

Browse files
author
Mamatha Inamdar
committed
powerpc/pseries: Define HVPIPE specific macros
JIRA: https://issues.redhat.com/browse/RHEL-101849 Conflicts: backport upstream commit 26b4fce - RH 9.x commit ("powerpc/pseries: Add papr-vpd character driver for VPD retrieval") made changes to avoid backporting all of adf7a01 and some preceding commits it depends on (i.e. the table-based RTAS function lookup infrastructure introduced upstream by 8252b88 ("powerpc/rtas: improve function information lookups"). So this back-port ignored macros such as RTAS_FNIDX__IBM_*) - Change in find_rtas_mutex() to get mutexes for ibm,receive-hvpipe-msg and ibm,send-hvpipe-msg RTAS calls. commit 26b4fce Author: Haren Myneni <haren@linux.ibm.com> Date: Tue Sep 9 01:43:54 2025 -0700 powerpc/pseries: Define HVPIPE specific macros Define HVPIPE specific macros which are needed to support ibm,send-hvpipe-msg and ibm,receive-hvpipe-msg RTAS calls and used to handle HVPIPE message events. 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-3-haren@linux.ibm.com Signed-off-by: Mamatha Inamdar <minamdar@redhat.com>
1 parent 6f98266 commit 0061533

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

arch/powerpc/include/asm/rtas.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#define RTAS_HARDWARE_ERROR -1 /* Hardware Error */
2828
#define RTAS_BUSY -2 /* RTAS Busy */
2929
#define RTAS_INVALID_PARAMETER -3 /* Invalid indicator/domain/sensor etc. */
30+
#define RTAS_FUNC_NOT_SUPPORTED -5 /* Function not supported */
3031
#define RTAS_EXTENDED_DELAY_MIN 9900
3132
#define RTAS_EXTENDED_DELAY_MAX 9905
3233

@@ -56,6 +57,7 @@
5657
#define RTAS_EPOW_WARNING 0x40000000 /* set bit 1 */
5758
#define RTAS_HOTPLUG_EVENTS 0x10000000 /* set bit 3 */
5859
#define RTAS_IO_EVENTS 0x08000000 /* set bit 4 */
60+
#define RTAS_HVPIPE_MSG_EVENTS 0x04000000 /* set bit 5 */
5961
#define RTAS_EVENT_SCAN_ALL_EVENTS 0xffffffff
6062

6163
/* RTAS event severity */
@@ -105,6 +107,7 @@
105107
#define RTAS_TYPE_DEALLOC 0xE3
106108
#define RTAS_TYPE_DUMP 0xE4
107109
#define RTAS_TYPE_HOTPLUG 0xE5
110+
#define RTAS_TYPE_HVPIPE 0xE6
108111
/* I don't add PowerMGM events right now, this is a different topic */
109112
#define RTAS_TYPE_PMGM_POWER_SW_ON 0x60
110113
#define RTAS_TYPE_PMGM_POWER_SW_OFF 0x61
@@ -197,6 +200,7 @@ inline uint32_t rtas_ext_event_company_id(struct rtas_ext_event_log_v6 *ext_log)
197200
#define PSERIES_ELOG_SECT_ID_HMC_ID (('H' << 8) | 'M')
198201
#define PSERIES_ELOG_SECT_ID_EPOW (('E' << 8) | 'P')
199202
#define PSERIES_ELOG_SECT_ID_IO_EVENT (('I' << 8) | 'E')
203+
#define PSERIES_ELOG_SECT_ID_HVPIPE_EVENT (('P' << 8) | 'E')
200204
#define PSERIES_ELOG_SECT_ID_MANUFACT_INFO (('M' << 8) | 'I')
201205
#define PSERIES_ELOG_SECT_ID_CALL_HOME (('C' << 8) | 'H')
202206
#define PSERIES_ELOG_SECT_ID_USER_DEF (('U' << 8) | 'D')
@@ -341,6 +345,7 @@ extern struct mutex rtas_ibm_get_indices_lock;
341345
extern struct mutex rtas_ibm_set_dynamic_indicator_lock;
342346
extern struct mutex rtas_ibm_get_dynamic_sensor_state_lock;
343347
extern struct mutex rtas_ibm_physical_attestation_lock;
348+
extern struct mutex rtas_ibm_send_hvpipe_msg_lock;
344349

345350
#define GLOBAL_INTERRUPT_QUEUE 9005
346351

arch/powerpc/kernel/rtas.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ DEFINE_MUTEX(rtas_ibm_get_vpd_lock);
8181
DEFINE_MUTEX(rtas_ibm_get_indices_lock);
8282
DEFINE_MUTEX(rtas_ibm_set_dynamic_indicator_lock);
8383
DEFINE_MUTEX(rtas_ibm_get_dynamic_sensor_state_lock);
84+
DEFINE_MUTEX(rtas_ibm_receive_hvpipe_msg_lock);
85+
DEFINE_MUTEX(rtas_ibm_send_hvpipe_msg_lock);
8486

8587
/* RTAS use home made raw locking instead of spin_lock_irqsave
8688
* because those can be called from within really nasty contexts
@@ -1012,6 +1014,8 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
10121014
{ "ibm,update-properties", -1, 0, -1, -1, -1, 4096 },
10131015
#endif
10141016
{ "ibm,physical-attestation", -1, 0, 1, -1, -1 },
1017+
{ "ibm,receive-hvpipe-msg", -1, 0, 1, -1, -1 },
1018+
{ "ibm,send-hvpipe-msg", -1, 1, -1, -1, -1 },
10151019
};
10161020

10171021
static bool in_rmo_buf(u32 base, u32 end)
@@ -1134,6 +1138,12 @@ static struct mutex *find_rtas_mutex(int token)
11341138
if (token == rtas_token("ibm,physical-attestation"))
11351139
return &rtas_ibm_physical_attestation_lock;
11361140

1141+
if (token == rtas_token("ibm,receive-hvpipe-msg"))
1142+
return &rtas_ibm_receive_hvpipe_msg_lock;
1143+
1144+
if (token == rtas_token("ibm,send-hvpipe-msg"))
1145+
return &rtas_ibm_send_hvpipe_msg_lock;
1146+
11371147
return NULL;
11381148
}
11391149

arch/powerpc/kernel/rtasd.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ static char *rtas_event_type(int type)
8989
return "Platform Resource Reassignment Event";
9090
case RTAS_TYPE_HOTPLUG:
9191
return "Hotplug Event";
92+
case RTAS_TYPE_HVPIPE:
93+
return "Hypervisor Pipe Notification event";
9294
}
9395

9496
return rtas_type[0];

0 commit comments

Comments
 (0)