All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: WANG Xuerui <git@xen0n.name>
Cc: linux-mips@vger.kernel.org, Huacai Chen <chenhc@lemote.com>,
	Tiezhu Yang <yangtiezhu@loongson.cn>
Subject: Re: [PATCH 4/4] MIPS: emulate CPUCFG instruction on older Loongson64 cores
Date: Sat, 2 May 2020 21:59:19 +0800	[thread overview]
Message-ID: <20200502215919.3bb50668@flygoat-x1e> (raw)
In-Reply-To: <20200502133846.40590-5-git@xen0n.name>

On Sat,  2 May 2020 21:38:46 +0800
WANG Xuerui <git@xen0n.name> wrote:

> CPUCFG is the instruction for querying processor characteristics on
> newer Loongson processors, much like CPUID of x86. Since the
> instruction is supposedly designed to provide a unified way to do
> feature detection (without having to, for example, parse
> /proc/cpuinfo which is too heavyweight), it is important to provide
> compatibility for older cores without native support. Fortunately,
> most of the fields can be synthesized without changes to semantics.
> Performance is not really big a concern, because feature detection
> logic is not expected to be invoked very often in typical userland
> applications.
> 
> The instruction can't be emulated on LOONGSON_2EF cores, according to
> FlyGoat's experiments. Because the LWC2 opcode is assigned to other
> valid instructions on 2E and 2F, no RI exception is raised for us to
> intercept. So compatibility is only extended back furthest to
> Loongson-3A1000. Loongson-2K is covered too, as it is basically a
> remix of various blocks from the 3A/3B models from a kernel
> perspective.
> 
> This is lightly based on Loongson's work on their Linux 3.10 fork, for
> being the authority on the right feature flags to fill in, where
> things aren't otherwise discoverable.
> 
> Signed-off-by: WANG Xuerui <git@xen0n.name>
> Cc: Huacai Chen <chenhc@lemote.com>
> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Cc: Tiezhu Yang <yangtiezhu@loongson.cn>

Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Tested-by: Jiaxun Yang <jiaxun.yang@flygoat.com> # Loongson-2K, 3B1500

Thanks for providing me early access of this series so I can perform
reviewing and testing before you posting to the list.

And welcome!

--
Jiaxun Yang

[...]

  reply	other threads:[~2020-05-02 13:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02 13:38 [PATCH 0/4] CPUCFG emulation on older Loongson64 cores WANG Xuerui
2020-05-02 13:38 ` [PATCH 1/4] MIPS: Loongson64: fix typos in loongson_regs.h WANG Xuerui
2020-05-02 13:38 ` [PATCH 2/4] MIPS: Loongson64: define offsets and known revisions for some CPUCFG features WANG Xuerui
2020-05-02 13:38 ` [PATCH 3/4] MIPS: define more Loongson CP0.Config6 and CP0.Diag feature bits WANG Xuerui
2020-05-02 13:38 ` [PATCH 4/4] MIPS: emulate CPUCFG instruction on older Loongson64 cores WANG Xuerui
2020-05-02 13:59   ` Jiaxun Yang [this message]
2020-05-03  6:31   ` Huacai Chen
2020-05-03  7:58     ` Wang Xuerui
2020-05-03  8:25       ` Jiaxun Yang
2020-05-03 10:33 ` [PATCH v2 0/4] CPUCFG emulation " WANG Xuerui
2020-05-16 11:29   ` WANG Xuerui
2020-05-17  8:38     ` Thomas Bogendoerfer
2020-05-03 10:33 ` [PATCH v2 1/4] MIPS: Loongson64: fix typos in loongson_regs.h WANG Xuerui
2020-05-03 10:33 ` [PATCH v2 2/4] MIPS: Loongson64: define offsets and known revisions for some CPUCFG features WANG Xuerui
2020-05-03 10:33 ` [PATCH v2 3/4] MIPS: define more Loongson CP0.Config6 and CP0.Diag feature bits WANG Xuerui
2020-05-03 10:33 ` [PATCH v2 4/4] MIPS: emulate CPUCFG instruction on older Loongson64 cores WANG Xuerui
2020-05-03 10:50   ` [PATCH v2 RESEND " WANG Xuerui
2020-05-03 15:50     ` Jiaxun Yang
2020-05-04  5:25       ` WANG Xuerui
2020-05-04  6:58         ` Jiaxun Yang
2020-05-17  8:37     ` Thomas Bogendoerfer
2020-05-17 11:39       ` WANG Xuerui
2020-05-17 15:17         ` Thomas Bogendoerfer
2020-05-18  2:44           ` WANG Xuerui
2020-05-19 14:33             ` WANG Xuerui

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=20200502215919.3bb50668@flygoat-x1e \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=git@xen0n.name \
    --cc=linux-mips@vger.kernel.org \
    --cc=yangtiezhu@loongson.cn \
    /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.