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 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 A1FCEC4727C for ; Tue, 29 Sep 2020 14:02:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id D48D6208B8 for ; Tue, 29 Sep 2020 14:02:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D48D6208B8 Authentication-Results: mail.kernel.org; dmarc=none (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 444028E0006; Tue, 29 Sep 2020 10:02:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3EE968E0001; Tue, 29 Sep 2020 10:02:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28E818E0006; Tue, 29 Sep 2020 10:02:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id F3C438E0001 for ; Tue, 29 Sep 2020 10:02:50 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id B75EE180AD770 for ; Tue, 29 Sep 2020 14:02:50 +0000 (UTC) X-FDA: 77316264900.06.ducks66_4a099172718a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 373AF100B631B for ; Tue, 29 Sep 2020 14:02:38 +0000 (UTC) X-HE-Tag: ducks66_4a099172718a X-Filterd-Recvd-Size: 3844 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf30.hostedemail.com (Postfix) with ESMTP for ; Tue, 29 Sep 2020 14:02:37 +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 9C5AA31B; Tue, 29 Sep 2020 07:02:36 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.51.69]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 921A33F6CF; Tue, 29 Sep 2020 07:02:29 -0700 (PDT) Date: Tue, 29 Sep 2020 15:02:26 +0100 From: Mark Rutland To: Alexander Potapenko Cc: Will Deacon , Marco Elver , 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@huawei.com, Jonathan Corbet , Joonsoo Kim , Kees Cook , Pekka Enberg , Peter Zijlstra , sjpark@amazon.com, 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: <20200929140226.GB53442@C02TD0UTHF1T.local> References: <20200921132611.1700350-1-elver@google.com> <20200921132611.1700350-4-elver@google.com> <20200921143059.GO2139@willie-the-truck> 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 Fri, Sep 25, 2020 at 05:25:11PM +0200, Alexander Potapenko wrote: > Will, > > > 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? > > How do we assign struct pages to a fixed virtual space area (I'm > currently experimenting with 0xffff7f0000000000-0xffff7f0000200000)? You don't. There should be a struct page for each of the /physical/ pages, and these can be found: * via the physical address, using phyts_to_page() or pfn_to_page() * via the linear/direct map, using virt_to_page() * via the vmalloc page tables using vmalloc_to_page() If you need virt_to_page() to work, the address has to be part of the linear/direct map. If you need to find the struct page for something that's part of the kernel image you can use virt_to_page(lm_alias(x)). > Looks like filling page table entries (similarly to what's being done > in arch/arm64/mm/kasan_init.c) is not enough. > I thought maybe vmemmap_populate() would do the job, but it didn't > (virt_to_pfn() still returns invalid PFNs). As above, I think lm_alias() will solve the problem here. Please see that and CONFIG_DEBUG_VIRTUAL. Thanks, Mark.