VT-d: make remap_entry_to_msi_msg() return consistent message
authorJan Beulich <jbeulich@suse.com>
Thu, 4 Oct 2012 07:28:25 +0000 (09:28 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 4 Oct 2012 07:28:25 +0000 (09:28 +0200)
During debugging of another problem I found that in x2APIC mode, the
destination field of the low address value wasn't passed back
correctly. While this is benign in most cases (as the value isn't being
used anywhere), it can be confusing (and misguiding) when printing the
value read or when comparing it to the one previously passed into the
inverse function.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/drivers/passthrough/vtd/intremap.c

index 5b6066995d2fb8f412cf7ce8747878b2b64abc11..5f3531ac006a943938647070c7b1926c6b09caef 100644 (file)
@@ -521,8 +521,8 @@ static int remap_entry_to_msi_msg(
     if ( x2apic_enabled )
         msg->dest32 = iremap_entry->lo.dst;
     else
-        msg->address_lo |=
-            ((iremap_entry->lo.dst >> 8) & 0xff ) << MSI_ADDR_DEST_ID_SHIFT;
+        msg->dest32 = (iremap_entry->lo.dst >> 8) & 0xff;
+    msg->address_lo |= (msg->dest32 & 0xff) << MSI_ADDR_DEST_ID_SHIFT;
 
     msg->data =
         MSI_DATA_TRIGGER_EDGE |