From: Will Deacon <will@kernel.org>
To: Mark Rutland <mark.rutland@arm.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>,
linux-arm-kernel@lists.infradead.org,
Catalin Marinas <catalin.marinas@arm.com>,
James Morse <james.morse@arm.com>, Marc Zyngier <maz@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V2] arm64/mm: Fix idmap on [16K|36VA|48PA]
Date: Mon, 4 Oct 2021 18:23:04 +0100 [thread overview]
Message-ID: <20211004172303.GA28223@willie-the-truck> (raw)
In-Reply-To: <20211004104947.GA4430@C02TD0UTHF1T.local>
On Mon, Oct 04, 2021 at 11:49:58AM +0100, Mark Rutland wrote:
> Hi Anshuman,
>
> On Tue, Sep 28, 2021 at 11:03:45AM +0530, Anshuman Khandual wrote:
> > When creating the idmap, the kernel may add one extra level to idmap memory
> > outside the VA range. But for [16K|36VA|48PA], we need two levels to reach
> > 48 bits. If the bootloader places the kernel in memory above (1 << 46), the
> > kernel will fail to enable the MMU. Although we are not aware of a platform
> > where this happens, it is worth to accommodate such scenarios and prevent a
> > possible kernel crash.
>
> I think it's worth noting here that ARM64_VA_BITS_36 depends on EXPERT,
> so very few people are likely to be using this configuration.
>
> > Lets fix this problem by carefully analyzing existing VA_BITS with respect
> > to maximum possible mapping with the existing PGDIR level i.e (PGDIR_SHIFT
> > + PAGE_SHIFT - 3) and then evaluating how many extra page table levels are
> > required to accommodate the reduced idmap_t0sz to map __idmap_text_end.
> >
> > Cc: Catalin Marinas <catalin.marinas@arm.com>
> > Cc: Will Deacon <will@kernel.org>
> > Cc: James Morse <james.morse@arm.com>
> > Cc: Marc Zyngier <maz@kernel.org>
> > Cc: Mark Rutland <mark.rutland@arm.com>
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-kernel@vger.kernel.org
> > Fixes: 215399392fe4 ("arm64: 36 bit VA")
> > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> > ---
> > This applies on v5.15-rc3.
> >
> > This is a different approach as compared to V1 which still applies on the
> > latest mainline. Besides this enables all upcoming FEAT_LPA2 combinations
> > as well. Please do suggest which approach would be preferred.
> > - Anshuman
> >
> > V1: https://lore.kernel.org/all/1627879359-30303-1-git-send-email-anshuman.khandual@arm.com/
> > RFC: https://lore.kernel.org/lkml/1627019894-14819-1-git-send-email-anshuman.khandual@arm.com/
>
> If we need something to backport, I'm not opposed to taking one of these
> patches (and as v1 is simpler, I'd prefer that), but I think either
> approach is further bodging around the `map_memory` macro not being a
> great fit for the idmap creation, and it would be better to rework the
> structure of the pagetable creation code to do the right thing from the
> outset.
>
> Catalin, Will, do you have any preference as to having a backportable
> fix for this?
Given that I don't think this has ever worked (i.e. this isn't a
regression), I don't see the need to backport the fix unless somebody is
running into real problems.
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:[~2021-10-04 17:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 5:33 [PATCH V2] arm64/mm: Fix idmap on [16K|36VA|48PA] Anshuman Khandual
2021-10-04 10:49 ` Mark Rutland
2021-10-04 17:23 ` Will Deacon [this message]
2021-10-12 4:49 ` Anshuman Khandual
2021-10-12 9:49 ` Mark Rutland
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=20211004172303.GA28223@willie-the-truck \
--to=will@kernel.org \
--cc=anshuman.khandual@arm.com \
--cc=catalin.marinas@arm.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
/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