qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH] PPC: spapr: Expose /hypervisor node in device tree


From: Alexander Graf
Subject: [Qemu-ppc] [PATCH] PPC: spapr: Expose /hypervisor node in device tree
Date: Thu, 24 Apr 2014 15:04:19 +0200

PR KVM supports an ePAPR compliant hypercall interface in parallel to the
normal sPAPR one. Expose the ePAPR /hypervisor node and properties to the
guest so it can use it.

This enables magic page sharing on PR KVM with -M pseries.

Signed-off-by: Alexander Graf <address@hidden>
---
 hw/ppc/spapr.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index a11e121..93d1fac 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -521,6 +521,19 @@ static void *spapr_create_fdt_skel(hwaddr initrd_base,
     /* event-sources */
     spapr_events_fdt_skel(fdt, epow_irq);
 
+    /* /hypervisor node */
+    if (kvm_enabled()) {
+        uint8_t hypercall[16];
+
+        /* indicate KVM hypercall interface */
+        _FDT((fdt_begin_node(fdt, "hypervisor")));
+        _FDT((fdt_property_string(fdt, "compatible", "linux,kvm")));
+        kvmppc_get_hypercall(first_cpu->env_ptr, hypercall, sizeof(hypercall));
+        _FDT((fdt_property(fdt, "hcall-instructions", hypercall,
+                          sizeof(hypercall))));
+        _FDT((fdt_end_node(fdt)));
+    }
+
     _FDT((fdt_end_node(fdt))); /* close root node */
     _FDT((fdt_finish(fdt)));
 
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]