[PA] Split PartitionSuperPageExtentEntry into read-only one and writable one.
This is a part of ShadowMetadata CL (2/5). The entire CL is
crrev.com/c/5570783.
ReadOnlyPartitionSuperPageExtentEntry is used for
PartitionSuperPageExtentEntry inside the giga cage, and
WritablePartitionSuperPageExtentEntry is used for
PartitionSuperPageExtentEntry inside the shadow pool.
The design doc of shadow metadata is
https://docs.google.com/document/d/1LvMI_c1VuT4sWUqgKOdJlrZv0UWP5e3PLJ_oOlJ4l2k
Bug: 40238514
No-Try: true
Change-Id: Ib06c7743701b98e168c49781d2d933789a144590
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5684975
Reviewed-by: Yuki Shiino <yukishiino@chromium.org>
Commit-Queue: Takashi Sakamoto <tasak@google.com>
Cr-Commit-Position: refs/heads/main@{#1337653}
NOKEYCHECK=True
GitOrigin-RevId: 7cddc390c898096526a3911df8b97ac6bfd14bd8
diff --git a/partition_allocator/pa_dump_heap.cc b/partition_allocator/pa_dump_heap.cc
index 70024bb..68af679 100644
--- a/partition_allocator/pa_dump_heap.cc
+++ b/partition_allocator/pa_dump_heap.cc
@@ -39,7 +39,7 @@
using partition_alloc::internal::kSuperPageSize;
using partition_alloc::internal::PartitionPageMetadata;
using partition_alloc::internal::PartitionPageSize;
-using partition_alloc::internal::PartitionSuperPageExtentEntry;
+using partition_alloc::internal::ReadOnlyPartitionSuperPageExtentEntry;
using partition_alloc::internal::SystemPageSize;
// See https://www.kernel.org/doc/Documentation/vm/pagemap.txt.
@@ -128,11 +128,11 @@
uintptr_t extent_address =
reinterpret_cast<uintptr_t>(root_.get()->first_extent);
while (extent_address) {
- auto extent =
- RawBuffer<PartitionSuperPageExtentEntry>::ReadFromProcessMemory(
- reader_, extent_address);
+ auto extent = RawBuffer<ReadOnlyPartitionSuperPageExtentEntry>::
+ ReadFromProcessMemory(reader_, extent_address);
uintptr_t first_super_page_address = SuperPagesBeginFromExtent(
- reinterpret_cast<PartitionSuperPageExtentEntry*>(extent_address));
+ reinterpret_cast<ReadOnlyPartitionSuperPageExtentEntry*>(
+ extent_address));
for (uintptr_t super_page = first_super_page_address;
super_page < first_super_page_address +
extent->get()->number_of_consecutive_super_pages *