[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86: correct MSI_ADDR_DEST_ID_MASK



commit 3d239dce98abf6afef1ac2632ad357f9d739a405
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Thu May 15 15:27:37 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Thu May 15 15:27:37 2014 +0200

    x86: correct MSI_ADDR_DEST_ID_MASK
    
    This should only cover bits 12-19, in line with MSI_ADDR_DEST_ID_SHIFT.
    
    Also replace a couple of open-coded uses of this shift and mask.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/irq.c                 |    3 ++-
 xen/drivers/passthrough/vtd/intremap.c |    2 +-
 xen/drivers/passthrough/vtd/iommu.c    |    2 +-
 xen/include/asm-x86/msi.h              |    2 +-
 4 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/hvm/irq.c b/xen/arch/x86/hvm/irq.c
index 677fbcd..cb34b21 100644
--- a/xen/arch/x86/hvm/irq.c
+++ b/xen/arch/x86/hvm/irq.c
@@ -283,7 +283,8 @@ void hvm_inject_msi(struct domain *d, uint64_t addr, 
uint32_t data)
 
     if ( !vector )
     {
-        int pirq = ((addr >> 32) & 0xffffff00) | ((addr >> 12) & 0xff);
+        int pirq = ((addr >> 32) & 0xffffff00) | dest;
+
         if ( pirq > 0 )
         {
             struct pirq *info = pirq_info(d, pirq);
diff --git a/xen/drivers/passthrough/vtd/intremap.c 
b/xen/drivers/passthrough/vtd/intremap.c
index 2f8b9eb..07c6dac 100644
--- a/xen/drivers/passthrough/vtd/intremap.c
+++ b/xen/drivers/passthrough/vtd/intremap.c
@@ -535,7 +535,7 @@ static int remap_entry_to_msi_msg(
         msg->dest32 = iremap_entry->lo.dst;
     else
         msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
-    msg->address_lo |= (msg->dest32 & 0xff) << MSI_ADDR_DEST_ID_SHIFT;
+    msg->address_lo |= MSI_ADDR_DEST_ID(msg->dest32);
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |
diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 32e2035..9a9c1b4 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1044,7 +1044,7 @@ static void dma_msi_set_affinity(struct irq_desc *desc, 
const cpumask_t *mask)
     if (x2apic_enabled)
         msg.address_hi = dest & 0xFFFFFF00;
     msg.address_lo &= ~MSI_ADDR_DEST_ID_MASK;
-    msg.address_lo |= MSI_ADDR_DEST_ID(dest & 0xff);
+    msg.address_lo |= MSI_ADDR_DEST_ID(dest);
     iommu->msi.msg = msg;
 
     spin_lock_irqsave(&iommu->register_lock, flags);
diff --git a/xen/include/asm-x86/msi.h b/xen/include/asm-x86/msi.h
index 1dd0d8c..4c62a3a 100644
--- a/xen/include/asm-x86/msi.h
+++ b/xen/include/asm-x86/msi.h
@@ -49,7 +49,7 @@
 #define MSI_ADDR_REDIRECTION_LOWPRI (1 << MSI_ADDR_REDIRECTION_SHIFT)
 
 #define MSI_ADDR_DEST_ID_SHIFT         12
-#define         MSI_ADDR_DEST_ID_MASK          0x00ffff0
+#define         MSI_ADDR_DEST_ID_MASK          0x00ff000
 #define  MSI_ADDR_DEST_ID(dest)                (((dest) << 
MSI_ADDR_DEST_ID_SHIFT) & MSI_ADDR_DEST_ID_MASK)
 
 /* MAX fixed pages reserved for mapping MSIX tables. */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.