diff options
author | Alexandru Dutu <alexandru.dutu@amd.com> | 2014-11-23 18:01:08 -0800 |
---|---|---|
committer | Alexandru Dutu <alexandru.dutu@amd.com> | 2014-11-23 18:01:08 -0800 |
commit | adbaa4dfde96d5aaf84adf0ae4989ef880aad726 (patch) | |
tree | d0f597266fc27c9b7bfa36312fee1de1fea6c450 /src/arch/x86/tlb.cc | |
parent | 335514dfdc63c6f8e34cc172e2582ceca548a07c (diff) | |
download | gem5-adbaa4dfde96d5aaf84adf0ae4989ef880aad726.tar.xz |
kvm, x86: Adding support for SE mode execution
This patch adds methods in KvmCPU model to handle KVM exits caused by syscall
instructions and page faults. These types of exits will be encountered if
KvmCPU is run in SE mode.
Diffstat (limited to 'src/arch/x86/tlb.cc')
-rw-r--r-- | src/arch/x86/tlb.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/arch/x86/tlb.cc b/src/arch/x86/tlb.cc index fa226ac55..dd0aed770 100644 --- a/src/arch/x86/tlb.cc +++ b/src/arch/x86/tlb.cc @@ -232,15 +232,22 @@ TLB::finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const { Addr paddr = req->getPaddr(); - // Check for an access to the local APIC - if (FullSystem) { + AddrRange m5opRange(0xFFFF0000, 0xFFFFFFFF); + + if (m5opRange.contains(paddr)) { + if (m5opRange.contains(paddr)) { + req->setFlags(Request::MMAPPED_IPR | Request::GENERIC_IPR); + req->setPaddr(GenericISA::iprAddressPseudoInst( + (paddr >> 8) & 0xFF, + paddr & 0xFF)); + } + } else if (FullSystem) { + // Check for an access to the local APIC LocalApicBase localApicBase = tc->readMiscRegNoEffect(MISCREG_APIC_BASE); AddrRange apicRange(localApicBase.base * PageBytes, (localApicBase.base + 1) * PageBytes - 1); - AddrRange m5opRange(0xFFFF0000, 0xFFFFFFFF); - if (apicRange.contains(paddr)) { // The Intel developer's manuals say the below restrictions apply, // but the linux kernel, because of a compiler optimization, breaks @@ -257,11 +264,6 @@ TLB::finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const req->setFlags(Request::UNCACHEABLE); req->setPaddr(x86LocalAPICAddress(tc->contextId(), paddr - apicRange.start())); - } else if (m5opRange.contains(paddr)) { - req->setFlags(Request::MMAPPED_IPR | Request::GENERIC_IPR); - req->setPaddr(GenericISA::iprAddressPseudoInst( - (paddr >> 8) & 0xFF, - paddr & 0xFF)); } } |