summaryrefslogtreecommitdiff
path: root/src/common/page_table.h
diff options
context:
space:
mode:
authorGravatar Markus Wick2021-05-29 09:24:09 +0200
committerGravatar Markus Wick2021-05-29 09:28:26 +0200
commit42a7c5d017a3a6bb5e6ed1b51b955ea3d756eead (patch)
tree4fefc42bc8c52930851ddb783dae2b7ddf3fbbe3 /src/common/page_table.h
parentcore/arm_interface: Improve the performance of memory fallbacks. (diff)
downloadyuzu-42a7c5d017a3a6bb5e6ed1b51b955ea3d756eead.tar.gz
yuzu-42a7c5d017a3a6bb5e6ed1b51b955ea3d756eead.tar.xz
yuzu-42a7c5d017a3a6bb5e6ed1b51b955ea3d756eead.zip
core/memory: Check our memory fallbacks for out-of-bound behavior.
This makes it by far harder to crash yuzu. Also implement the 48bit masking of AARCH64 while touching this code.
Diffstat (limited to '')
-rw-r--r--src/common/page_table.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/page_table.h b/src/common/page_table.h
index 61c5552e0..e92b66b2b 100644
--- a/src/common/page_table.h
+++ b/src/common/page_table.h
@@ -98,6 +98,10 @@ struct PageTable {
98 */ 98 */
99 void Resize(size_t address_space_width_in_bits, size_t page_size_in_bits); 99 void Resize(size_t address_space_width_in_bits, size_t page_size_in_bits);
100 100
101 size_t GetAddressSpaceBits() const {
102 return current_address_space_width_in_bits;
103 }
104
101 /** 105 /**
102 * Vector of memory pointers backing each page. An entry can only be non-null if the 106 * Vector of memory pointers backing each page. An entry can only be non-null if the
103 * corresponding attribute element is of type `Memory`. 107 * corresponding attribute element is of type `Memory`.
@@ -105,6 +109,8 @@ struct PageTable {
105 VirtualBuffer<PageInfo> pointers; 109 VirtualBuffer<PageInfo> pointers;
106 110
107 VirtualBuffer<u64> backing_addr; 111 VirtualBuffer<u64> backing_addr;
112
113 size_t current_address_space_width_in_bits;
108}; 114};
109 115
110} // namespace Common 116} // namespace Common