Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3799566pxk; Tue, 22 Sep 2020 02:58:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyEUWj69fh7X3oePN9l+zvRMwGrzhxQmZV3ZpVS4MvKkK+HI9YnaZCZ2MwgGUsNX/YE6LII X-Received: by 2002:a17:906:1d08:: with SMTP id n8mr4160558ejh.236.1600768698024; Tue, 22 Sep 2020 02:58:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600768698; cv=none; d=google.com; s=arc-20160816; b=qVIQTSZ3mXRZGpdn7nZ5uC4R7dsq4ErERzITG0lKvxfcO/Mm2SXJGTl5SNWpsShm7f DIT5HjDc9dL85hvHVSSp/OeOEhFgsrLGKr1PMJ6ZblvdyYDdJALAZYYlFM1TRVt3ywzV ww5k3ERu3iBxax0hXkoGyyhpcgNNakb/WBZTkgeLtsHFsGLx6AcAWpwLcScALbRiEiQF sGBOtI7J8N06D2YZQcQB2lFLAp65/dzzTSxXBILq4Rb9Xygs3a8xK2b8cmiRvqydUhlf doF/ur3ApjxkRH9GBatca8fuvCt55+NNBdRYK5KWjeGheiv3KikV1EtiI5W3PDpHgSeE 6jSA== 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=eVKPH13bJ8Pw64uEwVW7kgXl7zM95RCC9p4HQ/Nmkxc=; b=GIi7Ba/Ou8iCwDf3t42OQ6nIzEggQCMSiKzCaDMMFypRXNq8WrdvJO6FyPaO3g68Nw 2tvy0g7iuFvIp7fM8BxyOA4d26Ds5LVMRK5CkjlOaWMco8YzPXYFl7cm81dKYzOnLq2s oTjy89QPAqkICUj9XGbfRyRKC8+5xdWYQw3hLdLdjfnAaCT6vHLaraL2fjQJNgBbnHVN wPjFBj08Z8nunIQL8qrqXXHIK/C8nLD4xI19tJjOA7phwUKI1qgO4Gs8qtNNidubEi5I xV6gjb7UjA5OvY86kzjYsc7RILQLZEBfuyCuroiZvxlZ+acL97fmA2oFpUYfdoH9kW1W uNDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Js+n82cx; 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 z3si9885741edp.549.2020.09.22.02.57.55; Tue, 22 Sep 2020 02:58:18 -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=Js+n82cx; 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 S1726503AbgIVJ4k (ORCPT + 99 others); Tue, 22 Sep 2020 05:56:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726353AbgIVJ4k (ORCPT ); Tue, 22 Sep 2020 05:56:40 -0400 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6915C061755 for ; Tue, 22 Sep 2020 02:56:39 -0700 (PDT) Received: by mail-oo1-xc42.google.com with SMTP id w25so211445oos.10 for ; Tue, 22 Sep 2020 02:56:39 -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=eVKPH13bJ8Pw64uEwVW7kgXl7zM95RCC9p4HQ/Nmkxc=; b=Js+n82cxs9o4HmRZr9CSN2h8XlIXga5zCjRQQqMjoMjBNYDb9Zk1jyZ/cWAe9CjE6T wtxq2Eg6Yuo97NcCeFMioAuTWhT5+Vn7v1Iky4fQzsqDx/VwqbybIZT2ofCISFETGzSF ysY/mG8RLF+R81492AgLpvFlPxr5OSr8vPEeR8W7MXuxpJAWHVmYJQzldLfS0R7qo0rS 5cZu+Bun3id+qqZurrj34eezcYweU4EgKGbOwAiAotGHH02K20iOkWoX186rRX+a+p+g cdljiEoHs66HEloUBJQnjppqiT6zv7DKeo07APPIzhwfxtBW+mF1MNo3tWRlcFHka7KJ Lang== 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=eVKPH13bJ8Pw64uEwVW7kgXl7zM95RCC9p4HQ/Nmkxc=; b=kX3bbxZNOugvh2fu7PvZ3bHSxsvkj1YUBEbUzP9aaMKVEsmxVjU6nm/pshEG0SkA1K 7CjvF7ZtGRn/SP2/Wdc022uaQK1s3I1J/ZyIsYeQThuR9He8U/W6RWQ8ADeIjmKlnRTw YTcVgEAEcOfF5hlDa7oOew8aGfYVUK+coD2Tb9zFODClULNEf+h5yT566p8fNYidP6Ey LzGxR2dpR9qtrJ1/lqe7Zo7N5J+KNPyk71cwOtuZWirIPFqrrwynq3NhZ/p881/GU2jp 4Pp31L5K4aegbtvSBKM7vskQjANGYBdqyA4XJfok6LIl9wWQr0XIZHb64PeLhZ5J/hzn zqlA== X-Gm-Message-State: AOAM5327avUqW62FUBWnnkqsf3QmfQ/SxU2bzEI4JxiiXEGfVSujdyrv CNT2PPRRAwl1hFhLO4bKmwFNsv26fsvjAtdmfoV6zQ== X-Received: by 2002:a4a:751a:: with SMTP id j26mr2423028ooc.14.1600768599083; Tue, 22 Sep 2020 02:56:39 -0700 (PDT) MIME-Version: 1.0 References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> <20200921143059.GO2139@willie-the-truck> <20200921174357.GB3141@willie-the-truck> In-Reply-To: <20200921174357.GB3141@willie-the-truck> From: Marco Elver Date: Tue, 22 Sep 2020 11:56:26 +0200 Message-ID: Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 To: Will Deacon Cc: Alexander Potapenko , Andrew Morton , "H. Peter Anvin" , "Paul E. McKenney" , Andrey Konovalov , Andrey Ryabinin , Andy Lutomirski , Borislav Petkov , Catalin Marinas , Christoph Lameter , Dave Hansen , David Rientjes , Dmitriy 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 19:44, Will Deacon wrote: [...] > > > > > 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? On x86 we just do `char __kfence_pool[KFENCE_POOL_SIZE] ...;` to statically allocate the pool. On arm64 this doesn't seem to work because static memory doesn't have struct pages? Thanks, -- Marco