misc: Clean up usage of arch/isa_traits.hh.

isa_traits.hh used to have much more in it, but now it only has
PageShift, PageBytes, and (for now) the guest endianness. These values
should only be retrieved from the System class generally speaking, so
only the system class should include arch/isa_traits.hh.

Some gpu compute related files need PageBytes or PageShift. Even though
those files don't advertise their ISA dependence, they are tied to x86.
In those files, they can include arch/x86/isa_traits.hh.

The only other file which legitimately needs arch/isa_traits.hh is the
decoder cache since it uses PageBytes to size an array.

Change-Id: I12686368715623e3140a68a7027c136bd52567b1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33203
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2020-08-21 21:58:03 -07:00
parent 1e18de8270
commit 1d755b4ba1
28 changed files with 11 additions and 29 deletions

View File

@@ -41,7 +41,6 @@
#ifndef __ARCH_GENERIC_MEMHELPERS_HH__
#define __ARCH_GENERIC_MEMHELPERS_HH__
#include "arch/isa_traits.hh"
#include "base/types.hh"
#include "mem/packet.hh"
#include "mem/request.hh"

View File

@@ -52,7 +52,6 @@
#include "arch/generic/types.hh"
#include "arch/generic/vec_pred_reg.hh"
#include "arch/generic/vec_reg.hh"
#include "arch/isa_traits.hh"
#include "arch/riscv/generated/max_inst_regs.hh"
#include "base/types.hh"

View File

@@ -51,7 +51,6 @@
#include "arch/null/cpu_dummy.hh"
#else
#include "arch/generic/interrupts.hh"
#include "arch/isa_traits.hh"
#include "base/statistics.hh"
#include "mem/port_proxy.hh"
#include "sim/clocked_object.hh"

View File

@@ -45,7 +45,6 @@
#include <list>
#include <string>
#include "arch/isa_traits.hh"
#include "base/refcnt.hh"
#include "config/the_isa.hh"
#include "cpu/base_dyn_inst.hh"

View File

@@ -43,7 +43,6 @@
#include <iomanip>
#include <sstream>
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/loader/symtab.hh"
#include "config/the_isa.hh"

View File

@@ -44,7 +44,6 @@
#include <array>
#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/o3/cpu.hh"
#include "cpu/o3/isa_specific.hh"

View File

@@ -49,7 +49,6 @@
#include <queue>
#include "arch/generic/tlb.hh"
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/random.hh"
#include "base/types.hh"

View File

@@ -29,7 +29,6 @@
#ifndef __CPU_O3_IMPL_HH__
#define __CPU_O3_IMPL_HH__
#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/o3/cpu_policy.hh"

View File

@@ -49,7 +49,6 @@
#include "arch/generic/debugfaults.hh"
#include "arch/generic/vec_reg.hh"
#include "arch/isa_traits.hh"
#include "arch/locked_mem.hh"
#include "config/the_isa.hh"
#include "cpu/inst_seq.hh"

View File

@@ -44,7 +44,6 @@
#include <vector>
#include "arch/isa_traits.hh"
#include "arch/types.hh"
#include "base/trace.hh"
#include "config/the_isa.hh"

View File

@@ -44,7 +44,6 @@
#include <list>
#include "arch/isa_traits.hh"
#include "arch/registers.hh"
#include "config/the_isa.hh"
#include "cpu/o3/rename.hh"

View File

@@ -44,7 +44,6 @@
#include <algorithm>
#include "arch/isa_traits.hh"
#include "arch/types.hh"
#include "arch/utility.hh"
#include "base/trace.hh"

View File

@@ -31,7 +31,6 @@
#include <deque>
#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/inst_seq.hh"
#include "cpu/pred/indirect.hh"

View File

@@ -42,7 +42,6 @@
#include <string>
#include "arch/isa_traits.hh"
#include "arch/utility.hh"
#include "base/callback.hh"
#include "base/compiler.hh"

View File

@@ -47,7 +47,6 @@
#include "arch/decoder.hh"
#include "arch/generic/tlb.hh"
#include "arch/isa.hh"
#include "arch/isa_traits.hh"
#include "arch/registers.hh"
#include "arch/types.hh"
#include "base/types.hh"

View File

@@ -49,7 +49,6 @@
#include <deque>
#include <string>
#include "arch/isa_traits.hh"
#include "base/chunk_generator.hh"
#include "base/cprintf.hh" // csprintf
#include "base/trace.hh"

View File

@@ -40,7 +40,6 @@
#include <functional>
#include "arch/isa_traits.hh"
#include "base/bitunion.hh"
#include "dev/virtio/virtio_ring.h"
#include "mem/port_proxy.hh"

View File

@@ -35,6 +35,7 @@
#include <limits>
#include "arch/x86/isa_traits.hh"
#include "base/output.hh"
#include "debug/GPUDisp.hh"
#include "debug/GPUExec.hh"

View File

@@ -40,6 +40,7 @@
#include "arch/x86/faults.hh"
#include "arch/x86/insts/microldstop.hh"
#include "arch/x86/isa_traits.hh"
#include "arch/x86/pagetable.hh"
#include "arch/x86/pagetable_walker.hh"
#include "arch/x86/regs/misc.hh"

View File

@@ -35,6 +35,7 @@
#include <limits>
#include "arch/x86/isa_traits.hh"
#include "arch/x86/linux/linux.hh"
#include "base/chunk_generator.hh"
#include "debug/GPUDisp.hh"

View File

@@ -40,7 +40,6 @@
#include <string>
#include "arch/isa.hh"
#include "arch/isa_traits.hh"
#include "base/types.hh"
#include "cpu/simple/atomic.hh"
#include "cpu/simple/timing.hh"

View File

@@ -35,6 +35,7 @@
#include <cstring>
#include "arch/x86/isa_traits.hh"
#include "base/logging.hh"
#include "debug/GPUTLB.hh"
#include "sim/process.hh"

View File

@@ -41,7 +41,6 @@
#include "arch/generic/tlb.hh"
#include "arch/isa.hh"
#include "arch/isa_traits.hh"
#include "arch/x86/pagetable.hh"
#include "arch/x86/regs/segment.hh"
#include "base/logging.hh"

View File

@@ -37,7 +37,6 @@
#include "kern/linux/helpers.hh"
#include "arch/isa_traits.hh"
#include "config/the_isa.hh"
#include "cpu/thread_context.hh"
#include "mem/port_proxy.hh"

View File

@@ -48,7 +48,6 @@
#include <cstdint>
#include "arch/isa_traits.hh"
#include "arch/generic/tlb.hh"
#include "base/statistics.hh"
#include "base/types.hh"

View File

@@ -28,7 +28,6 @@
#include "sim/faults.hh"
#include "arch/isa_traits.hh"
#include "base/logging.hh"
#include "cpu/base.hh"
#include "cpu/thread_context.hh"

View File

@@ -318,7 +318,7 @@ Process::drain()
void
Process::allocateMem(Addr vaddr, int64_t size, bool clobber)
{
int npages = divCeil(size, (int64_t)PageBytes);
int npages = divCeil(size, (int64_t)system->getPageBytes());
Addr paddr = system->allocPhysPages(npages);
pTable->map(vaddr, paddr, size,
clobber ? EmulationPageTable::Clobber :
@@ -333,14 +333,14 @@ Process::replicatePage(Addr vaddr, Addr new_paddr, ThreadContext *old_tc,
new_paddr = system->allocPhysPages(1);
// Read from old physical page.
uint8_t *buf_p = new uint8_t[PageBytes];
old_tc->getVirtProxy().readBlob(vaddr, buf_p, PageBytes);
uint8_t *buf_p = new uint8_t[system->getPageBytes()];
old_tc->getVirtProxy().readBlob(vaddr, buf_p, system->getPageBytes());
// Create new mapping in process address space by clobbering existing
// mapping (if any existed) and then write to the new physical page.
bool clobber = true;
pTable->map(vaddr, new_paddr, PageBytes, clobber);
new_tc->getVirtProxy().writeBlob(vaddr, buf_p, PageBytes);
pTable->map(vaddr, new_paddr, system->getPageBytes(), clobber);
new_tc->getVirtProxy().writeBlob(vaddr, buf_p, system->getPageBytes());
delete[] buf_p;
}
@@ -442,7 +442,7 @@ Process::updateBias()
// Determine how large the interpreters footprint will be in the process
// address space.
Addr interp_mapsize = roundUp(interp->mapSize(), TheISA::PageBytes);
Addr interp_mapsize = roundUp(interp->mapSize(), system->getPageBytes());
// We are allocating the memory area; set the bias to the lowest address
// in the allocated memory region.

View File

@@ -241,7 +241,7 @@ exitGroupFunc(SyscallDesc *desc, ThreadContext *tc, int status)
SyscallReturn
getpagesizeFunc(SyscallDesc *desc, ThreadContext *tc)
{
return (int)PageBytes;
return (int)tc->getSystemPtr()->getPageBytes();
}