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=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,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 BD0C4C4727C for ; Tue, 29 Sep 2020 14:05:05 +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 0526E208B8 for ; Tue, 29 Sep 2020 14:05:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QXtnFgmd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0526E208B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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=0kFs3+aSK42myTMDXM0RsG+JfEpRJz2i9V1YHHwDhL8=; b=QXtnFgmdIu7eCHoC54vXKxtv2 5CNu1kx1IH6lI+YyI1pMzVkkMCYXtRt0kcPO9uaZEd59mrj6iJszdLzE1wiaGn4aFw6EoPh24spzm LpaZ5Ffsbh7tv9Zuzs4RxMMHYrInM3T8ruorfDZUc22o2TIx/Z+x1OWSpY56uPfkFYdX48M1n+WN/ X91hZUNTYPYBMydCgpTUt2joyEMzSQTuOStlOpx/1G5Tl3DZ3SUpQObrclVJ5LsAlZ4cmO41eLlEc oim9SPJNcl5ORt9pckQEHZqN05xLZPwFfl20uIIrZMH/4mEy8h6qZdomatlTI7dxV7Pmoy3mdl2jN +qq41CvmQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNGDl-0003ee-QQ; Tue, 29 Sep 2020 14:03:10 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kNGDF-0003S0-U0 for linux-arm-kernel@lists.infradead.org; Tue, 29 Sep 2020 14:02:40 +0000 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 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-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200929_100238_115284_D2F57C56 X-CRM114-Status: GOOD ( 21.31 ) 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: Hillf Danton , "open list:DOCUMENTATION" , Peter Zijlstra , Catalin Marinas , Dave Hansen , Linux Memory Management List , Eric Dumazet , "H. Peter Anvin" , Christoph Lameter , Will Deacon , 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 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel