@@ -16,12 +16,17 @@ There are three components to pagemap:
1616 * Bits 0-4 swap type if swapped
1717 * Bits 5-54 swap offset if swapped
1818 * Bit 55 pte is soft-dirty (see Documentation/vm/soft-dirty.txt)
19- * Bit 56 page exclusively mapped
19+ * Bit 56 page exclusively mapped (since 4.2)
2020 * Bits 57-60 zero
21- * Bit 61 page is file-page or shared-anon
21+ * Bit 61 page is file-page or shared-anon (since 3.5)
2222 * Bit 62 page swapped
2323 * Bit 63 page present
2424
25+ Since Linux 4.0 only users with the CAP_SYS_ADMIN capability can get PFNs.
26+ In 4.0 and 4.1 opens by unprivileged fail with -EPERM. Starting from
27+ 4.2 the PFN field is zeroed if the user does not have CAP_SYS_ADMIN.
28+ Reason: information about PFNs helps in exploiting Rowhammer vulnerability.
29+
2530 If the page is not present but in swap, then the PFN contains an
2631 encoding of the swap file number and the page's offset into the
2732 swap. Unmapped pages return a null PFN. This allows determining
@@ -160,3 +165,8 @@ Other notes:
160165Reading from any of the files will return -EINVAL if you are not starting
161166the read on an 8-byte boundary (e.g., if you sought an odd number of bytes
162167into the file), or if the size of the read is not a multiple of 8 bytes.
168+
169+ Before Linux 3.11 pagemap bits 55-60 were used for "page-shift" (which is
170+ always 12 at most architectures). Since Linux 3.11 their meaning changes
171+ after first clear of soft-dirty bits. Since Linux 4.2 they are used for
172+ flags unconditionally.
0 commit comments