ppc: allow certain HV interrupts to be delivered to guests
commit10c21b5c20bf3d20b7b0ad279db37ae89cc7937d
authorNicholas Piggin <npiggin@gmail.com>
Thu, 27 Oct 2016 12:50:58 +0000 (27 23:50 +1100)
committerDavid Gibson <david@gibson.dropbear.id.au>
Fri, 28 Oct 2016 00:17:35 +0000 (28 11:17 +1100)
tree3656bf0ff51237daf3100b1a42b56b0e88243770
parentcf63246319019c330a214c1ca9284c9405a6eb7a
ppc: allow certain HV interrupts to be delivered to guests

ppc hypervisors have delivered system reset and machine check exception
interrupts to guests in some situations (e.g., see FWNMI feature of LoPAPR,
or NMI injection in QEMU).

These exceptions are architected to set the HV bit in hardware, however
when injected into a guest, the HV bit should be cleared. Current code
masks off the HV bit before setting the new MSR, however this happens after
the interrupt delivery model has calculated delivery mode for the exception.
This can result in the guest's MSR LE bit being lost.

Account for this in the exception handler and don't set HV bit for guest
delivery.

Also add another sanity check to ensure similar bugs get caught.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target-ppc/excp_helper.c