Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: maobibo <maobibo@loongson.cn>
To: jiaxun.yang@flygoat.com
Cc: WANG Xuerui <git@xen0n.name>, linux-mips@vger.kernel.org
Subject: Re: [PATCH v3 0/1] CPUCFG emulation on older Loongson64 cores
Date: Sat, 23 May 2020 10:10:16 +0800	[thread overview]
Message-ID: <bedfcdc3-ae99-2920-c08e-94a269406d80@loongson.cn> (raw)
In-Reply-To: <50F35B43-9313-4083-A98F-45FCA3F516E2@flygoat.com>



On 05/22/2020 10:34 PM, Jiaxun Yang wrote:
> 
> 
> 于 2020年5月22日 GMT+08:00 下午10:14:02, "毛碧波" <maobibo@loongson.cn> 写到:
>>
>>
>>
>> &gt; -----原始邮件-----
>> &gt; 发件人: "Jiaxun Yang" <jiaxun.yang@flygoat.com>
>> &gt; 发送时间: 2020-05-22 20:57:33 (星期五)
>> &gt; 收件人: "毛碧波" <maobibo@loongson.cn>, "WANG Xuerui" <git@xen0n.name>
>> &gt; 抄送: linux-mips@vger.kernel.org
>> &gt; 主题: Re: [PATCH v3 0/1] CPUCFG emulation on older Loongson64 cores
>> &gt; 
>> &gt; 
>> &gt; 
>> &gt; 于 2020年5月22日 GMT+08:00 下午8:06:01, "毛碧波" <maobibo@loongson.cn> 写到:
>> &gt; &gt;Sorry for late reponse.
>> &gt; &gt;I just want to know how to solve compatibility on older kernel.
>> &gt; &gt;It is ok to run user application with cpucfg instr on new kernel with this
>> &gt; &gt;patch, however what if the application is running on older kernel without
>> &gt; &gt;cpucfg simulation?
>> &gt; 
>> &gt; Application can firstly probe if CPUCFG is supported by kernel &amp; hardware
>> &gt; by fork a thread and catch SIGILL signal or HWCAP.
>> &gt; Then decide use legacy methods or CPUCFG to probe other features.
>> &gt; 
>> &gt; Similar method have been proofed on Arm.
>> Sure, if  that works, what is the purpose of this patch? Do we need cpucfg
>> simulation on older machine since there is proper method already?
> 
> Because it's more efficient and elegant.
> Also applications can assume systems without CPUCFG have
> no Loongson extension support.
> That can save hundreds lines in various applications.
You can add add this to hwcap/cpuinfo though it is difficult to add vendor specific
hwcap. Application can check hwcap and then use cpucfg gracefully. 

I do not see usage of cpucfg simulation on older machine, do we add new instruction emulation if there is new instruction?  On the other way is there cpuid simulation on x86 system?

> 
> We can kill ugly probe method in applications when all
> machine have upgraded kernel.
I doubt application vendor has the willing of removing so-called ugly code but work broken
on older kernel.

> 
> And as you can see, cpucfg is exporting more config options than any
> existing methods like HWCAP or cpuinfo.
> And they may valuable to applications.
> 
> Btw: Please fix your email client.
> 
> Thanks.
> 


  reply	other threads:[~2020-05-23  2:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-21 18:14 [PATCH v3 0/1] CPUCFG emulation on older Loongson64 cores WANG Xuerui
2020-05-21 18:14 ` [PATCH v3 1/1] MIPS: emulate CPUCFG instruction " WANG Xuerui
2020-05-22  3:34   ` Jiaxun Yang
2020-05-22  4:39   ` Huacai Chen
2020-05-23  4:07     ` WANG Xuerui
2020-05-22 12:06 ` [PATCH v3 0/1] CPUCFG emulation " 毛碧波
2020-05-22 12:57   ` Jiaxun Yang
2020-05-22 14:14     ` 毛碧波
2020-05-22 14:34       ` Jiaxun Yang
2020-05-23  2:10         ` maobibo [this message]
2020-05-23  2:30           ` Jiaxun Yang
2020-05-23  2:48           ` WANG Xuerui
2020-05-23  3:10   ` 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=bedfcdc3-ae99-2920-c08e-94a269406d80@loongson.cn \
    --to=maobibo@loongson.cn \
    --cc=git@xen0n.name \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-mips@vger.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