- Fixes for EFI support
x86-EFI-discard-comment.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=131
This commit is contained in:
parent
ed105f0f54
commit
82e844b703
@ -29,6 +29,19 @@ the community).
|
|||||||
|
|
||||||
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Jan Beulich <jbeulich@novell.com>
|
||||||
|
# Date 1309549342 -3600
|
||||||
|
# Node ID 638f31a30b6ccb3fe26f79b991bed4cd03995809
|
||||||
|
# Parent 7631c461132000979f05759705c055eb3c975c0b
|
||||||
|
x86/EFI: adjust installation logic
|
||||||
|
|
||||||
|
We should always install xen.efi into /usr/lib64/efi/; installation
|
||||||
|
into /boot/efi/efi/$(EFI_VENDOR) remains dependent upon specifying
|
||||||
|
EFI_VENDOR.
|
||||||
|
|
||||||
|
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
||||||
|
|
||||||
--- a/xen/Makefile
|
--- a/xen/Makefile
|
||||||
+++ b/xen/Makefile
|
+++ b/xen/Makefile
|
||||||
@@ -11,6 +11,8 @@ export XEN_DOMAIN ?= $(shell ([ -x /bin/
|
@@ -11,6 +11,8 @@ export XEN_DOMAIN ?= $(shell ([ -x /bin/
|
||||||
@ -40,15 +53,20 @@ Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|||||||
.PHONY: default
|
.PHONY: default
|
||||||
default: build
|
default: build
|
||||||
|
|
||||||
@@ -32,6 +34,13 @@ _install: $(TARGET).gz
|
@@ -32,6 +34,18 @@ _install: $(TARGET).gz
|
||||||
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
|
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET))-$(XEN_VERSION).gz
|
||||||
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
|
ln -f -s $(notdir $(TARGET))-$(XEN_FULLVERSION).gz $(DESTDIR)/boot/$(notdir $(TARGET)).gz
|
||||||
$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
|
$(INSTALL_DATA) $(TARGET)-syms $(DESTDIR)/boot/$(notdir $(TARGET))-syms-$(XEN_FULLVERSION)
|
||||||
+ if [ -r $(TARGET).efi -a -n "$(EFI_MOUNTPOINT)" ]; then \
|
+ if [ -r $(TARGET).efi ]; then \
|
||||||
+ if [ -n '$(EFI_VENDOR)' ]; then \
|
+ [ -d $(DESTDIR)$(LIBDIR)/efi ] || $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/efi; \
|
||||||
|
+ $(INSTALL_DATA) $(TARGET).efi $(DESTDIR)$(LIBDIR)/efi/$(notdir $(TARGET))-$(XEN_FULLVERSION).efi; \
|
||||||
|
+ ln -sf $(notdir $(TARGET))-$(XEN_FULLVERSION).efi $(DESTDIR)$(LIBDIR)/efi/$(notdir $(TARGET))-$(XEN_VERSION).$(XEN_SUBVERSION).efi; \
|
||||||
|
+ ln -sf $(notdir $(TARGET))-$(XEN_FULLVERSION).efi $(DESTDIR)$(LIBDIR)/efi/$(notdir $(TARGET))-$(XEN_VERSION).efi; \
|
||||||
|
+ ln -sf $(notdir $(TARGET))-$(XEN_FULLVERSION).efi $(DESTDIR)$(LIBDIR)/efi/$(notdir $(TARGET)).efi; \
|
||||||
|
+ if [ -n '$(EFI_MOUNTPOINT)' -a -n '$(EFI_VENDOR)' ]; then \
|
||||||
+ $(INSTALL_DATA) $(TARGET).efi $(DESTDIR)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(notdir $(TARGET))-$(XEN_FULLVERSION).efi; \
|
+ $(INSTALL_DATA) $(TARGET).efi $(DESTDIR)$(EFI_MOUNTPOINT)/efi/$(EFI_VENDOR)/$(notdir $(TARGET))-$(XEN_FULLVERSION).efi; \
|
||||||
+ elif [ "$(DESTDIR)" = "$(patsubst $(shell cd $(XEN_ROOT) && pwd)/%,%,$(DESTDIR))" ]; then \
|
+ elif [ "$(DESTDIR)" = "$(patsubst $(shell cd $(XEN_ROOT) && pwd)/%,%,$(DESTDIR))" ]; then \
|
||||||
+ echo 'EFI installation not done (EFI_VENDOR not set)' >&2; \
|
+ echo 'EFI installation only partially done (EFI_VENDOR not set)' >&2; \
|
||||||
+ fi; \
|
+ fi; \
|
||||||
+ fi
|
+ fi
|
||||||
|
|
||||||
|
@ -17,6 +17,19 @@ being quoted because this is a mode with paging enabled [otherwise
|
|||||||
|
|
||||||
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
||||||
|
|
||||||
|
# HG changeset patch
|
||||||
|
# User Jan Beulich <jbeulich@novell.com>
|
||||||
|
# Date 1309549303 -3600
|
||||||
|
# Node ID 7631c461132000979f05759705c055eb3c975c0b
|
||||||
|
# Parent 335e96664589dd14dfce7ef72e3fee71ad9c39e3
|
||||||
|
x86/EFI: fix interrupt and fault handling during runtime services calls
|
||||||
|
|
||||||
|
The missing piece was the setting up of an accessible GDT prior to
|
||||||
|
switching page tables (and reverting to the original setting after
|
||||||
|
having established the normal page tables again afterwards).
|
||||||
|
|
||||||
|
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
||||||
|
|
||||||
--- a/xen/arch/x86/efi/boot.c
|
--- a/xen/arch/x86/efi/boot.c
|
||||||
+++ b/xen/arch/x86/efi/boot.c
|
+++ b/xen/arch/x86/efi/boot.c
|
||||||
@@ -16,6 +16,7 @@
|
@@ -16,6 +16,7 @@
|
||||||
@ -198,7 +211,7 @@ Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|||||||
|
|
||||||
UINTN __read_mostly efi_memmap_size;
|
UINTN __read_mostly efi_memmap_size;
|
||||||
UINTN __read_mostly efi_mdesc_size;
|
UINTN __read_mostly efi_mdesc_size;
|
||||||
@@ -30,6 +32,68 @@ struct efi __read_mostly efi = {
|
@@ -30,6 +32,88 @@ struct efi __read_mostly efi = {
|
||||||
.smbios = EFI_INVALID_TABLE_ADDR,
|
.smbios = EFI_INVALID_TABLE_ADDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -213,6 +226,17 @@ Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|||||||
+ /* prevent fixup_page_fault() from doing anything */
|
+ /* prevent fixup_page_fault() from doing anything */
|
||||||
+ irq_enter();
|
+ irq_enter();
|
||||||
+
|
+
|
||||||
|
+ if ( !is_hvm_vcpu(current) && !is_idle_vcpu(current) )
|
||||||
|
+ {
|
||||||
|
+ struct desc_ptr gdt_desc = {
|
||||||
|
+ .limit = LAST_RESERVED_GDT_BYTE,
|
||||||
|
+ .base = (unsigned long)(per_cpu(gdt_table, smp_processor_id()) -
|
||||||
|
+ FIRST_RESERVED_GDT_ENTRY)
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ write_cr3(virt_to_maddr(efi_l4_pgtable));
|
+ write_cr3(virt_to_maddr(efi_l4_pgtable));
|
||||||
+
|
+
|
||||||
+ return cr3;
|
+ return cr3;
|
||||||
@ -221,6 +245,15 @@ Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|||||||
+void efi_rs_leave(unsigned long cr3)
|
+void efi_rs_leave(unsigned long cr3)
|
||||||
+{
|
+{
|
||||||
+ write_cr3(cr3);
|
+ write_cr3(cr3);
|
||||||
|
+ if ( !is_hvm_vcpu(current) && !is_idle_vcpu(current) )
|
||||||
|
+ {
|
||||||
|
+ struct desc_ptr gdt_desc = {
|
||||||
|
+ .limit = LAST_RESERVED_GDT_BYTE,
|
||||||
|
+ .base = GDT_VIRT_START(current)
|
||||||
|
+ };
|
||||||
|
+
|
||||||
|
+ asm volatile ( "lgdt %0" : : "m" (gdt_desc) );
|
||||||
|
+ }
|
||||||
+ irq_exit();
|
+ irq_exit();
|
||||||
+ spin_unlock(&efi_rs_lock);
|
+ spin_unlock(&efi_rs_lock);
|
||||||
+}
|
+}
|
||||||
@ -267,7 +300,7 @@ Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
|
int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
|
||||||
@@ -86,3 +150,267 @@ int efi_get_info(uint32_t idx, union xen
|
@@ -86,3 +170,267 @@ int efi_get_info(uint32_t idx, union xen
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
18
x86-EFI-discard-comment.patch
Normal file
18
x86-EFI-discard-comment.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
The SuSE version of gcc produces a non-standard section named
|
||||||
|
.comment.SUSE.OPTs, but the PE32+ handling in binutils can't really
|
||||||
|
deal with any section to be placed at virtual address zero (and not
|
||||||
|
needing to be loaded). Even if binutils did, at least the UEFI
|
||||||
|
implementation in EDK 1.06 doesn't look at the section characteristics
|
||||||
|
at all, and hence would attempt to load such a section, and fail or
|
||||||
|
corrupt other data.
|
||||||
|
|
||||||
|
--- a/xen/arch/x86/xen.lds.S
|
||||||
|
+++ b/xen/arch/x86/xen.lds.S
|
||||||
|
@@ -163,6 +163,7 @@ SECTIONS
|
||||||
|
*(.eh_frame)
|
||||||
|
#ifdef EFI
|
||||||
|
*(.comment)
|
||||||
|
+ *(.comment.*)
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
@ -5,7 +5,7 @@
|
|||||||
# This is the correct place to edit the build version.
|
# This is the correct place to edit the build version.
|
||||||
# All other places this is stored (eg. compile.h) should be autogenerated.
|
# All other places this is stored (eg. compile.h) should be autogenerated.
|
||||||
export XEN_VERSION = 4
|
export XEN_VERSION = 4
|
||||||
@@ -91,7 +92,7 @@ delete-unfresh-files:
|
@@ -96,7 +97,7 @@ delete-unfresh-files:
|
||||||
@rm -f $@1 $@2
|
@rm -f $@1 $@2
|
||||||
|
|
||||||
# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
|
# compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
|
||||||
@ -14,7 +14,7 @@
|
|||||||
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
|
@sed -e 's/@@date@@/$(shell LC_ALL=C date)/g' \
|
||||||
-e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
|
-e 's/@@time@@/$(shell LC_ALL=C date +%T)/g' \
|
||||||
-e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
|
-e 's/@@whoami@@/$(XEN_WHOAMI)/g' \
|
||||||
@@ -101,10 +102,9 @@ include/xen/compile.h: include/xen/compi
|
@@ -106,10 +107,9 @@ include/xen/compile.h: include/xen/compi
|
||||||
-e 's/@@version@@/$(XEN_VERSION)/g' \
|
-e 's/@@version@@/$(XEN_VERSION)/g' \
|
||||||
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
|
-e 's/@@subversion@@/$(XEN_SUBVERSION)/g' \
|
||||||
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
|
-e 's/@@extraversion@@/$(XEN_EXTRAVERSION)/g' \
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 7 10:17:08 MDT 2011 - carnold@novell.com
|
||||||
|
|
||||||
|
- Fixes for EFI support
|
||||||
|
x86-EFI-discard-comment.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jun 29 09:37:05 MDT 2011 - carnold@novell.com
|
Wed Jun 29 09:37:05 MDT 2011 - carnold@novell.com
|
||||||
|
|
||||||
|
21
xen.spec
21
xen.spec
@ -72,8 +72,8 @@ BuildRequires: te_latex
|
|||||||
BuildRequires: tetex
|
BuildRequires: tetex
|
||||||
%endif
|
%endif
|
||||||
%ifarch x86_64
|
%ifarch x86_64
|
||||||
# EFI
|
# EFI requires gcc45 or newer
|
||||||
#BuildRequires: libgcc46 gcc46
|
BuildRequires: gcc45
|
||||||
BuildRequires: glibc-32bit glibc-devel-32bit
|
BuildRequires: glibc-32bit glibc-devel-32bit
|
||||||
BuildRequires: gcc-32bit
|
BuildRequires: gcc-32bit
|
||||||
BuildRequires: gcc43-32bit
|
BuildRequires: gcc43-32bit
|
||||||
@ -288,6 +288,7 @@ Patch511: supported_module.diff
|
|||||||
Patch512: magic_ioport_compat.patch
|
Patch512: magic_ioport_compat.patch
|
||||||
Patch513: xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch
|
Patch513: xen.sles11sp1.bug684297.xen_oldmem_pfn_is_ram.patch
|
||||||
Patch514: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
|
Patch514: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch
|
||||||
|
Patch515: x86-EFI-discard-comment.patch
|
||||||
Patch650: disable_emulated_device.diff
|
Patch650: disable_emulated_device.diff
|
||||||
Patch651: ioemu-disable-scsi.patch
|
Patch651: ioemu-disable-scsi.patch
|
||||||
Patch652: ioemu-disable-emulated-ide-if-pv.patch
|
Patch652: ioemu-disable-emulated-ide-if-pv.patch
|
||||||
@ -805,6 +806,7 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
|
|||||||
%patch512 -p1
|
%patch512 -p1
|
||||||
%patch513 -p1
|
%patch513 -p1
|
||||||
%patch514 -p1
|
%patch514 -p1
|
||||||
|
%patch515 -p1
|
||||||
%patch650 -p1
|
%patch650 -p1
|
||||||
%patch651 -p1
|
%patch651 -p1
|
||||||
%patch652 -p1
|
%patch652 -p1
|
||||||
@ -874,10 +876,10 @@ done
|
|||||||
export CFLAGS="$RPM_OPT_FLAGS"
|
export CFLAGS="$RPM_OPT_FLAGS"
|
||||||
%if %{?with_dom0_support}0
|
%if %{?with_dom0_support}0
|
||||||
# EFI
|
# EFI
|
||||||
#%ifarch x86_64
|
%ifarch x86_64
|
||||||
#make -C xen install CC=gcc-4.6 max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT EFI_VENDOR=SuSE %{?_smp_mflags}
|
make -C xen install CC=gcc-4.5 max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags}
|
||||||
#make -C xen clean
|
make -C xen clean
|
||||||
#%endif
|
%endif
|
||||||
install_xen()
|
install_xen()
|
||||||
{
|
{
|
||||||
local ext=""
|
local ext=""
|
||||||
@ -1073,9 +1075,10 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/xencons
|
|||||||
/boot/xen-syms-dbg-%{version}-%{release}
|
/boot/xen-syms-dbg-%{version}-%{release}
|
||||||
/boot/xen.gz
|
/boot/xen.gz
|
||||||
# EFI
|
# EFI
|
||||||
#%ifarch x86_64
|
%ifarch x86_64
|
||||||
#/boot/efi/efi/SuSE/xen-%{version}-%{release}.efi
|
%dir %{_libdir}/efi
|
||||||
#%endif
|
%{_libdir}/efi/xen*.efi
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files libs
|
%files libs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user