qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to


From: WANG Xuerui
Subject: Re: [PATCH for-7.1 3/4] target/loongarch: rename the TCG CPU "la464" to "qemu64-v1.00"
Date: Wed, 17 Aug 2022 17:10:30 +0800
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:105.0) Gecko/20100101 Thunderbird/105.0a1

On 2022/8/17 16:11, gaosong wrote:

在 2022/8/17 上午10:36, chen huacai 写道:
Hi, Richard and Xuerui,

On Mon, Aug 15, 2022 at 4:54 AM Richard Henderson
<richard.henderson@linaro.org> wrote:
On 8/14/22 09:55, WANG Xuerui wrote:
From: WANG Xuerui <git@xen0n.name>

The only LoongArch CPU implemented is modeled after the Loongson 3A5000,
but it is not the real thing, ...
The 3A5000 is the SoC, as far as I could find, and the documentation of that says the core
is named the la464.


In general, high-fidelity models can and should be named after the real hardware model, while generic emulation-oriented models should be named
after ISA levels.
This wasn't intended to be a generic emulation model, as far as I know.  There are missing
features, but presumably those would eventually be filled in.


For now, the best reference for LoongArch ISA levels
is the revision number of the LoongArch ISA Manual, of which v1.00 is
still the latest. (v1.01 and v1.02 are minor revisions without
substantive change.)

As defined by various specs, the vendor and model names are also
reflected in respective CSRs, and are 8 bytes long. So, rename "la464"
to "qemu64-v1.00", with "QEMU64" as vendor name and "v1.00" as model
name.
Eh, I suppose.  I'm not really keen on this though, as I would presume there will be eventual forward progress on completing the real cpu model. We simply won't give any
compatibility guarantees for loongarch until we are ready to do so.
In my opinion, real cpu name (Loongson-3A5000, Loongson-3A6000, etc.)
and generic qemu emulated name (qemu64-v1.00, qemu64-v2.00, vx.xx is
the ISA level, I found this style is used for x86) are both
acceptable. But la464 is not a good cpu name, because la264 and la464
are in the same ISA level, while la664 will be in a new level.
I think that 'la264' , 'la464' and 'la664'  are  cpu core name. used them as cpu type is more suitable. Although la264 and la464 are in the same ISA level,   but the features should be different.

From my own experiences, different use cases care about different aspects of the CPU, and that IMO is an argument in favor of providing both (high-fidelity models named after actual product model names, and virtual models named after ISA levels). But before we have truly high-fidelity models I think we should start with the virtual ones first. And don't pretend the currently implemented model is LA464 -- the kernel change I've linked to [1] implies the opposite.

If you're emulating certain boards to test kernels/drivers or similar things, it could help to be able to specify exact CPU models and/or machine type. However, for the linux-user case, it is almost always the ISA level that actually matters, and I don't think LA264/LA364/LA464 are going to differ w.r.t. unprivileged instruction behavior. Having to choose an overly specific model for a broad ISA level match seems inappropriate to my aesthetic sense.

[1]: https://github.com/torvalds/linux/commit/71610ab1d017e131a9888ef8acd035284fb0e1dd



reply via email to

[Prev in Thread] Current Thread [Next in Thread]