[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC 11/16] irq: skip action avalability check for guest's IRQ





On 12/12/2018 11:30, Andrii Anisov wrote:


On 11.12.18 16:48, Julien Grall wrote:
And you can't see any potential race in that code happening in the future?
It is protected with `desc->lock` so far. If one decided to get it from under the lock, the race is possible with `release_irq()`.

Also getting an unknown
interrupt is very unlikely on a non-debug platform.

I am tempted to keep the code at the same place but protect with an #ifndef NDEBUG. What do you think?
Well, I think about a correspondent ASSERT for the guest IRQ. Like following:

      if ( test_bit(_IRQ_GUEST, &desc->status) )
      {>>           struct irq_guest *info = irq_get_guest_info(desc);
+            ASSERT( desc->action != NULL );

What would you prefer?

An ASSERT(...) is already embed in irq_get_guest_info(desc).

I thought about the ASSERT(...) over the current printk yesterday. But I discarded it because it does not give you more information if something went really wrong as the stack trace would not really be helpful in that context.

So I would prefer the #ifdef NDEBUG solution.

Cheers,

--
Julien Grall

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.