+
+HandleLockErrata:
+
+ /* Fail if this isn't a write fault */
+ test word ptr [ebp+KTRAP_FRAME_ERROR_CODE], 0x4
+ jnz NotLockErrata
+
+ /* Also make sure the page fault is for IDT entry 6 */
+ mov eax, PCR[KPCR_IDT]
+ add eax, 0x30
+ cmp eax, edi
+ jne NotLockErrata
+
+ /*
+ * This is a write fault to the Invalid Opcode handler entry.
+ * We assume this is the lock errata and not a real write fault.
+ */
+
+ /* Clear the error code */
+ and dword ptr [ebp+KTRAP_FRAME_ERROR_CODE], 0
+
+ /* Check if this happened in V86 mode */
+ test dword ptr [ebp+KTRAP_FRAME_EFLAGS], EFLAGS_V86_MASK
+ jnz VdmOpCodeFault
+
+ /* Dispatch this to the invalid opcode handler */
+ jmp DispatchLockErrata