Re: [PATCH v2] KVM: s390: Beautify skey enable check

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

 



On 20.07.2018 16:16, Janosch Frank wrote:
> cpu_arch {
>  	seqcount_t cputm_seqcount;
>  	__u64 cputm_start;
>  	bool gs_enabled;
> +	bool skey_enabled;
>  };
>  
>  struct kvm_vm_stat {
> diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
> index 83c678266588..54493c587a9e 100644
> --- a/arch/s390/kvm/priv.c
> +++ b/arch/s390/kvm/priv.c
> @@ -205,13 +205,10 @@ static int handle_store_cpu_address(struct kvm_vcpu *vcpu)
>  int kvm_s390_skey_check_enable(struct kvm_vcpu *vcpu)
>  {
>  	int rc;
> -	struct kvm_s390_sie_block *sie_block = vcpu->arch.sie_block;
>  
>  	trace_kvm_s390_skey_related_inst(vcpu);
>  	/* Already enabled? */
> -	if (vcpu->kvm->arch.use_skf &&
> -	    !(sie_block->ictl & (ICTL_ISKE | ICTL_SSKE | ICTL_RRBE)) &&
> -	    !kvm_s390_test_cpuflags(vcpu, CPUSTAT_KSS))
> +	if (vcpu->arch.skey_enabled)
>  		return 0;
>  
>  	rc = s390_enable_skey();
> @@ -221,10 +218,9 @@ int kvm_s390_skey_check_enable(struct kvm_vcpu *vcpu)
>  
>  	if (kvm_s390_test_cpuflags(vcpu, CPUSTAT_KSS))
>  		kvm_s390_clear_cpuflags(vcpu, CPUSTAT_KSS);
> -	if (!vcpu->kvm->arch.use_skf)
> -		sie_block->ictl |= ICTL_ISKE | ICTL_SSKE | ICTL_RRBE;
> -	else
> -		

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>

-- 

Thanks,

David / dhildenb



[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