€•vFŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ%/translations/zh_CN/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/zh_TW/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/it_IT/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ja_JP/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/ko_KR/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ%/translations/sp_SP/arch/arm64/ptdump”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒKernel page table dump”h]”hŒKernel page table dump”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒ?/var/lib/git/docbuild/linux/Documentation/arch/arm64/ptdump.rst”h KubhŒ paragraph”“”)”}”(hXptdump is a debugfs interface that provides a detailed dump of the kernel page tables. It offers a comprehensive overview of the kernel virtual memory layout as well as the attributes associated with the various regions in a human-readable format. It is useful to dump the kernel page tables to verify permissions and memory types. Examining the page table entries and permissions helps identify potential security vulnerabilities such as mappings with overly permissive access rights or improper memory protections.”h]”hXptdump is a debugfs interface that provides a detailed dump of the kernel page tables. It offers a comprehensive overview of the kernel virtual memory layout as well as the attributes associated with the various regions in a human-readable format. It is useful to dump the kernel page tables to verify permissions and memory types. Examining the page table entries and permissions helps identify potential security vulnerabilities such as mappings with overly permissive access rights or improper memory protections.”…””}”(hh¹hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hXÙMemory hotplug allows dynamic expansion or contraction of available memory without requiring a system reboot. To maintain the consistency and integrity of the memory management data structures, arm64 makes use of the ``mem_hotplug_lock`` semaphore in write mode. Additionally, in read mode, ``mem_hotplug_lock`` supports an efficient implementation of ``get_online_mems()`` and ``put_online_mems()``. These protect the offlining of memory being accessed by the ptdump code.”h]”(hŒÙMemory hotplug allows dynamic expansion or contraction of available memory without requiring a system reboot. To maintain the consistency and integrity of the memory management data structures, arm64 makes use of the ”…””}”(hhÇhžhhŸNh NubhŒliteral”“”)”}”(hŒ``mem_hotplug_lock``”h]”hŒmem_hotplug_lock”…””}”(hhÑhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhhÇubhŒ6 semaphore in write mode. Additionally, in read mode, ”…””}”(hhÇhžhhŸNh NubhÐ)”}”(hŒ``mem_hotplug_lock``”h]”hŒmem_hotplug_lock”…””}”(hhãhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhhÇubhŒ) supports an efficient implementation of ”…””}”(hhÇhžhhŸNh NubhÐ)”}”(hŒ``get_online_mems()``”h]”hŒget_online_mems()”…””}”(hhõhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhhÇubhŒ and ”…””}”(hhÇhžhhŸNh NubhÐ)”}”(hŒ``put_online_mems()``”h]”hŒput_online_mems()”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhhÇubhŒJ. These protect the offlining of memory being accessed by the ptdump code.”…””}”(hhÇhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒ`In order to dump the kernel page tables, enable the following configurations and mount debugfs::”h]”hŒ_In order to dump the kernel page tables, enable the following configurations and mount debugfs:”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhŒ literal_block”“”)”}”(hŒjCONFIG_PTDUMP_DEBUGFS=y mount -t debugfs nodev /sys/kernel/debug cat /sys/kernel/debug/kernel_page_tables”h]”hŒjCONFIG_PTDUMP_DEBUGFS=y mount -t debugfs nodev /sys/kernel/debug cat /sys/kernel/debug/kernel_page_tables”…””}”hj/sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1j-hŸh¶h Khh£hžhubh¸)”}”(hX“On analysing the output of ``cat /sys/kernel/debug/kernel_page_tables`` one can derive information about the virtual address range of the entry, followed by size of the memory region covered by this entry, the hierarchical structure of the page tables and finally the attributes associated with each page. The page attributes provide information about access permissions, execution capability, type of mapping such as leaf level PTE or block level PGD, PMD and PUD, and access status of a page within the kernel memory. Assessing these attributes can assist in understanding the memory layout, access patterns and security characteristics of the kernel pages.”h]”(hŒOn analysing the output of ”…””}”(hj?hžhhŸNh NubhÐ)”}”(hŒ,``cat /sys/kernel/debug/kernel_page_tables``”h]”hŒ(cat /sys/kernel/debug/kernel_page_tables”…””}”(hjGhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhj?ubhXL one can derive information about the virtual address range of the entry, followed by size of the memory region covered by this entry, the hierarchical structure of the page tables and finally the attributes associated with each page. The page attributes provide information about access permissions, execution capability, type of mapping such as leaf level PTE or block level PGD, PMD and PUD, and access status of a page within the kernel memory. Assessing these attributes can assist in understanding the memory layout, access patterns and security characteristics of the kernel pages.”…””}”(hj?hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubh¸)”}”(hŒ&Kernel virtual memory layout example::”h]”hŒ%Kernel virtual memory layout example:”…””}”(hj_hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h K)hh£hžhubj.)”}”(hX®start address end address size attributes +---------------------------------------------------------------------------------------+ | ---[ Linear Mapping start ]---------------------------------------------------------- | | .................. | | 0xfff0000000000000-0xfff0000000210000 2112K PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED | | 0xfff0000000210000-0xfff0000001c00000 26560K PTE ro NX SHD AF UXN MEM/NORMAL | | .................. | | ---[ Linear Mapping end ]------------------------------------------------------------ | +---------------------------------------------------------------------------------------+ | ---[ Modules start ]----------------------------------------------------------------- | | .................. | | 0xffff800000000000-0xffff800008000000 128M PTE | | .................. | | ---[ Modules end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ vmalloc() area ]---------------------------------------------------------------- | | .................. | | 0xffff800008010000-0xffff800008200000 1984K PTE ro x SHD AF UXN MEM/NORMAL | | 0xffff800008200000-0xffff800008e00000 12M PTE ro x SHD AF CON UXN MEM/NORMAL | | .................. | | ---[ vmalloc() end ]----------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ Fixmap start ]------------------------------------------------------------------ | | .................. | | 0xfffffbfffdb80000-0xfffffbfffdb90000 64K PTE ro x SHD AF UXN MEM/NORMAL | | 0xfffffbfffdb90000-0xfffffbfffdba0000 64K PTE ro NX SHD AF UXN MEM/NORMAL | | .................. | | ---[ Fixmap end ]-------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ PCI I/O start ]----------------------------------------------------------------- | | .................. | | 0xfffffbfffe800000-0xfffffbffff800000 16M PTE | | .................. | | ---[ PCI I/O end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ vmemmap start ]----------------------------------------------------------------- | | .................. | | 0xfffffc0002000000-0xfffffc0002200000 2M PTE RW NX SHD AF UXN MEM/NORMAL | | 0xfffffc0002200000-0xfffffc0020000000 478M PTE | | .................. | | ---[ vmemmap end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+”h]”hX®start address end address size attributes +---------------------------------------------------------------------------------------+ | ---[ Linear Mapping start ]---------------------------------------------------------- | | .................. | | 0xfff0000000000000-0xfff0000000210000 2112K PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED | | 0xfff0000000210000-0xfff0000001c00000 26560K PTE ro NX SHD AF UXN MEM/NORMAL | | .................. | | ---[ Linear Mapping end ]------------------------------------------------------------ | +---------------------------------------------------------------------------------------+ | ---[ Modules start ]----------------------------------------------------------------- | | .................. | | 0xffff800000000000-0xffff800008000000 128M PTE | | .................. | | ---[ Modules end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ vmalloc() area ]---------------------------------------------------------------- | | .................. | | 0xffff800008010000-0xffff800008200000 1984K PTE ro x SHD AF UXN MEM/NORMAL | | 0xffff800008200000-0xffff800008e00000 12M PTE ro x SHD AF CON UXN MEM/NORMAL | | .................. | | ---[ vmalloc() end ]----------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ Fixmap start ]------------------------------------------------------------------ | | .................. | | 0xfffffbfffdb80000-0xfffffbfffdb90000 64K PTE ro x SHD AF UXN MEM/NORMAL | | 0xfffffbfffdb90000-0xfffffbfffdba0000 64K PTE ro NX SHD AF UXN MEM/NORMAL | | .................. | | ---[ Fixmap end ]-------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ PCI I/O start ]----------------------------------------------------------------- | | .................. | | 0xfffffbfffe800000-0xfffffbffff800000 16M PTE | | .................. | | ---[ PCI I/O end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+ | ---[ vmemmap start ]----------------------------------------------------------------- | | .................. | | 0xfffffc0002000000-0xfffffc0002200000 2M PTE RW NX SHD AF UXN MEM/NORMAL | | 0xfffffc0002200000-0xfffffc0020000000 478M PTE | | .................. | | ---[ vmemmap end ]------------------------------------------------------------------- | +---------------------------------------------------------------------------------------+”…””}”hjmsbah}”(h]”h ]”h"]”h$]”h&]”j=j>uh1j-hŸh¶h K+hh£hžhubh¸)”}”(hŒ5``cat /sys/kernel/debug/kernel_page_tables`` output::”h]”(hÐ)”}”(hŒ,``cat /sys/kernel/debug/kernel_page_tables``”h]”hŒ(cat /sys/kernel/debug/kernel_page_tables”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÏhj{ubhŒ output:”…””}”(hj{hžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h KVhh£hžhubj.)”}”(hX0xfff0000001c00000-0xfff0000080000000 2020M PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000080000000-0xfff0000800000000 30G PMD 0xfff0000800000000-0xfff0000800700000 7M PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000800700000-0xfff0000800710000 64K PTE ro NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000800710000-0xfff0000880000000 2089920K PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000880000000-0xfff0040000000000 4062G PMD 0xfff0040000000000-0xffff800000000000 3964T PGD”h]”hX0xfff0000001c00000-0xfff0000080000000 2020M PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000080000000-0xfff0000800000000 30G PMD 0xfff0000800000000-0xfff0000800700000 7M PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000800700000-0xfff0000800710000 64K PTE ro NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000800710000-0xfff0000880000000 2089920K PTE RW NX SHD AF UXN MEM/NORMAL-TAGGED 0xfff0000880000000-0xfff0040000000000 4062G PMD 0xfff0040000000000-0xffff800000000000 3964T PGD”…””}”hj—sbah}”(h]”h ]”h"]”h$]”h&]”j=j>uh1j-hŸh¶h KXhh£hžhubeh}”(h]”Œkernel-page-table-dump”ah ]”h"]”Œkernel page table dump”ah$]”h&]”uh1h¡hhhžhhŸh¶h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h¶uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¦NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jÐŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h¶Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”jªj§sŒ nametypes”}”jª‰sh}”j§h£sŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.