From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932947AbbFVHLG (ORCPT ); Mon, 22 Jun 2015 03:11:06 -0400 Received: from a.ns.miles-group.at ([95.130.255.143]:65275 "EHLO radon.swed.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753925AbbFVHK4 (ORCPT ); Mon, 22 Jun 2015 03:10:56 -0400 Message-ID: <5587B4FB.3040609@nod.at> Date: Mon, 22 Jun 2015 09:10:51 +0200 From: Richard Weinberger User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Alexei Starovoitov , Nicolai Stange CC: "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, daniel@iogearbox.net Subject: Re: [PATCH] lib: test_bpf: purge CPP register redefinitions References: <87twu0df3k.fsf@gmail.com> <20150622060523.GA16156@Alexeis-MacBook-Pro.local> <5587B0C7.8090507@nod.at> In-Reply-To: <5587B0C7.8090507@nod.at> Content-Type: multipart/mixed; boundary="------------070900040409070207060008" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a multi-part message in MIME format. --------------070900040409070207060008 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit 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 --------------070900040409070207060008 Content-Type: text/x-patch; name="ptrace_abi.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ptrace_abi.diff" 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 #include 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 #include #include +#include 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 #include #include +#include #include 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 #include +#include /* * 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 #include #include +#include #include #include #include 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 +#include void clear_flushed_tls(struct task_struct *task) { --------------070900040409070207060008-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/