From: Jan Beulich Date: Tue, 24 Jun 2014 08:24:52 +0000 (+0200) Subject: VT-d/qinval: make local variable used for communication with IOMMU "volatile" X-Git-Tag: 4.2.5-rc2~8 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=524f82e65b8bff8c016b4036bc2f2708ad80e11d;p=xen.git VT-d/qinval: make local variable used for communication with IOMMU "volatile" 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 Reviewed-by: Andrew Cooper Acked-by: Yang Zhang master commit: ceec46c02074e1b2ade0b13c3c4a2f3942ae698c master date: 2014-06-20 10:25:33 +0200 --- diff --git a/xen/drivers/passthrough/vtd/qinval.c b/xen/drivers/passthrough/vtd/qinval.c index 6a410d8e8f..d2b5fa93b2 100644 --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -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;