Re: [PATCH v7 16/17] KVM: s390: pv: add KVM_CAP_S390_PROT_REBOOT_ASYNC

Janosch Frank
2022-02-07T15:46:30Z

On 2/7/22 16:19, Claudio Imbrenda wrote:
> On Mon, 7 Feb 2022 15:37:48 +0100
> Janosch Frank <frankja@linux.ibm.com> wrote:
>
>> On 2/4/22 16:53, Claudio Imbrenda wrote:
>>> Add KVM_CAP_S390_PROT_REBOOT_ASYNC to signal that the
>>> KVM_PV_ASYNC_DISABLE and KVM_PV_ASYNC_DISABLE_PREPARE commands for the
>>> KVM_S390_PV_COMMAND ioctl are available.
>>>
>>> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
>>> ---
>>> arch/s390/kvm/kvm-s390.c | 3 +++
>>> include/uapi/linux/kvm.h | 1 +
>>> 2 files changed, 4 insertions(+)
>>>
>>> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
>>> index f7952cef1309..1e696202a569 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -608,6 +608,9 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
>>> case KVM_CAP_S390_BPB:
>>> r = test_facility(82);
>>> break;
>>> + case KVM_CAP_S390_PROT_REBOOT_ASYNC:
>>> + r = lazy_destroy && is_prot_virt_host();
>>
>> While reboot might be the best use-case for the async disable I don't
>> think we should name the capability this way.
>>
>> KVM_CAP_S390_PROTECTED_ASYNC_DESTR ?
>
> then maybe
>
> KVM_CAP_S390_PROTECTED_ASYNC_DISABLE ?

Sounds good to me

>
>>
>> It's a bit long but the initial capability didn't abbreviate the
>> protected part so it is what it is.
>>
>>
>>> + break;
>>> case KVM_CAP_S390_PROTECTED:
>>> r = is_prot_virt_host();
>>> break;
>>> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
>>> index 7f574c87a6ba..c41c108f6b14 100644
>>> --- a/include/uapi/linux/kvm.h
>>> +++ b/include/uapi/linux/kvm.h
>>> @@ -1134,6 +1134,7 @@ struct kvm_ppc_resize_hpt {
>>> #define KVM_CAP_VM_GPA_BITS 207
>>> #define KVM_CAP_XSAVE2 208
>>> #define KVM_CAP_SYS_ATTRIBUTES 209
>>> +#define KVM_CAP_S390_PROT_REBOOT_ASYNC 215
>>>
>>> #ifdef KVM_CAP_IRQ_ROUTING
>>>
>>>
>>
>