search for: efi_memory_descriptor

Displaying 12 results from an estimated 12 matches for "efi_memory_descriptor".

2015 Aug 26
5
[PATCH] Call ExitBootServices twice
From: Sylvain Gault <sylvain.gault at gmail.com> On some architecture, including my hardware, the function ExitBootServices may need to be called twice in order to successfully exit the boot services. As stated by the UEFI spec, the first call to ExitBootServices may perform a partial shutdown of the services. It seems that during this partial shutdown, the memory map can be modified, thus
2015 Nov 02
3
[PATCH] efi: Call ExitBootServices at least twice
...c > @@ -1001,19 +1001,79 @@ static int handle_ramdisks(struct linux_header *hdr, > return 0; > } > > +/* > + * Like get_memory_map but try to use the given buffer first, reallocate it if > + * it's too small and always set the allocated size. > + */ > +static EFI_MEMORY_DESCRIPTOR * > +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, > + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + al...
2015 Sep 16
1
[PATCH] efi: Call ExitBootServices at least twice
....c > @@ -1001,19 +1001,79 @@ static int handle_ramdisks(struct > linux_header *hdr, return 0; > } > > +/* > + * Like get_memory_map but try to use the given buffer first, > reallocate it if > + * it's too small and always set the allocated size. > + */ > +static EFI_MEMORY_DESCRIPTOR * > +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, > + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, > + UINT32 *desc_ver) > +{ > + EFI_STATUS status; > + UINTN size, allocsizeadd; > + > + allocsizeadd = sizeof(*map) * 2; > + > +...
2015 Aug 26
0
[PATCH] efi: Call ExitBootServices at least twice
.....a39ab43 100644 --- a/efi/main.c +++ b/efi/main.c @@ -1001,19 +1001,79 @@ static int handle_ramdisks(struct linux_header *hdr, return 0; } +/* + * Like get_memory_map but try to use the given buffer first, reallocate it if + * it's too small and always set the allocated size. + */ +static EFI_MEMORY_DESCRIPTOR * +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, + UINT32 *desc_ver) +{ + EFI_STATUS status; + UINTN size, allocsizeadd; + + allocsizeadd = sizeof(*map) * 2; + + do { + size = *allocsize; + status = uefi_call_...
2015 Nov 03
2
[PATCH] efi: Call ExitBootServices at least twice
...*hdr, >>> return 0; >>> } >>> >>> +/* >>> + * Like get_memory_map but try to use the given buffer first, reallocate >>> it if >>> + * it's too small and always set the allocated size. >>> + */ >>> +static EFI_MEMORY_DESCRIPTOR * >>> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >>> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >>> + UINT32 *desc_ver) >>> +{ >>> + EFI_STATUS status; >>> +...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...amdisks(struct linux_header >> *hdr, >> return 0; >> } >> >> +/* >> + * Like get_memory_map but try to use the given buffer first, reallocate >> it if >> + * it's too small and always set the allocated size. >> + */ >> +static EFI_MEMORY_DESCRIPTOR * >> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >> + UINT32 *desc_ver) >> +{ >> + EFI_STATUS status; >> + UINTN size, allocsizeadd...
2015 Nov 03
0
[PATCH] efi: Call ExitBootServices at least twice
...;> } >>>> >>>> +/* >>>> + * Like get_memory_map but try to use the given buffer first, >>>> reallocate >>>> it if >>>> + * it's too small and always set the allocated size. >>>> + */ >>>> +static EFI_MEMORY_DESCRIPTOR * >>>> +get_memory_map_realloc(EFI_MEMORY_DESCRIPTOR *map, UINTN *allocsize, >>>> + UINTN *nr_entries, UINTN *key, UINTN *desc_sz, >>>> + UINT32 *desc_ver) >>>> +{ >>>> + EFI_STATUS status; &...
2020 Jun 11
2
[PATCH] efi/main: add retry to exit_boot()
...- efi/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/efi/main.c b/efi/main.c index 6a748412..d7fb637e 100644 --- a/efi/main.c +++ b/efi/main.c @@ -1008,16 +1008,81 @@ static int exit_boot(struct boot_params *bp) EFI_MEMORY_DESCRIPTOR *map; EFI_STATUS status; uint32_t e820_type; - UINTN i, nr_entries, key, desc_sz; + UINTN i, nr_entries, key, desc_sz, buf_sz, map_sz; UINT32 desc_ver; + /* + * Call once with empty buffer size to + * see how large the buffer should be. + */ + buf_sz = 0; + status = uefi_call_wrapper(BS-...
2014 Feb 22
2
[PATCH] efi: off-by-one in gdt allocation
.../main.c b/efi/main.c index 94878f9..bdf9353 100644 --- a/efi/main.c +++ b/efi/main.c @@ -450,7 +450,7 @@ struct dt_desc { uint64_t *base; } __packed; -struct dt_desc gdt = { 0x800, (uint64_t *)0 }; +struct dt_desc gdt = { 0x7ff, (uint64_t *)0 }; struct dt_desc idt = { 0, 0 }; static inline EFI_MEMORY_DESCRIPTOR * @@ -852,12 +852,12 @@ static int build_gdt(void) EFI_STATUS status; /* Allocate gdt consistent with the alignment for architecture */ - status = emalloc(gdt.limit, __SIZEOF_POINTER__ , (EFI_PHYSICAL_ADDRESS *)&gdt.base); + status = emalloc(gdt.limit + 1, __SIZEOF_POINTER__ , (EFI_PHYSIC...
2020 Jun 18
0
[PATCH] efi/main: add retry to exit_boot()
...fi/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 11 deletions(-) diff --git a/efi/main.c b/efi/main.c index 6a748412..d7fb637e 100644 --- a/efi/main.c +++ b/efi/main.c @@ -1008,16 +1008,81 @@ static int exit_boot(struct boot_params *bp) EFI_MEMORY_DESCRIPTOR *map; EFI_STATUS status; uint32_t e820_type; - UINTN i, nr_entries, key, desc_sz; + UINTN i, nr_entries, key, desc_sz, buf_sz, map_sz; UINT32 desc_ver; + /* + * Call once with empty buffer size to + * see how large the buffer should be. + */ + buf_sz = 0; + status = uefi_call_wrapper(BS...
2015 Aug 13
3
[syslinux:master] efi/pxe: Reuse handle
...image_handle, handles[i]); > + uefi_call_wrapper(BS->CloseProtocol, 4, pxe_handle, bguid, > + image_handle, pxe_handle); > > free_binding: > free(b); > @@ -454,7 +445,7 @@ get_mem_desc(unsigned long memmap, UINTN desc_sz, int i) > return (EFI_MEMORY_DESCRIPTOR *)(memmap + (i * desc_sz)); > } > > -EFI_HANDLE image_handle; > +EFI_HANDLE image_handle, pxe_handle; > > static inline UINT64 round_up(UINT64 x, UINT64 y) > { > @@ -1295,6 +1286,7 @@ EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table) > } else { &gt...
2015 Nov 21
7
Only 2.5G of RAM available then syslinux64.efi boots 32-bit linux 686-pae
Hello, I'm booting linux-3.16-686-pae kernel (32-bit) via syslinux.efi 64-bit version. After boot linux sees only 2.5G of RAM while system has 32G installed. If I boot the same kernel with GRUB64 efi instead of syslinux then amount of RAM available to linux is 32G. Is this a bug or I'm missing something? syslinux.cfg: label live-686-pae menu label Linux (686-pae) menu