Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

authored by

Haren Myneni and committed by
Madhavan Srinivasan
26b4fcec 043439ad

+35
+9
arch/powerpc/include/asm/rtas.h
··· 68 68 RTAS_FNIDX__IBM_READ_PCI_CONFIG, 69 69 RTAS_FNIDX__IBM_READ_SLOT_RESET_STATE, 70 70 RTAS_FNIDX__IBM_READ_SLOT_RESET_STATE2, 71 + RTAS_FNIDX__IBM_RECEIVE_HVPIPE_MSG, 71 72 RTAS_FNIDX__IBM_REMOVE_PE_DMA_WINDOW, 72 73 RTAS_FNIDX__IBM_RESET_PE_DMA_WINDOW, 73 74 RTAS_FNIDX__IBM_SCAN_LOG_DUMP, 75 + RTAS_FNIDX__IBM_SEND_HVPIPE_MSG, 74 76 RTAS_FNIDX__IBM_SET_DYNAMIC_INDICATOR, 75 77 RTAS_FNIDX__IBM_SET_EEH_OPTION, 76 78 RTAS_FNIDX__IBM_SET_SLOT_RESET, ··· 165 163 #define RTAS_FN_IBM_READ_PCI_CONFIG rtas_fn_handle(RTAS_FNIDX__IBM_READ_PCI_CONFIG) 166 164 #define RTAS_FN_IBM_READ_SLOT_RESET_STATE rtas_fn_handle(RTAS_FNIDX__IBM_READ_SLOT_RESET_STATE) 167 165 #define RTAS_FN_IBM_READ_SLOT_RESET_STATE2 rtas_fn_handle(RTAS_FNIDX__IBM_READ_SLOT_RESET_STATE2) 166 + #define RTAS_FN_IBM_RECEIVE_HVPIPE_MSG rtas_fn_handle(RTAS_FNIDX__IBM_RECEIVE_HVPIPE_MSG) 168 167 #define RTAS_FN_IBM_REMOVE_PE_DMA_WINDOW rtas_fn_handle(RTAS_FNIDX__IBM_REMOVE_PE_DMA_WINDOW) 169 168 #define RTAS_FN_IBM_RESET_PE_DMA_WINDOW rtas_fn_handle(RTAS_FNIDX__IBM_RESET_PE_DMA_WINDOW) 170 169 #define RTAS_FN_IBM_SCAN_LOG_DUMP rtas_fn_handle(RTAS_FNIDX__IBM_SCAN_LOG_DUMP) 170 + #define RTAS_FN_IBM_SEND_HVPIPE_MSG rtas_fn_handle(RTAS_FNIDX__IBM_SEND_HVPIPE_MSG) 171 171 #define RTAS_FN_IBM_SET_DYNAMIC_INDICATOR rtas_fn_handle(RTAS_FNIDX__IBM_SET_DYNAMIC_INDICATOR) 172 172 #define RTAS_FN_IBM_SET_EEH_OPTION rtas_fn_handle(RTAS_FNIDX__IBM_SET_EEH_OPTION) 173 173 #define RTAS_FN_IBM_SET_SLOT_RESET rtas_fn_handle(RTAS_FNIDX__IBM_SET_SLOT_RESET) ··· 221 217 #define RTAS_HARDWARE_ERROR -1 /* Hardware or other unspecified error. */ 222 218 #define RTAS_BUSY -2 /* Retry immediately. */ 223 219 #define RTAS_INVALID_PARAMETER -3 /* Invalid indicator/domain/sensor etc. */ 220 + #define RTAS_FUNC_NOT_SUPPORTED -5 /* Function not supported */ 224 221 #define RTAS_UNEXPECTED_STATE_CHANGE -7 /* Seems limited to EEH and slot reset. */ 225 222 #define RTAS_EXTENDED_DELAY_MIN 9900 /* Retry after delaying for ~1ms. */ 226 223 #define RTAS_EXTENDED_DELAY_MAX 9905 /* Retry after delaying for ~100s. */ ··· 238 233 #define RTAS_EPOW_WARNING 0x40000000 /* set bit 1 */ 239 234 #define RTAS_HOTPLUG_EVENTS 0x10000000 /* set bit 3 */ 240 235 #define RTAS_IO_EVENTS 0x08000000 /* set bit 4 */ 236 + #define RTAS_HVPIPE_MSG_EVENTS 0x04000000 /* set bit 5 */ 241 237 #define RTAS_EVENT_SCAN_ALL_EVENTS 0xffffffff 242 238 243 239 /* RTAS event severity */ ··· 288 282 #define RTAS_TYPE_DEALLOC 0xE3 289 283 #define RTAS_TYPE_DUMP 0xE4 290 284 #define RTAS_TYPE_HOTPLUG 0xE5 285 + #define RTAS_TYPE_HVPIPE 0xE6 291 286 /* I don't add PowerMGM events right now, this is a different topic */ 292 287 #define RTAS_TYPE_PMGM_POWER_SW_ON 0x60 293 288 #define RTAS_TYPE_PMGM_POWER_SW_OFF 0x61 ··· 381 374 #define PSERIES_ELOG_SECT_ID_HMC_ID (('H' << 8) | 'M') 382 375 #define PSERIES_ELOG_SECT_ID_EPOW (('E' << 8) | 'P') 383 376 #define PSERIES_ELOG_SECT_ID_IO_EVENT (('I' << 8) | 'E') 377 + #define PSERIES_ELOG_SECT_ID_HVPIPE_EVENT (('P' << 8) | 'E') 384 378 #define PSERIES_ELOG_SECT_ID_MANUFACT_INFO (('M' << 8) | 'I') 385 379 #define PSERIES_ELOG_SECT_ID_CALL_HOME (('C' << 8) | 'H') 386 380 #define PSERIES_ELOG_SECT_ID_USER_DEF (('U' << 8) | 'D') ··· 527 519 extern struct mutex rtas_ibm_set_dynamic_indicator_lock; 528 520 extern struct mutex rtas_ibm_get_dynamic_sensor_state_lock; 529 521 extern struct mutex rtas_ibm_physical_attestation_lock; 522 + extern struct mutex rtas_ibm_send_hvpipe_msg_lock; 530 523 531 524 #define GLOBAL_INTERRUPT_QUEUE 9005 532 525
+24
arch/powerpc/kernel/rtas.c
··· 98 98 DEFINE_MUTEX(rtas_ibm_get_indices_lock); 99 99 DEFINE_MUTEX(rtas_ibm_set_dynamic_indicator_lock); 100 100 DEFINE_MUTEX(rtas_ibm_get_dynamic_sensor_state_lock); 101 + DEFINE_MUTEX(rtas_ibm_receive_hvpipe_msg_lock); 102 + DEFINE_MUTEX(rtas_ibm_send_hvpipe_msg_lock); 101 103 102 104 static struct rtas_function rtas_function_table[] __ro_after_init = { 103 105 [RTAS_FNIDX__CHECK_EXCEPTION] = { ··· 375 373 [RTAS_FNIDX__IBM_READ_SLOT_RESET_STATE2] = { 376 374 .name = "ibm,read-slot-reset-state2", 377 375 }, 376 + [RTAS_FNIDX__IBM_RECEIVE_HVPIPE_MSG] { 377 + .name = "ibm,receive-hvpipe-msg", 378 + .filter = &(const struct rtas_filter) { 379 + .buf_idx1 = 0, .size_idx1 = 1, 380 + .buf_idx2 = -1, .size_idx2 = -1, 381 + }, 382 + /* 383 + * PAPR+ v2.13 R1–7.3.32.1 384 + */ 385 + .lock = &rtas_ibm_receive_hvpipe_msg_lock, 386 + }, 378 387 [RTAS_FNIDX__IBM_REMOVE_PE_DMA_WINDOW] = { 379 388 .name = "ibm,remove-pe-dma-window", 380 389 }, ··· 403 390 .buf_idx1 = 0, .size_idx1 = 1, 404 391 .buf_idx2 = -1, .size_idx2 = -1, 405 392 }, 393 + }, 394 + [RTAS_FNIDX__IBM_SEND_HVPIPE_MSG] { 395 + .name = "ibm,send-hvpipe-msg", 396 + .filter = &(const struct rtas_filter) { 397 + .buf_idx1 = 1, .size_idx1 = -1, 398 + .buf_idx2 = -1, .size_idx2 = -1, 399 + }, 400 + /* 401 + * PAPR+ v2.13 R1–7.3.32.2 402 + */ 403 + .lock = &rtas_ibm_send_hvpipe_msg_lock, 406 404 }, 407 405 [RTAS_FNIDX__IBM_SET_DYNAMIC_INDICATOR] = { 408 406 .name = "ibm,set-dynamic-indicator",
+2
arch/powerpc/kernel/rtasd.c
··· 89 89 return "Platform Resource Reassignment Event"; 90 90 case RTAS_TYPE_HOTPLUG: 91 91 return "Hotplug Event"; 92 + case RTAS_TYPE_HVPIPE: 93 + return "Hypervisor Pipe Notification event"; 92 94 } 93 95 94 96 return rtas_type[0];