ppc: Fix generation if ISI/DSI vs. HV mode
commit33595dc9f3f4839fa7d1195df6007f3457e515be
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Tue, 21 Jun 2016 21:48:50 +0000 (21 23:48 +0200)
committerDavid Gibson <david@gibson.dropbear.id.au>
Thu, 23 Jun 2016 02:43:25 +0000 (23 12:43 +1000)
tree8f69752ba1bc87d4a5bc622ab14af6b0451f241b
parentf03a1af581b926118d619ad1acc3304ad84d5e5b
ppc: Fix generation if ISI/DSI vs. HV mode

Under some circumstances, we need to direct ISI and DSI interrupts
at the hypervisor, turning them into HISI/HDSI, and using different
SPRs (HDSISR and HDAR) depending on the combination of MSR_DR and
the corresponding VPM bits in LPCR.

This moves part of the code into helpers that are fixed to select
the right exception type and registers. On pre-P7 processors, LPCR
is 0 which provides the old behaviour of directing the interrupts
at the supervisor.

Thanks to Andrei Warkentin for finding a bug when HV=1

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
[clg: Merged a fix on POWERPC_EXCP_HDSI fixing the condition on
      msr_hv, from Andrei Warkentin <andrey.warkentin@gmail.com> ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
target-ppc/mmu-hash64.c