* include/grub/i386/pc/memory.h: Decrease
GRUB_MEMORY_MACHINE_SCRATCH_SIZE and increase
GRUB_MEMORY_MACHINE_PROT_STACK_SIZE.
The binary doesn't change (checked). It's more to better reflect actual
usage.
* grub-core/kern/x86_64/efi/callwrap.S: Fix stack alignment.
Previously we misaligned stack by 8 in startup.S and compensated
for it in callwrap.S. According to ABI docs (EFI and sysv amd64)
right behaviour is to align stack in startup.S and keep it aligned
in callwrap.S. startup.S part was committed few commits before. This
takes care of callwrap.S.
Reported by: Gary Lin.
Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem
when rest of GRUB is compiled for hisher stepping. Instead use
.set mips3/.set mips1 around cache and sync opcodes.
Add automated filesystem checking based on scripts I've used now for
quite some time locally. Most of the test require root so they are
skipped when run without necessarry privelegies.
Josh Triplett [Tue, 19 Nov 2013 13:31:40 +0000 (14:31 +0100)]
* grub-core/kern/x86_64/efi/startup.S (_start): Align the stack to a
16-byte boundary, as required by the x86-64 ABI, before calling
grub_main. In some cases, GCC emits code that assumes this
alignment, which crashes if not aligned. The EFI firmware is also
entitled to assume that stack alignment without checking.
Josh Triplett [Mon, 18 Nov 2013 17:00:52 +0000 (18:00 +0100)]
* grub-core/mmap/efi/mmap.c (grub_mmap_register): Round up/down to
4k page boundaries as expected by firmware rather than 1k
boundaries.
(grub_mmap_malign_and_register): Likewise.
* grub-core/kern/mm.c (grub_real_malloc): Decrease cut-off of moving the
pointer to 32K. This is the size of cache element which is the most
common allocation >1K. This way the pointer is always around blocks
of 32K and so we keep performance while decreasing fragmentation.
Colin Watson [Mon, 18 Nov 2013 16:16:33 +0000 (16:16 +0000)]
* tests/gzcompress_test.in: Skip if gzip is not installed (unlikely,
but for symmetry).
* tests/lzocompress_test.in: Skip if lzop is not installed.
* tests/xzcompress_test.in: Skip if xz is not installed.
* grub-core/kern/mm.c (grub_real_malloc): Don't update the pointer to
current memory when allocating large chunks. This significantly
decreases memory fragmentation.
* tests/util/grub-shell.in: For powerpc tests put the CD-ROM as primary
master since with some combinations of qemu and firmware only primary
IDE channel is available.
* grub-core/tests/gfxterm_menu.c: Skip high-resolution tests on
low-memory platforms where we don't have enough memory for them.
* grub-core/tests/videotest_checksum.c: Likewise.
* grub-core/lib/powerpc/setjmp.S (grub_setjmp): Save r31.
(grub_longjmp): Restore r31.
* include/grub/powerpc/setjmp.h (grub_jmp_buf): Reserve space for r31.
* grub-core/tests/cmdline_cat_test.c (cmdline_cat_test): Ignore errors
of loading gfxterm as gfxterm is embed in kernel on some platforms.
* grub-core/tests/gfxterm_menu.c (gfxterm_menu): Likewise.
Load gfxmenu.
Rewrite grub-install, grub-mkrescue, grub-mkstandalone and grub-mknetdir
the function of these files exceeds what can be sanely handled in shell
in posix-comaptible way. Also writing it in C extends the functionality
to non-UNIX-like OS and minimal environments.
* grub-core/kern/arm/cache.S: Don't switch back to ARM mode when
compiling to thumb2.
* grub-core/kern/arm/cache_armv7.S: Likewise.
* grub-core/lib/arm/setjmp.S: Likewise.
We have only 92K of stack and using over 4K per frame is wasteful
* grub-core/script/yylex.l (yyalloc), (yyfree), (yyrealloc): Declare
as macros so that compiler would remove useless structure on stack.
Better solution would be to fix flex not to put this structure on
the stack but flex is external program.
We have only 92K of stack and using over 4K per frame is wasteful
* grub-core/fs/jfs.c (getblk): Allocate on heap rather than on
stack. Note: this function is recursive.
(grub_jfs_read_inode): Read only part we care about.
Leif Lindholm [Sat, 16 Nov 2013 12:15:53 +0000 (12:15 +0000)]
arm: fix u-boot port syscall interface va_arg handling
Commit c9cd02c broke the u-boot syscall API for va_args that spill over
to the stack, causing the disk support to stop working. This patch
resolves the problem, while keeping the new, cleaner transition_space
handling.
Andrey Borzenkov [Sat, 16 Nov 2013 13:03:20 +0000 (17:03 +0400)]
restore -nostdlib for libgcc symbols tests
Commit 24f4e57c4684471da088c504dec0380886eece0c plugged leakage
of CFLAGS between individual tests, which broke test for libgcc
symbols. It needs -nostdlib which was set in previous test and
inherited before. Set it explicitly.
On upcoming arm64 port libgcc ctz* are not usable in standalone
environment. Since we need ctz* for this case and implementation is
in C we may as well use it on all concerned platforms.
Colin Watson [Thu, 14 Nov 2013 16:45:27 +0000 (16:45 +0000)]
* util/grub-install_header: Set localedir here, since this file is
where it's used.
* util/grub-install.in: Remove setting of localedir.
* util/grub-mkrescue.in: Likewise.
* configure.ac: Move nm checks to the end.
Call grub_PROG_NM_WORKS.
* acinclude.m4: New check grub_PROG_NM_WORKS.
Use $TARGET_CFLAGS -c when compiling test binary.
* grub-core/kern/arm/cache_armv6.S: Remove special handling for
clang (not necessarry with -no-integrated-as).
* include/grub/symbol.h [__arm__]: Likewise.