Re: [PATCH v3 2/3] KVM: s390: Add UV feature negotiation

From: Janosch Frank
Date: Tue Aug 15 2023 - 09:40:34 EST


On 8/10/23 13:32, Steffen Eiden wrote:
Add a uv_feature list for pv-guests to the KVM cpu-model.
The feature bits 'AP-interpretation for secure guests' and
'AP-interrupt for secure guests' are available.

Signed-off-by: Steffen Eiden <seiden@xxxxxxxxxxxxx>
[...]
+#define KVM_S390_VM_CPU_UV_FEAT_GUEST_DEFAULT 0

Reviewed-by: Janosch Frank <frankja@xxxxxxxxxxxxx>

I don't think that's needed, just set it to 0 (and even that's not really needed since it's kzalloced but I'm fine with making this explicit).

int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
{
gfp_t alloc_flags = GFP_KERNEL_ACCOUNT;
@@ -3296,6 +3368,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
kvm->arch.model.cpuid = kvm_s390_get_initial_cpuid();
kvm->arch.model.ibc = sclp.ibc & 0x0fff;
+ kvm->arch.model.uv_feat_guest.feat = KVM_S390_VM_CPU_UV_FEAT_GUEST_DEFAULT;
+
kvm_s390_crypto_init(kvm);
if (IS_ENABLED(CONFIG_VFIO_PCI_ZDEV_KVM)) {