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.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 B304AC4347E for ; Mon, 21 Sep 2020 17:45:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BEF22151B for ; Mon, 21 Sep 2020 17:45:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mKNP1Bfs"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="xdj8QUY3" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3BEF22151B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IrAt1LrPyOJmRWCNnkW4T82zY8kkal0A2tIJ8pJKvzI=; b=mKNP1Bfs5shz/pKpGwizh53k8 WT3S+okTf9UV7y3w0yM3QjxyHJM+IMvT9+FEuSwrFR3yaCvzeTqP+zIZWLlA3yS9j6z3V+IenuPVF 1ljRinTCmo/s0LW27AUJmkFeR4vZiHN+BSmDdgqtrbtDooKtKGWDcrFeRUrwaByKcSoIiy+EL1XsJ w/kDi/gW1tQw35g9mN4dRDHTG0L8dPdliSu9XBVxVvpEABQ0z3fvqvxfGeaOUO2LbZcxaFrEdVEd+ Eon4Rc90C6OTWEwfNYr5j4Y/U6TqqYdmBkT7FNT4Z0Fzg4Ojgm2n1HGtAYPNRv706VuUDcJcE4kTe MGBO+ewUg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKPrH-0003hU-WD; Mon, 21 Sep 2020 17:44:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKPrE-0003f8-73 for linux-arm-kernel@lists.infradead.org; Mon, 21 Sep 2020 17:44:09 +0000 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 2313C2151B; Mon, 21 Sep 2020 17:44:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600710247; bh=Arof+t7RZMesEWYOG0q/K65qTQSUsR3YSbeXtjQZtLU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=xdj8QUY35DLXeadsX8mhIaX+uEoxr9k8Ugskr/fkdQdqVBAICA5hNRdZdrCjpDgSM OuGT+vQnC241+3LLy4YbvGKg+kv54dVMqHgO+mo0MT3UyQII9JNlSW8Ub8b3g+D+QO DAvj1xOoVEu4RWszeCUqjt9jWgCvdI6cP124z5p8= Date: Mon, 21 Sep 2020 18:43:59 +0100 From: Will Deacon To: Alexander Potapenko Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 Message-ID: <20200921174357.GB3141@willie-the-truck> References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> <20200921143059.GO2139@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200921_134408_497216_B8C03F3D X-CRM114-Status: GOOD ( 29.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Hillf Danton , "open list:DOCUMENTATION" , Peter Zijlstra , Catalin Marinas , Dave Hansen , Linux Memory Management List , Eric Dumazet , "H. Peter Anvin" , Christoph Lameter , sjpark@amazon.com, Jonathan Corbet , the arch/x86 maintainers , kasan-dev , Ingo Molnar , Vlastimil Babka , David Rientjes , Andrey Ryabinin , Marco Elver , Kees Cook , "Paul E. McKenney" , Jann Horn , Andrey Konovalov , Borislav Petkov , Andy Lutomirski , Jonathan.Cameron@huawei.com, Thomas Gleixner , Joonsoo Kim , Dmitriy Vyukov , Linux ARM , Greg Kroah-Hartman , LKML , Pekka Enberg , Andrew Morton Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Sep 21, 2020 at 05:37:10PM +0200, Alexander Potapenko wrote: > On Mon, Sep 21, 2020 at 4:58 PM Alexander Potapenko wrote: > > > > On Mon, Sep 21, 2020 at 4:31 PM 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(). > > > > > > > > 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. > > > > NP, thanks for looking! > > > > > 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? > > > > Yes, having a dedicated address sounds good. > > We're inserting kfence_init() into start_kernel() after timekeeping_init(). > > So way after mm_init(), if that matters. > > The question is though, how big should that dedicated area be? > Right now KFENCE_NUM_OBJECTS can be up to 16383 (which makes the pool > size 64MB), but this number actually comes from the limitation on > static objects, so we might want to increase that number on arm64. What happens on x86 and why would we do something different? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel