gpu-compute: Implement per-request MTYPEs
GPU MTYPE is currently set using a global config passed to the PACoalescer. This patch enables MTYPE to be set by the shader on a per-request bases. In real hardware, the MTYPE is extracted from a GPUVM PTE during address translation. However, our current simulator only models x86 page tables which do not have the appropriate bits for GPU MTYPES. Rather than hacking non-x86 bits into our x86 page table models, this patch instead keeps an interval tree of all pages that request custom MTYPES in the driver itself. This is currently only used to map host pages to the GPU as uncacheable, but is easily extensible to other MTYPES. Change-Id: I7daab0ffae42084b9131a67c85cd0aa4bbbfc8d6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42216 Maintainer: Matthew Poremba <matthew.poremba@amd.com> Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Matthew Poremba
parent
dfa712f041
commit
ad43083bb3
@@ -42,7 +42,7 @@
|
||||
#include "sim/syscall_emul_buf.hh"
|
||||
|
||||
GPUCommandProcessor::GPUCommandProcessor(const Params &p)
|
||||
: HSADevice(p), dispatcher(*p.dispatcher), driver(nullptr)
|
||||
: HSADevice(p), dispatcher(*p.dispatcher), _driver(nullptr)
|
||||
{
|
||||
dispatcher.setCommandProcessor(this);
|
||||
}
|
||||
@@ -194,8 +194,17 @@ GPUCommandProcessor::updateHsaSignal(Addr signal_handle, uint64_t signal_value,
|
||||
void
|
||||
GPUCommandProcessor::attachDriver(HSADriver *hsa_driver)
|
||||
{
|
||||
fatal_if(driver, "Should not overwrite driver.");
|
||||
driver = hsa_driver;
|
||||
fatal_if(_driver, "Should not overwrite driver.");
|
||||
// TODO: GPU Driver inheritance hierarchy doesn't really make sense.
|
||||
// Should get rid of the base class.
|
||||
_driver = dynamic_cast<GPUComputeDriver *>(hsa_driver);
|
||||
assert(_driver);
|
||||
}
|
||||
|
||||
GPUComputeDriver*
|
||||
GPUCommandProcessor::driver()
|
||||
{
|
||||
return _driver;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -285,7 +294,7 @@ GPUCommandProcessor::dispatchPkt(HSAQueueEntry *task)
|
||||
void
|
||||
GPUCommandProcessor::signalWakeupEvent(uint32_t event_id)
|
||||
{
|
||||
driver->signalWakeupEvent(event_id);
|
||||
_driver->signalWakeupEvent(event_id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user