|
@@ -115,7 +115,15 @@ static void check_valid_segment(uint16_t index, int ldt,
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if (ar != expected_ar) {
|
|
|
+ /* The SDM says "bits 19:16 are undefined". Thanks. */
|
|
|
+ ar &= ~0xF0000;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * NB: Different Linux versions do different things with the
|
|
|
+ * accessed bit in set_thread_area().
|
|
|
+ */
|
|
|
+ if (ar != expected_ar &&
|
|
|
+ (ldt || ar != (expected_ar | AR_ACCESSED))) {
|
|
|
printf("[FAIL]\t%s entry %hu has AR 0x%08X but expected 0x%08X\n",
|
|
|
(ldt ? "LDT" : "GDT"), index, ar, expected_ar);
|
|
|
nerrs++;
|