From 5f80e028b5a844932d15a48e2a132031357ef350 Mon Sep 17 00:00:00 2001 From: Michael Brooks Date: Mon, 12 Apr 2021 13:50:21 -0700 Subject: [PATCH] Force Simple Mapping Extended mapping sets the status bit indicating that it is extended on the 63rd bit. For systems that can only access 32-bit, this won't work. Use MappingTypeHints to use Simple for everything. --- driver/device_buffer_mapper.cc | 2 +- driver/mmio_driver.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driver/device_buffer_mapper.cc b/driver/device_buffer_mapper.cc index 51ac8f5..2c3a3d2 100644 --- a/driver/device_buffer_mapper.cc +++ b/driver/device_buffer_mapper.cc @@ -106,7 +106,7 @@ util::StatusOr DeviceBufferMapper::Map(const Buffer& buffer, DmaDirection direction) { TRACE_SCOPE("DeviceBufferMapper::Map"); if (buffer.IsValid()) { - return address_space_->MapMemory(buffer, direction, MappingTypeHint::kAny); + return address_space_->MapMemory(buffer, direction, MappingTypeHint::kSimple); } return DeviceBuffer(); // Invalid buffer. } diff --git a/driver/mmio_driver.cc b/driver/mmio_driver.cc index d2768ed..cae1954 100644 --- a/driver/mmio_driver.cc +++ b/driver/mmio_driver.cc @@ -435,7 +435,7 @@ util::StatusOr MmioDriver::DoMapBuffer( if (buffer.IsValid()) { ASSIGN_OR_RETURN(auto device_buffer, address_space_->MapMemory(buffer, direction, - MappingTypeHint::kExtended)); + MappingTypeHint::kSimple)); // TODO : this is dangerous: the std::bind captures a raw pointer to // the address space. This will break if executable registry outlives // address space in the driver. A better way is to at least use share_ptr