linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: WANG Xuerui <kernel@xen0n.name>
To: jiaxun.yang@flygoat.com, linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>, Tiezhu Yang <yangtiezhu@loongson.cn>
Subject: Re: [PATCH v2 RESEND 4/4] MIPS: emulate CPUCFG instruction on older Loongson64 cores
Date: Mon, 4 May 2020 13:25:00 +0800	[thread overview]
Message-ID: <f8eb83b8-7ec3-5d5c-7f4c-c78f72c04c1a@xen0n.name> (raw)
In-Reply-To: <3B0FE747-AE18-404B-9CD3-D3401634340C@flygoat.com>

On 5/3/20 11:50 PM, Jiaxun Yang wrote:

> Some random thoughts on that:
>
> While cpucfg instruction would not be available on other MIPS
> processors, and given that most distros are more willing to provide
> general MIPS version instead of Loongson specified version, we'd better
> provide user space programs a way to probe emulated/physical cpucfg support.
>
> Looks like elf_hwcap would be a option? I've already added some flags about
> Loongson's extension and now an extra HWCAP_LOONGSON_CPUCFG can cover everything.

All emulated outputs from the older models have the LCSRP bit clear in 
this patch. As CPUCFG is part of the Loongson CSR ASE, this is the 
reliable way to distinguish between emulated and physical CPUCFG support.

However, because detecting presence of CPUCFG itself still requires one 
to handle SIGILL, exposing an hwcap might be an option. So we'll have 
the following mapping:

- no HWCAP_LOONGSON_CPUCFG -- other MIPS or Loongson-2EF or Loongson-32
- CPUCFG.0x2.LCSRP == 0 -- older Loongson-64 models
- otherwise, Loongson-3A R4 or later

Seems some of the previously defined hwcaps will become unnecessary if 
we make this change. But they're already part of kernel ABI so we have 
to keep them, fortunately we still have plenty of bits available. At 
least future additions of Loongson features wouldn't go through hwcap.

I think the hwcap addition can be added in another follow-up series if 
the idea gets consensus; let's keep this series focused.


  reply	other threads:[~2020-05-04  5:31 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
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 [this message]
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=f8eb83b8-7ec3-5d5c-7f4c-c78f72c04c1a@xen0n.name \
    --to=kernel@xen0n.name \
    --cc=chenhc@lemote.com \
    --cc=jiaxun.yang@flygoat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).