diff mbox series

[v2,4/4] KVM: s390: don't setup dummy routing when KVM_CREATE_IRQCHIP

Message ID 20240121111730.262429-5-foxywang@tencent.com (mailing list archive)
State New, archived
Headers show
Series KVM: irqchip: synchronize srcu only if needed | expand

Commit Message

Yi Wang Jan. 21, 2024, 11:17 a.m. UTC
As we have setup empty irq routing in kvm_create_vm(), there's
no need to setup dummy routing when KVM_CREATE_IRQCHIP.

Signed-off-by: Yi Wang <foxywang@tencent.com>
---
 arch/s390/kvm/kvm-s390.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Oliver Upton Jan. 23, 2024, 6:54 p.m. UTC | #1
On Sun, Jan 21, 2024 at 07:17:30PM +0800, Yi Wang wrote:
> As we have setup empty irq routing in kvm_create_vm(), there's
> no need to setup dummy routing when KVM_CREATE_IRQCHIP.
> 
> Signed-off-by: Yi Wang <foxywang@tencent.com>
> ---
>  arch/s390/kvm/kvm-s390.c | 13 +++++--------
>  1 file changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> index acc81ca6492e..7c836c973b75 100644
> --- a/arch/s390/kvm/kvm-s390.c
> +++ b/arch/s390/kvm/kvm-s390.c
> @@ -2999,14 +2999,11 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
>  		break;
>  	}
>  	case KVM_CREATE_IRQCHIP: {
> -		struct kvm_irq_routing_entry routing;
> -
> -		r = -EINVAL;
> -		if (kvm->arch.use_irqchip) {
> -			/* Set up dummy routing. */
> -			memset(&routing, 0, sizeof(routing));
> -			r = kvm_set_irq_routing(kvm, &routing, 0, 0);
> -		}
> +		/*
> +		 * As we have set up empty routing, there is no need to
> +		 * setup dummy routing here.
> +		 */

Where exactly?

In the context of this patch series it is rather obvious, but this
comment does not stand on its own. You can either throw the reader a
bone by mentioning where the dummy routing is created or just drop the
comment altogether.

> +		r = 0;
>  		break;
>  	}
>  	case KVM_SET_DEVICE_ATTR: {
> -- 
> 2.39.3
>
Yi Wang Jan. 24, 2024, 2:16 a.m. UTC | #2
On Wed, Jan 24, 2024 at 2:54 AM Oliver Upton <oliver.upton@linux.dev> wrote:
>
> On Sun, Jan 21, 2024 at 07:17:30PM +0800, Yi Wang wrote:
> > As we have setup empty irq routing in kvm_create_vm(), there's
> > no need to setup dummy routing when KVM_CREATE_IRQCHIP.
> >
> > Signed-off-by: Yi Wang <foxywang@tencent.com>
> > ---
> >  arch/s390/kvm/kvm-s390.c | 13 +++++--------
> >  1 file changed, 5 insertions(+), 8 deletions(-)
> >
> > diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
> > index acc81ca6492e..7c836c973b75 100644
> > --- a/arch/s390/kvm/kvm-s390.c
> > +++ b/arch/s390/kvm/kvm-s390.c
> > @@ -2999,14 +2999,11 @@ int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
> >               break;
> >       }
> >       case KVM_CREATE_IRQCHIP: {
> > -             struct kvm_irq_routing_entry routing;
> > -
> > -             r = -EINVAL;
> > -             if (kvm->arch.use_irqchip) {
> > -                     /* Set up dummy routing. */
> > -                     memset(&routing, 0, sizeof(routing));
> > -                     r = kvm_set_irq_routing(kvm, &routing, 0, 0);
> > -             }
> > +             /*
> > +              * As we have set up empty routing, there is no need to
> > +              * setup dummy routing here.
> > +              */
>
> Where exactly?
>
> In the context of this patch series it is rather obvious, but this
> comment does not stand on its own. You can either throw the reader a
> bone by mentioning where the dummy routing is created or just drop the
> comment altogether.

Yeap, you are right. I will drop this in the upcoming patch.

>
> > +             r = 0;
> >               break;
> >       }
> >       case KVM_SET_DEVICE_ATTR: {
> > --
> > 2.39.3
> >
>
> --
> Thanks,
> Oliver
diff mbox series

Patch

diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index acc81ca6492e..7c836c973b75 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -2999,14 +2999,11 @@  int kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg)
 		break;
 	}
 	case KVM_CREATE_IRQCHIP: {
-		struct kvm_irq_routing_entry routing;
-
-		r = -EINVAL;
-		if (kvm->arch.use_irqchip) {
-			/* Set up dummy routing. */
-			memset(&routing, 0, sizeof(routing));
-			r = kvm_set_irq_routing(kvm, &routing, 0, 0);
-		}
+		/*
+		 * As we have set up empty routing, there is no need to
+		 * setup dummy routing here.
+		 */
+		r = 0;
 		break;
 	}
 	case KVM_SET_DEVICE_ATTR: {