Public bug reported:

[Description]
PRMT needs to find the correct type of block to
translate the PA-VA mapping for EFI runtime services.

The issue arises because the PRMT is finding a block of type
EFI_CONVENTIONAL_MEMORY, which is not appropriate for runtime services
as described in Section 2.2.2 (Runtime Services) of the UEFI
Specification [1]. Since the PRM handler is a type of runtime service,
this causes an exception when the PRM handler is called.

[Firmware Bug]: Unable to handle paging request in EFI runtime service
WARNING: CPU: 22 PID: 4330 at drivers/firmware/efi/runtime-wrappers.c:341
    __efi_queue_work+0x11c/0x170
Call trace:
  __efi_queue_work+0x11c/0x170
  efi_call_acpi_prm_handler+0x68/0xd0
  acpi_platformrt_space_handler+0x198/0x258
  acpi_ev_address_space_dispatch+0x144/0x388
  acpi_ex_access_region+0x9c/0x118
  acpi_ex_write_serial_bus+0xc4/0x218
  acpi_ex_write_data_to_field+0x168/0x218
  acpi_ex_store_object_to_node+0x1a8/0x258
  acpi_ex_store+0xec/0x330
  acpi_ex_opcode_1A_1T_1R+0x15c/0x618
  acpi_ds_exec_end_op+0x274/0x548
  acpi_ps_parse_loop+0x10c/0x6b8
  acpi_ps_parse_aml+0x140/0x3b0
  acpi_ps_execute_method+0x12c/0x2a0
  acpi_ns_evaluate+0x210/0x310
  acpi_evaluate_object+0x178/0x358
  acpi_proc_write+0x1a8/0x8a0 [acpi_call]
  proc_reg_write+0xcc/0x150
  vfs_write+0xd8/0x380
  ksys_write+0x70/0x120
  __arm64_sys_write+0x24/0x48
  invoke_syscall.constprop.0+0x80/0xf8
  do_el0_svc+0x50/0x110
  el0_svc+0x48/0x1d0
  el0t_64_sync_handler+0x15c/0x178
  el0t_64_sync+0x1a8/0x1b0
Find a block with specific type to fix this.
prmt find a block with EFI_RUNTIME_SERVICES_DATA for prm handler and find a 
block with EFI_RUNTIME_SERVICES_CODE for prm context. If no suitable block is 
found, a warning message will be prompted but the procedue continues to manage 
the next prm handler. However, if the prm handler is actullay called without 
proper allocation, it would result in a failure during error handling.

By using the correct memory types for runtime services, Ensure that the PRM 
handler and the context are
properly mapped in the virtual address space during runtime, preventing the 
paging request error.

[1]
https://uefi.org/sites/default/files/resources/UEFI_Spec_2_10_Aug29.pdf

Fixes: cefc7ca ("ACPI: PRM: implement OperationRegion handler for the 
PlatformRtMechanism subtype")
[backported from 
https://patchwork.kernel.org/project/linux-acpi/patch/20240911155536.3900579-1-ko...@nvidia.com/]

Reviewed-by: Matthew R. Ochs mo...@nvidia.com
Tested-by: Andrew Adriance aadria...@nvidia.com

[Test Plan]

1. With SBIOS 2.3.1, there's a PRM callback in sbios.
2. boot into shell
3. check the result
```
modprobe acpi-call
echo '\_SB.CPER._DSM {0x43, 0x19, 0x1F, 0xF1, 0x02, 0x5B, 0x1B, 0x4B, 0xAC, 
0x54, 0xFC, 0x6D, 0xB4, 0x21, 0xC5, 0x5B} 0 0' > /proc/acpi/call
cat /proc/acpi/call
```

[[Where problems could occur]]
Low, w/o target sbios, would not get the callback from sbios.

** Affects: linux-nvidia (Ubuntu)
     Importance: Undecided
     Assignee: koba (kobako)
         Status: In Progress

** Changed in: linux-nvidia (Ubuntu)
       Status: New => In Progress

** Changed in: linux-nvidia (Ubuntu)
     Assignee: (unassigned) => koba (kobako)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2081874

Title:
  NVIDIA: SAUCE: acpi/prmt: find block with specific type

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-nvidia/+bug/2081874/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to