All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for-4.12] gic-vgic: fix assert condition
@ 2019-01-24 18:33 Andrii Anisov
  2019-01-24 18:47 ` Nuernberger, Stefan
  2019-01-24 19:27 ` Julien Grall
  0 siblings, 2 replies; 10+ messages in thread
From: Andrii Anisov @ 2019-01-24 18:33 UTC (permalink / raw)
  To: xen-devel
  Cc: Juergen Gross, Andre Przywara, Julien Grall, Stefano Stabellini,
	Andrii Anisov

From: Andrii Anisov <andrii_anisov@epam.com>

Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
 xen/arch/arm/gic-vgic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
index 48922f5..684f2d1 100644
--- a/xen/arch/arm/gic-vgic.c
+++ b/xen/arch/arm/gic-vgic.c
@@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, struct vcpu *v, unsigned int virq,
     int ret = 0;
 
     /* "desc" is optional when we disconnect an IRQ. */
-    ASSERT(connect && desc);
+    ASSERT(connect || desc);
 
     /* We are taking to rank lock to prevent parallel connections. */
     vgic_lock_rank(v_target, rank, flags);
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-24 18:33 [PATCH for-4.12] gic-vgic: fix assert condition Andrii Anisov
@ 2019-01-24 18:47 ` Nuernberger, Stefan
  2019-01-24 20:28   ` André Przywara
  2019-01-25  6:55   ` Andrii Anisov
  2019-01-24 19:27 ` Julien Grall
  1 sibling, 2 replies; 10+ messages in thread
From: Nuernberger, Stefan @ 2019-01-24 18:47 UTC (permalink / raw)
  To: andrii.anisov, xen-devel
  Cc: jgross, andre.przywara, julien.grall, sstabellini, andrii_anisov

On Thu, 2019-01-24 at 20:33 +0200, Andrii Anisov wrote:
> From: Andrii Anisov <andrii_anisov@epam.com>
> 
> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
> ---
>  xen/arch/arm/gic-vgic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
> index 48922f5..684f2d1 100644
> --- a/xen/arch/arm/gic-vgic.c
> +++ b/xen/arch/arm/gic-vgic.c
> @@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, struct
> vcpu *v, unsigned int virq,
>      int ret = 0;
>  
>      /* "desc" is optional when we disconnect an IRQ. */
> -    ASSERT(connect && desc);
> +    ASSERT(connect || desc);

I assume it should be ASSERT(!connect || desc);

- Stefan
>  
>      /* We are taking to rank lock to prevent parallel connections.
> */
>      vgic_lock_rank(v_target, rank, flags);
-- 
Amazon Development Center Germany GmbH
c/o Stefan Nuernberger
Am Brauhaus 12
01099 Dresden
Germany

Amtsgericht Charlottenburg - HRB 149173 B - UStID DE 289 237 879
Managing Directors: Ralf Herbrich, Chris Schlaeger



Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrer: Christian Schlaeger, Ralf Herbrich
Ust-ID: DE 289 237 879
Eingetragen am Amtsgericht Charlottenburg HRB 149173 B

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-24 18:33 [PATCH for-4.12] gic-vgic: fix assert condition Andrii Anisov
  2019-01-24 18:47 ` Nuernberger, Stefan
@ 2019-01-24 19:27 ` Julien Grall
  2019-01-25  7:11   ` Andrii Anisov
  1 sibling, 1 reply; 10+ messages in thread
From: Julien Grall @ 2019-01-24 19:27 UTC (permalink / raw)
  To: Andrii Anisov
  Cc: Juergen Gross, Stefano Stabellini, Andrii Anisov, Andre Przywara,
	Julien Grall, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1127 bytes --]

(sorry for the formatting)

On Thu, 24 Jan 2019, 18:35 Andrii Anisov, <andrii.anisov@gmail.com> wrote:

> From: Andrii Anisov <andrii_anisov@epam.com>
>

Empty commit message should only happen when the title provide enough
information.

In that case, you should explain how you hit the assert so the reviewers
can understand the change.


Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
> ---
>  xen/arch/arm/gic-vgic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
> index 48922f5..684f2d1 100644
> --- a/xen/arch/arm/gic-vgic.c
> +++ b/xen/arch/arm/gic-vgic.c
> @@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, storuct vcpu
> *v, unsigned int virq,
>      int ret = 0;
>
>      /* "desc" is optional when we disconnect an IRQ. */
> -    ASSERT(connect && desc);
> +    ASSERT(connect || desc);


This looks wrong to me. Now you allow desc to be NULL when connecting an
IRQ. This does not even match the comment above.

Without a meaningful commit message, this hard to understand the reasoning
behind the modification.

Cheers,

[-- Attachment #1.2: Type: text/html, Size: 1883 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-24 18:47 ` Nuernberger, Stefan
@ 2019-01-24 20:28   ` André Przywara
  2019-01-25  6:55   ` Andrii Anisov
  1 sibling, 0 replies; 10+ messages in thread
From: André Przywara @ 2019-01-24 20:28 UTC (permalink / raw)
  To: Nuernberger, Stefan, andrii.anisov, xen-devel
  Cc: jgross, julien.grall, sstabellini, andrii_anisov

On 24/01/2019 18:47, Nuernberger, Stefan wrote:
> On Thu, 2019-01-24 at 20:33 +0200, Andrii Anisov wrote:
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
>> ---
>>  xen/arch/arm/gic-vgic.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
>> index 48922f5..684f2d1 100644
>> --- a/xen/arch/arm/gic-vgic.c
>> +++ b/xen/arch/arm/gic-vgic.c
>> @@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, struct
>> vcpu *v, unsigned int virq,
>>      int ret = 0;
>>  
>>      /* "desc" is optional when we disconnect an IRQ. */
>> -    ASSERT(connect && desc);
>> +    ASSERT(connect || desc);
> 
> I assume it should be ASSERT(!connect || desc);

Drawing the truth table and throwing all my CS text book boolean
knowledge at it :-)  Yes, Stefan's version matches the comment.

Plus what Julien said about the commit message.

Cheers,
Andre

>>  
>>      /* We are taking to rank lock to prevent parallel connections.
>> */
>>      vgic_lock_rank(v_target, rank, flags);


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-24 18:47 ` Nuernberger, Stefan
  2019-01-24 20:28   ` André Przywara
@ 2019-01-25  6:55   ` Andrii Anisov
  2019-01-25 12:10     ` Andrii Anisov
  1 sibling, 1 reply; 10+ messages in thread
From: Andrii Anisov @ 2019-01-25  6:55 UTC (permalink / raw)
  To: Nuernberger, Stefan
  Cc: jgross, sstabellini, Andrii Anisov, andre.przywara, julien.grall,
	xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 299 bytes --]

Hello Stefan,

You are absolutely correct.

Sent from my Android.

чт, 24 січ. 2019, 20:47 Nuernberger, Stefan користувач snu@amazon.de пише:

> -    ASSERT(connect && desc);
> +    ASSERT(connect || desc);

I assume it should be ASSERT(!connect || desc);

- Stefan

[-- Attachment #1.2: Type: text/html, Size: 921 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-24 19:27 ` Julien Grall
@ 2019-01-25  7:11   ` Andrii Anisov
  0 siblings, 0 replies; 10+ messages in thread
From: Andrii Anisov @ 2019-01-25  7:11 UTC (permalink / raw)
  To: Julien Grall
  Cc: Juergen Gross, Stefano Stabellini, Andrii Anisov, Andre Przywara,
	Julien Grall, xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 1587 bytes --]

Dear Julien,



чт, 24 січ. 2019, 21:27 Julien Grall користувач julien.grall@gmail.com пише:

> (sorry for the formatting)
>
> On Thu, 24 Jan 2019, 18:35 Andrii Anisov, <andrii.anisov@gmail.com> wrote:
>
>> From: Andrii Anisov <andrii_anisov@epam.com>
>>
>
> Empty commit message should only happen when the title provide enough
> information.
>
> In that case, you should explain how you hit the assert so the reviewers
> can understand the change.
>

It was an extremely rare an totally unusual use-case, which nobody else
needs.
I did reboot a guest domain with a device passthroughed to it.


>
> Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
>> ---
>>  xen/arch/arm/gic-vgic.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/gic-vgic.c b/xen/arch/arm/gic-vgic.c
>> index 48922f5..684f2d1 100644
>> --- a/xen/arch/arm/gic-vgic.c
>> +++ b/xen/arch/arm/gic-vgic.c
>> @@ -443,7 +443,7 @@ int vgic_connect_hw_irq(struct domain *d, storuct
>> vcpu *v, unsigned int virq,
>>      int ret = 0;
>>
>>      /* "desc" is optional when we disconnect an IRQ. */
>> -    ASSERT(connect && desc);
>> +    ASSERT(connect || desc);
>
>
> This looks wrong to me. Now you allow desc to be NULL when connecting an
> IRQ.
>
Yes, sure, the original check is much better: it doesn't allow
disconnecting at all.

This does not even match the comment above.
>
Being upset I mistakingly set another wrong condition. Stefan instead
suggested the right one.

Sent from my Android.

>

[-- Attachment #1.2: Type: text/html, Size: 3373 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-25  6:55   ` Andrii Anisov
@ 2019-01-25 12:10     ` Andrii Anisov
  2019-02-05  1:02       ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: Andrii Anisov @ 2019-01-25 12:10 UTC (permalink / raw)
  To: Nuernberger, Stefan
  Cc: jgross, sstabellini, Andrii Anisov, andre.przywara, julien.grall,
	xen-devel

Stefan,

I hope you would not mind if I put your Suggested-by for v2?

On 25.01.19 08:55, Andrii Anisov wrote:

> You are absolutely correct.
-- 
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-01-25 12:10     ` Andrii Anisov
@ 2019-02-05  1:02       ` Stefano Stabellini
  2019-02-05  8:33         ` Andrii Anisov
  0 siblings, 1 reply; 10+ messages in thread
From: Stefano Stabellini @ 2019-02-05  1:02 UTC (permalink / raw)
  To: Andrii Anisov
  Cc: jgross, sstabellini, Andrii Anisov, andre.przywara, Nuernberger,
	Stefan, julien.grall, xen-devel

Hi Andrii,

Please send an update soon as I would like to get it in 4.12.


Juergen,

I would like to have your release ack on this.


On Fri, 25 Jan 2019, Andrii Anisov wrote:
> Stefan,
> 
> I hope you would not mind if I put your Suggested-by for v2?
> 
> On 25.01.19 08:55, Andrii Anisov wrote:
> 
> > You are absolutely correct.
> -- 
> Sincerely,
> Andrii Anisov.
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-02-05  1:02       ` Stefano Stabellini
@ 2019-02-05  8:33         ` Andrii Anisov
  2019-02-05 19:07           ` Stefano Stabellini
  0 siblings, 1 reply; 10+ messages in thread
From: Andrii Anisov @ 2019-02-05  8:33 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: jgross, Andrii Anisov, andre.przywara, Nuernberger, Stefan,
	julien.grall, xen-devel

Hello Stefano,

On 05.02.19 03:02, Stefano Stabellini wrote:
> Please send an update soon as I would like to get it in 4.12.

It is already there [1] [2].

[1] https://lists.xenproject.org/archives/html/xen-devel/2019-01/msg02048.html
[2] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=863549158129d326b2e5850f722bfda643264f2b

-- 
Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH for-4.12] gic-vgic: fix assert condition
  2019-02-05  8:33         ` Andrii Anisov
@ 2019-02-05 19:07           ` Stefano Stabellini
  0 siblings, 0 replies; 10+ messages in thread
From: Stefano Stabellini @ 2019-02-05 19:07 UTC (permalink / raw)
  To: Andrii Anisov
  Cc: jgross, Stefano Stabellini, Andrii Anisov, andre.przywara,
	Nuernberger, Stefan, julien.grall, xen-devel

On Tue, 5 Feb 2019, Andrii Anisov wrote:
> Hello Stefano,
> 
> On 05.02.19 03:02, Stefano Stabellini wrote:
> > Please send an update soon as I would like to get it in 4.12.
> 
> It is already there [1] [2].
> 
> [1] https://lists.xenproject.org/archives/html/xen-devel/2019-01/msg02048.html
> [2]
> https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=863549158129d326b2e5850f722bfda643264f2b

Ops, I missed it :-)  Even better.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-02-05 19:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-24 18:33 [PATCH for-4.12] gic-vgic: fix assert condition Andrii Anisov
2019-01-24 18:47 ` Nuernberger, Stefan
2019-01-24 20:28   ` André Przywara
2019-01-25  6:55   ` Andrii Anisov
2019-01-25 12:10     ` Andrii Anisov
2019-02-05  1:02       ` Stefano Stabellini
2019-02-05  8:33         ` Andrii Anisov
2019-02-05 19:07           ` Stefano Stabellini
2019-01-24 19:27 ` Julien Grall
2019-01-25  7:11   ` Andrii Anisov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.