diff mbox series

[v14,3/6] KVM: s390: pv: add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE

Message ID 20220930140150.37463-4-imbrenda@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series KVM: s390: pv: implement lazy destroy for reboot | expand

Commit Message

Claudio Imbrenda Sept. 30, 2022, 2:01 p.m. UTC
Add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 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>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
---
 arch/s390/kvm/kvm-s390.c | 3 +++
 include/uapi/linux/kvm.h | 1 +
 2 files changed, 4 insertions(+)

Comments

Steffen Eiden Oct. 4, 2022, 1:44 p.m. UTC | #1
On 9/30/22 16:01, Claudio Imbrenda wrote:
> Add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 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>
> Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
LGTM.

Reviewed-by: Steffen Eiden <seiden@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 d0027964a6f5..7a3bd68efd85 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -618,6 +618,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_PROTECTED_ASYNC_DISABLE:
> +		r = async_destroy && is_prot_virt_host();
> +		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 02602c5c1975..9afe0084b2c5 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -1177,6 +1177,7 @@ struct kvm_ppc_resize_hpt {
>   #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
>   #define KVM_CAP_S390_ZPCI_OP 221
>   #define KVM_CAP_S390_CPU_TOPOLOGY 222
> +#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 225
>   
>   #ifdef KVM_CAP_IRQ_ROUTING
>
Janosch Frank Oct. 10, 2022, 11:45 a.m. UTC | #2
On 9/30/22 16:01, Claudio Imbrenda wrote:
> Add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 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>
> Reviewed-by: Nico Boehr <nrb@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 d0027964a6f5..7a3bd68efd85 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -618,6 +618,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_PROTECTED_ASYNC_DISABLE:
> +		r = async_destroy && is_prot_virt_host();
> +		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 02602c5c1975..9afe0084b2c5 100644
> --- a/include/uapi/linux/kvm.h
> +++ b/include/uapi/linux/kvm.h
> @@ -1177,6 +1177,7 @@ struct kvm_ppc_resize_hpt {
>   #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
>   #define KVM_CAP_S390_ZPCI_OP 221
>   #define KVM_CAP_S390_CPU_TOPOLOGY 222
> +#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 225

I can see 223 in Paolo's next, is there a 224 that I've missed?


>   
>   #ifdef KVM_CAP_IRQ_ROUTING
>
Claudio Imbrenda Oct. 10, 2022, 12:15 p.m. UTC | #3
On Mon, 10 Oct 2022 13:45:54 +0200
Janosch Frank <frankja@linux.ibm.com> wrote:

> On 9/30/22 16:01, Claudio Imbrenda wrote:
> > Add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 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>
> > Reviewed-by: Nico Boehr <nrb@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 d0027964a6f5..7a3bd68efd85 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -618,6 +618,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_PROTECTED_ASYNC_DISABLE:
> > +		r = async_destroy && is_prot_virt_host();
> > +		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 02602c5c1975..9afe0084b2c5 100644
> > --- a/include/uapi/linux/kvm.h
> > +++ b/include/uapi/linux/kvm.h
> > @@ -1177,6 +1177,7 @@ struct kvm_ppc_resize_hpt {
> >   #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
> >   #define KVM_CAP_S390_ZPCI_OP 221
> >   #define KVM_CAP_S390_CPU_TOPOLOGY 222
> > +#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 225  
> 
> I can see 223 in Paolo's next, is there a 224 that I've missed?

no, I set this to an arbitrarily high value to avoid conficts

seems like I got it more or less right :)

feel free to change the value of the macro when merging, so it's
contiguous.

> 
> 
> >   
> >   #ifdef KVM_CAP_IRQ_ROUTING
> >     
>
Janosch Frank Oct. 10, 2022, 1:10 p.m. UTC | #4
On 10/10/22 14:15, Claudio Imbrenda wrote:
> On Mon, 10 Oct 2022 13:45:54 +0200
> Janosch Frank <frankja@linux.ibm.com> wrote:
> 
>> On 9/30/22 16:01, Claudio Imbrenda wrote:
>>> Add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 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>
>>> Reviewed-by: Nico Boehr <nrb@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 d0027964a6f5..7a3bd68efd85 100644
>>> --- a/arch/s390/kvm/kvm-s390.c
>>> +++ b/arch/s390/kvm/kvm-s390.c
>>> @@ -618,6 +618,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_PROTECTED_ASYNC_DISABLE:
>>> +		r = async_destroy && is_prot_virt_host();
>>> +		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 02602c5c1975..9afe0084b2c5 100644
>>> --- a/include/uapi/linux/kvm.h
>>> +++ b/include/uapi/linux/kvm.h
>>> @@ -1177,6 +1177,7 @@ struct kvm_ppc_resize_hpt {
>>>    #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
>>>    #define KVM_CAP_S390_ZPCI_OP 221
>>>    #define KVM_CAP_S390_CPU_TOPOLOGY 222
>>> +#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 225
>>
>> I can see 223 in Paolo's next, is there a 224 that I've missed?
> 
> no, I set this to an arbitrarily high value to avoid conficts
> 
> seems like I got it more or less right :)
> 
> feel free to change the value of the macro when merging, so it's
> contiguous.

Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
diff mbox series

Patch

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index d0027964a6f5..7a3bd68efd85 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -618,6 +618,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_PROTECTED_ASYNC_DISABLE:
+		r = async_destroy && is_prot_virt_host();
+		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 02602c5c1975..9afe0084b2c5 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1177,6 +1177,7 @@  struct kvm_ppc_resize_hpt {
 #define KVM_CAP_VM_DISABLE_NX_HUGE_PAGES 220
 #define KVM_CAP_S390_ZPCI_OP 221
 #define KVM_CAP_S390_CPU_TOPOLOGY 222
+#define KVM_CAP_S390_PROTECTED_ASYNC_DISABLE 225
 
 #ifdef KVM_CAP_IRQ_ROUTING