Flush paging TLB on guest page fault exception. If we do not do this, the Linux kernel runs but syscalls often get stuck

This commit is contained in:
Jonathan Campbell
2021-11-22 23:09:34 -08:00
parent 4943806b31
commit 83cfc43dc9

View File

@@ -406,6 +406,13 @@ static Bitu Normal_Loop(void) {
catch (const GuestPageFaultException& pf) {
Bitu FillFlags(void);
// LOG_MSG("Guest page fault %08x code %08x",(unsigned int)pf.lin_addr,(unsigned int)pf.faultcode);
/* Clear TLB because the guest OS is likely going to update the page tables to resolve the fault.
* This is REQUIRED for the normal core to run the Linux kernel properly, or else things just get "stuck"
* when you run commands. */
PAGING_ClearTLB();
ret = 0;
FillFlags();
paging.cr2=pf.lin_addr;