All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hong H. Pham" <hong.pham@windriver.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH] Fix VIS emulation bugs
Date: Thu, 04 Dec 2008 14:51:28 +0000	[thread overview]
Message-ID: <4937EE70.2010307@windriver.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0812040038150.8383@digraph.polyomino.org.uk>

Hi,

>> This patch fixes the bug if single-stepping over the affected
>> instruction in the debugger, but not if the testcase is run
>> standalone.  For that, Wind River has another patch I hope they will
>> send as a followup to this patch submission.
>>
>> Signed-off-by: Joseph Myers <joseph@codesourcery.com>
> 
> Patch applied, thanks!

Here's the follow up patch to Joseph's VIS emulation fix.  The pdist
testcase runs successfully as a standalone with this patch.

Best regards,
Hong


Copy the FPU state to the task's thread_info->fpregs for the VIS emulation
functions to access.

Signed-off-by: Hong H. Pham <hong.pham@windriver.com>
---
  arch/sparc64/kernel/visemul.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/sparc64/kernel/visemul.c b/arch/sparc64/kernel/visemul.c
index 4e285f9..a4428fd 100644
--- a/arch/sparc64/kernel/visemul.c
+++ b/arch/sparc64/kernel/visemul.c
@@ -802,16 +802,18 @@ int vis_emul(struct pt_regs *regs, unsigned int insn)
  	BUG_ON(regs->tstate & TSTATE_PRIV);

  	if (test_thread_flag(TIF_32BIT))
  		pc = (u32)pc;

  	if (get_user(insn, (u32 __user *) pc))
  		return -EFAULT;

+	save_and_clear_fpu();
+
  	opf = (insn & VIS_OPF_MASK) >> VIS_OPF_SHIFT;
  	switch (opf) {
  	default:
  		return -EINVAL;

  	/* Pixel Formatting Instructions.  */
  	case FPACK16_OPF:
  	case FPACK32_OPF:
-- 
1.5.5.1


  parent reply	other threads:[~2008-12-04 14:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-04  0:41 [PATCH] Fix VIS emulation bugs Joseph S. Myers
2008-12-04  3:35 ` David Miller
2008-12-04 14:51 ` Hong H. Pham [this message]
2008-12-04 17:12 ` David Miller

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=4937EE70.2010307@windriver.com \
    --to=hong.pham@windriver.com \
    --cc=sparclinux@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.