public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Fenghua Yu <fenghuay@nvidia.com>
To: Ben Horgan <ben.horgan@arm.com>, james.morse@arm.com
Cc: amitsinght@marvell.com, baisheng.gao@unisoc.com,
	baolin.wang@linux.alibaba.com, bobo.shaobowang@huawei.com,
	carl@os.amperecomputing.com, catalin.marinas@arm.com,
	dakr@kernel.org, dave.martin@arm.com, david@redhat.com,
	dfustini@baylibre.com, gregkh@linuxfoundation.org,
	gshan@redhat.com, guohanjun@huawei.com, jeremy.linton@arm.com,
	jonathan.cameron@huawei.com, kobak@nvidia.com,
	lcherian@marvell.com, lenb@kernel.org,
	linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, lpieralisi@kernel.org,
	peternewman@google.com, quic_jiles@quicinc.com,
	rafael@kernel.org, robh@kernel.org, rohit.mathew@arm.com,
	scott@os.amperecomputing.com, sdonthineni@nvidia.com,
	sudeep.holla@arm.com, tan.shaopeng@fujitsu.com, will@kernel.org,
	xhao@linux.alibaba.com
Subject: Re: [PATCH v5 03/34] ACPI / PPTT: Add acpi_pptt_cache_v1_full to use pptt cache as one structure
Date: Tue, 18 Nov 2025 08:30:08 -0800	[thread overview]
Message-ID: <bef76508-830c-497d-a539-6110686b412f@nvidia.com> (raw)
In-Reply-To: <d31067ac-7400-4a0c-b1ed-5f1cc5ae9e1e@arm.com>



On 11/18/25 02:57, Ben Horgan wrote:
> 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@arm.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.
> 

With this fixed,

Reviewed-by: Fenghua Yu <fenghuay@nvidia.com>

>>
>> 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.

Right. Thank you for your explanation!

-Fenghua

  reply	other threads:[~2025-11-18 16:30 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-17 16:59 [PATCH v5 00/34] arm_mpam: Add basic mpam driver Ben Horgan
2025-11-17 16:59 ` [PATCH v5 01/34] ACPI / PPTT: Add a helper to fill a cpumask from a processor container Ben Horgan
2025-11-18  8:37   ` Hanjun Guo
2025-11-19  3:35   ` Gavin Shan
2025-11-19 10:00     ` Ben Horgan
2025-11-19 16:22   ` Jeremy Linton
2025-11-17 16:59 ` [PATCH v5 02/34] ACPI / PPTT: Stop acpi_count_levels() expecting callers to clear levels Ben Horgan
2025-11-19  4:50   ` Hanjun Guo
2025-11-19 16:25   ` Jeremy Linton
2025-11-17 16:59 ` [PATCH v5 03/34] ACPI / PPTT: Add acpi_pptt_cache_v1_full to use pptt cache as one structure Ben Horgan
2025-11-18  4:03   ` Fenghua Yu
2025-11-18 10:57     ` Ben Horgan
2025-11-18 16:30       ` Fenghua Yu [this message]
2025-11-18 14:40   ` Jonathan Cameron
2025-11-19  3:44   ` Gavin Shan
2025-11-19  5:13   ` Hanjun Guo
2025-11-19 16:28   ` Jeremy Linton
2025-11-17 16:59 ` [PATCH v5 04/34] ACPI / PPTT: Find cache level by cache-id Ben Horgan
2025-11-18 15:32   ` Jonathan Cameron
2025-11-19 16:29   ` Jeremy Linton
2025-11-17 16:59 ` [PATCH v5 05/34] ACPI / PPTT: Add a helper to fill a cpumask from a cache_id Ben Horgan
2025-11-18 15:33   ` Jonathan Cameron
2025-11-19 16:37   ` Jeremy Linton
2025-11-17 16:59 ` [PATCH v5 06/34] arm64: kconfig: Add Kconfig entry for MPAM Ben Horgan
2025-11-17 16:59 ` [PATCH v5 07/34] platform: Define platform_device_put cleanup handler Ben Horgan
2025-11-17 16:59 ` [PATCH v5 08/34] ACPI: Define acpi_put_table cleanup handler and acpi_get_table_ret() helper Ben Horgan
2025-11-17 19:46   ` Rafael J. Wysocki
2025-11-18 11:07     ` Ben Horgan
2025-11-18 16:13     ` Catalin Marinas
2025-11-18 16:21       ` Rafael J. Wysocki
2025-11-18 16:45         ` Catalin Marinas
2025-11-17 16:59 ` [PATCH v5 09/34] ACPI / MPAM: Parse the MPAM table Ben Horgan
2025-11-18  3:31   ` Fenghua Yu
2025-11-17 16:59 ` [PATCH v5 10/34] arm_mpam: Add probe/remove for mpam msc driver and kbuild boiler plate Ben Horgan
2025-11-17 19:50   ` Markus Elfring
2025-11-18 10:44     ` Ben Horgan
2025-11-18 11:28       ` [v5 " Markus Elfring
2025-11-18  5:19   ` [PATCH v5 " Shaopeng Tan (Fujitsu)
2025-11-17 16:59 ` [PATCH v5 11/34] arm_mpam: Add the class and component structures for firmware described ris Ben Horgan
2025-11-18  4:11   ` Fenghua Yu
2025-11-17 16:59 ` [PATCH v5 12/34] arm_mpam: Add MPAM MSC register layout definitions Ben Horgan
2025-11-17 16:59 ` [PATCH v5 13/34] arm_mpam: Add cpuhp callbacks to probe MSC hardware Ben Horgan
2025-11-17 16:59 ` [PATCH v5 14/34] arm_mpam: Probe hardware to find the supported partid/pmg values Ben Horgan
2025-11-18 16:23   ` Fenghua Yu
2025-11-17 16:59 ` [PATCH v5 15/34] arm_mpam: Add helpers for managing the locking around the mon_sel registers Ben Horgan
2025-11-19  4:13   ` Fenghua Yu
2025-11-19 10:12     ` Ben Horgan
2025-11-17 16:59 ` [PATCH v5 16/34] arm_mpam: Probe the hardware features resctrl supports Ben Horgan
2025-11-17 16:59 ` [PATCH v5 17/34] arm_mpam: Merge supported features during mpam_enable() into mpam_class Ben Horgan
2025-11-17 16:59 ` [PATCH v5 18/34] arm_mpam: Reset MSC controls from cpuhp callbacks Ben Horgan
2025-11-17 16:59 ` [PATCH v5 19/34] arm_mpam: Add a helper to touch an MSC from any CPU Ben Horgan
2025-11-17 16:59 ` [PATCH v5 20/34] arm_mpam: Extend reset logic to allow devices to be reset any time Ben Horgan
2025-11-17 17:00 ` [PATCH v5 21/34] arm_mpam: Register and enable IRQs Ben Horgan
2025-11-18  5:30   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 22/34] arm_mpam: Use a static key to indicate when mpam is enabled Ben Horgan
2025-11-17 17:00 ` [PATCH v5 23/34] arm_mpam: Allow configuration to be applied and restored during cpu online Ben Horgan
2025-11-18  5:21   ` Shaopeng Tan (Fujitsu)
2025-11-18 15:39   ` Jonathan Cameron
2025-11-19  4:53   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 24/34] arm_mpam: Probe and reset the rest of the features Ben Horgan
2025-11-18 16:54   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 25/34] arm_mpam: Add helpers to allocate monitors Ben Horgan
2025-11-18 20:44   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 26/34] arm_mpam: Add mpam_msmon_read() to read monitor value Ben Horgan
2025-11-19  5:03   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 27/34] arm_mpam: Track bandwidth counter state for power management Ben Horgan
2025-11-19  4:43   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 28/34] arm_mpam: Consider overflow in bandwidth counter state Ben Horgan
2025-11-19  4:27   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 29/34] arm_mpam: Probe for long/lwd mbwu counters Ben Horgan
2025-11-19  4:57   ` Fenghua Yu
2025-11-17 17:00 ` [PATCH v5 30/34] arm_mpam: Use long MBWU counters if supported Ben Horgan
2025-11-17 17:00 ` [PATCH v5 31/34] arm_mpam: Add helper to reset saved mbwu state Ben Horgan
2025-11-17 17:00 ` [PATCH v5 32/34] arm_mpam: Add kunit test for bitmap reset Ben Horgan
2025-11-17 17:00 ` [PATCH v5 33/34] arm_mpam: Add kunit tests for props_mismatch() Ben Horgan
2025-11-17 17:00 ` [PATCH v5 34/34] MAINTAINERS: new entry for MPAM Driver Ben Horgan
2025-11-17 20:02   ` Catalin Marinas
2025-11-17 22:08     ` Reinette Chatre
2025-11-18 15:41   ` Jonathan Cameron
2025-11-19  4:06   ` Gavin Shan
2025-11-18  3:29 ` [PATCH v5 00/34] arm_mpam: Add basic mpam driver Fenghua Yu
2025-11-18  6:54 ` Shaopeng Tan (Fujitsu)
2025-11-18  7:45 ` Hanjun Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bef76508-830c-497d-a539-6110686b412f@nvidia.com \
    --to=fenghuay@nvidia.com \
    --cc=amitsinght@marvell.com \
    --cc=baisheng.gao@unisoc.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=ben.horgan@arm.com \
    --cc=bobo.shaobowang@huawei.com \
    --cc=carl@os.amperecomputing.com \
    --cc=catalin.marinas@arm.com \
    --cc=dakr@kernel.org \
    --cc=dave.martin@arm.com \
    --cc=david@redhat.com \
    --cc=dfustini@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gshan@redhat.com \
    --cc=guohanjun@huawei.com \
    --cc=james.morse@arm.com \
    --cc=jeremy.linton@arm.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kobak@nvidia.com \
    --cc=lcherian@marvell.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=peternewman@google.com \
    --cc=quic_jiles@quicinc.com \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rohit.mathew@arm.com \
    --cc=scott@os.amperecomputing.com \
    --cc=sdonthineni@nvidia.com \
    --cc=sudeep.holla@arm.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=will@kernel.org \
    --cc=xhao@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox