qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

xen: Fix ring.h header

The xen_[rw]?mb() macros defined in ring.h can't be used and the fact
that there are gated behind __XEN_INTERFACE_VERSION__ means that it
needs to be defined somewhere. QEMU doesn't implement interfaces with
the Xen hypervisor so defining __XEN_INTERFACE_VERSION__ is pointless.
This leads to:
include/hw/xen/io/ring.h:47:5: error: "__XEN_INTERFACE_VERSION__"
is not defined, evaluates to 0 [-Werror=undef]

Cleanup ring.h. The xen_*mb() macros are already defined in xenctrl.h
which is included in xen_common.h.

Reported-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20190704153605.4140-1-anthony.perard@citrix.com>
[aperard: Adding the comment proposed upstream]
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

+7 -6
+7 -6
include/hw/xen/interface/io/ring.h
··· 33 33 * - standard integers types (uint8_t, uint16_t, etc) 34 34 * They are provided by stdint.h of the standard headers. 35 35 * 36 + * Before using the different macros, you need to provide the following 37 + * macros: 38 + * - xen_mb() a memory barrier 39 + * - xen_rmb() a read memory barrier 40 + * - xen_wmb() a write memory barrier 41 + * Example of those can be found in xenctrl.h. 42 + * 36 43 * In addition, if you intend to use the FLEX macros, you also need to 37 44 * provide the following, before invoking the FLEX macros: 38 45 * - size_t ··· 41 48 * These declarations are provided by string.h of the standard headers, 42 49 * and grant_table.h from the Xen public headers. 43 50 */ 44 - 45 - #if __XEN_INTERFACE_VERSION__ < 0x00030208 46 - #define xen_mb() mb() 47 - #define xen_rmb() rmb() 48 - #define xen_wmb() wmb() 49 - #endif 50 51 51 52 typedef unsigned int RING_IDX; 52 53