Re: [PATCH] KVM: s390: Cleanup initial cpu reset

David Hildenbrand
2020-01-10T14:37:40Z

On 10.01.20 15:01, Cornelia Huck wrote:
> On Fri, 10 Jan 2020 08:48:24 -0500
> Janosch Frank <frankja@linux.ibm.com> wrote:
>
>> The code seems to be quite old and uses lots of unneeded spaces for
>> alignment, which doesn't really help with readability.
>>
>> Let's:
>> * Get rid of the extra spaces
>> * Remove the ULs as they are not needed on 0s
>> * Define constants for the CR 0 and 14 initial values
>> * Use the sizeof of the gcr array to memset it to 0
>>
>> Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
>> ---
>>
>> Something like this?
>
> +1, like.
>
>> Did I forget something?
>>
>> ---
>> arch/s390/include/asm/kvm_host.h | 5 +++++
>> arch/s390/kvm/kvm-s390.c | 18 +++++++-----------
>> 2 files changed, 12 insertions(+), 11 deletions(-)
>>
>> diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
>> index 02f4c21c57f6..37747db884bd 100644
>> --- a/arch/s390/include/asm/kvm_host.h
>> +++ b/arch/s390/include/asm/kvm_host.h
>> @@ -122,6 +122,11 @@ struct mcck_volatile_info {
>> __u32 reserved;
>> };
>>
>> +#define CR0_INITIAL (CR0_UNUSED_56 | CR0_INTERRUPT_KEY_SUBMASK | \
>> + CR0_MEASUREMENT_ALERT_SUBMASK)
>> +#define CR14_INITIAL (CR14_UNUSED_32 | CR14_UNUSED_33 | \
>> + CR14_EXTERNAL_DAMAGE_SUBMASK)
>
> Maybe CR<n>_INITIAL_MASK?

+1

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

--
Thanks,

David / dhildenb