Blame SOURCES/kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch

76daa3
From 0efa66da9c8638270ac03a02d184473b7a049fe8 Mon Sep 17 00:00:00 2001
76daa3
From: David Gibson <dgibson@redhat.com>
76daa3
Date: Thu, 27 Apr 2017 02:15:54 +0200
76daa3
Subject: [PATCH 19/23] target/ppc: Add new H-CALL shells for in memory table
76daa3
 translation
76daa3
76daa3
RH-Author: David Gibson <dgibson@redhat.com>
76daa3
Message-id: <20170427021558.4884-4-dgibson@redhat.com>
76daa3
Patchwork-id: 74914
76daa3
O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 3/7] target/ppc: Add new H-CALL shells for in memory table translation
76daa3
Bugzilla: 1368786
76daa3
RH-Acked-by: Thomas Huth <thuth@redhat.com>
76daa3
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
76daa3
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
76daa3
From: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
76daa3
76daa3
The use of the new in memory tables introduced in ISAv3.00 for translation,
76daa3
also referred to as process tables, requires the introduction of 3 new
76daa3
H-CALLs; H_REGISTER_PROCESS_TABLE, H_CLEAN_SLB, and H_INVALIDATE_PID.
76daa3
76daa3
Add shells for each of these and register them as the hypercall handlers.
76daa3
Currently they all log an unimplemented hypercall and return H_FUNCTION.
76daa3
76daa3
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
76daa3
[dwg: Fix style nits]
76daa3
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
76daa3
76daa3
(cherry picked from commit d77a98b01575bbbeff87a83f6e7f5ca0ce3aefdb)
76daa3
76daa3
Siged-off-by: David Gibson <dgibson@redhat.com>
76daa3
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
76daa3
---
76daa3
 hw/ppc/spapr_hcall.c   | 31 +++++++++++++++++++++++++++++++
76daa3
 include/hw/ppc/spapr.h |  3 +++
76daa3
 2 files changed, 34 insertions(+)
76daa3
76daa3
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
76daa3
index f05a90e..7952129 100644
76daa3
--- a/hw/ppc/spapr_hcall.c
76daa3
+++ b/hw/ppc/spapr_hcall.c
76daa3
@@ -878,6 +878,32 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPRMachineState *spapr,
76daa3
     return ret;
76daa3
 }
76daa3
 
76daa3
+static target_ulong h_clean_slb(PowerPCCPU *cpu, sPAPRMachineState *spapr,
76daa3
+                                target_ulong opcode, target_ulong *args)
76daa3
+{
76daa3
+    qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n",
76daa3
+                  opcode, " (H_CLEAN_SLB)");
76daa3
+    return H_FUNCTION;
76daa3
+}
76daa3
+
76daa3
+static target_ulong h_invalidate_pid(PowerPCCPU *cpu, sPAPRMachineState *spapr,
76daa3
+                                     target_ulong opcode, target_ulong *args)
76daa3
+{
76daa3
+    qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n",
76daa3
+                  opcode, " (H_INVALIDATE_PID)");
76daa3
+    return H_FUNCTION;
76daa3
+}
76daa3
+
76daa3
+static target_ulong h_register_process_table(PowerPCCPU *cpu,
76daa3
+                                             sPAPRMachineState *spapr,
76daa3
+                                             target_ulong opcode,
76daa3
+                                             target_ulong *args)
76daa3
+{
76daa3
+    qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n",
76daa3
+                  opcode, " (H_REGISTER_PROC_TBL)");
76daa3
+    return H_FUNCTION;
76daa3
+}
76daa3
+
76daa3
 #define H_SIGNAL_SYS_RESET_ALL         -1
76daa3
 #define H_SIGNAL_SYS_RESET_ALLBUTSELF  -2
76daa3
 
76daa3
@@ -1084,6 +1110,11 @@ static void hypercall_register_types(void)
76daa3
     spapr_register_hypercall(H_PAGE_INIT, h_page_init);
76daa3
     spapr_register_hypercall(H_SET_MODE, h_set_mode);
76daa3
 
76daa3
+    /* In Memory Table MMU h-calls */
76daa3
+    spapr_register_hypercall(H_CLEAN_SLB, h_clean_slb);
76daa3
+    spapr_register_hypercall(H_INVALIDATE_PID, h_invalidate_pid);
76daa3
+    spapr_register_hypercall(H_REGISTER_PROC_TBL, h_register_process_table);
76daa3
+
76daa3
     /* "debugger" hcalls (also used by SLOF). Note: We do -not- differenciate
76daa3
      * here between the "CI" and the "CACHE" variants, they will use whatever
76daa3
      * mapping attributes qemu is using. When using KVM, the kernel will
76daa3
diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
76daa3
index 808aac8..9db6bbe 100644
76daa3
--- a/include/hw/ppc/spapr.h
76daa3
+++ b/include/hw/ppc/spapr.h
76daa3
@@ -349,6 +349,9 @@ struct sPAPRMachineState {
76daa3
 #define H_XIRR_X                0x2FC
76daa3
 #define H_RANDOM                0x300
76daa3
 #define H_SET_MODE              0x31C
76daa3
+#define H_CLEAN_SLB             0x374
76daa3
+#define H_INVALIDATE_PID        0x378
76daa3
+#define H_REGISTER_PROC_TBL     0x37C
76daa3
 #define H_SIGNAL_SYS_RESET      0x380
76daa3
 #define MAX_HCALL_OPCODE        H_SIGNAL_SYS_RESET
76daa3
 
76daa3
-- 
76daa3
1.8.3.1
76daa3