Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2956022pxk; Mon, 28 Sep 2020 04:57:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxskRtD+KrY7gEuZcAWcQRCcKrk9jKptSX6KvWaiyi4glnCg0ogPwTyxLOnukFpN38gTdtO X-Received: by 2002:a17:906:24d2:: with SMTP id f18mr1238260ejb.510.1601294270503; Mon, 28 Sep 2020 04:57:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601294270; cv=none; d=google.com; s=arc-20160816; b=J5rhqEgUzJW/G4/LvsdPSxfJ2sau8NJ/U1a6WWLlDeGITjlsJGeVRR4sMplRk69iKX EZiO6QlzY7qe9GxrigxPT1YXvMRMfXNy2WfPydgrFQGtd/sDlsxM9hCGAZplNetdfRxb aGRKWaIwtq/ABbXdJkjGU5wxOWJfMYEXmNRJ8NPy5RD6zUjGE9sjNzYfP6JzBvsc/AQs S/xhGgho27W73HtuR+CGwsB3BOwHF6dSWZ5TAMx85DwJ+a2ZjwcsjkhG8opJrKRSxxsy AVKOBkS+n5MsR0N2V0+SOBS66aW7qhgnin2AImRpiCNgtdB5bKUtJGdbv3cX+Hslcsb/ T7lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=qVxE17p4zsLCszLlrp2+yy6w1PaUWdFxLyFkrOjdfgU=; b=oSY8evnmeMoGdDAzojhOg8izM5i6ovJxqbN2SaLmaHtT/8pjCw+HuLZNXiNZdUKeho EVCPvoLY19jz9fMtTgo/nm+R4szZcAEC2YxTjsqC6OdAe2Et3qqHkPWsJ8cZX2d93eEP QLY03uxdF6vCcari/cb4c5AHdQWpC2DHiDAnHQJddGqBeiYR4pCtrzGHhCsTZtr5SfUo fCu6Q+0SGlpUmGTQKg/piDD8lqn9+2QaLqCKWQAEtbtSnV3jHE3QAgKOK3Bw2zVVF3G7 iJVnKN+3aDToXKi7iRWG+yO3m4OnZntGxghAZ+LnSGD7SY1DJU7FuQTbtBmfrnJq7K+i 2q6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FrUJQhU8; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e18si452918edy.386.2020.09.28.04.57.27; Mon, 28 Sep 2020 04:57:50 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=FrUJQhU8; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbgI1LyJ (ORCPT + 99 others); Mon, 28 Sep 2020 07:54:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726656AbgI1LyI (ORCPT ); Mon, 28 Sep 2020 07:54:08 -0400 Received: from mail-oo1-xc44.google.com (mail-oo1-xc44.google.com [IPv6:2607:f8b0:4864:20::c44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC46FC061755 for ; Mon, 28 Sep 2020 04:54:07 -0700 (PDT) Received: by mail-oo1-xc44.google.com with SMTP id 4so218370ooh.11 for ; Mon, 28 Sep 2020 04:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qVxE17p4zsLCszLlrp2+yy6w1PaUWdFxLyFkrOjdfgU=; b=FrUJQhU8kLw5wzKwxdDxIRtiVoZ4lfeEZwy4LJPWfKENd3ZpDBr+fUeXyts5ABr4TM ZH5Q5AUVRyledcZkhZFHMj1Xb7lLb7lvKlji7ROGvzgo5ad7SJnlL95Wct+/0nKk++lq wYWBtVoulBHcCIV7zqSRjVQeTpnuEVHGkiONEu3FSe0BhD/SwyM/JVJg1Di8LjLpUzMQ Ed0RQHWOFbz70PZpdJtw4ZCSz3+jgk5repK1v2BzNhFohtN0QypxHHQD9EbCKbCxyof+ XI+394+OH71KeoWaiKUNCaoq1tLs3vkcMfYf4L9lvcLWzyN3U+23iR3Pz3G1aYmjKf0n RJPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qVxE17p4zsLCszLlrp2+yy6w1PaUWdFxLyFkrOjdfgU=; b=mCWRC8fnFzeUP5I3IiB8McuMLMcWM1tg87G4OlEuWRJXhzi68BTQWz/h5EMJdxRASs y1OfikGs6YX2NzAl0hJAvHqaeka5wT2X60xxuTobQ0ifZhlKiBswV+W7FIh642RZkNuh jvJK7yAxYo9AxQ5JfLH9mi60J1uzZ15o6yuIYn7oDg7IhD+SwYwPOBWeaXYtnfpm/uSt XAhLRM/qm9/YSNlFFRg2FC29z91xbu3EHn6rUhsqBVeJYfxwpnSMs0m5v6JtmghDEDpF KDGMvO2gJD0MY1U2Xiw5RRSFKo/cQUisyx66a5s0AeooIVRxmL+H0nu1PVq/UyheEv6x UwDQ== X-Gm-Message-State: AOAM530hyEeNqe3RdrCGYOJgdyvooexVf6x/EOCp+nhtE4EhVP8475rQ roC372YWf/jnGTd8Q0G5YyMTybrmzykv0sUVh7EKoQ== X-Received: by 2002:a4a:a58f:: with SMTP id d15mr554121oom.36.1601294046985; Mon, 28 Sep 2020 04:54:06 -0700 (PDT) MIME-Version: 1.0 References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> <20200921143059.GO2139@willie-the-truck> In-Reply-To: <20200921143059.GO2139@willie-the-truck> From: Marco Elver Date: Mon, 28 Sep 2020 13:53:55 +0200 Message-ID: Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 To: Will Deacon , Alexander Potapenko , Andrew Morton Cc: "H. Peter Anvin" , "Paul E. McKenney" , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Christoph Lameter , Dave Hansen , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , Hillf Danton , Ingo Molnar , Jann Horn , Jonathan Cameron , Jonathan Corbet , Joonsoo Kim , Kees Cook , Mark Rutland , Pekka Enberg , Peter Zijlstra , SeongJae Park , Thomas Gleixner , Vlastimil Babka , "the arch/x86 maintainers" , "open list:DOCUMENTATION" , LKML , kasan-dev , Linux ARM , Linux Memory Management List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 21 Sep 2020 at 16:31, Will Deacon wrote: > On Mon, Sep 21, 2020 at 03:26:04PM +0200, Marco Elver wrote: > > Add architecture specific implementation details for KFENCE and enable > > KFENCE for the arm64 architecture. In particular, this implements the > > required interface in . Currently, the arm64 version does > > not yet use a statically allocated memory pool, at the cost of a pointer > > load for each is_kfence_address(). [...] > > For ARM64, we would like to solicit feedback on what the best option is > > to obtain a constant address for __kfence_pool. One option is to declare > > a memory range in the memory layout to be dedicated to KFENCE (like is > > done for KASAN), however, it is unclear if this is the best available > > option. We would like to avoid touching the memory layout. > Given that the pool is relatively small (i.e. when compared with our virtual > address space), dedicating an area of virtual space sounds like it makes > the most sense here. How early do you need it to be available? Note: we're going to send a v4 this or next week with a few other minor fixes in it. But I think we just don't want to block the entire series on figuring out what the static-pool arm64 version should do, especially if we'll have a few iterations with only this patch here changing. So the plan will be: 1. Send v4, which could from our point-of-view be picked up for merging. Unless of course there are more comments. 2. Work out the details for the static-pool arm64 version, since it doesn't seem trivial to do the same thing as we do for x86. In preparation for that, v4 will allow the __kfence_pool's attributes to be defined entirely by , so that we can fiddle with sections etc. 3. Send patch switching out the simpler arm64 version here for one that places __kfence_pool at a static location. Hopefully that plan is reasonable. Thanks, -- Marco