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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 A1C56C433E7 for ; Thu, 15 Oct 2020 14:15:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DAD7922254 for ; Thu, 15 Oct 2020 14:15:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ENts0Dm6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DAD7922254 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3C3D96B005D; Thu, 15 Oct 2020 10:15:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 374166B007D; Thu, 15 Oct 2020 10:15:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28ABE6B007E; Thu, 15 Oct 2020 10:15:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id F084E6B005D for ; Thu, 15 Oct 2020 10:15:16 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 81017180AD815 for ; Thu, 15 Oct 2020 14:15:16 +0000 (UTC) X-FDA: 77374357032.05.pets77_05087ce27215 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 5E7721802455C for ; Thu, 15 Oct 2020 14:15:16 +0000 (UTC) X-HE-Tag: pets77_05087ce27215 X-Filterd-Recvd-Size: 6326 Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 14:15:15 +0000 (UTC) Received: by mail-oi1-f194.google.com with SMTP id l85so3227065oih.10 for ; Thu, 15 Oct 2020 07:15:15 -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=myXCOQxC7yXdiZx9nG9HTWtecWE6QzVgfe61cEeMHyM=; b=ENts0Dm6VGl7JCrVX9DHKihoOjKWkL7zveAIJ88O1VvyEPa+oWNJrNnTUWLffpC6YL TKZfpXNJbyP7fOMAXYpJ0KmJMck477GzDbGvCHaRGkgeHkHFOsBsY/s6bxT9DLFL20Wg Lp9tAvWitbNSqAceLGVBs2lBdVwx4XkdZ63C6gQF6eEnSWbzQiJmzL8b0lQnxlxxHsjn 2SbT8k3vEXKhH9Fcm8pjPRq8G6g4Y8Ss/j2S4HlSy1iO2NEchpEGTtl13KO8zAtQPtjj oL0+DzHoIHfHbQeV7XLjRxB12RnVxxOZsxBn8uVVr9NnNtMqM/Aih4wmRUg22V6JXiEA aL/A== 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=myXCOQxC7yXdiZx9nG9HTWtecWE6QzVgfe61cEeMHyM=; b=cVzkDBoJ37rskKSdQmvF7OoUBn8Y3mdj5y6j49B4y9NSBK0J6FUfNqcPeiPEuZyX7u NedUuKPPdgZ4860Ykd/MxFCH4EfDKCHJM+9YKa9e+Hcj/fwqcGyDx6USdfoI0xn+nSRG 8j9Roblr62iBon+uN8NTtSOpfbWu2EfeUGbcf9F0M+4zEc+yXhDeJShN9Ld0+UC+4zfN YNrhy6pbHRG4rG3ZtPasV3Ak2Tlg2gZ8kgVzvhAIboA7B6mAVgugGB1rLYoZ4/qq0jtk 2OavxlVUW/V4Na8tYqRjAY8vWYqi/2D+LhVdKo324rxxTbc+tnVgNmtptn0iW2Kx31+J jHEA== X-Gm-Message-State: AOAM531zx8IvKO1BIqFlgbRnvU9F8bI+YSvreAwc/AHWADJfSanpcH3+ NndLZ8APNYTCak7LQSbF6MQODyyD0My/qekWWw7mBA== X-Google-Smtp-Source: ABdhPJyiZVTec8MGhfwjgMdcqomFj34Th7O68O0hMU5cub02dKvyPgALRpq80Lcmzr7NhCURFgEzH/D3O13q6ca6pFI= X-Received: by 2002:aca:6206:: with SMTP id w6mr1155830oib.121.1602771314808; Thu, 15 Oct 2020 07:15:14 -0700 (PDT) MIME-Version: 1.0 References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> <20200921143059.GO2139@willie-the-truck> <20200929140226.GB53442@C02TD0UTHF1T.local> <20201001175716.GA89689@C02TD0UTHF1T.local> <20201008104501.GB72325@C02TD0UTHF1T.local> <20201015133948.GB50416@C02TD0UTHF1T.local> In-Reply-To: <20201015133948.GB50416@C02TD0UTHF1T.local> From: Marco Elver Date: Thu, 15 Oct 2020 16:15:03 +0200 Message-ID: Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 To: Mark Rutland Cc: Alexander Potapenko , Will Deacon , 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 , 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" 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: On Thu, 15 Oct 2020 at 15:39, Mark Rutland wrote: > On Wed, Oct 14, 2020 at 09:12:37PM +0200, Marco Elver wrote: > > On Thu, 8 Oct 2020 at 12:45, Mark Rutland wrote: > > > On Thu, Oct 08, 2020 at 11:40:52AM +0200, Marco Elver wrote: > > > > On Thu, 1 Oct 2020 at 19:58, Mark Rutland wrote: > > > > > > > > If you need virt_to_page() to work, the address has to be part of the > > > > > > > linear/direct map. > > > > > We're going with dynamically allocating the pool (for both x86 and > > > > arm64), > > [...] > > > We've got most of this sorted now for v5 -- thank you! > > > > The only thing we're wondering now, is if there are any corner cases > > with using memblock_alloc'd memory for the KFENCE pool? (We'd like to > > avoid page alloc's MAX_ORDER limit.) We have a version that passes > > tests on x86 and arm64, but checking just in case. :-) > > AFAICT otherwise the only noticeable difference might be PageSlab(), if > that's clear for KFENCE allocated pages? A few helpers appear to check > that to determine how something was allocated (e.g. in the scatterlist > and hwpoison code), and I suspect that needs to behave the same. We had to take care of setting PageSlab before, too. We do this during kfence_init(). > Otherwise, I *think* using memblock_alloc should be fine on arm64; I'm > not entirely sure for x86 (but suspect it's similar). On arm64: > > * All memory is given a struct page via memblocks_present() adding all > memory memblocks. This includes memory allocated by memblock_alloc(). > > * All memory is mapped into the linear map via arm64's map_mem() adding > all (non-nomap) memory memblocks. This includes memory allocated by > memblock_alloc(). Very good, thank you. We'll send v5 with these changes rebased on 5.10-rc1 (in ~2 weeks). Thanks, -- Marco