Re: [PATCH v1 1/3] KVM: s390: introduce defines for control registers

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

 



On Fri, 27 Apr 2018 14:36:11 +0200
David Hildenbrand <david@xxxxxxxxxx> wrote:

> In KVM code we use masks to test/set control registers.
> 
> Let's define the ones we use in arch/s390/include/asm/ctl_reg.h and
> replace all occurrences in KVM code.
> 
> As we will be needing the define for Clock-comparator sign control soon,
> let's also add it.
> 
> Suggested-by: Collin L. Walling <walling@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>
> ---
>  arch/s390/include/asm/ctl_reg.h | 12 ++++++++++++
>  arch/s390/kvm/guestdbg.c        |  2 +-
>  arch/s390/kvm/interrupt.c       | 16 ++++++++--------
>  arch/s390/kvm/kvm-s390.c        | 10 +++++++---
>  4 files changed, 28 insertions(+), 12 deletions(-)
> 
> diff --git a/arch/s390/include/asm/ctl_reg.h b/arch/s390/include/asm/ctl_reg.h
> index 99c93d0346f9..4600453536c2 100644
> --- a/arch/s390/include/asm/ctl_reg.h
> +++ b/arch/s390/include/asm/ctl_reg.h
> @@ -10,8 +10,20 @@
>  
>  #include <linux/const.h>
>  
> +#define CR0_CLOCK_COMPARATOR_SIGN	_BITUL(63 - 10)
> +#define CR0_EMERGENCY_SIGNAL_SUBMASK	_BITUL(63 - 49)
> +#define CR0_EXTERNAL_CALL_SUBMASK	_BITUL(63 - 50)
> +#define CR0_CLOCK_COMPARATOR_SUBMASK	_BITUL(63 - 52)
> +#define CR0_CPU_TIMER_SUBMASK		_BITUL(63 - 53)
> +#define CR0_SERVICE_SIGNAL_SUBMASK	_BITUL(63 - 54)
> +#define CR0_UNUSED_56			_BITUL(63 - 56)
> +#define CR0_INTERRUPT_KEY_SUBMASK	_BITUL(63 - 57)
> +#define CR0_MEASUREMENT_ALERT_SUBMASK	_BITUL(63 - 58)
> +
>  #define CR2_GUARDED_STORAGE		_BITUL(63 - 59)
>  
> +#define CR14_UNUSED_32			_BITUL(63 - 32)
> +#define CR14_UNUSED_33			_BITUL(63 - 33)

These 'unused' values look a bit odd, but keep the masks unchanged :)
(The respective values do not seem to be in the public documentation
afaics?)

>  #define CR14_CHANNEL_REPORT_SUBMASK	_BITUL(63 - 35)
>  #define CR14_RECOVERY_SUBMASK		_BITUL(63 - 36)
>  #define CR14_DEGRADATION_SUBMASK	_BITUL(63 - 37)

Looks like a real improvement in readability!

Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>



[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