Skip to contentSkip to conversation

Decouple SandyBridge quirk from VTd timeout

PATCH Superseded Don Dugger 2 participants 2 messages Oct 8, 2014 – Oct 10, 2014

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Don Dugger

author
#0 lore raw

PATCH 1/1 Decouple SandyBridge quirk from VTd timeout

Currently the quirk code for SandyBridge uses the VTd timeout value when writing to an IGD register. Since the IGD is not part of the VTd engine this is the wrong timeout value to use. Change this code to use a timeout value that is unique to the quirk code.

--

xen/drivers/passthrough/vtd/quirks.c +3 -1
diff -r cf06cdd94296 xen/drivers/passthrough/vtd/quirks.c
@@ -50,6 +50,8 @@
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
 
+#define SNB_IGD_TIMEOUT	MILLISECS(1000)
+
 static u32 __read_mostly ioh_id;
 static u32 __initdata igd_id;
 bool_t __read_mostly rwbf_quirk;
@@ -177,7 +179,7 @@
     start_time = NOW();
     while ( (*(volatile u32 *)(igd_reg_va + 0x22AC) & 0xF) != 0 )
     {
-        if ( NOW() > start_time + DMAR_OPERATION_TIMEOUT )
+        if ( NOW() > start_time + SNB_IGD_TIMEOUT )
         {
             dprintk(XENLOG_INFO VTDPREFIX,
                     "snb_vtd_ops_preamble: failed to disable idle handshake\n");
#1 lore raw
Quoted 16 lines
Quoted 1 line
Quoted 1 line · On 08.10.14 at 18:34, <[email protected]> wrote:

Currently the quirk code for SandyBridge uses the VTd timeout value when writing to an IGD register. Since the IGD is not part of the VTd engine this is the wrong timeout value to use. Change this code to use a timeout value that is unique to the quirk code.

--
diff -r cf06cdd94296 xen/drivers/passthrough/vtd/quirks.c

xen/drivers/passthrough/vtd/quirks.c line 53

Quoted 4 lines
xen/drivers/passthrough/vtd/quirks.c +1 -0
@@ -50,6 +50,8 @@
 #define IS_ILK(id)    (id == 0x00408086 || id == 0x00448086 || id== 0x00628086 || id == 0x006A8086)
 #define IS_CPT(id)    (id == 0x01008086 || id == 0x01048086)
 
+#define SNB_IGD_TIMEOUT	MILLISECS(1000)

I would have expected the value to get shrunk to less than a second at once, without which the change isn't really all that useful. Mind explaining why this isn't being done?

Jan