RDMSR, WRMSR, and WBINVD now correctly GPF when CPL > 0, fixes #4887.

This commit is contained in:
OBattler
2024-10-15 23:54:57 +02:00
parent 9fb32aaa09
commit 0a3f1e3279
2 changed files with 10 additions and 2 deletions

View File

@@ -2611,7 +2611,9 @@ cpu_ven_reset(void)
void
cpu_RDMSR(void)
{
switch (cpu_s->cpu_type) {
if (CPL)
x86gpf(NULL, 0);
else switch (cpu_s->cpu_type) {
case CPU_IBM386SLC:
case CPU_IBM486SLC:
case CPU_IBM486BL:
@@ -3466,7 +3468,9 @@ cpu_WRMSR(void)
cpu_log("WRMSR %08X %08X%08X\n", ECX, EDX, EAX);
switch (cpu_s->cpu_type) {
if (CPL)
x86gpf(NULL, 0);
else switch (cpu_s->cpu_type) {
case CPU_IBM386SLC:
case CPU_IBM486SLC:
case CPU_IBM486BL:

View File

@@ -878,6 +878,10 @@ opINVD(uint32_t fetchdat)
static int
opWBINVD(uint32_t fetchdat)
{
if (CPL) {
x86gpf(NULL, 0);
return 1;
}
CLOCK_CYCLES(10000);
CPU_BLOCK_END();
return 0;