From 604d28cc3f791657414f8b21103921fa0147fc63 Mon Sep 17 00:00:00 2001 From: Greg Kurz Date: Mon, 24 Jul 2017 14:34:33 +0200 Subject: board-qemu: add private hcall to inform host on "phandle" update The "interrupt-map" property in each PHB node references the "phandle" property of the "interrupt-controller" node. This is used by the guest OS to setup IRQs for any PCI device plugged into the PHB. QEMU sets this property to an arbitrary value in the flattened DT passed to SLOF. Since commit 82954d4c1088, SLOF has some generic code to convert all references to any "phandle" property to a SLOF specific value. This is is perfectly okay for coldplug devices, since the guest OS only sees the converted value in "interrupt-map". It is a problem though for hotplug devices. Since they don't go through SLOF, the guest OS receives the arbitrary value set by QEMU and fails to setup IRQs. In order to support PHB hotplug, this patch introduces a new private hcall, which allows SLOF to tell QEMU that a "phandle" was converted from an old value to a new value. Suggested-by: Thomas Huth Signed-off-by: Greg Kurz Signed-off-by: Alexey Kardashevskiy --- lib/libhvcall/hvcall.code | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/libhvcall/hvcall.code') diff --git a/lib/libhvcall/hvcall.code b/lib/libhvcall/hvcall.code index 0ff50f2..8349748 100644 --- a/lib/libhvcall/hvcall.code +++ b/lib/libhvcall/hvcall.code @@ -129,3 +129,10 @@ PRIM(check_X2d_and_X2d_patch_X2d_sc1) patch_broken_sc1((void*)start, (void*)end, (void*)patch_ins); MIRP + +// : hv-update-phandle ( old_phandle new_phandle -- res ) +PRIM(hv_X2d_update_X2d_phandle) + uint32_t new_phandle = TOS.u; POP; + uint32_t old_phandle = TOS.u; + TOS.u = hv_generic(KVMPPC_H_UPDATE_PHANDLE, old_phandle, new_phandle); +MIRP -- cgit v1.1