From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR Date: Thu, 26 Aug 2010 17:42:21 +0800 Message-ID: <201008261742.21696.sheng@linux.intel.com> References: Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_9bjdMiFUQpTOuX8" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --Boundary-00=_9bjdMiFUQpTOuX8 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Thursday 26 August 2010 17:24:40 Keir Fraser wrote: > On 26/08/2010 10:17, "Sheng Yang" wrote: > > + /* Hardware require RH = 1 for LPR delivery mode */ > > + if ( new_ire.lo.dlm == dest_LowestPrio ) > > + new_ire.lo.rh = 1; > > + else > > + new_ire.lo.rh = 0; > > The form 'if ( p ) x = 1; else x = 0;' is better written as 'x = (p)'. > Please re-submit in that style. > > -- Keir Updated, thanks. -- regards Yang, Sheng -- diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -320,9 +320,10 @@ *(((u32 *)&new_rte) + 0) = value; new_ire.lo.fpd = 0; new_ire.lo.dm = new_rte.dest_mode; - new_ire.lo.rh = 0; new_ire.lo.tm = new_rte.trigger; new_ire.lo.dlm = new_rte.delivery_mode; + /* Hardware require RH = 1 for LPR delivery mode */ + new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio); new_ire.lo.avail = 0; new_ire.lo.res_1 = 0; new_ire.lo.vector = new_rte.vector; @@ -632,9 +633,10 @@ /* Set interrupt remapping table entry */ new_ire.lo.fpd = 0; new_ire.lo.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1; - new_ire.lo.rh = 0; new_ire.lo.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1; new_ire.lo.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1; + /* Hardware require RH = 1 for LPR delivery mode */ + new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio); new_ire.lo.avail = 0; new_ire.lo.res_1 = 0; new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) & --Boundary-00=_9bjdMiFUQpTOuX8 Content-Type: text/x-patch; charset="UTF-8"; name="rh_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="rh_fix.patch" diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -320,9 +320,10 @@ *(((u32 *)&new_rte) + 0) = value; new_ire.lo.fpd = 0; new_ire.lo.dm = new_rte.dest_mode; - new_ire.lo.rh = 0; new_ire.lo.tm = new_rte.trigger; new_ire.lo.dlm = new_rte.delivery_mode; + /* Hardware require RH = 1 for LPR delivery mode */ + new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio); new_ire.lo.avail = 0; new_ire.lo.res_1 = 0; new_ire.lo.vector = new_rte.vector; @@ -632,9 +633,10 @@ /* Set interrupt remapping table entry */ new_ire.lo.fpd = 0; new_ire.lo.dm = (msg->address_lo >> MSI_ADDR_DESTMODE_SHIFT) & 0x1; - new_ire.lo.rh = 0; new_ire.lo.tm = (msg->data >> MSI_DATA_TRIGGER_SHIFT) & 0x1; new_ire.lo.dlm = (msg->data >> MSI_DATA_DELIVERY_MODE_SHIFT) & 0x1; + /* Hardware require RH = 1 for LPR delivery mode */ + new_ire.lo.rh = (new_ire.lo.dlm == dest_LowestPrio); new_ire.lo.avail = 0; new_ire.lo.res_1 = 0; new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) & --Boundary-00=_9bjdMiFUQpTOuX8 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.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_9bjdMiFUQpTOuX8--