From: Catalin Marinas <catalin.marinas@arm.com>
To: 乱石 <zhangliguang@linux.alibaba.com>
Cc: Suzuki K Poulose <suzuki.poulose@arm.com>,
Anshuman Khandual <anshuman.khandual@arm.com>,
gustavoars@kernel.org, linux-kernel@vger.kernel.org,
Mark Brown <broonie@kernel.org>,
Vincenzo Frascino <vincenzo.frascino@arm.com>,
Will Deacon <will@kernel.org>, Dave Martin <Dave.Martin@arm.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm64/cpuinfo: Show right CPU architecture information
Date: Tue, 19 Jan 2021 12:32:38 +0000 [thread overview]
Message-ID: <20210119123237.GA17369@gaia> (raw)
In-Reply-To: <ff3a2f25-083c-2363-5e09-4d6acf5291e7@linux.alibaba.com>
On Tue, Jan 19, 2021 at 07:26:31PM +0800, 乱石 wrote:
> 锟斤拷 2021/1/19 19:01, Will Deacon 写锟斤拷:
> > On Tue, Jan 19, 2021 at 06:55:10PM +0800, Liguang Zhang wrote:
> > > CPU architecture is assigned to be a fixed value, it should be obtained
> > > from midr register.
> > >
> > > Signed-off-by: Liguang Zhang <zhangliguang@linux.alibaba.com>
> > > ---
> > > arch/arm64/kernel/cpuinfo.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c
> > > index 77605aec25fe..0bd11e0fe9f2 100644
> > > --- a/arch/arm64/kernel/cpuinfo.c
> > > +++ b/arch/arm64/kernel/cpuinfo.c
> > > @@ -191,7 +191,7 @@ static int c_show(struct seq_file *m, void *v)
> > > seq_printf(m, "CPU implementer\t: 0x%02x\n",
> > > MIDR_IMPLEMENTOR(midr));
> > > - seq_printf(m, "CPU architecture: 8\n");
> > > + seq_printf(m, "CPU architecture: %d\n", MIDR_ARCHITECTURE(midr));
> > Huh? Won't this always return 0xf?
>
> Hi Will,
>
> I'm not sure. My platform return 0xf, but /proc/cpuinfo show 8. Why we
> assign a fixed
>
> value to cpu architecture?
Because 0xf first appeared on some ARMv6 CPUs (1176, 11MPcore and some
newer revisions of 1136). A field value of 0xf means don't bother with
architecture version but rather check the CPUID information for the
features you need. We decided to call it 8 here with 64-bit as that was
announced as ARMv8. A 32-bit kernel running on ARMv8 hardware would
report 7 (as it would on some ARMv6 hardware like 1176 etc.)
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2021-01-19 12:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 10:55 [PATCH] arm64/cpuinfo: Show right CPU architecture information Liguang Zhang
2021-01-19 11:01 ` Will Deacon
2021-01-19 11:26 ` 乱石
2021-01-19 12:32 ` Catalin Marinas [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=20210119123237.GA17369@gaia \
--to=catalin.marinas@arm.com \
--cc=Dave.Martin@arm.com \
--cc=anshuman.khandual@arm.com \
--cc=broonie@kernel.org \
--cc=gustavoars@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
--cc=zhangliguang@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