Bug 731529

Summary: grub making uefi calls without aligning stack pointer
Product: [Fedora] Fedora Reporter: Adam Williamson <awilliam>
Component: grubAssignee: Peter Jones <pjones>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 16CC: jonathan, lkundrak, madhu.chinakonda, mads, mishu, pjones, tflink
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: AcceptedBlocker
Fixed In Version: grub-0.97-79.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-10-03 13:57:53 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 713564    

Description Adam Williamson 2011-08-17 15:29:46 EDT
It appears that grub is making calls to the UEFI firmware when the stack pointer is not aligned to a 16-byte boundary (which is required by UEFI). This results in the system failing to boot if its firmware can't handle such calls.
Comment 1 Adam Williamson 2011-08-17 15:30:55 EDT
Proposing as a beta blocker under the criterion "The installer must boot and run on systems using EFI other than Apple Macs ". This is a showstopper for quite a lot of EFI systems.
Comment 2 Tim Flink 2011-09-01 13:37:47 EDT
Discussed in the 2011-08-26 blocker review meeting. Accepted as a Fedora 16 beta blocker as it violates the following beta release criterion [1]:

The installer must boot and run on systems using EFI other than Apple Macs

[1] https://fedoraproject.org/wiki/Fedora_16_Beta_Release_Criteria
Comment 3 Fedora Update System 2011-09-01 16:08:52 EDT
grub-0.97-77.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub-0.97-77.fc16
Comment 4 Fedora Update System 2011-09-06 14:09:54 EDT
Package grub-0.97-77.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub-0.97-77.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/grub-0.97-77.fc16
then log in and leave karma (feedback).
Comment 5 Jurgen Kramer 2011-09-09 07:05:34 EDT
For me this has taken a turn for the worse.

Test with PreBeta TC2 DVD.

On regular PC, boots ok. When selecting an item from the grub menu it takes a long time to see something actually happening. It would appear the system hangs but after a long wait.

macmini 2011: legacy boot: works ok
macmini 2011: efi boot, no go, just hangs. Does not get to grub menu.
macbookair late 2010: legacy boot: works ok
macbookair late 2010: efi boot: long wait, double penguin logo (quiet removed from cmdline) ends up with garbled screen. Not usable
Comment 6 Mads Kiilerich 2011-09-09 08:16:40 EDT
(In reply to comment #5)
Can you tell the exact Mac versions? Such as "Macmini2,1", an identifier which can be found in dmesg or smolt or OS/X system info.

Exactly which image are you using? A 64-bit Fedora image? Which kernel and grub version?

> macmini 2011: legacy boot: works ok

> macmini 2011: efi boot, no go, just hangs. Does not get to grub menu.

FWIW a manually installed grub2-efi works for me on Macmini5,1

Did it work in previous Fedora versions? Can you try do downgrade grub and see if that helps?

> macbookair late 2010: legacy boot: works ok
> macbookair late 2010: efi boot: long wait, double penguin logo (quiet removed
> from cmdline) ends up with garbled screen. Not usable

Did it work in previous Fedora versions?

That does not look like a boot loader issue, so you should file a new kernel bug ... unless it already has been filed - it do look like Bug 650949. dmesg and smolt info from the legacy boot may be relevant.
Comment 7 Jurgen Kramer 2011-09-09 08:43:42 EDT
F16 EFI boot from x86_64 DVD prior to F16 Beta TC2 worked just fine. The upgraded grub seems to cause problems. I have a working F16 installation on my MacMini5,1 with a manual installed grub2-efi (BZ #730124).

My above results (comment #5) are, as mentioned, with the Fedora 16 Beta Test Compose 2 (TC2) x86_64 DVD.

wrt mba (MacBookAir3,1) garbled screen with EFI boot, that is indeed probably BZ #650949. Currently runs F15 x86_64 using legacy boot, graphics work just fine with nouveau. But that is another topic.

To recap my problems are with the current F16 Beta TC2 x86_64 DVD which uses the updated grub (grub-0.97-77.fc16).
Comment 8 Jurgen Kramer 2011-09-09 09:43:13 EDT
Another test with F16 Beta TC2 x86_64 DVD this time on a 2011 imac (iMac12,2).
Selecting EFI boot get me to the grub menu and anaconda starts to a black screen. Booting with nomodeset fails to start X but that's outside of grub.

So 3 types of macs, the newest (2011 macmini) now fails with EFI boot using the lastest grub legacy build. I will retest with the Beta TC1 DVD.
Comment 9 Mads Kiilerich 2011-09-09 10:23:34 EDT
I see almost the same with iMac11,2 and iMac11,3 with grub2-efi. The incorrect nomodeset X autodetection is bug 726159 - and WONTFIX. It is usable for me with nomodeset and xdriver=fbset . The KMS failure is bug 726143. I don't know how similar iMac12,2 is and if it has different issues.
Comment 10 Jurgen Kramer 2011-09-09 10:35:02 EDT
Retested with the F16 Beta TC1 x86_64 DVD which includes grub 0.97-75. I can conform that with this grub EFI boot still works on MacMini5,1 and grub 0.97-77 does not.
Comment 11 Adam Williamson 2011-09-15 00:59:54 EDT
pjones: have you had a look at the regressions here? they're not beta critical as we don't require Mac EFI to work, but obviously it would be best to fix them. should they be filed as a new report?
Comment 12 Jurgen Kramer 2011-09-15 13:09:57 EDT
Fixing Mac EFI would be really appreciated. 
Installing F16 in legacy mode on Macs with Lion is no longer an option. Lion already uses 3 partitions out of the 4 possible old style MBR ones. Fedora wants to create 3 additional ones which does not work with the MBR scheme. GPT is a must.
Comment 13 Peter Jones 2011-09-15 14:20:50 EDT
If what you're seeing is screen corruption, that is almost certainly not this bug, but rather the other changes to support some mac graphics better.  This is testable with -76, but should be addressed in a separate bug.
Comment 14 Jurgen Kramer 2011-09-15 14:34:45 EDT
pjones: I guess you replied to comment #9. For me the problem is not being able to do a EFI boot on the MacMini5,1. This worked with grub-0.97-75.
Comment 15 Adam Williamson 2011-09-15 15:08:13 EDT
jurgen: can you please file a new bug for your issue and link it here? thanks.
Comment 16 Jurgen Kramer 2011-09-16 03:45:49 EDT
OK, I've created BZ #738969 for the problem with EFI boot on MacMini5,1.
Comment 17 Adam Williamson 2011-09-16 14:05:13 EDT
setting VERIFIED, pjones affirms the initial bug is fixed.
Comment 18 Fedora Update System 2011-09-27 17:20:56 EDT
grub-0.97-78.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub-0.97-78.fc16
Comment 19 Fedora Update System 2011-09-28 14:54:08 EDT
Package grub-0.97-78.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub-0.97-78.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/grub-0.97-78.fc16
then log in and leave karma (feedback).
Comment 20 Fedora Update System 2011-09-28 19:39:52 EDT
grub-0.97-79.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/grub-0.97-79.fc16
Comment 21 Tim Flink 2011-09-30 11:15:10 EDT
All of the EFI tests are pretty much working. Other issues would have likely surfaced by now; moving to VERIFIED.
Comment 22 Fedora Update System 2011-10-03 13:57:31 EDT
grub-0.97-79.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.