All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Remove useless architecture prefix from the CPU list
@ 2024-04-20  5:46 Thomas Huth
  2024-04-20  5:46 ` [PATCH 1/3] target/i386/cpu: Remove "x86" " Thomas Huth
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Thomas Huth @ 2024-04-20  5:46 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, Richard Henderson, qemu-trivial

Printing an architecture prefix in front of each CPU name is not helpful
at all: It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and it also
takes some precious space in the dense output of the CPU entries. Let's
simply remove those now.

Thomas Huth (3):
  target/i386/cpu: Remove "x86" prefix from the CPU list
  target/s390x/cpu_models: Rework the output of "-cpu help"
  target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list

 target/i386/cpu.c         | 2 +-
 target/ppc/cpu_init.c     | 9 +++++----
 target/s390x/cpu_models.c | 9 +++++----
 3 files changed, 11 insertions(+), 9 deletions(-)

-- 
2.44.0



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

* [PATCH 1/3] target/i386/cpu: Remove "x86" prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
@ 2024-04-20  5:46 ` Thomas Huth
  2024-04-20  5:46 ` [PATCH 2/3] target/s390x/cpu_models: Rework the output of "-cpu help" Thomas Huth
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-04-20  5:46 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, Richard Henderson, qemu-trivial

Printing an "x86" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now and use two spaces at the
beginning of the lines for the indentation of the entries instead,
like most other target architectures are doing it for their CPU help
output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 33760a2ee1..fd46e264a2 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5572,7 +5572,7 @@ static void x86_cpu_list_entry(gpointer data, gpointer user_data)
         desc = g_strdup_printf("%s (deprecated)", olddesc);
     }
 
-    qemu_printf("x86 %-20s  %s\n", name, desc);
+    qemu_printf("  %-20s  %s\n", name, desc);
 }
 
 /* list available CPU models and flags */
-- 
2.44.0



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

* [PATCH 2/3] target/s390x/cpu_models: Rework the output of "-cpu help"
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
  2024-04-20  5:46 ` [PATCH 1/3] target/i386/cpu: Remove "x86" " Thomas Huth
@ 2024-04-20  5:46 ` Thomas Huth
  2024-04-20  5:46 ` [PATCH 3/3] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Thomas Huth
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-04-20  5:46 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, Richard Henderson, qemu-trivial

Printing an "s390x" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now!

While we're at it, use two spaces at the beginning of the lines for
the indentation of the entries, and add a "Available CPUs" in the
very first line, like most other target architectures are doing it
for their "-cpu help" output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/s390x/cpu_models.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 8ed3bb6a27..58c58f05a0 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -355,9 +355,9 @@ static void s390_print_cpu_model_list_entry(gpointer data, gpointer user_data)
     /* strip off the -s390x-cpu */
     g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0;
     if (details->len) {
-        qemu_printf("s390 %-15s %-35s (%s)\n", name, scc->desc, details->str);
+        qemu_printf("  %-15s %-35s (%s)\n", name, scc->desc, details->str);
     } else {
-        qemu_printf("s390 %-15s %-35s\n", name, scc->desc);
+        qemu_printf("  %-15s %-35s\n", name, scc->desc);
     }
     g_free(name);
 }
@@ -402,6 +402,7 @@ void s390_cpu_list(void)
     S390Feat feat;
     GSList *list;
 
+    qemu_printf("Available CPUs:\n");
     list = object_class_get_list(TYPE_S390_CPU, false);
     list = g_slist_sort(list, s390_cpu_list_compare);
     g_slist_foreach(list, s390_print_cpu_model_list_entry, NULL);
@@ -411,14 +412,14 @@ void s390_cpu_list(void)
     for (feat = 0; feat < S390_FEAT_MAX; feat++) {
         const S390FeatDef *def = s390_feat_def(feat);
 
-        qemu_printf("%-20s %s\n", def->name, def->desc);
+        qemu_printf("  %-20s %s\n", def->name, def->desc);
     }
 
     qemu_printf("\nRecognized feature groups:\n");
     for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
         const S390FeatGroupDef *def = s390_feat_group_def(group);
 
-        qemu_printf("%-20s %s\n", def->name, def->desc);
+        qemu_printf("  %-20s %s\n", def->name, def->desc);
     }
 }
 
-- 
2.44.0



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

* [PATCH 3/3] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
  2024-04-20  5:46 ` [PATCH 1/3] target/i386/cpu: Remove "x86" " Thomas Huth
  2024-04-20  5:46 ` [PATCH 2/3] target/s390x/cpu_models: Rework the output of "-cpu help" Thomas Huth
@ 2024-04-20  5:46 ` Thomas Huth
  2024-04-20 14:40 ` [PATCH 0/3] Remove useless architecture " David Hildenbrand
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Thomas Huth @ 2024-04-20  5:46 UTC (permalink / raw)
  To: qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, Richard Henderson, qemu-trivial

Printing a "PowerPC" in front of each CPU name is not helpful at all:
It is confusing for the users since they don't know whether they
have to specify these letters for the "-cpu" parameter, too, and
it also takes some precious space in the dense output of the CPU
entries. Let's simply remove this now and use two spaces at the
beginning of the lines for the indentation of the entries instead,
and add a "Available CPUs" in the very first line, like most other
target architectures are doing it for their CPU help output already.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 target/ppc/cpu_init.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index 6241de62ce..8b932dccfb 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -7063,7 +7063,7 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
     }
 
     name = cpu_model_from_type(typename);
-    qemu_printf("PowerPC %-16s PVR %08x\n", name, pcc->pvr);
+    qemu_printf("  %-16s PVR %08x\n", name, pcc->pvr);
     for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) {
         PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
         ObjectClass *alias_oc = ppc_cpu_class_by_name(alias->model);
@@ -7076,10 +7076,10 @@ static void ppc_cpu_list_entry(gpointer data, gpointer user_data)
          * avoid printing the wrong alias here and use "preferred" instead
          */
         if (strcmp(alias->alias, family->desc) == 0) {
-            qemu_printf("PowerPC %-16s (alias for preferred %s CPU)\n",
+            qemu_printf("  %-16s (alias for preferred %s CPU)\n",
                         alias->alias, family->desc);
         } else {
-            qemu_printf("PowerPC %-16s (alias for %s)\n",
+            qemu_printf("  %-16s (alias for %s)\n",
                         alias->alias, name);
         }
     }
@@ -7090,6 +7090,7 @@ void ppc_cpu_list(void)
 {
     GSList *list;
 
+    qemu_printf("Available CPUs:\n");
     list = object_class_get_list(TYPE_POWERPC_CPU, false);
     list = g_slist_sort(list, ppc_cpu_list_compare);
     g_slist_foreach(list, ppc_cpu_list_entry, NULL);
@@ -7097,7 +7098,7 @@ void ppc_cpu_list(void)
 
 #ifdef CONFIG_KVM
     qemu_printf("\n");
-    qemu_printf("PowerPC %s\n", "host");
+    qemu_printf("  %s\n", "host");
 #endif
 }
 
-- 
2.44.0



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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
                   ` (2 preceding siblings ...)
  2024-04-20  5:46 ` [PATCH 3/3] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Thomas Huth
@ 2024-04-20 14:40 ` David Hildenbrand
  2024-04-20 16:26 ` Richard Henderson
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: David Hildenbrand @ 2024-04-20 14:40 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	Richard Henderson, qemu-trivial

On 20.04.24 07:46, Thomas Huth wrote:
> Printing an architecture prefix in front of each CPU name is not helpful
> at all: It is confusing for the users since they don't know whether they
> have to specify these letters for the "-cpu" parameter, too, and it also
> takes some precious space in the dense output of the CPU entries. Let's
> simply remove those now.

Yes, I also never really understood the purpose.

-- 
Cheers,

David / dhildenb



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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
                   ` (3 preceding siblings ...)
  2024-04-20 14:40 ` [PATCH 0/3] Remove useless architecture " David Hildenbrand
@ 2024-04-20 16:26 ` Richard Henderson
  2024-04-20 16:53 ` Michael Tokarev
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Richard Henderson @ 2024-04-20 16:26 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, qemu-trivial

On 4/19/24 22:46, Thomas Huth wrote:
> Thomas Huth (3):
>    target/i386/cpu: Remove "x86" prefix from the CPU list
>    target/s390x/cpu_models: Rework the output of "-cpu help"
>    target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
                   ` (4 preceding siblings ...)
  2024-04-20 16:26 ` Richard Henderson
@ 2024-04-20 16:53 ` Michael Tokarev
  2024-04-22  8:03 ` Daniel P. Berrangé
  2024-04-26  9:13 ` Mario Casquero
  7 siblings, 0 replies; 11+ messages in thread
From: Michael Tokarev @ 2024-04-20 16:53 UTC (permalink / raw)
  To: Thomas Huth, qemu-devel, Paolo Bonzini
  Cc: qemu-ppc, qemu-s390x, Nicholas Piggin, Daniel Henrique Barboza,
	David Hildenbrand, Richard Henderson, qemu-trivial

20.04.2024 08:46, Thomas Huth:
> Printing an architecture prefix in front of each CPU name is not helpful
> at all: It is confusing for the users since they don't know whether they
> have to specify these letters for the "-cpu" parameter, too, and it also
> takes some precious space in the dense output of the CPU entries. Let's
> simply remove those now.
> 
> Thomas Huth (3):
>    target/i386/cpu: Remove "x86" prefix from the CPU list
>    target/s390x/cpu_models: Rework the output of "-cpu help"
>    target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list

Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>

I'll pick it up for trivial-patches after 9.0 is out.

This also reminded me about https://gitlab.com/qemu-project/qemu/-/issues/2141

/mjt


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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
                   ` (5 preceding siblings ...)
  2024-04-20 16:53 ` Michael Tokarev
@ 2024-04-22  8:03 ` Daniel P. Berrangé
  2024-04-22  8:22   ` Thomas Huth
  2024-04-26  9:13 ` Mario Casquero
  7 siblings, 1 reply; 11+ messages in thread
From: Daniel P. Berrangé @ 2024-04-22  8:03 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, Paolo Bonzini, qemu-ppc, qemu-s390x, Nicholas Piggin,
	Daniel Henrique Barboza, David Hildenbrand, Richard Henderson,
	qemu-trivial

On Sat, Apr 20, 2024 at 07:46:03AM +0200, Thomas Huth wrote:
> Printing an architecture prefix in front of each CPU name is not helpful
> at all: It is confusing for the users since they don't know whether they
> have to specify these letters for the "-cpu" parameter, too, and it also
> takes some precious space in the dense output of the CPU entries. Let's
> simply remove those now.

Could it be said that this arch prefix is about to finally become useful
with Philippe's patches to add a 'qemu-system-any' command covering
multiple arches ?

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-22  8:03 ` Daniel P. Berrangé
@ 2024-04-22  8:22   ` Thomas Huth
  2024-04-29 10:26     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 11+ messages in thread
From: Thomas Huth @ 2024-04-22  8:22 UTC (permalink / raw)
  To: Daniel P. Berrangé
  Cc: qemu-devel, Paolo Bonzini, qemu-ppc, qemu-s390x, Nicholas Piggin,
	Daniel Henrique Barboza, David Hildenbrand, Richard Henderson,
	qemu-trivial

On 22/04/2024 10.03, Daniel P. Berrangé wrote:
> On Sat, Apr 20, 2024 at 07:46:03AM +0200, Thomas Huth wrote:
>> Printing an architecture prefix in front of each CPU name is not helpful
>> at all: It is confusing for the users since they don't know whether they
>> have to specify these letters for the "-cpu" parameter, too, and it also
>> takes some precious space in the dense output of the CPU entries. Let's
>> simply remove those now.
> 
> Could it be said that this arch prefix is about to finally become useful
> with Philippe's patches to add a 'qemu-system-any' command covering
> multiple arches ?

I don't think so: In that case we'd rather print it once at the beginning of 
a list ("Available x86 CPUs:") instead of printing it in each and every line.

  Thomas




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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
                   ` (6 preceding siblings ...)
  2024-04-22  8:03 ` Daniel P. Berrangé
@ 2024-04-26  9:13 ` Mario Casquero
  7 siblings, 0 replies; 11+ messages in thread
From: Mario Casquero @ 2024-04-26  9:13 UTC (permalink / raw)
  To: Thomas Huth
  Cc: qemu-devel, Paolo Bonzini, qemu-ppc, qemu-s390x, Nicholas Piggin,
	Daniel Henrique Barboza, David Hildenbrand, Richard Henderson,
	qemu-trivial

This series has been successfully tested in x86. Execute the cpu help
command and check in the list the x86 prefix is no longer present.

Tested-by: Mario Casquero <mcasquer@redhat.com>

On Sat, Apr 20, 2024 at 7:47 AM Thomas Huth <thuth@redhat.com> wrote:
>
> Printing an architecture prefix in front of each CPU name is not helpful
> at all: It is confusing for the users since they don't know whether they
> have to specify these letters for the "-cpu" parameter, too, and it also
> takes some precious space in the dense output of the CPU entries. Let's
> simply remove those now.
>
> Thomas Huth (3):
>   target/i386/cpu: Remove "x86" prefix from the CPU list
>   target/s390x/cpu_models: Rework the output of "-cpu help"
>   target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list
>
>  target/i386/cpu.c         | 2 +-
>  target/ppc/cpu_init.c     | 9 +++++----
>  target/s390x/cpu_models.c | 9 +++++----
>  3 files changed, 11 insertions(+), 9 deletions(-)
>
> --
> 2.44.0
>
>



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

* Re: [PATCH 0/3] Remove useless architecture prefix from the CPU list
  2024-04-22  8:22   ` Thomas Huth
@ 2024-04-29 10:26     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 11+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-04-29 10:26 UTC (permalink / raw)
  To: Thomas Huth, Daniel P. Berrangé
  Cc: qemu-devel, Paolo Bonzini, qemu-ppc, qemu-s390x, Nicholas Piggin,
	Daniel Henrique Barboza, David Hildenbrand, Richard Henderson,
	qemu-trivial

On 22/4/24 10:22, Thomas Huth wrote:
> On 22/04/2024 10.03, Daniel P. Berrangé wrote:
>> On Sat, Apr 20, 2024 at 07:46:03AM +0200, Thomas Huth wrote:
>>> Printing an architecture prefix in front of each CPU name is not helpful
>>> at all: It is confusing for the users since they don't know whether they
>>> have to specify these letters for the "-cpu" parameter, too, and it also
>>> takes some precious space in the dense output of the CPU entries. Let's
>>> simply remove those now.
>>
>> Could it be said that this arch prefix is about to finally become useful
>> with Philippe's patches to add a 'qemu-system-any' command covering
>> multiple arches ?
> 
> I don't think so: In that case we'd rather print it once at the 
> beginning of a list ("Available x86 CPUs:") instead of printing it in 
> each and every line.

Yes that is correct. Hopefully we won't have the same CPU name used
by different architectures...

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



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

end of thread, other threads:[~2024-04-29 10:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-20  5:46 [PATCH 0/3] Remove useless architecture prefix from the CPU list Thomas Huth
2024-04-20  5:46 ` [PATCH 1/3] target/i386/cpu: Remove "x86" " Thomas Huth
2024-04-20  5:46 ` [PATCH 2/3] target/s390x/cpu_models: Rework the output of "-cpu help" Thomas Huth
2024-04-20  5:46 ` [PATCH 3/3] target/ppc/cpu_init: Remove "PowerPC" prefix from the CPU list Thomas Huth
2024-04-20 14:40 ` [PATCH 0/3] Remove useless architecture " David Hildenbrand
2024-04-20 16:26 ` Richard Henderson
2024-04-20 16:53 ` Michael Tokarev
2024-04-22  8:03 ` Daniel P. Berrangé
2024-04-22  8:22   ` Thomas Huth
2024-04-29 10:26     ` Philippe Mathieu-Daudé
2024-04-26  9:13 ` Mario Casquero

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.