Summary: | [EFI] boot/loader.efi: miscompilation on Intel Haswell with AVX2 and CPUTYPE=native | ||
---|---|---|---|
Product: | Base System | Reporter: | O. Hartmann <ohartmann> |
Component: | kern | Assignee: | Warner Losh <imp> |
Status: | Closed FIXED | ||
Severity: | Affects Some People | CC: | bcran, emaste, grahamperrin, imp |
Priority: | --- | Keywords: | uefi |
Version: | CURRENT | Flags: | imp:
mfc-stable13+
imp: mfc-stable12+ imp: mfc-stable11- |
Hardware: | amd64 | ||
OS: | Any | ||
Bug Depends on: | |||
Bug Blocks: | 231027 |
Description
O. Hartmann
2014-10-27 19:24:42 UTC
Note, adding -mno-avx2 reported not to help: https://lists.freebsd.org/pipermail/freebsd-current/2014-September/052351.html It appears the flags are not passed into libefi. Does CPUTYPE=haswell also cause this issue? And more importantly, this was from 3 years ago... Can someone confirm the problem still exists... I think that https://svnweb.freebsd.org/changeset/base/326038 fixed this. Can someone who is in a position to test please confirm? For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open" I just tried this again in my WIP branch and loader.efi still hangs with CPUTYPE?=native in src.conf. comparing builds with and without the src.conf setting shows -march=native in the cc commandline I know how to paper over this bug :) Any update @imp? I'm starting to think there's a miscompilation or other build problem in general, too. I've been seeing memory corruption when using the new HTTP boot feature that appears to be in our binary. Does this still happen? https://reviews.freebsd.org/D31187 looks like it is still the case, but I get there by inspection. The above review will fix it, however. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-15 03:06:19 +0000 loader: make sure CPUTYPE is ignored when building CPUTYPE?=native causes -march=native to be added to the command line. When the host machine is haswell, this causes some versions of clang to generate code that can't execute in the efi boot loader environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk is included too early to control with NO_CPU_CFLAGS here. The only other option is to put that in all the Makefiles, and this is less tedious and error prone. PR: 194641 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31187 MFC After: 1 week stand/defs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) Please try out the committed changed. It looks to fix the problem for me. It's in my MFC queue. If there's still an issue, please reopen. Sorry it took so long to resolve. Thanks. ^Triage: Re-open pending merge A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=5ad4296780ded135e8cd48a3877b52c4a7f4cb1d commit 5ad4296780ded135e8cd48a3877b52c4a7f4cb1d Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-21 16:13:10 +0000 loader: make sure CPUTYPE is ignored when building CPUTYPE?=native causes -march=native to be added to the command line. When the host machine is haswell, this causes some versions of clang to generate code that can't execute in the efi boot loader environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk is included too early to control with NO_CPU_CFLAGS here. The only other option is to put that in all the Makefiles, and this is less tedious and error prone. PR: 194641 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31187 MFC After: 1 week (cherry picked from commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc) stand/defs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=ee6908d78275449011f8fb1b6d73bde75c02f705 commit ee6908d78275449011f8fb1b6d73bde75c02f705 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2021-07-15 03:06:08 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2021-07-21 16:16:32 +0000 loader: make sure CPUTYPE is ignored when building CPUTYPE?=native causes -march=native to be added to the command line. When the host machine is haswell, this causes some versions of clang to generate code that can't execute in the efi boot loader environment. Set _CPUCFLAGS= to undo what's done bsd.cpu.mk. bsd.cpu.mk is included too early to control with NO_CPU_CFLAGS here. The only other option is to put that in all the Makefiles, and this is less tedious and error prone. PR: 194641 Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31187 MFC After: 1 week (cherry picked from commit 7a0c0ff7ee25ff1efa3dbedcb20d2c80178639cc) stand/defs.mk | 8 ++++++++ 1 file changed, 8 insertions(+) fixed in all supported branches. I no longer support nanobsd in stable/11 since that branch is at end of life. |