Skip to contentSkip to conversation

qemu-cpu-models: Convert to rST; document other MSR bits

PATCH Superseded Kashyap Chamarthy 4 participants 10 messages Feb 20, 2020 – Feb 25, 2020 Kbuild

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover qemu-cpu-models: Convert to rST; document other MSR bits

In v3:
- Address the comments from Peter Maydell, from here:
https://lists.nongnu.org/archive/html/qemu-devel/2020-02/msg05155.html

This small series does two things:

(1) Convert the original qemu-cpu-models.texi to rST

(2) In a separate patch, incorporate the additional new content from this:
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg06455.html
([PATCH v3] qemu-cpu-models: Document -noTSX, mds-no, taa-no, and tsx-ctrl)

Sphinx rendering of the converted doc is here:

    https://kashyapc.fedorapeople.org/QEMU_v4.2.0-1301-gb082353c5e_docs/system/qemu-cpu-models.html

Kashyap Chamarthy (2):
docs: Convert qemu-cpu-models.texi to rST qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl

 MAINTAINERS                     |   2 +-
 Makefile                        |  10 +-
 docs/qemu-cpu-models.texi       | 677 --------------------------------
 docs/system/conf.py             |   3 +
 docs/system/index.rst           |   1 +
 docs/system/qemu-cpu-models.rst | 571 +++++++++++++++++++++++++++
 qemu-doc.texi                   |   5 -
 7 files changed, 581 insertions(+), 688 deletions(-)
 delete mode 100644 docs/qemu-cpu-models.texi
 create mode 100644 docs/system/qemu-cpu-models.rst
Signature · 1 line
2.21.0
#1 lore raw

PATCH v3 1/2 docs: Convert qemu-cpu-models.texi to rST

This doc was originally written by Daniel P. Berrangé <[email protected]>, introduced via commit[1]: 2544e9e4aa (docs: add guidance on configuring CPU models for x86, 2018-06-27).

In this patch:

- 1-1 conversion of Texinfo to rST, besides a couple of minor
tweaks that are too trivial to mention. (Thanks to Stephen
Finucane on IRC for the suggestion to use rST "definition lists" instead of bullets in some places.)

Further modifications will be done via a separate patch.

- rST and related infra changes: for building the manual page, Makefile fixes, clean up references to qemu-cpu-models.texi, etc.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=2544e9e4aa

---
v2: Fix rST conversion, man page creation, Makefile changes, et al
(thanks, Peter Maydell)

---
 MAINTAINERS                     |   2 +-
 Makefile                        |  10 +-
 docs/qemu-cpu-models.texi       | 677 --------------------------------
 docs/system/conf.py             |   3 +
 docs/system/index.rst           |   1 +
 docs/system/qemu-cpu-models.rst | 514 ++++++++++++++++++++++++
 qemu-doc.texi                   |   5 -
 7 files changed, 524 insertions(+), 688 deletions(-)
 delete mode 100644 docs/qemu-cpu-models.texi
 create mode 100644 docs/system/qemu-cpu-models.rst
MAINTAINERS +1 -1
index e72b5e5f69..38bb821034 100644
@@ -319,7 +319,7 @@ F: tests/tcg/i386/
 F: tests/tcg/x86_64/
 F: hw/i386/
 F: disas/i386.c
-F: docs/qemu-cpu-models.texi
+F: docs/system/qemu-cpu-models.rst
 T: git https://github.com/ehabkost/qemu.git x86-next
 
 Xtensa TCG CPUs
Makefile +5 -5
index 461d40bea6..5377a30d88 100644
@@ -349,9 +349,9 @@ DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-img.1
 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-nbd.8
 DOCS+=$(MANUAL_BUILDDIR)/interop/qemu-ga.8
 DOCS+=$(MANUAL_BUILDDIR)/system/qemu-block-drivers.7
+DOCS+=$(MANUAL_BUILDDIR)/system/qemu-cpu-models.7
 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7
 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7
-DOCS+=docs/qemu-cpu-models.7
 DOCS+=$(MANUAL_BUILDDIR)/index.html
 ifdef CONFIG_VIRTFS
 DOCS+=$(MANUAL_BUILDDIR)/interop/virtfs-proxy-helper.1
@@ -764,7 +764,6 @@ distclean: clean
 	rm -f docs/interop/qemu-qmp-ref.txt docs/interop/qemu-ga-ref.txt
 	rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf
 	rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html
-	rm -f docs/qemu-cpu-models.7
 	rm -rf .doctrees
 	$(call clean-manual,devel)
 	$(call clean-manual,interop)
@@ -841,7 +840,7 @@ ifdef CONFIG_POSIX
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7"
 	$(INSTALL_DATA) docs/interop/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7"
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-block-drivers.7 "$(DESTDIR)$(mandir)/man7"
-	$(INSTALL_DATA) docs/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7"
+	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/system/qemu-cpu-models.7 "$(DESTDIR)$(mandir)/man7"
 ifeq ($(CONFIG_TOOLS),y)
 	$(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-img.1 "$(DESTDIR)$(mandir)/man1"
 	$(INSTALL_DIR) "$(DESTDIR)$(mandir)/man8"
@@ -1056,6 +1055,8 @@ $(call define-manpage-rule,interop,\
 
 $(call define-manpage-rule,system,qemu-block-drivers.7)
 
+$(call define-manpage-rule,system,qemu-cpu-models.7)
+
 $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
 	@mkdir -p "$(MANUAL_BUILDDIR)"
 	$(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
@@ -1078,7 +1079,6 @@ docs/interop/qemu-ga-qapi.texi: qga/qapi-generated/qga-qapi-doc.texi
 
 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
 qemu.1: qemu-option-trace.texi
-docs/qemu-cpu-models.7: docs/qemu-cpu-models.texi
 
 html: qemu-doc.html docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html sphinxdocs
 info: qemu-doc.info docs/interop/qemu-qmp-ref.info docs/interop/qemu-ga-ref.info
@@ -1090,7 +1090,7 @@ qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \
 	qemu-tech.texi qemu-option-trace.texi \
 	qemu-deprecated.texi qemu-monitor.texi \
 	qemu-monitor-info.texi \
-	docs/qemu-cpu-models.texi docs/security.texi
+	docs/security.texi
 
 docs/interop/qemu-ga-ref.dvi docs/interop/qemu-ga-ref.html \
     docs/interop/qemu-ga-ref.info docs/interop/qemu-ga-ref.pdf \
docs/qemu-cpu-models.texi deleted +0 -677

677 lines not on this page · raw message

docs/system/conf.py +3 -0
index 7ca115f5e0..7cc9da9508 100644
@@ -18,5 +18,8 @@ html_theme_options['description'] = u'System Emulation User''s Guide'
 man_pages = [
     ('qemu-block-drivers', 'qemu-block-drivers',
      u'QEMU block drivers reference',
+     ['Fabrice Bellard and the QEMU Project developers'], 7),
+    ('qemu-cpu-models', 'qemu-cpu-models',
+     u'QEMU CPU Models',
      ['Fabrice Bellard and the QEMU Project developers'], 7)
 ]
docs/system/index.rst +1 -0
index f66e6ea585..849dcd8cb8 100644
@@ -15,3 +15,4 @@ Contents:
    :maxdepth: 2
 
    qemu-block-drivers
+   qemu-cpu-models
docs/system/qemu-cpu-models.rst new file +514 -0

514 lines not on this page · raw message

qemu-doc.texi +0 -5
index a1ef6b6484..c6a74877d6 100644
@@ -616,11 +616,6 @@ The monitor understands integers expressions for every integer
 argument. You can use register names to get the value of specifics
 CPU registers by prefixing them with @emph{$}.
 
-@node cpu_models
-@section CPU models
-
-@include docs/qemu-cpu-models.texi
-
 @node disk_images
 @section Disk Images
 
Signature · 1 line
2.21.0
#2 lore raw

Re: [PATCH v3 1/2] docs: Convert qemu-cpu-models.texi to rST

Quoted 36 lines · Kashyap Chamarthy

This doc was originally written by Daniel P. Berrangé <[email protected]>, introduced via commit[1]: 2544e9e4aa (docs: add guidance on configuring CPU models for x86, 2018-06-27).

In this patch:

- 1-1 conversion of Texinfo to rST, besides a couple of minor
tweaks that are too trivial to mention. (Thanks to Stephen
Finucane on IRC for the suggestion to use rST "definition lists" instead of bullets in some places.)

Further modifications will be done via a separate patch.

- rST and related infra changes: for building the manual page, Makefile fixes, clean up references to qemu-cpu-models.texi, etc.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=2544e9e4aa

---
v2: Fix rST conversion, man page creation, Makefile changes, et al
(thanks, Peter Maydell)

---
 MAINTAINERS                     |   2 +-
 Makefile                        |  10 +-
 docs/qemu-cpu-models.texi       | 677 --------------------------------
 docs/system/conf.py             |   3 +
 docs/system/index.rst           |   1 +
 docs/system/qemu-cpu-models.rst | 514 ++++++++++++++++++++++++
 qemu-doc.texi                   |   5 -
 7 files changed, 524 insertions(+), 688 deletions(-)
 delete mode 100644 docs/qemu-cpu-models.texi
 create mode 100644 docs/system/qemu-cpu-models.rst

Makefile $(call define-manpage-rule,interop,\ · line 1058

Quoted 4 lines
Makefile +1 -0
@@ -1056,6 +1055,8 @@ $(call define-manpage-rule,interop,\
 
 $(call define-manpage-rule,system,qemu-block-drivers.7)
 
+$(call define-manpage-rule,system,qemu-cpu-models.7)

The new manpage should be added to the existing define-manpage-rule invocation for the system manual: the last argument is a space separated list of all the manpages in the manual, like this:

$(call define-manpage-rule,system,qemu-block-drivers.7 qemu-cpu-models.7)

Quoted 16 lines
(quoted diff) +1 -3
+
 $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
        @mkdir -p "$(MANUAL_BUILDDIR)"
        $(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
 
 
 
-@c man begin AUTHOR
-Daniel P. Berrange
-@c man end
docs/system/conf.py +0 -0
index 7ca115f5e0..7cc9da9508 100644

docs/system/conf.py html_theme_options['description'] = u'System Emulation User''s Guide' · line 25

Quoted 8 lines
docs/system/conf.py +3 -0
@@ -18,5 +18,8 @@ html_theme_options['description'] = u'System Emulation User''s Guide'
 man_pages = [
     ('qemu-block-drivers', 'qemu-block-drivers',
      u'QEMU block drivers reference',
+     ['Fabrice Bellard and the QEMU Project developers'], 7),
+    ('qemu-cpu-models', 'qemu-cpu-models',
+     u'QEMU CPU Models',
      ['Fabrice Bellard and the QEMU Project developers'], 7)
 ]

The old manpage/documentation credits Dan as the author, so that's what we should specify in the conf.py line, rather than 'Fabrice and the project devs' (which we use for qemu-block-drivers.7 because that's what the old texi version of that file specified as the authors).

Quoted 4 lines
docs/system/conf.py +4 -0
+Preferred CPU models for Intel x86 hosts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following CPU models are preferred for use on Intel hosts.

docs/system/conf.py

Quoted 10 lines
docs/system/conf.py +10 -0
+Administrators / applications are recommended to use the CPU model that
+matches the generation of the host CPUs in use. In a deployment with a
+mixture of host CPU models between machines, if live migration
+compatibility is required, use the newest CPU model that is compatible
+across all desired hosts.
+
+* Intel Xeon Processor (Skylake, 2016)
+
+  * ``Skylake-Server``
+  * ``Skylake-Server-IBRS``

This reverses the old ordering of these lists, which consistently had the QEMU CPU model names as the 'term' and the explanations as the 'definition' of a definition-list. Now we have the 'explanation' first and the 'terms' second...

Quoted 4 lines
docs/system/conf.py +4 -0
+* AMD EPYC Processor (2017)
+
+  * ``EPYC``
+  * ``EPYC-IBPB``

docs/system/conf.py

Quoted 10 lines
docs/system/conf.py +10 -0
+
+* ``Opteron_G5`` – AMD Opteron 63xx class CPU (2012)
+
+* ``Opteron_G4`` – AMD Opteron 62xx class CPU (2011)
+
+* ``Opteron_G3`` – AMD Opteron 23xx (Gen 3 Class Opteron, 2009)
+
+* ``Opteron_G2`` – AMD Opteron 22xx (Gen 2 Class Opteron, 2006)
+
+* ``Opteron_G1`` – AMD Opteron 240 (Gen 1 Class Opteron, 2004)

...but here we become inconsistent, switching back to term first and explanation second. I think the term-first approach of the original texi makes more sense, as we're trying to document the behaviour of the various CPU models QEMU supports.

rST is not a fan of having multiple definition list items sharing a definition, which is probably why you ended up with the list approach you did, but we can do:

``Skylake-Server``, ``Skylake-Server-IBRS``
Intel Xeon Processor (Skylake, 2016)

``Skylake-Client``, ``Skylake-Client-IBRS``
Intel Core Processor (Skylake, 2015)

Or we can actually document what the difference is between a "Skylake-Server" and a "Skylake-Server-IBRS", rather than leaving the user to guess :-), in which case we could write

``Skylake-Server``
Intel Xeon Processor (Skylake, 2016)
``Skylake-Server-IBRS``
Like ``Skylake-Server`` but with extra magic

(or whatever the difference is...)

Regardless of how we format this, we should be consistent in using the same format throughout the document.

thanks
-- PMM

#3 lore raw

Re: [PATCH v3 1/2] docs: Convert qemu-cpu-models.texi to rST

Quoted 70 lines · Peter Maydell
Quoted 36 lines · Kashyap Chamarthy

This doc was originally written by Daniel P. Berrangé <[email protected]>, introduced via commit[1]: 2544e9e4aa (docs: add guidance on configuring CPU models for x86, 2018-06-27).

In this patch:

- 1-1 conversion of Texinfo to rST, besides a couple of minor
tweaks that are too trivial to mention. (Thanks to Stephen
Finucane on IRC for the suggestion to use rST "definition lists" instead of bullets in some places.)

Further modifications will be done via a separate patch.

- rST and related infra changes: for building the manual page, Makefile fixes, clean up references to qemu-cpu-models.texi, etc.

[1] https://git.qemu.org/?p=qemu.git;a=commit;h=2544e9e4aa

---
v2: Fix rST conversion, man page creation, Makefile changes, et al
(thanks, Peter Maydell)

---
 MAINTAINERS                     |   2 +-
 Makefile                        |  10 +-
 docs/qemu-cpu-models.texi       | 677 --------------------------------
 docs/system/conf.py             |   3 +
 docs/system/index.rst           |   1 +
 docs/system/qemu-cpu-models.rst | 514 ++++++++++++++++++++++++
 qemu-doc.texi                   |   5 -
 7 files changed, 524 insertions(+), 688 deletions(-)
 delete mode 100644 docs/qemu-cpu-models.texi
 create mode 100644 docs/system/qemu-cpu-models.rst

Makefile $(call define-manpage-rule,interop,\ · line 1058

Quoted 4 lines
Makefile +1 -0
@@ -1056,6 +1055,8 @@ $(call define-manpage-rule,interop,\
 
 $(call define-manpage-rule,system,qemu-block-drivers.7)
 
+$(call define-manpage-rule,system,qemu-cpu-models.7)

The new manpage should be added to the existing define-manpage-rule invocation for the system manual: the last argument is a space separated list of all the manpages in the manual, like this:

$(call define-manpage-rule,system,qemu-block-drivers.7 qemu-cpu-models.7)

Quoted 22 lines
(quoted diff) +1 -3
+
 $(MANUAL_BUILDDIR)/index.html: $(SRC_PATH)/docs/index.html.in qemu-version.h
        @mkdir -p "$(MANUAL_BUILDDIR)"
        $(call quiet-command, sed "s|@@VERSION@@|${VERSION}|g" $< >$@, \
 
 
 
-@c man begin AUTHOR
-Daniel P. Berrange
-@c man end
docs/system/conf.py +3 -0
index 7ca115f5e0..7cc9da9508 100644
@@ -18,5 +18,8 @@ html_theme_options['description'] = u'System Emulation User''s Guide'
 man_pages = [
     ('qemu-block-drivers', 'qemu-block-drivers',
      u'QEMU block drivers reference',
+     ['Fabrice Bellard and the QEMU Project developers'], 7),
+    ('qemu-cpu-models', 'qemu-cpu-models',
+     u'QEMU CPU Models',
Quoted 8 lines

docs/system/conf.py html_theme_options['description'] = u'System Emulation User''s Guide' · line 25

Quoted 2 lines
docs/system/conf.py +0 -0
      ['Fabrice Bellard and the QEMU Project developers'], 7)
 ]

The old manpage/documentation credits Dan as the author, so that's what we should specify in the conf.py line, rather than 'Fabrice and the project devs' (which we use for qemu-block-drivers.7 because that's what the old texi version of that file specified as the authors).

I agree that listing Fabrice explicitly here is wrong since he didn't write any of it.

As the author, I don't feel a need for my name to be explicitly credited here. QEMU is a collaborative project and other people add text to this over time. Indeed IME explicitly listing an individual encourages users to directly email the individual person with questions, instead of using the mailing list / irc / forums.

Thus I would personally prefer if we just used

"The QEMU Project maintainers"

as the author credit

Quoted 11 lines
Quoted 11 lines
docs/system/conf.py +11 -0
+Preferred CPU models for Intel x86 hosts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following CPU models are preferred for use on Intel hosts.
+Administrators / applications are recommended to use the CPU model that
+matches the generation of the host CPUs in use. In a deployment with a
+mixture of host CPU models between machines, if live migration
+compatibility is required, use the newest CPU model that is compatible
+across all desired hosts.
+
+* Intel Xeon Processor (Skylake, 2016)
Quoted 8 lines

docs/system/conf.py

Quoted 3 lines
docs/system/conf.py +3 -0
+
+  * ``Skylake-Server``
+  * ``Skylake-Server-IBRS``

This reverses the old ordering of these lists, which consistently had the QEMU CPU model names as the 'term' and the explanations as the 'definition' of a definition-list. Now we have the 'explanation' first and the 'terms' second...

Yep, the model name used for the "-cpu NAME" arg is the most important piece of information IMHO. The human description is just a side note.

Regards,
Daniel

Signature · 3 lines
|: 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 :|
#4 lore raw

Re: [PATCH v3 1/2] docs: Convert qemu-cpu-models.texi to rST

Quoted 33 lines · Daniel P. Berrangé
Quoted 12 lines · Peter Maydell
Quoted 11 lines · Kashyap Chamarthy
docs/system/conf.py +3 -0
index 7ca115f5e0..7cc9da9508 100644
@@ -18,5 +18,8 @@ html_theme_options['description'] = u'System Emulation User''s Guide'
 man_pages = [
     ('qemu-block-drivers', 'qemu-block-drivers',
      u'QEMU block drivers reference',
+     ['Fabrice Bellard and the QEMU Project developers'], 7),
+    ('qemu-cpu-models', 'qemu-cpu-models',
+     u'QEMU CPU Models',
Quoted 8 lines

docs/system/conf.py html_theme_options['description'] = u'System Emulation User''s Guide' · line 25

Quoted 2 lines
docs/system/conf.py +0 -0
      ['Fabrice Bellard and the QEMU Project developers'], 7)
 ]

The old manpage/documentation credits Dan as the author, so that's what we should specify in the conf.py line, rather than 'Fabrice and the project devs' (which we use for qemu-block-drivers.7 because that's what the old texi version of that file specified as the authors).

I agree that listing Fabrice explicitly here is wrong since he didn't write any of it.

As the author, I don't feel a need for my name to be explicitly credited here. QEMU is a collaborative project and other people add text to this over time. Indeed IME explicitly listing an individual encourages users to directly email the individual person with questions, instead of using the mailing list / irc / forums.

Quoted 5 lines

Thus I would personally prefer if we just used

"The QEMU Project maintainers"

as the author credit

Sure, if you want to update the author credit (which you originally picked in commit 2544e9e4aa2bcef :-)) we can do that, though our standard phrasing (see
the QEMU_COPYRIGHT #define in qemu-common.h) is "The QEMU Project developers" so I'd rather we stuck with that than "maintainers".

Mostly I want to avoid our rST conversion accidentally dropping or changing existing authorship/attribution information, so maybe we should change the authorship in a follow-on patch.

thanks
-- PMM

#5 lore raw

Re: [PATCH v3 1/2] docs: Convert qemu-cpu-models.texi to rST

In reply to Peter Maydell
Quoted 1 line · Peter Maydell

On Thu, 20 Feb 2020 at 14:20, Kashyap Chamarthy <[email protected]> wrote:

[...]

Quoted 11 lines

Makefile $(call define-manpage-rule,interop,\ · line 1058

Quoted 5 lines
Makefile +1 -0
@@ -1056,6 +1055,8 @@ $(call define-manpage-rule,interop,\
 
 $(call define-manpage-rule,system,qemu-block-drivers.7)
 
+$(call define-manpage-rule,system,qemu-cpu-models.7)

The new manpage should be added to the existing define-manpage-rule invocation for the system manual: the last argument is a space separated list of all the manpages in the manual, like this:

$(call define-manpage-rule,system,qemu-block-drivers.7 qemu-cpu-models.7)

Ah, will fix.

[...]

Quoted 8 lines
Quoted 8 lines
docs/system/conf.py +4 -0
+++ b/docs/system/conf.py
@@ -18,5 +18,8 @@ html_theme_options['description'] = u'System Emulation User''s Guide'
 man_pages = [
     ('qemu-block-drivers', 'qemu-block-drivers',
      u'QEMU block drivers reference',
+     ['Fabrice Bellard and the QEMU Project developers'], 7),
+    ('qemu-cpu-models', 'qemu-cpu-models',
+     u'QEMU CPU Models',
Quoted 8 lines

docs/system/conf.py html_theme_options['description'] = u'System Emulation User''s Guide' · line 25

Quoted 2 lines
docs/system/conf.py +0 -0
      ['Fabrice Bellard and the QEMU Project developers'], 7)
 ]

The old manpage/documentation credits Dan as the author, so that's what we should specify in the conf.py line, rather than 'Fabrice and the project devs' (which we use for qemu-block-drivers.7 because that's what the old texi version of that file specified as the authors).

Yeah, I first felt strange adding "Fabrice and the QEMU Project developers". But as you've guessed I just picked what you used for 'qemu-block-drivers.7'. That's why I mentioned Dan and his original commit ID in my commit message, for clear posterity.

As Dan says in his follow-up, a file indeed usually gets modified over time. And given the follow-up interaction between you and Dan, in the next iteration, I'll change it to: "The QEMU Project developers".

(While I agree that we should be careful to not mix attribution changes with the noise of rST conversion, maybe in this case a seperate commit is an overkill; hope it is okay if I call it out in the commit message.)

Quoted 11 lines
Quoted 11 lines
docs/system/qemu-cpu-models.rst new file +11 -0
+Preferred CPU models for Intel x86 hosts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The following CPU models are preferred for use on Intel hosts.
+Administrators / applications are recommended to use the CPU model that
+matches the generation of the host CPUs in use. In a deployment with a
+mixture of host CPU models between machines, if live migration
+compatibility is required, use the newest CPU model that is compatible
+across all desired hosts.
+
+* Intel Xeon Processor (Skylake, 2016)
Quoted 8 lines

docs/system/qemu-cpu-models.rst line 67

Quoted 3 lines
docs/system/qemu-cpu-models.rst new file +3 -0
+
+  * ``Skylake-Server``
+  * ``Skylake-Server-IBRS``

This reverses the old ordering of these lists, which consistently had the QEMU CPU model names as the 'term' and the explanations as the 'definition' of a definition-list. Now we have the 'explanation' first and the 'terms' second...

Yeah, as you guessed, I was trying to wrangle with rST syntax.

Quoted 12 lines
Quoted 12 lines
docs/system/qemu-cpu-models.rst new file +12 -0
+* AMD EPYC Processor (2017)
+
+  * ``EPYC``
+  * ``EPYC-IBPB``
+
+* ``Opteron_G5`` – AMD Opteron 63xx class CPU (2012)
+
+* ``Opteron_G4`` – AMD Opteron 62xx class CPU (2011)
+
+* ``Opteron_G3`` – AMD Opteron 23xx (Gen 3 Class Opteron, 2009)
+
+* ``Opteron_G2`` – AMD Opteron 22xx (Gen 2 Class Opteron, 2006)
Quoted 8 lines

docs/system/qemu-cpu-models.rst line 209

Quoted 2 lines
docs/system/qemu-cpu-models.rst new file +2 -0
+
+* ``Opteron_G1`` – AMD Opteron 240 (Gen 1 Class Opteron, 2004)

...but here we become inconsistent, switching back to term first and explanation second. I think the term-first approach of the original texi makes more sense, as we're trying to document the behaviour of the various CPU models QEMU supports.

True, I'll stick with the term-first approach, and get rid of the inconsistency.

Quoted 14 lines

rST is not a fan of having multiple definition list items sharing a definition, which is probably why you ended up with the list approach you did, but we can do:

``Skylake-Server``, ``Skylake-Server-IBRS``
Intel Xeon Processor (Skylake, 2016)

``Skylake-Client``, ``Skylake-Client-IBRS``
Intel Core Processor (Skylake, 2015)

Or we can actually document what the difference is between a "Skylake-Server" and a "Skylake-Server-IBRS", rather than leaving the user to guess :-), in which case we could write

Quoted 6 lines

``Skylake-Server``
Intel Xeon Processor (Skylake, 2016)
``Skylake-Server-IBRS``
Like ``Skylake-Server`` but with extra magic

(or whatever the difference is...)

(The difference is the -IBRS models have 'spec-ctrl' CPU flag baked in.)

And yes, I like the latter approach — explicitly spelling it out reduces cogntive load for the readers.

Quoted 2 lines

Regardless of how we format this, we should be consistent in using the same format throughout the document.

Agree, will fix. Thanks for the eagle eyes, as usual. :-)

[...]

Signature · 1 line
/kashyap
#6 lore raw

Re: [PATCH v3 1/2] docs: Convert qemu-cpu-models.texi to rST

Quoted 1 line · Kashyap Chamarthy

On Fri, Feb 21, 2020 at 03:16:29PM +0000, Peter Maydell wrote:

[...]

Quoted 9 lines
Quoted 9 lines

rST is not a fan of having multiple definition list items sharing a definition, which is probably why you ended up with the list approach you did, but we can do:

``Skylake-Server``, ``Skylake-Server-IBRS``
Intel Xeon Processor (Skylake, 2016)

``Skylake-Client``, ``Skylake-Client-IBRS``
Intel Core Processor (Skylake, 2015)

For this series, I'll stick with the above approach throughout. And will do the separate description of each model and how it differs from the previous, as a follow-up. (No, I won't forget about it :-))

[...]

Signature · 1 line
/kashyap
#7 lore raw

PATCH v3 2/2 qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl

In reply to Kashyap Chamarthy

- Add the '-noTSX' variants for CascadeLake and SkyLake.

- Document the three MSR bits: 'mds-no', 'taa-no', and 'tsx-ctrl'

Two confusing things about 'mds-no' (and the first point applies to the other two MSRs too):

(1) The 'mds-no' bit will _not_ show up in the guest's /proc/cpuinfo. Rather it is used to fill in the guest's sysfs:

/sys/devices/system/cpu/vulnerabilities/mds:Not affected

Paolo confirmed on IRC as such.

(2) There are _three_ variants[+] of CascadeLake CPUs, with different stepping levels: 5, 6, and 7. To quote wikichip.org[*]:

"note that while steppings 6 & 7 are fully mitigated, earlier stepping 5 is not protected against MSBDS, MLPDS, nor MDSUM"

The above is also indicated in the Intel's document[+], as indicated by "No" under the three columns of MFBDS, MSBDS, and MLPDS.

I've expressed this in the docs without belabouring the details.

[+] https://software.intel.com/security-software-guidance/insights/processors-affected-microarchitectural-data-sampling
[*] https://en.wikichip.org/wiki/intel/microarchitectures/cascade_lake#Key_changes_from_Skylake

---
---
[Retaining parts of the change-log from the Texinfo-variant of this patch, which is now no-longer needed:
https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg06455.html]

v3:
- Makefile, Sphinx and related fixes (Peter Maydell)
- Address feedback from Paolo
- Add URL to the deep-dive on Intel's MDS
v2:
- Address feedback from DanPB
- Add sections on 'taa-no' and 'tsx-ctrl'

---
 docs/system/qemu-cpu-models.rst | 57 +++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
docs/system/qemu-cpu-models.rst +57 -0
index a189d6a9da..946e90e1dc 100644
@@ -61,15 +61,24 @@ mixture of host CPU models between machines, if live migration
 compatibility is required, use the newest CPU model that is compatible
 across all desired hosts.
 
+* Intel Xeon Processor (Cascade Lake, 2019), with "stepping" levels 6 or
+  7 only.  (The Cascade Lake Xeon processor with *stepping 5 is
+  vulnerable to MDS variants*.)
+
+  * ``Cascadelake-Server``
+  * ``Cascadelake-Server-noTSX``
+
 * Intel Xeon Processor (Skylake, 2016)
 
   * ``Skylake-Server``
   * ``Skylake-Server-IBRS``
+  * ``Skylake-Server-IBRS-noTSX``
 
 * Intel Core Processor (Skylake, 2015)
 
   * ``Skylake-Client``
   * ``Skylake-Client-IBRS``
+  * ``Skylake-Client-noTSX-IBRS}``
 
 * Intel Core Processor (Broadwell, 2014)
 
@@ -182,6 +191,54 @@ features are included if using "Host passthrough" or "Host model".
   Requires the host CPU microcode to support this feature before it
   can be used for guest CPUs.
 
+``mds-no``
+  Recommended to inform the guest OS that the host is *not* vulnerable
+  to any of the MDS variants ([MFBDS] CVE-2018-12130, [MLPDS]
+  CVE-2018-12127, [MSBDS] CVE-2018-12126).
+
+  This is an MSR (Model-Specific Register) feature rather than a CPUID feature,
+  so it will not appear in the Linux ``/proc/cpuinfo`` in the host or
+  guest.  Instead, the host kernel uses it to populate the MDS
+  vulnerability file in ``sysfs``.
+
+  So it should only be enabled for VMs if the host reports @code{Not
+  affected} in the ``/sys/devices/system/cpu/vulnerabilities/mds`` file.
+
+``taa-no``
+  Recommended to inform that the guest that the host is ``not``
+  vulnerable to CVE-2019-11135, TSX Asynchronous Abort (TAA).
+
+  This too is an MSR feature, so it does not show up in the Linux
+  ``/proc/cpuinfo`` in the host or guest.
+
+  It should only be enabled for VMs if the host reports ``Not affected``
+  in the ``/sys/devices/system/cpu/vulnerabilities/tsx_async_abort``
+  file.
+
+``tsx-ctrl``
+  Recommended to inform the guest that it can disable the Intel TSX
+  (Transactional Synchronization Extensions) feature; or, if the
+  processor is vulnerable, use the Intel VERW instruction (a
+  processor-level instruction that performs checks on memory access) as
+  a mitigation for the TAA vulnerability.  (For details, refer to this
+  `Intel's deep-dive into
+  MDS <https://software.intel.com/security-software-guidance/insights/deep-dive-intel-analysis-microarchitectural-data-sampling>`_.)
+
+  Expose this to the guest OS if and only if: (a) the host has TSX
+  enabled; *and* (b) the guest has ``rtm`` CPU flag enabled.
+
+  By disabling TSX, KVM-based guests can avoid paying the price of
+  mitigting TSX-based attacks.
+
+  Note that ``tsx-ctrl`` too is an MSR feature, so it does not show
+  up in the Linux ``/proc/cpuinfo`` in the host or guest.
+
+  To validate that Intel TSX is indeed disabled for the guest, there are
+  two ways: (a) check for the *absence* of ``rtm`` in the guest's
+  ``/proc/cpuinfo``; or (b) the
+  ``/sys/devices/system/cpu/vulnerabilities/tsx_async_abort`` file in
+  the guest should report ``Mitigation: TSX disabled``.
+
 
 Preferred CPU models for AMD x86 hosts
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
2.21.0
#8 lore raw

Re: [PATCH v3 2/2] qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl

Two small changes...

docs/system/qemu-cpu-models.rst features are included if using "Host passthrough" or "Host model". · line 225

Quoted 7 lines · Kashyap Chamarthy
docs/system/qemu-cpu-models.rst +7 -0
+  Recommended to inform the guest that it can disable the Intel TSX
+  (Transactional Synchronization Extensions) feature; or, if the
+  processor is vulnerable, use the Intel VERW instruction (a
+  processor-level instruction that performs checks on memory access) as
+  a mitigation for the TAA vulnerability.  (For details, refer to this
+  `Intel's deep-dive into
+  MDS <https://software.intel.com/security-software-guidance/insights/deep-dive-intel-analysis-microarchitectural-data-sampling>`_.)

... refer to Intel's deep dive into MDS <...>_.

(I don't know what the trailing underscore is for. I reaffirm my definition of rST as the Perl of markup formats).

docs/system/qemu-cpu-models.rst features are included if using "Host passthrough" or "Host model". · line 231

Quoted 6 lines
docs/system/qemu-cpu-models.rst +6 -0
+
+  Expose this to the guest OS if and only if: (a) the host has TSX
+  enabled; *and* (b) the guest has ``rtm`` CPU flag enabled.
+
+  By disabling TSX, KVM-based guests can avoid paying the price of
+  mitigting TSX-based attacks.

"mitigating"

Paolo

#9 lore raw

Re: [PATCH v3 2/2] qemu-cpu-models.rst: Document -noTSX, mds-no, taa-no, and tsx-ctrl

Quoted 3 lines · Paolo Bonzini

... refer to Intel's deep dive into MDS <...>_.

(I don't know what the trailing underscore is for.

It's because the external-hyperlink syntax is a complication of the simpler format for within-document references. Inside a document, you can have a simple link like this:

This is a link to the target_ defined below.

.. _target:

This is where the link target defined above goes to.

So trailing underscore is for words that go to somewhere else, and leading underscore for words that come from somewhere else.

Syntax complication 1 is that instead of word_ you can say some phrase with spaces_ if you want the link to span more than one word. (The docutils spec calls these "phrase-references").

Syntax complication 2 is that instead of having to define the target of an external URL separately from the place you wanted to refer to it, like this:

.. _target: http://somewhere-else.org/

you can directly embed it inside a phrase-reference:

Go to somewhere external <http://somewhere-else.org/>_

which is more convenient if you only wanted to use the URL once. But the _ is still there because it's still the markup that indicates "this is going be a link to go somewhere".

Quoted 1 line

I reaffirm my definition of rST as the Perl of markup formats).

Not going to argue with that :-) But like Perl, there's usually some kind of a rationale lurking under the surface.

thanks
-- PMM