From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46301C433EF for ; Thu, 9 Dec 2021 10:44:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7723B6B0071; Thu, 9 Dec 2021 05:43:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6FB926B0073; Thu, 9 Dec 2021 05:43:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5C2936B0074; Thu, 9 Dec 2021 05:43:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0111.hostedemail.com [216.40.44.111]) by kanga.kvack.org (Postfix) with ESMTP id 484B56B0071 for ; Thu, 9 Dec 2021 05:43:50 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 0355A181291FC for ; Thu, 9 Dec 2021 10:43:40 +0000 (UTC) X-FDA: 78897919758.21.9863C0B Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf29.hostedemail.com (Postfix) with ESMTP id 457EA120007 for ; Thu, 9 Dec 2021 10:43:39 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id r138so4694912pgr.13 for ; Thu, 09 Dec 2021 02:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=2Qjk1kLBchBn6nu4RyDNGi/pft6RyBtffqzm5RXD6rQ=; b=J3fgveQOyktHd0Ho6etVh+aiABFsCMbits+i4+iiw3mPGq0uV+cwoX51PQxUyX1m/u guVf+Yy/AALjrRYousf5AWBJOSXjBdfIruQ+12bnfDkQtkrkGptAGDly7UT4e+Qf9/A6 ZG6y06qVmUF8U/9C0WnBuCeYTnrQT0Ll4AxFXzvcHBUGOeALFrwANDwwkk2cSazA8fQT JitIEB2WLroaNlv5sDxN5F3yqb6MnIP+xPFJ28c694sFturpNEL5t5AEuTZTC5UTWqjO PVOfPEZ45ZkQYpmOLCeVh8/99r2cqZObZSVqnFBxaEuoX6PyxaJMyUWwq+JlrGlkQQCe lsag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=2Qjk1kLBchBn6nu4RyDNGi/pft6RyBtffqzm5RXD6rQ=; b=zz93gtKoLLW887GSbTSM82aQMssn4sWaQNBDnR2H1WgGaN5qepxj3P3nSKKfbfO75K /9nOBwZn9JvvVtoC/kFCKLYY8DeBCLFmuN8/RJeA2TQ2CrmFGPqspZ+i151rV/knb3md ZXXcwiK1vxhnAFAjuOV33WG84K+K8W6BvkKNomKl6kcw4NyerOrTaB2TauL65hxGPs8d xnUaPj0k1I3lVuH2/eJAsUve3qYI33U6ManCISCS6Hcu/wDVoCLUEP82IFdNDxCPyXAZ TjrbWIkRH6PDF3qOEEoALlEyea3meOu7r5xFfWlq9o/og3cQMmPnC1IEayAEB7Zm/Er0 T1Ig== X-Gm-Message-State: AOAM532g6oE0zhJgJGvXeNuE45rvp9QG2Pe3QYVEaHPGUBKPg97i+rZ4 yn9/0RYMN2htvMHNOjN8eUc= X-Google-Smtp-Source: ABdhPJwHG5S78XCRdMnXjjsXRAdUoVQkNZBPVctW89B41UUPc1LLj2IYRqJKX0ugAkxryonyH8Gm6Q== X-Received: by 2002:a63:b60e:: with SMTP id j14mr33497418pgf.554.1639046618557; Thu, 09 Dec 2021 02:43:38 -0800 (PST) Received: from localhost (203-219-139-206.static.tpgi.com.au. [203.219.139.206]) by smtp.gmail.com with ESMTPSA id h8sm5230340pgj.26.2021.12.09.02.43.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Dec 2021 02:43:38 -0800 (PST) Date: Thu, 09 Dec 2021 20:43:32 +1000 From: Nicholas Piggin Subject: Re: [PATCH v4 09/10] powerpc/mm: Convert to default topdown mmap layout To: "alex@ghiti.fr" , Benjamin Herrenschmidt , Christophe Leroy , Michael Ellerman , Paul Mackerras Cc: "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "linuxppc-dev@lists.ozlabs.org" References: <1639044621.jeow25j0pr.astroid@bobo.none> <360e2a3e-63c6-3ce2-f481-695ad0ec4880@csgroup.eu> In-Reply-To: <360e2a3e-63c6-3ce2-f481-695ad0ec4880@csgroup.eu> MIME-Version: 1.0 Message-Id: <1639046542.qkwu4mjtew.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Stat-Signature: 78rza7sc8iofz6xsa63hbqe1uyc5gjcn Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=J3fgveQO; spf=pass (imf29.hostedemail.com: domain of npiggin@gmail.com designates 209.85.215.175 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 457EA120007 X-HE-Tag: 1639046619-552253 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Excerpts from Christophe Leroy's message of December 9, 2021 8:22 pm: >=20 >=20 > Le 09/12/2021 =C3=A0 11:15, Nicholas Piggin a =C3=A9crit=C2=A0: >> Excerpts from Christophe Leroy's message of December 9, 2021 3:18 am: >>> Select CONFIG_ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT and >>> remove arch/powerpc/mm/mmap.c >>> >>> This change provides standard randomisation of mmaps. >>> >>> See commit 8b8addf891de ("x86/mm/32: Enable full randomization on i386 >>> and X86_32") for all the benefits of mmap randomisation. >>=20 >> The justification seems pretty reasonable. >>=20 >>> >>> Comparison between powerpc implementation and the generic one: >>> - mmap_is_legacy() is identical. >>> - arch_mmap_rnd() does exactly the same allthough it's written >>> slightly differently. >>> - MIN_GAP and MAX_GAP are identical. >>> - mmap_base() does the same but uses STACK_RND_MASK which provides >>> the same values as stack_maxrandom_size(). >>> - arch_pick_mmap_layout() is almost identical. The only difference >>> is that it also adds the random factor to mm->mmap_base in legacy mode. >>> >>> That last point is what provides the standard randomisation of mmaps. >>=20 >> Thanks for describing it. Could you add random_factor to mmap_base for >> the legacy path for powerpc as a 2-line change that adds the legacy >> randomisation. And then this bigger patch would be closer to a no-op. >>=20 >=20 > You mean you would like to see the following patch before doing the=20 > convert ? >=20 > https://patchwork.ozlabs.org/project/linuxppc-dev/patch/7dabf1cbde67a346a= 187881d4f0bd17347e0334a.1533732583.git.christophe.leroy@c-s.fr/ Yes. Thanks, Nick