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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB1C1C43465 for ; Mon, 21 Sep 2020 14:31:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 79D0F2226A for ; Mon, 21 Sep 2020 14:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600698671; bh=krO8zF0GrOs00mBfRnRzTehlbc7iAKlLH4rzrtRfnqc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=u7YQ2NziCQWNYLYsH2tSzQ26coDBqo7c6jljAPhehalud9eOf3gSCUj41FZ4ax5rC MO4weRbqHJ0WVU3EKfx9BAUY7yXN8oKBY40X2M5C2OZFF5ayFZniCTWXGFdRDCbWHH axpMWE3JJVWDQ61D3vucZu7rRh79ItsZ8iRYFgKQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726501AbgIUObL (ORCPT ); Mon, 21 Sep 2020 10:31:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbgIUObK (ORCPT ); Mon, 21 Sep 2020 10:31:10 -0400 Received: from willie-the-truck (236.31.169.217.in-addr.arpa [217.169.31.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 821E721D91; Mon, 21 Sep 2020 14:31:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600698669; bh=krO8zF0GrOs00mBfRnRzTehlbc7iAKlLH4rzrtRfnqc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=w1R8TSnt2fQsxgf5LT0ZPAYzmRGdNdiwFgADCYrRTaz1wiToTEyowHYQJXNP5ZzNz JtZqlGCVDO7fXkQN9g3BMcYql263K3PntOmYEZK7IhNKAkYifPH1Sey8npLsTj/D3p nQCI8p0EgRNpuW7EaQlZVyPY9seG884bExHmNR2U= Date: Mon, 21 Sep 2020 15:31:01 +0100 From: Will Deacon To: Marco Elver Cc: akpm@linux-foundation.org, glider@google.com, hpa@zytor.com, paulmck@kernel.org, andreyknvl@google.com, aryabinin@virtuozzo.com, luto@kernel.org, bp@alien8.de, catalin.marinas@arm.com, cl@linux.com, dave.hansen@linux.intel.com, rientjes@google.com, dvyukov@google.com, edumazet@google.com, gregkh@linuxfoundation.org, hdanton@sina.com, mingo@redhat.com, jannh@google.com, Jonathan.Cameron@huawei.com, corbet@lwn.net, iamjoonsoo.kim@lge.com, keescook@chromium.org, mark.rutland@arm.com, penberg@kernel.org, peterz@infradead.org, sjpark@amazon.com, tglx@linutronix.de, vbabka@suse.cz, x86@kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 Message-ID: <20200921143059.GO2139@willie-the-truck> References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200921132611.1700350-4-elver@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.org 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(). > > Reviewed-by: Dmitry Vyukov > Co-developed-by: Alexander Potapenko > Signed-off-by: Alexander Potapenko > Signed-off-by: Marco Elver > --- > 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. Sorry for the delay on this. 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? An alternative approach would be to patch in the address at runtime, with something like a static key to swizzle off the direct __kfence_pool load once we're up and running. Will