Manually page align address range for write watch.

This commit is contained in:
Ben Vanik 2015-06-23 17:37:09 -07:00
parent 9441808b40
commit d335555277
1 changed files with 3 additions and 1 deletions

View File

@ -104,7 +104,9 @@ uintptr_t MMIOHandler::AddPhysicalWriteWatch(uint32_t guest_address,
// This means we need to round up, which will cause spurious access
// violations and invalidations.
// TODO(benvanik): only invalidate if actually within the region?
length = xe::round_up(length, xe::page_size());
length =
xe::round_up(length + (base_address % xe::page_size()), xe::page_size());
base_address = base_address - (base_address % xe::page_size());
// Add to table. The slot reservation may evict a previous watch, which
// could include our target, so we do it first.