\

Self-referencing Page Tables for the x86-Architecture

62 points - 12/25/2025

Source
  • no92

    12/25/2025

    If I'm not mistaken, this is just fractal mapping, which is very common. See https://wiki.osdev.org/Fractal_Page_Mapping

      • userbinator

        12/25/2025

        It's amusing to see a concept that is explained simply in a few lines, become an entire bachelor's thesis.

    • cmpxchg8b

      12/25/2025

      I'm confused, is this meant to be presented as new work? Windows has done this for a very long time.

        • raggi

          12/25/2025

          I found it very opaquely worded the whole way through. I think the work being presented is simply an implementation of the technique in eduos, but short of going and reading the paper I don’t know.

          • protoman3000

            12/25/2025

            It’s a bachelor’s thesis.

            • als0

              12/25/2025

              "There is only a single reference5 dated to 2010 indicating that Microsoft might use a similar approach for its NT kernel."

                • cmpxchg8b

                  12/25/2025

                  Googling for it brings up a ton of results.

          • voidmain

            12/25/2025

            I'm currently using recursive page tables for the OS I'm working on, but I'm probably going to change that. There are lots of different address spaces for different processes and (with IOMMU) devices, and it's nicer to be able to modify any of them rather than only the current one. I am leaning toward just assigning 2 MiB of memory to page tables at a time and keeping a mapping for these (I don't want to map all physical memory in the kernel for security reasons).

              • amluto

                12/26/2025

                Don’t use recursive page tables.

                - What if you want to port to an architecture that can’t do them?

                - How sure are you that all the bonus bits in the entries line up right?

                - What if you want to use huge pages of various sizes?

                - What if you want to write-protect some page tables?

                - What if you want to access a non-current page table? If you do that you need to write all the relevant logic anyway.

                - What if a page table isn’t allocated? You probably don’t want to find out by trying to access it and getting a page fault in kernel mode.

                - What if you don’t want user code to be able to trivially guess kernel addresses?

            • jdefr89

              12/25/2025

              Isn't this just fractal page mappings? Am I missing something?

              • maximgeorge

                12/25/2025

                [dead]