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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 426DAC4167B for ; Mon, 11 Dec 2023 14:24:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=6sp+zqUW+Ybb8DCB6ajotDjO9SB3hAy2i70pX+Jc6/Y=; b=bADF4L3jrg8jIk IBoj9g3MGqEHkJKahqBxEaTNVg9qXOlUy0faIJyDDMxG5WB5usPAc3wh5mgxXD5Z4qUdlD0Z0MlwK t+Unny3tEpCiS3MT0IbdVtTVg4D7I9ZqbAqxpAsCahOR0f/LPgSJ8icyzj3JXM6rhGKL7w4HQd6xr JHzs6UUs4HIT8zvhyjNb1uSAh81hv7yD7o53FxohDw53ia+lLBty4GdGJ7GdV4yvOiLshLgEXVA+L Ag9SjqsZ9u8rLFUML7/D6OS7vVEx5nlOyVP710deRobG3v0xTlfaq/yto+D2wWYRyncxCV1+u1n8I f27Ll3K9GhdWqKgQ+sxQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rChBu-005AQM-18; Mon, 11 Dec 2023 14:23:32 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rChBe-005AMF-0z for linux-arm-kernel@lists.infradead.org; Mon, 11 Dec 2023 14:23:25 +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 82789FEC; Mon, 11 Dec 2023 06:23:55 -0800 (PST) Received: from FVFF77S0Q05N.cambridge.arm.com (FVFF77S0Q05N.cambridge.arm.com [10.1.34.127]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B5A653F738; Mon, 11 Dec 2023 06:23:07 -0800 (PST) Date: Mon, 11 Dec 2023 14:23:05 +0000 From: Mark Rutland To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , Catalin Marinas , Will Deacon , Marc Zyngier , Ryan Roberts , Anshuman Khandual , Kees Cook Subject: Re: [PATCH v6 05/41] arm64: mm: Move fixmap region above vmemmap region Message-ID: References: <20231129111555.3594833-43-ardb@google.com> <20231129111555.3594833-48-ardb@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231129111555.3594833-48-ardb@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231211_062310_888931_3BD96CE5 X-CRM114-Status: GOOD ( 22.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Wed, Nov 29, 2023 at 12:16:01PM +0100, Ard Biesheuvel wrote: > From: Ard Biesheuvel > > Move the fixmap region above the vmemmap region, so that the start of > the vmemmap delineates the end of the region available for vmalloc and > vmap allocations and the randomized placement of the kernel and modules. > > In a subsequent patch, we will take advantage of this to reclaim most of > the vmemmap area when running a 52-bit VA capable build with 52-bit > virtual addressing disabled at runtime. > > Note that the existing guard region of 256 MiB covers the fixmap and PCI > I/O regions as well, so we can reduce it 8 MiB, which is what we use in > other places too. > > Signed-off-by: Ard Biesheuvel As with the prior patch, this looks simple enough, but it'd be good if we could do something to assert that we don't overlap this region with others. Mark. > --- > arch/arm64/include/asm/memory.h | 2 +- > arch/arm64/include/asm/pgtable.h | 2 +- > arch/arm64/mm/ptdump.c | 4 ++-- > 3 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h > index 99caeff78e1a..2745bed8ae5b 100644 > --- a/arch/arm64/include/asm/memory.h > +++ b/arch/arm64/include/asm/memory.h > @@ -51,7 +51,7 @@ > #define VMEMMAP_END (VMEMMAP_START + VMEMMAP_SIZE) > #define PCI_IO_START (VMEMMAP_END + SZ_8M) > #define PCI_IO_END (PCI_IO_START + PCI_IO_SIZE) > -#define FIXADDR_TOP (VMEMMAP_START - SZ_32M) > +#define FIXADDR_TOP (-UL(SZ_8M)) > > #if VA_BITS > 48 > #define VA_BITS_MIN (48) > diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h > index b19a8aee684c..8d30e2787b1f 100644 > --- a/arch/arm64/include/asm/pgtable.h > +++ b/arch/arm64/include/asm/pgtable.h > @@ -22,7 +22,7 @@ > * and fixed mappings > */ > #define VMALLOC_START (MODULES_END) > -#define VMALLOC_END (VMEMMAP_START - SZ_256M) > +#define VMALLOC_END (VMEMMAP_START - SZ_8M) > > #define vmemmap ((struct page *)VMEMMAP_START - (memstart_addr >> PAGE_SHIFT)) > > diff --git a/arch/arm64/mm/ptdump.c b/arch/arm64/mm/ptdump.c > index d1df56d44f8a..3958b008f908 100644 > --- a/arch/arm64/mm/ptdump.c > +++ b/arch/arm64/mm/ptdump.c > @@ -45,12 +45,12 @@ static struct addr_marker address_markers[] = { > { MODULES_END, "Modules end" }, > { VMALLOC_START, "vmalloc() area" }, > { VMALLOC_END, "vmalloc() end" }, > - { FIXADDR_TOT_START, "Fixmap start" }, > - { FIXADDR_TOP, "Fixmap end" }, > { VMEMMAP_START, "vmemmap start" }, > { VMEMMAP_START + VMEMMAP_SIZE, "vmemmap end" }, > { PCI_IO_START, "PCI I/O start" }, > { PCI_IO_END, "PCI I/O end" }, > + { FIXADDR_TOT_START, "Fixmap start" }, > + { FIXADDR_TOP, "Fixmap end" }, > { -1, NULL }, > }; > > -- > 2.43.0.rc1.413.gea7ed67945-goog > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel