[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 09/18] xen: add PVH boot entry code
From: |
Juergen Gross |
Subject: |
[PATCH v3 09/18] xen: add PVH boot entry code |
Date: |
Wed, 24 Oct 2018 16:54:18 +0200 |
Add the code for the Xen PVH mode boot entry.
Signed-off-by: Juergen Gross <address@hidden>
---
V3: clear %fs and %gs, too (Daniel Kiper)
use GRUB_MEMORY_MACHINE_PROT_STACK_SIZE for stack size (Daniel Kiper)
---
grub-core/kern/i386/xen/startup_pvh.S | 52 +++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/grub-core/kern/i386/xen/startup_pvh.S
b/grub-core/kern/i386/xen/startup_pvh.S
index 69b8fdcca..417655990 100644
--- a/grub-core/kern/i386/xen/startup_pvh.S
+++ b/grub-core/kern/i386/xen/startup_pvh.S
@@ -19,11 +19,63 @@
#include <config.h>
#include <grub/symbol.h>
+#include <grub/machine/memory.h>
.file "startup_pvh.S"
.text
+ .globl start, _start
+ .code32
+start:
+_start:
+ cld
+ lgdt gdtdesc
+ ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $1f
+1:
+ movl $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %eax
+ mov %eax, %ds
+ mov %eax, %es
+ mov %eax, %ss
+ mov %eax, %fs
+ mov %eax, %gs
+ leal LOCAL(stack_end), %esp
+
+ /* Save address of start info structure. */
+ mov %ebx, pvh_start_info
+ call EXT_C(grub_main)
+ /* Doesn't return. */
+
+ .p2align 3
+gdt:
+ .word 0, 0
+ .byte 0, 0, 0, 0
+
+ /* -- code segment --
+ * base = 0x00000000, limit = 0xFFFFF (4 KiB Granularity), present
+ * type = 32bit code execute/read, DPL = 0
+ */
+ .word 0xFFFF, 0
+ .byte 0, 0x9A, 0xCF, 0
+
+ /* -- data segment --
+ * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present
+ * type = 32 bit data read/write, DPL = 0
+ */
+ .word 0xFFFF, 0
+ .byte 0, 0x92, 0xCF, 0
+
+ .p2align 3
+/* this is the GDT descriptor */
+gdtdesc:
+ .word 0x17 /* limit */
+ .long gdt /* addr */
+
+ .p2align 2
/* Saved pointer to start info structure. */
.globl pvh_start_info
pvh_start_info:
.long 0
+
+ .bss
+ .space GRUB_MEMORY_MACHINE_PROT_STACK_SIZE
+LOCAL(stack_end):
--
2.16.4
- [PATCH v3 10/18] xen: setup hypercall page for PVH, (continued)
- [PATCH v3 10/18] xen: setup hypercall page for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 06/18] xen: rearrange xen/init.c to prepare it for Xen PVH mode, Juergen Gross, 2018/10/24
- [PATCH v3 08/18] xen: add basic hooks for PVH in current code, Juergen Gross, 2018/10/24
- [PATCH v3 02/18] loader/linux: support passing rsdp address via boot params, Juergen Gross, 2018/10/24
- [PATCH v3 15/18] grub-module-verifier: Ignore all_video for xenpvh, Juergen Gross, 2018/10/24
- [PATCH v3 11/18] xen: get memory map from hypervisor for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 17/18] xen_pvh: support grub-install for xen_pvh, Juergen Gross, 2018/10/24
- [PATCH v3 14/18] xen_pvh: add build runes for grub-core, Juergen Gross, 2018/10/24
- [PATCH v3 13/18] xen: init memory regions for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 18/18] xen_pvh: add support to configure, Juergen Gross, 2018/10/24
- [PATCH v3 09/18] xen: add PVH boot entry code,
Juergen Gross <=
- [PATCH v3 12/18] xen: setup Xen specific data for PVH, Juergen Gross, 2018/10/24
- [PATCH v3 16/18] xen_pvh: support building a standalone image, Juergen Gross, 2018/10/24
- [PATCH v3 01/18] xen: add some xen headers, Juergen Gross, 2018/10/24
- Re: [Xen-devel] [PATCH v3 00/18] xen: add pvh guest support, Hans van Kranenburg, 2018/10/24