Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2933959pxa; Tue, 25 Aug 2020 07:19:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxjq4RxUZSxHfIoPORaJvxksZT/o5txKAI4/mi1FycvtHVqtzekBKeKyOaAF7v3qJF6PUr X-Received: by 2002:a17:906:6a84:: with SMTP id p4mr11304766ejr.374.1598365162222; Tue, 25 Aug 2020 07:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598365162; cv=none; d=google.com; s=arc-20160816; b=CamEIsDWOEkLJQJq5YOUXIjVi51xytWBP8bn25A9I2j9GMnhexCWsOhB1c0dreQVrt AMeWO5f3zWv2+ptR4UALcOJh1DOQzMbaUfI3to8MOfm3fsV7VLZgTM8D4tKnhYZzT55P CNfFTqtkKaVCQ77k+Iltf+INOYoTGfRSatQ6/Syzc6aJjn2Bh5i0WiyoCCdsgG866PHF 8lvWqGmolymKqToyN71UIMV1f9zXU9i5zq3OnLpBjmuCC+TQ3BPODz1iqlWy5FS3ZvNC N4mDxbL/22yu2H3LzDyTszhY5KxcMuqaNY82J9cUbvO1G+/SOmnmGGbx/qbwfnF8khWz WJdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:references:cc:to:from:subject; bh=ir55siASQFNHks42YfjSoBEmT9+gXu5q5c7IuFHvWDY=; b=pqeGnlnSHH2hFN053/Cox98HuQ/cY89I9AHlT9Ckn5w06jqeQax/9BfuKursj3o+nz 74afczM+1wjMQBE3mLdVZaurMMfks3F4mQ8x75uXFC2JWKGY0Dwpk4M6h42W/PPjSkaO muhH3PcFNBcmhGrLlSdMNCSYzsL8iXxnZhQ0Za1lje+Kx12LXo4sqVYqwPscHXLdgbmo nvxrl9rinbPS4Vcql17o35fBEZvjuCHHHrsOtYO1rOcFFVS0qbcsieh4Tas4tgqkLrgA 1EQvBMZ4kyw7ZsZEhP9FykjwawYNcFaWTQ5gZdkYL9i98lvr1wSTzzJaeFZHDPmM/p3N AuTg== 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 hb22si3424730ejb.152.2020.08.25.07.18.59; Tue, 25 Aug 2020 07:19:22 -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 S1726230AbgHYOQQ (ORCPT + 99 others); Tue, 25 Aug 2020 10:16:16 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:9286 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725893AbgHYOQP (ORCPT ); Tue, 25 Aug 2020 10:16:15 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4BbWHt0vQ2z9tx1l; Tue, 25 Aug 2020 16:16:10 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id pJ2ZT6WP1cSM; Tue, 25 Aug 2020 16:16:10 +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 4BbWHs4Dvlz9txlt; Tue, 25 Aug 2020 16:16:09 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 01BDA8B823; Tue, 25 Aug 2020 16:16:08 +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 PErXmI-tRVWl; Tue, 25 Aug 2020 16:16:07 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7380D8B820; Tue, 25 Aug 2020 16:16:04 +0200 (CEST) Subject: Re: [PATCH v8 2/8] powerpc/vdso: Remove __kernel_datapage_offset and simplify __get_datapage() From: Christophe Leroy To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , nathanl@linux.ibm.com Cc: linux-arch@vger.kernel.org, arnd@arndb.de, linux-kernel@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, vincenzo.frascino@arm.com, linuxppc-dev@lists.ozlabs.org References: <0d2201efe3c7727f2acc718aefd7c5bb22c66c57.1588079622.git.christophe.leroy@c-s.fr> <87wo34tbas.fsf@mpe.ellerman.id.au> <2f9b7d02-9e2f-4724-2608-c5573f6507a2@csgroup.eu> Message-ID: <6862421a-5a14-2e38-b825-e39e6ad3d51d@csgroup.eu> Date: Tue, 25 Aug 2020 16:15:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <2f9b7d02-9e2f-4724-2608-c5573f6507a2@csgroup.eu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 04/08/2020 à 13:17, Christophe Leroy a écrit : > > > On 07/16/2020 02:59 AM, Michael Ellerman wrote: >> Christophe Leroy writes: >>> The VDSO datapage and the text pages are always located immediately >>> next to each other, so it can be hardcoded without an indirection >>> through __kernel_datapage_offset >>> >>> In order to ease things, move the data page in front like other >>> arches, that way there is no need to know the size of the library >>> to locate the data page. >>> [...] >> >> I merged this but then realised it breaks the display of the vdso in >> /proc/self/maps. >> >> ie. the vdso vma gets no name: >> >>    # cat /proc/self/maps [...] >> >> >> And it's also going to break the logic in arch_unmap() to detect if >> we're unmapping (part of) the VDSO. And it will break arch_remap() too. >> >> And the logic to recognise the signal trampoline in >> arch/powerpc/perf/callchain_*.c as well. > > I don't think it breaks that one, because ->vdsobase is still the start > of text. > >> >> So I'm going to rebase and drop this for now. >> >> Basically we have a bunch of places that assume that vdso_base is == the >> start of the VDSO vma, and also that the code starts there. So that will >> need some work to tease out all those assumptions and make them work >> with this change. > > Ok, one day I need to look at it in more details and see how other > architectures handle it etc ... > I just sent out a series which switches powerpc to the new _install_special_mapping() API, the one powerpc uses being deprecated since commit a62c34bd2a8a ("x86, mm: Improve _install_special_mapping and fix x86 vdso naming") arch_remap() gets replaced by vdso_remap() For arch_unmap(), I'm wondering how/what other architectures do, because powerpc seems to be the only one to erase the vdso context pointer when unmapping the vdso. So far I updated it to take into account the pages switch. Everything else is not impacted because our vdso_base is still the base of the text and that's what those things (signal trampoline, callchain, ...) expect. Maybe we should change it to 'void *vdso' in the same way as other architectures, as it is not anymore the exact vdso_base but the start of VDSO text. Note that the series applies on top of the generic C VDSO implementation series. However all but the last commit cleanly apply without that series. As that last commit is just an afterwork cleanup, it can come in a second step. Christophe