linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
To: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>,
	"open list:MIPS" <linux-mips@vger.kernel.org>,
	Fuxin Zhang <zhangfx@lemote.com>,
	Zhangjin Wu <wuzhangjin@gmail.com>
Subject: Re: [PATCH V3 1/2] MIPS: Loongson-3: Enable COP2 usage in kernel
Date: Wed, 5 Aug 2020 14:10:21 +0200	[thread overview]
Message-ID: <20200805121021.GA12598@alpha.franken.de> (raw)
In-Reply-To: <CAAhV-H6M-BnBMzFYUom04mdBZhA4+9M3JTUC-dvckTMUeFw9+w@mail.gmail.com>

On Sat, Aug 01, 2020 at 03:59:41PM +0800, Huacai Chen wrote:
> On Wed, May 6, 2020 at 1:30 PM Jiaxun Yang <jiaxun.yang@flygoat.com> wrote:
> >
> >
> >
> > 于 2020年5月2日 GMT+08:00 下午12:55:43, Huacai Chen <chenhc@lemote.com> 写到:
> > >Loongson-3's COP2 is Multi-Media coprocessor, it is disabled in kernel
> > >mode by default. However, gslq/gssq (16-bytes load/store instructions)
> > >overrides the instruction format of lwc2/swc2. If we wan't to use gslq/
> > >gssq for optimization in kernel, we should enable COP2 usage in kernel.
> > >
> > >Please pay attention that in this patch we only enable COP2 in kernel,
> > >which means it will lose ST0_CU2 when a process go to user space (try
> > >to use COP2 in user space will trigger an exception and then grab COP2,
> > >which is similar to FPU). And as a result, we need to modify the context
> > >switching code because the new scheduled process doesn't contain ST0_CU2
> > >in its THERAD_STATUS probably.
> > >
> > >Signed-off-by: Huacai Chen <chenhc@lemote.com>
> >
> > Reviewed-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> >
> Does this patch have some unresolved problems, or there is something unclear?

yes there is. Since this COP2 is a total black box to me, it would be
really helpfull to get some docs for it or at least some information what
it exactly does and how you want to use it in kernel code.

Looking closer at the patch I realized, that there is already support
for usage of COP2 in user land, which I thought isn't the case (at least
I understood that from one of your mails). So is there enough state
saving to support this ?

And finally what I stil don't like is the splittering of more
#ifdef LOONGSON into common code. I'd prefer a more generic way
to enable COPx for in kernel usage. Maybe a more generic config option
or a dynamic solution like the one for user land.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

  reply	other threads:[~2020-08-05 20:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-02  4:55 [PATCH V3 1/2] MIPS: Loongson-3: Enable COP2 usage in kernel Huacai Chen
2020-05-02  4:55 ` [PATCH V3 2/2] MIPS: Loongson-3: Calculate ra properly when unwinding the stack Huacai Chen
2020-05-06  5:29 ` [PATCH V3 1/2] MIPS: Loongson-3: Enable COP2 usage in kernel Jiaxun Yang
2020-08-01  7:59   ` Huacai Chen
2020-08-05 12:10     ` Thomas Bogendoerfer [this message]
2020-08-05 13:51       ` Jiaxun Yang
2020-08-06  1:15         ` Huacai Chen
2020-08-07 13:13         ` Thomas Bogendoerfer
2020-08-07 13:25           ` Jiaxun Yang
2020-08-07 13:36             ` Thomas Bogendoerfer
2020-08-09 14:53             ` Jiaxun Yang
2020-08-10 14:12               ` Thomas Bogendoerfer
2020-08-11  2:16                 ` Jiaxun Yang
2020-08-11  6:45                   ` Huacai Chen
2020-08-11 12:06                     ` Thomas Bogendoerfer
2020-08-14  9:44                       ` Huacai Chen
2020-08-14 13:16                         ` Jiaxun Yang
2020-08-26 12:46                         ` Thomas Bogendoerfer
2020-08-27  3:48                           ` Huacai Chen
2020-08-28  8:42                             ` Thomas Bogendoerfer
2020-08-28  9:21                               ` Huacai Chen
2020-08-28  9:33                                 ` Thomas Bogendoerfer
2020-08-28  9:52                                   ` Huacai Chen
2020-08-28 11:12                                     ` Thomas Bogendoerfer
2020-09-02  6:54                           ` Huacai Chen
2020-09-03  8:43                             ` Thomas Bogendoerfer

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=20200805121021.GA12598@alpha.franken.de \
    --to=tsbogend@alpha.franken.de \
    --cc=chenhc@lemote.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-mips@vger.kernel.org \
    --cc=wuzhangjin@gmail.com \
    --cc=zhangfx@lemote.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;
as well as URLs for NNTP newsgroup(s).