Re: [PATCH] KVM: s390: add etoken support for guests

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

 




On 07/18/2018 03:02 PM, David Hildenbrand wrote:
>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>> index 3b7a5151b6a5..12cb0ed7ed6a 100644
>> --- a/arch/s390/kvm/kvm-s390.c
>> +++ b/arch/s390/kvm/kvm-s390.c
>> @@ -2300,6 +2300,8 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
>>  		vcpu->run->kvm_valid_regs |= KVM_SYNC_BPBC;
>>  	if (test_kvm_facility(vcpu->kvm, 133))
>>  		vcpu->run->kvm_valid_regs |= KVM_SYNC_GSCB;
>> +	if (test_kvm_facility(vcpu->kvm, 156))
>> +		vcpu->run->kvm_valid_regs |= KVM_SYNC_ETOKEN;
>>  	/* fprs can be synchronized via vrs, even if the guest has no vx. With
>>  	 * MACHINE_HAS_VX, (load|store)_fpu_regs() will work with vrs format.
>>  	 */
>> @@ -2549,7 +2551,8 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
>>  	}
>>  	if (test_kvm_facility(vcpu->kvm, 139))
>>  		vcpu->arch.sie_block->ecd |= ECD_MEF;
>> -
>> +	if (test_kvm_facility(vcpu->kvm, 156))
>> +		vcpu->arch.sie_block->ecd |= ECD_ETOKENF;
>>  	if (vcpu->arch.sie_block->gd) {
>>  		vcpu->arch.sie_block->eca |= ECA_AIV;
>>  		VCPU_EVENT(vcpu, 3, "AIV gisa format-%u enabled for cpu %03u",
>> @@ -3467,6 +3470,7 @@ static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
>>  		}
>>  		preempt_enable();
>>  	}
>> +	/* etoken handled by SIE */
> 
> maybe extend both statements (this and below) to something like
> 
> "SIE will save/store etoken directly into SDNX and therefore kvm_run"

Yes, will change.
> 
>>  
>>  	kvm_run->kvm_dirty_regs = 0;
>>  }
>> @@ -3506,7 +3510,7 @@ static void store_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
>>  			__ctl_clear_bit(2, 4);
>>  		vcpu->arch.host_gscb = NULL;
>>  	}
>> -
>> +	/* etoken handled by SIE */
>>  }
> 
> Looks sane to me. I assume resets are completely handled by user space
> just like guarded storage.

Yes, its resetted on clear reset (qemu will do that):


> Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

thanks.




[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