spapr, xics, xive: Better use of assert()s on irq claim/free paths
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 25 Sep 2019 03:49:59 +0000 (13:49 +1000)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 4 Oct 2019 09:08:23 +0000 (19:08 +1000)
commit580dde5e4a4597be26cb948a711727c2a406f158
treedb8e92526b64c4f6788355acc045be5deaa9261c
parentf233cee97bfbab24517171ef5a56d8a54d8a96ef
spapr, xics, xive: Better use of assert()s on irq claim/free paths

The irq claim and free paths for both XICS and XIVE check for some
validity conditions.  Some of these represent genuine runtime failures,
however others - particularly checking that the basic irq number is in a
sane range - could only fail in the case of bugs in the callin code.
Therefore use assert()s instead of runtime failures for those.

In addition the non backend-specific part of the claim/free paths should
only be used for PAPR external irqs, that is in the range SPAPR_XIRQ_BASE
to the maximum irq number.  Put assert()s for that into the top level
dispatchers as well.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Greg Kurz <groug@kaod.org>
hw/intc/spapr_xive.c
hw/ppc/spapr_irq.c