Bug 859223

Summary: grub2 must support IBM client architecture (CAS) reboot
Product: [Fedora] Fedora Reporter: IBM Bug Proxy <bugproxy>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 18CC: dcantrell, dennis, gustavold, jkachuck, mads, pjones, wgomerin
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: All   
Fixed In Version: grub2-2.00-10.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-30 23:29:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 846990    
Description Flags
IBM CAS reboot implementation patch using pjones's guideline none

Description IBM Bug Proxy 2012-09-20 20:21:38 UTC
There are cases where the POWER firmware must reboot in order to support specific features requested by a kernel. The kernel calls ibm,client-architecture-support and it may either return or reboot with the new feature set. eg:

Calling ibm,client-architecture-support.../
Elapsed time since release of system processors: 70959 mins 50 secs
Welcome to GRUB!

Right now we get dumped back into the grub menus and we will end up booting the default kernel the second time around if the user doesn't catch it in time.

grub2 must catch and handle this by immediately booting the same kernel again. As an example the yaboot code does this before booting a kernel:

     prom_set_options("boot-last-label", bootlastlabel,
                      strlen(bootlastlabel) + 1);

And it checks a couple of properties to see if the reboot count is above 0:

     if (prom_get_options("ibm,client-architecture-support-reboot",fw_nbr_reboots, FW_NBR_REBOOTSZ) == -1 )
        prom_get_options("ibm,fw-nbr-reboots",fw_nbr_reboots, FW_NBR_REBOOTSZ);
     fw_reboot_cnt = simple_strtol(fw_nbr_reboots,&endp,10);
     if (fw_reboot_cnt > 0L)
          prom_get_options("boot-last-label", bootlastlabel, BOOTLASTSZ);

I tested Paulo's patch and it works great. Thanks Paulo!

A simple test case for this is to boot an old kernel (I used 2.6.31) and then reboot into Fedora's latest kernel. It starts booting, then you see the client-architecture-support call and a reboot. This time grub boots directly into the latest selected kernel. Even when I edited the menu entry (for additional kernel parameters) my changes were saved and reused on the second boot.

Comment 1 IBM Bug Proxy 2012-09-20 20:21:55 UTC
Created attachment 615112 [details]
IBM CAS reboot implementation patch using pjones's guideline

Comment 2 Fedora Update System 2012-10-18 18:07:24 UTC
grub2-2.00-10.fc18 has been submitted as an update for Fedora 18.

Comment 3 Fedora Update System 2012-10-19 15:41:33 UTC
Package grub2-2.00-10.fc18:
* should fix your issue,
* was pushed to the Fedora 18 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing grub2-2.00-10.fc18'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2012-10-22 19:53:49 UTC
grub2-2.00-11.fc18 has been submitted as an update for Fedora 18.

Comment 5 Gustavo Luiz Duarte 2012-10-30 23:29:48 UTC
grub2-2.00-10.fc18 works fine.