Skip to content

[PW_SID:1069064] ACPI: Unify CPU UID interface and fix ARM64 TPH steer-tag issue#1642

Open
linux-riscv-bot wants to merge 7 commits intoworkflow__riscv__fixesfrom
pw1069064
Open

[PW_SID:1069064] ACPI: Unify CPU UID interface and fix ARM64 TPH steer-tag issue#1642
linux-riscv-bot wants to merge 7 commits intoworkflow__riscv__fixesfrom
pw1069064

Conversation

@linux-riscv-bot
Copy link

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

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>
@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 135.49 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1020.52 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1373.00 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.40 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.94 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.13 seconds
Result: WARNING
Output:

CHECK: Please use a blank line after function/struct/union/enum declarations
#50: FILE: arch/arm64/include/asm/acpi.h:121:
 }
+int acpi_get_cpu_uid(unsigned int cpu, u32 *uid);

WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?

total: 0 errors, 1 warnings, 1 checks, 72 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit af2e518c4300 ("arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 1 checks, 72 lines checked
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?


@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 82.61 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
kdoc
Desc: Detects for kdoc errors
Duration: 0.84 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.23 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 1: "[v9,1/7] arm64/acpi: Add acpi_get_cpu_uid() and switch arm_cspmu to use it"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.32 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 140.81 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 990.72 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1335.77 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.56 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.53 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.05 seconds
Result: WARNING
Output:

CHECK: Please use a blank line after function/struct/union/enum declarations
#32: FILE: arch/loongarch/include/asm/acpi.h:47:
 }
+int acpi_get_cpu_uid(unsigned int cpu, u32 *uid);

WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?

total: 0 errors, 1 warnings, 1 checks, 19 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 2c7d622d489d ("loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 1 checks, 19 lines checked
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?


@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 83.36 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
kdoc
Desc: Detects for kdoc errors
Duration: 0.92 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
module-param
Desc: Detect module_param changes
Duration: 0.27 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 2: "[v9,2/7] loongarch/acpi: Add acpi_get_cpu_uid() declaration and implementation"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.33 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 137.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
build-rv64-clang-allmodconfig
Desc: Builds riscv64 allmodconfig with Clang, and checks for errors and added warnings
Duration: 1319.60 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
build-rv64-gcc-allmodconfig
Desc: Builds riscv64 allmodconfig with GCC, and checks for errors and added warnings
Duration: 1921.98 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
build-rv64-nommu-k210-defconfig
Desc: Builds riscv64 defconfig with NOMMU for K210
Duration: 26.15 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
build-rv64-nommu-k210-virt
Desc: Builds riscv64 defconfig with NOMMU for the virt platform
Duration: 27.71 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
checkpatch
Desc: Runs checkpatch.pl on the patch
Duration: 2.37 seconds
Result: WARNING
Output:

CHECK: Please use a blank line after function/struct/union/enum declarations
#35: FILE: arch/riscv/include/asm/acpi.h:68:
 }
+int acpi_get_cpu_uid(unsigned int cpu, u32 *uid);

WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?

total: 0 errors, 1 warnings, 1 checks, 59 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 04f0fb59b585 ("riscv/acpi: Add acpi_get_cpu_uid() implementation and update users") has style problems, please review.

NOTE: Ignored message types: ALLOC_SIZEOF_STRUCT CAMELCASE COMMIT_LOG_LONG_LINE GIT_COMMIT_ID MACRO_ARG_REUSE NO_AUTHOR_SIGN_OFF

NOTE: If any of the errors are false positives, please report
      them to the maintainer, see CHECKPATCH in MAINTAINERS.
total: 0 errors, 1 warnings, 1 checks, 59 lines checked
CHECK: Please use a blank line after function/struct/union/enum declarations
WARNING: The commit message has 'stable@', perhaps it also needs a 'Fixes:' tag?


@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
dtb-warn-rv64
Desc: Checks for Device Tree warnings/errors
Duration: 81.20 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
header-inline
Desc: Detects static functions without inline keyword in header files
Duration: 0.24 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
kdoc
Desc: Detects for kdoc errors
Duration: 0.89 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
module-param
Desc: Detect module_param changes
Duration: 0.26 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
verify-fixes
Desc: Verifies that the Fixes: tags exist
Duration: 5.29 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 3: "[v9,3/7] riscv/acpi: Add acpi_get_cpu_uid() implementation and update users"
verify-signedoff
Desc: Verifies that Signed-off-by: tags are correct
Duration: 0.47 seconds
Result: PASS

@linux-riscv-bot
Copy link
Author

Patch 4: "[v9,4/7] x86/acpi: Add acpi_get_cpu_uid() implementation and update Xen users"
build-rv32-defconfig
Desc: Builds riscv32 defconfig
Duration: 135.84 seconds
Result: PASS

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.

2 participants