Commit 0105bd6d authored by Lorenzo "Palinuro" Faletra's avatar Lorenzo "Palinuro" Faletra
Browse files

Import Debian changes 2.02+dfsg1-10parrot1

grub2 (2.02+dfsg1-10parrot1) parrot; urgency=medium

  * Import new Debian and Kali updates.

grub2 (2.02+dfsg1-10kali1) kali-dev; urgency=medium

  * Sync with Debian. Remaining changes:
    - Add Conflicts relation between grub-efi-$arch-bin and
    grub-efi-$arch-signed

grub2 (2.02+dfsg1-10) unstable; urgency=medium

  * Apply patch from Heinrich Schuchardt (mentioned in #916695 though
    unrelated):
    - grub-core/loader/efi/fdt.c: do not copy random memory
  * Add luks modules to signed UEFI images (pointed out by Alex Griffin and
    Hervé Werner; closes: #908162, LP: #1565950).
  * Keep track of the previous version of /usr/share/grub/default/grub and
    set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
    can't figure this out for itself since we apply debconf-based
    customisations on top of the template configuration file (closes:
    #812574, LP: #564853).
  * Backport Xen PVH guest support from upstream (closes: #776450).  Thanks
    to Hans van Kranenburg for testing.
parent f0dba45e
# see git-dpm(1) from git-dpm package
614ea0626131fc49f82d80e6459a200b8bc8e591
614ea0626131fc49f82d80e6459a200b8bc8e591
0e3e215f58cbacbd623a19c5283da412d729cc65
0e3e215f58cbacbd623a19c5283da412d729cc65
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
59aeb1cfaa3d5bfd7bbeeee0f0d37f6d9eed51fe
grub2_2.02+dfsg1.orig.tar.xz
......
......@@ -167,6 +167,7 @@ GRUB_MODULES="$CD_MODULES
gcry_tiger
gcry_twofish
gcry_whirlpool
luks
lvm
mdraid09
mdraid1x
......
grub2 (2.02+dfsg1-10parrot1) parrot; urgency=medium
* Import new Debian and Kali updates.
-- Lorenzo "Palinuro" Faletra <palinuro@parrotsec.org> Fri, 25 Jan 2019 19:46:36 +0100
grub2 (2.02+dfsg1-10kali1) kali-dev; urgency=medium
* Sync with Debian. Remaining changes:
- Add Conflicts relation between grub-efi-$arch-bin and
grub-efi-$arch-signed
-- Sophie Brun <sophie@offensive-security.com> Mon, 21 Jan 2019 13:06:02 +0100
grub2 (2.02+dfsg1-10) unstable; urgency=medium
* Apply patch from Heinrich Schuchardt (mentioned in #916695 though
unrelated):
- grub-core/loader/efi/fdt.c: do not copy random memory
* Add luks modules to signed UEFI images (pointed out by Alex Griffin and
Hervé Werner; closes: #908162, LP: #1565950).
* Keep track of the previous version of /usr/share/grub/default/grub and
set UCF_FORCE_CONFFOLD=1 when running ucf if it hasn't changed; ucf
can't figure this out for itself since we apply debconf-based
customisations on top of the template configuration file (closes:
#812574, LP: #564853).
* Backport Xen PVH guest support from upstream (closes: #776450). Thanks
to Hans van Kranenburg for testing.
-- Colin Watson <cjwatson@debian.org> Fri, 11 Jan 2019 15:24:20 +0000
grub2 (2.02+dfsg1-9parrot1) testing; urgency=medium
* Import new Debian release.
......
obj/grub-xen-host-i386/grub-i386-xen.bin usr/lib/grub-xen
obj/grub-xen-host-pvh-i386/grub-i386-xen_pvh.bin usr/lib/grub-xen
obj/grub-xen-host-amd64/grub-x86_64-xen.bin usr/lib/grub-xen
grub-xen-host: statically-linked-binary usr/lib/grub-xen/grub-i386-xen.bin
grub-xen-host: statically-linked-binary usr/lib/grub-xen/grub-i386-xen_pvh.bin
grub-xen-host: statically-linked-binary usr/lib/grub-xen/grub-x86_64-xen.bin
if search -s -f /boot/grub/grub.cfg ; then
echo "Reading (${root})/boot/grub/grub.cfg"
configfile /boot/grub/grub.cfg
fi
if search -s -f /grub/grub.cfg ; then
echo "Reading (${root})/grub/grub.cfg"
configfile /grub/grub.cfg
fi
From 2a8298a27e1313af552c049e35ec8c8c82197285 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
Date: Mon, 17 Dec 2018 22:00:24 +0100
Subject: grub-core/loader/efi/fdt.c: do not copy random memory
We should not try to copy any memory area which is outside of the original
fdt. If this extra memory is controlled by a hypervisor this might end
with a crash.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Origin: other, https://lists.gnu.org/archive/html/grub-devel/2018-12/msg00042.html
Last-Update: 2018-12-21
Patch-Name: efi-fdt-do-not-copy-random-memory.patch
---
grub-core/loader/efi/fdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/loader/efi/fdt.c b/grub-core/loader/efi/fdt.c
index a4c6e8036..c9aee74ef 100644
--- a/grub-core/loader/efi/fdt.c
+++ b/grub-core/loader/efi/fdt.c
@@ -66,7 +66,7 @@ grub_fdt_load (grub_size_t additional_size)
if (raw_fdt)
{
- grub_memmove (fdt, raw_fdt, size);
+ grub_memmove (fdt, raw_fdt, size - additional_size);
grub_fdt_set_totalsize (fdt, size);
}
else
......@@ -99,3 +99,24 @@ efi-fdt-set-address-size-cells-to-2-for-empty-tree.patch
linuxefi-update-to-new-interfaces.patch
gcc-8-packed-not-aligned.patch
linuxefi-skip-validation-without-secure-boot.patch
efi-fdt-do-not-copy-random-memory.patch
xen-pvh-add-headers.patch
xen-pvh-rsdp-boot-params.patch
xen-pvh-refactor-grant-tab-init.patch
xen-pvh-prepare-common-code.patch
xen-pvh-add-dummy-headers.patch
xen-pvh-rearrange-init.patch
xen-pvh-ptr2mfn.patch
xen-pvh-offsets.patch
xen-pvh-basic-hooks.patch
xen-pvh-boot-entry.patch
xen-pvh-setup-hypercall-page.patch
xen-pvh-get-memory-map.patch
xen-pvh-setup-data.patch
xen-pvh-init-memory-regions.patch
xen-pvh-build.patch
xen-pvh-module-verifier.patch
xen-pvh-elfnote-defines.patch
xen-pvh-mkimage.patch
xen-pvh-install.patch
xen-pvh-configure.patch
From c5e44c9c6dd64d4447eae7ceebd8437e63a8d0bf Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Fri, 7 Dec 2018 13:11:33 +0100
Subject: xen: Add some dummy headers for PVH mode
With Xen PVH mode adding a new machine type the machine related headers
need to be present for the build to succeed. Most of the headers just
need to include the related common i386 headers. Add those to the tree.
Note that xen_pvh/int.h needs to include pc/int_types.h instead of
pc/int.h in order to avoid the definition of grub_bios_interrupt().
xen_pvh/memory.h needs to include coreboot/memory.h (like some other
<machine>/memory.h do as well) as this contains just the needed stubs.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=408de833bbd1ccad39ad439eaf3cddd528b039b5
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07
Patch-Name: xen-pvh-add-dummy-headers.patch
---
include/grub/i386/xen_pvh/boot.h | 1 +
include/grub/i386/xen_pvh/console.h | 1 +
include/grub/i386/xen_pvh/int.h | 1 +
include/grub/i386/xen_pvh/memory.h | 1 +
include/grub/i386/xen_pvh/time.h | 1 +
5 files changed, 5 insertions(+)
create mode 100644 include/grub/i386/xen_pvh/boot.h
create mode 100644 include/grub/i386/xen_pvh/console.h
create mode 100644 include/grub/i386/xen_pvh/int.h
create mode 100644 include/grub/i386/xen_pvh/memory.h
create mode 100644 include/grub/i386/xen_pvh/time.h
diff --git a/include/grub/i386/xen_pvh/boot.h b/include/grub/i386/xen_pvh/boot.h
new file mode 100644
index 000000000..6cd23aa83
--- /dev/null
+++ b/include/grub/i386/xen_pvh/boot.h
@@ -0,0 +1 @@
+#include <grub/i386/pc/boot.h>
diff --git a/include/grub/i386/xen_pvh/console.h b/include/grub/i386/xen_pvh/console.h
new file mode 100644
index 000000000..305a46d8e
--- /dev/null
+++ b/include/grub/i386/xen_pvh/console.h
@@ -0,0 +1 @@
+#include <grub/i386/pc/console.h>
diff --git a/include/grub/i386/xen_pvh/int.h b/include/grub/i386/xen_pvh/int.h
new file mode 100644
index 000000000..0f1f9ee62
--- /dev/null
+++ b/include/grub/i386/xen_pvh/int.h
@@ -0,0 +1 @@
+#include <grub/i386/pc/int_types.h>
diff --git a/include/grub/i386/xen_pvh/memory.h b/include/grub/i386/xen_pvh/memory.h
new file mode 100644
index 000000000..8dd6f7c8c
--- /dev/null
+++ b/include/grub/i386/xen_pvh/memory.h
@@ -0,0 +1 @@
+#include <grub/i386/coreboot/memory.h>
diff --git a/include/grub/i386/xen_pvh/time.h b/include/grub/i386/xen_pvh/time.h
new file mode 100644
index 000000000..2298ee8f4
--- /dev/null
+++ b/include/grub/i386/xen_pvh/time.h
@@ -0,0 +1 @@
+#include <grub/i386/pc/time.h>
This diff is collapsed.
From d664fffc6db23a112ba2f5dc4dd2137a9b2a6756 Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Fri, 7 Dec 2018 13:11:37 +0100
Subject: xen: Add basic hooks for PVH in current code
Add the hooks to current code needed for Xen PVH. They will be filled
with code later when the related functionality is being added.
loader/i386/linux.c needs to include machine/kernel.h now as it needs
to get GRUB_KERNEL_USE_RSDP_ADDR from there. This in turn requires to
add an empty kernel.h header for some i386 platforms (efi, coreboot,
ieee1275, xen) and for x86_64 efi.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: backport, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=0b3e4eb2d2e1875e6045e838962f769f2ce161dd
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07
Patch-Name: xen-pvh-basic-hooks.patch
---
grub-core/Makefile.am | 6 +++++
grub-core/kern/i386/xen/pvh.c | 37 +++++++++++++++++++++++++++
grub-core/kern/i386/xen/startup_pvh.S | 29 +++++++++++++++++++++
grub-core/kern/xen/init.c | 4 +++
grub-core/loader/i386/linux.c | 1 +
include/grub/i386/coreboot/kernel.h | 1 +
include/grub/i386/efi/kernel.h | 1 +
include/grub/i386/ieee1275/kernel.h | 1 +
include/grub/i386/xen/kernel.h | 1 +
include/grub/i386/xen_pvh/kernel.h | 30 ++++++++++++++++++++++
include/grub/x86_64/efi/kernel.h | 1 +
include/grub/xen.h | 5 ++++
12 files changed, 117 insertions(+)
create mode 100644 grub-core/kern/i386/xen/pvh.c
create mode 100644 grub-core/kern/i386/xen/startup_pvh.S
create mode 100644 include/grub/i386/coreboot/kernel.h
create mode 100644 include/grub/i386/efi/kernel.h
create mode 100644 include/grub/i386/ieee1275/kernel.h
create mode 100644 include/grub/i386/xen/kernel.h
create mode 100644 include/grub/i386/xen_pvh/kernel.h
create mode 100644 include/grub/x86_64/efi/kernel.h
diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am
index 44bb981c2..cc884e379 100644
--- a/grub-core/Makefile.am
+++ b/grub-core/Makefile.am
@@ -102,6 +102,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
endif
if COND_i386_efi
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
@@ -111,6 +112,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/pmtimer.h
endif
if COND_i386_coreboot
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/coreboot/lbio.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/video.h
@@ -122,6 +124,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h
endif
if COND_i386_multiboot
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/acpi.h
endif
@@ -132,6 +135,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
endif
if COND_i386_ieee1275
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/ieee1275/ieee1275.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/extcmd.h
@@ -140,6 +144,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
endif
if COND_i386_xen
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/xen.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/xen/hypercall.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/terminfo.h
@@ -158,6 +163,7 @@ KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/loader.h
endif
if COND_x86_64_efi
+KERNEL_HEADER_FILES += $(top_builddir)/include/grub/machine/kernel.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/efi.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/efi/disk.h
KERNEL_HEADER_FILES += $(top_srcdir)/include/grub/i386/tsc.h
diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c
new file mode 100644
index 000000000..4f629b15e
--- /dev/null
+++ b/grub-core/kern/i386/xen/pvh.c
@@ -0,0 +1,37 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <grub/kernel.h>
+#include <grub/misc.h>
+#include <grub/memory.h>
+#include <grub/mm.h>
+#include <grub/xen.h>
+#include <xen/hvm/start_info.h>
+#include <grub/machine/kernel.h>
+
+grub_uint64_t grub_rsdp_addr;
+
+void
+grub_xen_setup_pvh (void)
+{
+}
+
+grub_err_t
+grub_machine_mmap_iterate (grub_memory_hook_t hook, void *hook_data)
+{
+}
diff --git a/grub-core/kern/i386/xen/startup_pvh.S b/grub-core/kern/i386/xen/startup_pvh.S
new file mode 100644
index 000000000..69b8fdcca
--- /dev/null
+++ b/grub-core/kern/i386/xen/startup_pvh.S
@@ -0,0 +1,29 @@
+/* startup.S - bootstrap GRUB itself */
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <config.h>
+#include <grub/symbol.h>
+
+ .file "startup_pvh.S"
+ .text
+
+/* Saved pointer to start info structure. */
+ .globl pvh_start_info
+pvh_start_info:
+ .long 0
diff --git a/grub-core/kern/xen/init.c b/grub-core/kern/xen/init.c
index a23dad633..782ca7295 100644
--- a/grub-core/kern/xen/init.c
+++ b/grub-core/kern/xen/init.c
@@ -564,6 +564,10 @@ grub_machine_init (void)
+ GRUB_KERNEL_MACHINE_MOD_GAP,
GRUB_KERNEL_MACHINE_MOD_ALIGN);
+#ifdef GRUB_MACHINE_XEN_PVH
+ grub_xen_setup_pvh ();
+#endif
+
grub_xen_setup_gnttab ();
#ifdef GRUB_MACHINE_XEN
diff --git a/grub-core/loader/i386/linux.c b/grub-core/loader/i386/linux.c
index 40887e08e..161a6b7de 100644
--- a/grub-core/loader/i386/linux.c
+++ b/grub-core/loader/i386/linux.c
@@ -35,6 +35,7 @@
#include <grub/i18n.h>
#include <grub/lib/cmdline.h>
#include <grub/linux.h>
+#include <grub/machine/kernel.h>
GRUB_MOD_LICENSE ("GPLv3+");
diff --git a/include/grub/i386/coreboot/kernel.h b/include/grub/i386/coreboot/kernel.h
new file mode 100644
index 000000000..3209df5f5
--- /dev/null
+++ b/include/grub/i386/coreboot/kernel.h
@@ -0,0 +1 @@
+/* Dummy header. */
diff --git a/include/grub/i386/efi/kernel.h b/include/grub/i386/efi/kernel.h
new file mode 100644
index 000000000..3209df5f5
--- /dev/null
+++ b/include/grub/i386/efi/kernel.h
@@ -0,0 +1 @@
+/* Dummy header. */
diff --git a/include/grub/i386/ieee1275/kernel.h b/include/grub/i386/ieee1275/kernel.h
new file mode 100644
index 000000000..3209df5f5
--- /dev/null
+++ b/include/grub/i386/ieee1275/kernel.h
@@ -0,0 +1 @@
+/* Dummy header. */
diff --git a/include/grub/i386/xen/kernel.h b/include/grub/i386/xen/kernel.h
new file mode 100644
index 000000000..3209df5f5
--- /dev/null
+++ b/include/grub/i386/xen/kernel.h
@@ -0,0 +1 @@
+/* Dummy header. */
diff --git a/include/grub/i386/xen_pvh/kernel.h b/include/grub/i386/xen_pvh/kernel.h
new file mode 100644
index 000000000..2b7b8a129
--- /dev/null
+++ b/include/grub/i386/xen_pvh/kernel.h
@@ -0,0 +1,30 @@
+/*
+ * GRUB -- GRand Unified Bootloader
+ * Copyright (C) 2018 Free Software Foundation, Inc.
+ *
+ * GRUB is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GRUB is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GRUB_KERNEL_MACHINE_HEADER
+#define GRUB_KERNEL_MACHINE_HEADER 1
+
+#ifndef ASM_FILE
+
+#define GRUB_KERNEL_USE_RSDP_ADDR 1
+
+extern grub_uint64_t EXPORT_VAR(grub_rsdp_addr);
+
+#endif /* ! ASM_FILE */
+
+#endif /* GRUB_KERNEL_MACHINE_HEADER */
diff --git a/include/grub/x86_64/efi/kernel.h b/include/grub/x86_64/efi/kernel.h
new file mode 100644
index 000000000..3209df5f5
--- /dev/null
+++ b/include/grub/x86_64/efi/kernel.h
@@ -0,0 +1 @@
+/* Dummy header. */
diff --git a/include/grub/xen.h b/include/grub/xen.h
index c31cc10c7..91cb7cf81 100644
--- a/include/grub/xen.h
+++ b/include/grub/xen.h
@@ -95,6 +95,11 @@ typedef grub_uint64_t grub_xen_mfn_t;
typedef grub_uint32_t grub_xen_mfn_t;
#endif
typedef unsigned int grub_xen_evtchn_t;
+
+#ifdef GRUB_MACHINE_XEN_PVH
+extern struct hvm_start_info *pvh_start_info;
+void grub_xen_setup_pvh (void);
+#endif
#endif
#endif
From 6c3df9cf4e8e965f7c18b10afba8d311e87b381d Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Fri, 7 Dec 2018 13:11:38 +0100
Subject: xen: Add PVH boot entry code
Add the code for the Xen PVH mode boot entry.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=1a4d83af2fc1eb0a0951775a2b86860ab074c699
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07
Patch-Name: xen-pvh-boot-entry.patch
---
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..363c31858 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, %fs
+ mov %eax, %gs
+ mov %eax, %ss
+ 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):
From fdb322ca3c1d64f93e7d81a64899773c62eb18f0 Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Fri, 7 Dec 2018 13:11:43 +0100
Subject: xen_pvh: Add build runes for grub-core
Add the modifications to the build system needed to build a xen_pvh
grub.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Tested-by: Hans van Kranenburg <hans@knorrie.org>
Origin: upstream, https://git.savannah.gnu.org/cgit/grub.git/commit/?id=9c062ad42c32a42b677da4b066cb33debf1dfe30
Bug-Debian: https://bugs.debian.org/776450
Last-Update: 2019-01-07
Patch-Name: xen-pvh-build.patch
---
gentpl.py | 4 ++--
grub-core/Makefile.am | 12 ++++++++++++
grub-core/Makefile.core.def | 35 +++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 2 deletions(-)
diff --git a/gentpl.py b/gentpl.py
index f08bcc404..24d890895 100644
--- a/gentpl.py
+++ b/gentpl.py
@@ -28,7 +28,7 @@ import re
GRUB_PLATFORMS = [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_coreboot",
"i386_multiboot", "i386_ieee1275", "x86_64_efi",
- "i386_xen", "x86_64_xen",