qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu'
@ 2024-01-18 13:32 Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 1/4] hw/ppc/spapr: Add missing license Nicholas Piggin
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-01-18 13:32 UTC (permalink / raw)
  To: qemu-ppc
  Cc: Nicholas Piggin, David Gibson, Harsh Prateek Bora,
	Daniel Henrique Barboza, Cédric Le Goater,
	Philippe Mathieu-Daudé, qemu-devel

I grabbed Philippe's series series and tried to use a more
agreeable name. Further disagreement is okay, but must come
with a better alternative :) would be good to get this out of
the way. I actually don't think softmmu is a great term for it
either even in isolation, so would be good to move away from it.

Previous discussion:
https://lists.gnu.org/archive/html/qemu-ppc/2023-10/msg00016.html

Thanks,
Nick

Philippe Mathieu-Daudé (4):
  hw/ppc/spapr: Add missing license
  hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep
  hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr
  hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu'

 include/hw/ppc/spapr.h                       |  9 ++++++---
 hw/ppc/spapr_hcall.c                         | 12 ++++++++----
 hw/ppc/{spapr_softmmu.c => spapr_vhyp_mmu.c} | 13 +++++++++++--
 target/ppc/tcg-stub.c                        | 15 ---------------
 hw/ppc/meson.build                           |  2 +-
 5 files changed, 26 insertions(+), 25 deletions(-)
 rename hw/ppc/{spapr_softmmu.c => spapr_vhyp_mmu.c} (97%)

-- 
2.42.0



^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] hw/ppc/spapr: Add missing license
  2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
@ 2024-01-18 13:32 ` Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 2/4] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep Nicholas Piggin
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-01-18 13:32 UTC (permalink / raw)
  To: qemu-ppc
  Cc: Nicholas Piggin, David Gibson, Harsh Prateek Bora,
	Daniel Henrique Barboza, Cédric Le Goater,
	Philippe Mathieu-Daudé, qemu-devel

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Commit 9fdf0c2995 ("Start implementing pSeries logical partition
machine") added hw/ppc/spapr_hcall.c, then commit 962104f044
("hw/ppc: moved hcalls that depend on softmmu") extracted the
system code to hw/ppc/spapr_softmmu.c. Take the license and
copyrights from the original spapr_hcall.c at commit 9fdf0c2995.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[npiggin: Update file description.]
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/ppc/spapr_softmmu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/ppc/spapr_softmmu.c b/hw/ppc/spapr_softmmu.c
index fc1bbc0b61..2fade94029 100644
--- a/hw/ppc/spapr_softmmu.c
+++ b/hw/ppc/spapr_softmmu.c
@@ -1,3 +1,12 @@
+/*
+ * MMU hypercalls for the sPAPR (pseries) vHyp hypervisor that is used by TCG
+ *
+ * Copyright (c) 2004-2007 Fabrice Bellard
+ * Copyright (c) 2007 Jocelyn Mayer
+ * Copyright (c) 2010 David Gibson, IBM Corporation.
+ *
+ * SPDX-License-Identifier: MIT
+ */
 #include "qemu/osdep.h"
 #include "qemu/cutils.h"
 #include "qemu/memalign.h"
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep
  2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 1/4] hw/ppc/spapr: Add missing license Nicholas Piggin
@ 2024-01-18 13:32 ` Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 3/4] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr Nicholas Piggin
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-01-18 13:32 UTC (permalink / raw)
  To: qemu-ppc
  Cc: Nicholas Piggin, David Gibson, Harsh Prateek Bora,
	Daniel Henrique Barboza, Cédric Le Goater,
	Philippe Mathieu-Daudé, qemu-devel

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Check tcg_enabled() before calling softmmu_resize_hpt_prepare()
and softmmu_resize_hpt_commit() to allow the compiler to elide
their calls. The stubs are then unnecessary, remove them.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/ppc/spapr_hcall.c  | 12 ++++++++----
 target/ppc/tcg-stub.c | 15 ---------------
 2 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index fcefd1d1c7..0d7d523e6d 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -123,9 +123,11 @@ static target_ulong h_resize_hpt_prepare(PowerPCCPU *cpu,
 
     if (kvm_enabled()) {
         return H_HARDWARE;
+    } else if (tcg_enabled()) {
+        return softmmu_resize_hpt_prepare(cpu, spapr, shift);
+    } else {
+        g_assert_not_reached();
     }
-
-    return softmmu_resize_hpt_prepare(cpu, spapr, shift);
 }
 
 static void do_push_sregs_to_kvm_pr(CPUState *cs, run_on_cpu_data data)
@@ -191,9 +193,11 @@ static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu,
 
     if (kvm_enabled()) {
         return H_HARDWARE;
+    } else if (tcg_enabled()) {
+        return softmmu_resize_hpt_commit(cpu, spapr, flags, shift);
+    } else {
+        g_assert_not_reached();
     }
-
-    return softmmu_resize_hpt_commit(cpu, spapr, flags, shift);
 }
 
 
diff --git a/target/ppc/tcg-stub.c b/target/ppc/tcg-stub.c
index aadcf59d26..740d796b98 100644
--- a/target/ppc/tcg-stub.c
+++ b/target/ppc/tcg-stub.c
@@ -28,18 +28,3 @@ void create_ppc_opcodes(PowerPCCPU *cpu, Error **errp)
 void destroy_ppc_opcodes(PowerPCCPU *cpu)
 {
 }
-
-target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu,
-                                        SpaprMachineState *spapr,
-                                        target_ulong shift)
-{
-    g_assert_not_reached();
-}
-
-target_ulong softmmu_resize_hpt_commit(PowerPCCPU *cpu,
-                                       SpaprMachineState *spapr,
-                                       target_ulong flags,
-                                       target_ulong shift)
-{
-    g_assert_not_reached();
-}
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 3/4] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr
  2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 1/4] hw/ppc/spapr: Add missing license Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 2/4] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep Nicholas Piggin
@ 2024-01-18 13:32 ` Nicholas Piggin
  2024-01-18 13:32 ` [PATCH v2 4/4] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu' Nicholas Piggin
  2024-01-18 15:16 ` [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-01-18 13:32 UTC (permalink / raw)
  To: qemu-ppc
  Cc: Nicholas Piggin, David Gibson, Harsh Prateek Bora,
	Daniel Henrique Barboza, Cédric Le Goater,
	Philippe Mathieu-Daudé, qemu-devel

From: Philippe Mathieu-Daudé <philmd@linaro.org>

Since 'softmmu' is quite a loaded term in QEMU, rename the vhyp MMU
facilities to use the vhyp_mmu_ prefix rather than softmmu_.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[npiggin: Pick a different name.]
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 include/hw/ppc/spapr.h | 9 ++++++---
 hw/ppc/spapr_hcall.c   | 4 ++--
 hw/ppc/spapr_softmmu.c | 4 ++--
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h
index e91791a1a9..5b5ba9ef77 100644
--- a/include/hw/ppc/spapr.h
+++ b/include/hw/ppc/spapr.h
@@ -634,10 +634,13 @@ void spapr_register_hypercall(target_ulong opcode, spapr_hcall_fn fn);
 target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode,
                              target_ulong *args);
 
-target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu, SpaprMachineState *spapr,
+target_ulong vhyp_mmu_resize_hpt_prepare(PowerPCCPU *cpu,
+                                         SpaprMachineState *spapr,
                                          target_ulong shift);
-target_ulong softmmu_resize_hpt_commit(PowerPCCPU *cpu, SpaprMachineState *spapr,
-                                        target_ulong flags, target_ulong shift);
+target_ulong vhyp_mmu_resize_hpt_commit(PowerPCCPU *cpu,
+                                        SpaprMachineState *spapr,
+                                        target_ulong flags,
+                                        target_ulong shift);
 bool is_ram_address(SpaprMachineState *spapr, hwaddr addr);
 void push_sregs_to_kvm_pr(SpaprMachineState *spapr);
 
diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c
index 0d7d523e6d..75c2d12978 100644
--- a/hw/ppc/spapr_hcall.c
+++ b/hw/ppc/spapr_hcall.c
@@ -124,7 +124,7 @@ static target_ulong h_resize_hpt_prepare(PowerPCCPU *cpu,
     if (kvm_enabled()) {
         return H_HARDWARE;
     } else if (tcg_enabled()) {
-        return softmmu_resize_hpt_prepare(cpu, spapr, shift);
+        return vhyp_mmu_resize_hpt_prepare(cpu, spapr, shift);
     } else {
         g_assert_not_reached();
     }
@@ -194,7 +194,7 @@ static target_ulong h_resize_hpt_commit(PowerPCCPU *cpu,
     if (kvm_enabled()) {
         return H_HARDWARE;
     } else if (tcg_enabled()) {
-        return softmmu_resize_hpt_commit(cpu, spapr, flags, shift);
+        return vhyp_mmu_resize_hpt_commit(cpu, spapr, flags, shift);
     } else {
         g_assert_not_reached();
     }
diff --git a/hw/ppc/spapr_softmmu.c b/hw/ppc/spapr_softmmu.c
index 2fade94029..b3dd8b3a59 100644
--- a/hw/ppc/spapr_softmmu.c
+++ b/hw/ppc/spapr_softmmu.c
@@ -378,7 +378,7 @@ static void cancel_hpt_prepare(SpaprMachineState *spapr)
     free_pending_hpt(pending);
 }
 
-target_ulong softmmu_resize_hpt_prepare(PowerPCCPU *cpu,
+target_ulong vhyp_mmu_resize_hpt_prepare(PowerPCCPU *cpu,
                                          SpaprMachineState *spapr,
                                          target_ulong shift)
 {
@@ -562,7 +562,7 @@ static int rehash_hpt(PowerPCCPU *cpu,
     return H_SUCCESS;
 }
 
-target_ulong softmmu_resize_hpt_commit(PowerPCCPU *cpu,
+target_ulong vhyp_mmu_resize_hpt_commit(PowerPCCPU *cpu,
                                         SpaprMachineState *spapr,
                                         target_ulong flags,
                                         target_ulong shift)
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu'
  2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
                   ` (2 preceding siblings ...)
  2024-01-18 13:32 ` [PATCH v2 3/4] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr Nicholas Piggin
@ 2024-01-18 13:32 ` Nicholas Piggin
  2024-01-18 15:16 ` [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2024-01-18 13:32 UTC (permalink / raw)
  To: qemu-ppc
  Cc: Nicholas Piggin, David Gibson, Harsh Prateek Bora,
	Daniel Henrique Barboza, Cédric Le Goater,
	Philippe Mathieu-Daudé, qemu-devel

From: Philippe Mathieu-Daudé <philmd@linaro.org>

In the spirit of reducing use of the term 'softmmu', rename
spapr_softmmu.c to spapr_vhyp_mmu.c.

Logically, the TLB loading code that walks the hash table is the
implementation of the ppc hash MMU, and the code that manipulates
the hash table is the implementation of the PAPR hypervisor
interface (called vhyp).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
[npiggin: Pick a different name, explain it in changelog.]
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 hw/ppc/{spapr_softmmu.c => spapr_vhyp_mmu.c} | 0
 hw/ppc/meson.build                           | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)
 rename hw/ppc/{spapr_softmmu.c => spapr_vhyp_mmu.c} (100%)

diff --git a/hw/ppc/spapr_softmmu.c b/hw/ppc/spapr_vhyp_mmu.c
similarity index 100%
rename from hw/ppc/spapr_softmmu.c
rename to hw/ppc/spapr_vhyp_mmu.c
diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build
index eba3406e7f..30bd2aaccf 100644
--- a/hw/ppc/meson.build
+++ b/hw/ppc/meson.build
@@ -31,7 +31,7 @@ ppc_ss.add(when: 'CONFIG_PSERIES', if_true: files(
   'pef.c',
 ))
 ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_TCG'], if_true: files(
-  'spapr_softmmu.c',
+  'spapr_vhyp_mmu.c',
 ))
 ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c'))
 if host_os == 'linux'
-- 
2.42.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu'
  2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
                   ` (3 preceding siblings ...)
  2024-01-18 13:32 ` [PATCH v2 4/4] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu' Nicholas Piggin
@ 2024-01-18 15:16 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-01-18 15:16 UTC (permalink / raw)
  To: Nicholas Piggin, qemu-ppc
  Cc: David Gibson, Harsh Prateek Bora, Daniel Henrique Barboza,
	Cédric Le Goater, qemu-devel

On 18/1/24 14:32, Nicholas Piggin wrote:
> I grabbed Philippe's series series and tried to use a more
> agreeable name. Further disagreement is okay, but must come
> with a better alternative :) would be good to get this out of
> the way. I actually don't think softmmu is a great term for it
> either even in isolation, so would be good to move away from it.

Eh thanks for the respin Nicholas! I'm happy with the new name :)

Series:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-18 15:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-18 13:32 [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Nicholas Piggin
2024-01-18 13:32 ` [PATCH v2 1/4] hw/ppc/spapr: Add missing license Nicholas Piggin
2024-01-18 13:32 ` [PATCH v2 2/4] hw/ppc/spapr_hcall: Allow elision of softmmu_resize_hpt_prep Nicholas Piggin
2024-01-18 13:32 ` [PATCH v2 3/4] hw/ppc/spapr_hcall: Rename {softmmu -> vhyp_mmu}_resize_hpt_pr Nicholas Piggin
2024-01-18 13:32 ` [PATCH v2 4/4] hw/ppc/spapr: Rename 'softmmu' -> 'vhyp_mmu' Nicholas Piggin
2024-01-18 15:16 ` [PATCH v2 0/4] hw/ppc/spapr: Rename 'softmmu' Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).