Skip to contentSkip to conversation

docs/specs: Convert txt files to rST

PATCH In review Peter Maydell 5 participants 23 messages Sep 27, 2023 – Nov 8, 2023

lore
Share & tools
lore
#0 lore raw

cover docs/specs: Convert txt files to rST

This patchseries converts most of the remaining .txt files in docs/specs to rST format and integrates tem with our documentation. (The one remaining .txt file is rocker.txt, which I left to do later because at over 1000 lines it is much bigger than these.)

These are mostly simple conversions with not too much effort put into the formatting/markup. In a few cases I dropped parts of the text already covered elsewhere or made light fixes for grammar/spelling; see individual patch commit messages for more detail.

thanks
-- PMM

Peter Maydell (8):
docs/specs/vmw_pvscsi-spec: Convert to rST
docs/specs/edu: Convert to rST
docs/specs/ivshmem-spec: Convert to rST
docs/specs/pvpanic: Convert to rST
docs/specs/standard-vga: Convert to rST
docs/specs/virt-ctlr: Convert to rST
docs/specs/vmcoreinfo: Convert to rST
docs/specs/vmgenid: Convert to rST

 MAINTAINERS                                   |   5 +-
 docs/specs/{edu.txt => edu.rst}               |  84 +++---
 docs/specs/index.rst                          |   8 +
 .../{ivshmem-spec.txt => ivshmem-spec.rst}    |  63 ++---
 docs/specs/pci-ids.rst                        |   2 +-
 docs/specs/{pvpanic.txt => pvpanic.rst}       |  41 ++-
 docs/specs/standard-vga.rst                   |  94 +++++++
 docs/specs/standard-vga.txt                   |  81 ------
 docs/specs/{virt-ctlr.txt => virt-ctlr.rst}   |  12 +-
 docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} |  33 +--
 docs/specs/vmgenid.rst                        | 246 ++++++++++++++++++
 docs/specs/vmgenid.txt                        | 245 -----------------
 docs/specs/vmw_pvscsi-spec.rst                | 115 ++++++++
 docs/specs/vmw_pvscsi-spec.txt                |  92 -------
 docs/system/devices/ivshmem.rst               |   2 +-
 hw/display/vga-isa.c                          |   2 +-
 hw/display/vga-pci.c                          |   2 +-
 17 files changed, 595 insertions(+), 532 deletions(-)
 rename docs/specs/{edu.txt => edu.rst} (64%)
 rename docs/specs/{ivshmem-spec.txt => ivshmem-spec.rst} (88%)
 rename docs/specs/{pvpanic.txt => pvpanic.rst} (64%)
 create mode 100644 docs/specs/standard-vga.rst
 delete mode 100644 docs/specs/standard-vga.txt
 rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)
 rename docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} (50%)
 create mode 100644 docs/specs/vmgenid.rst
 delete mode 100644 docs/specs/vmgenid.txt
 create mode 100644 docs/specs/vmw_pvscsi-spec.rst
 delete mode 100644 docs/specs/vmw_pvscsi-spec.txt
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/8 docs/specs/vmw_pvscsi-spec: Convert to rST

Convert the docs/specs/vmw_pvscsi-spec.txt file to rST format. This conversion includes some minor wordsmithing of the text to fix some grammar nits.

---
The number of lines changed for markup formatting was such a large amount of the document that it didn't seem worth breaking out the wording tweaks separately...

---
 MAINTAINERS                    |   1 +
 docs/specs/index.rst           |   1 +
 docs/specs/vmw_pvscsi-spec.rst | 115 +++++++++++++++++++++++++++++++++
 docs/specs/vmw_pvscsi-spec.txt |  92 --------------------------
 4 files changed, 117 insertions(+), 92 deletions(-)
 create mode 100644 docs/specs/vmw_pvscsi-spec.rst
 delete mode 100644 docs/specs/vmw_pvscsi-spec.txt
MAINTAINERS +1 -0
index 355b1960ce4..e0e23907871 100644
@@ -2283,6 +2283,7 @@ S: Maintained
 F: hw/net/vmxnet*
 F: hw/scsi/vmw_pvscsi*
 F: tests/qtest/vmxnet3-test.c
+F: docs/specs/vwm_pvscsi-spec.rst
 
 Rocker
 M: Jiri Pirko <[email protected]>
docs/specs/index.rst +1 -0
index e58be38c41c..d23efbe2480 100644
@@ -24,3 +24,4 @@ guest hardware that is specific to QEMU.
    acpi_erst
    sev-guest-firmware
    fw_cfg
+   vmw_pvscsi-spec
docs/specs/vmw_pvscsi-spec.rst new file +115 -0

115 lines not on this page · raw message

docs/specs/vmw_pvscsi-spec.txt deleted +0 -92

92 lines not on this page · raw message

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

Re: [PATCH 1/8] docs/specs/vmw_pvscsi-spec: Convert to rST

Quoted 9 lines · Peter Maydell

Convert the docs/specs/vmw_pvscsi-spec.txt file to rST format. This conversion includes some minor wordsmithing of the text to fix some grammar nits.

---
The number of lines changed for markup formatting was such a large amount of the document that it didn't seem worth breaking out the wording tweaks separately...

Quoted 8 lines
---
  MAINTAINERS                    |   1 +
  docs/specs/index.rst           |   1 +
  docs/specs/vmw_pvscsi-spec.rst | 115 +++++++++++++++++++++++++++++++++
  docs/specs/vmw_pvscsi-spec.txt |  92 --------------------------
  4 files changed, 117 insertions(+), 92 deletions(-)

create mode 100644 docs/specs/vmw_pvscsi-spec.rst delete mode 100644 docs/specs/vmw_pvscsi-spec.txt

#3 lore raw

PATCH 2/8 docs/specs/edu: Convert to rST

In reply to Peter Maydell

Convert docs/specs/edu.txt to rST format.

---
 MAINTAINERS                     |  1 +
 docs/specs/{edu.txt => edu.rst} | 84 ++++++++++++++++++++-------------
 docs/specs/index.rst            |  1 +
 3 files changed, 54 insertions(+), 32 deletions(-)
 rename docs/specs/{edu.txt => edu.rst} (64%)
MAINTAINERS +1 -0
index e0e23907871..9e27cad11c3 100644
@@ -1825,6 +1825,7 @@ EDU
 M: Jiri Slaby <[email protected]>
 S: Maintained
 F: hw/misc/edu.c
+F: docs/specs/edu.rst
 
 IDE
 M: John Snow <[email protected]>
docs/specs/edu.rst renamed from docs/specs/edu.txt +52 -32

137 lines not on this page · raw message

docs/specs/index.rst +1 -0
index d23efbe2480..30a0cf3d47e 100644
@@ -25,3 +25,4 @@ guest hardware that is specific to QEMU.
    sev-guest-firmware
    fw_cfg
    vmw_pvscsi-spec
+   edu
Signature · 1 line
2.34.1
Reviewed-by on v1 2/8
#4 lore raw

Re: [PATCH 2/8] docs/specs/edu: Convert to rST

Quoted 9 lines · Peter Maydell

Convert docs/specs/edu.txt to rST format.

---
  MAINTAINERS                     |  1 +
  docs/specs/{edu.txt => edu.rst} | 84 ++++++++++++++++++++-------------
  docs/specs/index.rst            |  1 +
  3 files changed, 54 insertions(+), 32 deletions(-)

rename docs/specs/{edu.txt => edu.rst} (64%)

#5 lore raw

PATCH 3/8 docs/specs/ivshmem-spec: Convert to rST

In reply to Peter Maydell

Convert docs/specs/ivshmem-spec.txt to rST format.

In converting, I have dropped the sections on the device's command line interface and usage, as they are already covered by the user-facing docs in system/devices/ivshmem.rst.

I have also removed the reference to Memnic, because the URL is dead and a web search suggests that whatever this was it's pretty much sunk without trace.

---
 docs/specs/index.rst                          |  1 +
 .../{ivshmem-spec.txt => ivshmem-spec.rst}    | 63 +++++++------------
 docs/specs/pci-ids.rst                        |  2 +-
 docs/system/devices/ivshmem.rst               |  2 +-
 4 files changed, 26 insertions(+), 42 deletions(-)
 rename docs/specs/{ivshmem-spec.txt => ivshmem-spec.rst} (88%)
docs/specs/index.rst +1 -0
index 30a0cf3d47e..e60c8377541 100644
@@ -26,3 +26,4 @@ guest hardware that is specific to QEMU.
    fw_cfg
    vmw_pvscsi-spec
    edu
+   ivshmem-spec
docs/specs/ivshmem-spec.rst renamed from docs/specs/ivshmem-spec.txt +23 -40

119 lines not on this page · raw message

docs/specs/pci-ids.rst +1 -1
index d6707fa069a..c0a3dec2e7a 100644
@@ -50,7 +50,7 @@ maintained as part of the virtio specification.
   by QEMU.
 
 1af4:1110
-  ivshmem device (shared memory, ``docs/specs/ivshmem-spec.txt``)
+  ivshmem device (:doc:`ivshmem-spec`)
 
 All other device IDs are reserved.
 
docs/system/devices/ivshmem.rst +1 -1
index e7aaf34c200..ce71e256630 100644
@@ -33,7 +33,7 @@ syntax when using the shared memory server is:
 When using the server, the guest will be assigned a VM ID (>=0) that
 allows guests using the same server to communicate via interrupts.
 Guests can read their VM ID from a device register (see
-ivshmem-spec.txt).
+:doc:`../../specs/ivshmem-spec`).
 
 Migration with ivshmem
 ~~~~~~~~~~~~~~~~~~~~~~
Signature · 1 line
2.34.1
Reviewed-by on v1 3/8
#6 lore raw

Re: [PATCH 3/8] docs/specs/ivshmem-spec: Convert to rST

Quoted 10 lines · Peter Maydell

Convert docs/specs/ivshmem-spec.txt to rST format.

In converting, I have dropped the sections on the device's command line interface and usage, as they are already covered by the user-facing docs in system/devices/ivshmem.rst.

I have also removed the reference to Memnic, because the URL is dead and a web search suggests that whatever this was it's pretty much sunk without trace.

Quoted 8 lines
---
  docs/specs/index.rst                          |  1 +
  .../{ivshmem-spec.txt => ivshmem-spec.rst}    | 63 +++++++------------
  docs/specs/pci-ids.rst                        |  2 +-
  docs/system/devices/ivshmem.rst               |  2 +-
  4 files changed, 26 insertions(+), 42 deletions(-)

rename docs/specs/{ivshmem-spec.txt => ivshmem-spec.rst} (88%)

#7 lore raw

PATCH 4/8 docs/specs/pvpanic: Convert to rST

In reply to Peter Maydell

Convert docs/specs/pvpanic.txt to rST format.

---
 docs/specs/index.rst                    |  1 +
 docs/specs/{pvpanic.txt => pvpanic.rst} | 41 ++++++++++++++++---------
 2 files changed, 28 insertions(+), 14 deletions(-)
 rename docs/specs/{pvpanic.txt => pvpanic.rst} (64%)
docs/specs/index.rst +1 -0
index e60c8377541..52bfab2f68b 100644
@@ -27,3 +27,4 @@ guest hardware that is specific to QEMU.
    vmw_pvscsi-spec
    edu
    ivshmem-spec
+   pvpanic
docs/specs/pvpanic.rst renamed from docs/specs/pvpanic.txt +27 -14

60 lines not on this page · raw message

Signature · 1 line
2.34.1
Reviewed-by on v1 4/8
#8 lore raw

Re: [PATCH 4/8] docs/specs/pvpanic: Convert to rST

Quoted 8 lines · Peter Maydell

Convert docs/specs/pvpanic.txt to rST format.

---
  docs/specs/index.rst                    |  1 +
  docs/specs/{pvpanic.txt => pvpanic.rst} | 41 ++++++++++++++++---------
  2 files changed, 28 insertions(+), 14 deletions(-)

rename docs/specs/{pvpanic.txt => pvpanic.rst} (64%)

$ ./scripts/get_maintainer.pl -f hw/misc/pvpanic.c
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
$ ./scripts/get_maintainer.pl -f docs/specs/pvpanic.txt
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.

No clue who should maintain that.

#9 lore raw

PATCH 5/8 docs/specs/standard-vga: Convert to rST

In reply to Peter Maydell

Convert docs/specs/standard-vga.txt to rST format.

---
 docs/specs/index.rst        |  1 +
 docs/specs/standard-vga.rst | 94 +++++++++++++++++++++++++++++++++++++
 docs/specs/standard-vga.txt | 81 --------------------------------
 hw/display/vga-isa.c        |  2 +-
 hw/display/vga-pci.c        |  2 +-
 5 files changed, 97 insertions(+), 83 deletions(-)
 create mode 100644 docs/specs/standard-vga.rst
 delete mode 100644 docs/specs/standard-vga.txt
docs/specs/index.rst +1 -0
index 52bfab2f68b..ee84b8109d6 100644
@@ -28,3 +28,4 @@ guest hardware that is specific to QEMU.
    edu
    ivshmem-spec
    pvpanic
+   standard-vga
docs/specs/standard-vga.rst new file +94 -0

94 lines not on this page · raw message

docs/specs/standard-vga.txt deleted +0 -81

81 lines not on this page · raw message

hw/display/vga-isa.c +1 -1
index 2a5437d8037..c096ec93e52 100644
@@ -1,7 +1,7 @@
 /*
  * QEMU ISA VGA Emulator.
  *
- * see docs/specs/standard-vga.txt for virtual hardware specs.
+ * see docs/specs/standard-vga.rst for virtual hardware specs.
  *
  * Copyright (c) 2003 Fabrice Bellard
  *
hw/display/vga-pci.c +1 -1
index b351b8f299d..e4f45b4476d 100644
@@ -1,7 +1,7 @@
 /*
  * QEMU PCI VGA Emulator.
  *
- * see docs/specs/standard-vga.txt for virtual hardware specs.
+ * see docs/specs/standard-vga.rst for virtual hardware specs.
  *
  * Copyright (c) 2003 Fabrice Bellard
  *
Signature · 1 line
2.34.1
Reviewed-by on v1 5/8
#10 lore raw

Re: [PATCH 5/8] docs/specs/standard-vga: Convert to rST

Quoted 10 lines · Peter Maydell

Convert docs/specs/standard-vga.txt to rST format.

---
  docs/specs/index.rst        |  1 +
  docs/specs/standard-vga.rst | 94 +++++++++++++++++++++++++++++++++++++
  docs/specs/standard-vga.txt | 81 --------------------------------
  hw/display/vga-isa.c        |  2 +-
  hw/display/vga-pci.c        |  2 +-
  5 files changed, 97 insertions(+), 83 deletions(-)
Quoted 2 lines

create mode 100644 docs/specs/standard-vga.rst
delete mode 100644 docs/specs/standard-vga.txt

$ ./scripts/get_maintainer.pl -f docs/specs/standard-vga.txt
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.

./scripts/get_maintainer.pl -f hw/display/vga-isa.c Gerd Hoffmann <[email protected]> (maintainer:Standard VGA) [email protected] (open list:All patches CC here)

Cc'ing Gerd.

Maybe worth squashing:

-- >8 --

MAINTAINERS +1 -1
index cd8d6b140f..1fdaaad072 100644
@@ -2466,6 +2466,7 @@ F: hw/display/vga*
 F: hw/display/bochs-display.c
 F: include/hw/display/vga.h
 F: include/hw/display/bochs-vbe.h
+F: docs/specs/standard-vga.rst
 
---
 
Quoted 222 lines
docs/specs/index.rst +1 -0
index 52bfab2f68b..ee84b8109d6 100644
@@ -28,3 +28,4 @@ guest hardware that is specific to QEMU.
     edu
     ivshmem-spec
     pvpanic
+   standard-vga
docs/specs/standard-vga.rst new file +94 -0
new file mode 100644
index 00000000000..992f429ced1
@@ -0,0 +1,94 @@
+
+QEMU Standard VGA
+=================
+
+Exists in two variants, for isa and pci.
+
+command line switches:
+
+``-vga std``
+   picks isa for -M isapc, otherwise pci
+``-device VGA``
+   pci variant
+``-device isa-vga``
+   isa variant
+``-device secondary-vga``
+   legacy-free pci variant
+
+
+PCI spec
+--------
+
+Applies to the pci variant only for obvious reasons.
+
+PCI ID
+   ``1234:1111``
+
+PCI Region 0
+   Framebuffer memory, 16 MB in size (by default).
+   Size is tunable via vga_mem_mb property.
+
+PCI Region 1
+   Reserved (so we have the option to make the framebuffer bar 64bit).
+
+PCI Region 2
+   MMIO bar, 4096 bytes in size (QEMU 1.3+)
+
+PCI ROM Region
+   Holds the vgabios (QEMU 0.14+).
+
+
+The legacy-free variant has no ROM and has ``PCI_CLASS_DISPLAY_OTHER``
+instead of ``PCI_CLASS_DISPLAY_VGA``.
+
+
+IO ports used
+-------------
+
+Doesn't apply to the legacy-free pci variant, use the MMIO bar instead.
+
+``03c0 - 03df``
+   standard vga ports
+``01ce``
+   bochs vbe interface index port
+``01cf``
+   bochs vbe interface data port (x86 only)
+``01d0``
+   bochs vbe interface data port
+
+
+Memory regions used
+-------------------
+
+``0xe0000000``
+  Framebuffer memory, isa variant only.
+
+The pci variant used to mirror the framebuffer bar here, QEMU 0.14+
+stops doing that (except when in ``-M pc-$old`` compat mode).
+
+
+MMIO area spec
+--------------
+
+Likewise applies to the pci variant only for obvious reasons.
+
+``0000 - 03ff``
+  edid data blob.
+``0400 - 041f``
+  vga ioports (``0x3c0`` to ``0x3df``), remapped 1:1. Word access
+  is supported, bytes are written in little endian order (aka index
+  port first),  so indexed registers can be updated with a single
+  mmio write (and thus only one vmexit).
+``0500 - 0515``
+  bochs dispi interface registers, mapped flat without index/data ports.
+  Use ``(index << 1)`` as offset for (16bit) register access.
+``0600 - 0607``
+  QEMU extended registers.  QEMU 2.2+ only.
+  The pci revision is 2 (or greater) when these registers are present.
+  The registers are 32bit.
+``0600``
+  QEMU extended register region size, in bytes.
+``0604``
+  framebuffer endianness register.
+  - ``0xbebebebe`` indicates big endian.
+  - ``0x1e1e1e1e`` indicates little endian.
docs/specs/standard-vga.txt deleted +0 -81
deleted file mode 100644
index 18f75f1b302..00000000000
@@ -1,81 +0,0 @@
-
-QEMU Standard VGA
-=================
-
-Exists in two variants, for isa and pci.
-
-command line switches:
-    -vga std               [ picks isa for -M isapc, otherwise pci ]
-    -device VGA            [ pci variant ]
-    -device isa-vga        [ isa variant ]
-    -device secondary-vga  [ legacy-free pci variant ]
-
-
-PCI spec
---------
-
-Applies to the pci variant only for obvious reasons.
-
-PCI ID: 1234:1111
-
-PCI Region 0:
-   Framebuffer memory, 16 MB in size (by default).
-   Size is tunable via vga_mem_mb property.
-
-PCI Region 1:
-   Reserved (so we have the option to make the framebuffer bar 64bit).
-
-PCI Region 2:
-   MMIO bar, 4096 bytes in size (qemu 1.3+)
-
-PCI ROM Region:
-   Holds the vgabios (qemu 0.14+).
-
-
-The legacy-free variant has no ROM and has PCI_CLASS_DISPLAY_OTHER
-instead of PCI_CLASS_DISPLAY_VGA.
-
-
-IO ports used
--------------
-
-Doesn't apply to the legacy-free pci variant, use the MMIO bar instead.
-
-03c0 - 03df : standard vga ports
-01ce        : bochs vbe interface index port
-01cf        : bochs vbe interface data port (x86 only)
-01d0        : bochs vbe interface data port
-
-
-Memory regions used
--------------------
-
-0xe0000000 : Framebuffer memory, isa variant only.
-
-The pci variant used to mirror the framebuffer bar here, qemu 0.14+
-stops doing that (except when in -M pc-$old compat mode).
-
-
-MMIO area spec
---------------
-
-Likewise applies to the pci variant only for obvious reasons.
-
-0000 - 03ff : edid data blob.
-0400 - 041f : vga ioports (0x3c0 -> 0x3df), remapped 1:1.
-              word access is supported, bytes are written
-              in little endia order (aka index port first),
-              so indexed registers can be updated with a
-              single mmio write (and thus only one vmexit).
-0500 - 0515 : bochs dispi interface registers, mapped flat
-              without index/data ports.  Use (index << 1)
-              as offset for (16bit) register access.
-
-0600 - 0607 : qemu extended registers.  qemu 2.2+ only.
-              The pci revision is 2 (or greater) when
-              these registers are present.  The registers
-              are 32bit.
-  0600      : qemu extended register region size, in bytes.
-  0604      : framebuffer endianness register.
-              - 0xbebebebe indicates big endian.
-              - 0x1e1e1e1e indicates little endian.
hw/display/vga-isa.c +1 -1
index 2a5437d8037..c096ec93e52 100644
@@ -1,7 +1,7 @@
  /*
   * QEMU ISA VGA Emulator.
   *
- * see docs/specs/standard-vga.txt for virtual hardware specs.
+ * see docs/specs/standard-vga.rst for virtual hardware specs.
   *
   * Copyright (c) 2003 Fabrice Bellard
   *
hw/display/vga-pci.c +1 -1
index b351b8f299d..e4f45b4476d 100644
@@ -1,7 +1,7 @@
  /*
   * QEMU PCI VGA Emulator.
   *
- * see docs/specs/standard-vga.txt for virtual hardware specs.
+ * see docs/specs/standard-vga.rst for virtual hardware specs.
   *
   * Copyright (c) 2003 Fabrice Bellard
   *
#11 lore raw

PATCH 6/8 docs/specs/virt-ctlr: Convert to rST

In reply to Peter Maydell

Convert docs/specs/virt-ctlr.txt to rST format.

I added the name of the device to give readers a bit more idea of which device we're actually documenting here.

---
 docs/specs/index.rst                        |  1 +
 docs/specs/{virt-ctlr.txt => virt-ctlr.rst} | 12 +++++-------
 2 files changed, 6 insertions(+), 7 deletions(-)
 rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)
docs/specs/index.rst +1 -0
index ee84b8109d6..8d30968650b 100644
@@ -29,3 +29,4 @@ guest hardware that is specific to QEMU.
    ivshmem-spec
    pvpanic
    standard-vga
+   virt-ctlr
docs/specs/virt-ctlr.rst renamed from docs/specs/virt-ctlr.txt +5 -7
similarity index 70%
rename from docs/specs/virt-ctlr.txt
rename to docs/specs/virt-ctlr.rst
index 24d38084f7f..ad3edde82d2 100644
@@ -1,9 +1,9 @@
 Virtual System Controller
 =========================
 
-This device is a simple interface defined for the pure virtual machine with no
-hardware reference implementation to allow the guest kernel to send command
-to the host hypervisor.
+The ``virt-ctrl`` device is a simple interface defined for the pure
+virtual machine with no hardware reference implementation to allow the
+guest kernel to send command to the host hypervisor.
 
 The specification can evolve, the current state is defined as below.
 
@@ -11,14 +11,12 @@ This is a MMIO mapped device using 256 bytes.
 
 Two 32bit registers are defined:
 
-1- the features register (read-only, address 0x00)
-
+the features register (read-only, address 0x00)
    This register allows the device to report features supported by the
    controller.
    The only feature supported for the moment is power control (0x01).
 
-2- the command register (write-only, address 0x04)
-
+the command register (write-only, address 0x04)
    This register allows the kernel to send the commands to the hypervisor.
    The implemented commands are part of the power control feature and
    are reset (1), halt (2) and panic (3).
Signature · 1 line
2.34.1
Reviewed-by on v1 6/8
#12 lore raw

Re: [PATCH 6/8] docs/specs/virt-ctlr: Convert to rST

Quoted 11 lines · Peter Maydell

Convert docs/specs/virt-ctlr.txt to rST format.

I added the name of the device to give readers a bit more idea of which device we're actually documenting here.

---
  docs/specs/index.rst                        |  1 +
  docs/specs/{virt-ctlr.txt => virt-ctlr.rst} | 12 +++++-------
  2 files changed, 6 insertions(+), 7 deletions(-)

rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)

$ ./scripts/get_maintainer.pl -f docs/specs/virt-ctlr.txt
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
$ ./scripts/get_maintainer.pl -f hw/misc/virt_ctrl.c
Laurent Vivier <[email protected]> (maintainer:virt)
[email protected] (open list:All patches CC here)

Cc'ing Laurent.

Maybe worth squashing:

-- >8 --

MAINTAINERS +1 -1
index cd8d6b140f..2fe435ea9e 100644
@@ -1283,6 +1283,7 @@ F: include/hw/char/goldfish_tty.h
 F: include/hw/intc/goldfish_pic.h
 F: include/hw/intc/m68k_irqc.h
 F: include/hw/misc/virt_ctrl.h
+F: docs/specs/virt-ctlr.rst
 
---
 
Quoted 17 lines
docs/specs/index.rst +1 -0
index ee84b8109d6..8d30968650b 100644
@@ -29,3 +29,4 @@ guest hardware that is specific to QEMU.
     ivshmem-spec
     pvpanic
     standard-vga
+   virt-ctlr
docs/specs/virt-ctlr.rst renamed from docs/specs/virt-ctlr.txt +0 -0
similarity index 70%
rename from docs/specs/virt-ctlr.txt
rename to docs/specs/virt-ctlr.rst
index 24d38084f7f..ad3edde82d2 100644

docs/specs/virt-ctlr.rst line 4

Quoted 7 lines
docs/specs/virt-ctlr.rst renamed from docs/specs/virt-ctlr.txt +1 -3
@@ -1,9 +1,9 @@
  Virtual System Controller
  =========================
 
-This device is a simple interface defined for the pure virtual machine with no
-hardware reference implementation to allow the guest kernel to send command
-to the host hypervisor.
+The ``virt-ctrl`` device is a simple interface defined for the pure

Clearer.

Quoted 22 lines
docs/specs/virt-ctlr.rst renamed from docs/specs/virt-ctlr.txt +4 -4
+virtual machine with no hardware reference implementation to allow the
+guest kernel to send command to the host hypervisor.
 
  The specification can evolve, the current state is defined as below.
 
@@ -11,14 +11,12 @@ This is a MMIO mapped device using 256 bytes.
 
  Two 32bit registers are defined:
 
-1- the features register (read-only, address 0x00)
-
+the features register (read-only, address 0x00)
     This register allows the device to report features supported by the
     controller.
     The only feature supported for the moment is power control (0x01).
 
-2- the command register (write-only, address 0x04)
-
+the command register (write-only, address 0x04)
     This register allows the kernel to send the commands to the hypervisor.
     The implemented commands are part of the power control feature and
     are reset (1), halt (2) and panic (3).
#13 lore raw

Re: [PATCH 6/8] docs/specs/virt-ctlr: Convert to rST

Quoted 19 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Peter Maydell

Convert docs/specs/virt-ctlr.txt to rST format.

I added the name of the device to give readers a bit more idea of which device we're actually documenting here.

---
  docs/specs/index.rst                        |  1 +
  docs/specs/{virt-ctlr.txt => virt-ctlr.rst} | 12 +++++-------
  2 files changed, 6 insertions(+), 7 deletions(-)

rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)

$ ./scripts/get_maintainer.pl -f docs/specs/virt-ctlr.txt
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
Quoted 5 lines
$ ./scripts/get_maintainer.pl -f hw/misc/virt_ctrl.c
Laurent Vivier <[email protected]> (maintainer:virt)
[email protected] (open list:All patches CC here)

Cc'ing Laurent.

That raises the question, is it intentional that the doc is virt-ctlr but the source file is virt-ctrl ? Should we rename one of them (looks like the doc, so easy enough to do as part of this patch)?

thanks
-- PMM

#14 lore raw

Re: [PATCH 6/8] docs/specs/virt-ctlr: Convert to rST

Quoted 24 lines · Peter Maydell
Quoted 23 lines · Philippe Mathieu-Daudé
Quoted 11 lines · Peter Maydell

Convert docs/specs/virt-ctlr.txt to rST format.

I added the name of the device to give readers a bit more idea of which device we're actually documenting here.

---
   docs/specs/index.rst                        |  1 +
   docs/specs/{virt-ctlr.txt => virt-ctlr.rst} | 12 +++++-------
   2 files changed, 6 insertions(+), 7 deletions(-)

rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)

$ ./scripts/get_maintainer.pl -f docs/specs/virt-ctlr.txt
get_maintainer.pl: No maintainers found, printing recent contributors.
get_maintainer.pl: Do not blindly cc: them on patches!  Use common sense.
$ ./scripts/get_maintainer.pl -f hw/misc/virt_ctrl.c
Laurent Vivier <[email protected]> (maintainer:virt)
[email protected] (open list:All patches CC here)
Quoted 6 lines
Quoted 1 line

Cc'ing Laurent.

That raises the question, is it intentional that the doc is virt-ctlr but the source file is virt-ctrl ? Should we rename one of them (looks like the doc, so easy enough to do as part of this patch)?

$ git grep ctlr| wc -l
     430
$ git grep ctrl| wc -l
    4063

Since you are already renaming the file, correcting the typo in the same file seems like a good idea.

#15 lore raw

PATCH 7/8 docs/specs/vmcoreinfo: Convert to rST

In reply to Peter Maydell

Convert docs/specs/vmcoreinfo.txt to rST format.

---
 MAINTAINERS                                   |  1 +
 docs/specs/index.rst                          |  1 +
 docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} | 33 ++++++++++---------
 3 files changed, 19 insertions(+), 16 deletions(-)
 rename docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} (50%)
MAINTAINERS +1 -0
index 9e27cad11c3..23ee617acaf 100644
@@ -2805,6 +2805,7 @@ F: include/sysemu/dump.h
 F: qapi/dump.json
 F: scripts/dump-guest-memory.py
 F: stubs/dump.c
+F: docs/specs/vmcoreinfo.rst
 
 Error reporting
 M: Markus Armbruster <[email protected]>
docs/specs/index.rst +1 -0
index 8d30968650b..7a56ccb2155 100644
@@ -30,3 +30,4 @@ guest hardware that is specific to QEMU.
    pvpanic
    standard-vga
    virt-ctlr
+   vmcoreinfo
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +17 -16
similarity index 50%
rename from docs/specs/vmcoreinfo.txt
rename to docs/specs/vmcoreinfo.rst
index bcbca6fe47c..462b04474d3 100644
@@ -2,19 +2,19 @@
 VMCoreInfo device
 =================
 
-The `-device vmcoreinfo` will create a fw_cfg entry for a guest to
+The ``-device vmcoreinfo`` will create a ``fw_cfg`` entry for a guest to
 store dump details.
 
-etc/vmcoreinfo
-**************
+``etc/vmcoreinfo``
+==================
 
-A guest may use this fw_cfg entry to add information details to qemu
+A guest may use this ``fw_cfg`` entry to add information details to qemu
 dumps.
 
 The entry of 16 bytes has the following layout, in little-endian::
 
-#define VMCOREINFO_FORMAT_NONE 0x0
-#define VMCOREINFO_FORMAT_ELF 0x1
+    #define VMCOREINFO_FORMAT_NONE 0x0
+    #define VMCOREINFO_FORMAT_ELF 0x1
 
     struct FWCfgVMCoreInfo {
         uint16_t host_format;  /* formats host supports */
@@ -26,17 +26,17 @@ The entry of 16 bytes has the following layout, in little-endian::
 Only full write (of 16 bytes) are considered valid for further
 processing of entry values.
 
-A write of 0 in guest_format will disable further processing of
+A write of 0 in ``guest_format`` will disable further processing of
 vmcoreinfo entry values & content.
 
-You may write a guest_format that is not supported by the host, in
+You may write a ``guest_format`` that is not supported by the host, in
 which case the entry data can be ignored by qemu (but you may still
-access it through a debugger, via vmcoreinfo_realize::vmcoreinfo_state).
+access it through a debugger, via ``vmcoreinfo_realize::vmcoreinfo_state``).
 
 Format & content
-****************
+================
 
-As of qemu 2.11, only VMCOREINFO_FORMAT_ELF is supported.
+As of qemu 2.11, only ``VMCOREINFO_FORMAT_ELF`` is supported.
 
 The entry gives location and size of an ELF note that is appended in
 qemu dumps.
@@ -44,10 +44,11 @@ qemu dumps.
 The note format/class must be of the target bitness and the size must
 be less than 1Mb.
 
-If the ELF note name is "VMCOREINFO", it is expected to be the Linux
-vmcoreinfo note (see Documentation/ABI/testing/sysfs-kernel-vmcoreinfo
-in Linux source). In this case, qemu dump code will read the content
-as a key=value text file, looking for "NUMBER(phys_base)" key
+If the ELF note name is ``VMCOREINFO``, it is expected to be the Linux
+vmcoreinfo note (see `the kernel documentation for its format
+<https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-kernel-vmcoreinfo>`_).
+In this case, qemu dump code will read the content
+as a key=value text file, looking for ``NUMBER(phys_base)`` key
 value. The value is expected to be more accurate than architecture
 guess of the value. This is useful for KASLR-enabled guest with
-ancient tools not handling the VMCOREINFO note.
+ancient tools not handling the ``VMCOREINFO`` note.
Signature · 1 line
2.34.1
Reviewed-by on v1 7/8
#16 lore raw

Re: [PATCH 7/8] docs/specs/vmcoreinfo: Convert to rST

Quoted 15 lines · Peter Maydell

Convert docs/specs/vmcoreinfo.txt to rST format.

---
  MAINTAINERS                                   |  1 +
  docs/specs/index.rst                          |  1 +
  docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} | 33 ++++++++++---------
  3 files changed, 19 insertions(+), 16 deletions(-)

rename docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} (50%)

MAINTAINERS +0 -0
index 9e27cad11c3..23ee617acaf 100644

MAINTAINERS F: include/sysemu/dump.h · line 2808

Quoted 4 lines
MAINTAINERS +1 -0
@@ -2805,6 +2805,7 @@ F: include/sysemu/dump.h
  F: qapi/dump.json
  F: scripts/dump-guest-memory.py
  F: stubs/dump.c
+F: docs/specs/vmcoreinfo.rst

Good :)

Cc'ing Marc-André.

Quoted 54 lines
MAINTAINERS +0 -0
  Error reporting
  M: Markus Armbruster <[email protected]>
docs/specs/index.rst +1 -0
index 8d30968650b..7a56ccb2155 100644
@@ -30,3 +30,4 @@ guest hardware that is specific to QEMU.
     pvpanic
     standard-vga
     virt-ctlr
+   vmcoreinfo
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +8 -8
similarity index 50%
rename from docs/specs/vmcoreinfo.txt
rename to docs/specs/vmcoreinfo.rst
index bcbca6fe47c..462b04474d3 100644
@@ -2,19 +2,19 @@
  VMCoreInfo device
  =================
 
-The `-device vmcoreinfo` will create a fw_cfg entry for a guest to
+The ``-device vmcoreinfo`` will create a ``fw_cfg`` entry for a guest to
  store dump details.
 
-etc/vmcoreinfo
-**************
+``etc/vmcoreinfo``
+==================
 
-A guest may use this fw_cfg entry to add information details to qemu
+A guest may use this ``fw_cfg`` entry to add information details to qemu
  dumps.
 
  The entry of 16 bytes has the following layout, in little-endian::
 
-#define VMCOREINFO_FORMAT_NONE 0x0
-#define VMCOREINFO_FORMAT_ELF 0x1
+    #define VMCOREINFO_FORMAT_NONE 0x0
+    #define VMCOREINFO_FORMAT_ELF 0x1
 
      struct FWCfgVMCoreInfo {
          uint16_t host_format;  /* formats host supports */
@@ -26,17 +26,17 @@ The entry of 16 bytes has the following layout, in little-endian::
  Only full write (of 16 bytes) are considered valid for further
  processing of entry values.
 
-A write of 0 in guest_format will disable further processing of
+A write of 0 in ``guest_format`` will disable further processing of
  vmcoreinfo entry values & content.
 
-You may write a guest_format that is not supported by the host, in
+You may write a ``guest_format`` that is not supported by the host, in

docs/specs/vmcoreinfo.rst The entry of 16 bytes has the following layout, in little-endian:: · line 39

Quoted 10 lines
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +3 -3
  which case the entry data can be ignored by qemu (but you may still
-access it through a debugger, via vmcoreinfo_realize::vmcoreinfo_state).
+access it through a debugger, via ``vmcoreinfo_realize::vmcoreinfo_state``).
 
  Format & content
-****************
+================
 
-As of qemu 2.11, only VMCOREINFO_FORMAT_ELF is supported.
+As of qemu 2.11, only ``VMCOREINFO_FORMAT_ELF`` is supported.

Maybe s/qemu/QEMU/, otherwise:

Quoted 19 lines
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +6 -5
  The entry gives location and size of an ELF note that is appended in
  qemu dumps.
@@ -44,10 +44,11 @@ qemu dumps.
  The note format/class must be of the target bitness and the size must
  be less than 1Mb.
 
-If the ELF note name is "VMCOREINFO", it is expected to be the Linux
-vmcoreinfo note (see Documentation/ABI/testing/sysfs-kernel-vmcoreinfo
-in Linux source). In this case, qemu dump code will read the content
-as a key=value text file, looking for "NUMBER(phys_base)" key
+If the ELF note name is ``VMCOREINFO``, it is expected to be the Linux
+vmcoreinfo note (see `the kernel documentation for its format
+<https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-kernel-vmcoreinfo>`_).
+In this case, qemu dump code will read the content
+as a key=value text file, looking for ``NUMBER(phys_base)`` key
  value. The value is expected to be more accurate than architecture
  guess of the value. This is useful for KASLR-enabled guest with
-ancient tools not handling the VMCOREINFO note.
+ancient tools not handling the ``VMCOREINFO`` note.
#17 lore raw

Re: [PATCH 7/8] docs/specs/vmcoreinfo: Convert to rST

Quoted 5 lines · Philippe Mathieu-Daudé
Quoted 3 lines · Peter Maydell

Convert docs/specs/vmcoreinfo.txt to rST format.

Quoted 110 lines
Quoted 12 lines
---
  MAINTAINERS                                   |  1 +
  docs/specs/index.rst                          |  1 +
  docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} | 33 ++++++++++---------
  3 files changed, 19 insertions(+), 16 deletions(-)

rename docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} (50%)

MAINTAINERS +0 -0
index 9e27cad11c3..23ee617acaf 100644

MAINTAINERS F: include/sysemu/dump.h · line 2808

Quoted 4 lines
MAINTAINERS +1 -0
@@ -2805,6 +2805,7 @@ F: include/sysemu/dump.h
  F: qapi/dump.json
  F: scripts/dump-guest-memory.py
  F: stubs/dump.c
+F: docs/specs/vmcoreinfo.rst

Good :)

Cc'ing Marc-André.

Quoted 54 lines
MAINTAINERS +0 -0
  Error reporting
  M: Markus Armbruster <[email protected]>
docs/specs/index.rst +1 -0
index 8d30968650b..7a56ccb2155 100644
@@ -30,3 +30,4 @@ guest hardware that is specific to QEMU.
     pvpanic
     standard-vga
     virt-ctlr
+   vmcoreinfo
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +8 -8
similarity index 50%
rename from docs/specs/vmcoreinfo.txt
rename to docs/specs/vmcoreinfo.rst
index bcbca6fe47c..462b04474d3 100644
@@ -2,19 +2,19 @@
  VMCoreInfo device
  =================
 
-The `-device vmcoreinfo` will create a fw_cfg entry for a guest to
+The ``-device vmcoreinfo`` will create a ``fw_cfg`` entry for a guest to
  store dump details.
 
-etc/vmcoreinfo
-**************
+``etc/vmcoreinfo``
+==================
 
-A guest may use this fw_cfg entry to add information details to qemu
+A guest may use this ``fw_cfg`` entry to add information details to qemu
  dumps.
 
  The entry of 16 bytes has the following layout, in little-endian::
 
-#define VMCOREINFO_FORMAT_NONE 0x0
-#define VMCOREINFO_FORMAT_ELF 0x1
+    #define VMCOREINFO_FORMAT_NONE 0x0
+    #define VMCOREINFO_FORMAT_ELF 0x1
 
      struct FWCfgVMCoreInfo {
          uint16_t host_format;  /* formats host supports */
@@ -26,17 +26,17 @@ The entry of 16 bytes has the following layout, in little-endian::
  Only full write (of 16 bytes) are considered valid for further
  processing of entry values.
 
-A write of 0 in guest_format will disable further processing of
+A write of 0 in ``guest_format`` will disable further processing of
  vmcoreinfo entry values & content.
 
-You may write a guest_format that is not supported by the host, in
+You may write a ``guest_format`` that is not supported by the host, in

docs/specs/vmcoreinfo.rst The entry of 16 bytes has the following layout, in little-endian:: · line 39

Quoted 10 lines
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +3 -3
  which case the entry data can be ignored by qemu (but you may still
-access it through a debugger, via vmcoreinfo_realize::vmcoreinfo_state).
+access it through a debugger, via ``vmcoreinfo_realize::vmcoreinfo_state``).
 
  Format & content
-****************
+================
 
-As of qemu 2.11, only VMCOREINFO_FORMAT_ELF is supported.
+As of qemu 2.11, only ``VMCOREINFO_FORMAT_ELF`` is supported.

Maybe s/qemu/QEMU/, otherwise:

Quoted 19 lines
docs/specs/vmcoreinfo.rst renamed from docs/specs/vmcoreinfo.txt +6 -5
  The entry gives location and size of an ELF note that is appended in
  qemu dumps.
@@ -44,10 +44,11 @@ qemu dumps.
  The note format/class must be of the target bitness and the size must
  be less than 1Mb.
 
-If the ELF note name is "VMCOREINFO", it is expected to be the Linux
-vmcoreinfo note (see Documentation/ABI/testing/sysfs-kernel-vmcoreinfo
-in Linux source). In this case, qemu dump code will read the content
-as a key=value text file, looking for "NUMBER(phys_base)" key
+If the ELF note name is ``VMCOREINFO``, it is expected to be the Linux
+vmcoreinfo note (see `the kernel documentation for its format
+<https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-kernel-vmcoreinfo>`_).
+In this case, qemu dump code will read the content
+as a key=value text file, looking for ``NUMBER(phys_base)`` key
  value. The value is expected to be more accurate than architecture
  guess of the value. This is useful for KASLR-enabled guest with
-ancient tools not handling the VMCOREINFO note.
+ancient tools not handling the ``VMCOREINFO`` note.
#18 lore raw

PATCH 8/8 docs/specs/vmgenid: Convert to rST

In reply to Peter Maydell

Convert docs/specs/vmgenid.txt to rST format.

---
 MAINTAINERS            |   2 +-
 docs/specs/index.rst   |   1 +
 docs/specs/vmgenid.rst | 246 +++++++++++++++++++++++++++++++++++++++++
 docs/specs/vmgenid.txt | 245 ----------------------------------------
 4 files changed, 248 insertions(+), 246 deletions(-)
 create mode 100644 docs/specs/vmgenid.rst
 delete mode 100644 docs/specs/vmgenid.txt
MAINTAINERS +1 -1
index 23ee617acaf..d2338e3beb6 100644
@@ -2369,7 +2369,7 @@ S: Orphan
 R: Ani Sinha <[email protected]>
 F: hw/acpi/vmgenid.c
 F: include/hw/acpi/vmgenid.h
-F: docs/specs/vmgenid.txt
+F: docs/specs/vmgenid.rst
 F: tests/qtest/vmgenid-test.c
 
 LED
docs/specs/index.rst +1 -0
index 7a56ccb2155..b3f482b0aa5 100644
@@ -31,3 +31,4 @@ guest hardware that is specific to QEMU.
    standard-vga
    virt-ctlr
    vmcoreinfo
+   vmgenid
docs/specs/vmgenid.rst new file +246 -0

246 lines not on this page · raw message

docs/specs/vmgenid.txt deleted +0 -245

245 lines not on this page · raw message

Signature · 1 line
2.34.1
#19 lore raw

Re: [PATCH 8/8] docs/specs/vmgenid: Convert to rST

Quoted 11 lines · Peter Maydell

Convert docs/specs/vmgenid.txt to rST format.

---
  MAINTAINERS            |   2 +-
  docs/specs/index.rst   |   1 +
  docs/specs/vmgenid.rst | 246 +++++++++++++++++++++++++++++++++++++++++
  docs/specs/vmgenid.txt | 245 ----------------------------------------
  4 files changed, 248 insertions(+), 246 deletions(-)

create mode 100644 docs/specs/vmgenid.rst
delete mode 100644 docs/specs/vmgenid.txt

Cc'ing Ani.

Quoted 525 lines
MAINTAINERS +1 -1
index 23ee617acaf..d2338e3beb6 100644
@@ -2369,7 +2369,7 @@ S: Orphan
  R: Ani Sinha <[email protected]>
  F: hw/acpi/vmgenid.c
  F: include/hw/acpi/vmgenid.h
-F: docs/specs/vmgenid.txt
+F: docs/specs/vmgenid.rst
  F: tests/qtest/vmgenid-test.c
 
  LED
docs/specs/index.rst +1 -0
index 7a56ccb2155..b3f482b0aa5 100644
@@ -31,3 +31,4 @@ guest hardware that is specific to QEMU.
     standard-vga
     virt-ctlr
     vmcoreinfo
+   vmgenid
docs/specs/vmgenid.rst new file +246 -0
new file mode 100644
index 00000000000..9a3cefcd828
@@ -0,0 +1,246 @@
+Virtual Machine Generation ID Device
+====================================
+
+..
+   Copyright (C) 2016 Red Hat, Inc.
+   Copyright (C) 2017 Skyport Systems, Inc.
+
+   This work is licensed under the terms of the GNU GPL, version 2 or later.
+   See the COPYING file in the top-level directory.
+
+The VM generation ID (``vmgenid``) device is an emulated device which
+exposes a 128-bit, cryptographically random, integer value identifier,
+referred to as a Globally Unique Identifier, or GUID.
+
+This allows management applications (e.g. libvirt) to notify the guest
+operating system when the virtual machine is executed with a different
+configuration (e.g. snapshot execution or creation from a template).  The
+guest operating system notices the change, and is then able to react as
+appropriate by marking its copies of distributed databases as dirty,
+re-initializing its random number generator etc.
+
+
+Requirements
+------------
+
+These requirements are extracted from the "How to implement virtual machine
+generation ID support in a virtualization platform" section of
+`the Microsoft Virtual Machine Generation ID specification
+<http://go.microsoft.com/fwlink/?LinkId=260709>`_ dated August 1, 2012.
+
+- **R1a** The generation ID shall live in an 8-byte aligned buffer.
+
+- **R1b** The buffer holding the generation ID shall be in guest RAM,
+  ROM, or device MMIO range.
+
+- **R1c** The buffer holding the generation ID shall be kept separate from
+  areas used by the operating system.
+
+- **R1d** The buffer shall not be covered by an AddressRangeMemory or
+  AddressRangeACPI entry in the E820 or UEFI memory map.
+
+- **R1e** The generation ID shall not live in a page frame that could be
+  mapped with caching disabled. (In other words, regardless of whether the
+  generation ID lives in RAM, ROM or MMIO, it shall only be mapped as
+  cacheable.)
+
+- **R2** to **R5** [These AML requirements are isolated well enough in the
+  Microsoft specification for us to simply refer to them here.]
+
+- **R6** The hypervisor shall expose a _HID (hardware identifier) object
+  in the VMGenId device's scope that is unique to the hypervisor vendor.
+
+
+QEMU Implementation
+-------------------
+
+The above-mentioned specification does not dictate which ACPI descriptor table
+will contain the VM Generation ID device.  Other implementations (Hyper-V and
+Xen) put it in the main descriptor table (Differentiated System Description
+Table or DSDT).  For ease of debugging and implementation, we have decided to
+put it in its own Secondary System Description Table, or SSDT.
+
+The following is a dump of the contents from a running system::
+
+  # iasl -p ./SSDT -d /sys/firmware/acpi/tables/SSDT
+
+  Intel ACPI Component Architecture
+  ASL+ Optimizing Compiler version 20150717-64
+  Copyright (c) 2000 - 2015 Intel Corporation
+
+  Reading ACPI table from file /sys/firmware/acpi/tables/SSDT - Length
+  00000198 (0x0000C6)
+  ACPI: SSDT 0x0000000000000000 0000C6 (v01 BOCHS  VMGENID  00000001 BXPC 00000001)
+  Acpi table [SSDT] successfully installed and loaded
+  Pass 1 parse of [SSDT]
+  Pass 2 parse of [SSDT]
+  Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
+
+  Parsing completed
+  Disassembly completed
+  ASL Output:    ./SSDT.dsl - 1631 bytes
+  # cat SSDT.dsl
+  /*
+   * Intel ACPI Component Architecture
+   * AML/ASL+ Disassembler version 20150717-64
+   * Copyright (c) 2000 - 2015 Intel Corporation
+   *
+   * Disassembling to symbolic ASL+ operators
+   *
+   * Disassembly of /sys/firmware/acpi/tables/SSDT, Sun Feb  5 00:19:37 2017
+   *
+   * Original Table Header:
+   *     Signature        "SSDT"
+   *     Length           0x000000CA (202)
+   *     Revision         0x01
+   *     Checksum         0x4B
+   *     OEM ID           "BOCHS "
+   *     OEM Table ID     "VMGENID"
+   *     OEM Revision     0x00000001 (1)
+   *     Compiler ID      "BXPC"
+   *     Compiler Version 0x00000001 (1)
+   */
+  DefinitionBlock ("/sys/firmware/acpi/tables/SSDT.aml", "SSDT", 1, "BOCHS ", "VMGENID", 0x00000001)
+  {
+      Name (VGIA, 0x07FFF000)
+      Scope (\_SB)
+      {
+          Device (VGEN)
+          {
+              Name (_HID, "QEMUVGID")  // _HID: Hardware ID
+              Name (_CID, "VM_Gen_Counter")  // _CID: Compatible ID
+              Name (_DDN, "VM_Gen_Counter")  // _DDN: DOS Device Name
+              Method (_STA, 0, NotSerialized)  // _STA: Status
+              {
+                  Local0 = 0x0F
+                  If ((VGIA == Zero))
+                  {
+                      Local0 = Zero
+                  }
+
+                  Return (Local0)
+              }
+
+              Method (ADDR, 0, NotSerialized)
+              {
+                  Local0 = Package (0x02) {}
+                  Index (Local0, Zero) = (VGIA + 0x28)
+                  Index (Local0, One) = Zero
+                  Return (Local0)
+              }
+          }
+      }
+
+      Method (\_GPE._E05, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
+      {
+          Notify (\_SB.VGEN, 0x80) // Status Change
+      }
+  }
+
+
+Design Details:
+---------------
+
+Requirements R1a through R1e dictate that the memory holding the
+VM Generation ID must be allocated and owned by the guest firmware,
+in this case BIOS or UEFI.  However, to be useful, QEMU must be able to
+change the contents of the memory at runtime, specifically when starting a
+backed-up or snapshotted image.  In order to do this, QEMU must know the
+address that has been allocated.
+
+The mechanism chosen for this memory sharing is writable fw_cfg blobs.
+These are data object that are visible to both QEMU and guests, and are
+addressable as sequential files.
+
+More information about fw_cfg can be found in :doc:`fw_cfg`.
+
+Two fw_cfg blobs are used in this case:
+
+``/etc/vmgenid_guid``
+
+- contains the actual VM Generation ID GUID
+- read-only to the guest
+
+``/etc/vmgenid_addr``
+
+- contains the address of the downloaded vmgenid blob
+- writable by the guest
+
+
+QEMU sends the following commands to the guest at startup:
+
+1. Allocate memory for vmgenid_guid fw_cfg blob.
+2. Write the address of vmgenid_guid into the SSDT (VGIA ACPI variable as
+   shown above in the iasl dump).  Note that this change is not propagated
+   back to QEMU.
+3. Write the address of vmgenid_guid back to QEMU's copy of vmgenid_addr
+   via the fw_cfg DMA interface.
+
+After step 3, QEMU is able to update the contents of vmgenid_guid at will.
+
+Since BIOS or UEFI does not necessarily run when we wish to change the GUID,
+the value of VGIA is persisted via the VMState mechanism.
+
+As spelled out in the specification, any change to the GUID executes an
+ACPI notification.  The exact handler to use is not specified, so the vmgenid
+device uses the first unused one:  ``\_GPE._E05``.
+
+
+Endian-ness Considerations:
+---------------------------
+
+Although not specified in Microsoft's document, it is assumed that the
+device is expected to use little-endian format.
+
+All GUID passed in via command line or monitor are treated as big-endian.
+GUID values displayed via monitor are shown in big-endian format.
+
+
+GUID Storage Format:
+--------------------
+
+In order to implement an OVMF "SDT Header Probe Suppressor", the contents of
+the vmgenid_guid fw_cfg blob are not simply a 128-bit GUID.  There is also
+significant padding in order to align and fill a memory page, as shown in the
+following diagram::
+
+  +----------------------------------+
+  | SSDT with OEM Table ID = VMGENID |
+  +----------------------------------+
+  | ...                              |       TOP OF PAGE
+  | VGIA dword object ---------------|-----> +---------------------------+
+  | ...                              |       | fw-allocated array for    |
+  | _STA method referring to VGIA    |       | "etc/vmgenid_guid"        |
+  | ...                              |       +---------------------------+
+  | ADDR method referring to VGIA    |       |  0: OVMF SDT Header probe |
+  | ...                              |       |     suppressor            |
+  +----------------------------------+       | 36: padding for 8-byte    |
+                                             |     alignment             |
+                                             | 40: GUID                  |
+                                             | 56: padding to page size  |
+                                             +---------------------------+
+                                             END OF PAGE
+
+
+Device Usage:
+-------------
+
+The device has one property, which may be only be set using the command line:
+
+``guid``
+  sets the value of the GUID.  A special value ``auto`` instructs
+  QEMU to generate a new random GUID.
+
+For example::
+
+  QEMU  -device vmgenid,guid="324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
+  QEMU  -device vmgenid,guid=auto
+
+The property may be queried via QMP/HMP::
+
+  (QEMU) query-vm-generation-id
+  {"return": {"guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}}
+
+Setting of this parameter is intentionally left out from the QMP/HMP
+interfaces.  There are no known use cases for changing the GUID once QEMU is
+running, and adding this capability would greatly increase the complexity.
docs/specs/vmgenid.txt deleted +0 -245
deleted file mode 100644
index 80ff69f31cc..00000000000
@@ -1,245 +0,0 @@
-VIRTUAL MACHINE GENERATION ID
-=============================
-
-Copyright (C) 2016 Red Hat, Inc.
-Copyright (C) 2017 Skyport Systems, Inc.
-
-This work is licensed under the terms of the GNU GPL, version 2 or later.
-See the COPYING file in the top-level directory.
-
-===
-
-The VM generation ID (vmgenid) device is an emulated device which
-exposes a 128-bit, cryptographically random, integer value identifier,
-referred to as a Globally Unique Identifier, or GUID.
-
-This allows management applications (e.g. libvirt) to notify the guest
-operating system when the virtual machine is executed with a different
-configuration (e.g. snapshot execution or creation from a template).  The
-guest operating system notices the change, and is then able to react as
-appropriate by marking its copies of distributed databases as dirty,
-re-initializing its random number generator etc.
-
-
-Requirements
-------------
-
-These requirements are extracted from the "How to implement virtual machine
-generation ID support in a virtualization platform" section of the
-specification, dated August 1, 2012.
-
-
-The document may be found on the web at:
-  http://go.microsoft.com/fwlink/?LinkId=260709
-
-R1a. The generation ID shall live in an 8-byte aligned buffer.
-
-R1b. The buffer holding the generation ID shall be in guest RAM, ROM, or device
-     MMIO range.
-
-R1c. The buffer holding the generation ID shall be kept separate from areas
-     used by the operating system.
-
-R1d. The buffer shall not be covered by an AddressRangeMemory or
-     AddressRangeACPI entry in the E820 or UEFI memory map.
-
-R1e. The generation ID shall not live in a page frame that could be mapped with
-     caching disabled. (In other words, regardless of whether the generation ID
-     lives in RAM, ROM or MMIO, it shall only be mapped as cacheable.)
-
-R2 to R5. [These AML requirements are isolated well enough in the Microsoft
-          specification for us to simply refer to them here.]
-
-R6. The hypervisor shall expose a _HID (hardware identifier) object in the
-    VMGenId device's scope that is unique to the hypervisor vendor.
-
-
-QEMU Implementation
--------------------
-
-The above-mentioned specification does not dictate which ACPI descriptor table
-will contain the VM Generation ID device.  Other implementations (Hyper-V and
-Xen) put it in the main descriptor table (Differentiated System Description
-Table or DSDT).  For ease of debugging and implementation, we have decided to
-put it in its own Secondary System Description Table, or SSDT.
-
-The following is a dump of the contents from a running system:
-
-# iasl -p ./SSDT -d /sys/firmware/acpi/tables/SSDT
-
-Intel ACPI Component Architecture
-ASL+ Optimizing Compiler version 20150717-64
-Copyright (c) 2000 - 2015 Intel Corporation
-
-Reading ACPI table from file /sys/firmware/acpi/tables/SSDT - Length
-00000198 (0x0000C6)
-ACPI: SSDT 0x0000000000000000 0000C6 (v01 BOCHS  VMGENID  00000001 BXPC
-00000001)
-Acpi table [SSDT] successfully installed and loaded
-Pass 1 parse of [SSDT]
-Pass 2 parse of [SSDT]
-Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
-
-Parsing completed
-Disassembly completed
-ASL Output:    ./SSDT.dsl - 1631 bytes
-# cat SSDT.dsl
-/*
- * Intel ACPI Component Architecture
- * AML/ASL+ Disassembler version 20150717-64
- * Copyright (c) 2000 - 2015 Intel Corporation
- *
- * Disassembling to symbolic ASL+ operators
- *
- * Disassembly of /sys/firmware/acpi/tables/SSDT, Sun Feb  5 00:19:37 2017
- *
- * Original Table Header:
- *     Signature        "SSDT"
- *     Length           0x000000CA (202)
- *     Revision         0x01
- *     Checksum         0x4B
- *     OEM ID           "BOCHS "
- *     OEM Table ID     "VMGENID"
- *     OEM Revision     0x00000001 (1)
- *     Compiler ID      "BXPC"
- *     Compiler Version 0x00000001 (1)
- */
-DefinitionBlock ("/sys/firmware/acpi/tables/SSDT.aml", "SSDT", 1, "BOCHS ",
-"VMGENID", 0x00000001)
-{
-    Name (VGIA, 0x07FFF000)
-    Scope (\_SB)
-    {
-        Device (VGEN)
-        {
-            Name (_HID, "QEMUVGID")  // _HID: Hardware ID
-            Name (_CID, "VM_Gen_Counter")  // _CID: Compatible ID
-            Name (_DDN, "VM_Gen_Counter")  // _DDN: DOS Device Name
-            Method (_STA, 0, NotSerialized)  // _STA: Status
-            {
-                Local0 = 0x0F
-                If ((VGIA == Zero))
-                {
-                    Local0 = Zero
-                }
-
-                Return (Local0)
-            }
-
-            Method (ADDR, 0, NotSerialized)
-            {
-                Local0 = Package (0x02) {}
-                Index (Local0, Zero) = (VGIA + 0x28)
-                Index (Local0, One) = Zero
-                Return (Local0)
-            }
-        }
-    }
-
-    Method (\_GPE._E05, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
-    {
-        Notify (\_SB.VGEN, 0x80) // Status Change
-    }
-}
-
-
-Design Details:
----------------
-
-Requirements R1a through R1e dictate that the memory holding the
-VM Generation ID must be allocated and owned by the guest firmware,
-in this case BIOS or UEFI.  However, to be useful, QEMU must be able to
-change the contents of the memory at runtime, specifically when starting a
-backed-up or snapshotted image.  In order to do this, QEMU must know the
-address that has been allocated.
-
-The mechanism chosen for this memory sharing is writable fw_cfg blobs.
-These are data object that are visible to both QEMU and guests, and are
-addressable as sequential files.
-
-More information about fw_cfg can be found in "docs/specs/fw_cfg.txt"
-
-Two fw_cfg blobs are used in this case:
-
-/etc/vmgenid_guid - contains the actual VM Generation ID GUID
-                  - read-only to the guest
-/etc/vmgenid_addr - contains the address of the downloaded vmgenid blob
-                  - writable by the guest
-
-
-QEMU sends the following commands to the guest at startup:
-
-1. Allocate memory for vmgenid_guid fw_cfg blob.
-2. Write the address of vmgenid_guid into the SSDT (VGIA ACPI variable as
-   shown above in the iasl dump).  Note that this change is not propagated
-   back to QEMU.
-3. Write the address of vmgenid_guid back to QEMU's copy of vmgenid_addr
-   via the fw_cfg DMA interface.
-
-After step 3, QEMU is able to update the contents of vmgenid_guid at will.
-
-Since BIOS or UEFI does not necessarily run when we wish to change the GUID,
-the value of VGIA is persisted via the VMState mechanism.
-
-As spelled out in the specification, any change to the GUID executes an
-ACPI notification.  The exact handler to use is not specified, so the vmgenid
-device uses the first unused one:  \_GPE._E05.
-
-
-Endian-ness Considerations:
----------------------------
-
-Although not specified in Microsoft's document, it is assumed that the
-device is expected to use little-endian format.
-
-All GUID passed in via command line or monitor are treated as big-endian.
-GUID values displayed via monitor are shown in big-endian format.
-
-
-GUID Storage Format:
---------------------
-
-In order to implement an OVMF "SDT Header Probe Suppressor", the contents of
-the vmgenid_guid fw_cfg blob are not simply a 128-bit GUID.  There is also
-significant padding in order to align and fill a memory page, as shown in the
-following diagram:
-
-+----------------------------------+
-| SSDT with OEM Table ID = VMGENID |
-+----------------------------------+
-| ...                              |       TOP OF PAGE
-| VGIA dword object ---------------|-----> +---------------------------+
-| ...                              |       | fw-allocated array for    |
-| _STA method referring to VGIA    |       | "etc/vmgenid_guid"        |
-| ...                              |       +---------------------------+
-| ADDR method referring to VGIA    |       |  0: OVMF SDT Header probe |
-| ...                              |       |     suppressor            |
-+----------------------------------+       | 36: padding for 8-byte    |
-                                           |     alignment             |
-                                           | 40: GUID                  |
-                                           | 56: padding to page size  |
-                                           +---------------------------+
-                                           END OF PAGE
-
-
-Device Usage:
--------------
-
-The device has one property, which may be only be set using the command line:
-
-  guid - sets the value of the GUID.  A special value "auto" instructs
-         QEMU to generate a new random GUID.
-
-For example:
-
-  QEMU  -device vmgenid,guid="324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
-  QEMU  -device vmgenid,guid=auto
-
-The property may be queried via QMP/HMP:
-
-  (QEMU) query-vm-generation-id
-  {"return": {"guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}}
-
-Setting of this parameter is intentionally left out from the QMP/HMP
-interfaces.  There are no known use cases for changing the GUID once QEMU is
-running, and adding this capability would greatly increase the complexity.
Reviewed-by
#20 lore raw

Re: [PATCH 8/8] docs/specs/vmgenid: Convert to rST

Quoted 16 lines · Philippe Mathieu-Daudé
Quoted 10 lines · Peter Maydell

Convert docs/specs/vmgenid.txt to rST format.

---
 MAINTAINERS            |   2 +-
 docs/specs/index.rst   |   1 +
 docs/specs/vmgenid.rst | 246 +++++++++++++++++++++++++++++++++++++++++
 docs/specs/vmgenid.txt | 245 ----------------------------------------
 4 files changed, 248 insertions(+), 246 deletions(-)
 create mode 100644 docs/specs/vmgenid.rst
 delete mode 100644 docs/specs/vmgenid.txt
Quoted 1 line

Cc'ing Ani.

Thanks Phil. I looked at the rendering here:
https://gitlab.com/anisinha/qemu/-/blob/review/docs/specs/vmgenid.rst?ref_type=heads

And it looks good.

Based on this

Quoted 526 lines
Quoted 525 lines
MAINTAINERS +1 -1
index 23ee617acaf..d2338e3beb6 100644
@@ -2369,7 +2369,7 @@ S: Orphan
 R: Ani Sinha <[email protected]>
 F: hw/acpi/vmgenid.c
 F: include/hw/acpi/vmgenid.h
-F: docs/specs/vmgenid.txt
+F: docs/specs/vmgenid.rst
 F: tests/qtest/vmgenid-test.c
   LED
docs/specs/index.rst +1 -0
index 7a56ccb2155..b3f482b0aa5 100644
@@ -31,3 +31,4 @@ guest hardware that is specific to QEMU.
    standard-vga
    virt-ctlr
    vmcoreinfo
+   vmgenid
docs/specs/vmgenid.rst new file +246 -0
new file mode 100644
index 00000000000..9a3cefcd828
@@ -0,0 +1,246 @@
+Virtual Machine Generation ID Device
+====================================
+
+..
+   Copyright (C) 2016 Red Hat, Inc.
+   Copyright (C) 2017 Skyport Systems, Inc.
+
+   This work is licensed under the terms of the GNU GPL, version 2 or later.
+   See the COPYING file in the top-level directory.
+
+The VM generation ID (``vmgenid``) device is an emulated device which
+exposes a 128-bit, cryptographically random, integer value identifier,
+referred to as a Globally Unique Identifier, or GUID.
+
+This allows management applications (e.g. libvirt) to notify the guest
+operating system when the virtual machine is executed with a different
+configuration (e.g. snapshot execution or creation from a template).  The
+guest operating system notices the change, and is then able to react as
+appropriate by marking its copies of distributed databases as dirty,
+re-initializing its random number generator etc.
+
+
+Requirements
+------------
+
+These requirements are extracted from the "How to implement virtual machine
+generation ID support in a virtualization platform" section of
+`the Microsoft Virtual Machine Generation ID specification
+<http://go.microsoft.com/fwlink/?LinkId=260709>`_ dated August 1, 2012.
+
+- **R1a** The generation ID shall live in an 8-byte aligned buffer.
+
+- **R1b** The buffer holding the generation ID shall be in guest RAM,
+  ROM, or device MMIO range.
+
+- **R1c** The buffer holding the generation ID shall be kept separate from
+  areas used by the operating system.
+
+- **R1d** The buffer shall not be covered by an AddressRangeMemory or
+  AddressRangeACPI entry in the E820 or UEFI memory map.
+
+- **R1e** The generation ID shall not live in a page frame that could be
+  mapped with caching disabled. (In other words, regardless of whether the
+  generation ID lives in RAM, ROM or MMIO, it shall only be mapped as
+  cacheable.)
+
+- **R2** to **R5** [These AML requirements are isolated well enough in the
+  Microsoft specification for us to simply refer to them here.]
+
+- **R6** The hypervisor shall expose a _HID (hardware identifier) object
+  in the VMGenId device's scope that is unique to the hypervisor vendor.
+
+
+QEMU Implementation
+-------------------
+
+The above-mentioned specification does not dictate which ACPI descriptor table
+will contain the VM Generation ID device.  Other implementations (Hyper-V and
+Xen) put it in the main descriptor table (Differentiated System Description
+Table or DSDT).  For ease of debugging and implementation, we have decided to
+put it in its own Secondary System Description Table, or SSDT.
+
+The following is a dump of the contents from a running system::
+
+  # iasl -p ./SSDT -d /sys/firmware/acpi/tables/SSDT
+
+  Intel ACPI Component Architecture
+  ASL+ Optimizing Compiler version 20150717-64
+  Copyright (c) 2000 - 2015 Intel Corporation
+
+  Reading ACPI table from file /sys/firmware/acpi/tables/SSDT - Length
+  00000198 (0x0000C6)
+  ACPI: SSDT 0x0000000000000000 0000C6 (v01 BOCHS  VMGENID  00000001 BXPC 00000001)
+  Acpi table [SSDT] successfully installed and loaded
+  Pass 1 parse of [SSDT]
+  Pass 2 parse of [SSDT]
+  Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
+
+  Parsing completed
+  Disassembly completed
+  ASL Output:    ./SSDT.dsl - 1631 bytes
+  # cat SSDT.dsl
+  /*
+   * Intel ACPI Component Architecture
+   * AML/ASL+ Disassembler version 20150717-64
+   * Copyright (c) 2000 - 2015 Intel Corporation
+   *
+   * Disassembling to symbolic ASL+ operators
+   *
+   * Disassembly of /sys/firmware/acpi/tables/SSDT, Sun Feb  5 00:19:37 2017
+   *
+   * Original Table Header:
+   *     Signature        "SSDT"
+   *     Length           0x000000CA (202)
+   *     Revision         0x01
+   *     Checksum         0x4B
+   *     OEM ID           "BOCHS "
+   *     OEM Table ID     "VMGENID"
+   *     OEM Revision     0x00000001 (1)
+   *     Compiler ID      "BXPC"
+   *     Compiler Version 0x00000001 (1)
+   */
+  DefinitionBlock ("/sys/firmware/acpi/tables/SSDT.aml", "SSDT", 1, "BOCHS ", "VMGENID", 0x00000001)
+  {
+      Name (VGIA, 0x07FFF000)
+      Scope (\_SB)
+      {
+          Device (VGEN)
+          {
+              Name (_HID, "QEMUVGID")  // _HID: Hardware ID
+              Name (_CID, "VM_Gen_Counter")  // _CID: Compatible ID
+              Name (_DDN, "VM_Gen_Counter")  // _DDN: DOS Device Name
+              Method (_STA, 0, NotSerialized)  // _STA: Status
+              {
+                  Local0 = 0x0F
+                  If ((VGIA == Zero))
+                  {
+                      Local0 = Zero
+                  }
+
+                  Return (Local0)
+              }
+
+              Method (ADDR, 0, NotSerialized)
+              {
+                  Local0 = Package (0x02) {}
+                  Index (Local0, Zero) = (VGIA + 0x28)
+                  Index (Local0, One) = Zero
+                  Return (Local0)
+              }
+          }
+      }
+
+      Method (\_GPE._E05, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
+      {
+          Notify (\_SB.VGEN, 0x80) // Status Change
+      }
+  }
+
+
+Design Details:
+---------------
+
+Requirements R1a through R1e dictate that the memory holding the
+VM Generation ID must be allocated and owned by the guest firmware,
+in this case BIOS or UEFI.  However, to be useful, QEMU must be able to
+change the contents of the memory at runtime, specifically when starting a
+backed-up or snapshotted image.  In order to do this, QEMU must know the
+address that has been allocated.
+
+The mechanism chosen for this memory sharing is writable fw_cfg blobs.
+These are data object that are visible to both QEMU and guests, and are
+addressable as sequential files.
+
+More information about fw_cfg can be found in :doc:`fw_cfg`.
+
+Two fw_cfg blobs are used in this case:
+
+``/etc/vmgenid_guid``
+
+- contains the actual VM Generation ID GUID
+- read-only to the guest
+
+``/etc/vmgenid_addr``
+
+- contains the address of the downloaded vmgenid blob
+- writable by the guest
+
+
+QEMU sends the following commands to the guest at startup:
+
+1. Allocate memory for vmgenid_guid fw_cfg blob.
+2. Write the address of vmgenid_guid into the SSDT (VGIA ACPI variable as
+   shown above in the iasl dump).  Note that this change is not propagated
+   back to QEMU.
+3. Write the address of vmgenid_guid back to QEMU's copy of vmgenid_addr
+   via the fw_cfg DMA interface.
+
+After step 3, QEMU is able to update the contents of vmgenid_guid at will.
+
+Since BIOS or UEFI does not necessarily run when we wish to change the GUID,
+the value of VGIA is persisted via the VMState mechanism.
+
+As spelled out in the specification, any change to the GUID executes an
+ACPI notification.  The exact handler to use is not specified, so the vmgenid
+device uses the first unused one:  ``\_GPE._E05``.
+
+
+Endian-ness Considerations:
+---------------------------
+
+Although not specified in Microsoft's document, it is assumed that the
+device is expected to use little-endian format.
+
+All GUID passed in via command line or monitor are treated as big-endian.
+GUID values displayed via monitor are shown in big-endian format.
+
+
+GUID Storage Format:
+--------------------
+
+In order to implement an OVMF "SDT Header Probe Suppressor", the contents of
+the vmgenid_guid fw_cfg blob are not simply a 128-bit GUID.  There is also
+significant padding in order to align and fill a memory page, as shown in the
+following diagram::
+
+  +----------------------------------+
+  | SSDT with OEM Table ID = VMGENID |
+  +----------------------------------+
+  | ...                              |       TOP OF PAGE
+  | VGIA dword object ---------------|-----> +---------------------------+
+  | ...                              |       | fw-allocated array for    |
+  | _STA method referring to VGIA    |       | "etc/vmgenid_guid"        |
+  | ...                              |       +---------------------------+
+  | ADDR method referring to VGIA    |       |  0: OVMF SDT Header probe |
+  | ...                              |       |     suppressor            |
+  +----------------------------------+       | 36: padding for 8-byte    |
+                                             |     alignment             |
+                                             | 40: GUID                  |
+                                             | 56: padding to page size  |
+                                             +---------------------------+
+                                             END OF PAGE
+
+
+Device Usage:
+-------------
+
+The device has one property, which may be only be set using the command line:
+
+``guid``
+  sets the value of the GUID.  A special value ``auto`` instructs
+  QEMU to generate a new random GUID.
+
+For example::
+
+  QEMU  -device vmgenid,guid="324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
+  QEMU  -device vmgenid,guid=auto
+
+The property may be queried via QMP/HMP::
+
+  (QEMU) query-vm-generation-id
+  {"return": {"guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}}
+
+Setting of this parameter is intentionally left out from the QMP/HMP
+interfaces.  There are no known use cases for changing the GUID once QEMU is
+running, and adding this capability would greatly increase the complexity.
docs/specs/vmgenid.txt deleted +0 -245
deleted file mode 100644
index 80ff69f31cc..00000000000
@@ -1,245 +0,0 @@
-VIRTUAL MACHINE GENERATION ID
-=============================
-
-Copyright (C) 2016 Red Hat, Inc.
-Copyright (C) 2017 Skyport Systems, Inc.
-
-This work is licensed under the terms of the GNU GPL, version 2 or later.
-See the COPYING file in the top-level directory.
-
-===
-
-The VM generation ID (vmgenid) device is an emulated device which
-exposes a 128-bit, cryptographically random, integer value identifier,
-referred to as a Globally Unique Identifier, or GUID.
-
-This allows management applications (e.g. libvirt) to notify the guest
-operating system when the virtual machine is executed with a different
-configuration (e.g. snapshot execution or creation from a template).  The
-guest operating system notices the change, and is then able to react as
-appropriate by marking its copies of distributed databases as dirty,
-re-initializing its random number generator etc.
-
-
-Requirements
-------------
-
-These requirements are extracted from the "How to implement virtual machine
-generation ID support in a virtualization platform" section of the
-specification, dated August 1, 2012.
-
-
-The document may be found on the web at:
-  http://go.microsoft.com/fwlink/?LinkId=260709
-
-R1a. The generation ID shall live in an 8-byte aligned buffer.
-
-R1b. The buffer holding the generation ID shall be in guest RAM, ROM, or device
-     MMIO range.
-
-R1c. The buffer holding the generation ID shall be kept separate from areas
-     used by the operating system.
-
-R1d. The buffer shall not be covered by an AddressRangeMemory or
-     AddressRangeACPI entry in the E820 or UEFI memory map.
-
-R1e. The generation ID shall not live in a page frame that could be mapped with
-     caching disabled. (In other words, regardless of whether the generation ID
-     lives in RAM, ROM or MMIO, it shall only be mapped as cacheable.)
-
-R2 to R5. [These AML requirements are isolated well enough in the Microsoft
-          specification for us to simply refer to them here.]
-
-R6. The hypervisor shall expose a _HID (hardware identifier) object in the
-    VMGenId device's scope that is unique to the hypervisor vendor.
-
-
-QEMU Implementation
--------------------
-
-The above-mentioned specification does not dictate which ACPI descriptor table
-will contain the VM Generation ID device.  Other implementations (Hyper-V and
-Xen) put it in the main descriptor table (Differentiated System Description
-Table or DSDT).  For ease of debugging and implementation, we have decided to
-put it in its own Secondary System Description Table, or SSDT.
-
-The following is a dump of the contents from a running system:
-
-# iasl -p ./SSDT -d /sys/firmware/acpi/tables/SSDT
-
-Intel ACPI Component Architecture
-ASL+ Optimizing Compiler version 20150717-64
-Copyright (c) 2000 - 2015 Intel Corporation
-
-Reading ACPI table from file /sys/firmware/acpi/tables/SSDT - Length
-00000198 (0x0000C6)
-ACPI: SSDT 0x0000000000000000 0000C6 (v01 BOCHS  VMGENID  00000001 BXPC
-00000001)
-Acpi table [SSDT] successfully installed and loaded
-Pass 1 parse of [SSDT]
-Pass 2 parse of [SSDT]
-Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
-
-Parsing completed
-Disassembly completed
-ASL Output:    ./SSDT.dsl - 1631 bytes
-# cat SSDT.dsl
-/*
- * Intel ACPI Component Architecture
- * AML/ASL+ Disassembler version 20150717-64
- * Copyright (c) 2000 - 2015 Intel Corporation
- *
- * Disassembling to symbolic ASL+ operators
- *
- * Disassembly of /sys/firmware/acpi/tables/SSDT, Sun Feb  5 00:19:37 2017
- *
- * Original Table Header:
- *     Signature        "SSDT"
- *     Length           0x000000CA (202)
- *     Revision         0x01
- *     Checksum         0x4B
- *     OEM ID           "BOCHS "
- *     OEM Table ID     "VMGENID"
- *     OEM Revision     0x00000001 (1)
- *     Compiler ID      "BXPC"
- *     Compiler Version 0x00000001 (1)
- */
-DefinitionBlock ("/sys/firmware/acpi/tables/SSDT.aml", "SSDT", 1, "BOCHS ",
-"VMGENID", 0x00000001)
-{
-    Name (VGIA, 0x07FFF000)
-    Scope (\_SB)
-    {
-        Device (VGEN)
-        {
-            Name (_HID, "QEMUVGID")  // _HID: Hardware ID
-            Name (_CID, "VM_Gen_Counter")  // _CID: Compatible ID
-            Name (_DDN, "VM_Gen_Counter")  // _DDN: DOS Device Name
-            Method (_STA, 0, NotSerialized)  // _STA: Status
-            {
-                Local0 = 0x0F
-                If ((VGIA == Zero))
-                {
-                    Local0 = Zero
-                }
-
-                Return (Local0)
-            }
-
-            Method (ADDR, 0, NotSerialized)
-            {
-                Local0 = Package (0x02) {}
-                Index (Local0, Zero) = (VGIA + 0x28)
-                Index (Local0, One) = Zero
-                Return (Local0)
-            }
-        }
-    }
-
-    Method (\_GPE._E05, 0, NotSerialized)  // _Exx: Edge-Triggered GPE
-    {
-        Notify (\_SB.VGEN, 0x80) // Status Change
-    }
-}
-
-
-Design Details:
----------------
-
-Requirements R1a through R1e dictate that the memory holding the
-VM Generation ID must be allocated and owned by the guest firmware,
-in this case BIOS or UEFI.  However, to be useful, QEMU must be able to
-change the contents of the memory at runtime, specifically when starting a
-backed-up or snapshotted image.  In order to do this, QEMU must know the
-address that has been allocated.
-
-The mechanism chosen for this memory sharing is writable fw_cfg blobs.
-These are data object that are visible to both QEMU and guests, and are
-addressable as sequential files.
-
-More information about fw_cfg can be found in "docs/specs/fw_cfg.txt"
-
-Two fw_cfg blobs are used in this case:
-
-/etc/vmgenid_guid - contains the actual VM Generation ID GUID
-                  - read-only to the guest
-/etc/vmgenid_addr - contains the address of the downloaded vmgenid blob
-                  - writable by the guest
-
-
-QEMU sends the following commands to the guest at startup:
-
-1. Allocate memory for vmgenid_guid fw_cfg blob.
-2. Write the address of vmgenid_guid into the SSDT (VGIA ACPI variable as
-   shown above in the iasl dump).  Note that this change is not propagated
-   back to QEMU.
-3. Write the address of vmgenid_guid back to QEMU's copy of vmgenid_addr
-   via the fw_cfg DMA interface.
-
-After step 3, QEMU is able to update the contents of vmgenid_guid at will.
-
-Since BIOS or UEFI does not necessarily run when we wish to change the GUID,
-the value of VGIA is persisted via the VMState mechanism.
-
-As spelled out in the specification, any change to the GUID executes an
-ACPI notification.  The exact handler to use is not specified, so the vmgenid
-device uses the first unused one:  \_GPE._E05.
-
-
-Endian-ness Considerations:
----------------------------
-
-Although not specified in Microsoft's document, it is assumed that the
-device is expected to use little-endian format.
-
-All GUID passed in via command line or monitor are treated as big-endian.
-GUID values displayed via monitor are shown in big-endian format.
-
-
-GUID Storage Format:
---------------------
-
-In order to implement an OVMF "SDT Header Probe Suppressor", the contents of
-the vmgenid_guid fw_cfg blob are not simply a 128-bit GUID.  There is also
-significant padding in order to align and fill a memory page, as shown in the
-following diagram:
-
-+----------------------------------+
-| SSDT with OEM Table ID = VMGENID |
-+----------------------------------+
-| ...                              |       TOP OF PAGE
-| VGIA dword object ---------------|-----> +---------------------------+
-| ...                              |       | fw-allocated array for    |
-| _STA method referring to VGIA    |       | "etc/vmgenid_guid"        |
-| ...                              |       +---------------------------+
-| ADDR method referring to VGIA    |       |  0: OVMF SDT Header probe |
-| ...                              |       |     suppressor            |
-+----------------------------------+       | 36: padding for 8-byte    |
-                                           |     alignment             |
-                                           | 40: GUID                  |
-                                           | 56: padding to page size  |
-                                           +---------------------------+
-                                           END OF PAGE
-
-
-Device Usage:
--------------
-
-The device has one property, which may be only be set using the command line:
-
-  guid - sets the value of the GUID.  A special value "auto" instructs
-         QEMU to generate a new random GUID.
-
-For example:
-
-  QEMU  -device vmgenid,guid="324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"
-  QEMU  -device vmgenid,guid=auto
-
-The property may be queried via QMP/HMP:
-
-  (QEMU) query-vm-generation-id
-  {"return": {"guid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}}
-
-Setting of this parameter is intentionally left out from the QMP/HMP
-interfaces.  There are no known use cases for changing the GUID once QEMU is
-running, and adding this capability would greatly increase the complexity.
#21 lore raw
In reply to Peter Maydell

Ping for code review ?

thanks
-- PMM

Quoted 58 lines · Peter Maydell

This patchseries converts most of the remaining .txt files in docs/specs to rST format and integrates tem with our documentation. (The one remaining .txt file is rocker.txt, which I left to do later because at over 1000 lines it is much bigger than these.)

These are mostly simple conversions with not too much effort put into the formatting/markup. In a few cases I dropped parts of the text already covered elsewhere or made light fixes for grammar/spelling; see individual patch commit messages for more detail.

thanks
-- PMM

Peter Maydell (8):
docs/specs/vmw_pvscsi-spec: Convert to rST
docs/specs/edu: Convert to rST
docs/specs/ivshmem-spec: Convert to rST
docs/specs/pvpanic: Convert to rST
docs/specs/standard-vga: Convert to rST
docs/specs/virt-ctlr: Convert to rST
docs/specs/vmcoreinfo: Convert to rST
docs/specs/vmgenid: Convert to rST

 MAINTAINERS                                   |   5 +-
 docs/specs/{edu.txt => edu.rst}               |  84 +++---
 docs/specs/index.rst                          |   8 +
 .../{ivshmem-spec.txt => ivshmem-spec.rst}    |  63 ++---
 docs/specs/pci-ids.rst                        |   2 +-
 docs/specs/{pvpanic.txt => pvpanic.rst}       |  41 ++-
 docs/specs/standard-vga.rst                   |  94 +++++++
 docs/specs/standard-vga.txt                   |  81 ------
 docs/specs/{virt-ctlr.txt => virt-ctlr.rst}   |  12 +-
 docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} |  33 +--
 docs/specs/vmgenid.rst                        | 246 ++++++++++++++++++
 docs/specs/vmgenid.txt                        | 245 -----------------
 docs/specs/vmw_pvscsi-spec.rst                | 115 ++++++++
 docs/specs/vmw_pvscsi-spec.txt                |  92 -------
 docs/system/devices/ivshmem.rst               |   2 +-
 hw/display/vga-isa.c                          |   2 +-
 hw/display/vga-pci.c                          |   2 +-
 17 files changed, 595 insertions(+), 532 deletions(-)
 rename docs/specs/{edu.txt => edu.rst} (64%)
 rename docs/specs/{ivshmem-spec.txt => ivshmem-spec.rst} (88%)
 rename docs/specs/{pvpanic.txt => pvpanic.rst} (64%)
 create mode 100644 docs/specs/standard-vga.rst
 delete mode 100644 docs/specs/standard-vga.txt
 rename docs/specs/{virt-ctlr.txt => virt-ctlr.rst} (70%)
 rename docs/specs/{vmcoreinfo.txt => vmcoreinfo.rst} (50%)
 create mode 100644 docs/specs/vmgenid.rst
 delete mode 100644 docs/specs/vmgenid.txt
 create mode 100644 docs/specs/vmw_pvscsi-spec.rst
 delete mode 100644 docs/specs/vmw_pvscsi-spec.txt

--
2.34.1

#22 lore raw
In reply to Peter Maydell
Quoted 15 lines · Peter Maydell

This patchseries converts most of the remaining .txt files in docs/specs to rST format and integrates tem with our documentation. (The one remaining .txt file is rocker.txt, which I left to do later because at over 1000 lines it is much bigger than these.)

These are mostly simple conversions with not too much effort put into the formatting/markup. In a few cases I dropped parts of the text already covered elsewhere or made light fixes for grammar/spelling; see individual patch commit messages for more detail.

thanks
-- PMM

Quoted 9 lines

Peter Maydell (8):
docs/specs/vmw_pvscsi-spec: Convert to rST
docs/specs/edu: Convert to rST
docs/specs/ivshmem-spec: Convert to rST
docs/specs/pvpanic: Convert to rST
docs/specs/standard-vga: Convert to rST
docs/specs/virt-ctlr: Convert to rST
docs/specs/vmcoreinfo: Convert to rST
docs/specs/vmgenid: Convert to rST

In the absence of further review I'm going to apply these via target-arm.next, since they're only docs format conversions; let me know if you'd like more time.

thanks
-- PMM