mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
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>
33 lines
904 B
C++
33 lines
904 B
C++
/*
|
|
* Copyright (C) 2024 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "shared/source/page_fault_manager/cpu_page_fault_manager.h"
|
|
|
|
namespace NEO {
|
|
class CommandStreamReceiver;
|
|
class GraphicsAllocation;
|
|
|
|
class TbxPageFaultManager : public virtual CpuPageFaultManager {
|
|
public:
|
|
static std::unique_ptr<TbxPageFaultManager> create();
|
|
|
|
using CpuPageFaultManager::insertAllocation;
|
|
using CpuPageFaultManager::removeAllocation;
|
|
void insertAllocation(CommandStreamReceiver *csr, GraphicsAllocation *alloc, uint32_t bank, void *ptr, size_t size) override;
|
|
void removeAllocation(GraphicsAllocation *alloc) override;
|
|
|
|
using CpuPageFaultManager::checkFaultHandlerFromPageFaultManager;
|
|
using CpuPageFaultManager::verifyAndHandlePageFault;
|
|
|
|
protected:
|
|
void handlePageFault(void *ptr, PageFaultData &faultData) override;
|
|
};
|
|
|
|
} // namespace NEO
|