| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
Also clean up some cases of misused/opencoded ENTRY()
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
|
|
|
|
|
| |
This reverts commit 8a3c4acc9907cfec9aae9f1bc251fbf50af6828e.
It's reportedly broken.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
... 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>
|
|
|
|
|
|
|
|
| |
... 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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
... 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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Prevent similar bugs in future by poisoning the relocated bottom
megabyte.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
dealing with operations that need to distinguish between native and
compatibility mode guests.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
| |
Signed-off-by: Jan Beulich <jbeulich@novell.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
Ensures we do not overlap with the cpu_info structure.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
stack frame pointer).
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
| |
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Fix x86/64 bootstrap.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
Remove unnecessary SYMBOL_NAME* macros.
Signed-off-by: Keir Fraser <keir@xensource.com>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
mmu_update fixes for x86_64. About halfway there.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
| |
SYSCALL fixes.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
| |
Various bug fixes, and NMI/DF improvements for x86_64.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
| |
Added user-memory accessing functionality for x86_64.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
More x86_64 prgress. Many more gaps filled in. Next step is DOM0
construction.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
More x86/64 stuff.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
| |
Build and x86/64 fixes.
Signed-off-by: keir.fraser@cl.cam.ac.uk
|
|
|
|
|
|
| |
Many files:
x86/64 fixes.
|
|
|
|
|
| |
Some more x86/64 progress...
|