From: "Jan Beulich" Subject: [PATCH 1/4] VT-d/qinval: make local variable used for communication with IOMMU "volatile" Date: Mon, 16 Jun 2014 13:47:40 +0100 Message-ID: <539F038C020000780001AA34@mail.emea.novell.com> References: <539F025A020000780001AA25@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part3E0CFE7C.1__=" Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WwWK9-0007Th-5p for xen-devel@lists.xenproject.org; Mon, 16 Jun 2014 12:47:45 +0000 In-Reply-To: <539F025A020000780001AA25@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Yang Z Zhang , xiantao.zhang@intel.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part3E0CFE7C.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- a/xen/drivers/passthrough/vtd/qinval.c +++ b/xen/drivers/passthrough/vtd/qinval.c @@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct=20 u8 iflag, u8 sw, u8 fn) { s_time_t start_time; - u32 poll_slot =3D QINVAL_STAT_INIT; + volatile u32 poll_slot =3D QINVAL_STAT_INIT; int index =3D -1; int ret =3D -1; unsigned long flags; --=__Part3E0CFE7C.1__= Content-Type: text/plain; name="VT-d-qi-poll_slot-volatile.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="VT-d-qi-poll_slot-volatile.patch" VT-d/qinval: make local variable used for communication with IOMMU = "volatile"=0A=0AWithout that there is - afaict - nothing preventing the = compiler from=0Aputting the variable into a register for the duration of = the wait loop.=0A=0ASigned-off-by: Jan Beulich =0A=0A---= a/xen/drivers/passthrough/vtd/qinval.c=0A+++ b/xen/drivers/passthrough/vtd= /qinval.c=0A@@ -196,7 +196,7 @@ static int queue_invalidate_wait(struct = =0A u8 iflag, u8 sw, u8 fn)=0A {=0A s_time_t start_time;=0A- = u32 poll_slot =3D QINVAL_STAT_INIT;=0A+ volatile u32 poll_slot =3D = QINVAL_STAT_INIT;=0A int index =3D -1;=0A int ret =3D -1;=0A = unsigned long flags;=0A --=__Part3E0CFE7C.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part3E0CFE7C.1__=--