dev,gpu-compute: Use a TranslationGen in DmaVirtDevice.
Use a TranslationGen to iterate over the translations for a region, rather than using a ChunkGenerator with a fixed page size the device needs to know. Change-Id: I5da565232bd5282074ef279ca74e556daeffef70 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50763 Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Matthew Poremba <matthew.poremba@amd.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> Maintainer: Matthew Poremba <matthew.poremba@amd.com>
This commit is contained in:
@@ -65,19 +65,15 @@ GPUCommandProcessor::hsaPacketProc()
|
||||
return *hsaPP;
|
||||
}
|
||||
|
||||
void
|
||||
GPUCommandProcessor::translateOrDie(Addr vaddr, Addr &paddr)
|
||||
TranslationGenPtr
|
||||
GPUCommandProcessor::translate(Addr vaddr, Addr size)
|
||||
{
|
||||
/**
|
||||
* Grab the process and try to translate the virtual address with it;
|
||||
* with new extensions, it will likely be wrong to just arbitrarily
|
||||
* grab context zero.
|
||||
*/
|
||||
// Grab the process and try to translate the virtual address with it; with
|
||||
// new extensions, it will likely be wrong to just arbitrarily grab context
|
||||
// zero.
|
||||
auto process = sys->threads[0]->getProcessPtr();
|
||||
|
||||
if (!process->pTable->translate(vaddr, paddr)) {
|
||||
fatal("failed translation: vaddr 0x%x\n", vaddr);
|
||||
}
|
||||
return process->pTable->translateRange(vaddr, size);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user