From: Will Deacon <will@kernel.org>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: catalin.marinas@arm.com,
Anshuman Khandual <anshuman.khandual@arm.com>,
linux-arm-kernel@lists.infradead.org,
Steve Capper <steve.capper@arm.com>
Subject: Re: [PATCH v2 1/4] arm64: mm: use single quantity to represent the PA to VA translation
Date: Thu, 15 Oct 2020 11:47:25 +0100 [thread overview]
Message-ID: <20201015104725.GD5064@willie-the-truck> (raw)
In-Reply-To: <20201008153602.9467-2-ardb@kernel.org>
On Thu, Oct 08, 2020 at 05:35:59PM +0200, Ard Biesheuvel wrote:
> On arm64, the global variable memstart_addr represents the physical
> address of PAGE_OFFSET, and so physical to virtual translations or
> vice versa used to come down to simple additions or subtractions
> involving the values of PAGE_OFFSET and memstart_addr.
>
> When support for 52-bit virtual addressing was introduced, we had to
> deal with PAGE_OFFSET potentially being outside of the region that
> can be covered by the virtual range (as the 52-bit VA capable build
> needs to be able to run on systems that are only 48-bit VA capable),
> and for this reason, another translation was introduced, and recorded
> in the global variable physvirt_offset.
>
> However, if we go back to the original definition of memstart_addr,
> i.e., the physical address of PAGE_OFFSET, it turns out that there is
> no need for two separate translations: instead, we can simply subtract
> the size of the unaddressable VA space from memstart_addr to make the
> available physical memory appear in the 48-bit addressable VA region.
>
> This simplifies things, but also fixes a bug on KASLR builds, which
> may update memstart_addr later on in arm64_memblock_init(), but fails
> to update vmemmap and physvirt_offset accordingly.
>
> Fixes: 5383cc6efed13 ("arm64: mm: Introduce vabits_actual")
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> ---
> arch/arm64/include/asm/memory.h | 5 ++--
> arch/arm64/include/asm/pgtable.h | 4 +--
> arch/arm64/mm/init.c | 30 +++++++-------------
> 3 files changed, 14 insertions(+), 25 deletions(-)
I'll pick this one patch up for 5.10, thanks.
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-10-15 10:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 15:35 [PATCH v2 0/4] arm64: mm: optimize VA space organization for 52-bit Ard Biesheuvel
2020-10-08 15:35 ` [PATCH v2 1/4] arm64: mm: use single quantity to represent the PA to VA translation Ard Biesheuvel
2020-10-13 16:14 ` Steve Capper
2020-10-13 16:47 ` Steve Capper
2020-10-15 10:47 ` Will Deacon [this message]
2020-10-08 15:36 ` [PATCH v2 2/4] arm64: mm: extend linear region for 52-bit VA configurations Ard Biesheuvel
2020-10-13 16:51 ` Steve Capper
2020-10-13 16:57 ` Ard Biesheuvel
2020-10-13 17:38 ` Steve Capper
2020-10-14 3:44 ` Anshuman Khandual
2020-10-14 7:18 ` Ard Biesheuvel
2020-10-08 15:36 ` [PATCH v2 3/4] arm64: mm: make vmemmap region a projection of the linear region Ard Biesheuvel
2020-10-13 16:52 ` Steve Capper
2020-11-10 12:55 ` Geert Uytterhoeven
2020-11-10 13:10 ` Ard Biesheuvel
2020-11-10 14:08 ` Ard Biesheuvel
2020-11-10 14:56 ` Geert Uytterhoeven
2020-11-10 15:39 ` Catalin Marinas
2020-11-10 15:42 ` Ard Biesheuvel
2020-11-10 16:14 ` Catalin Marinas
2020-11-10 16:18 ` Ard Biesheuvel
2020-10-08 15:36 ` [PATCH v2 4/4] arm64: mm: tidy up top of kernel VA space Ard Biesheuvel
2020-10-13 16:52 ` Steve Capper
2020-10-09 14:16 ` [PATCH v2 0/4] arm64: mm: optimize VA space organization for 52-bit Ard Biesheuvel
2020-10-15 20:40 ` Will Deacon
2020-11-09 18:51 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201015104725.GD5064@willie-the-truck \
--to=will@kernel.org \
--cc=anshuman.khandual@arm.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=steve.capper@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox