From: Suzuki K Poulose <suzuki.poulose@arm.com>
To: anshuman.khandual@arm.com, linux-arm-kernel@lists.infradead.org
Cc: catalin.marinas@arm.com, will@kernel.org, broonie@kernel.org,
mark.rutland@arm.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] arm64/cpufeature: Validate feature bits spacing in arm64_ftr_regs[]
Date: Tue, 30 Jun 2020 11:16:18 +0100 [thread overview]
Message-ID: <9c2a5410-044e-03cb-9233-900389d0dfea@arm.com> (raw)
In-Reply-To: <25fd985f-65b8-3884-02f4-10311d3f55fe@arm.com>
On 06/30/2020 02:49 AM, Anshuman Khandual wrote:
>
>
> On 06/29/2020 04:12 PM, Suzuki K Poulose wrote:
>> On 06/16/2020 03:25 AM, Anshuman Khandual wrote:
>>> arm64_feature_bits for a register in arm64_ftr_regs[] are in a descending
>>> order as per their shift values. Validate that these features bits are
>>> defined correctly and do not overlap with each other. This check protects
>>> against any inadvertent erroneous changes to the register definitions.
>>>
>>> Cc: Catalin Marinas <catalin.marinas@arm.com>
>>> Cc: Will Deacon <will@kernel.org>
>>> Cc: Suzuki K Poulose <suzuki.poulose@arm.com>
>>> Cc: Mark Brown <broonie@kernel.org>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: linux-arm-kernel@lists.infradead.org
>>> Cc: linux-kernel@vger.kernel.org
>>> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
>>> ---
>>> Applies on 5.8-rc1.
>>>
>>> arch/arm64/kernel/cpufeature.c | 45 +++++++++++++++++++++++++++++++---
>>> 1 file changed, 42 insertions(+), 3 deletions(-)
>>> + }
>>> - /* Check that the array is sorted so that we can do the binary search */
>>> - for (i = 1; i < ARRAY_SIZE(arm64_ftr_regs); i++)
>>> + /*
>>> + * Skip the first register. There is nothing to
>>> + * compare against for now.
>>> + */
>>> + if (i == 0)
>>> + continue;
>>
>> You are starting at 1 already, so you may skip this check.
>
> Actually, now we are starting with 0 instead for both i and j.
> Hence this check would be required.
Sorry, ignore that.
Suzuki
prev parent reply other threads:[~2020-06-30 10:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 2:25 Anshuman Khandual
2020-06-29 10:42 ` Suzuki K Poulose
2020-06-30 1:49 ` Anshuman Khandual
2020-06-30 10:16 ` Suzuki K Poulose [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=9c2a5410-044e-03cb-9233-900389d0dfea@arm.com \
--to=suzuki.poulose@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@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®