diff options
author | Luca Dariz <luca.dariz@gmail.com> | 2022-02-05 18:51:24 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-27 19:09:19 +0200 |
commit | f90ba97d5091ad85f089817231f53e34a0f6f259 (patch) | |
tree | 9586f5d9d0e11f508b150315b7466d5197726d56 /i386/intel | |
parent | f2626beb39dc416ceebfa35076d89cd291e2b903 (diff) | |
download | gnumach-f90ba97d5091ad85f089817231f53e34a0f6f259.tar.gz gnumach-f90ba97d5091ad85f089817231f53e34a0f6f259.tar.bz2 gnumach-f90ba97d5091ad85f089817231f53e34a0f6f259.zip |
add support for booting from grub with x86_64
* configure: compile for native x86_64 by default instead of xen
* x86_64/Makefrag.am: introduce KERNEL_MAP_BASE to reuse the constant
in both code and linker script
* x86_64/ldscript: use a .boot section for the very first operations,
until we reach long mode. This section is not really allocated, so
it doesn't need to be freed later. The vm system is later
initialized starting from .text and not including .boot
* link kernel at 0x4000000 as the xen version, higher values causes
linker errors
* we can't use full segmentation in long mode, so we need to create a
temporary mapping during early boot to be able to jump to high
addresses
* build direct map for first 4G in boothdr, it seems required by Linux
drivers
* add INTEL_PTE_PS bit definition to enable 2MB pages during bootstrap
* ensure write bit is set in PDP entry access rights. This only
applies to PAE-enabled kernels, mandatory for x86_64. On xen
platform it seems to be handled differently
Signed-off-by: Luca Dariz <luca@orpolo.org>
Message-Id: <20220205175129.309469-2-luca@orpolo.org>
Diffstat (limited to 'i386/intel')
-rw-r--r-- | i386/intel/pmap.c | 4 | ||||
-rw-r--r-- | i386/intel/pmap.h | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c index 5302b092..57c18a0d 100644 --- a/i386/intel/pmap.c +++ b/i386/intel/pmap.c @@ -655,7 +655,7 @@ void pmap_bootstrap(void) pa_to_pte(_kvtophys((void *) kernel_page_dir + i * INTEL_PGBYTES)) | INTEL_PTE_VALID -#ifdef MACH_PV_PAGETABLES +#if !defined(MACH_HYP) || defined(MACH_PV_PAGETABLES) | INTEL_PTE_WRITE #endif ); @@ -1298,7 +1298,7 @@ pmap_t pmap_create(vm_size_t size) WRITE_PTE(&p->pdpbase[i], pa_to_pte(kvtophys((vm_offset_t) page_dir[i])) | INTEL_PTE_VALID -#ifdef MACH_PV_PAGETABLES +#if !defined(MACH_HYP) || defined(MACH_PV_PAGETABLES) | INTEL_PTE_WRITE #endif ); diff --git a/i386/intel/pmap.h b/i386/intel/pmap.h index 63683bc5..bad640c1 100644 --- a/i386/intel/pmap.h +++ b/i386/intel/pmap.h @@ -148,6 +148,7 @@ typedef phys_addr_t pt_entry_t; #define INTEL_PTE_NCACHE 0x00000010 #define INTEL_PTE_REF 0x00000020 #define INTEL_PTE_MOD 0x00000040 +#define INTEL_PTE_PS 0x00000080 #ifdef MACH_PV_PAGETABLES /* Not supported */ #define INTEL_PTE_GLOBAL 0x00000000 |