[SeaBIOS] [RFC 2/3] Transitions to and from 64 bits

Gerd Hoffmann kraxel at redhat.com
Mon Sep 21 13:57:56 CET 2015


  Hi,

> +/****************************************************************
> + * Page table
> + ****************************************************************/
> +void *gen_identity_page_table(u64 max_addr)
> +{
> +    /* Map directly all the addresses */
> +    u32 pt_entries = (max_addr + 0xFFF) >> 12;
> +    u32 pdt_entries = (pt_entries + 0x1FF) >> 9;
> +    u32 pdpt_entries = (pdt_entries + 0x1FF) >> 9;
> +    u32 pml4_entries = (pdpt_entries + 0x1FF) >> 9;

You can use hugepages.  Then you'll need _alot_ less memory for the
pagetables, and the copying probably goes faster too.

You might consider mapping the nvdimm below 4G instead of entering long
mode.

cheers,
  Gerd





More information about the SeaBIOS mailing list