[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d31067ac-7400-4a0c-b1ed-5f1cc5ae9e1e@arm.com>
Date: Tue, 18 Nov 2025 10:57:19 +0000
From: Ben Horgan <ben.horgan@....com>
To: Fenghua Yu <fenghuay@...dia.com>, james.morse@....com
Cc: amitsinght@...vell.com, baisheng.gao@...soc.com,
baolin.wang@...ux.alibaba.com, bobo.shaobowang@...wei.com,
carl@...amperecomputing.com, catalin.marinas@....com, dakr@...nel.org,
dave.martin@....com, david@...hat.com, dfustini@...libre.com,
gregkh@...uxfoundation.org, gshan@...hat.com, guohanjun@...wei.com,
jeremy.linton@....com, jonathan.cameron@...wei.com, kobak@...dia.com,
lcherian@...vell.com, lenb@...nel.org, linux-acpi@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
lpieralisi@...nel.org, peternewman@...gle.com, quic_jiles@...cinc.com,
rafael@...nel.org, robh@...nel.org, rohit.mathew@....com,
scott@...amperecomputing.com, sdonthineni@...dia.com, sudeep.holla@....com,
tan.shaopeng@...itsu.com, will@...nel.org, xhao@...ux.alibaba.com
Subject: Re: [PATCH v5 03/34] ACPI / PPTT: Add acpi_pptt_cache_v1_full to use
pptt cache as one structure
Hi Fenghua,
On 11/18/25 04:03, Fenghua Yu wrote:
> Hi, Ben,
>
> On 11/17/25 08:59, Ben Horgan wrote:
>> In actbl2.h, acpi_pptt_cache describes the fields in the original
>> Cache Type Structure. In PPTT table version 3 a new field was added at
>> the
>> end, cache_id. This is described in acpi_pptt_cache_v1 but rather than
>> including all v1 fields it just includes this one.
>>
>> In lieu of this being fixed in acpica, introduce
>> acpi_pptt_cache_v1_full to
>> contain all the fields of the Cache Type Structure . Update the existing
>> code to use this new struct. This simplifies the code and removes a
>> non-standard use of ACPI_ADD_PTR.
>>
>> Signed-off-by: Ben Horgan <ben.horgan@....com>
>> ---
>> I have opened a pull request to acpica to update acpi_pptt_cache_v1 to
>> include all fields. https://github.com/acpica/acpica/pull/1059
>>
>> Change since v4:
>> Use fields directly in acpi_pptt_cache_v1_full
>> Delay the casting
>>
>> Changes since v3:
>> New patch
>> ---
>> drivers/acpi/pptt.c | 47 +++++++++++++++++++++++++++++++++++----------
>> 1 file changed, 37 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/acpi/pptt.c b/drivers/acpi/pptt.c
>> index 2856254e29d7..53fde9bd8140 100644
>> --- a/drivers/acpi/pptt.c
>> +++ b/drivers/acpi/pptt.c
>> @@ -21,6 +21,25 @@
>> #include <linux/cacheinfo.h>
>> #include <acpi/processor.h>
>> +/*
>> + * The acpi_pptt_cache_v1 in actbl2.h, which is imported from acpica,
>> + * only contains the cache_id field rather than all the fields of the
>> + * Cache Type Structure. Use this alternative structure until it is
>> + * resolved in acpica.
>> + */
>> +struct acpi_pptt_cache_v1_full {
>> + struct acpi_subtable_header header;
>> + u16 reserved;
>> + u32 flags;
>> + u32 next_level_of_cache;
>> + u32 size;
>> + u32 number_of_sets;
>> + u8 associativity;
>> + u8 attributes;
>> + u16 line_size;
>> + u32 cache_id;
>> +};
>
> Should "__packed" be added to this table?
Yes, I missed that.
>
> Should this table be defined in include/acpi/actbl2.h? Seems defining
> the two cache tables separately in two places are not natural?
Indeed. The dificulty is that include/acpi/actbl2.h is generated from
acpica. I propose a fix for this in the pull request mentioned above:
https://github.com/acpica/acpica/pull/1059 This extends
acpi_pptt_cache_v1 to include all the fields in the new version of the
cache type structure (not just cache_id).
One thing I could do if it looks like the acpica change will be accepted
is to temporarily delete acpi_pptt_cache_v1 from include/acpi/actbl2.h
and rename acpi_pptt_cache_v1_full in drivers/acpi/pptt.c to
acpi_pptt_cache_v1. When include/acpi/actbl2.h is updated the conflict
should be evident and the version in drivers/acpi/pptt.c can be dropped.
I'll keep it like it is for now though as this would be an api breaking
change for acpica and the maintainers may prefer to handle this a
different way.
>
> Thanks.
>
> -Fenghua
Thanks,
Ben
Powered by blists - more mailing lists