Skip to content

Commit ce44ed8

Browse files
committed
Merge: edac: Turin: Address translation using PRM
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5855 JIRA: https://issues.redhat.com/browse/RHEL-22695 Signed-off-by: Aristeu Rozanski <[email protected]> Approved-by: Mark Langsdorf <[email protected]> Approved-by: Lenny Szubowicz <[email protected]> Approved-by: Jiri Dluhos <[email protected]> Approved-by: David Arcari <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Augusto Caringi <[email protected]>
2 parents ae02f75 + d332191 commit ce44ed8

File tree

10 files changed

+356
-137
lines changed

10 files changed

+356
-137
lines changed

drivers/acpi/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ config ACPI_VIOT
589589

590590
config ACPI_PRMT
591591
bool "Platform Runtime Mechanism Support"
592-
depends on EFI && (X86_64 || ARM64)
592+
depends on EFI_RUNTIME_WRAPPERS && (X86_64 || ARM64)
593593
default y
594594
help
595595
Platform Runtime Mechanism (PRM) is a firmware interface exposing a

drivers/acpi/prmt.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,30 @@ static struct prm_handler_info *find_prm_handler(const guid_t *guid)
224224
#define UPDATE_LOCK_ALREADY_HELD 4
225225
#define UPDATE_UNLOCK_WITHOUT_LOCK 5
226226

227+
int acpi_call_prm_handler(guid_t handler_guid, void *param_buffer)
228+
{
229+
struct prm_handler_info *handler = find_prm_handler(&handler_guid);
230+
struct prm_module_info *module = find_prm_module(&handler_guid);
231+
struct prm_context_buffer context;
232+
efi_status_t status;
233+
234+
if (!module || !handler)
235+
return -ENODEV;
236+
237+
memset(&context, 0, sizeof(context));
238+
ACPI_COPY_NAMESEG(context.signature, "PRMC");
239+
context.identifier = handler->guid;
240+
context.static_data_buffer = handler->static_data_buffer_addr;
241+
context.mmio_ranges = module->mmio_info;
242+
243+
status = efi_call_acpi_prm_handler(handler->handler_addr,
244+
(u64)param_buffer,
245+
&context);
246+
247+
return efi_status_to_err(status);
248+
}
249+
EXPORT_SYMBOL_GPL(acpi_call_prm_handler);
250+
227251
/*
228252
* This is the PlatformRtMechanism opregion space handler.
229253
* @function: indicates the read/write. In fact as the PlatformRtMechanism
@@ -277,9 +301,9 @@ static acpi_status acpi_platformrt_space_handler(u32 function,
277301
context.static_data_buffer = handler->static_data_buffer_addr;
278302
context.mmio_ranges = module->mmio_info;
279303

280-
status = efi_call_virt_pointer(handler, handler_addr,
281-
handler->acpi_param_buffer_addr,
282-
&context);
304+
status = efi_call_acpi_prm_handler(handler->handler_addr,
305+
handler->acpi_param_buffer_addr,
306+
&context);
283307
if (status == EFI_SUCCESS) {
284308
buffer->prm_status = PRM_HANDLER_SUCCESS;
285309
} else {

0 commit comments

Comments
 (0)