Message ID | 20250427075317.42687-1-qiyuzhu2@amd.com |
---|---|
State | New |
Headers | show |
Series | ACPI:PRM: Reduce unnecessary printing to avoid the worries of regular users | expand |
On Sun, Apr 27, 2025 at 9:54 AM Zhu Qiyu <qiyuzhu2@amd.com> wrote: > > Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM > handler and context") introduces non-essential printing "Failed > to find VA for GUID: 7626C6AE-F973-429C-A91C-107D7BE298B0, PA: 0x0" > which causes unnecessary worry for regular users. > > Refer to PRM Spec Section 4.1.2[1], both static data buffer address > and ACPI parameter buffer address may be NULL if they are not needed. > So there is no need to print out "Failed to find VA ... " to intimidate > regular users. > > Link: https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf # [1] > > Signed-off-by: Zhu Qiyu <qiyuzhu2@amd.com> > --- > drivers/acpi/prmt.c | 31 ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) > > diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c > index e549914a636c..fcd721559eb5 100644 > --- a/drivers/acpi/prmt.c > +++ b/drivers/acpi/prmt.c > @@ -72,7 +72,20 @@ struct prm_module_info { > struct prm_handler_info handlers[] __counted_by(handler_count); > }; > > -static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) > +enum prm_addr_type { > + PRM_HANDLER_ADDR, > + PRM_STATIC_DATA_BUFFER_ADDR, > + PRM_ACPI_PARAM_BUFFER_ADDR, > + PRM_ADD_TYPE_MAX, > +}; > + > +static char *prm_addr_type_name[PRM_ADD_TYPE_MAX] = { > + "handler", > + "static data buffer", > + "acpi param buffer", > +}; > + > +static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa, enum prm_addr_type type) > { > efi_memory_desc_t *md; > u64 pa_offset = pa & ~PAGE_MASK; > @@ -85,7 +98,12 @@ static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) > } > } > > - pr_warn("Failed to find VA for GUID: %pUL, PA: 0x%llx", guid, pa); Well, maybe just change the line above to something like: pr_info("VA for GUID: %pUL, PA: 0x%llx not found\n", guid, pa); which should look less intimidating? > + if (type == PRM_HANDLER_ADDR) > + pr_warn("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", > + prm_addr_type_name[type], guid, pa); > + else > + pr_debug("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", > + prm_addr_type_name[type], guid, pa); > > return 0; > } > @@ -153,13 +171,16 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) > > guid_copy(&th->guid, (guid_t *)handler_info->handler_guid); > th->handler_addr = > - (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address); > + (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address, > + PRM_HANDLER_ADDR); > > th->static_data_buffer_addr = > - efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address); > + efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address, > + PRM_STATIC_DATA_BUFFER_ADDR); > > th->acpi_param_buffer_addr = > - efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address); > + efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address, > + PRM_ACPI_PARAM_BUFFER_ADDR); > > } while (++cur_handler < tm->handler_count && (handler_info = get_next_handler(handler_info))); > > > base-commit: 9d7a0577c9db35c4cc52db90bc415ea248446472 > -- > 2.34.1 >
[AMD Official Use Only - AMD Internal Distribution Only] Hi Rafael, Thanks for the advice, I think your proposed changes are also reasonable. Patch v3 has been sent, please review. https://lore.kernel.org/linux-acpi/20250512011833.142204-1-qiyuzhu2@amd.com/ BRs Zhu Qiyu -----邮件原件----- 发件人: Rafael J. Wysocki <rafael@kernel.org> 发送时间: 2025年5月10日 2:44 收件人: Zhu, Qiyu <Qiyu.Zhu@amd.com> 抄送: rafael@kernel.org; lenb@kernel.org; linux-acpi@vger.kernel.org; linux-kernel@vger.kernel.org 主题: Re: [PATCH] ACPI:PRM: Reduce unnecessary printing to avoid the worries of regular users Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On Sun, Apr 27, 2025 at 9:54 AM Zhu Qiyu <qiyuzhu2@amd.com> wrote: > > Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM > handler and context") introduces non-essential printing "Failed to > find VA for GUID: 7626C6AE-F973-429C-A91C-107D7BE298B0, PA: 0x0" > which causes unnecessary worry for regular users. > > Refer to PRM Spec Section 4.1.2[1], both static data buffer address > and ACPI parameter buffer address may be NULL if they are not needed. > So there is no need to print out "Failed to find VA ... " to > intimidate regular users. > > Link: > https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Me > chanism%20-%20with%20legal%20notice.pdf # [1] > > Signed-off-by: Zhu Qiyu <qiyuzhu2@amd.com> > --- > drivers/acpi/prmt.c | 31 ++++++++++++++++++++++++++----- > 1 file changed, 26 insertions(+), 5 deletions(-) > > diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index > e549914a636c..fcd721559eb5 100644 > --- a/drivers/acpi/prmt.c > +++ b/drivers/acpi/prmt.c > @@ -72,7 +72,20 @@ struct prm_module_info { > struct prm_handler_info handlers[] > __counted_by(handler_count); }; > > -static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) > +enum prm_addr_type { > + PRM_HANDLER_ADDR, > + PRM_STATIC_DATA_BUFFER_ADDR, > + PRM_ACPI_PARAM_BUFFER_ADDR, > + PRM_ADD_TYPE_MAX, > +}; > + > +static char *prm_addr_type_name[PRM_ADD_TYPE_MAX] = { > + "handler", > + "static data buffer", > + "acpi param buffer", > +}; > + > +static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa, enum > +prm_addr_type type) > { > efi_memory_desc_t *md; > u64 pa_offset = pa & ~PAGE_MASK; @@ -85,7 +98,12 @@ static u64 > efi_pa_va_lookup(efi_guid_t *guid, u64 pa) > } > } > > - pr_warn("Failed to find VA for GUID: %pUL, PA: 0x%llx", guid, pa); Well, maybe just change the line above to something like: pr_info("VA for GUID: %pUL, PA: 0x%llx not found\n", guid, pa); which should look less intimidating? > + if (type == PRM_HANDLER_ADDR) > + pr_warn("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", > + prm_addr_type_name[type], guid, pa); > + else > + pr_debug("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", > + prm_addr_type_name[type], guid, pa); > > return 0; > } > @@ -153,13 +171,16 @@ acpi_parse_prmt(union acpi_subtable_headers > *header, const unsigned long end) > > guid_copy(&th->guid, (guid_t *)handler_info->handler_guid); > th->handler_addr = > - (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address); > + (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address, > + PRM_HANDLER_ADDR); > > th->static_data_buffer_addr = > - efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address); > + efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address, > + PRM_STATIC_DATA_BUFFER_ADDR); > > th->acpi_param_buffer_addr = > - efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address); > + efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address, > + PRM_ACPI_PARAM_BUFFER_ADDR); > > } while (++cur_handler < tm->handler_count && (handler_info = > get_next_handler(handler_info))); > > > base-commit: 9d7a0577c9db35c4cc52db90bc415ea248446472 > -- > 2.34.1 >
diff --git a/drivers/acpi/prmt.c b/drivers/acpi/prmt.c index e549914a636c..fcd721559eb5 100644 --- a/drivers/acpi/prmt.c +++ b/drivers/acpi/prmt.c @@ -72,7 +72,20 @@ struct prm_module_info { struct prm_handler_info handlers[] __counted_by(handler_count); }; -static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) +enum prm_addr_type { + PRM_HANDLER_ADDR, + PRM_STATIC_DATA_BUFFER_ADDR, + PRM_ACPI_PARAM_BUFFER_ADDR, + PRM_ADD_TYPE_MAX, +}; + +static char *prm_addr_type_name[PRM_ADD_TYPE_MAX] = { + "handler", + "static data buffer", + "acpi param buffer", +}; + +static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa, enum prm_addr_type type) { efi_memory_desc_t *md; u64 pa_offset = pa & ~PAGE_MASK; @@ -85,7 +98,12 @@ static u64 efi_pa_va_lookup(efi_guid_t *guid, u64 pa) } } - pr_warn("Failed to find VA for GUID: %pUL, PA: 0x%llx", guid, pa); + if (type == PRM_HANDLER_ADDR) + pr_warn("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", + prm_addr_type_name[type], guid, pa); + else + pr_debug("Failed to find %s VA for GUID: %pUL, PA: 0x%llx", + prm_addr_type_name[type], guid, pa); return 0; } @@ -153,13 +171,16 @@ acpi_parse_prmt(union acpi_subtable_headers *header, const unsigned long end) guid_copy(&th->guid, (guid_t *)handler_info->handler_guid); th->handler_addr = - (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address); + (void *)efi_pa_va_lookup(&th->guid, handler_info->handler_address, + PRM_HANDLER_ADDR); th->static_data_buffer_addr = - efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address); + efi_pa_va_lookup(&th->guid, handler_info->static_data_buffer_address, + PRM_STATIC_DATA_BUFFER_ADDR); th->acpi_param_buffer_addr = - efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address); + efi_pa_va_lookup(&th->guid, handler_info->acpi_param_buffer_address, + PRM_ACPI_PARAM_BUFFER_ADDR); } while (++cur_handler < tm->handler_count && (handler_info = get_next_handler(handler_info)));
Commit 088984c8d54c ("ACPI: PRM: Find EFI_MEMORY_RUNTIME block for PRM handler and context") introduces non-essential printing "Failed to find VA for GUID: 7626C6AE-F973-429C-A91C-107D7BE298B0, PA: 0x0" which causes unnecessary worry for regular users. Refer to PRM Spec Section 4.1.2[1], both static data buffer address and ACPI parameter buffer address may be NULL if they are not needed. So there is no need to print out "Failed to find VA ... " to intimidate regular users. Link: https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf # [1] Signed-off-by: Zhu Qiyu <qiyuzhu2@amd.com> --- drivers/acpi/prmt.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) base-commit: 9d7a0577c9db35c4cc52db90bc415ea248446472