aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot
Commit message (Collapse)AuthorAgeFilesLines
* x86: Introduce and use GLOBAL() in asm codeAndrew Cooper2013-09-097-58/+44
| | | | | | Also clean up some cases of misused/opencoded ENTRY() Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
* Revert "x86/boot: Explicitly clean pcpu stacks in debug builds"Jan Beulich2013-08-271-9/+0
| | | | | This reverts commit 8a3c4acc9907cfec9aae9f1bc251fbf50af6828e. It's reportedly broken.
* x86/boot: Explicitly clean pcpu stacks in debug buildsAndrew Cooper2013-08-271-0/+9
| | | | | | | | | This reduces confusion when looking at a hexdump of the pcpu stacks and wondering were on earth some of the junk was coming from. Also leave some grep fodder for finding where the BSP switches stack (because it took me far longer to find than I care to admit to). Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* x86: find a better location for the real-mode trampolinePaolo Bonzini2013-01-181-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | On some machines, the location at 0x40e does not point to the beginning of the EBDA. Rather, it points to the beginning of the BIOS-reserved area of the EBDA, while the option ROMs place their data below that segment. For this reason, 0x413 is actually a better source than 0x40e to get the location of the real-mode trampoline. Xen was already using it as a second source, and this patch keeps that working. However, just in case, let's also fetch the information from the multiboot structure, where the boot loader should have placed it. This way we don't necessarily trust one of the BIOS or the multiboot loader more than the other. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Retain the previous code, thus using the multiboot value only if it's sane but lower than the BDA computed one. Also use the full 32-bit mem_lower value and prefer MBI_MEMLIMITS over open coding it (requiring a slight adjustment to multiboot.h to make its constants actually usable in assembly code, which previously they were only meant to be). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
* x86: check for data and BSS in reloc code at compile time.Tim Deegan2012-09-132-7/+10
| | | | | | | | | This is a more useful failure mode than hanging at boot time, and incidentally fixes the clang/LLVM build by removing a .subsection rune. Signed-off-by: Tim Deegan <tim@xen.org> Acked-by: Jan Beulich <jbeulich@suse.com> Committed-by: Tim Deegan <tim@xen.org>
* x86: We can assume CONFIG_PAGING_LEVELS==4.Keir Fraser2012-09-122-4/+0
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* xen: Remove x86_32 build target.Keir Fraser2012-09-124-167/+0
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86: retrieve keyboard shift status flags from BIOSJan Beulich2012-09-121-0/+9
| | | | | | | | | | | Recent Linux tries to make use of this, and has no way of getting at these bits without Xen assisting it. There doesn't appear to be a way to obtain the same information from UEFI. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86-64: construct static, uniform parts of page tables at build timeJan Beulich2012-09-112-32/+73
| | | | | | | | ... rather than at boot time, removing unnecessary redundancy between EFI and legacy boot code. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: construct static part of 1:1 mapping at build timeJan Beulich2012-09-113-49/+58
| | | | | | | | ... rather than at boot time, removing unnecessary redundancy between EFI and legacy boot code. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86: allow early use of fixmapsJan Beulich2012-09-111-1/+10
| | | | | | | | | As a prerequisite for adding an EHCI debug port based console implementation, set up the page tables needed for (a sub-portion of) the fixmaps together with other boot time page table construction. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86,cmdline: Fix setting skip_realmode boolean on no-real-mode and tboot optionsKeir Fraser2012-08-231-2/+4
| | | | | | ...effect should be cumulative. Signed-off-by: Keir Fraser <keir@xen.org>
* x86: get rid of BOOT_TRAMPOLINEJan Beulich2012-06-117-63/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We recently saw a machine that has the EBDA extending as low as 0x7c000, so that Xen fails to boot after relocating the trampoline. To fix this, I removed BOOT_TRAMPOLINE and bootsym_phys completely. Here are the parts: 1) the trampoline segment is set to 64k below the EBDA. head.S grows the ability to relocate the trampoline segment 2) reloc.c is made position-independent. It allocates data below the trampoline, whose address is passed in _eax. 3) cmdline.S is called before relocating, so all bootsym_phys there become sym_phys. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> jb: - fall back to low memory size (instead of segment 0x7c00) if EBDA value is out of range - also add upper limit check on EBDA value - fix and simplify inline assembly operands in reloc_mbi_struct() - use lret instead of retf - renamed early_stack to wakeup_stack, defined and used now only in wakeup.S - aligned reloc.bin's end of .text to 16 bytes, so that checking __bss_start == end works reliably Signed-off-by: Jan Beulich <jbeulich@suse.com> Committed-by: Keir Fraser <keir@xen.org>
* x86/EDD: check MBR for BIOS magic before considering signature validJan Beulich2012-05-311-1/+5
| | | | | Signed-off-by: Jan Beulich <JBeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org>
* x86-64/EFI: construct EDD data from device path protocol informationJan Beulich2011-08-191-10/+2
| | | | | | | In the absence of a BIOS to handle INT13 requests, this information must be constructed artificially instead when booted from EFI. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: trampoline cleanupJan Beulich2011-08-192-5/+7
| | | | | | | | | | | | | | | To make future changes less error prone, and to slightly simplify a possible future conversion to a relocatable trampoline even for the multiboot path (pretty desirable given that we had to change the trampoline base a number of times to escape collisions with firmware placed data), - remove final uses of bootsym_phys() from trampoline.S, allowing the symbol to be undefined before including this file (to make sure no new references get added) - replace two easy to deal with uses of bootsym_phys() in head.S - remove an easy to replace reference to BOOT_TRAMPOLINE Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: make run-time part of trampoline relocatableJan Beulich2011-08-194-21/+46
| | | | | | | | | | | | | | In order to eliminate an initial hack in the EFI boot code (where memory for the trampoline was just "claimed" instead of properly allocated), the trampoline code must no longer make assumption on the address at which it would be located. For the time being, the fixed address is being retained for the traditional multiboot path. As an additional benefit (at least from my pov) it allows confining the visibility of the BOOT_TRAMPOLINE definition to just the boot code. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86-64: EFI boot codeJan Beulich2011-06-282-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Besides introducing the relevant code paralleling parts of what is under xen/arch/x86/boot/, this adjusts the build logic so that with a single compilation two images (gzip-compressed ELF and EFI application) can get created. The EFI part of this depends on a new enough compiler (supposedly gcc 4.4.x and above, but so far only tested to work with 4.5.x) and a properly configured linker (must support the i386pep emulation). If either functionality is found to not be available, the EFI part of the build will simply be skipped. The patch adds all code to allow Xen and the (accordingly enabled) Dom0 kernel to boot, but doesn't allow Dom0 to make use of EFI runtime calls (this will be the subject of the next patch). Parts of the code were lifted from an earlier never published OS project of ours - whether respective license information needs to be added to the respective source file is unclear to me (I was told internally that adding a GPLv2 license header can be done if needed by the community). Open issues (not preventing this from being committed imo): The trampoline allocation and initialization isn't really nice. This is due to the trampoline needing to be placed at a fixed address, and hence making the trampoline relocatable would seem desirable here (as well as for BIOS-based booting, where the trampoline location needed to be adjusted a number of time already in the past, due to it colliding with firmware data). By excluding mem.S, edd.S, and video.S from copied trampoline (i.e. moving up wakeup.S? and making sure none of the symbols are used from EFI code), the effective trampoline size could at least be reduced. Should the mappings of [__XEN_VIRT_START, mbi.mem_upper) and [_end, __XEN_VIRT_START+BOOTSTRAP_MAP_BASE) be destroyed, despite non-EFI code also keeping them? Signed-off-by: Jan Beulich <jbeulich@novell.com>
* xen: fix reloc.S generation for non-gnu toolchainChristoph Egger2011-04-021-2/+2
| | | | | | The output of AT&T UNIX and GNU od(1) are different. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* Do not re-define XEN_ROOT in hypervisor sub-Makefiles.Keir Fraser2011-03-171-1/+0
| | | | | | | We can globally export it from xen/Makefile instead, as all hypervisor builds have this Makefile at their root. Signed-off-by: Keir Fraser <keir@xen.org>
* xen: add "lto=y" option to build Xen with link-time optimizations.Tim Deegan2011-03-072-1/+2
| | | | | | | | | | | | This involves gathering object files from .asm (which will be binary) and object files from .c (which will be in LTO format) separately until the final link. Only tested for x86_64 Xen builds using Clang/LLVM bitcode; it should be possible to do the same with newer GCCs and GIMPLE. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* Update my email address to long-term stable address.Keir Fraser2011-01-071-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xen.org>
* x86: do away with the boot time low-memory 1:1 mappingKeir Fraser2010-11-094-28/+12
| | | | | | | | | | | | | | | By doing so, we're no longer restricted to be able to place all boot loader modules into the low 1Gb/4Gb (32-/64-bit) of memory, nor is there a dependency anymore on where the boot loader places the modules. We're also no longer restricted to copy the modules into a place below 4Gb, nor to put them all together into a single piece of memory. Further it allows even the 32-bit Dom0 kernel to be loaded anywhere in physical memory (except if it doesn't support PAE-above-4G). Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: Correctly cook command lines for GRUB2.Keir Fraser2010-07-281-2/+7
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Add -fno-exceptions to list of possibly-supported CFLAGS for embedded ↵Keir Fraser2010-07-251-4/+1
| | | | | | targets. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Avoid assumptions about C struct layouts from asm code.Keir Fraser2010-07-131-1/+1
| | | | | | Largely this involves avoiding assumptions about 'struct cpu_info'. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* multiboot asm: Get offset constants from the C structKeir Fraser2010-05-071-4/+0
| | | | Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
* x86: add .data.page_aligned sectionKeir Fraser2010-05-062-1/+6
| | | | | | | ... and move page-aligned data there, instead of having random holes (to fulfill the demanded alignment) in the final image. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* xen: build fix GNU sed vs. BSD sedKeir Fraser2010-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the build error below: gmake[5]: Entering directory `xen/arch/x86/boot' gcc -O1 -fno-omit-frame-pointer -fno-optimize-sibling-calls -m32 -march=3Di686 -g -fno-strict-aliasing -std=3Dgnu99 -Wall -Wstrict-prototypes -Wno-unused-value -Wdeclaration-after-statement -fno-stack-protector -Werror -fno-builtin -msoft-float -c reloc.c -o reloc.o ld -melf_i386 -N -Ttext -o reloc.lnk reloc.o ld: invalid hex number `-o' BSD sed does not support the '+' in the basic re while gnu sed does. BSD sed supports '+' in the extended re and uses the -E flag while gnu sed uses -r. The only difference with the original version is that the '+' qualifier is replaced with '\{1\,\}' which should work with both BSD sed and GNU sed. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Fix 21051:bcc09eb7379f "x86_32: Relocate multiboot modules to below 1GB."Keir Fraser2010-03-241-14/+22
| | | | | | | | Copy the modules in ascending order in memory, rather than decsending order. This reduces the likelihood of the second relocation (in setup.c) corrupting modules through accidental overwriting. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_32: Relocate multiboot modules to below 1GB.Keir Fraser2010-03-233-2/+22
| | | | | | | | Otherwise Xen cannot access them later during boot. GRUB2 places modules as high as possible below 4GB, which has been causing boot failure. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: move trampoline locationKeir Fraser2010-02-102-3/+7
| | | | | | | | | | | | | | | | | | | A partner of ours is reporting boot failures (Xen not even emitting a single message) over iSCSI on new (UEFI based) systems. After pointing at their BIOS initially I finally remembered to take a look at the memory map a native kernel booted this way see - and voila, the BIOS reports memory starting at 0x8d000 as reserved. Xen, however, places about 12k of (trampoline) data at 0x8c000. For now, move the trampolien down by 4kB to 0x88000. Later we may choose the location dynamically based on E820 information, if this proves to be an ongoing problem. One thing this patch enforces in any case is a single point of definition for the hard coded location, so that at least adjusting it won't require more than a single line change in the future. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* cmdline_parse_early: fix parse 'edd=' optionKeir Fraser2009-11-091-1/+1
| | | | | | If 'edd='is default, it should decrease "opt_edd" not "opt_edid" Signed-off-by: Xiao Guangrong <ericxiao.gr@gmail.com>
* x86-64: extend manageable memory range to 5TbKeir Fraser2009-09-221-4/+4
| | | | | | | | Extend the virtual range reserved for the 1:1 mapping to cover 5Tb, and make the virtual size of the frame table gets match whatever the 1:1 table can cover. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: fix s3 resume on AMD CPUsKeir Fraser2009-06-161-14/+7
| | | | | | | | Avoid longjmp as it has different semantics than on Intel CPUs in long mode. Also add a few comments and remove a pointless reload of DS. Signed-off-by: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
* Fix Makefile portability: head -n -1 isn't portable.Keir Fraser2009-03-121-1/+2
| | | | Signed-off-by: John Levon <john.levon@sun.com>
* x86: Relocate Multiboot module command-line strings.Keir Fraser2009-02-041-8/+17
| | | | | | Missed this in the original patch. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Relocate Multiboot structures where we know they will beKeir Fraser2009-02-034-2/+118
| | | | | | | | | | | | | | | accessible. GRUB2 seems to like to stick them really high sometimes (just below 4GB). The 32-bit C code framework that this sets up can also be used for other stuff in future: * early cmdline parsing * relocating multiboot modules so they too are guaranteed accessible Its interaction with normal Xen start-of-day, and with the 16-bit assembly trampoline, needs a bit of thought. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Move libelf headers out of xen public header dir.Keir Fraser2009-01-081-1/+1
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Auto-build dependency files in hypervisor build tree.Keir Fraser2009-01-081-3/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: No need for short jmp before long hjmp when setting CR0.PEKeir Fraser2008-12-031-2/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* i386: make double fault TSS per-CPUKeir Fraser2008-09-221-1/+1
| | | | | | | As a follow-up to the per-CPU-GDT patch, this also makes the double fault TSS (and the associated stack) per-CPU. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* x86: make GDT per-CPUKeir Fraser2008-09-223-6/+12
| | | | | | | | | | | The major issue with supporting a significantly larger number of physical CPUs appears to be the use of per-CPU GDT entries - at present, x86-64 could support only up to 126 CPUs (with code changes to also use the top-most GDT page, that would be 254). Instead of trying to go with incremental steps here, by converting the GDT itself to be per-CPU, limitations in that respect go away entirely. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* i386: Remove non-PAE hypervisor build target.Keir Fraser2008-05-084-34/+2
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_64: Initialise upper half of 32-bit parameter registers whenKeir Fraser2008-03-311-3/+6
| | | | | | making Target Mode BIOS call. Fixes boot problems with some buggy BIOSes. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86/64: Make BIOS call to declare our intention to enter long mode.Keir Fraser2008-02-141-0/+7
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: First 1MB of memory should be mapped with 4kB mappings to avoidKeir Fraser2008-01-251-1/+35
| | | | | | conflict with fixed-range MTRRs. While there, we now map the VGA hole as uncacheable. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Clean up boot/wakeup code.Keir Fraser2007-12-104-19/+13
| | | | | | | | | * Generalise wakeup stack to general 'early stack' used everywhere. * Ensure things that must be aligned are aligned. * Remove some unused symbols. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Do not read/write EFER MSR if it doesn't exist.Keir Fraser2007-11-131-0/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>