mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 14:51:00 +00:00
[NTOSKRNL]: MOV CRX, YYY and MOV YYY, CRX, as well as the DR equivalents were not correctly detected as privileged instructions in the GPF handler. Fixes Winetests.
[NTOSKRNL]: The "Write" bit in the x86 Error Code is not bit 1, it is bit 2. Fix all the GPF handlers to check for bit 2 instead when determining if an exception was due to read or write. Fixes Winetests. I'll say it nicely this time for Timo: when you rewrite ASM, do it carefully :) svn path=/trunk/; revision=55735
This commit is contained in:
parent
1e172203a6
commit
0e2219f054
1 changed files with 13 additions and 6 deletions
|
@ -970,6 +970,12 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for privileged instructions */
|
/* Check for privileged instructions */
|
||||||
|
DPRINT("Instruction (%d) at fault: %lx %lx %lx %lx\n",
|
||||||
|
i,
|
||||||
|
Instructions[i],
|
||||||
|
Instructions[i + 1],
|
||||||
|
Instructions[i + 2],
|
||||||
|
Instructions[i + 3]);
|
||||||
if (Instruction == 0xF4) // HLT
|
if (Instruction == 0xF4) // HLT
|
||||||
{
|
{
|
||||||
/* HLT is privileged */
|
/* HLT is privileged */
|
||||||
|
@ -988,10 +994,11 @@ KiTrap0DHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
(Instructions[i + 1] == 0x08) || // INVD
|
(Instructions[i + 1] == 0x08) || // INVD
|
||||||
(Instructions[i + 1] == 0x09) || // WBINVD
|
(Instructions[i + 1] == 0x09) || // WBINVD
|
||||||
(Instructions[i + 1] == 0x35) || // SYSEXIT
|
(Instructions[i + 1] == 0x35) || // SYSEXIT
|
||||||
(Instructions[i + 1] == 0x26) || // MOV DR, XXX
|
(Instructions[i + 1] == 0x21) || // MOV DR, XXX
|
||||||
(Instructions[i + 1] == 0x06) || // CLTS
|
(Instructions[i + 1] == 0x06) || // CLTS
|
||||||
(Instructions[i + 1] == 0x20) || // MOV CR, XXX
|
(Instructions[i + 1] == 0x20) || // MOV CR, XXX
|
||||||
(Instructions[i + 1] == 0x24) || // MOV YYY, DR
|
(Instructions[i + 1] == 0x22) || // MOV XXX, CR
|
||||||
|
(Instructions[i + 1] == 0x23) || // MOV YYY, DR
|
||||||
(Instructions[i + 1] == 0x30) || // WRMSR
|
(Instructions[i + 1] == 0x30) || // WRMSR
|
||||||
(Instructions[i + 1] == 0x33)) // RDPMC
|
(Instructions[i + 1] == 0x33)) // RDPMC
|
||||||
// INVLPG, INVLPGA, SYSRET
|
// INVLPG, INVLPGA, SYSRET
|
||||||
|
@ -1192,7 +1199,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
KeBugCheckWithTf(IRQL_NOT_LESS_OR_EQUAL,
|
KeBugCheckWithTf(IRQL_NOT_LESS_OR_EQUAL,
|
||||||
Cr2,
|
Cr2,
|
||||||
-1,
|
-1,
|
||||||
TrapFrame->ErrCode & 1,
|
TrapFrame->ErrCode & 2 ? TRUE : FALSE,
|
||||||
TrapFrame->Eip,
|
TrapFrame->Eip,
|
||||||
TrapFrame);
|
TrapFrame);
|
||||||
}
|
}
|
||||||
|
@ -1254,7 +1261,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
/* This status code is repurposed so we can recognize it later */
|
/* This status code is repurposed so we can recognize it later */
|
||||||
KiDispatchException2Args(KI_EXCEPTION_ACCESS_VIOLATION,
|
KiDispatchException2Args(KI_EXCEPTION_ACCESS_VIOLATION,
|
||||||
TrapFrame->Eip,
|
TrapFrame->Eip,
|
||||||
TrapFrame->ErrCode & 1,
|
TrapFrame->ErrCode & 2 ? TRUE : FALSE,
|
||||||
Cr2,
|
Cr2,
|
||||||
TrapFrame);
|
TrapFrame);
|
||||||
}
|
}
|
||||||
|
@ -1264,7 +1271,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
/* These faults only have two parameters */
|
/* These faults only have two parameters */
|
||||||
KiDispatchException2Args(Status,
|
KiDispatchException2Args(Status,
|
||||||
TrapFrame->Eip,
|
TrapFrame->Eip,
|
||||||
TrapFrame->ErrCode & 1,
|
TrapFrame->ErrCode & 2 ? TRUE : FALSE,
|
||||||
Cr2,
|
Cr2,
|
||||||
TrapFrame);
|
TrapFrame);
|
||||||
}
|
}
|
||||||
|
@ -1273,7 +1280,7 @@ KiTrap0EHandler(IN PKTRAP_FRAME TrapFrame)
|
||||||
KiDispatchExceptionFromTrapFrame(STATUS_IN_PAGE_ERROR,
|
KiDispatchExceptionFromTrapFrame(STATUS_IN_PAGE_ERROR,
|
||||||
TrapFrame->Eip,
|
TrapFrame->Eip,
|
||||||
3,
|
3,
|
||||||
TrapFrame->ErrCode & 1,
|
TrapFrame->ErrCode & 2 ? TRUE : FALSE,
|
||||||
Cr2,
|
Cr2,
|
||||||
Status,
|
Status,
|
||||||
TrapFrame);
|
TrapFrame);
|
||||||
|
|
Loading…
Reference in a new issue