spapr/irq: Add XIVE sanity checks on non-P9 machines
commit273fef83f6c669f76fe25f419502ed123dfe15d2
authorCédric Le Goater <clg@kaod.org>
Thu, 28 Mar 2019 10:00:44 +0000 (28 11:00 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 28 Mar 2019 23:38:20 +0000 (29 10:38 +1100)
treec551bcf34bfd24983d8d74fb9fef0571569d2601
parent0a794529bd1109aeea0c407784b40a2605e808b9
spapr/irq: Add XIVE sanity checks on non-P9 machines

On non-P9 machines, the XIVE interrupt mode is not advertised, see
spapr_dt_ov5_platform_support(). Add a couple of checks on the machine
configuration to filter bogus setups and prevent OS failures :

                     Interrupt modes

  CPU/Compat      XICS    XIVE                dual

   P8/P8          OK      QEMU failure (1)    OK (3)
   P9/P8          OK      QEMU failure (2)    OK (3)
   P9/P9          OK      OK                  OK

  (1) CPU exception model is incompatible with XIVE and the presenters
      will fail to realize.

  (2) CPU exception model is compatible with XIVE, but the XIVE CAS
      advertisement is dropped when in POWER8 mode. So we could ended up
      booting with the XIVE DT properties but without the HCALLs. Avoid
      confusing Linux with such settings and fail under QEMU.

  (3) force XICS in machine init

Remove the check on XIVE-only machines in spapr_machine_init(), which
has now become redundant.

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