fix: regression caused by tbx fault mngr

Addresses regressions from the reverted merge
of the tbx fault manager for host memory.

This fixes attempts by the tbx fault manager
to protect/unprotect host buffer memory, even
if the host ptr was not driver-allocated.

In the case of the smoke test that triggered
the critical regression, clCreateBuffer was
called with the CL_MEM_USE_HOST_PTR flag.
The subsequent `mprotect` calls on the
provided host ptr then failed.

Related-To: NEO-12268
Signed-off-by: Jack Myers <jack.myers@intel.com>
This commit is contained in:
Jack Myers
2024-12-03 00:28:34 +00:00
committed by Compute-Runtime-Automation
parent 6c08454fea
commit 9a14fe2478
34 changed files with 757 additions and 131 deletions

View File

@@ -83,9 +83,11 @@ MemoryManager::MemoryManager(ExecutionEnvironment &executionEnvironment) : execu
localMemAllocsSize[rootDeviceIndex].store(0u);
}
if (anyLocalMemorySupported) {
pageFaultManager = PageFaultManager::create();
prefetchManager = PrefetchManager::create();
if (anyLocalMemorySupported || debugManager.isTbxMode()) {
pageFaultManager = CpuPageFaultManager::create();
if (anyLocalMemorySupported) {
prefetchManager = PrefetchManager::create();
}
}
if (debugManager.flags.EnableMultiStorageResources.get() != -1) {

View File

@@ -29,7 +29,7 @@ namespace NEO {
using SubDeviceIdsVec = StackVec<uint32_t, 4>;
class MultiGraphicsAllocation;
class PageFaultManager;
class CpuPageFaultManager;
class GfxPartition;
struct ImageInfo;
struct AllocationData;
@@ -192,7 +192,7 @@ class MemoryManager {
return deferredDeleter.get();
}
PageFaultManager *getPageFaultManager() const {
MOCKABLE_VIRTUAL CpuPageFaultManager *getPageFaultManager() const {
return pageFaultManager.get();
}
@@ -413,7 +413,7 @@ class MemoryManager {
std::vector<std::unique_ptr<LocalMemoryUsageBankSelector>> internalLocalMemoryUsageBankSelector;
std::vector<std::unique_ptr<LocalMemoryUsageBankSelector>> externalLocalMemoryUsageBankSelector;
void *reservedMemory = nullptr;
std::unique_ptr<PageFaultManager> pageFaultManager;
std::unique_ptr<CpuPageFaultManager> pageFaultManager;
std::unique_ptr<PrefetchManager> prefetchManager;
OSMemory::ReservedCpuAddressRange reservedCpuAddressRange;
std::vector<std::unique_ptr<HeapAssigner>> heapAssigners;