Skip to content

Conversation

@aubreyli
Copy link
Contributor

We fixed a customer PRM issue so update PRM module in velinux:

[0001] ACPI: PRM: Annotate struct prm_module_info with __counted_by
[0002] ACPI: PRM: Add PRM handler direct call support
[0003] ACPI: PRM: Remove unnecessary strict handler address checks

kees and others added 3 commits March 11, 2025 14:29
commit 2e89345 upstream.

Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct prm_module_info.

Intel-SIG: commit 2e89345 ACPI: PRM: Annotate struct prm_module_info with __counted_by.
Backport PRM update and bugfixes up to v6.14.

Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci # [1]
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Aubrey Li: amend commit log ]
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
commit f0fcdd2 upstream.

Platform Runtime Mechanism (PRM) handlers can be invoked from either the AML
interpreter or directly by an OS driver. Implement the latter.

  [ bp: Massage commit message. ]

Intel-SIG: commit f0fcdd2 PRM: Add PRM handler direct call support.
Backport PRM update and bugfixes up to v6.14.

Signed-off-by: John Allen <john.allen@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Yazen Ghannam <yazen.ghannam@amd.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20240730151731.15363-2-john.allen@amd.com
[ Aubrey Li: amend commit log ]
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
commit 7f5704b6a143b8eca640cba820968e798d065e91 upstream.

Commit 088984c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM
handler and context") added unnecessary strict handler address checks,
causing the PRM module to fail in translating memory error addresses.

Both static data buffer address and ACPI parameter buffer address may
be NULL if they are not needed, as described in section 4.1.2 PRM Handler
Information Structure of Platform Runtime Mechanism specification [1].

Here are two examples from real hardware:

----PRMT.dsl----

- staic data address is not used
[10Ch 0268   2]                     Revision : 0000
[10Eh 0270   2]                       Length : 002C
[110h 0272  16]                 Handler GUID : F6A58D47-E04F-4F5A-86B8-2A50D4AA109B
[120h 0288   8]              Handler address : 0000000065CE51F4
[128h 0296   8]           Satic Data Address : 0000000000000000
[130h 0304   8]       ACPI Parameter Address : 000000006522A718

- ACPI parameter address is not used
[1B0h 0432   2]                     Revision : 0000
[1B2h 0434   2]                       Length : 002C
[1B4h 0436  16]                 Handler GUID : 657E8AE6-A8FC-4877-BB28-42E7DE1899A5
[1C4h 0452   8]              Handler address : 0000000065C567C8
[1CCh 0460   8]           Satic Data Address : 000000006113FB98
[1D4h 0468   8]       ACPI Parameter Address : 0000000000000000

Intel-SIG: commit 7f5704b6a143 ACPI: PRM: Remove unnecessary strict handler address checks.
Backport PRM update and bugfixes up to v6.14.

Fixes: 088984c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context")
Reported-and-tested-by: Shi Liu <aurelianliu@tencent.com>
Cc: All applicable <stable@vger.kernel.org>
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
Link: https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf # [1]
Reviewed-by: Koba Ko <kobak@nvidia.com>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://patch.msgid.link/20250126022250.3014210-1-aubrey.li@linux.intel.com
[ rjw: Minor changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
[ Aubrey Li: amend commit log ]
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
@CLAassistant
Copy link

CLAassistant commented Mar 11, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 3 committers have signed the CLA.

✅ aubreyli
❌ kees
❌ jallen-amd
You have signed the CLA already but the status is still pending? Let us recheck it.

@aubreyli aubreyli changed the title ACPI: PRM: Backport PRM module updates and bugfixes up to v6.14 [6.6-velinux] ACPI: PRM: Backport PRM module updates and bugfixes up to v6.14 Mar 11, 2025
jackYoung0915 pushed a commit to jackYoung0915/kernel that referenced this pull request Aug 21, 2025
…fix-v1

[5.15][Revert] refactor hibmc driver to solve the compile error
x56Jason added a commit to openvelinux/kernel-intel that referenced this pull request Nov 10, 2025
…prm' into intel-6.6-velinux

We fixed a customer PRM issue so update PRM module in velinux:

[0001] ACPI: PRM: Annotate struct prm_module_info with __counted_by
[0002] ACPI: PRM: Add PRM handler direct call support
[0003] ACPI: PRM: Remove unnecessary strict handler address checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants