VT-d: make remap_entry_to_msi_msg() return consistent message
PATCH 1/1 VT-d: make remap_entry_to_msi_msg() return consistent message
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.
xen/drivers/passthrough/vtd/intremap.c +4 -0
@@ -504,7 +504,11 @@ static int remap_entry_to_msi_msg( MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI);if ( x2apic_enabled ) + { msg->dest32 = iremap_entry->lo.dst; + msg->address_lo |= + (iremap_entry->lo.dst &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ; + }else msg->address_lo |= ((iremap_entry->lo.dst >>8 ) &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ;
VT-d: make remap_entry_to_msi_msg() return consistent message
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.
xen/drivers/passthrough/vtd/intremap.c +4 -0
@@ -504,7 +504,11 @@ static int remap_entry_to_msi_msg( MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI);if ( x2apic_enabled ) + { msg->dest32 = iremap_entry->lo.dst; + msg->address_lo |= + (iremap_entry->lo.dst &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ; + }else msg->address_lo |= ((iremap_entry->lo.dst >>8 ) &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 8 lines · Jan Beulich
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 <[email protected]>
Quoted 21 lines
xen/drivers/passthrough/vtd/intremap.c +4
-0@@ -504,7 +504,11 @@ static int remap_entry_to_msi_msg( MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI);if ( x2apic_enabled ) + { msg->dest32 = iremap_entry->lo.dst; + msg->address_lo |= + (iremap_entry->lo.dst &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ; + }else msg->address_lo |= ((iremap_entry->lo.dst >>8 ) &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 10 lines
Quoted 1 line
Quoted 1 line
Keir Fraser <[email protected]> 10/02/12 7:01 PM >>>
Quoted 7 lines · Jan Beulich
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.
Quoted 3 lines
Quoted 1 line
Signed-off-by Jan Beulich <[email protected]>Acked-by Keir Fraser <[email protected]>
Actually on my way home yesterday I realized that this is not consistent, i.e. fails to cover symmetrically the !x2apic case. Therefore, I'd like to adjust this to pull out the msg->dest32 assignment from the conditional. Will that be okay to commit without re-submission?
Jan
Quoted 21 lines
xen/drivers/passthrough/vtd/intremap.c +4
-0@@ -504,7 +504,11 @@ static int remap_entry_to_msi_msg( MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI);if ( x2apic_enabled ) + { msg->dest32 = iremap_entry->lo.dst; + msg->address_lo |= + (iremap_entry->lo.dst &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ; + }else msg->address_lo |= ((iremap_entry->lo.dst >>8 ) &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 12 lines · Jan Beulich
Quoted 12 lines
Quoted 1 line
Quoted 1 line
Keir Fraser <[email protected]> 10/02/12 7:01 PM >>>
Quoted 8 lines · Jan Beulich
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 <[email protected]>
Quoted 7 lines
Quoted 1 line
Acked-by Keir Fraser <[email protected]>Actually on my way home yesterday I realized that this is not consistent, i.e. fails to cover symmetrically the !x2apic case. Therefore, I'd like to adjust this
to pull out themsg->dest32assignment from the conditional. Will that be okay to commit without re-submission?
Yes, that's fine by me.
-- Keir
Quoted 28 lines
Jan
Quoted 21 lines
xen/drivers/passthrough/vtd/intremap.c +4
-0@@ -504,7 +504,11 @@ static int remap_entry_to_msi_msg( MSI_ADDR_REDIRECTION_CPU: MSI_ADDR_REDIRECTION_LOWPRI);if ( x2apic_enabled ) + { msg->dest32 = iremap_entry->lo.dst; + msg->address_lo |= + (iremap_entry->lo.dst &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ; + }else msg->address_lo |= ((iremap_entry->lo.dst >>8 ) &0xff ) <<MSI_ADDR_DEST_ID_SHIFT ;_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel