Skip to contentSkip to conversation

qemu-options: Add documentation about PPC64's "-cpu compat" option

PATCH Applied Alexey Kardashevskiy 3 participants 11 messages Apr 2, 2015 – Apr 29, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-options: Add documentation about PPC64's "-cpu compat" option

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
 qemu-options.hx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
qemu-options.hx +10 -1
index c513352..bd15214 100644
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)
 STEXI
 @item -cpu @var{model}
 @findex -cpu
 Select CPU model (@code{-cpu help} for list and additional feature selection)
+@table @option
+@item compat=power6|power7|power8
+(PPC64 only)
+Enables architecture compatibility mode. "power6" enables PowerISA 2.05,
+"power7" - 2.06, "power8" - 2.07.
+@end table
 ETEXI
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
Signature · 1 line
2.0.0
#1 lore raw
Quoted 15 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
  qemu-options.hx | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
qemu-options.hx +0 -0
index c513352..bd15214 100644

qemu-options.hx HXCOMM Deprecated by -machine · line 90

Quoted 8 lines
qemu-options.hx +4 -1
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
  DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 
  DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)

Shouldn't there be a way to show this only for the ppc64 target?

Alex

Quoted 13 lines
qemu-options.hx +6 -0
  STEXI
  @item -cpu @var{model}
  @findex -cpu
  Select CPU model (@code{-cpu help} for list and additional feature selection)
+@table @option
+@item compat=power6|power7|power8
+(PPC64 only)
+Enables architecture compatibility mode. "power6" enables PowerISA 2.05,
+"power7" - 2.06, "power8" - 2.07.
+@end table
  ETEXI
 
  DEF("smp", HAS_ARG, QEMU_OPTION_smp,
#2 lore raw
Quoted 11 lines · Alexander Graf
Quoted 10 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
  qemu-options.hx | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 14 lines

qemu-options.hx HXCOMM Deprecated by -machine · line 89

Quoted 12 lines
qemu-options.hx +4 -1
index c513352..bd15214 100644
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
  DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
  DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)

Shouldn't there be a way to show this only for the ppc64 target?

I do not really know, I did not dig deep. I just saw "Intel IOMMU (VT-d)" in "qemu-system-ppc64 --help" output and concluded there is no easy way.

Quoted 18 lines

Alex

Quoted 13 lines
qemu-options.hx +6 -0
  STEXI
  @item -cpu @var{model}
  @findex -cpu
  Select CPU model (@code{-cpu help} for list and additional feature
 selection)
+@table @option
+@item compat=power6|power7|power8
+(PPC64 only)
+Enables architecture compatibility mode. "power6" enables PowerISA 2.05,
+"power7" - 2.06, "power8" - 2.07.
+@end table
  ETEXI
  DEF("smp", HAS_ARG, QEMU_OPTION_smp,
Signature · 1 line
Alexey
#3 lore raw
Quoted 33 lines

Am 08.04.2015 um 03:45 schrieb Alexey Kardashevskiy <[email protected]>:

Quoted 12 lines · Alexander Graf
Quoted 11 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
 qemu-options.hx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 14 lines

qemu-options.hx HXCOMM Deprecated by -machine · line 89

Quoted 12 lines
qemu-options.hx +4 -1
index c513352..bd15214 100644
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)

Shouldn't there be a way to show this only for the ppc64 target?

Quoted 1 line

I do not really know, I did not dig deep. I just saw "Intel IOMMU (VT-d)" in "qemu-system-ppc64 --help" output and concluded there is no easy way.

Please dig again :).

Alex

#4 lore raw
Quoted 33 lines · Alexander Graf
Quoted 33 lines

Am 08.04.2015 um 03:45 schrieb Alexey Kardashevskiy <[email protected]>:

Quoted 26 lines · Alexander Graf
Quoted 16 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
  qemu-options.hx | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
qemu-options.hx +0 -0
index c513352..bd15214 100644

qemu-options.hx HXCOMM Deprecated by -machine · line 89

Quoted 7 lines
qemu-options.hx +4 -1
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
  DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
  DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)

Shouldn't there be a way to show this only for the ppc64 target?

Quoted 3 lines
Quoted 1 line

I do not really know, I did not dig deep. I just saw "Intel IOMMU (VT-d)" in "qemu-system-ppc64 --help" output and concluded there is no easy way.

Please dig again :).

Ok. I did. I can do as below. QEMU shows different things on "-help" on PPC and x86_64. But qemu-doc.html has 2 entries for "-cpu" and it does not mention architecture per "-cpu" instance there (unless I keep the original "(PPC64 only)" which I find rather ugly):

===
-cpu model
Select CPU model (-cpu help for list and additional feature
selection)

-cpu model
Select CPU model (-cpu help for list and additional feature
selection)

compat=power6|power7|power8
Enables architecture compatibility mode. "power6" enables
PowerISA 2.05, "power7" - 2.06, "power8" - 2.07.

====

For the sake of a nice looking html, I would stick to the original patch but since you seem to know this stuff better, any help is very appreciated :)

qemu-options.hx +18 -1
index c513352..428359a 100644
@@ -84,13 +84,30 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu        select CPU ('-cpu help' for list)\n",
+            QEMU_ARCH_ALL & ~QEMU_ARCH_PPC)
 STEXI
 @item -cpu @var{model}
 @findex -cpu
 Select CPU model (@code{-cpu help} for list and additional feature selection)
 ETEXI
 
+DEF("cpu", HAS_ARG, QEMU_OPTION_cpu_ppc,
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode\n",
+        QEMU_ARCH_PPC)
+STEXI
+@item -cpu @var{model}
+@findex -cpu
+Select CPU model (@code{-cpu help} for list and additional feature selection)
+@table @option
+@item compat=power6|power7|power8
+Enables architecture compatibility mode. "power6" enables PowerISA 2.05,
+"power7" - 2.06, "power8" - 2.07.
+@end table
+ETEXI
+
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
     "-smp 

[cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
" set the number of CPUs to 'n' [default=1]\n"

Signature · 1 line
Alexey
#5 lore raw
Quoted 39 lines

Am 08.04.2015 um 09:41 schrieb Alexey Kardashevskiy <[email protected]>:

Quoted 34 lines · Alexander Graf
Quoted 33 lines
Quoted 31 lines

Am 08.04.2015 um 03:45 schrieb Alexey Kardashevskiy <[email protected]>:

Quoted 17 lines · Alexander Graf

On 04/02/2015 08:26 AM, Alexey Kardashevskiy wrote:
Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---
 qemu-options.hx | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
qemu-options.hx +0 -0
index c513352..bd15214 100644

qemu-options.hx HXCOMM Deprecated by -machine · line 89

Quoted 7 lines
qemu-options.hx +4 -1
@@ -84,11 +84,20 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode (PPC64 only)\n",
+        QEMU_ARCH_ALL)

Shouldn't there be a way to show this only for the ppc64 target?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

I do not really know, I did not dig deep. I just saw "Intel IOMMU (VT-d)" in "qemu-system-ppc64 --help" output and concluded there is no easy way.

Please dig again :).

Ok. I did. I can do as below. QEMU shows different things on "-help" on PPC and x86_64. But qemu-doc.html has 2 entries for "-cpu" and it does not mention architecture per "-cpu" instance there (unless I keep the original "(PPC64 only)" which I find rather ugly):

Can you find some way to only extend the arch_all message with a ppc specific def? Maybe restructure the layout?

Alex

Quoted 60 lines

===
-cpu model
Select CPU model (-cpu help for list and additional feature selection)

-cpu model
Select CPU model (-cpu help for list and additional feature selection)

compat=power6|power7|power8
Enables architecture compatibility mode. "power6" enables PowerISA 2.05, "power7" - 2.06, "power8" - 2.07.

====

For the sake of a nice looking html, I would stick to the original patch but since you seem to know this stuff better, any help is very appreciated :)

qemu-options.hx +2 -1
index c513352..428359a 100644
@@ -84,13 +84,30 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu        select CPU ('-cpu help' for list)\n",
+            QEMU_ARCH_ALL & ~QEMU_ARCH_PPC)

STEXI
@item -cpu @var{model}
@findex -cpu
Select CPU model (@code{-cpu help} for list and additional feature selection) ETEXI

qemu-options.hx +16 -0
+DEF("cpu", HAS_ARG, QEMU_OPTION_cpu_ppc,
+    "-cpu cpu,[compat=MODE]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode\n",
+        QEMU_ARCH_PPC)
+STEXI
+@item -cpu @var{model}
+@findex -cpu
+Select CPU model (@code{-cpu help} for list and additional feature selection)
+@table @option
+@item compat=power6|power7|power8
+Enables architecture compatibility mode. "power6" enables PowerISA 2.05,
+"power7" - 2.06, "power8" - 2.07.
+@end table
+ETEXI
+

DEF("smp", HAS_ARG, QEMU_OPTION_smp,
"-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]\n"
" set the number of CPUs to 'n' [default=1]\n"

Signature · 1 line
Alexey
#6 lore raw

PATCH v2 1/1 qemu-options: Add documentation about PPC64's "-cpu compat" option

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

---

After the patch:

[aik@vpl2 ~]$ ./qemu-system-ppc64 --help | grep -a2 -- "-cpu cpu" -cpu cpu[,compat=power6|power7|power8]
select CPU ('-cpu help' for list) compat= processor compatibility mode

ka1:/scratch/alexey/p/qemu-build/x86_x86_64$ ./x86_64-softmmu/qemu-system-x86_64 -help | grep -a2 -- "-cpu cpu"
-cpu cpu        select CPU ('-cpu help' for list)
-smp [cpus=]n[,maxcpus=cpus][,cores=cores][,threads=threads][,sockets=sockets]
                set the number of CPUs to 'n' [default=1]

qemu-doc.html:

-cpu model[,compat=mode]
Select CPU model (-cpu help for list and additional feature selection)

compat=power6|power7|power8
Enables POWER architecture compatibility mode. ‘power6’ enables PowerISA 2.05-compatibility mode, ‘power7’ - 2.06, ‘power8’ - 2.07. ‘mode’ is only supported by a PPC64-pseries machine.

---
Changes:
v2:
* only show new option for PPC

---
 qemu-options.hx | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
qemu-options.hx +13 -2
index c513352..5214798 100644
@@ -84,11 +84,22 @@ HXCOMM Deprecated by -machine
 DEF("M", HAS_ARG, QEMU_OPTION_M, "", QEMU_ARCH_ALL)
 
 DEF("cpu", HAS_ARG, QEMU_OPTION_cpu,
-    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL)
+    "-cpu cpu        select CPU ('-cpu help' for list)\n", QEMU_ARCH_ALL & ~QEMU_ARCH_PPC)
+DEF("cpu", HAS_ARG, QEMU_OPTION_cpu_ppc,
+    "-cpu cpu[,compat=power6|power7|power8]\n"
+    "                select CPU ('-cpu help' for list)\n"
+    "                compat= processor compatibility mode\n", QEMU_ARCH_PPC)
 STEXI
-@item -cpu @var{model}
+@item -cpu @var{model}[,compat=@var{mode}]
 @findex -cpu
 Select CPU model (@code{-cpu help} for list and additional feature selection)
+@table @option
+@item compat=power6|power7|power8
+Enables POWER architecture compatibility mode.
+@samp{power6} enables PowerISA 2.05-compatibility mode,
+@samp{power7} - 2.06, @samp{power8} - 2.07. @samp{mode} is only supported by
+a PPC64-pseries machine.
+@end table
 ETEXI
 
 DEF("smp", HAS_ARG, QEMU_OPTION_smp,
Signature · 1 line
2.0.0
#7 lore raw
Quoted 6 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

I've updated the previous version in spapr-next.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
#8 lore raw
Quoted 9 lines · David Gibson
Quoted 6 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

I've updated the previous version in spapr-next.

That was bad idea.

First of all this patch is missing this:

vl.c +1 -0
index 694deb4..12ffa1c 100644
@@ -2876,6 +2876,7 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_cpu:
+            case QEMU_OPTION_cpu_ppc:
                 /* hw initialization will check this */
                 cpu_model = optarg;
                 break;

But even with it, "-cpu help" does not work as the "if (!(popt->arch_mask & arch_type))" fails at vl.c:2868 because QEMU_OPTION_cpu does not have PPC64bit set (in order to hide unwanted options on x86) and QEMU_OPTION_cpu_ppc is not "-cpu".

We should use the original patch or none at all.

Signature · 1 line
Alexey
#9 lore raw
Quoted 29 lines · Alexey Kardashevskiy
Quoted 9 lines · David Gibson
Quoted 6 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

I've updated the previous version in spapr-next.

That was bad idea.

First of all this patch is missing this:

vl.c +1 -0
index 694deb4..12ffa1c 100644
@@ -2876,6 +2876,7 @@ int main(int argc, char **argv, char **envp)
                 break;
             }
             case QEMU_OPTION_cpu:
+            case QEMU_OPTION_cpu_ppc:
                 /* hw initialization will check this */
                 cpu_model = optarg;
                 break;
Quoted 6 lines

But even with it, "-cpu help" does not work as the "if (!(popt->arch_mask & arch_type))" fails at vl.c:2868 because QEMU_OPTION_cpu does not have PPC64bit set (in order to hide unwanted options on x86) and QEMU_OPTION_cpu_ppc is not "-cpu".

We should use the original patch or none at all.

Ok, I've dropped this from spapr-next for the time being.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson
Acked-by on v1 1/1 Applied
#10 lore raw
In reply to Alexey Kardashevskiy
Quoted 6 lines · Alexey Kardashevskiy

Since 8dfa3a5e "target-ppc: Add "compat" CPU option" (which was a part of client-architecture-support patchset) there is a "compat" option of "-cpu". However it was not documented at all and this is what this patch is trying to do.

Merged into my spapr-next branch.

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson