Exverge
5 days ago
No known key found for this signature in database
GPG Key ID: DAD399BCC5FB77E4
3 changed files with
5 additions and
4 deletions
-
src/common/host_memory.cpp
-
src/common/host_memory.h
-
src/core/memory.cpp
|
|
|
@ -864,7 +864,8 @@ void HostMemory::Protect(size_t virtual_offset, size_t length, MemoryPermission |
|
|
|
} |
|
|
|
|
|
|
|
// todo: make this actually inherit most permissive
|
|
|
|
LOG_WARNING(HW_Memory, "Memory is unaligned to page size, surrounding pages will inherit most permissive permissions"); |
|
|
|
LOG_DEBUG(HW_Memory, "Memory addresses {:#x}-{:#x} is unaligned to page size, surrounding pages will inherit most permissive permissions", |
|
|
|
virtual_offset, virtual_offset + length); |
|
|
|
auto aligned = AlignDown(virtual_offset, HostPageSize); |
|
|
|
auto diff = virtual_offset - aligned; |
|
|
|
virtual_offset = aligned; |
|
|
|
|
|
|
|
@ -18,7 +18,7 @@ |
|
|
|
|
|
|
|
namespace Common { |
|
|
|
|
|
|
|
#ifndef ARCHITECTURE_x86_64 |
|
|
|
#if !defined(ARCHITECTURE_x86_64) && !defined(__WIN32) |
|
|
|
const u64 HostPageSize = sysconf(_SC_PAGESIZE); |
|
|
|
const u64 HostPageBits = std::countr_zero(HostPageSize); |
|
|
|
const u64 HostPageMask = ~(HostPageSize - 1); |
|
|
|
|
|
|
|
@ -79,7 +79,7 @@ struct Memory::Impl { |
|
|
|
if (current_page_table->fastmem_arena) { |
|
|
|
bool is_fastmem = GetInteger(base) % Common::HostPageSize == GetInteger(target) % Common::HostPageSize; |
|
|
|
if (!is_fastmem) { |
|
|
|
LOG_WARNING(HW_Memory, "base {:#x} and target {:#x} aren't aligned in relation to host page size {}", |
|
|
|
LOG_DEBUG(HW_Memory, "base {:#x} and target {:#x} aren't aligned in relation to host page size {}", |
|
|
|
GetInteger(base), GetInteger(target), Common::HostPageSize); |
|
|
|
} |
|
|
|
|
|
|
|
@ -614,7 +614,7 @@ struct Memory::Impl { |
|
|
|
while (base != end) { |
|
|
|
auto target_paddr = target; |
|
|
|
if (auto iter = extra_mappings.find(base); iter != extra_mappings.end()) { |
|
|
|
LOG_WARNING(HW_Memory, "Mapping irregular address; {:#x} points to {:#x} instead of {:#x}", |
|
|
|
LOG_DEBUG(HW_Memory, "Mapping irregular address; {:#x} points to {:#x} instead of {:#x}", |
|
|
|
base << YUZU_PAGEBITS, iter->second << YUZU_PAGEBITS, GetInteger(target)); |
|
|
|
target_paddr = iter->second << YUZU_PAGEBITS; |
|
|
|
extra_mappings.erase(iter); |
|
|
|
|