]> xenbits.xensource.com Git - xen.git/commitdiff
VT-d/qinval: make local variable used for communication with IOMMU "volatile"
authorJan Beulich <jbeulich@suse.com>
Tue, 24 Jun 2014 08:24:52 +0000 (10:24 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 24 Jun 2014 08:24:52 +0000 (10:24 +0200)
Without that there is - afaict - nothing preventing the compiler from
putting the variable into a register for the duration of the wait loop.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Yang Zhang <yang.z.zhang@intel.com>
master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c
master date: 2014-06-20 10:25:33 +0200

xen/drivers/passthrough/vtd/qinval.c

index 6a410d8e8f8919c2c751b4ecb0134fd1fa361c32..d2b5fa93b223ab06940c05152dcdf256aa875e80 100644 (file)
@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct iommu *iommu,
     u8 iflag, u8 sw, u8 fn)
 {
     s_time_t start_time;
-    u32 poll_slot = QINVAL_STAT_INIT;
+    volatile u32 poll_slot = QINVAL_STAT_INIT;
     int index = -1;
     int ret = -1;
     unsigned long flags;