From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org
Subject: Re: [PATCH] powerpc: Fix system calls on Cell entered with XER.SO=1
Date: Mon, 01 Dec 2008 08:59:42 +1100 [thread overview]
Message-ID: <1228082382.7356.110.camel@pasglop> (raw)
In-Reply-To: <18739.2681.351794.669476@cargo.ozlabs.ibm.com>
On Mon, 2008-12-01 at 08:49 +1100, Paul Mackerras wrote:
> It turns out that on Cell, on a kernel with CONFIG_VIRT_CPU_ACCOUNTING
> = y, if a program sets the SO (summary overflow) bit in the XER and
> then does a system call, the SO bit in CR0 will be set on return
> regardless of whether the system call detected an error. Since CR0.SO
> is used as the error indication from the system call, this means that
> all system calls appear to fail.
>
> The reason is that the workaround for the timebase bug on Cell uses a
> compare instruction. With CONFIG_VIRT_CPU_ACCOUNTING = y, the
> ACCOUNT_CPU_USER_ENTRY macro reads the timebase, so we end up doing a
> compare instruction, which copies XER.SO to CR0.SO. Since we were
> doing this in the system call entry patch after clearing CR0.SO but
> before saving the CR, this meant that the saved CR image had CR0.SO
> set if XER.SO was set on entry.
>
> This fixes it by moving the clearing of CR0.SO to after the
> ACCOUNT_CPU_USER_ENTRY call in the system call entry path.
>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
next prev parent reply other threads:[~2008-11-30 21:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-30 21:49 [PATCH] powerpc: Fix system calls on Cell entered with XER.SO=1 Paul Mackerras
2008-11-30 21:59 ` Benjamin Herrenschmidt [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-11-26 0:59 Paul Mackerras
2008-11-26 10:52 ` Arnd Bergmann
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=1228082382.7356.110.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=cbe-oss-dev@ozlabs.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).