mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Koba Ko <kobak@nvidia.com>
To: Aubrey Li <aubrey.li@linux.intel.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Len Brown <lenb@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	"Matthew R . Ochs" <mochs@nvidia.com>
Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shi Liu <aurelianliu@tencent.com>,
	All applicable <stable@vger.kernel.org>
Subject: Re: [PATCH] ACPI: PRM: Remove unnecessary strict handler address checks
Date: Sun, 26 Jan 2025 11:18:10 +0800	[thread overview]
Message-ID: <27ea8e21-062c-4b00-8331-115039398359@nvidia.com> (raw)
In-Reply-To: <20250126022250.3014210-1-aubrey.li@linux.intel.com>

Since static_data_buffer_addr and acpi_param_buffer_addr
  would be passed to FW and OS doesn't use these two,
the responsibility of check is transferred to FW.

Please have my
Reviewed-by: Koba Ko <kobak@nvidia.com>

On 1/26/25 10:22, Aubrey Li wrote:
> External email: Use caution opening links or attachments
>
>
> Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM
> handler and context") added unnecessary strict handler address checks,
> caused 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
>
> Fixes: 088984c8d54c ("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]
> ---
>   drivers/acpi/prmt.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c
> index 747f83f7114d..e549914a636c 100644
> --- a/drivers/acpi/prmt.c
> +++ b/drivers/acpi/prmt.c
> @@ -287,9 +287,7 @@ static acpi_status acpi_platformrt_space_handler(u32 function,
>                  if (!handler || !module)
>                          goto invalid_guid;
>
> -               if (!handler->handler_addr ||
> -                   !handler->static_data_buffer_addr ||
> -                   !handler->acpi_param_buffer_addr) {
> +               if (!handler->handler_addr) {
>                          buffer->prm_status = PRM_HANDLER_ERROR;
>                          return AE_OK;
>                  }
> --
> 2.34.1
>

  reply	other threads:[~2025-01-26  3:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-26  2:22 Aubrey Li
2025-01-26  3:18 ` Koba Ko [this message]
2025-02-01 16:23 ` Ard Biesheuvel
2025-02-05 20:17   ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27ea8e21-062c-4b00-8331-115039398359@nvidia.com \
    --to=kobak@nvidia.com \
    --cc=ardb@kernel.org \
    --cc=aubrey.li@linux.intel.com \
    --cc=aurelianliu@tencent.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochs@nvidia.com \
    --cc=rafael@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®