From: Pierre Gondois <pierre.gondois@arm.com>
To: Will Deacon <will@kernel.org>
Cc: linux-kernel@vger.kernel.org, Radu Rendec <rrendec@redhat.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
Palmer Dabbelt <palmer@rivosinc.com>,
Oliver Upton <oliver.upton@linux.dev>,
Akihiko Odaki <akihiko.odaki@daynix.com>,
Gavin Shan <gshan@redhat.com>,
Conor Dooley <conor.dooley@microchip.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/3] cacheinfo: Add use_arch[|_cache]_info field/function
Date: Thu, 6 Apr 2023 09:28:32 +0200 [thread overview]
Message-ID: <d368e1b5-8094-ee30-9812-3a321e8bedb7@arm.com> (raw)
In-Reply-To: <20230327121734.GB31342@willie-the-truck>
Hello Will,
On 3/27/23 14:17, Will Deacon wrote:
> On Mon, Mar 27, 2023 at 01:59:51PM +0200, Pierre Gondois wrote:
>> The cache information can be extracted from either a Device
>> Tree (DT), the PPTT ACPI table, or arch registers (clidr_el1
>> for arm64).
>>
>> The clidr_el1 register is used only if DT/ACPI information is not
>> available. It does not states how caches are shared among CPUs.
>>
>> Add a use_arch_cache_info field/function to identify when the
>> DT/ACPI doesn't provide cache information. Use this information
>> to assume L1 caches are privates and L2 and higher are shared among
>> all CPUs.
>>
>> Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
>> ---
>> arch/arm64/kernel/cacheinfo.c | 5 +++++
>> drivers/base/cacheinfo.c | 20 ++++++++++++++++++--
>> include/linux/cacheinfo.h | 2 ++
>> 3 files changed, 25 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c
>> index c307f69e9b55..b6306cda0fa7 100644
>> --- a/arch/arm64/kernel/cacheinfo.c
>> +++ b/arch/arm64/kernel/cacheinfo.c
>> @@ -96,3 +96,8 @@ int populate_cache_leaves(unsigned int cpu)
>> }
>> return 0;
>> }
>> +
>> +bool use_arch_cache_info(unsigned int cpu)
>> +{
>> + return true;
>> +}
>
> It would be a lot nicer if this was a static inline function in a header
> rather than a weak symbol.
I am not sure I see where the static inline function should be added.
Do you prefer to have function like the following in
include/linux/cacheinfo.h ?
static inline bool use_arch_cache_info(unsigned int cpu)
{
#if defined(CONFIG_ARM64)
return true;
#else
return false;
#endif
}
Regards,
Pierre
>
> Will
prev parent reply other threads:[~2023-04-06 7:28 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-27 11:59 [PATCH 0/3] cacheinfo: Correctly fallback to using clidr_el1's information Pierre Gondois
2023-03-27 11:59 ` [PATCH 1/3] cacheinfo: Check sib_leaf in cache_leaves_are_shared() Pierre Gondois
2023-03-27 14:04 ` Conor Dooley
2023-03-27 11:59 ` [PATCH 2/3] cacheinfo: Check cache properties are present in DT Pierre Gondois
2023-03-27 14:13 ` Conor Dooley
2023-04-04 19:29 ` Conor Dooley
2023-04-06 7:31 ` Pierre Gondois
2023-03-27 11:59 ` [PATCH 3/3] cacheinfo: Add use_arch[|_cache]_info field/function Pierre Gondois
2023-03-27 12:17 ` Will Deacon
2023-04-06 7:28 ` Pierre Gondois [this message]
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=d368e1b5-8094-ee30-9812-3a321e8bedb7@arm.com \
--to=pierre.gondois@arm.com \
--cc=akihiko.odaki@daynix.com \
--cc=catalin.marinas@arm.com \
--cc=conor.dooley@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=gshan@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oliver.upton@linux.dev \
--cc=palmer@rivosinc.com \
--cc=rafael@kernel.org \
--cc=rrendec@redhat.com \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.org \
/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
all inboxes | Powered by JetHome®