Commit 49237b85 authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/sstabellini/tags/xen-20160614-tag' into staging



Xen 2016/06/14

# gpg: Signature made Tue 14 Jun 2016 16:01:52 BST
# gpg:                using RSA key 0x894F8F4870E1AE90
# gpg: Good signature from "Stefano Stabellini <stefano.stabellini@eu.citrix.com>"
# Primary key fingerprint: D04E 33AB A51F 67BA 07D3  0AEA 894F 8F48 70E1 AE90

* remotes/sstabellini/tags/xen-20160614-tag:
  xen: Clean up includes
  xen/blkif: avoid double access to any shared ring request fields

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 1be08a09 b1b23e5b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -79,14 +79,14 @@ static inline void blkif_get_x86_32_req(blkif_request_t *dst, blkif_x86_32_reque
	dst->handle = src->handle;
	dst->id = src->id;
	dst->sector_number = src->sector_number;
	if (src->operation == BLKIF_OP_DISCARD) {
	/* Prevent the compiler from using src->... instead. */
	barrier();
	if (dst->operation == BLKIF_OP_DISCARD) {
		struct blkif_request_discard *s = (void *)src;
		struct blkif_request_discard *d = (void *)dst;
		d->nr_sectors = s->nr_sectors;
		return;
	}
	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
	barrier();
	if (n > dst->nr_segments)
		n = dst->nr_segments;
	for (i = 0; i < n; i++)
@@ -102,14 +102,14 @@ static inline void blkif_get_x86_64_req(blkif_request_t *dst, blkif_x86_64_reque
	dst->handle = src->handle;
	dst->id = src->id;
	dst->sector_number = src->sector_number;
	if (src->operation == BLKIF_OP_DISCARD) {
	/* Prevent the compiler from using src->... instead. */
	barrier();
	if (dst->operation == BLKIF_OP_DISCARD) {
		struct blkif_request_discard *s = (void *)src;
		struct blkif_request_discard *d = (void *)dst;
		d->nr_sectors = s->nr_sectors;
		return;
	}
	/* prevent the compiler from optimizing the code and using src->nr_segments instead */
	barrier();
	if (n > dst->nr_segments)
		n = dst->nr_segments;
	for (i = 0; i < n; i++)
+2 −0
Original line number Diff line number Diff line
@@ -679,6 +679,8 @@ static int blk_get_request(struct XenBlkDev *blkdev, struct ioreq *ioreq, RING_I
                             RING_GET_REQUEST(&blkdev->rings.x86_64_part, rc));
        break;
    }
    /* Prevent the compiler from accessing the on-ring fields instead. */
    barrier();
    return 0;
}

+1 −4
Original line number Diff line number Diff line
@@ -19,13 +19,10 @@
 *  GNU GPL, version 2 or (at your option) any later version.
 */

#include "qemu/osdep.h"
#include <libusb.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/time.h>

#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/config-file.h"
#include "hw/sysbus.h"
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@
 */

#include "qemu-common.h"
#include "qemu/typedefs.h"
#include "exec/cpu-common.h"
#include "hw/irq.h"