spapr/xive: use the VCPU id as a NVT identifier
commit0cddee8d488667a7de60e75f76ead8cffe613d75
authorCédric Le Goater <clg@kaod.org>
Sun, 9 Dec 2018 19:45:57 +0000 (9 20:45 +0100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 20 Dec 2018 22:37:38 +0000 (21 09:37 +1100)
tree1a289e06d34799ed2c81fb217d347df3e3490887
parent3aa597f6505b4d7b62a1b77ab95a233dd5c7c5f0
spapr/xive: use the VCPU id as a NVT identifier

The IVPE scans the O/S CAM line of the XIVE thread interrupt contexts
to find a matching Notification Virtual Target (NVT) among the NVTs
dispatched on the HW processor threads.

On a real system, the thread interrupt contexts are updated by the
hypervisor when a Virtual Processor is scheduled to run on a HW
thread. Under QEMU, the model will emulate the same behavior by
hardwiring the NVT identifier in the thread context registers at
reset.

The NVT identifier used by the sPAPRXive model is the VCPU id. The END
identifier is also derived from the VCPU id. A set of helpers doing
the conversion between identifiers are provided for the hcalls
configuring the sources and the ENDs.

The model does not need a NVT table but the XiveRouter NVT operations
are provided to perform some extra checks in the routing algorithm.

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