2.3.2 MMIO: Upgrade registers layout to version 2

This patch addresses VIRTIO-44:

* Clarifies MagicValue content
* Bumps up the Version value to 2
* Removes paged-based addressing and replaces it
  with 64 bit addresses
* Replaces implicit queue organisation (based
  on alignment size) with explicit desc/avail/used
  addreses (based on original MST's patch, see
  VIRTIO-41)
* Introduces explicit protocol for queue
  enabling (based on original MST's idea)
  and disabling
* Defines driver's reaction to an invalid
  device ID (0x0).

Signed-off-by: Pawel Moll <pawel.moll@arm.com>


git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@67 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
2.3.2 MMIO: Add config space version register

... to allow synchronisation between the guest and the host.

Based on Rusty's original patch, see VIRTIO-35.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>


git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@68 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtio-ccw: introduce revisions

Provide a new ccw that allows devices and drivers to operate on selected
revision levels.

VIRTIO-42

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@69 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtio-ccw: split descriptor/available/used rings (alternate)

Extend vq_info_block so that the addresses for descriptor table,
available ring and used ring may be transmitted independently.

VIRTIO-23

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@70 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Revert "virtio-ccw: introduce revisions"

This reverts commit 663e7294691c6f76488d26c82a81f0d6d1e27593.

Accidental commit; minutes say we defer.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@71 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtio-ccw: add adapter interrupt support

Specify a new channel command to set up two-stage indicators as needed
for adapter interrupts and describe how adapter interrupts are used
for notifications.

VIRTIO-43

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@72 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtio-ccw: clarify some channel I/O concepts

Add the documents where channel I/O is generally described to the
normative references and add some further words on command rejects
and length checks.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@73 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Configuration (read) atomicity.

Aka issue VIRTIO-35.

This is solved per transport:
1) PCI: use the 8 bit reserved field.
	Assume that if you really change that fast, you'll do it lazily on
	config space read.
2) MMIO (already solved by v2 update)
3) CCW: no transport changes.
	They always read/write the entire thing.  This just shows that
	Cornelia is smarter than I am.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@74 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
configuration space endian-ness

make it all LE and require natural width accesses

resolves VIRTIO-9

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@au1.ibm.com> (rebase)

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@75 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtqueue endian-ness

make all ring structures LE
resolves VIRTIO-9

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@76 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
2.4.2.3.1 Legacy Interface: Feature bits

A previous patch put the device config layout in the middle of the
legacy feature bits.  Fix up now.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@77 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Use le types in all non-legacy places.

Emphasize that legacy endian was different, but change all the basic types
to use le32 etc as a constant reminder.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@78 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Thorough endianness notes for legacy.

This is noted at the beginning of the spec, but let's make it explicit
everywhere le32 etc is used.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@79 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Remove __ annotations on pci.

We use le32 etc elsewhere, make it consistent.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@80 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
CCW: Make it very clear that CCW channel commands are big-endian.

Noone is likely to get confused, but let's be explicit since the rest of
the spec is little-endian.

Signed-off-by: Rusty Russell <rusty@au1.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@81 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
ccw: Tweak the comments on endianess.

...just to make obvious that we're talking about the transmitted data.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@82 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
ccw: Remove reference to old s390-virtio transport.

Historical notes for a mechanism that was never officially specced
do not add anything to the standard.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@83 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
ccw: Improve indicator wording.

Be clearer about traditional vs. adapter interrupts and virtqueue vs.
configuration indicators.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@84 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
typo fix: 8-bite->8-bit

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@85 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
virtio-ccw: introduce revisions

Provide a new ccw that allows devices and drivers to operate on selected
revision levels.

VIRTIO-42

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@86 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652