aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/boot/x86_64.S
Commit message (Collapse)AuthorAgeFilesLines
* patches to support booting from my grubroot2013-10-231-2/+1
|
* x86: Introduce and use GLOBAL() in asm codeAndrew Cooper2013-09-091-18/+11
| | | | | | 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>
* x86-64: construct static, uniform parts of page tables at build timeJan Beulich2012-09-111-1/+69
| | | | | | | | ... 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-111-0/+12
| | | | | | | | ... 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-64: EFI boot codeJan Beulich2011-06-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* x86: add .data.page_aligned sectionKeir Fraser2010-05-061-1/+3
| | | | | | | ... 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>
* x86: make GDT per-CPUKeir Fraser2008-09-221-3/+7
| | | | | | | | | | | 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>
* x86: GDT reserved page should be a full page.Keir Fraser2007-11-131-4/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: early exception enhancementkfraser@localhost.localdomain2007-06-201-2/+13
| | | | | | | | | In order to at least have some minimal debuging capabilities when Xen crashes really early, dump out registers and stack contents in a raw form. Signed-off-by: Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* x86/64: Avoid bogus mbi pointer into relocated Xen address space.kfraser@localhost.localdomain2007-06-181-2/+0
| | | | | | Prevent similar bugs in future by poisoning the relocated bottom megabyte. Signed-off-by: Keir Fraser <keir@xensource.com>
* xen: Big changes to x86 start-of-day:kfraser@localhost.localdomain2007-05-101-185/+15
| | | | | | | | | | | | | | | | | | | | 1. x86/64 Xen now relocates itself to physical high memory. This is useful if we have devices that need very low memory, or if in future we want to grant a 1:1 mapping of low physical memory to a special 'native client domain'. 2. We now only map low 16MB RAM statically. All other RAM is mapped dynamically within the constraints of the e820 map. It is recommended never to map MMIO regions, and this change means that Xen now obeys this constraint. 3. The CPU bootup trampoline is now permanently installed at 0x90000. This is necessary prereq for CPU hotplug. 4. Start-of-day asm is generally cleaned up and diff between x86/32 and x86/64 is reduced. Signed-off-by: Keir Fraser <keir@xensource.com>
* Introduce _DOMF_compat and infrastructure as well as several conditionalsEmmanuel Ackaouy2007-01-051-4/+23
| | | | | | | dealing with operations that need to distinguish between native and compatibility mode guests. Signed-off-by: Jan Beulich <jbeulich@novell.com>
* [XEN] Make labels _start,_end,_stext,_etext,_sinittext,_einittext generic.kaf24@localhost.localdomain2007-01-031-2/+0
| | | | | | Also sync the tools/symbol.c symbol table generator with Linux. Make section names generic (e.e.g, .init.text, .init.data, ...). Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] Make multiboot-related code more readable.kfraser@localhost.localdomain2006-12-071-3/+6
| | | | | | | Tested on i386 and x86_64 with GRUB and PXELINUX bootmanagers. From: Christoph Egger <Christoph.Egger@amd.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN] eliminate unused {g,i}dt{,_descr}kfraser@localhost.localdomain2006-11-131-5/+0
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* [XEN] Remove definition of printf. All users are switched to printk.kfraser@localhost.localdomain2006-10-231-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [XEN][X86_64] Remove hardcoded addresses in x86/64 boot assembly.kfraser@localhost.localdomain2006-09-201-26/+23
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* Increase size of level-2 initial PDE identity map from first 64MB ofkaf24@firebug.cl.cam.ac.uk2006-04-191-2/+2
| | | | | | | | | physical RAM to first 1GB of physical RAM. This allows x86_64 xen to boot larger dom0 images. Without this changes large dom0 images fail to boot with "Unknown interrupt" on xen console and wedge. Signed-off-by: Todd Clayton <todd.clayton@sun.com>
* Fix show_registers() on x86/64. Get rid ofkaf24@firebug.cl.cam.ac.uk2006-02-031-0/+1
| | | | | | | | | GUEST_CONTEXT() macro and the eflags==0 hack to detect an HVM-guest stack frame. Various cleanups and fixes. Signed-off-by: Keir Fraser <keir@xensource.com>
* Move initial stack-pointer adjustment into assemblykaf24@firebug.cl.cam.ac.uk2005-12-301-4/+6
| | | | | | | | | | | | bootstrap code. Avoids need for indirection thru reset_stack_and_jump() in C code (which was incorrect for secondary CPUs since nothing was pushed on the stack on that initial call, hence the masking operation had no effect and we ended up running on a bogus stack pointer). Signed-off-by: Keir Fraser <keir@xensource.com>
* Reset the stack pointer on every cpu early during bootstrap.kaf24@firebug.cl.cam.ac.uk2005-12-291-1/+1
| | | | | | | | Ensures we do not overlap with the cpu_info structure. Signed-off-by: Keir Fraser <keir@xensource.com>
* Various fixes to Xen stack management. Ensure the cpu0_stackkaf24@firebug.cl.cam.ac.uk2005-12-291-6/+2
| | | | | | | | | | is always sufficiently aligned (requires some linker script tricks). Small fixes to show_trace() and ensure that Xen stack pointers are always below the 'struct cpu_info' region. Signed-off-by: Keir Fraser <keir@xensource.com>
* Move cpu0_stack out of Xen text section and into BSS. Thiskaf24@firebug.cl.cam.ac.uk2005-12-021-8/+11
| | | | | | | | | | | | | | | | | avoids getting loads of bogus cpu0_stack lines in call backtraces from non-debug builds. Doing this requires greater alignment of the BSS section, which reveals a bug in ld where the alignment padding is not added to the program segment's memsz field. We get around this by finding the address of the last symbol in the image, and increasing our load image's memsz to include that symbol. Also some cleanups to the linker scripts. Signed-off-by: Keir Fraser <keir@xensource.com>
* Better Xen backtraces in debug builds (follow thekaf24@firebug.cl.cam.ac.uk2005-09-011-2/+2
| | | | | | | | stack frame pointer). Signed-off-by: Keir Fraser <keir@xensource.com>
* Enable NX/XD feature for 32-bit PAE Xen.kaf24@firebug.cl.cam.ac.uk2005-07-131-2/+2
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* Fix NX/XD enable on secondary CPUs.kaf24@firebug.cl.cam.ac.uk2005-07-131-4/+8
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1466.1.1 (428cceb2sTCzL9rItLSMlnmH9XrnTQ)kaf24@firebug.cl.cam.ac.uk2005-05-191-5/+7
| | | | | | | | | Ensure correct alignment of CPU0 stack -- it must be aligned on a 2^STACK_ORDER page boundary. This requirement is now also checked at run-time, and a clear fatal error given if it is not satisfied. This bug affected both x86/32 and x86/64. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1462 (428c884242SexXIVbHWO-OkTk2Q95w)kaf24@firebug.cl.cam.ac.uk2005-05-191-4/+4
| | | | | | | | | | | | | | Clean up, fix, and rationalise RAM mapping in Xen. First, x86/64 must take care to map only registered RAM areas and not adjacent I/O holes -- otherwise a cpu may cache I/O space and cause coherency conflicts on the memory bus. Second, map_pages() and the memguard mechanisms are no longer sub-arch specific (moved to arch/x86/mm.c:map_pages_to_xen()). Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1449 (428b5b18LCgVTMb_50LKESAAA5057Q)kaf24@firebug.cl.cam.ac.uk2005-05-181-21/+24
| | | | | | Fix x86/64 bootstrap. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1443 (428b3f59xxbCVcbUBrHu1R1TkWcYhg)kaf24@firebug.cl.cam.ac.uk2005-05-181-38/+37
| | | | | | | | | Cleaner GDT interface. Xen now reserves the last 2 pages of a full-size (16 page) GDT. A guest can register a GDT with up to 7k entries. Xen automatically makes the GDT up to max size with empty page mappings, and turns page faults in that area to #GP(selector). Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1389.1.9 (42715735MS5tAFkKmbN0nXUetfgXZQ)kaf24@firebug.cl.cam.ac.uk2005-04-281-10/+10
| | | | | | Remove unnecessary SYMBOL_NAME* macros. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1236.1.27 (421f706biBboh8DlmOttNIpUogeM6Q)kaf24@scramble.cl.cam.ac.uk2005-02-251-2/+2
| | | | | | | A few fixes, and DOM0 by default is now allocated all of memory at boot time. Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
* bitkeeper revision 1.1215 (42142daa9YHoIs3M6QPvH1qZYBJO5g)kaf24@scramble.cl.cam.ac.uk2005-02-171-18/+27
| | | | | | | IDT fixes. Initialise IDT sanely on x86/64. On x86/32 try to keep per-cpu IDTs in sync better. Signed-off-by: Keir Fraser <keir@xensource.com>
* bitkeeper revision 1.1159.256.1 (420919a4fFt2x7Ej4o_xqAI2CSYN8Q)kaf24@scramble.cl.cam.ac.uk2005-02-081-3/+7
| | | | | | mmu_update fixes for x86_64. About halfway there. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.111 (4207a372uscrEafJDzNOVuj8gyt_Fw)kaf24@scramble.cl.cam.ac.uk2005-02-071-2/+2
| | | | | | SYSCALL fixes. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.110 (42079080u5EKN2Dp7MbOEM7lnEs4gg)kaf24@scramble.cl.cam.ac.uk2005-02-071-2/+2
| | | | | | Various bug fixes, and NMI/DF improvements for x86_64. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.106 (42068c6bV88PUeuTyW0W65OVudMAlQ)kaf24@viper.(none)2005-02-061-9/+0
| | | | | | Added user-memory accessing functionality for x86_64. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.105 (420666bemy1hHhMRPUknF0p3-jxn_w)kaf24@viper.(none)2005-02-061-1/+1
| | | | | | | x86/64 debug builds use guard pages in unallocated heap space and for stack-limit enforcement. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.85 (42038b45EjUo-1JiSCHXW0Wav4TZGQ)kaf24@scramble.cl.cam.ac.uk2005-02-041-1/+1
| | | | | | | x86_64 progress: now entering ring 3. Need a hypercall (SYSCALL) entry point, and some kind of DOM0 image to test against. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.77 (4202221693AFbvFZWeMHHIjQfbzTIQ)kaf24@scramble.cl.cam.ac.uk2005-02-031-6/+1
| | | | | | | | More x86_64 prgress. Many more gaps filled in. Next step is DOM0 construction. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.73 (420154ceFUvIANCrxSTgPyOjFi1Pag)kaf24@viper.(none)2005-02-021-2/+2
| | | | | | | | More x86_64 work. Interrupts and exceptions are now working. Next step is DOM0 construction. First part of that is to map rest of physical memory, allocate and map the mach_to_phys table, and fix arch_init_memory(). Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.72 (42011b79Y7C9nEKFZ5pdQXwp8jC9hw)kaf24@scramble.cl.cam.ac.uk2005-02-021-8/+15
| | | | | | | More x86/64. Now boot secondary CPUs, but I seem to have problems executing IRET, so interrupts are fatal. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.235.1 (42000d3dwcPyT8aY4VIPYGCfCAJuQQ)kaf24@viper.(none)2005-02-011-15/+6
| | | | | | | | | | More x86/64. Status: traps.c now included in the build, but actual building of IDT doesn't happen, and we need some sort of entry.S. More page-table building required so that arch_init_memory() can work. And there is something odd with MP-table parsing; I currently suspect that __init sections are causing problems. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.62 (41fff40aESe4aWS82z_rLHeonXpxuQ)kaf24@scramble.cl.cam.ac.uk2005-02-011-7/+0
| | | | | | More x86/64 stuff. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.212.60 (41febc4bKKSkh9u-Zes9v2CmBuLZxA)kaf24@viper.(none)2005-01-311-9/+1
| | | | | | | | | | More bootstrap fixes for x86/64. Next thing to do is sort out the IDT and get traps.c working; then we can get rid of a bunch of dummy labels from end of boot/x86_64.S. We're also going to need some kind of entry.S before we can safely enable interrupts. Also bear in mind that not all of physical RAM may be mapped (only first 1GB) and no m2p table is yet allocated or mapped. Plenty to be done!
* bitkeeper revision 1.1159.231.14 (41fa441azB6742PriyqlRlCP_gJ0Tw)kaf24@firebug.cl.cam.ac.uk2005-01-281-3/+3
| | | | | | Build and x86/64 fixes. Signed-off-by: keir.fraser@cl.cam.ac.uk
* bitkeeper revision 1.1159.1.488 (41c1acbbhUN0iUWmupmPB85ghWRehg)kaf24@pb001.cl.cam.ac.uk2004-12-161-0/+3
| | | | | | Many files: x86/64 fixes.
* bitkeeper revision 1.1159.187.66 (41bf1718JfLUlcF63YjP4sfqtgAPWA)kaf24@scramble.cl.cam.ac.uk2004-12-141-13/+6
| | | | | Some more x86/64 progress...