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=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 8715CC4363A for ; Thu, 15 Oct 2020 13:40:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C74C8206FB for ; Thu, 15 Oct 2020 13:40:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C74C8206FB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E0C276B0071; Thu, 15 Oct 2020 09:39:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DBC1E6B0072; Thu, 15 Oct 2020 09:39:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C83BB6B0073; Thu, 15 Oct 2020 09:39:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0151.hostedemail.com [216.40.44.151]) by kanga.kvack.org (Postfix) with ESMTP id 9CC336B0071 for ; Thu, 15 Oct 2020 09:39:59 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 2F9211EE6 for ; Thu, 15 Oct 2020 13:39:59 +0000 (UTC) X-FDA: 77374268118.10.price18_33072b927214 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 0D53A16A047 for ; Thu, 15 Oct 2020 13:39:59 +0000 (UTC) X-HE-Tag: price18_33072b927214 X-Filterd-Recvd-Size: 4509 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 15 Oct 2020 13:39:58 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8CFC013D5; Thu, 15 Oct 2020 06:39:57 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.51.4]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 58A683F719; Thu, 15 Oct 2020 06:39:51 -0700 (PDT) Date: Thu, 15 Oct 2020 14:39:48 +0100 From: Mark Rutland To: Marco Elver 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 Subject: Re: [PATCH v3 03/10] arm64, kfence: enable KFENCE for ARM64 Message-ID: <20201015133948.GB50416@C02TD0UTHF1T.local> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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. 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(). Thanks, Mark.