arm64 EFI stub
v3 cover arm64 EFI stub
This patch series adds EFI boot support for arm64. A PE/COFF header is created in head.S, as there is no toolchain support for PE/COFF on arm64. This also has the advantage that the file is both an "Image" file and a PE/COFF executable - the same binary can be loaded and run either way. The EFI 'stub' code is a shim layer that serves as the loader for the XEN kernel in the EFI environment. The stub loads the dom0 kernel and initrd if required, and adds entries for them as well as for the EFI data structures into the device tree passed to XEN. Once the device tree is constructed, EFI boot services are exited, and the stub transfers control to the normal XEN entry point. The only indication XEN has that it was loaded via the stub is that the device tree contains EFI properties. This is all very similar to the arm/arm64 Linux kernel EFI stubs.
I'm not really that happy with how the x86 build works, in particular the rule I added to arch/x86/Makefile to build boot.init.o to fix parallel builds. Due to the way the EFI build is done - building 2 executables at the same time with different EFI code included in each, the normal common build infrastructure doesn't work.
Changes since v2:
* Major refactor to use common EFI entry point and factor out arch specific code, rather than factoring out the common code.
* Update entire libfdt to v1.4.0 to provide fdt_create_empty_tree()
Changes since v1:
* Added common/efi directory for shared EFI code, and arch/arm/efi for arm-specfic code. Global build hacking of -fshort-wchar removed. arm32, arm64, and x86 with/without EFI enabled toolchain all build. The x86 build previously autodetected whether the EFI version should be built or not based on toolchain support. I couldn't get this working nicely with the common code, so for x86 I have the common code always build, and the EFI autodection works as normal for building the EFI version.
* Basic use of the EFI memory map instead of FDT based memory description. More work needed to resolve differences between FDT description of a small number of large memory banks with reserved regions, and EFI's potentially long list of available regions, which can be long.
* More refactoring of common EFI code to not directly exit using blexit(), as this broke the pre-linking targets. All shared code returns status, and it is up to the caller to exit and clean up.
* Reduced the number of patches. Refactoring of x86 code first, then moving all code to efi-shared.c in one patch.
* Fixed formatting/tab issues in new files, added Emacs footer.
* Fixed efi_get_memory_map to return NULL map pointer on error in addition to failed status.
* Added comments in head.S regarding PE/COFF specification, and 1:1 mapping used by EFI code.
* Updated device tree bindings to use new multiboot bindings. Since the stub is always built into XEN, we don't have to support older bindings.
Roy Franz (15):
move EFI boot code to common/efi
Move x86 specific funtions/variables to arch header
create arch functions to get and process EFI memory map. Add architecture functions for pre/post ExitBootServices Add efi_arch_cfg_file() to handle arch specific cfg file fields Add efi_arch_handle_cmdline() for processing commandline Move x86 specific video and disk probing code
Add efi_arch_memory() for arch specific memory setup
Add arch specific module handling to read_file()
Add SMBIOS and runtime services setup arch functions.
Add several misc. arch functions for EFI boot code.
Add efi_arch_use_config_file() function to control use of config file add arm64 cache flushing code from linux v3.16
Update libfdt to v1.4.0
Add ARM EFI boot support
.gitignore | 2 + xen/arch/arm/arm64/Makefile | 1 + xen/arch/arm/arm64/cache.S | 100 ++ xen/arch/arm/arm64/head.S | 145 ++- xen/arch/arm/xen.lds.S | 1 + xen/arch/x86/Makefile | 15 +- xen/arch/x86/efi/Makefile | 4 +- xen/arch/x86/efi/boot.c | 1723 ----------------------------------- xen/arch/x86/efi/efi.h | 39 - xen/arch/x86/efi/runtime.c | 2 +- xen/common/Makefile | 1 + xen/common/efi/Makefile | 17 + xen/common/efi/boot.c | 823 +++++++++++++++++ xen/common/efi/check.c | 4 + xen/common/efi/dummy.c | 1 + xen/common/efi/efi.h | 39 + xen/common/libfdt/Makefile.libfdt | 4 +- xen/common/libfdt/fdt.c | 30 +- xen/common/libfdt/fdt_empty_tree.c | 84 ++ xen/common/libfdt/fdt_ro.c | 7 +- xen/common/libfdt/fdt_rw.c | 31 +- xen/common/libfdt/fdt_sw.c | 4 +- xen/common/libfdt/fdt_wip.c | 2 +- xen/common/libfdt/version.lds | 6 + xen/include/asm-arm/arm64/efibind.h | 216 +++++ xen/include/asm-arm/efi-boot.h | 602 ++++++++++++ xen/include/asm-arm/efi.h | 29 + xen/include/asm-arm/efibind.h | 2 + xen/include/asm-arm/setup.h | 2 +- xen/include/asm-x86/efi-boot.h | 1064 +++++++++++++++++++++ xen/include/asm-x86/efi.h | 39 + xen/include/xen/libfdt/fdt.h | 93 +- xen/include/xen/libfdt/libfdt.h | 315 ++++++- xen/include/xen/libfdt/libfdt_env.h | 4 + 34 files changed, 3627 insertions(+), 1824 deletions(-) create mode 100644 xen/arch/arm/arm64/cache.S delete mode 100644 xen/arch/x86/efi/boot.c delete mode 100644 xen/arch/x86/efi/efi.h create mode 100644 xen/common/efi/Makefile create mode 100644 xen/common/efi/boot.c create mode 100644 xen/common/efi/check.c create mode 100644 xen/common/efi/dummy.c create mode 100644 xen/common/efi/efi.h create mode 100644 xen/common/libfdt/fdt_empty_tree.c create mode 100644 xen/include/asm-arm/arm64/efibind.h create mode 100644 xen/include/asm-arm/efi-boot.h create mode 100644 xen/include/asm-arm/efi.h create mode 100644 xen/include/asm-arm/efibind.h create mode 100644 xen/include/asm-x86/efi-boot.h create mode 100644 xen/include/asm-x86/efi.h
Signature · 1 line
2.1.0.rc1
PATCH v3 1/15 move x86 EFI boot code to common/efi
This moves the boot.c,the file that implements the EFI entry point to efi/common, and builds with both EFI/non-EFI toolchains. No code changes, just file movement and make updates.
Note that since both the EFI and non-EFI versions are built at the same time, the EFI boot code cannot be included in the common/build_in.o. In the ARM case, it will always be built in, so the normal common build infrastructure can be used.
The EFI runtime code is left alone as this patch series just implements the boot code.
--- .gitignore | 2 + xen/arch/x86/Makefile | 15 +- xen/arch/x86/efi/Makefile | 4 +- xen/arch/x86/efi/boot.c | 1723 -------------------------------------------- xen/arch/x86/efi/efi.h | 39 - xen/arch/x86/efi/runtime.c | 2 +- xen/common/Makefile | 1 + xen/common/efi/Makefile | 14 + xen/common/efi/boot.c | 1723 ++++++++++++++++++++++++++++++++++++++++++++ xen/common/efi/check.c | 4 + xen/common/efi/dummy.c | 1 + xen/common/efi/efi.h | 39 + xen/include/asm-x86/efi.h | 39 + 13 files changed, 1837 insertions(+), 1769 deletions(-) delete mode 100644 xen/arch/x86/efi/boot.c delete mode 100644 xen/arch/x86/efi/efi.h create mode 100644 xen/common/efi/Makefile create mode 100644 xen/common/efi/boot.c create mode 100644 xen/common/efi/check.c create mode 100644 xen/common/efi/dummy.c create mode 100644 xen/common/efi/efi.h create mode 100644 xen/include/asm-x86/efi.h
.gitignore +2 -0
@@ -254,6 +254,8 @@ xen/arch/x86/efi.lds xen/arch/x86/efi/check.efi xen/arch/x86/efi/disabled xen/arch/x86/efi/mkreloc +xen/common/efi/check.efi +xen/common/efi/disabled xen/ddb/* xen/include/headers.chk xen/include/asm
xen/arch/x86/Makefile +11 -4
@@ -75,6 +75,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +# This seems to be required to get parallel builds to work, otherwise prelink-efi.o complains about +# no rule to make boot.init.o +# Not sure what the right fix is +$(BASEDIR)/common/efi/boot.init.o: $(BASEDIR)/common/efi/boot.c + $(MAKE) -f $(BASEDIR)/Rules.mk -C $(BASEDIR)/common/efi/ boot.init.o + ifeq ($(lto),y) # Gather all LTO objects together prelink_lto.o: $(ALL_OBJS)
@@ -87,13 +94,13 @@ prelink-efi_lto.o: $(ALL_OBJS) efi/runtime.o efi/compat.o prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(LD) $(LDFLAGS) -r -o $@ $^ -prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o efi/boot.init.o +prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o $(BASEDIR)/common/efi/boot.init.o $(guard) $(LD) $(LDFLAGS) -r -o $@ $^ else prelink.o: $(ALL_OBJS) $(LD) $(LDFLAGS) -r -o $@ $^ -prelink-efi.o: $(ALL_OBJS) efi/boot.init.o efi/runtime.o efi/compat.o +prelink-efi.o: $(ALL_OBJS) $(BASEDIR)/common/efi/boot.init.o efi/runtime.o efi/compat.o $(guard) $(LD) $(LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) endif
@@ -143,8 +150,8 @@ $(TARGET).efi: prelink-efi.o efi.lds efi/relocs-dummy.o $(BASEDIR)/common/symbol if $(guard) false; then rm -f $@; echo 'EFI support disabled'; fi rm -f $(@D)/.$(@F).[0-9]* -efi/boot.init.o efi/runtime.o efi/compat.o: $(BASEDIR)/arch/x86/efi/built_in.o -efi/boot.init.o efi/runtime.o efi/compat.o: ; +efi/runtime.o efi/compat.o: $(BASEDIR)/arch/x86/efi/built_in.o +efi/runtime.o efi/compat.o: ; asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<
xen/arch/x86/efi/Makefile +2 -2
@@ -7,8 +7,8 @@ create = test -e $(1) || touch -t 199901010000 $(1) efi := $(filter y,$(x86_64)$(shell rm -f disabled)) efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y)) efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y)) -efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o))) +efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,runtime.o))) -extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o +extra-$(efi) += relocs-dummy.o runtime.o compat.o stub.o: $(extra-y)
xen/arch/x86/efi/boot.c deleted +0 -1723
1,723 lines not on this page · raw message
xen/arch/x86/efi/efi.h deleted +0 -39
@@ -1,39 +0,0 @@ -#include <asm/efibind.h> -#include <efi/efidef.h> -#include <efi/efierr.h> -#include <efi/eficon.h> -#include <efi/efidevp.h> -#include <efi/eficapsule.h> -#include <efi/efiapi.h> -#include <xen/efi.h> -#include <xen/spinlock.h> -#include <asm/page.h> - -struct efi_pci_rom { -const struct efi_pci_rom *next; -u16 vendor, devid, segment; -u8 bus, devfn; -unsigned long size; -unsigned char data[]; -}; - -extern unsigned int efi_num_ct; -extern EFI_CONFIGURATION_TABLE *efi_ct; - -extern unsigned int efi_version, efi_fw_revision; -extern const CHAR16 *efi_fw_vendor; - -extern EFI_RUNTIME_SERVICES *efi_rs; - -extern UINTN efi_memmap_size, efi_mdesc_size; -extern void *efi_memmap; - -extern l4_pgentry_t *efi_l4_pgtable; - -extern const struct efi_pci_rom *efi_pci_roms; - -extern UINT64 efi_boot_max_var_store_size, efi_boot_remain_var_store_size, - efi_boot_max_var_size; - -unsigned long efi_rs_enter (void ); -void efi_rs_leave (unsigned long );
xen/arch/x86/efi/runtime.c +1 -1
@@ -1,4 +1,4 @@ -#include "efi.h" +#include <asm/efi.h> #include <xen/cache.h> #include <xen/errno.h> #include <xen/guest_access.h>
xen/common/Makefile +1 -0
@@ -67,4 +67,5 @@ subdir-$(x86_64) += hvm subdir-$(coverage) += gcov subdir-y += libelf +subdir-y += efi subdir-$(HAS_DEVICE_TREE) += libfdt
xen/common/efi/Makefile new file +14 -0
@@ -0,0 +1,14 @@ +CFLAGS += -fshort-wchar + +obj-y += dummy.o + +create = test -e $(1) || touch -t 199901010000 $(1) + +efi := $(filter y,$(x86_64)$(shell rm -f disabled)) +efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y)) +efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y)) +efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o))) + +extra-$(efi) += boot.init.o + +dummy.o: boot.init.o $(extra-y)
xen/common/efi/boot.c new file +1723 -0
1,158 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.1.0.rc1
Part of the diff is not shown here. View the raw message.
PATCH v3 2/15 Move x86 specific funtions/variables to arch header
In reply to Roy FranzMove the global variables and functions that can be moved as-is from the common boot.c file to the x86 implementation header file.
--- xen/common/efi/boot.c | 460 ++--------------------------------------- xen/include/asm-x86/efi-boot.h | 455 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 468 insertions(+), 447 deletions(-) create mode 100644 xen/include/asm-x86/efi-boot.h
xen/common/efi/boot.c +13 -447
@@ -18,16 +18,6 @@#include <xen/string.h> #include <xen/stringify.h> #include <xen/vga.h> -#include <asm/e820.h> -#include <asm/edd.h> -#define __ASSEMBLY__/* avoid pulling in ACPI stuff (conflicts with EFI) */ -#include <asm/fixmap.h> -#undef __ASSEMBLY__ -#include <asm/msr.h> -#include <asm/processor.h> - -/* Using SetVirtualAddressMap() is incompatible with kexec: */ -#undef USE_SET_VIRTUAL_ADDRESS_MAP#define SHIM_LOCK_PROTOCOL_GUID \ { 0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23} }
@@ -41,8 +31,10 @@ typedef struct {EFI_SHIM_LOCK_VERIFY Verify; }EFI_SHIM_LOCK_PROTOCOL ; -extern char start[]; -extern u32 cpuid_ext_features; +static CHAR16 *__init FormatDec (UINT64 Val,CHAR16 *Buffer); +static CHAR16 *__init FormatHex (UINT64 Val,UINTN Width,CHAR16 *Buffer); +static void __init DisplayUint (UINT64 Val,INTN Width); +static CHAR16 *__init wstrcpy (CHAR16 *d,const CHAR16 *s);union string {CHAR16 *w;
@@ -69,19 +61,18 @@ static UINT32 __initdata mdesc_ver;static struct file __initdata cfg;static struct file __initdata kernel;static struct file __initdata ramdisk; -static struct file __initdata ucode;static struct file __initdata xsm; - -static multiboot_info_t __initdata mbi = { - .flags =MBI_MODULES |MBI_LOADERNAME -}; -static module_t __initdata mb_modules[3 ]; -static CHAR16 __initdata newline[] =L"\r\n" ;#define PrintStr (s) StdOut->OutputString(StdOut, s)#define PrintErr (s) StdErr->OutputString(StdErr, s) +/* +* Include architecture specific implementation here, which references the +* static globals defined above. +*/ +#include <asm/efi-boot.h> +static CHAR16 *__init FormatDec (UINT64 Val,CHAR16 *Buffer) {if ( Val >=10 )
@@ -255,32 +246,6 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode)blexit (mesg); } -static void __init place_string (u32 *addr,const char *s) -{ -static char *__initdata alloc = start; - -if ( s && *s ) - { -size_t len1 =strlen (s) +1 ; -const char *old = (char *)(long )*addr; -size_t len2 = *addr ?strlen (old) +1 :0 ; - - alloc -= len1 + len2; -/* -* Insert new string before already existing one. This is needed -* for options passed on the command line to override options from -* the configuration file. -*/ -memcpy (alloc, s, len1); -if ( *addr ) - { - alloc[len1 -1 ] =' ' ; -memcpy (alloc + len1, old, len2); - } - } - *addr = (long )alloc; -} -static unsigned int __init get_argv (unsigned int argc,CHAR16 **argv,CHAR16 *cmdline,UINTN cmdsize) {
@@ -574,104 +539,6 @@ static void __init split_value(char *s) *s =0 ; } -static void __init edd_put_string (u8 *dst,size_t n,const char *src) -{ -while ( n-- && *src ) - *dst++ = *src++; -if ( *src ) -PrintErrMesg (L"Internal error populating EDD info" , -EFI_BUFFER_TOO_SMALL ); -while ( n-- ) - *dst++ =' ' ; -} -#define edd_put_string (d, s) edd_put_string(d, ARRAY_SIZE(d), s) - -static void __init setup_efi_pci (void ) -{ -EFI_STATUS status; -EFI_HANDLE *handles; -static EFI_GUID __initdata pci_guid =EFI_PCI_IO_PROTOCOL ; -UINTN i, nr_pci, size =0 ; -struct efi_pci_rom *last =NULL ; - - status = efi_bs->LocateHandle (ByProtocol, &pci_guid,NULL , &size,NULL ); -if ( status ==EFI_BUFFER_TOO_SMALL ) - status = efi_bs->AllocatePool (EfiLoaderData, size, (void **)&handles); -if ( !EFI_ERROR (status) ) - status = efi_bs->LocateHandle (ByProtocol, &pci_guid,NULL , &size, - handles); -if (EFI_ERROR (status) ) - size =0 ; - - nr_pci = size /sizeof (*handles); -for ( i =0 ; i < nr_pci; ++i ) - { -EFI_PCI_IO *pci =NULL ; -u64 attributes; -struct efi_pci_rom *rom, *va; -UINTN segment, bus, device, function; - - status = efi_bs->HandleProtocol (handles[i], &pci_guid, (void **)&pci); -if (EFI_ERROR (status) || !pci || !pci->RomImage || !pci->RomSize ) -continue ; - - status = pci->Attributes (pci, EfiPciIoAttributeOperationGet,0 , - &attributes); -if (EFI_ERROR (status) || - !(attributes &EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM ) || -EFI_ERROR (pci->GetLocation (pci, &segment, &bus, &device, - &function)) ) -continue ; - -DisplayUint (segment,4 ); -PrintStr (L":" ); -DisplayUint (bus,2 ); -PrintStr (L":" ); -DisplayUint (device,2 ); -PrintStr (L"." ); -DisplayUint (function,1 ); -PrintStr (L": ROM: " ); -DisplayUint (pci->RomSize,0 ); -PrintStr (L" bytes at " ); -DisplayUint ((UINTN )pci->RomImage,0 ); -PrintStr (newline); - - size = pci->RomSize +sizeof (*rom); - status = efi_bs->AllocatePool (EfiRuntimeServicesData, size, - (void **)&rom); -if (EFI_ERROR (status) ) -continue ; - - rom->next =NULL ; - rom->size = pci->RomSize; - - status = pci->Pci.Read (pci, EfiPciIoWidthUint16,PCI_VENDOR_ID ,1 , - &rom->vendor); -if ( !EFI_ERROR (status) ) - status = pci->Pci.Read (pci, EfiPciIoWidthUint16,PCI_DEVICE_ID ,1 , - &rom->devid); -if (EFI_ERROR (status) ) - { - efi_bs->FreePool (rom); -continue ; - } - - rom->segment = segment; - rom->bus = bus; - rom->devfn = (device <<3 ) | function; -memcpy (rom->data, pci->RomImage, pci->RomSize); - - va = (void *)rom +DIRECTMAP_VIRT_START ; -if ( last ) - last->next = va; -else - efi_pci_roms = va; - last = rom; - } - - efi_bs->FreePool (handles); -} -static int __init set_color (u32 mask,int bpp,u8 *pos,u8 *sz) {if ( bpp <0 )
@@ -687,82 +554,6 @@ static int __init set_color(u32 mask, int bpp, u8 *pos, u8 *sz)return max (*pos + *sz, bpp); } -extern const intpte_t __page_tables_start[], __page_tables_end[]; -#define in_page_tables (v) ((intpte_t *)(v) >= __page_tables_start && \ - (intpte_t *)(v) < __page_tables_end) - -#define PE_BASE_RELOC_ABS 0 -#define PE_BASE_RELOC_HIGHLOW 3 -#define PE_BASE_RELOC_DIR64 10 - -extern const struct pe_base_relocs { -u32 rva; -u32 size; -u16 entries[]; -} __base_relocs_start[], __base_relocs_end[]; - -static void __init relocate_image (unsigned long delta) -{ -const struct pe_base_relocs *base_relocs; - -for ( base_relocs = __base_relocs_start; base_relocs < __base_relocs_end; ) - { -unsigned int i, n; - - n = (base_relocs->size -sizeof (*base_relocs)) / -sizeof (*base_relocs->entries); -for ( i =0 ; i < n; ++i ) - { -unsigned long addr = xen_phys_start + base_relocs->rva + - (base_relocs->entries[i] &0xfff ); - -switch ( base_relocs->entries[i] >>12 ) - { -case PE_BASE_RELOC_ABS : -break ; -case PE_BASE_RELOC_HIGHLOW : -if ( delta ) - { - *(u32 *)addr += delta; -if (in_page_tables (addr) ) - *(u32 *)addr += xen_phys_start; - } -break ; -case PE_BASE_RELOC_DIR64 : -if ( delta ) - { - *(u64 *)addr += delta; -if (in_page_tables (addr) ) - *(intpte_t *)addr += xen_phys_start; - } -break ; -default : -blexit (L"Unsupported relocation type" ); - } - } - base_relocs = (const void *)(base_relocs->entries + i + (i &1 )); - } -} - -extern const s32 __trampoline_rel_start[], __trampoline_rel_stop[]; -extern const s32 __trampoline_seg_start[], __trampoline_seg_stop[]; - -static void __init relocate_trampoline (unsigned long phys) -{ -const s32 *trampoline_ptr; - - trampoline_phys = phys; -/* Apply relocations to trampoline. */ -for ( trampoline_ptr = __trampoline_rel_start; - trampoline_ptr < __trampoline_rel_stop; - ++trampoline_ptr ) - *(u32 *)(*trampoline_ptr + (long )trampoline_ptr) += phys; -for ( trampoline_ptr = __trampoline_seg_start; - trampoline_ptr < __trampoline_seg_stop; - ++trampoline_ptr ) - *(u16 *)(*trampoline_ptr + (long )trampoline_ptr) = phys >>4 ; -} - void EFIAPI __init noreturnefi_start (EFI_HANDLE ImageHandle,EFI_SYSTEM_TABLE *SystemTable) {
@@ -879,7 +670,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) PrintStr(L"Xen " __stringify(XEN_VERSION) "." __stringify(XEN_SUBVERSION)XEN_EXTRAVERSION " (c/s " XEN_CHANGESET ") EFI loader\r\n" ); -relocate_image (0 ); +efi_arch_relocate_image (0 );if ( StdOut->QueryMode (StdOut, StdOut->Mode->Mode, &cols, &rows) ==EFI_SUCCESS )
@@ -1258,7 +1049,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)dmi_efi_get_table ((void *)(long )efi.smbios);/* Collect PCI ROM contents. */ -setup_efi_pci (); +efi_arch_pci ();/* Get snapshot of variable store parameters. */ status = (efi_rs->Hdr.Revision >> 16) >= 2 ?
@@ -1460,7 +1251,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_memmap = (void *)efi_memmap +DIRECTMAP_VIRT_START ; efi_fw_vendor = (void *)efi_fw_vendor +DIRECTMAP_VIRT_START ; -relocate_image (__XEN_VIRT_START - xen_phys_start); +efi_arch_relocate_image (__XEN_VIRT_START - xen_phys_start);memcpy ((void *)trampoline_phys, trampoline_start, cfg.size);/* Set system registers and transfer control. */
@@ -1496,228 +1287,3 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)for ( ; ; );/* not reached */ } -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP -static __init void copy_mapping (unsigned long mfn,unsigned long end, -bool_t (*is_valid)(unsigned long smfn, -unsigned long emfn)) -{ -unsigned long next; - -for ( ; mfn < end; mfn = next ) - { -l4_pgentry_t l4e = efi_l4_pgtable[l4_table_offset (mfn <<PAGE_SHIFT )]; -l3_pgentry_t *l3src, *l3dst; -unsigned long va = (unsigned long )mfn_to_virt (mfn); - - next = mfn + (1UL << (L3_PAGETABLE_SHIFT -PAGE_SHIFT )); -if ( !is_valid (mfn,min (next, end)) ) -continue ; -if ( !(l4e_get_flags (l4e) & _PAGE_PRESENT) ) - { - l3dst =alloc_xen_pagetable (); -BUG_ON (!l3dst); -clear_page (l3dst); - efi_l4_pgtable[l4_table_offset (mfn <<PAGE_SHIFT )] = -l4e_from_paddr (virt_to_maddr (l3dst), __PAGE_HYPERVISOR); - } -else - l3dst =l4e_to_l3e (l4e); - l3src =l4e_to_l3e (idle_pg_table[l4_table_offset (va)]); - l3dst[l3_table_offset (mfn <<PAGE_SHIFT )] = l3src[l3_table_offset (va)]; - } -} - -static bool_t __init ram_range_valid (unsigned long smfn,unsigned long emfn) -{ -unsigned long sz =pfn_to_pdx (emfn -1 ) /PDX_GROUP_COUNT +1 ; - -return !(smfn & pfn_hole_mask) && -find_next_bit (pdx_group_valid, sz, -pfn_to_pdx (smfn) /PDX_GROUP_COUNT ) < sz; -} - -static bool_t __init rt_range_valid (unsigned long smfn,unsigned long emfn) -{ -return 1 ; -} -#endif - -#define INVALID_VIRTUAL_ADDRESS (0xBAAADUL << \ - (EFI_PAGE_SHIFT + BITS_PER_LONG - 32)) - -void __init efi_init_memory (void ) -{ -unsigned int i; -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP -struct rt_extra { -struct rt_extra *next; -unsigned long smfn, emfn; -unsigned int prot; - } *extra, *extra_head =NULL ; -#endif - -printk (XENLOG_INFO "EFI memory map:\n" ); -for ( i =0 ; i < efi_memmap_size; i += efi_mdesc_size ) - { -EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i; -u64 len = desc->NumberOfPages <<EFI_PAGE_SHIFT ; -unsigned long smfn, emfn; -unsigned int prot =PAGE_HYPERVISOR ; - -printk (XENLOG_INFO " %013" PRIx64"-%013" PRIx64 -" type=%u attr=%016" PRIx64"\n" , - desc->PhysicalStart, desc->PhysicalStart + len -1 , - desc->Type, desc->Attribute); - -if ( !(desc->Attribute &EFI_MEMORY_RUNTIME ) ) -continue ; - - desc->VirtualStart =INVALID_VIRTUAL_ADDRESS ; - - smfn =PFN_DOWN (desc->PhysicalStart); - emfn =PFN_UP (desc->PhysicalStart + len); - -if ( desc->Attribute &EFI_MEMORY_WB ) -/* nothing */ ; -else if ( desc->Attribute &EFI_MEMORY_WT ) - prot |= _PAGE_PWT |MAP_SMALL_PAGES ; -else if ( desc->Attribute &EFI_MEMORY_WC ) - prot |= _PAGE_PAT |MAP_SMALL_PAGES ; -else if ( desc->Attribute & (EFI_MEMORY_UC |EFI_MEMORY_UCE ) ) - prot |= _PAGE_PWT | _PAGE_PCD |MAP_SMALL_PAGES ; -else - { -printk (XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx\n" , - smfn, emfn -1 ); -continue ; - } - -if ( desc->Attribute &EFI_MEMORY_WP ) - prot &= _PAGE_RW; -if ( desc->Attribute &EFI_MEMORY_XP ) - prot |= _PAGE_NX_BIT; - -if (pfn_to_pdx (emfn -1 ) < (DIRECTMAP_SIZE >>PAGE_SHIFT ) && - !(smfn & pfn_hole_mask) && - !((smfn ^ (emfn -1 )) & ~pfn_pdx_bottom_mask) ) - { -if ( (unsigned long )mfn_to_virt (emfn -1 ) >=HYPERVISOR_VIRT_END ) - prot &= ~_PAGE_GLOBAL; -if (map_pages_to_xen ((unsigned long )mfn_to_virt (smfn), - smfn, emfn - smfn, prot) ==0 ) - desc->VirtualStart = - (unsigned long )maddr_to_virt (desc->PhysicalStart); -else -printk (XENLOG_ERR "Could not map MFNs %#lx-%#lx\n" , - smfn, emfn -1 ); - } -#ifndef USE_SET_VIRTUAL_ADDRESS_MAP - else if ( !((desc->PhysicalStart + len - 1) >> (VADDR_BITS - 1)) && - (extra = xmalloc(struct rt_extra)) != NULL ) - { - extra->smfn = smfn; - extra->emfn = emfn; - extra->prot = prot & ~_PAGE_GLOBAL; - extra->next = extra_head; - extra_head = extra; - desc->VirtualStart = desc->PhysicalStart; - } -#endif - else - { -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP -/* XXX allocate e.g. down from FIXADDR_START */ -#endif -printk (XENLOG_ERR "No mapping for MFNs %#lx-%#lx\n" , - smfn, emfn -1 ); - } - } - -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP - efi_rs->SetVirtualAddressMap (efi_memmap_size, efi_mdesc_size, - mdesc_ver, efi_memmap); -#else -/* Set up 1:1 page tables to do runtime calls in "physical" mode. */ - efi_l4_pgtable =alloc_xen_pagetable (); -BUG_ON (!efi_l4_pgtable); -clear_page (efi_l4_pgtable); - -copy_mapping (0 , max_page, ram_range_valid); - -/* Insert non-RAM runtime mappings inside the direct map. */ -for ( i =0 ; i < efi_memmap_size; i += efi_mdesc_size ) - { -const EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i; - -if ( (desc->Attribute &EFI_MEMORY_RUNTIME ) && - desc->VirtualStart !=INVALID_VIRTUAL_ADDRESS && - desc->VirtualStart != desc->PhysicalStart ) -copy_mapping (PFN_DOWN (desc->PhysicalStart), -PFN_UP (desc->PhysicalStart + - (desc->NumberOfPages <<EFI_PAGE_SHIFT )), - rt_range_valid); - } - -/* Insert non-RAM runtime mappings outside of the direct map. */ -while ( (extra = extra_head) !=NULL ) - { -unsigned long addr = extra->smfn <<PAGE_SHIFT ; -l4_pgentry_t l4e = efi_l4_pgtable[l4_table_offset (addr)]; -l3_pgentry_t *pl3e; -l2_pgentry_t *pl2e; -l1_pgentry_t *l1t; - -if ( !(l4e_get_flags (l4e) & _PAGE_PRESENT) ) - { - pl3e =alloc_xen_pagetable (); -BUG_ON (!pl3e); -clear_page (pl3e); - efi_l4_pgtable[l4_table_offset (addr)] = -l4e_from_paddr (virt_to_maddr (pl3e), __PAGE_HYPERVISOR); - } -else - pl3e =l4e_to_l3e (l4e); - pl3e +=l3_table_offset (addr); -if ( !(l3e_get_flags (*pl3e) & _PAGE_PRESENT) ) - { - pl2e =alloc_xen_pagetable (); -BUG_ON (!pl2e); -clear_page (pl2e); - *pl3e =l3e_from_paddr (virt_to_maddr (pl2e), __PAGE_HYPERVISOR); - } -else - { -BUG_ON (l3e_get_flags (*pl3e) & _PAGE_PSE); - pl2e =l3e_to_l2e (*pl3e); - } - pl2e +=l2_table_offset (addr); -if ( !(l2e_get_flags (*pl2e) & _PAGE_PRESENT) ) - { - l1t =alloc_xen_pagetable (); -BUG_ON (!l1t); -clear_page (l1t); - *pl2e =l2e_from_paddr (virt_to_maddr (l1t), __PAGE_HYPERVISOR); - } -else - { -BUG_ON (l2e_get_flags (*pl2e) & _PAGE_PSE); - l1t =l2e_to_l1e (*pl2e); - } -for ( i =l1_table_offset (addr); - i <L1_PAGETABLE_ENTRIES && extra->smfn < extra->emfn; - ++i, ++extra->smfn ) - l1t[i] =l1e_from_pfn (extra->smfn, extra->prot); - -if ( extra->smfn == extra->emfn ) - { - extra_head = extra->next; -xfree (extra); - } - } - -/* Insert Xen mappings. */ -for ( i =l4_table_offset (HYPERVISOR_VIRT_START ); - i <l4_table_offset (DIRECTMAP_VIRT_END ); ++i ) - efi_l4_pgtable[i] = idle_pg_table[i]; -#endif -}
xen/include/asm-x86/efi-boot.h new file +455 -0
455 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 3/15 create arch functions to get and process EFI memory map.
In reply to Roy FranzThe memory used to store the EFI memory map is allocated in an architecture specific way, and the processing of the memory map itself uses x86 specific data structures. This patch adds architecture specific funtions so each architecture can provide its own implementation.
--- xen/common/efi/boot.c | 75 +++++------------------------------- xen/include/asm-x86/efi-boot.h | 86 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 93 insertions(+), 68 deletions(-)
xen/common/efi/boot.c +9 -66
@@ -56,8 +56,6 @@ static EFI_HANDLE __initdata efi_ih;static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdOut;static SIMPLE_TEXT_OUTPUT_INTERFACE *__initdata StdErr; -static UINT32 __initdata mdesc_ver; -static struct file __initdata cfg;static struct file __initdata kernel;static struct file __initdata ramdisk;
@@ -566,16 +564,18 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)EFI_STATUS status;unsigned int i, argc;CHAR16 **argv, *file_name, *cfg_file_name =NULL ; -UINTN cols, rows, depth, size, map_key, info_size, gop_mode = ~0 ; +UINTN cols, rows, depth, size, info_size, gop_mode = ~0 ;EFI_HANDLE *handles =NULL ;EFI_SHIM_LOCK_PROTOCOL *shim_lock;EFI_GRAPHICS_OUTPUT_PROTOCOL *gop =NULL ;EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;EFI_FILE_HANDLE dir_handle;union string section = {NULL }, name; -struct e820entry *e;u64 efer;bool_t base_video =0 ; +UINT32 mmap_desc_ver =0 ; +UINTN mmap_size, mmap_desc_size, mmap_key =0 ; +void *mmap; efi_ih = ImageHandle; efi_bs = SystemTable->BootServices;
@@ -875,8 +875,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) mbi.boot_loader_name = (long )"EFI" ; mbi.mods_addr = (long )mb_modules; -place_string (&mbi.mem_upper,NULL ); -/* Collect EDD info. */ BUILD_BUG_ON (offsetof(struct edd_info , edd_device_params) !=EDDEXTSIZE );BUILD_BUG_ON (sizeof (struct edd_device_params ) !=EDDPARMSIZE );
@@ -1171,67 +1169,12 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) } } - efi_bs->GetMemoryMap (&efi_memmap_size,NULL , &map_key, - &efi_mdesc_size, &mdesc_ver); - mbi.mem_upper -= efi_memmap_size; - mbi.mem_upper &= -__alignof__(EFI_MEMORY_DESCRIPTOR ); -if ( mbi.mem_upper < xen_phys_start ) -blexit (L"Out of static memory" ); - efi_memmap = (void *)(long )mbi.mem_upper; - status = efi_bs->GetMemoryMap (&efi_memmap_size, efi_memmap, &map_key, - &efi_mdesc_size, &mdesc_ver); -if (EFI_ERROR (status) ) -PrintErrMesg (L"Cannot obtain memory map" , status); +efi_arch_get_memory_map (&mmap_size, &mmap, &mmap_key, + &mmap_desc_size, &mmap_desc_ver); -/* Populate E820 table and check trampoline area availability. */ - e = e820map -1 ; -for ( i =0 ; i < efi_memmap_size; i += efi_mdesc_size ) - { -EFI_MEMORY_DESCRIPTOR *desc = efi_memmap + i; -u64 len = desc->NumberOfPages <<EFI_PAGE_SHIFT ; -u32 type; +efi_arch_process_memory_map (SystemTable, mmap, mmap_size, + mmap_desc_size, mmap_desc_ver); -switch ( desc->Type ) - { -default : - type =E820_RESERVED ; -break ; -case EfiConventionalMemory: -case EfiBootServicesCode: -case EfiBootServicesData: -if ( !trampoline_phys && desc->PhysicalStart + len <=0x100000 && - len >= cfg.size && desc->PhysicalStart + len > cfg.addr ) - cfg.addr = (desc->PhysicalStart + len - cfg.size) &PAGE_MASK ; -/* fall through */ -case EfiLoaderCode: -case EfiLoaderData: -if ( desc->Attribute &EFI_MEMORY_WB ) - type =E820_RAM ; -else -case EfiUnusableMemory: - type =E820_UNUSABLE ; -break ; -case EfiACPIReclaimMemory: - type =E820_ACPI ; -break ; -case EfiACPIMemoryNVS: - type =E820_NVS ; -break ; - } -if ( e820nr && type == e->type && - desc->PhysicalStart == e->addr + e->size ) - e->size += len; -else if ( !len || e820nr >=E820MAX ) -continue ; -else - { - ++e; - e->addr = desc->PhysicalStart; - e->size = len; - e->type = type; - ++e820nr; - } - }if ( !trampoline_phys ) {if ( !cfg.addr )
@@ -1239,7 +1182,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)relocate_trampoline (cfg.addr); } - status = efi_bs->ExitBootServices (ImageHandle, map_key); + status = efi_bs->ExitBootServices (ImageHandle, mmap_key);if (EFI_ERROR (status) )PrintErrMesg (L"Cannot exit boot services" , status);
xen/include/asm-x86/efi-boot.h +84 -2
101 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 4/15 Add architecture functions for pre/post ExitBootServices
In reply to Roy FranzThe UEFI ExitBootServices function is invoked to transition the system to the 'runtime' mode of operation, and is done right before transitioning from the EFI loader code into XEN proper. x86 does some arch specific memory management (trampoline) before exit boot services, and the code that transitions from the EFI application state to XEN is architecture specific. This patch adds two functions, one pre and one post ExitBootServices to allow each architecture to to handle these cases in a customized manner.
--- xen/common/efi/boot.c | 50 ++----------------------------------- xen/include/asm-x86/efi-boot.h | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 48 deletions(-)
xen/common/efi/boot.c +2 -48
@@ -571,7 +571,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;EFI_FILE_HANDLE dir_handle;union string section = {NULL }, name; -u64 efer;bool_t base_video =0 ;UINT32 mmap_desc_ver =0 ;UINTN mmap_size, mmap_desc_size, mmap_key =0 ;
@@ -1175,58 +1174,13 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)efi_arch_process_memory_map (SystemTable, mmap, mmap_size, mmap_desc_size, mmap_desc_ver); -if ( !trampoline_phys ) - { -if ( !cfg.addr ) -blexit (L"No memory for trampoline" ); -relocate_trampoline (cfg.addr); - } +efi_arch_pre_exit_boot (); status = efi_bs->ExitBootServices (ImageHandle, mmap_key);if (EFI_ERROR (status) )PrintErrMesg (L"Cannot exit boot services" , status); -/* Adjust pointers into EFI. */ - efi_ct = (void *)efi_ct +DIRECTMAP_VIRT_START ; -#ifdef USE_SET_VIRTUAL_ADDRESS_MAP - efi_rs = (void *)efi_rs +DIRECTMAP_VIRT_START ; -#endif - efi_memmap = (void *)efi_memmap +DIRECTMAP_VIRT_START ; - efi_fw_vendor = (void *)efi_fw_vendor +DIRECTMAP_VIRT_START ; - -efi_arch_relocate_image (__XEN_VIRT_START - xen_phys_start); -memcpy ((void *)trampoline_phys, trampoline_start, cfg.size); - -/* Set system registers and transfer control. */ - asmvolatile ("pushq $0\n\tpopfq" ); -rdmsrl (MSR_EFER , efer); - efer |=EFER_SCE ; -if ( cpuid_ext_features & (1 << (X86_FEATURE_NX &0x1f )) ) - efer |=EFER_NX ; -wrmsrl (MSR_EFER , efer); -write_cr0 (X86_CR0_PE |X86_CR0_MP |X86_CR0_ET |X86_CR0_NE |X86_CR0_WP | -X86_CR0_AM |X86_CR0_PG ); - asmvolatile ("mov %[cr4], %%cr4\n\t" -"mov %[cr3], %%cr3\n\t" -"movabs $__start_xen, %[rip]\n\t" -"lgdt gdt_descr(%%rip)\n\t" -"mov stack_start(%%rip), %%rsp\n\t" -"mov %[ds], %%ss\n\t" -"mov %[ds], %%ds\n\t" -"mov %[ds], %%es\n\t" -"mov %[ds], %%fs\n\t" -"mov %[ds], %%gs\n\t" -"movl %[cs], 8(%%rsp)\n\t" -"mov %[rip], (%%rsp)\n\t" -"lretq %[stkoff]-16" - : [rip]"=&r" (efer/* any dead 64-bit variable */ ) - : [cr3]"r" (idle_pg_table), - [cr4]"r" (mmu_cr4_features), - [cs]"ir" (__HYPERVISOR_CS), - [ds]"r" (__HYPERVISOR_DS), - [stkoff]"i" (STACK_SIZE -sizeof (struct cpu_info )), -"D" (&mbi) - :"memory" ); +efi_arch_post_exit_boot ();for ( ; ; );/* not reached */ }
xen/include/asm-x86/efi-boot.h +56 -0
59 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 5/15 Add efi_arch_cfg_file() to handle arch specific cfg file fields
In reply to Roy FranzDifferent architectures have some different configuration file fields that need to be handled. In particular, x86 has ucode and ARM has device tree files to be loaded. This arch specific function is used to allow each architecture to implement these features in arch specific code.
--- xen/common/efi/boot.c | 30 ++++++++++++++---------------- xen/include/asm-x86/efi-boot.h | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 16 deletions(-)
xen/common/efi/boot.c +14 -16
@@ -31,11 +31,6 @@ typedef struct {EFI_SHIM_LOCK_VERIFY Verify; }EFI_SHIM_LOCK_PROTOCOL ; -static CHAR16 *__init FormatDec (UINT64 Val,CHAR16 *Buffer); -static CHAR16 *__init FormatHex (UINT64 Val,UINTN Width,CHAR16 *Buffer); -static void __init DisplayUint (UINT64 Val,INTN Width); -static CHAR16 *__init wstrcpy (CHAR16 *d,const CHAR16 *s); -union string {CHAR16 *w;char *s;
@@ -50,6 +45,17 @@ struct file { }; }; +static CHAR16 *__init FormatDec (UINT64 Val,CHAR16 *Buffer); +static CHAR16 *__init FormatHex (UINT64 Val,UINTN Width,CHAR16 *Buffer); +static void __init DisplayUint (UINT64 Val,INTN Width); +static CHAR16 *__init wstrcpy (CHAR16 *d,const CHAR16 *s); +static char *__init get_value (const struct file *cfg,const char *section, +const char *item); +static void __init split_value (char *s); +static CHAR16 *__init s2w (union string *str); +static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,CHAR16 *name, +struct file *file); +static EFI_BOOT_SERVICES *__initdata efi_bs;static EFI_HANDLE __initdata efi_ih;
@@ -752,6 +758,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) }if ( !name.s )blexit (L"No Dom0 kernel image specified." ); + +efi_arch_cfg_file (dir_handle, section.s); +split_value (name.s);read_file (dir_handle,s2w (&name), &kernel); efi_bs->FreePool (name.w);
@@ -769,17 +778,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_bs->FreePool (name.w); } - name.s =get_value (&cfg, section.s,"ucode" ); -if ( !name.s ) - name.s =get_value (&cfg,"global" ,"ucode" ); -if ( name.s ) - { -microcode_set_module (mbi.mods_count); -split_value (name.s); -read_file (dir_handle,s2w (&name), &ucode); - efi_bs->FreePool (name.w); - } - name.s =get_value (&cfg, section.s,"xsm" );if ( name.s ) {
xen/include/asm-x86/efi-boot.h +15 -0
@@ -591,3 +591,18 @@ static void __init efi_arch_post_exit_boot(void) "D" (&mbi) : "memory" ); } + +static void __init efi_arch_cfg_file (EFI_FILE_HANDLE dir_handle,char *section) +{ +union string name; + name.s =get_value (&cfg, section,"ucode" ); +if ( !name.s ) + name.s =get_value (&cfg,"global" ,"ucode" ); +if ( name.s ) + { +microcode_set_module (mbi.mods_count); +split_value (name.s); +read_file (dir_handle,s2w (&name), &ucode); + efi_bs->FreePool (name.w); + } +}
Signature · 1 line
2.1.0.rc1
PATCH v3 6/15 Add efi_arch_handle_cmdline() for processing commandline
In reply to Roy FranzAdd arch function for processing the XEN commandline and updating internal structures.
--- xen/common/efi/boot.c | 41 +++++++++++------------------------------ xen/include/asm-x86/efi-boot.h | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 30 deletions(-)
xen/common/efi/boot.c +11 -30
@@ -53,6 +53,7 @@ static char *__init get_value(const struct file *cfg, const char *section, const char *item);static void __init split_value (char *s);static CHAR16 *__init s2w (union string *str); +static char *__init w2s (const union string *str);static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,CHAR16 *name,struct file *file);
@@ -251,7 +252,8 @@ static void __init PrintErrMesg(const CHAR16 *mesg, EFI_STATUS ErrCode) }static unsigned int __init get_argv (unsigned int argc,CHAR16 **argv, -CHAR16 *cmdline,UINTN cmdsize) +CHAR16 *cmdline,UINTN cmdsize, +CHAR16 **options) {CHAR16 *ptr = (CHAR16 *)(argv + argc +1 ), *prev =NULL ;bool_t prev_sep = TRUE;
@@ -277,10 +279,8 @@ static unsigned int __init get_argv(unsigned int argc, CHAR16 **argv, ++argc; else if ( prev && wstrcmp(prev, L"--") == 0 ) { -union string rest = { .w = cmdline }; - - --argv; -place_string (&mbi.cmdline,w2s (&rest)); +if ( options ) + *options = cmdline;break ; } else
@@ -569,7 +569,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)EFI_LOADED_IMAGE *loaded_image;EFI_STATUS status;unsigned int i, argc; -CHAR16 **argv, *file_name, *cfg_file_name =NULL ; +CHAR16 **argv, *file_name, *cfg_file_name =NULL , *options =NULL ;UINTN cols, rows, depth, size, info_size, gop_mode = ~0 ;EFI_HANDLE *handles =NULL ;EFI_SHIM_LOCK_PROTOCOL *shim_lock;
@@ -610,14 +610,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) dir_handle =get_parent_handle (loaded_image, &file_name); argc =get_argv (0 ,NULL , loaded_image->LoadOptions, - loaded_image->LoadOptionsSize); + loaded_image->LoadOptionsSize, &options);if ( argc >0 && efi_bs->AllocatePool (EfiLoaderData, (argc +1 ) *sizeof (*argv) + loaded_image->LoadOptionsSize, (void **)&argv) ==EFI_SUCCESS )get_argv (argc, argv, loaded_image->LoadOptions, - loaded_image->LoadOptionsSize); + loaded_image->LoadOptionsSize, &options);else argc =0 ;for ( i =1 ; i < argc; ++i )
@@ -786,19 +786,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_bs->FreePool (name.w); } - name.s =get_value (&cfg, section.s,"options" ); -if ( name.s ) -place_string (&mbi.cmdline, name.s); -/* Insert image name last, as it gets prefixed to the other options. */ -if ( argc ) - { - name.w = *argv; -w2s (&name); - } -else - name.s ="xen" ; -place_string (&mbi.cmdline, name.s); - cols = rows = depth =0 ;if ( !base_video ) {
@@ -817,6 +804,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) } } + name.s =get_value (&cfg, section.s,"options" ); +efi_arch_handle_cmdline (argc ? *argv :NULL , options, name.s); + efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); cfg.addr =0 ;
@@ -863,15 +853,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) } } -if ( mbi.cmdline ) - mbi.flags |=MBI_CMDLINE ; -/* -* These must not be initialized statically, since the value must -* not get relocated when processing base relocations below. -*/ - mbi.boot_loader_name = (long )"EFI" ; - mbi.mods_addr = (long )mb_modules; -/* Collect EDD info. */ BUILD_BUG_ON (offsetof(struct edd_info , edd_device_params) !=EDDEXTSIZE );BUILD_BUG_ON (sizeof (struct edd_device_params ) !=EDDPARMSIZE );
xen/include/asm-x86/efi-boot.h +33 -0
@@ -606,3 +606,36 @@ static void __init efi_arch_cfg_file(EFI_FILE_HANDLE dir_handle, char *section) efi_bs->FreePool (name.w); } } +static void __init efi_arch_handle_cmdline (CHAR16 *image_name, +CHAR16 *cmdline_options, +char *cfgfile_options) +{ +union string name; + +if ( cmdline_options ) + { + name.w = cmdline_options; +w2s (&name); +place_string (&mbi.cmdline, name.s); + } +if ( cfgfile_options ) +place_string (&mbi.cmdline, cfgfile_options); +/* Insert image name last, as it gets prefixed to the other options. */ +if ( image_name ) + { + name.w = image_name; +w2s (&name); + } +else + name.s ="xen" ; +place_string (&mbi.cmdline, name.s); + +if ( mbi.cmdline ) + mbi.flags |=MBI_CMDLINE ; +/* +* These must not be initialized statically, since the value must +* not get relocated when processing base relocations below. +*/ + mbi.boot_loader_name = (long )"EFI" ; + mbi.mods_addr = (long )mb_modules; +}
Signature · 1 line
2.1.0.rc1
PATCH v3 7/15 Move x86 specific video and disk probing code
In reply to Roy FranzMove x86 specific video (VGA) and disk (EDD) probing to arch specific file. This code is x86 only, so move it to arch specific code. The efi_arch_edd() and efi_arch_video() will be empty for ARM.
--- xen/common/efi/boot.c | 284 +-------------------------------------- xen/include/asm-x86/efi-boot.h | 298 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 301 insertions(+), 281 deletions(-)
xen/common/efi/boot.c +3 -281
@@ -543,34 +543,17 @@ static void __init split_value(char *s) *s =0 ; } -static int __init set_color (u32 mask,int bpp,u8 *pos,u8 *sz) -{ -if ( bpp <0 ) -return bpp; -if ( !mask ) -return -EINVAL ; -for ( *pos =0 ; !(mask &1 ); ++*pos ) - mask >>=1 ; -for ( *sz =0 ; mask &1 ; ++sz) - mask >>=1 ; -if ( mask ) -return -EINVAL ; -return max (*pos + *sz, bpp); -} - void EFIAPI __init noreturnefi_start (EFI_HANDLE ImageHandle,EFI_SYSTEM_TABLE *SystemTable) {static EFI_GUID __initdata loaded_image_guid =LOADED_IMAGE_PROTOCOL ;static EFI_GUID __initdata gop_guid =EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID ; -static EFI_GUID __initdata bio_guid =BLOCK_IO_PROTOCOL ; -static EFI_GUID __initdata devp_guid =DEVICE_PATH_PROTOCOL ;static EFI_GUID __initdata shim_lock_guid =SHIM_LOCK_PROTOCOL_GUID ;EFI_LOADED_IMAGE *loaded_image;EFI_STATUS status;unsigned int i, argc;CHAR16 **argv, *file_name, *cfg_file_name =NULL , *options =NULL ; -UINTN cols, rows, depth, size, info_size, gop_mode = ~0 ; +UINTN cols, rows, depth, size, info_size;EFI_HANDLE *handles =NULL ;EFI_SHIM_LOCK_PROTOCOL *shim_lock;EFI_GRAPHICS_OUTPUT_PROTOCOL *gop =NULL ;
@@ -677,15 +660,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)efi_arch_relocate_image (0 ); -if ( StdOut->QueryMode (StdOut, StdOut->Mode->Mode, - &cols, &rows) ==EFI_SUCCESS ) - { - vga_console_info.video_type =XEN_VGATYPE_TEXT_MODE_3 ; - vga_console_info.u.text_mode_3.columns = cols; - vga_console_info.u.text_mode_3.rows = rows; - vga_console_info.u.text_mode_3.font_height =16 ; - } - size =0 ; status = efi_bs->LocateHandle (ByProtocol, &gop_guid,NULL , &size,NULL );if ( status ==EFI_BUFFER_TOO_SMALL )
@@ -811,189 +785,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) cfg.addr =0 ; dir_handle->Close (dir_handle); - -if ( gop && !base_video ) - { -for ( i = size =0 ; i < gop->Mode->MaxMode; ++i ) - { -unsigned int bpp =0 ; - - status = gop->QueryMode (gop, i, &info_size, &mode_info); -if (EFI_ERROR (status) ) -continue ; -switch ( mode_info->PixelFormat ) - { -case PixelBitMask: - bpp =hweight32 (mode_info->PixelInformation.RedMask | - mode_info->PixelInformation.GreenMask | - mode_info->PixelInformation.BlueMask); -break ; -case PixelRedGreenBlueReserved8BitPerColor: -case PixelBlueGreenRedReserved8BitPerColor: - bpp =24 ; -break ; -default : -continue ; - } -if ( cols == mode_info->HorizontalResolution && - rows == mode_info->VerticalResolution && - (!depth || bpp == depth) ) - { - gop_mode = i; -break ; - } -if ( !cols && !rows && - mode_info->HorizontalResolution * - mode_info->VerticalResolution > size ) - { - size = mode_info->HorizontalResolution * - mode_info->VerticalResolution; - gop_mode = i; - } - } - } - -/* Collect EDD info. */ -BUILD_BUG_ON (offsetof(struct edd_info , edd_device_params) !=EDDEXTSIZE ); -BUILD_BUG_ON (sizeof (struct edd_device_params ) !=EDDPARMSIZE ); - size =0 ; - status = efi_bs->LocateHandle (ByProtocol, &bio_guid,NULL , &size,NULL ); -if ( status ==EFI_BUFFER_TOO_SMALL ) - status = efi_bs->AllocatePool (EfiLoaderData, size, (void **)&handles); -if ( !EFI_ERROR (status) ) - status = efi_bs->LocateHandle (ByProtocol, &bio_guid,NULL , &size, - handles); -if (EFI_ERROR (status) ) - size =0 ; -for ( i =0 ; i < size /sizeof (*handles); ++i ) - { -EFI_BLOCK_IO *bio; -EFI_DEV_PATH_PTR devp; -struct edd_info *info = boot_edd_info + boot_edd_info_nr; -struct edd_device_params *params = &info->edd_device_params; -enum { root, acpi, pci, ctrlr } state = root; - - status = efi_bs->HandleProtocol (handles[i], &bio_guid, (void **)&bio); -if (EFI_ERROR (status) || - bio->Media->RemovableMedia || - bio->Media->LogicalPartition ) -continue ; -if ( boot_edd_info_nr <EDD_INFO_MAX ) - { - info->device =0x80 + boot_edd_info_nr;/* fake */ - info->version =0x11 ; - params->length = offsetof(struct edd_device_params , dpte_ptr); - params->number_of_sectors = bio->Media->LastBlock +1 ; - params->bytes_per_sector = bio->Media->BlockSize; - params->dpte_ptr = ~0 ; - } - ++boot_edd_info_nr; - status = efi_bs->HandleProtocol (handles[i], &devp_guid, - (void **)&devp); -if (EFI_ERROR (status) ) -continue ; -for ( ; !IsDevicePathEnd (devp.DevPath); - devp.DevPath =NextDevicePathNode (devp.DevPath) ) - { -switch (DevicePathType (devp.DevPath) ) - { -const u8 *p; - -case ACPI_DEVICE_PATH : -if ( state != root || boot_edd_info_nr >EDD_INFO_MAX ) -break ; -switch (DevicePathSubType (devp.DevPath) ) - { -case ACPI_DP : -if ( devp.Acpi->HID !=EISA_PNP_ID (0xA03 ) && - devp.Acpi->HID !=EISA_PNP_ID (0xA08 ) ) -break ; - params->interface_path.pci.bus = devp.Acpi->UID; - state = acpi; -break ; -case EXPANDED_ACPI_DP : -/* XXX */ -break ; - } -break ; -case HARDWARE_DEVICE_PATH : -if ( state != acpi || -DevicePathSubType (devp.DevPath) !=HW_PCI_DP || - boot_edd_info_nr >EDD_INFO_MAX ) -break ; - state = pci; -edd_put_string (params->host_bus_type,"PCI" ); - params->interface_path.pci.slot = devp.Pci->Device; - params->interface_path.pci.function = devp.Pci->Function; -break ; -case MESSAGING_DEVICE_PATH : -if ( state != pci || boot_edd_info_nr >EDD_INFO_MAX ) -break ; - state = ctrlr; -switch (DevicePathSubType (devp.DevPath) ) - { -case MSG_ATAPI_DP : -edd_put_string (params->interface_type,"ATAPI" ); - params->interface_path.pci.channel = - devp.Atapi->PrimarySecondary; - params->device_path.atapi.device = devp.Atapi->SlaveMaster; - params->device_path.atapi.lun = devp.Atapi->Lun; -break ; -case MSG_SCSI_DP : -edd_put_string (params->interface_type,"SCSI" ); - params->device_path.scsi.id = devp.Scsi->Pun; - params->device_path.scsi.lun = devp.Scsi->Lun; -break ; -case MSG_FIBRECHANNEL_DP : -edd_put_string (params->interface_type,"FIBRE" ); - params->device_path.fibre.wwid = devp.FibreChannel->WWN; - params->device_path.fibre.lun = devp.FibreChannel->Lun; -break ; -case MSG_1394_DP : -edd_put_string (params->interface_type,"1394" ); - params->device_path.i1394.eui = devp.F1394->Guid; -break ; -case MSG_USB_DP : -case MSG_USB_CLASS_DP : -edd_put_string (params->interface_type,"USB" ); -break ; -case MSG_I2O_DP : -edd_put_string (params->interface_type,"I2O" ); - params->device_path.i2o.identity_tag = devp.I2O->Tid; -break ; -default : -continue ; - } - info->version =0x30 ; - params->length =sizeof (struct edd_device_params ); - params->key =0xbedd ; - params->device_path_info_length = -sizeof (struct edd_device_params ) - - offsetof(struct edd_device_params , key); -for ( p = (const u8 *)¶ms->key; p < ¶ms->checksum; ++p ) - params->checksum -= *p; -break ; -case MEDIA_DEVICE_PATH : -if (DevicePathSubType (devp.DevPath) ==MEDIA_HARDDRIVE_DP && - devp.HardDrive->MBRType ==MBR_TYPE_PCAT && - boot_mbr_signature_nr <EDD_MBR_SIG_MAX ) - { -struct mbr_signature *sig = boot_mbr_signature + - boot_mbr_signature_nr; - - sig->device =0x80 + boot_edd_info_nr;/* fake */ -memcpy (&sig->signature, devp.HardDrive->Signature, -sizeof (sig->signature)); - ++boot_mbr_signature_nr; - } -break ; - } - } - } -if ( handles ) - efi_bs->FreePool (handles); -if ( boot_edd_info_nr >EDD_INFO_MAX ) - boot_edd_info_nr =EDD_INFO_MAX ; +efi_arch_edd ();/* XXX Collect EDID info. */
@@ -1075,77 +867,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) l3_bootmap[l3_table_offset (xen_phys_start + (8 <<L2_PAGETABLE_SHIFT ) -1 )] =l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); -if ( gop ) - { -int bpp =0 ; - -/* Set graphics mode. */ -if ( gop_mode < gop->Mode->MaxMode && gop_mode != gop->Mode->Mode ) - gop->SetMode (gop, gop_mode); - -/* Get graphics and frame buffer info. */ - status = gop->QueryMode (gop, gop->Mode->Mode, &info_size, &mode_info); -if ( !EFI_ERROR (status) ) -switch ( mode_info->PixelFormat ) - { -case PixelRedGreenBlueReserved8BitPerColor: - vga_console_info.u.vesa_lfb.red_pos =0 ; - vga_console_info.u.vesa_lfb.red_size =8 ; - vga_console_info.u.vesa_lfb.green_pos =8 ; - vga_console_info.u.vesa_lfb.green_size =8 ; - vga_console_info.u.vesa_lfb.blue_pos =16 ; - vga_console_info.u.vesa_lfb.blue_size =8 ; - vga_console_info.u.vesa_lfb.rsvd_pos =24 ; - vga_console_info.u.vesa_lfb.rsvd_size =8 ; - bpp =32 ; -break ; -case PixelBlueGreenRedReserved8BitPerColor: - vga_console_info.u.vesa_lfb.red_pos =16 ; - vga_console_info.u.vesa_lfb.red_size =8 ; - vga_console_info.u.vesa_lfb.green_pos =8 ; - vga_console_info.u.vesa_lfb.green_size =8 ; - vga_console_info.u.vesa_lfb.blue_pos =0 ; - vga_console_info.u.vesa_lfb.blue_size =8 ; - vga_console_info.u.vesa_lfb.rsvd_pos =24 ; - vga_console_info.u.vesa_lfb.rsvd_size =8 ; - bpp =32 ; -break ; -case PixelBitMask: - bpp =set_color (mode_info->PixelInformation.RedMask, bpp, - &vga_console_info.u.vesa_lfb.red_pos, - &vga_console_info.u.vesa_lfb.red_size); - bpp =set_color (mode_info->PixelInformation.GreenMask, bpp, - &vga_console_info.u.vesa_lfb.green_pos, - &vga_console_info.u.vesa_lfb.green_size); - bpp =set_color (mode_info->PixelInformation.BlueMask, bpp, - &vga_console_info.u.vesa_lfb.blue_pos, - &vga_console_info.u.vesa_lfb.blue_size); - bpp =set_color (mode_info->PixelInformation.ReservedMask, bpp, - &vga_console_info.u.vesa_lfb.rsvd_pos, - &vga_console_info.u.vesa_lfb.rsvd_size); -if ( bpp >0 ) -break ; -/* fall through */ -default : -PrintErr (L"Current graphics mode is unsupported!\r\n" ); - status =EFI_UNSUPPORTED ; -break ; - } -if ( !EFI_ERROR (status) ) - { - vga_console_info.video_type =XEN_VGATYPE_EFI_LFB ; - vga_console_info.u.vesa_lfb.gbl_caps =2 ;/* possibly non-VGA */ - vga_console_info.u.vesa_lfb.width = - mode_info->HorizontalResolution; - vga_console_info.u.vesa_lfb.height = mode_info->VerticalResolution; - vga_console_info.u.vesa_lfb.bits_per_pixel = bpp; - vga_console_info.u.vesa_lfb.bytes_per_line = - (mode_info->PixelsPerScanLine * bpp +7 ) >>3 ; - vga_console_info.u.vesa_lfb.lfb_base = gop->Mode->FrameBufferBase; - vga_console_info.u.vesa_lfb.lfb_size = - (gop->Mode->FrameBufferSize +0xffff ) >>16 ; - } - } +efi_arch_video (base_video, cols, rows, depth, gop);efi_arch_get_memory_map (&mmap_size, &mmap, &mmap_key, &mmap_desc_size, &mmap_desc_ver);
xen/include/asm-x86/efi-boot.h +298 -0
301 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 8/15 Add efi_arch_memory() for arch specific memory setup
In reply to Roy FranzThis patch adds efi_arch_memory() to allow each architecture a hook to use for do memory setup. x86 uses this for trampoline memory setup and some pagetable setup.
--- xen/common/efi/boot.c | 29 +---------------------------- xen/include/asm-x86/efi-boot.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 28 deletions(-)
xen/common/efi/boot.c +1 -28
@@ -838,34 +838,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)PrintStr (newline); } -/* Allocate space for trampoline (in first Mb). */ - cfg.addr =0x100000 ; - cfg.size = trampoline_end - trampoline_start; - status = efi_bs->AllocatePages (AllocateMaxAddress, EfiLoaderData, -PFN_UP (cfg.size), &cfg.addr); -if ( status ==EFI_SUCCESS ) -relocate_trampoline (cfg.addr); -else - { - cfg.addr =0 ; -PrintStr (L"Trampoline space cannot be allocated; will try fallback.\r\n" ); - } - -/* Initialise L2 identity-map and boot-map page table entries (16MB). */ -for ( i =0 ; i <8 ; ++i ) - { -unsigned int slot = (xen_phys_start >>L2_PAGETABLE_SHIFT ) + i; -paddr_t addr = slot <<L2_PAGETABLE_SHIFT ; - - l2_identmap[slot] =l2e_from_paddr (addr,PAGE_HYPERVISOR |_PAGE_PSE); - slot &=L2_PAGETABLE_ENTRIES -1 ; - l2_bootmap[slot] =l2e_from_paddr (addr, __PAGE_HYPERVISOR|_PAGE_PSE); - } -/* Initialise L3 boot-map page directory entries. */ - l3_bootmap[l3_table_offset (xen_phys_start)] = -l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); - l3_bootmap[l3_table_offset (xen_phys_start + (8 <<L2_PAGETABLE_SHIFT ) -1 )] = -l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); +efi_arch_memory ();efi_arch_video (base_video, cols, rows, depth, gop);
xen/include/asm-x86/efi-boot.h +35 -0
@@ -937,3 +937,38 @@ static void __init efi_arch_video(bool_t base_video, } } } + +static void __init efi_arch_memory (void ) +{ +int i; +EFI_STATUS status; + +/* Allocate space for trampoline (in first Mb). */ + cfg.addr =0x100000 ; + cfg.size = trampoline_end - trampoline_start; + status = efi_bs->AllocatePages (AllocateMaxAddress, EfiLoaderData, +PFN_UP (cfg.size), &cfg.addr); +if ( status ==EFI_SUCCESS ) +relocate_trampoline (cfg.addr); +else + { + cfg.addr =0 ; +PrintStr (L"Trampoline space cannot be allocated; will try fallback.\r\n" ); + } + +/* Initialise L2 identity-map and boot-map page table entries (16MB). */ +for ( i =0 ; i <8 ; ++i ) + { +unsigned int slot = (xen_phys_start >>L2_PAGETABLE_SHIFT ) + i; +paddr_t addr = slot <<L2_PAGETABLE_SHIFT ; + + l2_identmap[slot] =l2e_from_paddr (addr,PAGE_HYPERVISOR |_PAGE_PSE); + slot &=L2_PAGETABLE_ENTRIES -1 ; + l2_bootmap[slot] =l2e_from_paddr (addr, __PAGE_HYPERVISOR|_PAGE_PSE); + } +/* Initialise L3 boot-map page directory entries. */ + l3_bootmap[l3_table_offset (xen_phys_start)] = +l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); + l3_bootmap[l3_table_offset (xen_phys_start + (8 <<L2_PAGETABLE_SHIFT ) -1 )] = +l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); +}
Signature · 1 line
2.1.0.rc1
PATCH v3 9/15 Add arch specific module handling to read_file()
In reply to Roy FranzEach architecture tracks modules differently internally, so add efi_arch_handle_module() routine to enable the common code to invoke the proper handling of modules as the are loaded.
--- xen/common/efi/boot.c | 98 +++++++++++++++++++++++------------------- xen/include/asm-x86/efi-boot.h | 15 +++++-- 2 files changed, 66 insertions(+), 47 deletions(-)
xen/common/efi/boot.c +54 -44
@@ -51,11 +51,10 @@ static void __init DisplayUint(UINT64 Val, INTN Width);static CHAR16 *__init wstrcpy (CHAR16 *d,const CHAR16 *s);static char *__init get_value (const struct file *cfg,const char *section,const char *item); -static void __init split_value (char *s);static CHAR16 *__init s2w (union string *str);static char *__init w2s (const union string *str); -static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,CHAR16 *name, -struct file *file); +static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,struct file *file, +char *name_options);static EFI_BOOT_SERVICES *__initdata efi_bs;static EFI_HANDLE __initdata efi_ih;
@@ -398,18 +397,39 @@ static CHAR16 *__init point_tail(CHAR16 *fn)break ; } } +/* +* Truncate string at first space, and return pointer +* to remainder of string. +*/ +static char *__init truncate_string (char *s) +{ +while ( *s && !isspace (*s) ) + ++s; +if ( *s ) + { + *s =0 ; +return (s +1 ); + } +return (NULL ); +} -static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,CHAR16 *name, -struct file *file) +static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,struct file *file, +char *name_options) {EFI_FILE_HANDLE FileHandle =NULL ;UINT64 size;EFI_STATUS ret;CHAR16 *what =NULL ; +char *options; +union string name; + + options =truncate_string (name_options); -if ( !name ) + name.s=name_options; +s2w (&name); +if ( !name.w )PrintErrMesg (L"No filename" ,EFI_OUT_OF_RESOURCES ); - ret = dir_handle->Open (dir_handle, &FileHandle, name, + ret = dir_handle->Open (dir_handle, &FileHandle, name.w,EFI_FILE_MODE_READ ,0 );if ( file == &cfg && ret ==EFI_NOT_FOUND )return 0 ;
@@ -441,20 +461,18 @@ static bool_t __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name, }else { + file->size = size;if ( file != &cfg ) { -PrintStr (name); +PrintStr (name.w);PrintStr (L": " );DisplayUint (file->addr,2 *sizeof (file->addr));PrintStr (L"-" );DisplayUint (file->addr + size,2 *sizeof (file->addr));PrintStr (newline); - mb_modules[mbi.mods_count].mod_start = file->addr >>PAGE_SHIFT ; - mb_modules[mbi.mods_count].mod_end = size; - ++mbi.mods_count; +efi_arch_handle_module (file, name_options, options); } - file->size = size; ret = FileHandle->Read (FileHandle, &file->size, file->ptr);if ( !EFI_ERROR (ret) && file->size != size ) ret =EFI_ABORTED ;
@@ -469,7 +487,7 @@ static bool_t __init read_file(EFI_FILE_HANDLE dir_handle, CHAR16 *name, {PrintErr (what);PrintErr (L" failed for " ); -PrintErrMesg (name, ret); +PrintErrMesg (name.w, ret); }return 1 ;
@@ -525,7 +543,13 @@ static char *__init get_value(const struct file *cfg, const char *section,break ;default :if ( match &&strncmp (ptr, item, ilen) ==0 && ptr[ilen] =='=' ) -return ptr + ilen +1 ; + { + ptr += ilen +1 ; +/* strip off any leading spaces */ +while ( *ptr &&isspace (*ptr) ) + ptr++; +return ptr; + }break ; } ptr +=strlen (ptr);
@@ -533,16 +557,6 @@ static char *__init get_value(const struct file *cfg, const char *section,return NULL ; } -static void __init split_value (char *s) -{ -while ( *s &&isspace (*s) ) - ++s; -place_string (&mb_modules[mbi.mods_count].string, s); -while ( *s && !isspace (*s) ) - ++s; - *s =0 ; -} - void EFIAPI __init noreturnefi_start (EFI_HANDLE ImageHandle,EFI_SYSTEM_TABLE *SystemTable) {
@@ -552,14 +566,14 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)EFI_LOADED_IMAGE *loaded_image;EFI_STATUS status;unsigned int i, argc; -CHAR16 **argv, *file_name, *cfg_file_name =NULL , *options =NULL ; +CHAR16 **argv, *options =NULL ;UINTN cols, rows, depth, size, info_size;EFI_HANDLE *handles =NULL ;EFI_SHIM_LOCK_PROTOCOL *shim_lock;EFI_GRAPHICS_OUTPUT_PROTOCOL *gop =NULL ;EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info;EFI_FILE_HANDLE dir_handle; -union string section = {NULL }, name; +union string section = {NULL }, name, file_name, cfg_file_name = {NULL };bool_t base_video =0 ;UINT32 mmap_desc_ver =0 ;UINTN mmap_size, mmap_desc_size, mmap_key =0 ;
@@ -590,7 +604,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) trampoline_xen_phys_start = xen_phys_start;/* Get the file system interface. */ - dir_handle =get_parent_handle (loaded_image, &file_name); + dir_handle =get_parent_handle (loaded_image, &file_name.w); argc =get_argv (0 ,NULL , loaded_image->LoadOptions, loaded_image->LoadOptionsSize, &options);
@@ -614,9 +628,9 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)if (wstrcmp (ptr +1 ,L"basevideo" ) ==0 ) base_video =1 ;else if (wstrncmp (ptr +1 ,L"cfg=" ,4 ) ==0 ) - cfg_file_name = ptr +5 ; + cfg_file_name.w = ptr +5 ;else if ( i +1 < argc &&wstrcmp (ptr +1 ,L"cfg" ) ==0 ) - cfg_file_name = argv[++i]; + cfg_file_name.w = argv[++i];else if (wstrcmp (ptr +1 ,L"help" ) ==0 || (ptr[1 ] ==L'?' && !ptr[2 ]) ) {
@@ -684,24 +698,26 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) gop =NULL ;/* Read and parse the config file. */ -if ( !cfg_file_name ) +if ( !cfg_file_name.w ) {CHAR16 *tail; -while ( (tail =point_tail (file_name)) !=NULL ) +while ( (tail =point_tail (file_name.w)) !=NULL ) {wstrcpy (tail,L".cfg" ); -if (read_file (dir_handle, file_name, &cfg) ) +if (read_file (dir_handle, &cfg,w2s (&file_name)) )break ; *tail =0 ; }if ( !tail )blexit (L"No configuration file found." );PrintStr (L"Using configuration file '" ); -PrintStr (file_name); +s2w (&file_name); +PrintStr (file_name.w);PrintStr (L"'\r\n" ); + efi_bs->FreePool (file_name.w); } -else if ( !read_file (dir_handle, cfg_file_name, &cfg) ) +else if ( !read_file (dir_handle, &cfg,w2s (&cfg_file_name)) )blexit (L"Configuration file not found." );pre_parse (&cfg);
@@ -720,7 +736,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)break ; efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); cfg.addr =0 ; -if ( !read_file (dir_handle,s2w (&name), &cfg) ) +if ( !read_file (dir_handle, &cfg, name.s) ) {PrintStr (L"Chained configuration file '" );PrintStr (name.w);
@@ -735,9 +751,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)efi_arch_cfg_file (dir_handle, section.s); -split_value (name.s); -read_file (dir_handle,s2w (&name), &kernel); - efi_bs->FreePool (name.w); +read_file (dir_handle, &kernel, name.s); if ( !EFI_ERROR(efi_bs->LocateProtocol(&shim_lock_guid, NULL, (void **)&shim_lock)) &&
@@ -747,17 +761,13 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) name.s =get_value (&cfg, section.s,"ramdisk" );if ( name.s ) { -split_value (name.s); -read_file (dir_handle,s2w (&name), &ramdisk); - efi_bs->FreePool (name.w); +read_file (dir_handle, &ramdisk, name.s); } name.s =get_value (&cfg, section.s,"xsm" );if ( name.s ) { -split_value (name.s); -read_file (dir_handle,s2w (&name), &xsm); - efi_bs->FreePool (name.w); +read_file (dir_handle, &xsm, name.s); } cols = rows = depth =0 ;
xen/include/asm-x86/efi-boot.h +12 -3
@@ -601,9 +601,7 @@ static void __init efi_arch_cfg_file(EFI_FILE_HANDLE dir_handle, char *section)if ( name.s ) {microcode_set_module (mbi.mods_count); -split_value (name.s); -read_file (dir_handle,s2w (&name), &ucode); - efi_bs->FreePool (name.w); +read_file (dir_handle, &ucode, name.s); } } static void __init efi_arch_handle_cmdline(CHAR16 *image_name,
@@ -972,3 +970,14 @@ static void __init efi_arch_memory(void) l3_bootmap[l3_table_offset (xen_phys_start + (8 <<L2_PAGETABLE_SHIFT ) -1 )] =l3e_from_paddr ((UINTN )l2_bootmap, __PAGE_HYPERVISOR); } + +static void __init efi_arch_handle_module (struct file *file,char *name, +char *options) +{ +place_string (&mb_modules[mbi.mods_count].string, options); +place_string (&mb_modules[mbi.mods_count].string,"" ); +place_string (&mb_modules[mbi.mods_count].string, name); + mb_modules[mbi.mods_count].mod_start = file->addr >>PAGE_SHIFT ; + mb_modules[mbi.mods_count].mod_end = file->size; + ++mbi.mods_count; +}
Signature · 1 line
2.1.0.rc1
PATCH v3 10/15 Add SMBIOS and runtime services setup arch functions.
In reply to Roy FranzAdd architecture specific funtions for setting up SMBIOS and runtime services data structures. These are not fundamentally x86 specific, but ARM currently lacks implementations. These functions may not be needed when ARM SMBIOS and runtime service support is added. Both SMBIOS and EFI runtime service support depend on this EFI boot patch series.
--- xen/common/efi/boot.c | 50 ++++---------------------------------- xen/include/asm-x86/efi-boot.h | 54 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 45 deletions(-)
xen/common/efi/boot.c +5 -45
@@ -55,6 +55,8 @@ static CHAR16 *__init s2w(union string *str);static char *__init w2s (const union string *str);static bool_t __init read_file (EFI_FILE_HANDLE dir_handle,struct file *file,char *name_options); +static bool_t __init __maybe_unused match_guid (const EFI_GUID *guid1, +const EFI_GUID *guid2);static EFI_BOOT_SERVICES *__initdata efi_bs;static EFI_HANDLE __initdata efi_ih;
@@ -170,7 +172,7 @@ static char *__init w2s(const union string *str)return str->s; } -static bool_t __init match_guid (const EFI_GUID *guid1,const EFI_GUID *guid2) +static bool_t __init __maybe_unused match_guid (const EFI_GUID *guid1,const EFI_GUID *guid2) {return guid1->Data1 == guid2->Data1 && guid1->Data2 == guid2->Data2 &&
@@ -581,12 +583,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) efi_ih = ImageHandle; efi_bs = SystemTable->BootServices; - efi_rs = SystemTable->RuntimeServices; - efi_ct = SystemTable->ConfigurationTable; - efi_num_ct = SystemTable->NumberOfTableEntries; - efi_version = SystemTable->Hdr.Revision; - efi_fw_vendor = SystemTable->FirmwareVendor; - efi_fw_revision = SystemTable->FirmwareRevision; StdOut = SystemTable->ConOut; StdErr = SystemTable->StdErr ?: StdOut;
@@ -805,49 +801,13 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) boot_cpu_data.x86_capability[1 ] = cpuid_ext_features; } -/* Obtain basic table pointers. */ -for ( i =0 ; i < efi_num_ct; ++i ) - { -static EFI_GUID __initdata acpi2_guid =ACPI_20_TABLE_GUID ; -static EFI_GUID __initdata acpi_guid =ACPI_TABLE_GUID ; -static EFI_GUID __initdata mps_guid =MPS_TABLE_GUID ; -static EFI_GUID __initdata smbios_guid =SMBIOS_TABLE_GUID ; - -if (match_guid (&acpi2_guid, &efi_ct[i].VendorGuid) ) - efi.acpi20 = (long )efi_ct[i].VendorTable; -if (match_guid (&acpi_guid, &efi_ct[i].VendorGuid) ) - efi.acpi = (long )efi_ct[i].VendorTable; -if (match_guid (&mps_guid, &efi_ct[i].VendorGuid) ) - efi.mps = (long )efi_ct[i].VendorTable; -if (match_guid (&smbios_guid, &efi_ct[i].VendorGuid) ) - efi.smbios = (long )efi_ct[i].VendorTable; - } +efi_arch_runtime_setup (SystemTable); -if (efi.smbios !=EFI_INVALID_TABLE_ADDR ) -dmi_efi_get_table ((void *)(long )efi.smbios); +efi_arch_smbios ();/* Collect PCI ROM contents. */ efi_arch_pci (); -/* Get snapshot of variable store parameters. */ - status = (efi_rs->Hdr.Revision >>16 ) >=2 ? - efi_rs->QueryVariableInfo (EFI_VARIABLE_NON_VOLATILE | -EFI_VARIABLE_BOOTSERVICE_ACCESS | -EFI_VARIABLE_RUNTIME_ACCESS , - &efi_boot_max_var_store_size, - &efi_boot_remain_var_store_size, - &efi_boot_max_var_size) : -EFI_INCOMPATIBLE_VERSION ; -if (EFI_ERROR (status) ) - { - efi_boot_max_var_store_size =0 ; - efi_boot_remain_var_store_size =0 ; - efi_boot_max_var_size = status; -PrintStr (L"Warning: Could not query variable store: " ); -DisplayUint (status,0 ); -PrintStr (newline); - } -efi_arch_memory ();efi_arch_video (base_video, cols, rows, depth, gop);
xen/include/asm-x86/efi-boot.h +54 -0
57 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 11/15 Add several misc. arch functions for EFI boot code.
In reply to Roy FranzAdd efi_arch_blexit() for arch specific cleanup on error exit, efi_arch_load_addr_check() to do the arch specific verifications of where the UEFI firmware loaded XEN, and efi_arch_cpu() for probing CPU features.
--- xen/common/efi/boot.c | 18 ++++-------------- xen/include/asm-x86/efi-boot.h | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 14 deletions(-)
xen/common/efi/boot.c +4 -14
@@ -192,11 +192,11 @@ static void __init noreturn blexit(const CHAR16 *str) efi_bs->FreePages (kernel.addr,PFN_UP (kernel.size));if ( ramdisk.addr ) efi_bs->FreePages (ramdisk.addr,PFN_UP (ramdisk.size)); -if ( ucode.addr ) - efi_bs->FreePages (ucode.addr,PFN_UP (ucode.size));if ( xsm.addr ) efi_bs->FreePages (xsm.addr,PFN_UP (xsm.size)); +efi_arch_blexit (); + efi_bs->Exit (efi_ih,EFI_SUCCESS ,0 ,NULL );unreachable ();/* not reached */ }
@@ -592,12 +592,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)if ( status !=EFI_SUCCESS )PrintErrMesg (L"No Loaded Image Protocol" , status); - xen_phys_start = (UINTN )loaded_image->ImageBase; -if ( (xen_phys_start + loaded_image->ImageSize -1 ) >>32 ) -blexit (L"Xen must be loaded below 4Gb." ); -if ( xen_phys_start & ((1 <<L2_PAGETABLE_SHIFT ) -1 ) ) -blexit (L"Xen must be loaded at a 2Mb boundary." ); - trampoline_xen_phys_start = xen_phys_start; +efi_arch_load_addr_check (loaded_image);/* Get the file system interface. */ dir_handle =get_parent_handle (loaded_image, &file_name.w);
@@ -794,12 +789,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)efi_arch_edd ();/* XXX Collect EDID info. */ - -if (cpuid_eax (0x80000000 ) >0x80000000 ) - { - cpuid_ext_features =cpuid_edx (0x80000001 ); - boot_cpu_data.x86_capability[1 ] = cpuid_ext_features; - } +efi_arch_cpu ();efi_arch_runtime_setup (SystemTable);
xen/include/asm-x86/efi-boot.h +23 -0
@@ -982,6 +982,14 @@ static void __init efi_arch_handle_module(struct file *file, char *name, ++mbi.mods_count; } +static void __init efi_arch_cpu (void ) +{ +if (cpuid_eax (0x80000000 ) >0x80000000 ) + { + cpuid_ext_features =cpuid_edx (0x80000001 ); + boot_cpu_data.x86_capability[1 ] = cpuid_ext_features; + } +}static void __init efi_arch_smbios (void ) {if (efi.smbios !=EFI_INVALID_TABLE_ADDR )
@@ -1035,3 +1043,18 @@ static void __init efi_arch_runtime_setup(EFI_SYSTEM_TABLE *SystemTable)PrintStr (newline); } } +static void __init efi_arch_blexit (void ) +{ +if ( ucode.addr ) + efi_bs->FreePages (ucode.addr,PFN_UP (ucode.size)); +} + +static void __init efi_arch_load_addr_check (EFI_LOADED_IMAGE *loaded_image) +{ + xen_phys_start = (UINTN )loaded_image->ImageBase; +if ( (xen_phys_start + loaded_image->ImageSize -1 ) >>32 ) +blexit (L"Xen must be loaded below 4Gb." ); +if ( xen_phys_start & ((1 <<L2_PAGETABLE_SHIFT ) -1 ) ) +blexit (L"Xen must be loaded at a 2Mb boundary." ); + trampoline_xen_phys_start = xen_phys_start; +}
Signature · 1 line
2.1.0.rc1
PATCH v3 12/15 Add efi_arch_use_config_file() function to control use of config file
In reply to Roy FranzThe x86 EFI build of XEN always uses a configuration file to load modules, but the ARM version can either use a config file to specify the modules, or be loaded by GRUB in which case GRUB loads the modules and adds them to the DTB that is passed to XEN. Add the efi_arch_use_config_file() to indicate if a configuration file is required. For x86, this will always be true. ARM will examine the DTB passed via EFI configuration table (if any), and if it contains module information will use that that not use the configuration file at all.
--- xen/common/efi/boot.c | 169 +++++++++++++++++++++-------------------- xen/include/asm-x86/efi-boot.h | 4 + 2 files changed, 90 insertions(+), 83 deletions(-)
xen/common/efi/boot.c +86 -83
@@ -574,8 +574,7 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)EFI_SHIM_LOCK_PROTOCOL *shim_lock;EFI_GRAPHICS_OUTPUT_PROTOCOL *gop =NULL ;EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *mode_info; -EFI_FILE_HANDLE dir_handle; -union string section = {NULL }, name, file_name, cfg_file_name = {NULL }; +union string section = {NULL }, name = {NULL }, file_name, cfg_file_name = {NULL };bool_t base_video =0 ;UINT32 mmap_desc_ver =0 ;UINTN mmap_size, mmap_desc_size, mmap_key =0 ;
@@ -594,9 +593,6 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)efi_arch_load_addr_check (loaded_image); -/* Get the file system interface. */ - dir_handle =get_parent_handle (loaded_image, &file_name.w); - argc =get_argv (0 ,NULL , loaded_image->LoadOptions, loaded_image->LoadOptionsSize, &options); if ( argc > 0 &&
@@ -688,104 +684,111 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable)if (EFI_ERROR (status) ) gop =NULL ; -/* Read and parse the config file. */ -if ( !cfg_file_name.w ) +if (efi_arch_use_config_file (SystemTable) ) { -CHAR16 *tail; +EFI_FILE_HANDLE dir_handle; -while ( (tail =point_tail (file_name.w)) !=NULL ) +/* Get the file system interface. */ + dir_handle =get_parent_handle (loaded_image, &file_name.w); +/* Read and parse the config file. */ +if ( !cfg_file_name.w ) { -wstrcpy (tail,L".cfg" ); -if (read_file (dir_handle, &cfg,w2s (&file_name)) ) -break ; - *tail =0 ; +CHAR16 *tail; + +while ( (tail =point_tail (file_name.w)) !=NULL ) + { +wstrcpy (tail,L".cfg" ); +if (read_file (dir_handle, &cfg,w2s (&file_name)) ) +break ; + *tail =0 ; + } +if ( !tail ) +blexit (L"No configuration file found." ); +PrintStr (L"Using configuration file '" ); +s2w (&file_name); +PrintStr (file_name.w); +PrintStr (L"'\r\n" ); + efi_bs->FreePool (file_name.w); } -if ( !tail ) -blexit (L"No configuration file found." ); -PrintStr (L"Using configuration file '" ); -s2w (&file_name); -PrintStr (file_name.w); -PrintStr (L"'\r\n" ); - efi_bs->FreePool (file_name.w); - } -else if ( !read_file (dir_handle, &cfg,w2s (&cfg_file_name)) ) -blexit (L"Configuration file not found." ); -pre_parse (&cfg); +else if ( !read_file (dir_handle, &cfg,w2s (&cfg_file_name)) ) +blexit (L"Configuration file not found." ); +pre_parse (&cfg); -if ( section.w ) -w2s (§ion); -else - section.s =get_value (&cfg,"global" ,"default" ); +if ( section.w ) +w2s (§ion); +else + section.s =get_value (&cfg,"global" ,"default" ); -for ( ; ; ) - { - name.s =get_value (&cfg, section.s,"kernel" ); -if ( name.s ) -break ; - name.s =get_value (&cfg,"global" ,"chain" ); -if ( !name.s ) -break ; - efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); - cfg.addr =0 ; -if ( !read_file (dir_handle, &cfg, name.s) ) +for ( ; ; ) { -PrintStr (L"Chained configuration file '" ); -PrintStr (name.w); + name.s =get_value (&cfg, section.s,"kernel" ); +if ( name.s ) +break ; + name.s =get_value (&cfg,"global" ,"chain" ); +if ( !name.s ) +break ; + efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); + cfg.addr =0 ; +if ( !read_file (dir_handle, &cfg, name.s) ) + { +PrintStr (L"Chained configuration file '" ); +PrintStr (name.w); + efi_bs->FreePool (name.w); +blexit (L"'not found." ); + } +pre_parse (&cfg); efi_bs->FreePool (name.w); -blexit (L"'not found." ); } -pre_parse (&cfg); - efi_bs->FreePool (name.w); - } -if ( !name.s ) -blexit (L"No Dom0 kernel image specified." ); - -efi_arch_cfg_file (dir_handle, section.s); +if ( !name.s ) +blexit (L"No Dom0 kernel image specified." ); -read_file (dir_handle, &kernel, name.s); +efi_arch_cfg_file (dir_handle, section.s); -if ( !EFI_ERROR (efi_bs->LocateProtocol (&shim_lock_guid,NULL , - (void **)&shim_lock)) && - (status = shim_lock->Verify (kernel.ptr, kernel.size)) !=EFI_SUCCESS ) +read_file (dir_handle, &kernel, name.s); +if ( !EFI_ERROR (efi_bs->LocateProtocol (&shim_lock_guid,NULL , + (void **)&shim_lock)) && + (status = shim_lock->Verify (kernel.ptr, kernel.size)) !=EFI_SUCCESS )PrintErrMesg (L"Dom0 kernel image could not be verified" , status); - name.s =get_value (&cfg, section.s,"ramdisk" ); -if ( name.s ) - { -read_file (dir_handle, &ramdisk, name.s); - } + name.s =get_value (&cfg, section.s,"ramdisk" ); +if ( name.s ) + { +read_file (dir_handle, &ramdisk, name.s); + } - name.s =get_value (&cfg, section.s,"xsm" ); -if ( name.s ) - { -read_file (dir_handle, &xsm, name.s); - } + name.s =get_value (&cfg, section.s,"xsm" ); +if ( name.s ) + { +read_file (dir_handle, &xsm, name.s); + } - cols = rows = depth =0 ; -if ( !base_video ) - { - name.cs =get_value (&cfg, section.s,"video" ); -if ( !name.cs ) - name.cs =get_value (&cfg,"global" ,"video" ); -if ( name.cs && !strncmp (name.cs,"gfx-" ,4 ) ) + cols = rows = depth =0 ; +if ( !base_video ) { - cols =simple_strtoul (name.cs +4 , &name.cs,10 ); -if ( *name.cs =='x' ) - rows =simple_strtoul (name.cs +1 , &name.cs,10 ); -if ( *name.cs =='x' ) - depth =simple_strtoul (name.cs +1 , &name.cs,10 ); -if ( *name.cs ) - cols = rows = depth =0 ; + name.cs =get_value (&cfg, section.s,"video" ); +if ( !name.cs ) + name.cs =get_value (&cfg,"global" ,"video" ); +if ( name.cs && !strncmp (name.cs,"gfx-" ,4 ) ) + { + cols =simple_strtoul (name.cs +4 , &name.cs,10 ); +if ( *name.cs =='x' ) + rows =simple_strtoul (name.cs +1 , &name.cs,10 ); +if ( *name.cs =='x' ) + depth =simple_strtoul (name.cs +1 , &name.cs,10 ); +if ( *name.cs ) + cols = rows = depth =0 ; + } } - } + name.s =get_value (&cfg, section.s,"options" ); - name.s =get_value (&cfg, section.s,"options" ); -efi_arch_handle_cmdline (argc ? *argv :NULL , options, name.s); + efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); + cfg.addr =0 ; - efi_bs->FreePages (cfg.addr,PFN_UP (cfg.size)); - cfg.addr =0 ; + dir_handle->Close (dir_handle); + +efi_arch_handle_cmdline (argc ? *argv :NULL , options, name.s); + } - dir_handle->Close (dir_handle);efi_arch_edd ();/* XXX Collect EDID info. */
xen/include/asm-x86/efi-boot.h +4 -0
@@ -1058,3 +1058,7 @@ static void __init efi_arch_load_addr_check(EFI_LOADED_IMAGE *loaded_image)blexit (L"Xen must be loaded at a 2Mb boundary." ); trampoline_xen_phys_start = xen_phys_start; } +static __init bool_t efi_arch_use_config_file (EFI_SYSTEM_TABLE *SystemTable) +{ +return 1 ;/* x86 always uses a config file */ +}
Signature · 1 line
2.1.0.rc1
PATCH v3 13/15 add arm64 cache flushing code from linux v3.16
In reply to Roy Franz__flush_dcache_all added from arch/arm64/mm/cache.S, with helper macros from arch/arm64/include/asm/assembler.h, from v3.16. The cache flushing is required when transitioning from EFI code that runs with cache enable to XEN startup code which expects the cache to be disabled.
--- xen/arch/arm/arm64/Makefile | 1 + xen/arch/arm/arm64/cache.S | 100 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 xen/arch/arm/arm64/cache.S
xen/arch/arm/arm64/Makefile +1 -0
@@ -7,5 +7,6 @@ obj-y += domain.o obj-y += vfp.o obj-y += smpboot.o obj-y += domctl.o +obj-y += cache.o obj-$(EARLY_PRINTK) += debug.o
xen/arch/arm/arm64/cache.S new file +100 -0
100 lines not on this page · raw message
Signature · 1 line
2.1.0.rc1
PATCH v3 14/15 Update libfdt to v1.4.0
In reply to Roy FranzUpdate libfdt to v1.4.0 of libfdt taken from git://git.jdl.com/software/dtc.git
XEN changes to libfdt_env.h carried over from existing libfdt (v1.3.0) This update provides the fdt_create_empty_tree() function used by the ARM EFI boot code.
--- xen/common/libfdt/Makefile.libfdt | 4 +- xen/common/libfdt/fdt.c | 30 +++- xen/common/libfdt/fdt_empty_tree.c | 84 ++++++++++ xen/common/libfdt/fdt_ro.c | 7 +- xen/common/libfdt/fdt_rw.c | 31 +++- xen/common/libfdt/fdt_sw.c | 4 +- xen/common/libfdt/fdt_wip.c | 2 +- xen/common/libfdt/version.lds | 6 + xen/include/xen/libfdt/fdt.h | 93 ++++++++--- xen/include/xen/libfdt/libfdt.h | 315 +++++++++++++++++++++++++++++++++--- xen/include/xen/libfdt/libfdt_env.h | 4 + 11 files changed, 529 insertions(+), 51 deletions(-) create mode 100644 xen/common/libfdt/fdt_empty_tree.c
xen/common/libfdt/Makefile.libfdt +2 -2
@@ -4,7 +4,7 @@ # be easily embeddable into other systems of Makefiles. # LIBFDT_soname = libfdt.$(SHAREDLIB_EXT).1 -LIBFDT_INCLUDES = fdt.h libfdt.h +LIBFDT_INCLUDES = fdt.h libfdt.h libfdt_env.h LIBFDT_VERSION = version.lds -LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c +LIBFDT_SRCS = fdt.c fdt_ro.c fdt_wip.c fdt_sw.c fdt_rw.c fdt_strerror.c fdt_empty_tree.c LIBFDT_OBJS = $(LIBFDT_SRCS:%.c=%.o)
xen/common/libfdt/fdt.c +29 -1
@@ -92,7 +92,7 @@ const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int len)uint32_t fdt_next_tag (const void *fdt,int startoffset,int *nextoffset) { -const uint32_t *tagp, *lenp; +const fdt32_t *tagp, *lenp;uint32_t tag;int offset = startoffset;const char *p;
@@ -198,6 +198,34 @@ int fdt_next_node(const void *fdt, int offset, int *depth)return offset; } +int fdt_first_subnode (const void *fdt,int offset) +{ +int depth =0 ; + + offset =fdt_next_node (fdt, offset, &depth); +if (offset <0 || depth !=1 ) +return -FDT_ERR_NOTFOUND ; + +return offset; +} + +int fdt_next_subnode (const void *fdt,int offset) +{ +int depth =1 ; + +/* +* With respect to the parent, the depth of the next subnode will be +* the same as the last. +*/ +do { + offset =fdt_next_node (fdt, offset, &depth); +if (offset <0 || depth <1 ) +return -FDT_ERR_NOTFOUND ; + }while (depth >1 ); + +return offset; +} +const char *_fdt_find_string (const char *strtab,int tabsize,const char *s) {int len =strlen (s) +1 ;
xen/common/libfdt/fdt_empty_tree.c new file +84 -0
84 lines not on this page · raw message
xen/common/libfdt/fdt_ro.c +3 -4
@@ -322,7 +322,7 @@ const void *fdt_getprop(const void *fdt, int nodeoffset,uint32_t fdt_get_phandle (const void *fdt,int nodeoffset) { -const uint32_t *php; +const fdt32_t *php;int len;/* FIXME: This is a bit sub-optimal, since we potentially scan
@@ -515,8 +515,7 @@ int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle)return offset;/* error from fdt_next_node() */ } -static int _fdt_stringlist_contains (const char *strlist,int listlen, -const char *str) +int fdt_stringlist_contains (const char *strlist,int listlen,const char *str) {int len =strlen (str);const char *p;
@@ -542,7 +541,7 @@ int fdt_node_check_compatible(const void *fdt, int nodeoffset, prop =fdt_getprop (fdt, nodeoffset,"compatible" , &len);if (!prop)return len; -if (_fdt_stringlist_contains (prop, len, compatible)) +if (fdt_stringlist_contains (prop, len, compatible))return 0 ;else return 1 ;
xen/common/libfdt/fdt_rw.c +29 -2
@@ -289,6 +289,33 @@ int fdt_setprop(void *fdt, int nodeoffset, const char *name,return 0 ; } +int fdt_appendprop (void *fdt,int nodeoffset,const char *name, +const void *val,int len) +{ +struct fdt_property *prop; +int err, oldlen, newlen; + +FDT_RW_CHECK_HEADER (fdt); + + prop =fdt_get_property_w (fdt, nodeoffset, name, &oldlen); +if (prop) { + newlen = len + oldlen; + err =_fdt_splice_struct (fdt, prop->data, +FDT_TAGALIGN (oldlen), +FDT_TAGALIGN (newlen)); +if (err) +return err; + prop->len =cpu_to_fdt32 (newlen); +memcpy (prop->data + oldlen, val, len); + }else { + err =_fdt_add_property (fdt, nodeoffset, name, len, &prop); +if (err) +return err; +memcpy (prop->data, val, len); + } +return 0 ; +} +int fdt_delprop (void *fdt,int nodeoffset,const char *name) {struct fdt_property *prop;
@@ -312,7 +339,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset,int nodelen;int err;uint32_t tag; -uint32_t *endtag; +fdt32_t *endtag;FDT_RW_CHECK_HEADER (fdt);
@@ -339,7 +366,7 @@ int fdt_add_subnode_namelen(void *fdt, int parentoffset, nh->tag =cpu_to_fdt32 (FDT_BEGIN_NODE );memset (nh->name,0 ,FDT_TAGALIGN (namelen+1 ));memcpy (nh->name, name, namelen); - endtag = (uint32_t *)((char *)nh + nodelen -FDT_TAGSIZE ); + endtag = (fdt32_t *)((char *)nh + nodelen -FDT_TAGSIZE ); *endtag =cpu_to_fdt32 (FDT_END_NODE );return offset;
xen/common/libfdt/fdt_sw.c +2 -2
@@ -153,7 +153,7 @@ int fdt_begin_node(void *fdt, const char *name)int fdt_end_node (void *fdt) { -uint32_t *en; +fdt32_t *en;FDT_SW_CHECK_HEADER (fdt);
@@ -213,7 +213,7 @@ int fdt_property(void *fdt, const char *name, const void *val, int len)int fdt_finish (void *fdt) {char *p = (char *)fdt; -uint32_t *end; +fdt32_t *end;int oldstroffset, newstroffset;uint32_t tag;int offset, nextoffset;
xen/common/libfdt/fdt_wip.c +1 -1
@@ -74,7 +74,7 @@ int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,static void _fdt_nop_region (void *start,int len) { -uint32_t *p; +fdt32_t *p;for (p = start; (char *)p < ((char *)start + len); p++) *p =cpu_to_fdt32 (FDT_NOP );
xen/common/libfdt/version.lds +6 -0
@@ -48,6 +48,12 @@ LIBFDT_1.2 { fdt_strerror; fdt_offset_ptr; fdt_next_tag; + fdt_appendprop; + fdt_create_empty_tree; + fdt_first_property_offset; + fdt_get_property_by_offset; + fdt_getprop_by_offset; + fdt_next_property_offset; local: *;
xen/include/xen/libfdt/fdt.h +72 -21
130 lines not on this page · raw message
xen/include/xen/libfdt/libfdt.h +297 -18
398 lines not on this page · raw message
xen/include/xen/libfdt/libfdt_env.h +4 -0
@@ -6,6 +6,10 @@#include <xen/string.h> #include <asm/byteorder.h> +typedef uint16_t fdt16_t ; +typedef uint32_t fdt32_t ; +typedef uint64_t fdt64_t ; +#define fdt16_to_cpu (x) be16_to_cpu(x)#define cpu_to_fdt16 (x) cpu_to_be16(x)#define fdt32_to_cpu (x) be32_to_cpu(x)
Signature · 1 line
2.1.0.rc1
PATCH v3 15/15 Add ARM EFI boot support
In reply to Roy FranzThis patch adds EFI boot support for ARM based on the previous refactoring of the x86 EFI boot code. All ARM specific code is in the ARM efi-boot.h header file, with the main EFI entry point common/efi/boot.c. The PE/COFF header is open-coded in head.S, which allows us to have a single binary be both an EFI executable and a normal arm64 IMAGE file. There is currently no PE/COFF toolchain support for arm64, so it is not possible to create the PE/COFF header in the same manner as on x86. This also simplifies the build as compared to x86, as we always build the same executable, whereas x86 builds 2. An ARM version of efi-bind.h is added, which is based on the x86_64 version with the x86 specific portions removed. The Makefile in common/efi is different for x86 and ARM, as for ARM we always build in EFI support.
--- xen/arch/arm/arm64/head.S | 145 ++++++++- xen/arch/arm/xen.lds.S | 1 + xen/common/efi/Makefile | 5 +- xen/include/asm-arm/arm64/efibind.h | 216 +++++++++++++ xen/include/asm-arm/efi-boot.h | 602 ++++++++++++++++++++++++++++++++++++ xen/include/asm-arm/efi.h | 29 ++ xen/include/asm-arm/efibind.h | 2 + xen/include/asm-arm/setup.h | 2 +- 8 files changed, 997 insertions(+), 5 deletions(-) create mode 100644 xen/include/asm-arm/arm64/efibind.h create mode 100644 xen/include/asm-arm/efi-boot.h create mode 100644 xen/include/asm-arm/efi.h create mode 100644 xen/include/asm-arm/efibind.h
xen/arch/arm/arm64/head.S +142 -3
@@ -24,6 +24,8 @@ #include <asm/page.h> #include <asm/asm_defns.h> #include <asm/early_printk.h> +#include <efi/efierr.h> +#include <asm/arm64/efibind.h> #define PT_PT 0xf7f /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=1 P=1 */ #define PT_MEM 0xf7d /* nG=1 AF=1 SH=11 AP=01 NS=1 ATTR=111 T=0 P=1 */
@@ -104,8 +106,14 @@ GLOBAL(start) /* * DO NOT MODIFY. Image header expected by Linux boot-loaders. */ - b real_start /* branch to kernel start, magic */ - .long 0 /* reserved */ +efi_head: + /* + * This add instruction has no meaningful effect except that + * its opcode forms the magic "MZ" signature of a PE/COFF file + * that is required for UEFI applications. + */ + add x13, x18, #0x16 + b real_start /* branch to kernel start */ .quad 0 /* Image load offset from start of RAM */ .quad 0 /* reserved */ .quad 0 /* reserved */
@@ -116,8 +124,113 @@ GLOBAL(start) .byte 0x52 .byte 0x4d .byte 0x64 - .word 0 /* reserved */ + .long pe_header - efi_head /* Offset to the PE header. */ + /* + * Add the PE/COFF header to the file. The address of this header + * is at offset 0x3c in the file, and is part of Linux "Image" + * header. The arm64 Linux Image format is designed to support + * being both an 'Image' format binary and a PE/COFF binary. + * The PE/COFF format is defined by Microsoft, and is available + * from: http://msdn.microsoft.com/en-us/gg463119.aspx + * Version 8.3 adds support for arm64 and UEFI usage. + */ + + .align 3 +pe_header: + .ascii "PE" + .short 0 +coff_header: + .short 0xaa64 /* AArch64 */ + .short 2 /* nr_sections */ + .long 0 /* TimeDateStamp */ + .long 0 /* PointerToSymbolTable */ + .long 1 /* NumberOfSymbols */ + .short section_table - optional_header /* SizeOfOptionalHeader */ + .short 0x206 /* Characteristics. */ + /* IMAGE_FILE_DEBUG_STRIPPED | */ + /* IMAGE_FILE_EXECUTABLE_IMAGE | */ + /* IMAGE_FILE_LINE_NUMS_STRIPPED */ +optional_header: + .short 0x20b /* PE32+ format */ + .byte 0x02 /* MajorLinkerVersion */ + .byte 0x14 /* MinorLinkerVersion */ + .long _end - real_start /* SizeOfCode */ + .long 0 /* SizeOfInitializedData */ + .long 0 /* SizeOfUninitializedData */ + .long efi_start - efi_head /* AddressOfEntryPoint */ + .long real_start - efi_head /* BaseOfCode */ + +extra_header_fields: + .quad 0 /* ImageBase */ + .long 0x200000 /* SectionAlignment (2MByte) */ + .long 0x8 /* FileAlignment */ + .short 0 /* MajorOperatingSystemVersion */ + .short 0 /* MinorOperatingSystemVersion */ + .short 0 /* MajorImageVersion */ + .short 0 /* MinorImageVersion */ + .short 0 /* MajorSubsystemVersion */ + .short 0 /* MinorSubsystemVersion */ + .long 0 /* Win32VersionValue */ + + .long _end - efi_head /* SizeOfImage */ + + /* Everything before the kernel image is considered part of the header */ + .long real_start - efi_head /* SizeOfHeaders */ + .long 0 /* CheckSum */ + .short 0xa /* Subsystem (EFI application) */ + .short 0 /* DllCharacteristics */ + .quad 0 /* SizeOfStackReserve */ + .quad 0 /* SizeOfStackCommit */ + .quad 0 /* SizeOfHeapReserve */ + .quad 0 /* SizeOfHeapCommit */ + .long 0 /* LoaderFlags */ + .long 0x6 /* NumberOfRvaAndSizes */ + + .quad 0 /* ExportTable */ + .quad 0 /* ImportTable */ + .quad 0 /* ResourceTable */ + .quad 0 /* ExceptionTable */ + .quad 0 /* CertificationTable */ + .quad 0 /* BaseRelocationTable */ + + /* Section table */ +section_table: + + /* + * The EFI application loader requires a relocation section + * because EFI applications must be relocatable. This is a + * dummy section as far as we are concerned. + */ + .ascii ".reloc" + .byte 0 + .byte 0 /* end of 0 padding of section name */ + .long 0 + .long 0 + .long 0 /* SizeOfRawData */ + .long 0 /* PointerToRawData */ + .long 0 /* PointerToRelocations */ + .long 0 /* PointerToLineNumbers */ + .short 0 /* NumberOfRelocations */ + .short 0 /* NumberOfLineNumbers */ + .long 0x42100040 /* Characteristics (section flags) */ + + + .ascii ".text" + .byte 0 + .byte 0 + .byte 0 /* end of 0 padding of section name */ + .long _end - real_start /* VirtualSize */ + .long real_start - efi_head /* VirtualAddress */ + .long __init_end_efi - real_start /* SizeOfRawData */ + .long real_start - efi_head /* PointerToRawData */ + + .long 0 /* PointerToRelocations (0 for executables) */ + .long 0 /* PointerToLineNumbers (0 for executables) */ + .short 0 /* NumberOfRelocations (0 for executables) */ + .short 0 /* NumberOfLineNumbers (0 for executables) */ + .long 0xe0500020 /* Characteristics (section flags) */ + .align 5 real_start: msr DAIFSet, 0xf /* Disable all interrupts */
@@ -618,6 +731,32 @@ ENTRY(lookup_processor_type) mov x0, #0 ret +ENTRY(efi_xen_start) + /* + * Turn off cache and MMU as XEN expects. EFI enables them, but also + * mandates a 1:1 (unity) VA->PA mapping, so we can turn off the + * MMU while executing EFI code before entering XEN. + * The EFI loader calls this to start XEN. + */ + mov x20, x0 + bl __flush_dcache_all + ic ialluis + + /* Turn off Dcache and MMU */ + mrs x0, sctlr_el2 + bic x0, x0, #1 << 0 /* clear SCTLR.M */ + bic x0, x0, #1 << 2 /* clear SCTLR.C */ + msr sctlr_el2, x0 + isb + + /* Jump to XEN entry point */ + mov x0, x20 + mov x1, xzr + mov x2, xzr + mov x3, xzr + b real_start +ENDPROC(efi_xen_start) + /* * Local variables: * mode: ASM
xen/arch/arm/xen.lds.S +1 -0
@@ -135,6 +135,7 @@ SECTIONS *(.xsm_initcall.init) __xsm_initcall_end = .; } :text + __init_end_efi = .; . = ALIGN(STACK_SIZE); __init_end = .;
xen/common/efi/Makefile +4 -1
@@ -1,5 +1,5 @@ CFLAGS += -fshort-wchar - +ifneq ($(XEN_TARGET_ARCH),arm64) obj-y += dummy.o create = test -e $(1) || touch -t 199901010000 $(1)
@@ -12,3 +12,6 @@ efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(c extra-$(efi) += boot.init.o dummy.o: boot.init.o $(extra-y) +else +obj-y += boot.init.o +endif
xen/include/asm-arm/arm64/efibind.h new file +216 -0
216 lines not on this page · raw message
xen/include/asm-arm/efi-boot.h new file +602 -0
602 lines not on this page · raw message
xen/include/asm-arm/efi.h new file +29 -0
@@ -0,0 +1,29 @@ +#include <asm/efibind.h> +#include <efi/efidef.h> +#include <efi/efierr.h> +#include <efi/eficon.h> +#include <efi/efidevp.h> +#include <efi/eficapsule.h> +#include <efi/efiapi.h> +#include <xen/efi.h> +#include <xen/spinlock.h> +#include <asm/page.h> + +extern unsigned int efi_num_ct; +extern EFI_CONFIGURATION_TABLE *efi_ct; + +extern unsigned int efi_version, efi_fw_revision; +extern const CHAR16 *efi_fw_vendor; + +extern EFI_RUNTIME_SERVICES *efi_rs; + +extern UINTN efi_memmap_size, efi_mdesc_size; +extern void *efi_memmap; + +extern const struct efi_pci_rom *efi_pci_roms; + +extern UINT64 efi_boot_max_var_store_size, efi_boot_remain_var_store_size, + efi_boot_max_var_size; + +unsigned long efi_rs_enter (void ); +void efi_rs_leave (unsigned long );
xen/include/asm-arm/efibind.h new file +2 -0
@@ -0,0 +1,2 @@ +#include <xen/types.h> +#include <asm/arm64/efibind.h>
xen/include/asm-arm/setup.h +1 -1
@@ -3,7 +3,7 @@#include <public/version.h> -#define NR_MEM_BANKS 8 +#define NR_MEM_BANKS 32#define MAX_MODULES 5/* Current maximum useful modules */
Signature · 1 line
2.1.0.rc1
Re: [PATCH V3 01/15] move x86 EFI boot code to common/efi
In reply to Roy FranzQuoted 2 lines · Roy Franz
This moves the boot.c,the file that implements the EFI entry point to efi/common, and builds with both EFI/non-EFI toolchains.
I'm not that familiar with the existing EFI stuff so maybe this is a dump question, but do you mean that it *can* now be built with either EFI or non-EFI, not that it *is* multiply compiled in a given build?
Quoted 2 lines
No code
changes, just file movement and make updates.
For next time could you please pass -M to git send-email/format-patch so that handles moves more efficiently and shows only the actual changes.
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 80
Quoted 11 lines
xen/arch/x86/Makefile +3
-0@@ -75,6 +75,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +# This seems to be required to get parallel builds to work, otherwise prelink-efi.o complains about +# no rule to make boot.init.o
I suppose we must recurse into common and arch at the same time.
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 81
Quoted 1 line
xen/arch/x86/Makefile +1
-0+# Not sure what the right fix is
Me neither. This doesn't look right to me though, given that xen/common/efi is also entered via a subdir-y in xen/common/Makefile.
Perhaps Jan has some ideas but I'm wondering if we ought not to recurse into xen/common/efi from here and not from xen/common, or at least to not include extra-$(efi) += boot.init.o in xen/common/efi/Makefile (that would also let the x86 specific checkng code stay here, might it?)
symbols-dummy.o has a similar hack, but notice that it is not build from xen/common/Makefile.
Anyway, I'm flailing, perhaps Jan can suggest the correct fix.
Quoted 48 lines
xen/arch/x86/Makefile +7
-4+$(BASEDIR)/common/efi/boot.init.o: $(BASEDIR)/common/efi/boot.c + $(MAKE) -f $(BASEDIR)/Rules.mk -C $(BASEDIR)/common/efi/ boot.init.o + ifeq ($(lto),y) # Gather all LTO objects together prelink_lto.o: $(ALL_OBJS)@@ -87,13 +94,13 @@ prelink-efi_lto.o: $(ALL_OBJS) efi/runtime.o efi/compat.o prelink.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink_lto.o $(LD) $(LDFLAGS) -r -o $@ $^ -prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o efi/boot.init.o +prelink-efi.o: $(patsubst %/built_in.o,%/built_in_bin.o,$(ALL_OBJS)) prelink-efi_lto.o $(BASEDIR)/common/efi/boot.init.o $(guard) $(LD) $(LDFLAGS) -r -o $@ $^ else prelink.o: $(ALL_OBJS) $(LD) $(LDFLAGS) -r -o $@ $^ -prelink-efi.o: $(ALL_OBJS) efi/boot.init.o efi/runtime.o efi/compat.o +prelink-efi.o: $(ALL_OBJS) $(BASEDIR)/common/efi/boot.init.o efi/runtime.o efi/compat.o $(guard) $(LD) $(LDFLAGS) -r -o $@ $(filter-out %/efi/built_in.o,$^) endif@@ -143,8 +150,8 @@ $(TARGET).efi: prelink-efi.o efi.lds efi/relocs-dummy.o $(BASEDIR)/common/symbol if $(guard) false; then rm -f $@; echo 'EFI support disabled'; fi rm -f $(@D)/.$(@F).[0-9]* -efi/boot.init.o efi/runtime.o efi/compat.o: $(BASEDIR)/arch/x86/efi/built_in.o -efi/boot.init.o efi/runtime.o efi/compat.o: ; +efi/runtime.o efi/compat.o: $(BASEDIR)/arch/x86/efi/built_in.o +efi/runtime.o efi/compat.o: ; asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(CC) $(filter-out -flto,$(CFLAGS)) -S -o $@ $<xen/arch/x86/efi/Makefile +2
-2@@ -7,8 +7,8 @@ create = test -e $(1) || touch -t 199901010000 $(1) efi := $(filter y,$(x86_64)$(shell rm -f disabled)) efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y)) efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y)) -efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o))) +efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,runtime.o))) -extra-$(efi) += boot.init.o relocs-dummy.o runtime.o compat.o +extra-$(efi) += relocs-dummy.o runtime.o compat.o stub.o: $(extra-y)
[...]
Quoted 30 lines
xen/common/Makefile +1
-0@@ -67,4 +67,5 @@ subdir-$(x86_64) += hvm subdir-$(coverage) += gcov subdir-y += libelf +subdir-y += efi subdir-$(HAS_DEVICE_TREE) += libfdtxen/common/efi/Makefile new file +14
-0@@ -0,0 +1,14 @@ +CFLAGS += -fshort-wchar + +obj-y += dummy.o + +create = test -e $(1) || touch -t 199901010000 $(1) + +efi := $(filter y,$(x86_64)$(shell rm -f disabled)) +efi := $(if $(efi),$(shell $(CC) $(filter-out $(CFLAGS-y) .%.d,$(CFLAGS)) -c check.c 2>disabled && echo y)) +efi := $(if $(efi),$(shell $(LD) -mi386pep --subsystem=10 -o check.efi check.o 2>disabled && echo y)) +efi := $(if $(efi),$(shell rm disabled)y,$(shell $(call create,boot.init.o); $(call create,runtime.o))) + +extra-$(efi) += boot.init.o + +dummy.o: boot.init.o $(extra-y)
Re: [PATCH V3 01/15] move x86 EFI boot code to common/efi
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 08.09.14 at 17:23, <[email protected]> wrote:
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 80
Quoted 9 lines · Roy Franz
xen/arch/x86/Makefile +3
-0@@ -75,6 +75,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +# This seems to be required to get parallel builds to work, otherwise prelink-efi.o complains about +# no rule to make boot.init.oI suppose we must recurse into common and arch at the same time.
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 81
Quoted 1 line
xen/arch/x86/Makefile +1
-0+# Not sure what the right fix isMe neither. This doesn't look right to me though, given that xen/common/efi is also entered via a subdir-y in xen/common/Makefile.
Perhaps Jan has some ideas but I'm wondering if we ought not to recurse into xen/common/efi from here and not from xen/common, or at least to not include extra-$(efi) += boot.init.o in xen/common/efi/Makefile (that would also let the x86 specific checkng code stay here, might it?)
Quoted 4 lines
symbols-dummy.o has a similar hack, but notice that it is not build from xen/common/Makefile.
Anyway, I'm flailing, perhaps Jan can suggest the correct fix.
So originally the idea was to sym-link the moved file into its current location, limiting the build recursion to what is being done today.
The only seamless alternative I can see would be to move the whole efi/ subtree to common/ (after all, runtime.c will need to be moved at some point too, and other files should then follow for consistency).
Jan
Re: [PATCH V3 13/15] add arm64 cache flushing code from linux v3.16
In reply to Roy FranzQuoted 6 lines · Roy Franz
__flush_dcache_alladded fromarch/arm64/mm/cache.S, with helper macros fromarch/arm64/include/asm/assembler.h, from v3.16. The cache flushing is required when transitioning from EFI code that runs with cache enable to XEN startup code which expects the cache to be disabled.Signed-off-by Roy Franz <[email protected]>
xen/arch/arm/arm64/cache.S line 52
Quoted 1 line
xen/arch/arm/arm64/cache.S new file +1
-0+ ENTRY(__flush_dcache_all)
This shouldn't be indented. If I come to be applying this version then I'll fix that as I go, but if you repost please fix.
Quoted 48 lines
xen/arch/arm/arm64/cache.S new file +48
-0+__flush_dcache_all: + dmb sy // ensure ordering with previous memory accesses + mrs x0, clidr_el1 // read clidr + and x3, x0, #0x7000000 // extract loc from clidr + lsr x3, x3, #23 // left align loc bit field + cbz x3, finished // if loc is 0, then no need to clean + mov x10, #0 // start clean at cache level 0 +loop1: + add x2, x10, x10, lsr #1 // work out 3x current cache level + lsr x1, x0, x2 // extract cache type bits from clidr + and x1, x1, #7 // mask of the bits for current cache only + cmp x1, #2 // see what cache we have at this level + b.lt skip // skip if no cache, or just i-cache + save_and_disable_irqs x9 // make CSSELR and CCSIDR access atomic + msr csselr_el1, x10 // select current cache level in csselr + isb // isb to sych the new cssr&csidr + mrs x1, ccsidr_el1 // read the new ccsidr + restore_irqs x9 + and x2, x1, #7 // extract the length of the cache lines + add x2, x2, #4 // add 4 (line length offset) + mov x4, #0x3ff + and x4, x4, x1, lsr #3 // find maximum number on the way size + clz w5, w4 // find bit position of way size increment + mov x7, #0x7fff + and x7, x7, x1, lsr #13 // extract max number of the index size +loop2: + mov x9, x4 // create working copy of max way size +loop3: + lsl x6, x9, x5 + orr x11, x10, x6 // factor way and cache number into x11 + lsl x6, x7, x2 + orr x11, x11, x6 // factor index number into x11 + dc cisw, x11 // clean & invalidate by set/way + subs x9, x9, #1 // decrement the way + b.ge loop3 + subs x7, x7, #1 // decrement the index + b.ge loop2 +skip: + add x10, x10, #2 // increment cache number + cmp x3, x10 + b.gt loop1 +finished: + mov x10, #0 // swith back to cache level 0 + msr csselr_el1, x10 // select current cache level in csselr + dsb sy + isb + ret +ENDPROC(__flush_dcache_all)
Re: [PATCH V3 14/15] Update libfdt to v1.4.0
In reply to Roy FranzQuoted 6 lines · Roy Franz
Update libfdt to v1.4.0 of libfdt taken from
git://git.jdl.com/software/dtc.git
XEN changes tolibfdt_env.hcarried over from existing libfdt (v1.3.0) This update provides thefdt_create_empty_tree()function used by the ARM EFI boot code.Signed-off-by Roy Franz <[email protected]>
Since this is just an import I'm not actually going to review this, so:
I suppose this and the previous patch (cache flush) could safely go in independently from the rest of the series?
Ian.
Re: [PATCH V3 15/15] Add ARM EFI boot support
In reply to Roy Franzxen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 736
Quoted 7 lines · Roy Franz
xen/arch/arm/arm64/head.S +3
-0@@ -618,6 +731,32 @@ ENTRY(lookup_processor_type) mov x0, #0 ret +ENTRY(efi_xen_start) + /* + * Turn off cache and MMU as XEN expects. EFI enables them, but also
It's just "Xen", not "XEN" (throughout).
xen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 740
Quoted 4 lines
xen/arch/arm/arm64/head.S +4
-0+ * mandates a 1:1 (unity) VA->PA mapping, so we can turn off the + * MMU while executing EFI code before entering XEN. + * The EFI loader calls this to start XEN. + */
Last time there was a handy comment about preserving x0 here. I think it would also (or perhaps instead) be good to have a comment before the entry giving the "prototype" for this function, since it is called from C.
xen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 743
Quoted 3 lines
xen/arch/arm/arm64/head.S +3
-0+ mov x20, x0 + bl __flush_dcache_all + ic ialluis
Two too many spaces before iall.
xen/common/efi/Makefile line 2
Quoted 8 lines
xen/common/efi/Makefile +1
-1@@ -1,5 +1,5 @@ CFLAGS += -fshort-wchar - +ifneq ($(XEN_TARGET_ARCH),arm64)
This does still build on arm32, right?
I suppose the discussion on patch #1 will have some knock on effects here.
Quoted 22 lines
xen/include/asm-arm/arm64/efibind.h new file +0
-0xen/include/asm-arm/efi-boot.h new file +9
-0+static void __init *lookup_fdt_config_table (EFI_SYSTEM_TABLE *sys_table) +{ +const EFI_GUID fdt_guid =DEVICE_TREE_GUID ; +EFI_CONFIGURATION_TABLE *tables; +void *fdt =NULL ; +int i; + + tables = sys_table->ConfigurationTable; +for ( i =0 ; i < sys_table->NumberOfTableEntries; i++ )
xen/include/asm-arm/efi-boot.h line 143
Quoted 10 lines
xen/include/asm-arm/efi-boot.h new file +10
-0+ { +if (match_guid (&tables[i].VendorGuid, &fdt_guid) ) + { + fdt = tables[i].VendorTable; +break ; + } + } +return fdt; +} +static EFI_STATUS __init efi_get_memory_map(void **map,
Missing a blank line after the previous function, here and elsewhere. I see you've gone from 2 blanks to 0 since last time ;-)
Quoted 1 line
+
fdt_val64=cpu_to_fdt64((u64)(unsigned long)sys_table);
(uintptr_t) is arguably more correct than (unsigned long) for this purpose. and again below.
Quoted 8 lines
xen/include/asm-arm/efi-boot.h new file +8
-0+ status =fdt_setprop (fdt, node,"linux,uefi-system-table" , + &fdt_val64,sizeof (fdt_val64)); +if ( status ) + goto fdt_set_fail; + + fdt_val64 =cpu_to_fdt64 ((u64 )(unsigned long )memory_map); + status =fdt_setprop (fdt, node,"linux,uefi-mmap-start" , + &fdt_val64,sizeof (fdt_val64));
[...]
xen/include/asm-arm/efi-boot.h
Quoted 3 lines
++static void
__initefi_arch_post_exit_boot(void)xen/include/asm-arm/efi-boot.h new file +2
-0+{ +efi_xen_start ((unsigned long )fdt);
You might as well make the pseudoprototype be a pointer if that is what fdt actually is.
xen/include/asm-arm/efi-boot.h line 572
Quoted 4 lines
xen/include/asm-arm/efi-boot.h new file +4
-0+static void __init efi_arch_load_addr_check (EFI_LOADED_IMAGE *loaded_image) +{ +if ( (unsigned long )loaded_image->ImageBase & ((1 <<20 ) -1 ) ) +blexit (L"Xen must be loaded at a 2MByte boundary." );
This isn't true any more, Xen only needs to be at a 4K boundary now.
Looking good, all of the above is pretty minor stuff, thanks!
Ian.
Re: [PATCH V3 14/15] Update libfdt to v1.4.0
In reply to Ian CampbellQuoted 8 lines · Ian Campbell
Quoted 6 lines · Roy Franz
Update libfdt to v1.4.0 of libfdt taken from
git://git.jdl.com/software/dtc.git
XEN changes tolibfdt_env.hcarried over from existing libfdt (v1.3.0) This update provides thefdt_create_empty_tree()function used by the ARM EFI boot code.Signed-off-by Roy Franz <[email protected]>
Quoted 9 lines
Since this is just an import I'm not actually going to review this, so:
Acked-by Ian Campbell <[email protected]>I suppose this and the previous patch (cache flush) could safely go in independently from the rest of the series?
Ian.
Yes, these are independent pieces that could go in separately. I can split them out if that would help,
or they could just be applied from this series.
Roy
Re: [PATCH V3 01/15] move x86 EFI boot code to common/efi
In reply to Jan BeulichQuoted 23 lines · Jan Beulich
Quoted 23 lines
Quoted 1 line
Quoted 1 line · On 08.09.14 at 17:23, <[email protected]> wrote:
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 80
Quoted 9 lines · Roy Franz
xen/arch/x86/Makefile +3
-0@@ -75,6 +75,13 @@ $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +# This seems to be required to get parallel builds to work, otherwise prelink-efi.o complains about +# no rule to make boot.init.oI suppose we must recurse into common and arch at the same time.
xen/arch/x86/Makefile $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 · line 81
Quoted 1 line
xen/arch/x86/Makefile +1
-0+# Not sure what the right fix isMe neither. This doesn't look right to me though, given that xen/common/efi is also entered via a subdir-y in xen/common/Makefile.
Perhaps Jan has some ideas but I'm wondering if we ought not to recurse into xen/common/efi from here and not from xen/common, or at least to not include extra-$(efi) += boot.init.o in xen/common/efi/Makefile (that would also let the x86 specific checkng code stay here, might it?)
Quoted 7 lines
Quoted 4 lines
symbols-dummy.o has a similar hack, but notice that it is not build from xen/common/Makefile.
Anyway, I'm flailing, perhaps Jan can suggest the correct fix.
So originally the idea was to sym-link the moved file into its current location, limiting the build recursion to what is being done today.
I think this will be the cleanest - that will allow ARM to use the standard common build stuff, and x86 to do exactly what it did before. I'll do this in the next version.
Quoted 7 lines
The only seamless alternative I can see would be to move the whole efi/ subtree to common/ (after all,
runtime.cwill need to be moved at some point too, and other files should then follow for consistency).Jan
Re: [PATCH V3 15/15] Add ARM EFI boot support
In reply to Ian CampbellQuoted 10 lines · Ian Campbell
xen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 736
Quoted 7 lines · Roy Franz
xen/arch/arm/arm64/head.S +3
-0@@ -618,6 +731,32 @@ ENTRY(lookup_processor_type) mov x0, #0 ret +ENTRY(efi_xen_start) + /* + * Turn off cache and MMU as XEN expects. EFI enables them, but alsoIt's just "Xen", not "XEN" (throughout).
OK.
Quoted 10 lines
xen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 740
Quoted 5 lines
xen/arch/arm/arm64/head.S +4
-0+ * mandates a 1:1 (unity) VA->PA mapping, so we can turn off the + * MMU while executing EFI code before entering XEN. + * The EFI loader calls this to start XEN. + */Last time there was a handy comment about preserving x0 here. I think it would also (or perhaps instead) be good to have a comment before the entry giving the "prototype" for this function, since it is called from C.
OK, I'll add that.
Quoted 18 lines
xen/arch/arm/arm64/head.S ENTRY(lookup_processor_type) · line 743
Quoted 4 lines
xen/arch/arm/arm64/head.S +3
-0+ mov x20, x0 + bl __flush_dcache_all + ic ialluisTwo too many spaces before iall.
xen/common/efi/Makefile line 2
Quoted 8 lines
xen/common/efi/Makefile +1
-1@@ -1,5 +1,5 @@ CFLAGS += -fshort-wchar - +ifneq ($(XEN_TARGET_ARCH),arm64)This does still build on arm32, right?
Quoted 2 lines
I suppose the discussion on patch #1 will have some knock on effects here.
Most of the stuff should be common with arm32, although I haven't tried it. The main thing
missing for arm32 is the PE/COFF header. I'm not intending to build the EFI stuff for arm32, but
it's possible I've borked the build - I forgot to try that on this patchset.
Quoted 28 lines
Quoted 28 lines
xen/include/asm-arm/arm64/efibind.h new file +0
-0xen/include/asm-arm/efi-boot.h new file +14
-0+static void __init *lookup_fdt_config_table (EFI_SYSTEM_TABLE *sys_table) +{ +const EFI_GUID fdt_guid =DEVICE_TREE_GUID ; +EFI_CONFIGURATION_TABLE *tables; +void *fdt =NULL ; +int i; + + tables = sys_table->ConfigurationTable; +for ( i =0 ; i < sys_table->NumberOfTableEntries; i++ ) + { +if (match_guid (&tables[i].VendorGuid, &fdt_guid) ) + { + fdt = tables[i].VendorTable; +break ;
Quoted 8 lines
xen/include/asm-arm/efi-boot.h line 143
Quoted 5 lines
xen/include/asm-arm/efi-boot.h new file +5
-0+ } + } +return fdt; +} +static EFI_STATUS __init efi_get_memory_map(void **map,Missing a blank line after the previous function, here and elsewhere. I see you've gone from 2 blanks to 0 since last time ;-)
I'll add the proper number of blank lines :)
Quoted 5 lines
Quoted 2 lines
+
fdt_val64=cpu_to_fdt64((u64)(unsigned long)sys_table);(
uintptr_t) is arguably more correct than (unsigned long) for this purpose. and again below.
Yup, I'll fix that.
Quoted 9 lines
xen/include/asm-arm/efi-boot.h line 279
Quoted 9 lines
xen/include/asm-arm/efi-boot.h new file +8
-0+ status =fdt_setprop (fdt, node,"linux,uefi-system-table" , + &fdt_val64,sizeof (fdt_val64)); +if ( status ) + goto fdt_set_fail; + + fdt_val64 =cpu_to_fdt64 ((u64 )(unsigned long )memory_map); + status =fdt_setprop (fdt, node,"linux,uefi-mmap-start" , + &fdt_val64,sizeof (fdt_val64));
Quoted 8 lines
[...]
xen/include/asm-arm/efi-boot.h
Quoted 3 lines
++static void
__initefi_arch_post_exit_boot(void)xen/include/asm-arm/efi-boot.h new file +2
-0+{ +efi_xen_start ((unsigned long )fdt);You might as well make the pseudoprototype be a pointer if that is what fdt actually is.
OK. That will save a cast, and the value in the register is the same.
Quoted 7 lines
xen/include/asm-arm/efi-boot.h line 572
Quoted 5 lines
xen/include/asm-arm/efi-boot.h new file +4
-0+static void __init efi_arch_load_addr_check (EFI_LOADED_IMAGE *loaded_image) +{ +if ( (unsigned long )loaded_image->ImageBase & ((1 <<20 ) -1 ) ) +blexit (L"Xen must be loaded at a 2MByte boundary." );This isn't true any more, Xen only needs to be at a 4K boundary now.
I will update this (along with the alignment requested in the PE/COFF header) and give it a spin.
Quoted 5 lines
Looking good, all of the above is pretty minor stuff, thanks!
Ian.
I'm hoping this is in good enough shape for 4.5 - I should be able to address all the feedback received so far quite quickly. Should I wait for more feedback, or prepare an updated patchset addressing the feedback so far?
Thanks,
Roy
Re: [PATCH V3 14/15] Update libfdt to v1.4.0
In reply to Roy FranzQuoted 16 lines · Roy Franz
Quoted 15 lines · Ian Campbell
Quoted 6 lines · Roy Franz
Update libfdt to v1.4.0 of libfdt taken from
git://git.jdl.com/software/dtc.git
XEN changes tolibfdt_env.hcarried over from existing libfdt (v1.3.0) This update provides thefdt_create_empty_tree()function used by the ARM EFI boot code.Signed-off-by Roy Franz <[email protected]>Since this is just an import I'm not actually going to review this, so:
Acked-by Ian Campbell <[email protected]>I suppose this and the previous patch (cache flush) could safely go in independently from the rest of the series?
Quoted 6 lines
Quoted 2 lines
Ian.
Yes, these are independent pieces that could go in separately. I can split them out if that would help,
or they could just be applied from this series.
Thanks, I'll pick them out of this series at some point soon, no need to split them out.
Ian.
Re: [PATCH V3 15/15] Add ARM EFI boot support
In reply to Roy FranzQuoted 6 lines · Roy Franz
I'm hoping this is in good enough shape for 4.5 - I should be able to address all the feedback received so far quite quickly. Should I wait for more feedback, or prepare an updated patchset addressing the feedback so far?
From the ARM side you could respin now, but I skipped over most of the
x86/refactoring bits (i.e. the bulk of the series) since that's more of a Jan thing. Jan -- do you have comments or should Roy wait?
Ian.
Re: [PATCH V3 15/15] Add ARM EFI boot support
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 09.09.14 at 11:24, <[email protected]> wrote:
Quoted 4 lines · Roy Franz
I'm hoping this is in good enough shape for 4.5 - I should be able to address all the feedback received so far quite quickly. Should I wait for more feedback, or prepare an updated patchset addressing the feedback so far?
From the ARM side you could respin now, but I skipped over most of the x86/refactoring bits (i.e. the bulk of the series) since that's more of a Jan thing. Jan -- do you have comments or should Roy wait?
I'm having a hard time estimating when I would get to look at the non-ARM pieces of the series, so I think re-spinning with the one (significant) structural change discussed earlier would be reasonable.
Jan
Re: [PATCH V3 15/15] Add ARM EFI boot support
Quoted 11 lines · Jan Beulich
Quoted 10 lines
Quoted 1 line
Quoted 1 line · On 09.09.14 at 11:24, <[email protected]> wrote:
Quoted 4 lines · Roy Franz
I'm hoping this is in good enough shape for 4.5 - I should be able to address all the feedback received so far quite quickly. Should I wait for more feedback, or prepare an updated patchset addressing the feedback so far?
From the ARM side you could respin now, but I skipped over most of the x86/refactoring bits (i.e. the bulk of the series) since that's more of a Jan thing. Jan -- do you have comments or should Roy wait?
Quoted 6 lines
I'm having a hard time estimating when I would get to look at the non-ARM pieces of the series, so I think re-spinning with the one (significant) structural change discussed earlier would be reasonable.
Jan
I'll get an updated series out today.
Thanks,
Roy