[PATCH 5/6] soc: hisilicon: kunpeng_hccs: Preserve PCC signatures

From: Sudeep Holla

Date: Sat Jun 27 2026 - 12:41:58 EST


ACPI specification defines the generic PCC shared memory signature as
the PCC base signature ORed with the subspace ID.

ACPI 6.6 added clarification that the signature is populated by the
platform and verified by OSPM.

The PCC mailbox controller now validates the signature when the channel
is requested. Stop copying complete local PCC headers into shared
memory and write only the mutable command, status, flags and length
fields, leaving the platform-populated signatures intact.

Cc: Huisong Li <lihuisong@xxxxxxxxxx>
Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxxxxx>
---
drivers/soc/hisilicon/kunpeng_hccs.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/soc/hisilicon/kunpeng_hccs.c b/drivers/soc/hisilicon/kunpeng_hccs.c
index 0cc2953d59a5..0e5e48e46eba 100644
--- a/drivers/soc/hisilicon/kunpeng_hccs.c
+++ b/drivers/soc/hisilicon/kunpeng_hccs.c
@@ -270,14 +270,11 @@ static inline void hccs_fill_pcc_shared_mem_region(struct hccs_dev *hdev,
void __iomem *comm_space,
u16 space_size)
{
- struct acpi_pcct_shared_memory tmp = {
- .signature = PCC_SIGNATURE | hdev->chan_id,
- .command = cmd,
- .status = 0,
- };
+ struct acpi_pcct_shared_memory __iomem *comm_base;

- memcpy_toio(hdev->cl_info.pcc_chan->shmem, (void *)&tmp,
- sizeof(struct acpi_pcct_shared_memory));
+ comm_base = hdev->cl_info.pcc_chan->shmem;
+ iowrite16(cmd, &comm_base->command);
+ iowrite16(0, &comm_base->status);

/* Copy the message to the PCC comm space */
memcpy_toio(comm_space, (void *)desc, space_size);
@@ -289,15 +286,12 @@ static inline void hccs_fill_ext_pcc_shared_mem_region(struct hccs_dev *hdev,
void __iomem *comm_space,
u16 space_size)
{
- struct acpi_pcct_ext_pcc_shared_memory tmp = {
- .signature = PCC_SIGNATURE | hdev->chan_id,
- .flags = PCC_CMD_COMPLETION_NOTIFY,
- .length = HCCS_PCC_SHARE_MEM_BYTES,
- .command = cmd,
- };
+ struct acpi_pcct_ext_pcc_shared_memory __iomem *comm_base;

- memcpy_toio(hdev->cl_info.pcc_chan->shmem, (void *)&tmp,
- sizeof(struct acpi_pcct_ext_pcc_shared_memory));
+ comm_base = hdev->cl_info.pcc_chan->shmem;
+ iowrite32(PCC_CMD_COMPLETION_NOTIFY, &comm_base->flags);
+ iowrite32(HCCS_PCC_SHARE_MEM_BYTES, &comm_base->length);
+ iowrite32(cmd, &comm_base->command);

/* Copy the message to the PCC comm space */
memcpy_toio(comm_space, (void *)desc, space_size);

--
2.43.0