[PATCH v3 04/26] KVM: arm64: nv: Add sanitising to EL2 configuration registers

Marc Zyngier maz at kernel.org
Wed Feb 7 02:57:26 PST 2024


On Wed, 07 Feb 2024 10:40:08 +0000,
Oliver Upton <oliver.upton at linux.dev> wrote:
> 
> On Mon, Feb 05, 2024 at 10:34:09AM +0000, Marc Zyngier wrote:
> > +	if (!(__vcpu_has_feature(&kvm->arch, KVM_ARM_VCPU_PTRAUTH_ADDRESS) &&
> > +	      __vcpu_has_feature(&kvm->arch, KVM_ARM_VCPU_PTRAUTH_ADDRESS)))
> > +		res0 |= (HCR_API | HCR_APK);
> 
> I think what you probably meant here is _ADDRESS and _GENERIC, right? Of
> course, this has no actual effect on the code, since we don't allow one
> without the other.

Gah. Embarrassing. But yes, harmless as we set both bits all the time.

> Maybe we can just change KVM's representation to a single flag to avoid
> this pointless exercise.

Yeah, it's been on my list of things to cleanup for a while. I'll look
into it for a separate patch.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list