[2/7] KVM: s390: add vector BCD enhancements facility to cpumodel
diff mbox series

Message ID 20190417152842.71730-3-borntraeger@de.ibm.com
State New
Headers show
Series
  • KVM: s390: new guest facilities
Related show

Commit Message

Christian Borntraeger April 17, 2019, 3:28 p.m. UTC
If vector support is enabled, the vector BCD enhancements facility
might also be enabled.
We can directly forward this facility to the guest if available
and VX is requested by user space.

Please note that user space can and will have the final decision
on the facility bits for a guests.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Reviewed-by: Collin Walling <walling@linux.ibm.com>
---
 arch/s390/kvm/kvm-s390.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

David Hildenbrand April 17, 2019, 3:34 p.m. UTC | #1
On 17.04.19 17:28, Christian Borntraeger wrote:
> If vector support is enabled, the vector BCD enhancements facility
> might also be enabled.
> We can directly forward this facility to the guest if available
> and VX is requested by user space.
> 
> Please note that user space can and will have the final decision
> on the facility bits for a guests.
> 
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
> Reviewed-by: Collin Walling <walling@linux.ibm.com>
> ---
>  arch/s390/kvm/kvm-s390.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index 03ddbe5e62bc..d3f3e63bb164 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -661,6 +661,10 @@ int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
>  				set_kvm_facility(kvm->arch.model.fac_mask, 148);
>  				set_kvm_facility(kvm->arch.model.fac_list, 148);
>  			}
> +			if (test_facility(152)) {
> +				set_kvm_facility(kvm->arch.model.fac_mask, 152);
> +				set_kvm_facility(kvm->arch.model.fac_list, 152);
> +			}
>  			r = 0;
>  		} else
>  			r = -EINVAL;
> 

Reviewed-by: David Hildenbrand <david@redhat.com>

Patch
diff mbox series

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 03ddbe5e62bc..d3f3e63bb164 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -661,6 +661,10 @@  int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap)
 				set_kvm_facility(kvm->arch.model.fac_mask, 148);
 				set_kvm_facility(kvm->arch.model.fac_list, 148);
 			}
+			if (test_facility(152)) {
+				set_kvm_facility(kvm->arch.model.fac_mask, 152);
+				set_kvm_facility(kvm->arch.model.fac_list, 152);
+			}
 			r = 0;
 		} else
 			r = -EINVAL;