public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Lennox Wu <lennox.wu@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	linux-kernel@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiang Liu <jiang.liu@huawei.com>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	Andrew Morton <akpm@linux-foundation.org>,
	"David S. Miller" <davem@davemloft.net>,
	Arnd Bergmann <arnd@arndb.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Liqin Chen <liqin299@gmail.com>
Subject: Re: [PATCH] Remove support for score architecture
Date: Mon, 2 Sep 2013 16:57:47 +0100	[thread overview]
Message-ID: <20130902155747.GZ13318@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAF0htA6sYZOvLt_JczGpfjEJZep6cAquJV9tZ2FwYC+C6ngzXQ@mail.gmail.com>

On Mon, Sep 02, 2013 at 11:18:17PM +0800, Lennox Wu wrote:
> Before we start the development of the S+core, Sunplus had licensed
> ARM and MIPS. We develop S+core for other reason such as the price.
> Some products on the web of Sunplus adopt S+core , for example
> the SPV7050.(http://w3.sunplus.com/products/spv7050.asp) These products
> could still be bought from the market. Some high-end products adopt
> ARM or MIPS. So, there is no conflict for a company adopts multiple
> architectures.
> 
> As I said, we recognize that we rarely update because of the limited
> applications and rare requests from customers. Maybe we don?t
> understand the culture enough; we think that it is unnecessary if we
> have no new bugs or new functions, the thought seems wrong. We can
> commit some patches in the near future.

"New bugs" as in "don't bother with the stuff that had been broken since
the initial merge"?  You might want to take a look at arch/score/kernel/entry.S,
for starters.  And compare these pieces of code:
        brl     r10                     # Do The Real system call

        cmpi.c  r4, 0
        blt     1f  
        ldi     r8, 0
        sw      r8, [r0, PT_R7]
        b 2f
1:
        cmpi.c  r4, -MAX_ERRNO - 1
        ble     2f
        ldi     r8, 0x1;
        sw      r8, [r0, PT_R7]
        neg     r4, r4
2:
        sw      r4, [r0, PT_R4]         # save result
- syscall without being traced vs.
        brl     r8

        li      r8, -MAX_ERRNO - 1
        sw      r8, [r0, PT_R7]         # set error flag

        neg     r4, r4                  # error
        sw      r4, [r0, PT_R0]         # set flag for syscall
                                        # restarting
1:      sw      r4, [r0, PT_R2]         # result
- syscall under ptrace.  Estimate the amount of testing (or reading, for
that matter) the second chunk had...

Both pieces are obviously derived from mips, except that
	* mips ABI has return values go in r2, score one - in r4.  Note where
the ptraced variant stores the result...
	* syscall restart logics on mips uses regs->regs[0] as "syscall restart
allowed" flag; score does no such thing - regs->is_syscall is used and no,
PT_R0 isn't equal to its offset
	* both mips and non-traced path on score implement this:
	r7 = (unsigned long)res >= -MAX_ERRNO;
	if (r7)
		res = -res;
ptraced path on score, OTOH, doesn't do comparison at all, slaps -MAX_ERRNO-1
into r7, always negates the return value and, while we are at it, still
contains the target of lost conditional branch instruction.

And yes, it had been that way since the initial merge into the mainline tree -
this didn't come from subsequent bitrot.  Does that disqualify it from
being a "new bug"?

  reply	other threads:[~2013-09-02 15:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-31  2:00 [PATCH] Remove support for score architecture Guenter Roeck
2013-08-31 18:55 ` Arnd Bergmann
2013-08-31 19:40   ` Al Viro
2013-09-02  4:13 ` Lennox Wu
2013-09-02  5:39   ` Guenter Roeck
2013-09-02 15:18     ` Lennox Wu
2013-09-02 15:57       ` Al Viro [this message]
2013-09-02 17:29       ` Guenter Roeck
     [not found]         ` <CAFP0e=Gio_o6QFboVGe3aBCM0zFrsrJuNBthj63RXr+=SDPp7Q@mail.gmail.com>
2013-09-03 15:26           ` Guenter Roeck
2013-09-04  4:19           ` Guenter Roeck
2013-09-05 13:41 ` Rob Landley
2013-09-05 16:13   ` Guenter Roeck

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=20130902155747.GZ13318@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiang.liu@huawei.com \
    --cc=lennox.wu@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=liqin299@gmail.com \
    --cc=sfr@canb.auug.org.au \
    --cc=torvalds@linux-foundation.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