[PATCH] KVM: arm64: Check cpu_has_spe() before initializing PMSCR_EL1 in VHE
Mukesh Ojha
mukesh.ojha at oss.qualcomm.com
Wed Oct 8 04:53:44 PDT 2025
On Tue, Oct 07, 2025 at 11:31:45AM -0700, Oliver Upton wrote:
> Hi Mukesh,
>
> I find it a bit odd to refer to cpu_has_spe() in the shortlog, which
> doesn't exist prior to this patch.
My bad !!
will fix this
>
> On Tue, Oct 07, 2025 at 11:53:56PM +0530, Mukesh Ojha wrote:
> > commit efad60e46057 ("KVM: arm64: Initialize PMSCR_EL1 when in VHE")
> > initializes PMSCR_EL1 to 0 which is making the boot up stuck when KVM
> > runs in VHE mode and reverting the change is fixing the issue.
> >
> > [ 2.967447] RPC: Registered tcp NFSv4.1 backchannel transport module.
> > [ 2.974061] PCI: CLS 0 bytes, default 64
> > [ 2.978171] Unpacking initramfs...
> > [ 2.982889] kvm [1]: nv: 568 coarse grained trap handlers
> > [ 2.988573] kvm [1]: IPA Size Limit: 40 bits
> >
> > Lets guard the change with cpu_has_spe() check so that it only affects
> > the cpu which has SPE feature supported.
>
> This could benefit from being spelled out a bit more. In both cases we
> check for the presence of FEAT_SPE, however I believe the issue you
> observe is EL3 hasn't delegated ownership of the Profiling Buffer to
> Non-secure nor does it reinject an UNDEF in response to the sysreg trap.
You are right, writing to SYS_PMSCR is causing an issue.
is it not the right to check if the profiling buffer is implemented
rather than just checking the version ?
>
> I agree that the change is correct but the rationale needs to be clear.
Will correct it.
>
> Thanks,
> Oliver
--
-Mukesh Ojha
More information about the linux-arm-kernel
mailing list