linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Anton Arapov <anton@redhat.com>,
	Ananth N Mavinakayanahalli <ananth@in.ibm.com>,
	Jim Keniston <jkenisto@linux.vnet.ibm.com>,
	Jiri Olsa <jolsa@redhat.com>, Josh Stone <jistone@redhat.com>
Subject: Re: [PATCH] uprobes/core: handle breakpoint and signal step exception.
Date: Thu, 8 Mar 2012 18:48:24 +0530	[thread overview]
Message-ID: <20120308131824.GC13284@linux.vnet.ibm.com> (raw)
In-Reply-To: <20120227091212.GA7092@elte.hu>

> >  
> >  #include <linux/kdebug.h>
> >  #include <asm/insn.h>
> >  
> > +#ifdef CONFIG_X86_32
> > +#define is_32bit_app(tsk) 1
> > +#else
> > +#define is_32bit_app(tsk) (test_tsk_thread_flag(tsk, TIF_IA32))
> > +#endif
> 
> Small detail, we prefer to use this variant:
> 
> #ifdef X
> # define foo()
> #else
> # define bar()
> #endif
> 
> to give the construct more visual structure.
> 
> Also, please put it into asm/compat.h and use it at other places 
> within arch/x86/ as well, there's half a dozen similar patterns 
> of TIP_IA32 tests in arch/x86/. Please make this a separate 
> patch, preceding this patch.

I am facing a problem doing the above.
I did some changes in arch/x86/kernel/signal.c and included compat.h 
and compilation fails on tip tree that the commit 
d1a797f388

In file included from ../arch/x86/kernel/signal.c:42:
../arch/x86/include/asm/compat.h: In function ‘arch_compat_alloc_user_space’:
../arch/x86/include/asm/compat.h:238: error: ‘old_rsp’ undeclared (first use in this function)
../arch/x86/include/asm/compat.h:238: error: (Each undeclared identifier is reported only once
../arch/x86/include/asm/compat.h:238: error: for each function it appears in.)
../arch/x86/include/asm/compat.h:238: warning: type defaults to ‘int’ in declaration of ‘pfo_ret__’            


I see old_rsp declared only under CONFIG_X86_64 in asm/processor.h 

The below helps resolve the problem.
---------
diff --git a/arch/x86/include/asm/compat.h b/arch/x86/include/asm/compat.h
index 9c9b6dc..147e790 100644
--- a/arch/x86/include/asm/compat.h
+++ b/arch/x86/include/asm/compat.h
@@ -233,9 +233,11 @@ static inline void __user *arch_compat_alloc_user_space(long len)
 
 	if (test_thread_flag(TIF_IA32)) {
 		sp = task_pt_regs(current)->sp;
+#ifdef CONFIG_X86_64
 	} else {
 		/* -128 for the x32 ABI redzone */
 		sp = __this_cpu_read(old_rsp) - 128;
+#endif
 	}
 
 	return (void __user *)round_down(sp - len, 16);


-----------

But I wanted to check if there is any reason why we cant include asm/compat.h in arch/x86/kernel/signal.c.

-- 
Thanks and Regards
Srikar


  parent reply	other threads:[~2012-03-08 13:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-23 11:02 [PATCH] uprobes/core: handle breakpoint and signal step exception Srikar Dronamraju
2012-02-23 12:18 ` Anton Arapov
2012-02-24  5:31   ` Srikar Dronamraju
2012-02-27  9:12 ` Ingo Molnar
2012-02-28 13:26   ` Srikar Dronamraju
2012-02-28 13:52     ` Ingo Molnar
2012-02-28 14:17       ` Srikar Dronamraju
2012-02-28 14:27         ` Ingo Molnar
2012-03-08 13:18   ` Srikar Dronamraju [this message]
2012-03-08 13:48     ` Ingo Molnar
2012-03-09  6:28       ` Srikar Dronamraju
2012-03-09  7:33         ` Ingo Molnar
2012-03-13  5:20           ` Ingo Molnar
2012-03-13  5:42             ` Ingo Molnar
2012-03-13  5:47               ` Ingo Molnar
2012-03-13  9:24                 ` Srikar Dronamraju
2012-03-13  9:38                   ` Ingo Molnar
2012-02-27  9:24 ` Ingo Molnar

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=20120308131824.GC13284@linux.vnet.ibm.com \
    --to=srikar@linux.vnet.ibm.com \
    --cc=ananth@in.ibm.com \
    --cc=anton@redhat.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jistone@redhat.com \
    --cc=jkenisto@linux.vnet.ibm.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).