From: Gabriel Krisman Bertazi <krisman@suse.de>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org,
broonie@kernel.org
Subject: Re: [PATCH v2] arm64: Avoid repeated AA64MMFR1_EL1 register read on pagefault path
Date: Wed, 18 Jan 2023 13:06:42 -0300 [thread overview]
Message-ID: <878rhzbze5.fsf@suse.de> (raw)
In-Reply-To: <Y8gTx/YKsgdpohMA@arm.com> (Catalin Marinas's message of "Wed, 18 Jan 2023 15:44:07 +0000")
Catalin Marinas <catalin.marinas@arm.com> writes:
> On Mon, Jan 09, 2023 at 12:19:55PM -0300, Gabriel Krisman Bertazi wrote:
>> diff --git a/arch/arm64/include/asm/cpufeature.h b/arch/arm64/include/asm/cpufeature.h
>> index 03d1c9d7af82..3d1a5677321e 100644
>> --- a/arch/arm64/include/asm/cpufeature.h
>> +++ b/arch/arm64/include/asm/cpufeature.h
>> @@ -864,7 +864,11 @@ static inline bool cpu_has_hw_af(void)
>> if (!IS_ENABLED(CONFIG_ARM64_HW_AFDBM))
>> return false;
>>
>> - mmfr1 = read_cpuid(ID_AA64MMFR1_EL1);
>> + /*
>> + * Use cached version to avoid emulated msr operation on KVM
>> + * guests.
>> + */
>> + mmfr1 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR1_EL1);
>> return cpuid_feature_extract_unsigned_field(mmfr1,
>> ID_AA64MMFR1_EL1_HAFDBS_SHIFT);
>> }
>
> You can probably make it slightly faster if you add a cpucap feature. We
> have ARM64_HW_DBM but not ARM64_HW_AF. Not sure you'd notice a
> difference in practice though.
Hi Catalin,
I had a patch for that, but when I noticed the existence of
ARM64_HW_DBM, I dropped it. it is mentioned quickly in the v1.
From my measurements, when comparing this version to a static variable
caching the value (patch v1), the bsearch performance impact was not
significant. I think it would be fine to keep this version.
but, of course, I can add the cpucap bit if it is preferred. Please,
let me know.
Thanks,
--
Gabriel Krisman Bertazi
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-01-18 16:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-09 15:19 [PATCH v2] arm64: Avoid repeated AA64MMFR1_EL1 register read on pagefault path Gabriel Krisman Bertazi
2023-01-11 8:34 ` Anshuman Khandual
2023-01-11 13:31 ` Gabriel Krisman Bertazi
2023-01-12 2:57 ` Anshuman Khandual
2023-01-12 3:05 ` Anshuman Khandual
2023-01-16 20:41 ` Gabriel Krisman Bertazi
2023-01-17 16:14 ` Will Deacon
2023-01-18 16:08 ` Gabriel Krisman Bertazi
2023-01-18 15:44 ` Catalin Marinas
2023-01-18 16:06 ` Gabriel Krisman Bertazi [this message]
2023-01-18 16:38 ` Will Deacon
2023-01-20 16:59 ` Catalin Marinas
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=878rhzbze5.fsf@suse.de \
--to=krisman@suse.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.