* [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR
@ 2010-08-26 9:17 Sheng Yang
2010-08-26 9:24 ` Keir Fraser
0 siblings, 1 reply; 3+ messages in thread
From: Sheng Yang @ 2010-08-26 9:17 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
[-- Attachment #1: Type: Text/Plain, Size: 1406 bytes --]
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
--
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,13 @@
*(((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 */
+ if ( new_ire.lo.dlm == dest_LowestPrio )
+ new_ire.lo.rh = 1;
+ else
+ new_ire.lo.rh = 0;
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = new_rte.vector;
@@ -632,9 +636,13 @@
/* 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 */
+ if ( new_ire.lo.dlm == dest_LowestPrio )
+ new_ire.lo.rh = 1;
+ else
+ new_ire.lo.rh = 0;
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
[-- Attachment #2: rh_fix.patch --]
[-- Type: text/x-patch, Size: 1351 bytes --]
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,13 @@
*(((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 */
+ if ( new_ire.lo.dlm == dest_LowestPrio )
+ new_ire.lo.rh = 1;
+ else
+ new_ire.lo.rh = 0;
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = new_rte.vector;
@@ -632,9 +636,13 @@
/* 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 */
+ if ( new_ire.lo.dlm == dest_LowestPrio )
+ new_ire.lo.rh = 1;
+ else
+ new_ire.lo.rh = 0;
new_ire.lo.avail = 0;
new_ire.lo.res_1 = 0;
new_ire.lo.vector = (msg->data >> MSI_DATA_VECTOR_SHIFT) &
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR
2010-08-26 9:17 [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR Sheng Yang
@ 2010-08-26 9:24 ` Keir Fraser
2010-08-26 9:42 ` Sheng Yang
0 siblings, 1 reply; 3+ messages in thread
From: Keir Fraser @ 2010-08-26 9:24 UTC (permalink / raw)
To: Sheng Yang; +Cc: xen-devel
On 26/08/2010 10:17, "Sheng Yang" <sheng@linux.intel.com> 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR
2010-08-26 9:24 ` Keir Fraser
@ 2010-08-26 9:42 ` Sheng Yang
0 siblings, 0 replies; 3+ messages in thread
From: Sheng Yang @ 2010-08-26 9:42 UTC (permalink / raw)
To: Keir Fraser; +Cc: xen-devel
[-- Attachment #1: Type: Text/Plain, Size: 1714 bytes --]
On Thursday 26 August 2010 17:24:40 Keir Fraser wrote:
> On 26/08/2010 10:17, "Sheng Yang" <sheng@linux.intel.com> 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) &
[-- Attachment #2: rh_fix.patch --]
[-- Type: text/x-patch, Size: 1231 bytes --]
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) &
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-08-26 9:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-26 9:17 [PATCH] VT-d: Hardware require RH bit to be set in IRTE when delivery mode is LPR Sheng Yang
2010-08-26 9:24 ` Keir Fraser
2010-08-26 9:42 ` Sheng Yang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.