linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Catalin Marinas <catalin.marinas@arm.com>
To: Marc Zyngier <maz@kernel.org>
Cc: mark.rutland@arm.com, jiangkunkun@huawei.com,
	eric.auger@redhat.com, cohuck@redhat.com, linuxarm@huawei.com,
	oliver.upton@linux.dev, yuzenghui@huawei.com,
	wangzhou1@hisilicon.com,
	Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
	jonathan.cameron@huawei.com, kvmarm@lists.linux.dev,
	sebott@redhat.com, will@kernel.org,
	linux-arm-kernel@lists.infradead.org, anthony.jebson@huawei.com
Subject: Re: [BUG][PATCH v8 4/6] arm64: Make _midr_in_range_list() an exported function
Date: Tue, 15 Apr 2025 16:54:58 +0100	[thread overview]
Message-ID: <Z_6BUgekb7YXOExu@arm.com> (raw)
In-Reply-To: <865xj5la2q.wl-maz@kernel.org>

On Tue, Apr 15, 2025 at 04:26:53PM +0100, Marc Zyngier wrote:
> On Tue, 15 Apr 2025 11:57:50 +0100,
> Ada Couprie Diaz <ada.coupriediaz@arm.com> wrote:
> > I discovered that this patch breaks boot for some CPUs when building
> > the default defconfig plus KASAN. This is still the case in v6.15-rc1
> > and rc2.
> > 
> > This patch marks `is_midr_in_range_list` as position independent but
> > it isn't, breaking early boot when instrumented with KASAN and
> > `CONFIG_RANDOMIZE_BASE` enabled.
> > 
> > The breaking usage seems to be in `kaslr_requires_kpti()` called in
> > `early_map_kernel()`.
> > My testing on an AMD Seattle board does crash, but newer machines
> > implementing E0PD do not crash as they do not need to check MIDRs in
> > `kaslr_requires_kpti()`.
> > `is_mdr_in_range_list` did work in PI code previously because it was
> > `inline`, which this patch changes.
> 
> OK, this is much more of a pain than I thought.
> 
> I tried bringing the various helpers into the PI section, but it ended
> up being extremely ugly.
> 
> More importantly, this is something that is pretty much at odds with
> the whole idea of the MIDR override -- it happens way earlier than we
> can populate the table.
> 
> The thing is, the only reason we need to do this is that we need to
> support the Cavium SEFAC (Sorry Excuse For A Computer) that cannot run
> with KPTI.
> 
> I can restore harmony with the following hack. But maybe we should
> just prune TX from the kernel and be done with this contraption.

That works for me. Well, we can still keep it around but panic on boot
if kpti is enabled on this platform. Just don't bother checking it via
early_map_kernel() from the PI code.

-- 
Catalin


  reply	other threads:[~2025-04-15 16:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-21 14:02 [PATCH v8 0/6] KVM: arm64: Errata management for VM Live migration Shameer Kolothum
2025-02-21 14:02 ` [PATCH v8 1/6] arm64: Modify _midr_range() functions to read MIDR/REVIDR internally Shameer Kolothum
2025-02-26 19:39   ` Catalin Marinas
2025-02-21 14:02 ` [PATCH v8 2/6] KVM: arm64: Introduce hypercall support for retrieving target implementations Shameer Kolothum
2025-02-21 14:02 ` [PATCH v8 3/6] KVM: arm64: Introduce KVM_REG_ARM_VENDOR_HYP_BMAP_2 Shameer Kolothum
2025-02-21 14:02 ` [PATCH v8 4/6] arm64: Make _midr_in_range_list() an exported function Shameer Kolothum
2025-02-26 19:40   ` Catalin Marinas
2025-04-15 10:57   ` [BUG][PATCH " Ada Couprie Diaz
2025-04-15 15:18     ` Shameerali Kolothum Thodi
2025-04-15 15:26     ` Marc Zyngier
2025-04-15 15:54       ` Catalin Marinas [this message]
2025-04-15 16:47         ` Marc Zyngier
2025-02-21 14:02 ` [PATCH v8 5/6] smccc/kvm_guest: Enable errata based on implementation CPUs Shameer Kolothum
2025-02-26 19:41   ` Catalin Marinas
2025-02-21 14:02 ` [PATCH v8 6/6] KVM: selftests: Add test for KVM_REG_ARM_VENDOR_HYP_BMAP_2 Shameer Kolothum
2025-03-05 23:58 ` [PATCH v8 0/6] KVM: arm64: Errata management for VM Live migration Oliver Upton

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=Z_6BUgekb7YXOExu@arm.com \
    --to=catalin.marinas@arm.com \
    --cc=anthony.jebson@huawei.com \
    --cc=cohuck@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=jiangkunkun@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=maz@kernel.org \
    --cc=oliver.upton@linux.dev \
    --cc=sebott@redhat.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=wangzhou1@hisilicon.com \
    --cc=will@kernel.org \
    --cc=yuzenghui@huawei.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;
as well as URLs for NNTP newsgroup(s).