arch-vega: Add VEGA page tables and TLB
Add the page table walker, page table format, TLB, TLB coalescer, and associated support in the AMDGPUDevice. This page table format used the hardware format for dGPU and is very different from APU/GCN3 which use the X86 page table format. In order to support either format for the GPU model, a common TranslationState called GpuTranslation state is created which holds the combined fields of both the APU and Vega translation state. Similarly the TlbEntry is cast at runtime by the corresponding arch files as they are the only files which touch the internals of the TlbEntry. The GPU model only checks if a TlbEntry is non-null and thus does not need to cast to peek inside the data structure. Change-Id: I4484c66239b48df5224d61caa6e968e56eea38a5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51848 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -106,6 +106,53 @@ class AMDGPUDevice : public PciDevice
|
||||
bool checkpoint_before_mmios;
|
||||
int init_interrupt_count;
|
||||
|
||||
typedef struct GEM5_PACKED
|
||||
{
|
||||
// Page table addresses: from (Base + Start) to (End)
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ptBaseL;
|
||||
uint32_t ptBaseH;
|
||||
};
|
||||
Addr ptBase;
|
||||
};
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ptStartL;
|
||||
uint32_t ptStartH;
|
||||
};
|
||||
Addr ptStart;
|
||||
};
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint32_t ptEndL;
|
||||
uint32_t ptEndH;
|
||||
};
|
||||
Addr ptEnd;
|
||||
};
|
||||
} VMContext; // VM Context
|
||||
|
||||
typedef struct SysVMContext : VMContext
|
||||
{
|
||||
Addr agpBase;
|
||||
Addr agpTop;
|
||||
Addr agpBot;
|
||||
Addr fbBase;
|
||||
Addr fbTop;
|
||||
Addr fbOffset;
|
||||
Addr sysAddrL;
|
||||
Addr sysAddrH;
|
||||
} SysVMContext; // System VM Context
|
||||
|
||||
SysVMContext vmContext0;
|
||||
std::vector<VMContext> vmContexts;
|
||||
|
||||
public:
|
||||
AMDGPUDevice(const AMDGPUDeviceParams &p);
|
||||
|
||||
@@ -127,6 +174,25 @@ class AMDGPUDevice : public PciDevice
|
||||
*/
|
||||
void serialize(CheckpointOut &cp) const override;
|
||||
void unserialize(CheckpointIn &cp) override;
|
||||
|
||||
/**
|
||||
* Methods related to translations and system/device memory.
|
||||
*/
|
||||
RequestorID vramRequestorId() { return 0; }
|
||||
|
||||
Addr
|
||||
getPageTableBase(uint16_t vmid)
|
||||
{
|
||||
assert(vmid > 0 && vmid < vmContexts.size());
|
||||
return vmContexts[vmid].ptBase;
|
||||
}
|
||||
|
||||
Addr
|
||||
getPageTableStart(uint16_t vmid)
|
||||
{
|
||||
assert(vmid > 0 && vmid < vmContexts.size());
|
||||
return vmContexts[vmid].ptStart;
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace gem5
|
||||
|
||||
Reference in New Issue
Block a user