xen: modify page table construction

Modify the page table construction to allow multiple virtual regions
to be mapped. This is done as preparation for removing the p2m list
from the initial kernel mapping in order to support huge pv domains.

This allows a cleaner approach for mapping the relocator page by
using this capability.

The interface to the assembler level of the relocator has to be changed
in order to be able to process multiple page table areas.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Juergen Gross 2016-03-03 10:38:15 +01:00 committed by Daniel Kiper
parent 5500cefccd
commit b67a95ecad
6 changed files with 358 additions and 233 deletions

View file

@ -20,6 +20,8 @@
#ifndef GRUB_MEMORY_CPU_HEADER
#define GRUB_MEMORY_CPU_HEADER 1
#define PAGE_SHIFT 12
/* The flag for protected mode. */
#define GRUB_MEMORY_CPU_CR0_PE_ON 0x1
#define GRUB_MEMORY_CPU_CR4_PAE_ON 0x00000020
@ -31,6 +33,11 @@
#define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */
#define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START
/* Some PTE definitions. */
#define GRUB_PAGE_PRESENT 0x00000001
#define GRUB_PAGE_RW 0x00000002
#define GRUB_PAGE_USER 0x00000004
#ifndef ASM_FILE
#define GRUB_MMAP_MALLOC_LOW 1

View file

@ -23,11 +23,13 @@
#include <grub/err.h>
#include <grub/relocator.h>
#define XEN_MAX_MAPPINGS 3
struct grub_relocator_xen_state
{
grub_addr_t start_info;
grub_addr_t paging_start;
grub_addr_t paging_size;
grub_addr_t paging_start[XEN_MAX_MAPPINGS];
grub_addr_t paging_size[XEN_MAX_MAPPINGS];
grub_addr_t mfn_list;
grub_addr_t stack;
grub_addr_t entry_point;