All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Nicolai Stange <nicstange@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	daniel@iogearbox.net
Subject: Re: [PATCH] lib: test_bpf: purge CPP register redefinitions
Date: Mon, 22 Jun 2015 09:10:51 +0200	[thread overview]
Message-ID: <5587B4FB.3040609@nod.at> (raw)
In-Reply-To: <5587B0C7.8090507@nod.at>

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

Am 22.06.2015 um 08:52 schrieb Richard Weinberger:
> Am 22.06.2015 um 08:05 schrieb Alexei Starovoitov:
>> to get rid of warning you proposing to do 1k line renames?!
>> Just add:
>> +#undef R8
>> +#undef R9
>> +#undef R10
>>  #define R0             BPF_REG_0
> 
> This would be also just another hack.
> 
>> Though I think the better fix woud be to clean up:
>> arch/x86/include/uapi/asm/ptrace-abi.h
>> What's the point of:
>> #define R8 72
>> from 'uapi' point of view?
> 
> To query cpu registers using ptrace(2).
> 
>> Look like kernel details that shouldn't be exposed in uapi.
> 
> These are not kernel details.
> 
> Actually the problem is the other way around.
> UML is Linux ported to it's own userspace ABI.
> Hence, the arch/um and arch/x86/um use uapi header files.
> 
> Maybe we can rework UML's header files such that
> no uapi header pollutes the kernel namespace.

While riding the bus to my office I've materialized that idea.
Nicolai, can you please give the attached patch a try?

Thanks,
//richard

[-- Attachment #2: ptrace_abi.diff --]
[-- Type: text/x-patch, Size: 1941 bytes --]

diff --git a/arch/um/include/asm/ptrace-generic.h b/arch/um/include/asm/ptrace-generic.h
index cb9b3c4..7485162 100644
--- a/arch/um/include/asm/ptrace-generic.h
+++ b/arch/um/include/asm/ptrace-generic.h
@@ -8,7 +8,6 @@
 
 #ifndef __ASSEMBLY__
 
-#include <asm/ptrace-abi.h>
 #include <sysdep/ptrace.h>
 
 struct pt_regs {
diff --git a/arch/um/kernel/ptrace.c b/arch/um/kernel/ptrace.c
index 174ee50..7a0b2d9 100644
--- a/arch/um/kernel/ptrace.c
+++ b/arch/um/kernel/ptrace.c
@@ -8,6 +8,7 @@
 #include <linux/sched.h>
 #include <linux/tracehook.h>
 #include <asm/uaccess.h>
+#include <asm/ptrace-abi.h>
 
 void user_enable_single_step(struct task_struct *child)
 {
diff --git a/arch/x86/um/ptrace_32.c b/arch/x86/um/ptrace_32.c
index ce3dd4f..a29756f 100644
--- a/arch/x86/um/ptrace_32.c
+++ b/arch/x86/um/ptrace_32.c
@@ -6,6 +6,7 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <asm/uaccess.h>
+#include <asm/ptrace-abi.h>
 #include <skas.h>
 
 extern int arch_switch_tls(struct task_struct *to);
diff --git a/arch/x86/um/ptrace_64.c b/arch/x86/um/ptrace_64.c
index 3b52bf0..a629694 100644
--- a/arch/x86/um/ptrace_64.c
+++ b/arch/x86/um/ptrace_64.c
@@ -11,6 +11,7 @@
 #define __FRAME_OFFSETS
 #include <asm/ptrace.h>
 #include <asm/uaccess.h>
+#include <asm/ptrace-abi.h>
 
 /*
  * determines which flags the user has access to.
diff --git a/arch/x86/um/tls_32.c b/arch/x86/um/tls_32.c
index 80ffa5b..48e3858 100644
--- a/arch/x86/um/tls_32.c
+++ b/arch/x86/um/tls_32.c
@@ -7,6 +7,7 @@
 #include <linux/sched.h>
 #include <linux/syscalls.h>
 #include <asm/uaccess.h>
+#include <asm/ptrace-abi.h>
 #include <os.h>
 #include <skas.h>
 #include <sysdep/tls.h>
diff --git a/arch/x86/um/tls_64.c b/arch/x86/um/tls_64.c
index d22363c..3ad7143 100644
--- a/arch/x86/um/tls_64.c
+++ b/arch/x86/um/tls_64.c
@@ -1,4 +1,5 @@
 #include <linux/sched.h>
+#include <asm/ptrace-abi.h>
 
 void clear_flushed_tls(struct task_struct *task)
 {

  reply	other threads:[~2015-06-22  7:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-21 19:41 [PATCH] lib: test_bpf: purge CPP register redefinitions Nicolai Stange
2015-06-21 19:41 ` Nicolai Stange
2015-06-22  6:05 ` Alexei Starovoitov
2015-06-22  6:05   ` Alexei Starovoitov
2015-06-22  6:52   ` Richard Weinberger
2015-06-22  6:52     ` Richard Weinberger
2015-06-22  7:10     ` Richard Weinberger [this message]
2015-06-22 13:47       ` Nicolai Stange
2015-06-22 13:47         ` Nicolai Stange
2015-06-23 13:47         ` David Miller
2015-06-23 13:47 ` 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=5587B4FB.3040609@nod.at \
    --to=richard@nod.at \
    --cc=alexei.starovoitov@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nicstange@gmail.com \
    /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.