diff mbox

sparc: refactor code in fault_32.c

Message ID 20090107.171649.174783717.davem@davemloft.net
State Accepted
Delegated to: David Miller
Headers show

Commit Message

David Miller Jan. 8, 2009, 1:16 a.m. UTC
From: Sam Ravnborg <sam@ravnborg.org>
Date: Tue, 6 Jan 2009 22:06:24 +0100

> So outstanding issues now are:
> 
> 1) How to fix "warning" in unaligned_64.c (get_user() || get_user())

I'm going to put a hack patch in, similar to your's, so people can get
work done.  We can try to cure this situation more cleanly later.

    sparc64: Work around branch tracer warning.
    
    As reported by Sam Ravnborg, Gcc-3.4.5 does not handle:
    
    	if (get_user() || get_user())
    
    with the new branch tracer enabled.
    
    Just seperate it out into seperate statements for now
    so people can get work done.
    
    Signed-off-by: David S. Miller <davem@davemloft.net>

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Ingo Molnar Jan. 8, 2009, 12:02 p.m. UTC | #1
* David Miller <davem@davemloft.net> wrote:

> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Tue, 6 Jan 2009 22:06:24 +0100
> 
> > So outstanding issues now are:
> > 
> > 1) How to fix "warning" in unaligned_64.c (get_user() || get_user())
> 
> I'm going to put a hack patch in, similar to your's, so people can get
> work done.  We can try to cure this situation more cleanly later.
> 
>     sparc64: Work around branch tracer warning.
>     
>     As reported by Sam Ravnborg, Gcc-3.4.5 does not handle:
>     
>     	if (get_user() || get_user())
>     
>     with the new branch tracer enabled.
>     
>     Just seperate it out into seperate statements for now
>     so people can get work done.

Can you think of any way we could improve the branch-tracer 
instrumentation define in any way to prevent such trouble?

	Ingo
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller Jan. 8, 2009, 4:33 p.m. UTC | #2
From: Ingo Molnar <mingo@elte.hu>
Date: Thu, 8 Jan 2009 13:02:34 +0100

> Can you think of any way we could improve the branch-tracer 
> instrumentation define in any way to prevent such trouble?

Steven was looking into this but every variant of the if() macro he
tried wasn't able to eliminate all of the problems.  We've been
discussing this with him in another thread for several days.  The
S390 folks are running into these kinds of problems too.

It's basically an issue of how deeply older GCCs will search
into the control flow of a very complex conditional.  There
really isn't anything we can do about that.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/sparc/kernel/unaligned_64.c b/arch/sparc/kernel/unaligned_64.c
index 203ddfa..f164d5a 100644
--- a/arch/sparc/kernel/unaligned_64.c
+++ b/arch/sparc/kernel/unaligned_64.c
@@ -601,11 +601,15 @@  void handle_lddfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr
 		pc = (u32)pc;
 	if (get_user(insn, (u32 __user *) pc) != -EFAULT) {
 		int asi = decode_asi(insn, regs);
+		int err;
+
 		if ((asi > ASI_SNFL) ||
 		    (asi < ASI_P))
 			goto daex;
-		if (get_user(first, (u32 __user *)sfar) ||
-		     get_user(second, (u32 __user *)(sfar + 4))) {
+		err = get_user(first, (u32 __user *)sfar);
+		if (!err)
+			err = get_user(second, (u32 __user *)(sfar + 4));
+		if (err) {
 			if (asi & 0x2) /* NF */ {
 				first = 0; second = 0;
 			} else