mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
x86/boot: Remove gratuitous call back into low-memory code
We appear to have implemented a memcpy() in the low-memory trampoline which we then call into from __start_xen(), for no adequately defined reason. Kill it with fire. Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
1 parent
6a4a625348
commit
24575e2c1b
3 files changed
+17
-25
No files matched your search
+5
-22
@@ -7,7 +7,7 @@ get_memory_map:
|
||||
|
||||
.Lmeme820:
|
||||
xorl %ebx, %ebx # continuation counter
|
||||
movw $bootsym(e820map), %di # point into the whitelist
|
||||
movw $bootsym(bios_e820map), %di # point into the whitelist
|
||||
# so we can have the bios
|
||||
# directly write into it.
|
||||
|
||||
@@ -22,8 +22,8 @@ get_memory_map:
|
||||
cmpl $SMAP,%eax # check the return is `SMAP'
|
||||
jne .Lmem88
|
||||
|
||||
incw bootsym(e820nr)
|
||||
cmpw $E820_BIOS_MAX,bootsym(e820nr) # up to this many entries
|
||||
incw bootsym(bios_e820nr)
|
||||
cmpw $E820_BIOS_MAX, bootsym(bios_e820nr) # up to this many entries
|
||||
jae .Lmem88
|
||||
|
||||
movw %di,%ax
|
||||
@@ -66,27 +66,10 @@ get_memory_map:
|
||||
|
||||
ret
|
||||
|
||||
/*
|
||||
* Copy E820 map obtained from BIOS to a buffer allocated by Xen.
|
||||
* Input: %rdi: target address of e820 entry array
|
||||
* %esi: maximum number of entries to copy
|
||||
* Output: %eax: number of entries copied
|
||||
*/
|
||||
.code64
|
||||
ENTRY(e820map_copy)
|
||||
mov %esi, %eax
|
||||
lea e820map(%rip), %rsi
|
||||
mov e820nr(%rip), %ecx
|
||||
cmp %ecx, %eax
|
||||
cmova %ecx, %eax # number of entries to move
|
||||
imul $5, %eax, %ecx
|
||||
rep movsl # do the move
|
||||
ret
|
||||
|
||||
.align 4
|
||||
e820map:
|
||||
GLOBAL(bios_e820map)
|
||||
.fill E820_BIOS_MAX*20,1,0
|
||||
e820nr:
|
||||
GLOBAL(bios_e820nr)
|
||||
.long 0
|
||||
GLOBAL(lowmem_kb)
|
||||
.long 0
|
||||
|
||||
@@ -669,6 +669,16 @@ static char * __init cmdline_cook(char *p, const char *loader_name)
|
||||
return p;
|
||||
}
|
||||
|
||||
static unsigned int __init copy_bios_e820(struct e820entry *map, unsigned int limit)
|
||||
{
|
||||
unsigned int n = min(bootsym(bios_e820nr), limit);
|
||||
|
||||
if ( n )
|
||||
memcpy(map, bootsym(bios_e820map), sizeof(*map) * n);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
void __init noreturn __start_xen(unsigned long mbi_p)
|
||||
{
|
||||
char *memmap_type = NULL;
|
||||
|
||||
@@ -37,8 +37,7 @@ extern struct e820map e820_raw;
|
||||
|
||||
/* These symbols live in the boot trampoline. */
|
||||
extern unsigned int lowmem_kb, highmem_kb;
|
||||
unsigned int e820map_copy(struct e820entry *map, unsigned int limit);
|
||||
|
||||
#define copy_bios_e820 bootsym(e820map_copy)
|
||||
extern struct e820map bios_e820map[];
|
||||
extern unsigned int bios_e820nr;
|
||||
|
||||
#endif /*__E820_HEADER*/
|
||||