[PW_SID:1069064] ACPI: Unify CPU UID interface and fix ARM64 TPH steer-tag issue#1642
[PW_SID:1069064] ACPI: Unify CPU UID interface and fix ARM64 TPH steer-tag issue#1642linux-riscv-bot wants to merge 7 commits intoworkflow__riscv__fixesfrom
Conversation
Add arch-specific acpi_get_cpu_uid() for arm64, and update dependent code: - Declare acpi_get_cpu_uid() in arch/arm64/include/asm/acpi.h - Implement acpi_get_cpu_uid() with input parameter validation - Replace get_acpi_id_for_cpu() with acpi_get_cpu_uid() in drivers/perf/arm_cspmu/arm_cspmu.c - Reimplement get_cpu_for_acpi_id() based on acpi_get_cpu_uid() (to align with new interface) and move its implementation next to acpi_get_cpu_uid() This is the first step towards unifying ACPI CPU UID retrieval interface across architectures, while adding input validation for robustness. Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add arch-specific acpi_get_cpu_uid() for loongarch: - Declare acpi_get_cpu_uid() in arch/loongarch/include/asm/acpi.h - Implement acpi_get_cpu_uid() with input parameter validation Align loongarch with the new unified ACPI CPU UID retrieval interface, preparing for replacement of the legacy get_acpi_id_for_cpu() (to be removed in follow-up patches). Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add arch-specific acpi_get_cpu_uid() for riscv: - Declare acpi_get_cpu_uid() in arch/riscv/include/asm/acpi.h - Implement acpi_get_cpu_uid() with input parameter validation - Switch rhct.c and arch/riscv/kernel/acpi_numa.c to use acpi_get_cpu_uid() instead of get_acpi_id_for_cpu() This aligns riscv with the unified ACPI CPU UID interface, improving input validation and consistency across ACPI-enabled platforms. Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
Add arch-specific acpi_get_cpu_uid() for x86: - Declare acpi_get_cpu_uid() in arch/x86/include/asm/acpi.h - Implement acpi_get_cpu_uid() with input parameter validation - Replace cpu_acpi_id() with acpi_get_cpu_uid() in Xen-related code - Remove the now-unused cpu_acpi_id() function Extend the unified ACPI CPU UID interface to x86, ensuring consistent error handling and input validation across all ACPI-enabled architectures. Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
- Add acpi_get_cpu_uid() prototype to include/linux/acpi.h (global scope) - Remove arch-specific acpi_get_cpu_uid() declarations from arm64/loongarch/riscv/x86 asm/acpi.h This centralizes the interface declaration for consistency, avoiding duplicate prototypes across architectures and simplifying future maintenance. Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
- Convert acpi/pptt.c to use acpi_get_cpu_uid() instead of get_acpi_id_for_cpu() - Remove unused get_acpi_id_for_cpu() implementations from arm64/loongarch/riscv This completes the migration to the unified ACPI CPU UID interface for PPTT code, and cleans up legacy unused functions to reduce technical debt. Cc: stable@vger.kernel.org Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com> Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
pcie_tph_get_cpu_st() is broken on ARM64:
1. pcie_tph_get_cpu_st() passes cpu_uid to the PCI ACPI DSM method.
cpu_uid should be the ACPI Processor UID [1].
2. In BNXT, pcie_tph_get_cpu_st() is passed a cpu_uid obtained via
cpumask_first(irq->cpu_mask) - the logical CPU ID of a CPU core,
generated and managed by kernel (e.g., [0,255] for a system with 256
logical CPU cores).
3. On ARM64 platforms, ACPI assigns Processor UID to cores listed in the
MADT table, and this UID may not match the kernel's logical CPU ID.
When this occurs, the mismatch results in the wrong CPU steer-tag.
4. On AMD x86 the logical CPU ID is identical to the ACPI Processor UID
so the mismatch is not seen.
Resolution:
1. Use acpi_get_cpu_uid() in pcie_tph_get_cpu_st() to translate from
logical CPU ID to ACPI Processor UID needed for the DSM call.
2. Rename pcie_tpu_get_cpu_st() parameter from cpu_uid to cpu to
reflect that it is a logical CPU_ID.
[1] According to ECN_TPH-ST_Revision_20200924
(https://members.pcisig.com/wg/PCI-SIG/document/15470), the input
is defined as: "If the target is a processor, then this field
represents the ACPI Processor UID of the processor as specified in
the MADT. If the target is a processor container, then this field
represents the ACPI Processor UID of the processor container as
specified in the PPTT."
Fixes: d2e8a34 ("PCI/TPH: Add Steering Tag support")
Cc: stable@vger.kernel.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Linux RISC-V bot <linux.riscv.bot@gmail.com>
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users" |
|
Patch 4: "[v9,4/7] x86/acpi: Add acpi_get_cpu_uid() implementation and update Xen users" |
PR for series 1069064 applied to workflow__riscv__fixes
Name: ACPI: Unify CPU UID interface and fix ARM64 TPH steer-tag issue
URL: https://patchwork.kernel.org/project/linux-riscv/list/?series=1069064
Version: 9