]> xenbits.xensource.com Git - xtf.git/commitdiff
XSA-186: Work around suspected Broadwell TLB erratum
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Oct 2016 10:34:53 +0000 (11:34 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 28 Oct 2016 10:34:53 +0000 (11:34 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
tests/xsa-186/main.c

index f2bc8f6cef9a152fbef48c0f63a690465915f1af..fe7e98b79a69ce6518d2c6f840b29ca05b036ab0 100644 (file)
@@ -143,6 +143,29 @@ void test_main(void)
     extern char insn_buf_end[] asm("insn_stub_end");
     memcpy(stub, insn_buf_start, insn_buf_end - insn_buf_start);
 
+    /*
+     * Work around suspected Broadwell TLB Erratum
+     *
+     * Occasionally, this test failes with:
+     *
+     *   --- Xen Test Framework ---
+     *   Environment: HVM 64bit (Long mode 4 levels)
+     *   XSA-186 PoC
+     *   ******************************
+     *   PANIC: Unhandled exception at 0008:fffffffffffffffa
+     *   Vec 14 #PF[-I-sr-] %cr2 fffffffffffffffa
+     *   ******************************
+     *
+     * on Broadwell hardware.  The mapping is definitely present as the
+     * memcpy() has already succeeded.  Inserting an invlpg resolves the
+     * issue, sugguesting that there is a race conditon between dTLB/iTLB
+     * handling.
+     *
+     * Work around the issue for now, to avoid intermittent OSSTest failures
+     * from blocking pushes of unrelated changes.
+     */
+    invlpg(stub);
+
     /*
      * Execute the stub.
      *