All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leo Yan <leo.yan@arm.com>
To: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
Cc: Marc Zyngier <maz@kernel.org>,
	Oliver Upton <oliver.upton@linux.dev>,
	joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com,
	catalin.marinas@arm.com, will@kernel.org,
	alexandru.elisei@arm.com, linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: arm64: Check cpu_has_spe() before initializing PMSCR_EL1 in VHE
Date: Wed, 8 Oct 2025 19:17:52 +0100	[thread overview]
Message-ID: <20251008181752.GD77665@e132581.arm.com> (raw)
In-Reply-To: <20251008165058.lcwiapdnar6hvw3b@hu-mojha-hyd.qualcomm.com>

On Wed, Oct 08, 2025 at 10:20:58PM +0530, Mukesh Ojha wrote:

[...]

> > > To me, this smells a lot more like some sort of papering over a
> > > firmware bug. Why isn't SPE available the first place?
> > 
> > TF-a grants permission to non-secure world [1], only access from secure
> > world or realm will trap to EL3.
> > 
> > So yes, it would be good to check if any issue in firmware.
> 
> We have our own implementation of EL3 and not using TF-A.

If you don't fix your firmware, you won't be able to use Arm SPE with
the Linux kernel.

> I believe, we should check in a similar way as we are doing for nVHE
> case.
> 
> if (host_data_test_flag(HAS_SPE))
> 	write_sysreg_el1(0, SYS_PMSCR);

The document Documentation/arch/arm64/booting.rst does not state that
permission for Arm SPE is mandatory, and the SPE driver [2] can
tolerate the lack of permission. So I'm fine with applying your patch
to fix the boot issue.

Thanks,
Leo

[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/perf/arm_spe_pmu.c#n1084

  reply	other threads:[~2025-10-08 18:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07 18:23 [PATCH] KVM: arm64: Check cpu_has_spe() before initializing PMSCR_EL1 in VHE Mukesh Ojha
2025-10-07 18:31 ` Oliver Upton
2025-10-08 10:46   ` Marc Zyngier
2025-10-08 12:40     ` Leo Yan
2025-10-08 16:50       ` Mukesh Ojha
2025-10-08 18:17         ` Leo Yan [this message]
2025-10-08 18:26     ` Oliver Upton
2025-10-09  9:11       ` Suzuki K Poulose
2025-10-08 11:53   ` Mukesh Ojha

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=20251008181752.GD77665@e132581.arm.com \
    --to=leo.yan@arm.com \
    --cc=alexandru.elisei@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=joey.gouly@arm.com \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=mukesh.ojha@oss.qualcomm.com \
    --cc=oliver.upton@linux.dev \
    --cc=suzuki.poulose@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.