Received: by 10.223.176.5 with SMTP id f5csp3445543wra; Mon, 29 Jan 2018 13:17:30 -0800 (PST) X-Google-Smtp-Source: AH8x224nYmBcVnswuHoDJXBCq/1Yrh8H2nWgwfj1d+JipKavZhtlbhnEKj7e+26/tYQ8QIvyr2xi X-Received: by 10.101.65.131 with SMTP id a3mr21490432pgq.99.1517260650386; Mon, 29 Jan 2018 13:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517260650; cv=none; d=google.com; s=arc-20160816; b=REcjgTceFtTOU0tuS6bPjX+1CiubPXvslJ1r6hoVFDjh2w69K68ncmcWo/6xWr23zD L0WX4+R1rFGerDACLTNH0imp5UWQxJGnFXcwwMYCLH4xSxEUikPGWoPa0rAvrE4YK5w7 YjLNIWPBQW+40q0SjnRrcCc/l5VFc20ipjVWTWqIupi6hc/YnBRNncs/kZm/Sz0X9YQi s+LK1DTy44EsudICNLBt59YMveByzNhDOj7Ww+lpPGw0ytVy3why9zypvfoT8GEVchNA k9psAgpDS+1k3WAr3X/oaPulpIbzI5MwbYWwfPMbjGErRq4R4mMaMCjGjdBVHxTZqWJK TA0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9xyyhXtQ4zufEcmZXK4vuDXVJySqg4HXIrr0fTPFz24=; b=ZcH7b8BzjoSOeeLmcXqs/Zgh9xNqBT8SCW/DAbXxjg+6CnkdJ9Ns1R8QA4Sw3sz3aB zfCXm3hDmlQE5y5foa6Lzl0mLR4lDCiPtWgc2pfzUpnPps9b5/BGxR5ZxNwk6d8YGtC9 TdR6Ak+8DryiOGYY4qSdrN7RFymFOSAx2h9ZsKRLyNlbteDcBTpNR5aWP7sq4JhpmskU wblBT5tK9+eFP4kRGYzypg/hZvm+rFQCeEN/FOSo2soeR0JuVDLn+k+jpDjSBMghCl4x QWf8G4taMrn5kO9YZh/5BuzK75re73BXZs5spzW+k8rvf8WxzImkEmyVX2WqfeGacGep LJRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si213225pfc.338.2018.01.29.13.17.15; Mon, 29 Jan 2018 13:17:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752402AbeA2VQw (ORCPT + 99 others); Mon, 29 Jan 2018 16:16:52 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43018 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752013AbeA2UEc (ORCPT ); Mon, 29 Jan 2018 15:04:32 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 679E62EAF; Mon, 29 Jan 2018 12:59:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Richard Weinberger , Greg Hackmann , Bernie Innocenti , Lorenzo Colitti Subject: [PATCH 3.18 38/52] um: Stop abusing __KERNEL__ Date: Mon, 29 Jan 2018 13:56:56 +0100 Message-Id: <20180129123629.857101845@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123628.168904217@linuxfoundation.org> References: <20180129123628.168904217@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Richard Weinberger commit 298e20ba8c197e8d429a6c8671550c41c7919033 upstream. Currently UML is abusing __KERNEL__ to distinguish between kernel and host code (os-Linux). It is better to use a custom define such that existing users of __KERNEL__ don't get confused. Signed-off-by: Richard Weinberger Cc: Greg Hackmann Cc: Bernie Innocenti Cc: Lorenzo Colitti Signed-off-by: Greg Kroah-Hartman --- arch/um/Makefile | 7 ++++--- arch/um/drivers/mconsole.h | 2 +- arch/um/include/shared/init.h | 4 ++-- arch/um/include/shared/user.h | 2 +- arch/x86/um/shared/sysdep/tls.h | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) --- a/arch/um/Makefile +++ b/arch/um/Makefile @@ -68,9 +68,10 @@ KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) - KBUILD_AFLAGS += $(ARCH_INCLUDE) -USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ - $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ - $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include +USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -I%,,$(KBUILD_CFLAGS))) \ + $(ARCH_INCLUDE) $(MODE_INCLUDE) $(filter -I%,$(CFLAGS)) \ + -D_FILE_OFFSET_BITS=64 -idirafter include \ + -D__KERNEL__ -D__UM_HOST__ #This will adjust *FLAGS accordingly to the platform. include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) --- a/arch/um/drivers/mconsole.h +++ b/arch/um/drivers/mconsole.h @@ -7,7 +7,7 @@ #ifndef __MCONSOLE_H__ #define __MCONSOLE_H__ -#ifndef __KERNEL__ +#ifdef __UM_HOST__ #include #define u32 uint32_t #endif --- a/arch/um/include/shared/init.h +++ b/arch/um/include/shared/init.h @@ -40,7 +40,7 @@ typedef int (*initcall_t)(void); typedef void (*exitcall_t)(void); -#ifndef __KERNEL__ +#ifdef __UM_HOST__ #ifndef __section # define __section(S) __attribute__ ((__section__(#S))) #endif @@ -131,7 +131,7 @@ extern struct uml_param __uml_setup_star #define __uml_postsetup_call __used __section(.uml.postsetup.init) #define __uml_exit_call __used __section(.uml.exitcall.exit) -#ifndef __KERNEL__ +#ifdef __UM_HOST__ #define __define_initcall(level,fn) \ static initcall_t __initcall_##fn __used \ --- a/arch/um/include/shared/user.h +++ b/arch/um/include/shared/user.h @@ -17,7 +17,7 @@ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* This is to get size_t */ -#ifdef __KERNEL__ +#ifndef __UM_HOST__ #include #else #include --- a/arch/x86/um/shared/sysdep/tls.h +++ b/arch/x86/um/shared/sysdep/tls.h @@ -1,7 +1,7 @@ #ifndef _SYSDEP_TLS_H #define _SYSDEP_TLS_H -# ifndef __KERNEL__ +#ifdef __UM_HOST__ /* Change name to avoid conflicts with the original one from , which * may be named user_desc (but in 2.4 and in header matching its API was named @@ -22,11 +22,11 @@ typedef struct um_dup_user_desc { #endif } user_desc_t; -# else /* __KERNEL__ */ +#else /* __UM_HOST__ */ typedef struct user_desc user_desc_t; -# endif /* __KERNEL__ */ +#endif /* __UM_HOST__ */ extern int os_set_thread_area(user_desc_t *info, int pid); extern int os_get_thread_area(user_desc_t *info, int pid);