Re: [PATCH v6 2/6] KVM: arm64: Reject attempts to set invalid debug arch version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 18, 2023 at 04:45:18PM +0000, Jing Zhang wrote:
> From: Oliver Upton <oliver.upton@xxxxxxxxx>
> 
> The debug architecture is mandatory in ARMv8, so KVM should not allow
> userspace to configure a vCPU with less than that. Of course, this isn't
> handled elegantly by the generic ID register plumbing, as the respective
> ID register fields have a nonzero starting value.
> 
> Add an explicit check for debug versions less than v8 of the
> architecture.
> 
> Signed-off-by: Oliver Upton <oliver.upton@xxxxxxxxx>
> Signed-off-by: Jing Zhang <jingzhangos@xxxxxxxxxx>

This patch needs to be broken up. You're doing a couple things:

 1) Forcing the behavior of the DebugVer field to be FTR_LOWER_SAFE, and
   adding the necessary check for a valid version

 2) Changing KVM's value for the field to expose up to Debugv8p8 to the
   guest.

The latter isn't described in the changelog at all, and worse yet the
ordering of the series is not bisectable. Changing the default value of
the field w/o allowing writes breaks migration.

So, please split this patch in two and consider stacking like so:

 - Change #1 above (field sanitization)

 - "KVM: arm64: Enable writable for ID_AA64DFR0_EL1 and ID_DFR0_EL1"

 - Change #2 above (advertise up to v8p8)

-- 
Thanks,
Oliver



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux