Skip to contentSkip to conversation

docs: rstfy some s390 docs

RFC PATCH Superseded Cornelia Huck 3 participants 12 messages Jan 28, 2020 – Feb 12, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover docs: rstfy some s390 docs

https://qemu.readthedocs.io/en/latest/index.html collects various documents from the QEMU docs/ subdirectory; however, none of the s390 files are currently included. Therefore, I set out to convert the existing files to rst and hook them up.

s390-dasd-ipl was straightforward enough; I also found a numbering issue.

vfio-ap was quite a bit more involved, but I hope I have produced something readable (would benefit from some more review). I also moved this into the system/ subdirectory; not sure if that is the best resting place, but it seemed to be the most reasonable one.

Tested via running 'make html' and inspecting the output.

Branch: https://github.com/cohuck/qemu rstfy-s390

Cornelia Huck (2):
docs: rstfy s390 dasd ipl documentation
docs: rstfy vfio-ap documentation

 MAINTAINERS                                   |   4 +-
 docs/devel/index.rst                          |   1 +
 .../{s390-dasd-ipl.txt => s390-dasd-ipl.rst}  |  65 +-
 docs/system/index.rst                         |   1 +
 docs/{vfio-ap.txt => system/vfio-ap.rst}      | 755 +++++++++---------
 5 files changed, 424 insertions(+), 402 deletions(-)
 rename docs/devel/{s390-dasd-ipl.txt => s390-dasd-ipl.rst} (77%)
 rename docs/{vfio-ap.txt => system/vfio-ap.rst} (56%)
Signature · 1 line
2.21.1
#1 lore raw

RFC PATCH 1/2 docs: rstfy s390 dasd ipl documentation

While at it, also fix the numbering in 'What QEMU does'.

---
 MAINTAINERS                                   |  2 +-
 docs/devel/index.rst                          |  1 +
 .../{s390-dasd-ipl.txt => s390-dasd-ipl.rst}  | 65 ++++++++++---------
 3 files changed, 37 insertions(+), 31 deletions(-)
 rename docs/devel/{s390-dasd-ipl.txt => s390-dasd-ipl.rst} (77%)
MAINTAINERS +1 -1
index f6511d5120ce..628bf7454088 100644
@@ -1235,7 +1235,7 @@ S: Supported
 F: hw/s390x/ipl.*
 F: pc-bios/s390-ccw/
 F: pc-bios/s390-ccw.img
-F: docs/devel/s390-dasd-ipl.txt
+F: docs/devel/s390-dasd-ipl.rst
 T: git https://github.com/borntraeger/qemu.git s390-next
 L: [email protected]
 
docs/devel/index.rst +1 -0
index ac862152dcb3..b084def854b8 100644
@@ -24,3 +24,4 @@ Contents:
    tcg
    tcg-plugins
    bitops
+   s390-dasd-ipl
docs/devel/s390-dasd-ipl.rst renamed from docs/devel/s390-dasd-ipl.txt +35 -30

133 lines not on this page · raw message

Signature · 1 line
2.21.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH RFC 1/2] docs: rstfy s390 dasd ipl documentation

Quoted 9 lines · Cornelia Huck

While at it, also fix the numbering in 'What QEMU does'.

---
 MAINTAINERS                                   |  2 +-
 docs/devel/index.rst                          |  1 +
 .../{s390-dasd-ipl.txt => s390-dasd-ipl.rst}  | 65 ++++++++++---------
 3 files changed, 37 insertions(+), 31 deletions(-)
 rename docs/devel/{s390-dasd-ipl.txt => s390-dasd-ipl.rst} (77%)

Looks sane to me.

#3 lore raw

Re: [PATCH RFC 1/2] docs: rstfy s390 dasd ipl documentation

In reply to Cornelia Huck
Quoted 22 lines · Cornelia Huck

While at it, also fix the numbering in 'What QEMU does'.

---

docs/devel/s390-dasd-ipl.rst renamed from docs/devel/s390-dasd-ipl.txt +5 -3
similarity index 77%
rename from docs/devel/s390-dasd-ipl.txt
rename to docs/devel/s390-dasd-ipl.rst
index 9107e048e4e6..1f6a7ea01ce6 100644
@@ -1,25 +1,28 @@
-*****************************
-***** s390 hardware IPL *****
-*****************************
+Booting from real channel-attached devices on s390x
+===================================================
+
+s390 hardware IPL
+-----------------

docs/devel/s390-dasd-ipl.rst line 13

Quoted 10 lines
docs/devel/s390-dasd-ipl.rst renamed from docs/devel/s390-dasd-ipl.txt +2 -2
 
 The s390 hardware IPL process consists of the following steps.
 
-1. A READ IPL ccw is constructed in memory location 0x0.
+1. A READ IPL ccw is constructed in memory location ``0x0``.
     This ccw, by definition, reads the IPL1 record which is located on the disk
     at cylinder 0 track 0 record 1. Note that the chain flag is on in this ccw
     so when it is complete another ccw will be fetched and executed from memory
-    location 0x08.
+    location ``0x08``.

I think the indentation here is off -- rST likes to see every line in a multiline bullet point start in the same column, like this:

1. A READ IPL ccw is constructed in memory location ``0x0``. This ccw, by ...
at cylinder...

Otherwise I think you end up with a blockquote by accident.

Formatting-wise the rest looks OK to me (and the other enumerated lists in this document don't have this odd indentation, just this first set of 1..4).

thanks
-- PMM

#4 lore raw

Re: [PATCH RFC 1/2] docs: rstfy s390 dasd ipl documentation

Quoted 37 lines · On Fri, 7 Feb 2020 12:05:09 +0000 Peter Maydell <[email protected]>…
Quoted 22 lines · Cornelia Huck

While at it, also fix the numbering in 'What QEMU does'.

---

docs/devel/s390-dasd-ipl.rst renamed from docs/devel/s390-dasd-ipl.txt +5 -3
similarity index 77%
rename from docs/devel/s390-dasd-ipl.txt
rename to docs/devel/s390-dasd-ipl.rst
index 9107e048e4e6..1f6a7ea01ce6 100644
@@ -1,25 +1,28 @@
-*****************************
-***** s390 hardware IPL *****
-*****************************
+Booting from real channel-attached devices on s390x
+===================================================
+
+s390 hardware IPL
+-----------------

docs/devel/s390-dasd-ipl.rst line 13

Quoted 10 lines
docs/devel/s390-dasd-ipl.rst renamed from docs/devel/s390-dasd-ipl.txt +2 -2
 
 The s390 hardware IPL process consists of the following steps.
 
-1. A READ IPL ccw is constructed in memory location 0x0.
+1. A READ IPL ccw is constructed in memory location ``0x0``.
     This ccw, by definition, reads the IPL1 record which is located on the disk
     at cylinder 0 track 0 record 1. Note that the chain flag is on in this ccw
     so when it is complete another ccw will be fetched and executed from memory
-    location 0x08.
+    location ``0x08``.  

I think the indentation here is off -- rST likes to see every line in a multiline bullet point start in the same column, like this:

Quoted 5 lines

1. A READ IPL ccw is constructed in memory location ``0x0``. This ccw, by ...
at cylinder...

Otherwise I think you end up with a blockquote by accident.

Hm, the resulting html looked sane to me... but making this consistent is a good idea anyway.

Quoted 4 lines

Formatting-wise the rest looks OK to me (and the other enumerated lists in this document don't have this odd indentation, just this first set of 1..4).

Thanks for looking!

Quoted 4 lines

thanks
-- PMM

#5 lore raw

RFC PATCH 2/2 docs: rstfy vfio-ap documentation

In reply to Cornelia Huck

Move to system/, as this is mostly about configuring vfio-ap.

---
 MAINTAINERS                              |   2 +-
 docs/system/index.rst                    |   1 +
 docs/{vfio-ap.txt => system/vfio-ap.rst} | 755 ++++++++++++-----------
 3 files changed, 387 insertions(+), 371 deletions(-)
 rename docs/{vfio-ap.txt => system/vfio-ap.rst} (56%)
MAINTAINERS +1 -1
index 628bf7454088..0df0d07a7f97 100644
@@ -1545,7 +1545,7 @@ F: hw/s390x/ap-bridge.c
 F: include/hw/s390x/ap-device.h
 F: include/hw/s390x/ap-bridge.h
 F: hw/vfio/ap.c
-F: docs/vfio-ap.txt
+F: docs/system/vfio-ap.rst
 L: [email protected]
 
 vhost
docs/system/index.rst +1 -0
index f66e6ea585cd..1a4b2c82acef 100644
@@ -15,3 +15,4 @@ Contents:
    :maxdepth: 2
 
    qemu-block-drivers
+   vfio-ap
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +385 -370

1,096 lines not on this page · raw message

Signature · 1 line
2.21.1
Acked-by on v1 2/2
#6 lore raw

Re: [PATCH RFC 2/2] docs: rstfy vfio-ap documentation

Quoted 9 lines · Cornelia Huck

Move to system/, as this is mostly about configuring vfio-ap.

---
 MAINTAINERS                              |   2 +-
 docs/system/index.rst                    |   1 +
 docs/{vfio-ap.txt => system/vfio-ap.rst} | 755 ++++++++++++-----------
 3 files changed, 387 insertions(+), 371 deletions(-)
 rename docs/{vfio-ap.txt => system/vfio-ap.rst} (56%)

I'm not an expert in all that RST markdown syntax, but I think it's a good idea to do this change, so FWIW:

#7 lore raw

Re: [PATCH RFC 2/2] docs: rstfy vfio-ap documentation

In reply to Cornelia Huck
Quoted 25 lines · Cornelia Huck

Move to system/, as this is mostly about configuring vfio-ap.

docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +0 -9
similarity index 56%
rename from docs/vfio-ap.txt
rename to docs/system/vfio-ap.rst
index b1eb2deeaf2f..c8c5728e0aaa 100644
@@ -1,17 +1,17 @@
 Adjunct Processor (AP) Device
 =============================
 
-Contents:
-=========
-* Introduction
-* AP Architectural Overview
-* Start Interpretive Execution (SIE) Instruction
-* AP Matrix Configuration on Linux Host
-* Starting a Linux Guest Configured with an AP Matrix
-* Example: Configure AP Matrices for Three Linux Guests
-> -Introduction:

docs/system/vfio-ap.rst line 12

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +9 -1
-============
+Contents
+--------
+* `Introduction`_
+* `AP Architectural Overview`_
+* `Start Interpretive Execution (SIE) Instruction`_
+* `AP Matrix Configuration on Linux Host`_
+* `Starting a Linux Guest Configured with an AP Matrix`_
+* `Example: Configure AP Matrices for Three Linux Guests`_
+

You don't need to manually write out a table of contents. You can just have one line

.. contents::

and Sphinx will produce an autogenerated table of contents (including a 'Contents' title) for you.

https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents

An example where we already use this is
docs/interop/live-block-operations.rst:
https://www.qemu.org/docs/master/interop/live-block-operations.html

docs/system/vfio-ap.rst line 14

Quoted 2 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +2 -0
+Introduction
+------------

rST doesn't require it, but I'd recommend a blank line below the ---- line; I think it makes the source more readable.

Quoted 25 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +3 -3
 The IBM Adjunct Processor (AP) Cryptographic Facility is comprised
 of three AP instructions and from 1 to 256 PCIe cryptographic adapter cards.
 These AP devices provide cryptographic functions to all CPUs assigned to a
@@ -21,8 +21,8 @@ On s390x, AP adapter cards are exposed via the AP bus. This document
 describes how those cards may be made available to KVM guests using the
 VFIO mediated device framework.
 
-AP Architectural Overview:
-=========================
+AP Architectural Overview
+-------------------------
 In order understand the terminology used in the rest of this document, let's
 start with some definitions:
 
@@ -75,7 +75,7 @@ start with some definitions:
   must be one of the control domains.
 
 Start Interpretive Execution (SIE) Instruction
-==============================================
+----------------------------------------------
 A KVM guest is started by executing the Start Interpretive Execution (SIE)
 instruction. The SIE state description is a control block that contains the
 state information for a KVM guest and is supplied as input to the SIE
@@ -114,246 +114,254 @@ The APQNs can provide secure key functionality - i.e., a private key is stored
 on the adapter card for each of its domains - so each APQN must be assigned to

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 120

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +4 -4
 at most one guest or the linux host.
 
-   Example 1: Valid configuration:
-   ------------------------------
-   Guest1: adapters 1,2  domains 5,6
-   Guest2: adapter  1,2  domain 7
+Example 1: Valid configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2  domains 5,6
+Guest2: adapter  1,2  domain 7

These don't render correctly -- rST thinks the "Example 1..." line is a subsection heading because of the underlining, and then renders the next two lines as runon-text:
"Guest1: adapters 1,2 domains 5,6 Guest2: adapter 1,2 domain 7"

Depending on what you want, you could try one of:
* use a literal block (which gets you fixed-width font, preserved whitespace and linebreaks)
* use a bulleted list
* use one of rST's table formats

(is it deliberate that line 1 is "adapters" and line 2 is "adapter" ?)

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +3 -6
-   This is valid because both guests have a unique set of APQNs: Guest1 has
-   APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).
+This is valid because both guests have a unique set of APQNs: Guest1 has
+APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).
 
-   Example 2: Valid configuration:
-   ------------------------------
-   Guest1: adapters 1,2 domains 5,6
-   Guest2: adapters 3,4 domains 5,6
+Example 2: Valid configuration

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 132

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +6 -3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2 domains 5,6
+Guest2: adapters 3,4 domains 5,6
 
-   This is also valid because both guests have a unique set of APQNs:
-      Guest1 has APQNs (1,5), (1,6), (2,5), (2,6);
-      Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)
+This is also valid because both guests have a unique set of APQNs:
+   Guest1 has APQNs (1,5), (1,6), (2,5), (2,6);
+   Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)

This is differently rendered from the equivalent text in example 1, because of the indent -- rST treats the 2 indented lines as a block quote, and indents them in the output, but flows the text into one long line.

I think personally I'd opt to render like this:

This is also valid because both guests have a unique set of APQNs:

* Guest1 has APQNs (1,5), (1,6), (2,5), (2,6)
* Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)

(ie a bulleted list); but anyway consistency between the examples would be good.

Quoted 20 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +6 -11
-   Example 3: Invalid configuration:
-   --------------------------------
-   Guest1: adapters 1,2  domains 5,6
-   Guest2: adapter  1    domains 6,7
+Example 3: Invalid configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2  domains 5,6
+Guest2: adapter  1    domains 6,7
 
-   This is an invalid configuration because both guests have access to
-   APQN (1,6).
+This is an invalid configuration because both guests have access to
+APQN (1,6).
 
-      * Individual bits in the mask can be switched on and off by specifying
-        each bit number to be switched in a comma separated list. Each bit
-        number string must be prepended with a ('+') or minus ('-') to indicate
-        the corresponding bit is to be switched on ('+') or off ('-'). Some
-        valid values are:

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +5 -0
+    * Individual bits in the mask can be switched on and off by specifying
+      each bit number to be switched in a comma separated list. Each bit
+      number string must be prepended with a ('+') or minus ('-') to indicate
+      the corresponding bit is to be switched on ('+') or off ('-'). Some
+      valid values are::
 
            "+0"    switches bit 0 on
            "-13"   switches bit 13 off
            "+0x41" switches bit 65 on
            "-0xff" switches bit 255 off

Maybe use a definition list here rather than a literal block?

valid values are:

``+0``
switches bit 0 on
``-13``
switches bit 13 off

etc. The literal block is fine if you think it looks better though.

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 358

Quoted 2 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +0 -0
 assign_adapter

Since these are filenames, you can enclose them in `` `` and they'll render as fixed-width text, which I think makes them stand out a bit better in the HTML. I'm pretty sure this works even in the term part of a definition list.

Not in this diff, but should the 'No APQN...' para in the assign_domain docs really be a 2nd para of the preceding bullet point rather than either its own bullet point or a paragraph outside the bulleted list ?

(ditto for assign_domain)

Quoted 5 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +0 -1
@@ -486,20 +494,22 @@ facilities:
    The AP facilities feature indicates that AP facilities are installed on the
    guest. This feature will be exposed for use only if the AP facilities
    are installed on the host system. The feature is s390-specific and is
-   represented as a parameter of the -cpu option on the QEMU command line:

docs/system/vfio-ap.rst facilities: · line 503

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +3 -3
+   represented as a parameter of the -cpu option on the QEMU command line::
 
       qemu-system-s390x -cpu $model,ap=on|off
 
-      Where:
+   Where:
 
-         $model is the CPU model defined for the guest (defaults to the model of
-                the host system if not specified).
+      $model

Formatting $model and ap=on|off with `` `` would look nicer I think (ditto below)

thanks
-- PMM

#8 lore raw

Re: [PATCH RFC 2/2] docs: rstfy vfio-ap documentation

Quoted 42 lines · On Fri, 7 Feb 2020 12:43:03 +0000 Peter Maydell <[email protected]>…
Quoted 25 lines · Cornelia Huck

Move to system/, as this is mostly about configuring vfio-ap.

docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +0 -9
similarity index 56%
rename from docs/vfio-ap.txt
rename to docs/system/vfio-ap.rst
index b1eb2deeaf2f..c8c5728e0aaa 100644
@@ -1,17 +1,17 @@
 Adjunct Processor (AP) Device
 =============================
 
-Contents:
-=========
-* Introduction
-* AP Architectural Overview
-* Start Interpretive Execution (SIE) Instruction
-* AP Matrix Configuration on Linux Host
-* Starting a Linux Guest Configured with an AP Matrix
-* Example: Configure AP Matrices for Three Linux Guests  
-> -Introduction:  

docs/system/vfio-ap.rst line 12

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +9 -1
-============
+Contents
+--------
+* `Introduction`_
+* `AP Architectural Overview`_
+* `Start Interpretive Execution (SIE) Instruction`_
+* `AP Matrix Configuration on Linux Host`_
+* `Starting a Linux Guest Configured with an AP Matrix`_
+* `Example: Configure AP Matrices for Three Linux Guests`_
+  

You don't need to manually write out a table of contents. You can just have one line

.. contents::

Quoted 8 lines

and Sphinx will produce an autogenerated table of contents (including a 'Contents' title) for you.

https://docutils.sourceforge.io/docs/ref/rst/directives.html#table-of-contents

An example where we already use this is
docs/interop/live-block-operations.rst:
https://www.qemu.org/docs/master/interop/live-block-operations.html

Oh, nice, will do. (Not sure how useful this was in the text document, anyway.)

Quoted 49 lines

docs/system/vfio-ap.rst line 14

Quoted 4 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +2 -0
+Introduction
+------------  

rST doesn't require it, but I'd recommend a blank line below the ---- line; I think it makes the source more readable.

Quoted 25 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +3 -3
 The IBM Adjunct Processor (AP) Cryptographic Facility is comprised
 of three AP instructions and from 1 to 256 PCIe cryptographic adapter cards.
 These AP devices provide cryptographic functions to all CPUs assigned to a
@@ -21,8 +21,8 @@ On s390x, AP adapter cards are exposed via the AP bus. This document
 describes how those cards may be made available to KVM guests using the
 VFIO mediated device framework.
 
-AP Architectural Overview:
-=========================
+AP Architectural Overview
+-------------------------
 In order understand the terminology used in the rest of this document, let's
 start with some definitions:
 
@@ -75,7 +75,7 @@ start with some definitions:
   must be one of the control domains.
 
 Start Interpretive Execution (SIE) Instruction
-==============================================
+----------------------------------------------
 A KVM guest is started by executing the Start Interpretive Execution (SIE)
 instruction. The SIE state description is a control block that contains the
 state information for a KVM guest and is supplied as input to the SIE
@@ -114,246 +114,254 @@ The APQNs can provide secure key functionality - i.e., a private key is stored
 on the adapter card for each of its domains - so each APQN must be assigned to

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 120

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +4 -4
 at most one guest or the linux host.
 
-   Example 1: Valid configuration:
-   ------------------------------
-   Guest1: adapters 1,2  domains 5,6
-   Guest2: adapter  1,2  domain 7
+Example 1: Valid configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2  domains 5,6
+Guest2: adapter  1,2  domain 7  

These don't render correctly -- rST thinks the "Example 1..." line is a subsection heading because of the underlining, and then renders the next two lines as runon-text:
"Guest1: adapters 1,2 domains 5,6 Guest2: adapter 1,2 domain 7"

Quoted 5 lines

Depending on what you want, you could try one of:
* use a literal block (which gets you fixed-width font, preserved whitespace and linebreaks)
* use a bulleted list
* use one of rST's table formats

Hm... I think this is supposed to be:
- header ("Example 1: ...")
- config
- explanation why this is a valid config

Maybe a table? Tony, any preferences?

Quoted 2 lines

(is it deliberate that line 1 is "adapters" and line 2 is "adapter" ?)

I don't think so.

Quoted 29 lines
Quoted 11 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +3 -6
-   This is valid because both guests have a unique set of APQNs: Guest1 has
-   APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).
+This is valid because both guests have a unique set of APQNs: Guest1 has
+APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).
 
-   Example 2: Valid configuration:
-   ------------------------------
-   Guest1: adapters 1,2 domains 5,6
-   Guest2: adapters 3,4 domains 5,6
+Example 2: Valid configuration

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 132

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +6 -3
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2 domains 5,6
+Guest2: adapters 3,4 domains 5,6
 
-   This is also valid because both guests have a unique set of APQNs:
-      Guest1 has APQNs (1,5), (1,6), (2,5), (2,6);
-      Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)
+This is also valid because both guests have a unique set of APQNs:
+   Guest1 has APQNs (1,5), (1,6), (2,5), (2,6);
+   Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)  

This is differently rendered from the equivalent text in example 1, because of the indent -- rST treats the 2 indented lines as a block quote, and indents them in the output, but flows the text into one long line.

I think personally I'd opt to render like this:

Quoted 7 lines

This is also valid because both guests have a unique set of APQNs:

* Guest1 has APQNs (1,5), (1,6), (2,5), (2,6)
* Guest2 has APQNs (3,5), (3,6), (4,5), (4,6)

(ie a bulleted list); but anyway consistency between the examples would be good.

Nod. The indentation in the document was a bit inconsistent, it just did not matter before.

Quoted 34 lines
Quoted 21 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +6 -11
-   Example 3: Invalid configuration:
-   --------------------------------
-   Guest1: adapters 1,2  domains 5,6
-   Guest2: adapter  1    domains 6,7
+Example 3: Invalid configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2  domains 5,6
+Guest2: adapter  1    domains 6,7
 
-   This is an invalid configuration because both guests have access to
-   APQN (1,6).
+This is an invalid configuration because both guests have access to
+APQN (1,6).  
 
-      * Individual bits in the mask can be switched on and off by specifying
-        each bit number to be switched in a comma separated list. Each bit
-        number string must be prepended with a ('+') or minus ('-') to indicate
-        the corresponding bit is to be switched on ('+') or off ('-'). Some
-        valid values are:

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +5 -0
+    * Individual bits in the mask can be switched on and off by specifying
+      each bit number to be switched in a comma separated list. Each bit
+      number string must be prepended with a ('+') or minus ('-') to indicate
+      the corresponding bit is to be switched on ('+') or off ('-'). Some
+      valid values are::
 
            "+0"    switches bit 0 on
            "-13"   switches bit 13 off
            "+0x41" switches bit 65 on
            "-0xff" switches bit 255 off  

Maybe use a definition list here rather than a literal block?

Quoted 8 lines

valid values are:

``+0``
switches bit 0 on
``-13``
switches bit 13 off

etc. The literal block is fine if you think it looks better though.

Not sure if a definition list for something that is basically a list of examples makes sense. Will check how it renders.

Quoted 9 lines

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 358

Quoted 4 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +0 -0
 assign_adapter  

Since these are filenames, you can enclose them in `` `` and they'll render as fixed-width text, which I think makes them stand out a bit better in the HTML. I'm pretty sure this works even in the term part of a definition list.

That's probably a good idea, will check.

Quoted 4 lines

Not in this diff, but should the 'No APQN...' para in the assign_domain docs really be a 2nd para of the preceding bullet point rather than either its own bullet point or a paragraph outside the bulleted list ?

Will also check, I mostly converted this document via a whack-a-mole approach.

Quoted 16 lines

(ditto for assign_domain)

Quoted 12 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +2 -2
@@ -486,20 +494,22 @@ facilities:
    The AP facilities feature indicates that AP facilities are installed on the
    guest. This feature will be exposed for use only if the AP facilities
    are installed on the host system. The feature is s390-specific and is
-   represented as a parameter of the -cpu option on the QEMU command line:
+   represented as a parameter of the -cpu option on the QEMU command line::
 
       qemu-system-s390x -cpu $model,ap=on|off
 
-      Where:
+   Where:
 
Quoted 6 lines

docs/system/vfio-ap.rst facilities: · line 503

Quoted 3 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +1 -2
-         $model is the CPU model defined for the guest (defaults to the model of
-                the host system if not specified).
+      $model  

Formatting $model and ap=on|off with `` `` would look nicer I think (ditto below)

Yep, I'll check if there is anything else that should be fixed-width.

Quoted 4 lines

thanks
-- PMM

Thanks for looking!

#9 lore raw

Re: [PATCH RFC 2/2] docs: rstfy vfio-ap documentation

Quoted 39 lines · On Fri, 7 Feb 2020 16:32:18 +0100 Cornelia Huck <[email protected]> wrote:
Quoted 20 lines · On Fri, 7 Feb 2020 12:43:03 +0000 Peter Maydell <[email protected]>…

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 120

Quoted 13 lines · Cornelia Huck

Move to system/, as this is mostly about configuring vfio-ap.

docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +4 -4
-   Example 1: Valid configuration:
-   ------------------------------
-   Guest1: adapters 1,2  domains 5,6
-   Guest2: adapter  1,2  domain 7
+Example 1: Valid configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Guest1: adapters 1,2  domains 5,6
+Guest2: adapter  1,2  domain 7    

These don't render correctly -- rST thinks the "Example 1..." line is a subsection heading because of the underlining, and then renders the next two lines as runon-text:
"Guest1: adapters 1,2 domains 5,6 Guest2: adapter 1,2 domain 7"

Quoted 5 lines

Depending on what you want, you could try one of:
* use a literal block (which gets you fixed-width font, preserved whitespace and linebreaks)
* use a bulleted list
* use one of rST's table formats

Hm... I think this is supposed to be:
- header ("Example 1: ...")
- config
- explanation why this is a valid config

Maybe a table? Tony, any preferences?

Quoted 2 lines

(is it deliberate that line 1 is "adapters" and line 2 is "adapter" ?)

Quoted 7 lines

I don't think so.

Quoted 5 lines

docs/system/vfio-ap.rst The APQNs can provide secure key functionality - i.e., a private key is stored · line 123

Quoted 5 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +2 -2
-   This is valid because both guests have a unique set of APQNs: Guest1 has
-   APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).
+This is valid because both guests have a unique set of APQNs: Guest1 has
+APQNs (1,5), (1,6), (2,5) and (2,6); Guest2 has APQNs (1,7) and (2,7).

This section now looks like this:

Example 1: Valid configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+----------+--------+--------+                                                  
|          | Guest1 | Guest2 |                                                  
+==========+========+========+                                                  
| adapters |  1, 2  |  1, 2  |                                                  
+----------+--------+--------+                                                  
| domains  |  5, 6  |  7     |                                                  
+----------+--------+--------+                                                  

This is valid because both guests have a unique set of APQNs:

* Guest1 has APQNs (1,5), (1,6), (2,5) and (2,6);
* Guest2 has APQNs (1,7) and (2,7).

Seems more readable to me, also in the rendered html. (Not sure if switching rows/columns would be better.)

#10 lore raw

Re: [PATCH RFC 2/2] docs: rstfy vfio-ap documentation

In reply to Cornelia Huck
Quoted 56 lines · On Tue, 28 Jan 2020 19:01:42 +0100 Cornelia Huck <[email protected]> wrote:

Move to system/, as this is mostly about configuring vfio-ap.

---
 MAINTAINERS                              |   2 +-
 docs/system/index.rst                    |   1 +
 docs/{vfio-ap.txt => system/vfio-ap.rst} | 755 ++++++++++++-----------
 3 files changed, 387 insertions(+), 371 deletions(-)
 rename docs/{vfio-ap.txt => system/vfio-ap.rst} (56%)
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +12 -30
-Example: Configure AP Matrixes for Three Linux Guests:
-=====================================================
+Example: Configure AP Matrices for Three Linux Guests
+-----------------------------------------------------
 Let's now provide an example to illustrate how KVM guests may be given
 access to AP facilities. For this example, we will show how to configure
 three guests such that executing the lszcrypt command on the guests would
-look like this:
-
-Guest1
-------
-CARD.DOMAIN TYPE  MODE
-------------------------------
-05          CEX5C CCA-Coproc
-05.0004     CEX5C CCA-Coproc
-05.00ab     CEX5C CCA-Coproc
-06          CEX5A Accelerator
-06.0004     CEX5A Accelerator
-06.00ab     CEX5C CCA-Coproc
-
-Guest2
-------
-CARD.DOMAIN TYPE  MODE
-------------------------------
-05          CEX5A Accelerator
-05.0047     CEX5A Accelerator
-05.00ff     CEX5A Accelerator (5,4), (5,171), (6,4), (6,171),
-
-Guest3
-------
-CARD.DOMAIN TYPE  MODE
-------------------------------
-06          CEX5A Accelerator
-06.0047     CEX5A Accelerator
-06.00ff     CEX5A Accelerator
+look like this::
+
+  Guest1
+  ------
+  CARD.DOMAIN TYPE  MODE
+  ------------------------------
+  05          CEX5C CCA-Coproc
+  05.0004     CEX5C CCA-Coproc
+  05.00ab     CEX5C CCA-Coproc
+  06          CEX5A Accelerator

docs/system/vfio-ap.rst The command will fail if: · line 650

Quoted 10 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +10 -0
+  06.0004     CEX5A Accelerator
+  06.00ab     CEX5C CCA-Coproc
+
+  Guest2
+  ------
+  CARD.DOMAIN TYPE  MODE
+  ------------------------------
+  05          CEX5A Accelerator
+  05.0047     CEX5A Accelerator
+  05.00ff     CEX5A Accelerator (5,4), (5,171), (6,4), (6,171),

Just noticed this trailing stuff (had already been in the original file). Looks like a stray paste, will remove.

Quoted 8 lines
docs/system/vfio-ap.rst renamed from docs/vfio-ap.txt +8 -0
+
+  Guest3
+  ------
+  CARD.DOMAIN TYPE  MODE
+  ------------------------------
+  06          CEX5A Accelerator
+  06.0047     CEX5A Accelerator
+  06.00ff     CEX5A Accelerator
#11 lore raw
In reply to Cornelia Huck
Quoted 21 lines · On Tue, 28 Jan 2020 19:01:40 +0100 Cornelia Huck <[email protected]> wrote:

https://qemu.readthedocs.io/en/latest/index.html collects various documents from the QEMU docs/ subdirectory; however, none of the s390 files are currently included. Therefore, I set out to convert the existing files to rst and hook them up.

s390-dasd-ipl was straightforward enough; I also found a numbering issue.

vfio-ap was quite a bit more involved, but I hope I have produced something readable (would benefit from some more review). I also moved this into the system/ subdirectory; not sure if that is the best resting place, but it seemed to be the most reasonable one.

Tested via running 'make html' and inspecting the output.

Branch: https://github.com/cohuck/qemu rstfy-s390

Cornelia Huck (2):
docs: rstfy s390 dasd ipl documentation
docs: rstfy vfio-ap documentation

Quoted 9 lines
 MAINTAINERS                                   |   4 +-
 docs/devel/index.rst                          |   1 +
 .../{s390-dasd-ipl.txt => s390-dasd-ipl.rst}  |  65 +-
 docs/system/index.rst                         |   1 +
 docs/{vfio-ap.txt => system/vfio-ap.rst}      | 755 +++++++++---------
 5 files changed, 424 insertions(+), 402 deletions(-)
 rename docs/devel/{s390-dasd-ipl.txt => s390-dasd-ipl.rst} (77%)
 rename docs/{vfio-ap.txt => system/vfio-ap.rst} (56%)

Friendly ping. Anybody got some spare cycles to look at this?