Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp210609pxj; Thu, 17 Jun 2021 00:38:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpymU69CWKQNMrMukPxb/j6SfWpUTofMCZDzYlGst4CPUS90iEljNi46+E7qU3Knoce1dQ X-Received: by 2002:a17:906:390d:: with SMTP id f13mr3008739eje.128.1623915498003; Thu, 17 Jun 2021 00:38:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623915497; cv=none; d=google.com; s=arc-20160816; b=HZzIHEmh/tvia3WacUzxfZ4tNTXL9+XwMuaGpY3xXDp899hnoBEZjr5B5Irs4skhHQ dCzcUYR+liPXaxeSpZWJbsEpxkB+ERV7behkMpeXy5+0TKxc0OGxSZpO2SUa5Zf71Iym J9v0Ysz27YYGzj6LsvVvPYOF/fDLz3fhOWPrYdE/KzQUn/TM/JPCjWYA1qATtCjFjvCk fDosta1HgS1z4YJMPgBUh3Yyoz2VxWWp7Ip6GOmgcJBMQqDP8Yh6/OB2iLlWdBoe5IXs x9iKmqdONbqnsJurwUOFlRqSpM4iD5ddV2l1D6tLH54IWmYj7su7Y+9yqhHUt+HwPsuk Ojvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:from:subject; bh=XxtCJXTuf8xtH6Bg+0pZoJmVk5o8TLYAoKvkBe/i3tY=; b=HSGL9t64CMnLl7ZTw9pAZIWbzjsjRI2ywoC35lhFZJzqlkxjGd6bowkMN7hB0Q/hoV T1F0YZWHYiVfg26R1etF/703m1WCR18P1EIDn/ujKHFbtG/VSyybGGv8xZ3lrkyuuHT6 5CTakj9eWfmXHx/fbFO62lldin9BD0qZ1dwkmQt/4bd7tE61S08A822xEg5sZyvjQ2FT EkJdfKSI5ro7eTzYqSDyTvd05ku6ZV9lQO6DET59EXrPa1/b25fsVuLGlwnUfH17WRna zceGn34Eq8Mq+H0gxXebWXCFz81H3Uc2brQ71O67mpIfWLieVIAU9S7FaT15o1p25yKy Rurw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j7si4828996ejm.492.2021.06.17.00.37.55; Thu, 17 Jun 2021 00:38:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230075AbhFQHhL (ORCPT + 99 others); Thu, 17 Jun 2021 03:37:11 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:44603 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229666AbhFQHhJ (ORCPT ); Thu, 17 Jun 2021 03:37:09 -0400 Received: from localhost (mailhub3.si.c-s.fr [192.168.12.233]) by localhost (Postfix) with ESMTP id 4G5DNN3BPjzBBMR; Thu, 17 Jun 2021 09:35:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Wwi-Sb9-gVs9; Thu, 17 Jun 2021 09:35:00 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 4G5DNN2CdMzB9jd; Thu, 17 Jun 2021 09:35:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 38BB98B804; Thu, 17 Jun 2021 09:35:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 7J6GAaFtRhUL; Thu, 17 Jun 2021 09:35:00 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 112FB8B801; Thu, 17 Jun 2021 09:34:59 +0200 (CEST) Subject: Re: [PATCH v3 22/23] powerpc/vdso: Migrate native signals to generic vdso_base From: Christophe Leroy To: Dmitry Safonov , linux-kernel@vger.kernel.org Cc: Dmitry Safonov <0x7f454c46@gmail.com>, Alexander Viro , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Catalin Marinas , Guo Ren , "H. Peter Anvin" , Ingo Molnar , Oleg Nesterov , Russell King , Thomas Bogendoerfer , Thomas Gleixner , Vincenzo Frascino , Will Deacon , x86@kernel.org, Benjamin Herrenschmidt , Michael Ellerman , Paul Mackerras References: <20210611180242.711399-1-dima@arista.com> <20210611180242.711399-23-dima@arista.com> <1678c131-98e3-2d5c-7cf1-0dcb985d67bb@csgroup.eu> Message-ID: Date: Thu, 17 Jun 2021 09:34:57 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1678c131-98e3-2d5c-7cf1-0dcb985d67bb@csgroup.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 17/06/2021 à 08:36, Christophe Leroy a écrit : > > > Le 11/06/2021 à 20:02, Dmitry Safonov a écrit : >> Generic way to track the land vma area. >> Stat speaks for itself. >> >> Cc: Benjamin Herrenschmidt >> Cc: Michael Ellerman >> Cc: Paul Mackerras >> Signed-off-by: Dmitry Safonov > > > Build failure: > >   CC      arch/powerpc/kernel/asm-offsets.s > In file included from ./include/linux/mmzone.h:21, >                  from ./include/linux/gfp.h:6, >                  from ./include/linux/xarray.h:14, >                  from ./include/linux/radix-tree.h:19, >                  from ./include/linux/fs.h:15, >                  from ./include/linux/compat.h:17, >                  from arch/powerpc/kernel/asm-offsets.c:14: > ./include/linux/mm_types.h: In function 'init_vdso_base': > ./include/linux/mm_types.h:522:28: error: 'TASK_SIZE_MAX' undeclared (first use in this function); > did you mean 'XATTR_SIZE_MAX'? >   522 | #define UNMAPPED_VDSO_BASE TASK_SIZE_MAX >       |                            ^~~~~~~~~~~~~ > ./include/linux/mm_types.h:627:40: note: in expansion of macro 'UNMAPPED_VDSO_BASE' >   627 |         mm->vdso_base = (void __user *)UNMAPPED_VDSO_BASE; >       |                                        ^~~~~~~~~~~~~~~~~~ > ./include/linux/mm_types.h:522:28: note: each undeclared identifier is reported only once for each > function it appears in >   522 | #define UNMAPPED_VDSO_BASE TASK_SIZE_MAX >       |                            ^~~~~~~~~~~~~ > ./include/linux/mm_types.h:627:40: note: in expansion of macro 'UNMAPPED_VDSO_BASE' >   627 |         mm->vdso_base = (void __user *)UNMAPPED_VDSO_BASE; >       |                                        ^~~~~~~~~~~~~~~~~~ > make[2]: *** [arch/powerpc/kernel/asm-offsets.s] Error 1 > make[1]: *** [prepare0] Error 2 > make: *** [__sub-make] Error 2 > Fixed by moving TASK_SIZE_MAX into asm/task_size_32.h and asm/task_size_64.h diff --git a/arch/powerpc/include/asm/task_size_32.h b/arch/powerpc/include/asm/task_size_32.h index de7290ee770f..03af9e6bb5cd 100644 --- a/arch/powerpc/include/asm/task_size_32.h +++ b/arch/powerpc/include/asm/task_size_32.h @@ -7,6 +7,7 @@ #endif #define TASK_SIZE (CONFIG_TASK_SIZE) +#define TASK_SIZE_MAX TASK_SIZE /* * This decides where the kernel will search for a free chunk of vm space during diff --git a/arch/powerpc/include/asm/task_size_64.h b/arch/powerpc/include/asm/task_size_64.h index c993482237ed..bfdb98c0ef43 100644 --- a/arch/powerpc/include/asm/task_size_64.h +++ b/arch/powerpc/include/asm/task_size_64.h @@ -49,6 +49,7 @@ TASK_SIZE_USER64) #define TASK_SIZE TASK_SIZE_OF(current) +#define TASK_SIZE_MAX TASK_SIZE_USER64 #define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4)) #define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(DEFAULT_MAP_WINDOW_USER64 / 4)) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index 22c79ab40006..5823140d39f1 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -8,13 +8,6 @@ #include #include -#ifdef __powerpc64__ -/* We use TASK_SIZE_USER64 as TASK_SIZE is not constant */ -#define TASK_SIZE_MAX TASK_SIZE_USER64 -#else -#define TASK_SIZE_MAX TASK_SIZE -#endif - static inline bool __access_ok(unsigned long addr, unsigned long size) { return addr < TASK_SIZE_MAX && size <= TASK_SIZE_MAX - addr;