12013-06-12 Nigel Croxon <nigel.croxon@hp.com> 2 Disable MMX and SSE 3 4 GCC 4.8.0 adds some optimizations that will use movups/movaps (and use 5 %xmm* registers) when they're faster, and of course that won't work at 6 all since UEFI firmwares aren't guaranteed to initialize the mmx/sse 7 instructions. 8 9 This will be even more annoying, since most UEFI firmwares don't 10 initialize the #DE or #UD trap handlers, and your backtrace will be a 11 random path through uninitialized memory, occasionally including 12 whatever address the IDT has for #UD, but also addresses like "0x4" and 13 "0x507" that you don't normally expect to see in your call path. 14 15 Signed-off-by: Peter Jones <pjones@redhat.com> 16 17 Author: Nigel Croxon <nigel.croxon@hp.com> 18 Date: Wed Jun 12 10:29:40 2013 -0400 19 20 bug in make 3.82 expand to odd values 21 22 Some Makefiles tickle a bug in make 3.82 that cause libefi.a 23 and libgnuefi.a dependencies to expand to the odd values: 24 25 libefi.a: boxdraw.o) smbios.o) ... 26 libgnuefi.a(reloc_x86_64.o: 27 28 The patch replaces libgnuefi.a($(OBJS)) & libefi.a($(OBJS)) 29 with an equivalent expansion that should work with any make 30 that supports $(patsubst). 31 32 Author: Nigel Croxon <nigel.croxon@hp.com> 33 Date: Wed Jun 12 09:53:01 2013 -0400 34 35 support .text.* sections on x86_64 36 37 Group them in .text. Also add vague linkage sections in .text. 38 39 Signed-off-by: David Decotigny <decot@googlers.com> 40 41 Author: Nigel Croxon <nigel.croxon@hp.com> 42 Date: Wed Jun 12 09:51:36 2013 -0400 43 44 cleanup and fix Make.defaults 45 46 Reorder variables in Make.defaults so that they are grouped by 47 functions. Also fixed ifeq (x,y) to have required syntax and make it 48 work for ARCH amd64->x86_64 renaming on BSD. Also provides top-level 49 Makefile with a "mkvars" target that displays effective variables. 50 51 Signed-off-by: David Decotigny <decot@googlers.com> 52 53 Author: Nigel Croxon <nigel.croxon@hp.com> 54 Date: Wed Jun 12 09:47:16 2013 -0400 55 56 automatically determine number of uefi_call_wrapper() args on x86_64 57 58 Instead of asking developers to explicitly pass the number of 59 parameters to the functions that get called, we determine them 60 automatically at preprocessing time. This should result in more 61 robust code. 62 63 Argument va_num is now ignored in x86_64 code, both with and 64 without HAVE_USE_MS_ABI. 65 66 Credits to the macro magic given in the comments. 67 68 Signed-off-by: David Decotigny <decot@googlers.com> 69 70 Author: Nigel Croxon <nigel.croxon@hp.com> 71 Date: Wed Jun 12 09:38:10 2013 -0400 72 73 fix parameter-passing corruption on x86_64 for >= 5 args 74 75 On x86_64 without HAVE_USE_MS_ABI support, uefi_call_wrapper() is a 76 variadic function. Parameters >=5 are copied to the stack and, when 77 passed small immediate values (and possibly other parameters), gcc 78 would emit a movl instruction before calling uefi_call_wrapper(). As a 79 result, only the lower 32b of these stack values are significant, the 80 upper 32b potentially contain garbage. Considering that 81 uefi_call_wrapper() assumes these arguments are clean 64b values 82 before calling the efi_callX() trampolines, the latter may be passed 83 garbage. This makes calling functions like 84 EFI_PCI_IO_PROTOCOL.Mem.Read()/Write() or BS->OpenProtocol() quite 85 unreliable. 86 87 This patch fixes this by turning uefi_call_wrapper() into a macro that 88 allows to expose the efi_callX() trampoline signatures to the callers, 89 so that gcc can know upfront that it has to pass all arguments to 90 efi_callX() as clean 64b values (eg. movq for immediates). The 91 _cast64_efi_callX macros are just here to avoid a gcc warning, they do 92 nothing otherwise. 93 94 Signed-off-by: David Decotigny <decot@googlers.com> 95 96 Author: noxorc <nigel.croxon@hp.com> 97 Date: Wed May 15 15:26:16 2013 -0400 98 99 - Removes the ElfW() macro usage from reloc_ia32.c and reloc_x86_64.c. These 100 macros only exist in link.h on Linux. On FreeBSD, the equivalent macro is 101 __ElfN(). But the macro usage is redundant. You're only going to compile the 102 ia32 file for IA32 binaries and the x86_64 file for X64 binaries. If you had 103 just one file built for both cases, then using the macro might make more 104 sense. 105 106 - Removes the "#define foo_t efi_foo_t" macros from reloc_ia32.c and 107 reloc_x86_64.c. 108 109 - Modifies inc/x86_64/efibind.h and inc/ia32/efibind.h to use the new 110 definitions for uint64_t, int64_t and int8_t. The 64-bit types are now defined 111 as: 112 113 typedef int __attribute__((__mode__(__DI__))) int64_t; 114 typedef unsigned int __attribute__((__mode__(__DI__))) uint64_t; 115 116 This removes the conflict between the host types dragged in by elf.h and the 117 type definitions in efibind.h that made the #define foo_t efi_foo_t" hack 118 necessary. Also, int8_t is now defined as signed char instead of just char 119 (assuming char == signed char is apparently not good enough). 120 121 - Also modifies these files to use stdint.h instead of stdint-gcc.h. It's 122 unclear if this is completely correct, but stdint-gcc.h is not present with 123 all GCC installs, and if you use -std=c99 or later you will force this case to 124 be hit. This also can break clang, which doesn't have a stdint-gcc.h at all. 125 126 - Removes the #include of <link.h> from reloc_ia32.c and reloc_x86_64.c (since 127 with the previous changes it's not needed anymore). 128 129 - Places the #include of <elf.h> after #include <efi>/#include <efilib.h> so 130 that we know the types will always be defined properly, in case you build on a 131 system where <elf.h> doesn't automatically pull in the right header files to 132 define all the needed types. (This actually happens on VxWorks. It's harmless 133 elsewhere. If you don't care about VxWorks, you can leave this out.) 134 135 - Modifies setjmp_ia32.S and setjmp_x86_64.S so to change "function" to 136 @function. The clang compiler doesn't like the former. Clang and GCC both like 137 the latter. 138 139 - Modifles Make.defaults so that if ARCH is detected as "amd64," it's changed 140 to "x86_64." It happens that uname -m on 64-bit FreeBSD reports the former 141 rather than the latter, which breaks the build. This may also be the case on 142 some other OSes. There's a way to force uname(1) to return x86_64 as the 143 machine type, but this way is a little friendlier. 144 145 - Creates gnuefi/elf_ia32_fbsd_efi.lds which specifies the object file type as 146 elf-ia32-freebsd. This is required for building on FreeBSD/i386, not just 147 FreeBSD/amd64. 148 149 - Modifies apps/Makefile to always use 150 $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds when building on either 32-bit or 151 64-bit FreeBSD instead of just for the x86_64 case. 152 153 - Changed LDFLAGS in Make.defaults to include --no-undefined. This will cause 154 linking to fail if there are any unsatisfied symbols when creating foo.so 155 during any of the app builds, as opposed to just silently succeeding and 156 producing an unusable binary. 157 158 - Changed CFLAGS to include -ffreestanding -fno-stack-protector -fno-stack- 159 check. This prevents clang from inserting a call to memset() when compiling 160 the RtZeroMem() and RtSetMem() routines in lib/runtime/efirtlib.c and guards 161 against the native compiler in some Linux distros from adding in stack 162 checking code which relies on libc help that isn't present in the EFI runtime 163 environment. 164 165 This does the following: 166 167 - Cleans up the ia32 and x86-64 relocation code a bit (tries to break the 168 dependency between the host ELF headers and the EFI runtime environment) 169 - Avoids the dependency on stdint-gcc.h which may not always be available 170 - Allows GNU EFI to build out of the box on both FreeBSD/i386 and 171 FreeBSD/amd64 172 - Allows GNU EFI to build out of the box with either GCC or clang on 173 FreeBSD/i386 and FreeBSD/amd64 9.0 and later. 174 - Makes things a little easier to port to VxWorks 175 - Avoids creating un-runable binaries with unresolved symbol definitions 176 (which can be very confusing to debug) 177 178 Author: noxorc <nigel.croxon@hp.com> 179 Date: Wed May 8 16:29:45 2013 -0400 180 181 Add the definitions for TCP, UDP and IP, for both IPv4 and IPv6. 182 183 1842013-05-02 Nigel Croxon <nigel.croxon@hp.com> 185 * Chnage from Matt Fleming <matt.fleming@intel.com> 186 - Preparation for adding the networking protocol definitions. 187 Add the service binding protocol. 188 1892013-02-21 Nigel Croxon <nigel.croxon@hp.com> 190 * Change from Peter Jones <pjones@redhat.com> 191 - Previously we were incorrectly passing 3 functions with 192 the System V ABI to UEFI functions as EFI ABI functions. 193 Mark them as EFIAPI so the compiler will (in our new 194 GNU_EFI_USE_MS_ABI world) use the correct ABI. 195 - These need to be EFIAPI functions because in some cases 196 they call ST->ConOut->OutputString(), which is an EFIAPI 197 function. (Which means that previously in cases that 198 needed "cdecl", these didn't work right.) 199 - If the compiler version is new enough, and GNU_EFI_USE_MS_ABI 200 is defined, use the function attribute ms_abi on everything 201 defined with "EFIAPI". Such calls will no longer go through 202 efi_call*, and as such will be properly type-checked. 203 - Honor PREFIX and LIBDIR correctly when passed in during the build. 204 - Add machine type defines for i386, arm/thumb, ia64, ebc, x86_64. 205 - __STDC_VERSION__ never actually gets defined unless there's a 206 --std=... line. So we were accidentally defining lots of c99 207 types ourself. Since it's 2012, use --std=c11 where appropriate, 208 and if it's defined and we're using gcc, actually include gcc's 209 stdint definitions. 210 - New test application added: route80h. This is a test program 211 for PciIo. It routes ioport 80h on ICH10 to PCI. This is also 212 useful on a very limited set of hardware to enable use of 213 a port 80h debug card. 214 - New test applcation added: modelist. This lists video modes 215 the GOP driver is showing us. 216 * Change from Finnbarr Murphy 217 - https://sourceforge.net/p/gnu-efi/feature-requests/2/ 218 Please add the following status codes to <efierr.h> 219 EFI_INCOMPATIBLE_VERSION 25 220 EFI_SECURITY_VIOLATION 26 221 EFI_CRC_ERROR 27 222 EFI_END_OF_MEDIA 28 223 EFI_END_OF_FILE 31 224 EFI_INVALID_LANGUAGE 32 225 EFI_COMPROMISED_DATA 33 226 * Change from SourceForge.net Bug report 227 - https://sourceforge.net/p/gnu-efi/bugs/5/ 228 BufferSize is a UINT64 *. The file shipped with GNU EFI is from 229 1998 whereas the latest one is from 2004. I suspect Intel changed 230 the API in order handle 64-bit systems. 231 * Change from Felipe Contreras <felipe.contreras@gmail.com> 232 - The current code seems to screw the stack at certain points. 233 Multiple people have complained that gummiboot hangs right away, 234 which is in part the fault of gummiboot, but happens only 235 because the stack gets screwed. x86_64 EFI already aligns the 236 stack, so there's no need for so much code to find a proper 237 alignment, we always need to shift by 8 anyway. 238 * Change from A. Steinmetz 239 - https://sourceforge.net/p/gnu-efi/patches/1/ 240 The patch prepares for elilo to support uefi pxe over ipv6 241 See uefi spec 2.3.1 errata c page 963 as reference. 242 Verfied on an ASUS Sabertooth X79 BIOS Rev. 2104 system which 243 is able to do an IPv6 UEFI PXE boot. 244 * Release 3.0t 245 2462012-09-21 Nigel Croxon <nigel.croxon@hp.com> 247 * Change from Peter Jones <pjones@redhat.com> 248 - EFI Block I/O protocol versions 2 and 3 provide more information 249 regarding physical disk layout, including alingment offset at the 250 beginning of the disk ("LowestAlignedLba"), logical block size 251 ("LogicalBlocksPerPhysicalBlock"), and optimal block transfer size 252 ("OptimalTransferLengthGranularity"). 253 * Release 3.0r 254 2552012-04-30 Nigel Croxon <nigel.croxon@hp.com> 256 * Change from Matt Fleming <matt.fleming@intel.com> 257 - The .reloc section is now 4096-byte boundary for x86_64. 258 Without this patch the .reloc section will not adhere to 259 the alignment value in the FileAlignment field (512 bytes by 260 default) of the PE/COFF header. This results in a signed 261 executable failing to boot in a secure boot environment. 262 * Release 3.0q 263 2642011-12-12 Nigel Croxon <nigel.croxon@hp.com> 265 * Changes from Fenghua Yu <fenghua.yu@intel.com> 266 - This fixes redefined types compilation failure for tcc.c on x86_64 machines. 267 * Release 3.0p 268 2692011-11-15 Nigel Croxon <nigel.croxon@hp.com> 270 * Changes from Darren Hart <dvhart@linux.intel.com> 271 - Conditionally assign toolchain binaries to allow overriding them. 272 - Force a dependency on lib for gnuefi. 273 * Release 3.0n 274 2752011-08-23 Nigel Croxon <nigel.croxon@hp.com> 276 * Changes from Peter Jones <pjones@redhat.com> 277 - Add guarantee 16-byte stack alignment on x86_64. 278 - Add routine to make callbacks work. 279 - Add apps/tcc.efi to test calling convention. 280 * Release 3.0m 281 2822011-07-22 Nigel Croxon <nigel.croxon@hp.com> 283 * Changed Makefiles from GPL to BSD. 284 * Changes from Peter Jones <pjones@redhat.com> 285 - Add ifdefs for ia64 to mirror ia32 and x86-64 so that 286 one can build with GCC. 287 - Add headers for PciIo. 288 - Add the UEFI 2.x bits for EFI_BOOT_SERVICES 289 - Add an ignore for .note.GNU-stack section in X86-64 linker maps. 290 * Release 3.0l 291 2922011-04-07 Nigel Croxon <nigel.croxon@hp.com> 293 * Change license from GPL to BSD. 294 * Release 3.0j 295 2962009-09-12 Julien BLACHE <jb@jblache.org> 297 * Add support for FreeBSD. 298 * Release 3.0i 299 3002009-09-11 Julien BLACHE <jb@jblache.org> 301 * Fix elf_ia32_efi.lds linker script to be compatible with the new 302 linker behaviour. Patch from the RedHat bugzilla 492183. 303 3042009-06-18 Nigel Croxon <nigel.croxon@hp.com> 305 * Release 3.0h 306 3072008-11-06 Nigel Croxon <nigel.croxon@hp.com> 308 * Fix to not having any relocations at all. 309 3102008-09-18 Nigel Croxon <nigel.croxon@hp.com> 311 * Use LIBDIR in makefiles 312 * Add setjmp/longjmp 313 * Fixes incorrect section attribute in crt0-efi-ia32.S 314 * Adds value EfiResetShutdown to enum EFI_RESET_TYPE 315 * Fixes a RAW warning in reloc_ia64.S 316 * Adds the USB HCI device path structure in the headers 317 patches were supplied by Peter Jones @ RedHat 318 3192008-02-22 Nigel Croxon <nigel.croxon@hp.com> 320 * Added '-mno-red-zone' to x68_64 compiles. 321 Patch provided by Mats Andersson. 322 3232008-01-23 Nigel Croxon <nigel.croxon@hp.com> 324 * release 3.0e to support x86_64 325 EFI calling convention, the stack should be aligned in 16 bytes 326 to make it possible to use SSE2 in EFI boot services. 327 This patch fixes this issue. Patch provided by Huang Ying from Intel. 328 3292007-05-11 Nigel Croxon <nigel.croxon@hp.com> 330 * release 3.0d to support x86_64 from Chandramouli Narayanan 331 from Intel and based on 3.0c-1 332 3332006-03-21 Stephane Eranian <eranian@hpl.hp.com> 334 * merged patch to support gcc-4.1 submitted by 335 Raymund Will from Novell/SuSE 336 3372006-03-20 Stephane Eranian <eranian@hpl.hp.com> 338 * updated ia-64 and ia-32 linker scripts to 339 match latest gcc. The new gcc may put functions in 340 .text* sections. patch submitted by H.J. Lu from Intel. 341 3422004-11-19 Stephane Eranian <eranian@hpl.hp.com> 343 * added patch to ignore .eh_frame section for IA-32. Patch 344 submitted by Jim Wilson 345 3462004-09-23 Stephane Eranian <eranian@hpl.hp.com> 347 * added patch to discard unwind sections, newer toolchains 348 complained about them. Patch submitted by Jesse Barnes from SGI. 349 3502003-09-29 Stephane Eranian <eranian@hpl.hp.com> 351 * updated elf_ia64_efi.lds to reflect new data sections 352 created by gcc-3.3. Patch provided by Andreas Schwab from Suse. 353 3542003-06-20 Stephane Eranian <eranian@hpl.hp.com> 355 * updated elf_ia64_efi.lds and elf_ia32_efi.lds to include 356 new types data sections produced by recent version of gcc-3.x 357 3582002-02-22 Stephane Eranian <eranian@hpl.hp.com> 359 * release 3.0a 360 * modified both IA-64 and IA-32 loader scripts to add support for the 361 new .rodata sections names (such as rodata.str2.8). Required 362 for new versions of gcc3.x. 363 3642001-06-20 Stephane Eranian <eranian@hpl.hp.com> 365 * release 3.0 366 * split gnu-efi package in two different packages: the libary+include+crt and the bootloader. 367 * removed W2U() hack and related files to get from wide-char to unicode. 368 * Use -fshort-wchar option for unicode. 369 * restructured Makefiles now install under INSTALLROOT. 370 3712001-04-06 Stephane Eranian <eranian@hpl.hp.com> 372 373 * incorporated patches from David and Michael Johnston at Intel 374 to get the package to compile for IA-32 linux target. 375 376 * Fixed ELILO to compile for Ia-32 (does not execute yet, though): 377 Makefile and start_kernel() function. 378 3792001-04-06 Andreas Schwab <schwab@suse.de> 380 381 * Fixed config.c to 382 get the timeout directive to do something. implemented the global 383 root= directive. 384 385 * Fix the efi_main() to deal with the -C option properly 386 3872001-04-05 Stephane Eranian <eranian@hpl.hp.com> 388 389 * update efi library to latest EFI toolkit 1.02 as distributed 390 by Intel. Fixed header + library files to compile with GCC 391 392 * merged ELI and LILO (as of gnu-efi-1.1) together, mostly 393 taking the config file feature of ELI. 394 395 * renamed LILO to ELILO to make the distinction 396 397 * restructured code to make it easier to understand and maintain 398 399 * fixed FPSWA driver checking and loading: we try all possible 400 files and let the driver itself figure out if it is the most 401 recent. 402 * added support for compression (gzip) but keep support for plain 403 ELF image. ELILO autodetects the format 404 405 * change the way the kernel is invoked. Now we call it in 406 physical memory mode. This breaks the dependency between the 407 kernel code and the loader. No more lilo_start.c madness. 408 409 * changed the way the boot_params are passed. We don't use the 410 ZERO_PAGE_ADDR trick anymore. Instead we use EFI runtime memory. 411 The address of the structure is passed to the kernel in r28 412 by our convention. 413 414 * released as gnu-efi-2.0 415 4162001-04-03 David Mosberger <davidm@hpl.hp.com> 417 418 * gnuefi/reloc_ia32.c (_relocate): Change return type from "void" 419 to "int". Return error status if relocation fails for some 420 reason. 421 422 * gnuefi/elf_ia32_efi.lds: Drop unneeded ".rel.reloc" section. 423 424 * gnuefi/crt0-efi-ia32.S (_start): Exit if _relocate() returns with 425 non-zero exit status. 426 427 * inc/ia32/efibind.h [__GNUC__]: Force 8-byte alignment for 64-bit 428 types as that is what EFI appears to be expecting, despite the 429 "#pragma pack()" at the beginning of the file! 430 4312001-03-29 David Mosberger <davidm@hpl.hp.com> 432 433 * gnuefi/reloc_ia32.c: Add a couple of defines to work around 434 libc/efilib collision on uint64_t et al. 435 (_relocate): Use ELF32_R_TYPE() instead of ELFW(R_TYPE)(). 436 437 * gnuefi/crt0-efi-ia32.S (dummy): Add a dummy relocation entry. 438 4392001-03-29 David Mosberger <davidm@hpl.hp.com> 440 441 * gnuefi/reloc_ia32.c: Add a couple of defines to work around 442 libc/efilib collision on uint64_t et al. 443 (_relocate): Use ELF32_R_TYPE() instead of ELFW(R_TYPE)(). 444 445 * gnuefi/crt0-efi-ia32.S (dummy): Add a dummy relocation entry. 446 4472000-10-26 David Mosberger <davidm@hpl.hp.com> 448 449 * gnuefi/elf_ia64_efi.lds: Mention .rela.sdata. 450 451 * Make.defaults (CFLAGS): Remove -nostdinc flags so we can pick 452 up the C compiler's stdarg.h. 453 454 * inc/stdarg.h: Remove this file. It's not correct for gcc (nor 455 most other optimizing compilers). 456 4572000-10-10 Stephane Eranian <eranian@hpl.hp.com> 458 459 * cleaned up the error message and printing of those. 460 * added support to load the FPSWA from a file in case support is not 461 present in the firmware already 462 * fixed split_args() to do the right thing when you have leading spaces 463 before kernel name 464 * changed the argify() function to rely on \0 instead of LoadOptionSize 465 as the field seems to be broken with current firmware 466 * bumped version to 1.0 467 4682000-10-04 David Mosberger <davidm@hpl.hp.com> 469 470 * gnuefi/reloc_ia64.S: Reserve space for up to 750 function descriptors. 471 472 * gnuefi/elf_ia64_efi.lds: Add .sdata section for small data and 473 put __gp in the "middle" of it. 474 475 * gnuefi/crt0-efi-ia64.S (_start): Use movl/add to load 476 gp-relative addresses that could be out of the range of the addl 477 offset. 478 * gnuefi/reloc_ia64.S (_relocate): Ditto. 479 480 * apps/Makefile: Remove standard rules and include Make.rules instead. 481 * lilo/Makefile: Ditto. 482 483 * Make.rules: New file. 484 4852000-08-04 Stephane Eranian <eranian@hpl.hp.com> 486 * released version 0.9 487 * incorporated ACPI changes for Asuza by NEC < kouchi@hpc.bs1.fc.nec.co.jp> 488 * added support for initrd (-i option) original ELI code from Bill Nottingham <notting@redhat.com>) 489 * lots of cleanups 490 * got rid of #ifdef LILO_DEBUG and uses macro instead 491 * fix a few extra memory leaks in create_boot_params() 492 * added exit capability just before starting the kernel 493 4942000-06-22 David Mosberger <davidm@hpl.hp.com> 495 496 * gnuefi/elf_ia64_efi.lds: Add .srodata, .ctors, .IA64.unwind, 497 .IA64.unwind_info to .data section and .rela.ctors to .rela 498 section. 499 5002000-04-03 David Mosberger <davidm@hpl.hp.com> 501 502 * lilo/lilo.c (LILO_VERSION): Up version number to 0.9. 503 504 * gnuefi/elf_ia64_efi.lds: Include .IA_64.unwind and 505 .IA_64.unwind_info in .data segment to avoid EFI load error 506 "ImageAddress: pointer outside of image" error due to the .dynsym 507 relocations against these sections. 508 509 * ChangeLog: Moved from lilo/ChangeLogs. 510 511 * gnuefi/reloc_ia64.S: fixed typo: .space directive had constant 512 100 hardcoded instead of using MAX_FUNCTION_DESCRIPTORS 513 macro. Duh. 514 515Fri Mar 17 15:19:18 PST 2000 Stephane Eranian <eranian@hpl.hp.com> 516 517 * Released 0.8 518 * replace the getopt.c with new version free with better license 519 * created a documentation file 520 * fix a couple of memory leaks 521 * code cleanups 522 * created a separate directory for lilo in the gnu-efi package. 523 * added support for the BOOT_IMAGE argument to kernel 524 * default is to build natively now 525