atom feed12 messages in org.oasis-open.lists.virtio-dev[virtio-dev] [PATCH] pci: missing doc...
FromSent OnAttachments
Michael S. TsirkinApr 1, 2015 11:42 am 
Cornelia HuckApr 2, 2015 2:01 am 
Michael S. TsirkinApr 2, 2015 3:06 am 
Cornelia HuckApr 2, 2015 3:23 am 
Michael S. TsirkinApr 7, 2015 2:19 am 
Michael S. TsirkinApr 7, 2015 3:02 am 
James BottomleyApr 7, 2015 3:40 pm 
Michael S. TsirkinApr 12, 2015 8:26 am 
Michael S. TsirkinApr 12, 2015 8:28 am 
James BottomleyApr 12, 2015 8:38 am 
Michael S. TsirkinApr 12, 2015 8:53 am 
Michael S. TsirkinApr 12, 2015 9:21 am 
Subject:[virtio-dev] [PATCH] pci: missing documentation for dealing with 64 bit config fields
From:Michael S. Tsirkin (ms@redhat.com)
Date:Apr 1, 2015 11:42:13 am
List:org.oasis-open.lists.virtio-dev

pci spec says what width access to use for 32, 16 and 8 bit fields, but does not explicitly say what to do for 32 bit fields. As we have text that says driver must treat 64 bit accesses as non-atomic, this seems to imply driver should always do two 32 bit wide accesses.

Let's make this an explicit requirement, and require devices to support this.

VIRTIO-139

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

--- conformance.tex | 1 + content.tex | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/conformance.tex b/conformance.tex index 350d2d0..0f601d7 100644 --- a/conformance.tex +++ b/conformance.tex @@ -155,6 +155,7 @@ A PCI device MUST conform to the following normative
statements: \begin{itemize} \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus} \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI
Device Discovery} +\item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI
Device Layout} \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus /
Virtio Structure PCI Capabilities} \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI
Device Layout / Common configuration structure layout} \item \ref{devicenormative:Virtio Transport Options / Virtio Over PCI Bus / PCI
Device Layout / Notification capability} diff --git a/content.tex b/content.tex index d66785a..fd3fd17 100644 --- a/content.tex +++ b/content.tex @@ -1083,14 +1083,23 @@ Structure PCI Capabilities.

Fields of different sizes are present in the device configuration regions. -All 32-bit and 16-bit fields are little-endian. +All 64-bit, 32-bit and 16-bit fields are little-endian. +64-bit fields are to be treated as two 32-bit fields, +with low 32 bit part followed by the high 32 bit part.

\drivernormative{\subsubsection}{PCI Device Layout}{Virtio Transport Options /
Virtio Over PCI Bus / PCI Device Layout}

-The driver -MUST access each field using the ``natural'' access method, i.e. -32-bit accesses for 32-bit fields, 16-bit accesses for 16-bit -fields and 8-bit accesses for 8-bit fields. +For device configuration access, the driver MUST use 8-bit wide +accesses for 8-bit wide fields, 16-bit wide and aligned accesses +for 16-bit wide fields and 32-bit wide and aligned accesses for +32-bit and 64-bit wide fields. For 64-bit fields, the driver MAY +access each of the high and low 32-bit parts of the field +independently. + +\devicenormative{\subsubsection}{PCI Device Layout}{Virtio Transport Options /
Virtio Over PCI Bus / PCI Device Layout} + +For 64-bit device configuration fields, the device MUST allow driver +independent access to high and low 32-bit parts of the field.

\subsection{Virtio Structure PCI Capabilities}\label{sec:Virtio Transport
Options / Virtio Over PCI Bus / Virtio Structure PCI Capabilities}