From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UyoCd-000104-D1 for mharc-grub-devel@gnu.org; Mon, 15 Jul 2013 15:12:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58085) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyoCY-0000xU-JV for grub-devel@gnu.org; Mon, 15 Jul 2013 15:12:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UyoCU-0007J8-WC for grub-devel@gnu.org; Mon, 15 Jul 2013 15:12:50 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:32817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UyoCU-0007IX-Sg for grub-devel@gnu.org; Mon, 15 Jul 2013 15:12:46 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jul 2013 20:12:43 +0100 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e8.ny.us.ibm.com (192.168.1.108) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 15 Jul 2013 20:12:41 +0100 Received: from d01relay05.pok.ibm.com (d01relay05.pok.ibm.com [9.56.227.237]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 3719138C805E for ; Mon, 15 Jul 2013 15:12:39 -0400 (EDT) Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay05.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r6FJCeoO112530 for ; Mon, 15 Jul 2013 15:12:40 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r6FJCdF5032264 for ; Mon, 15 Jul 2013 16:12:39 -0300 Received: from imap.linux.ibm.com (maier.raleigh.ibm.com [9.37.253.158]) by d01av03.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id r6FJCbqZ031977 for ; Mon, 15 Jul 2013 16:12:37 -0300 Received: by imap.linux.ibm.com (Postfix, from userid 48) id 96D021600002; Mon, 15 Jul 2013 15:12:37 -0400 (EDT) Received: from 9.8.13.62 ([9.8.13.62]) by imap.linux.ibm.com (Horde Framework) with HTTP; Mon, 15 Jul 2013 15:12:37 -0400 Date: Mon, 15 Jul 2013 15:12:37 -0400 Message-ID: <20130715151237.Horde.RWhdgZir309R5EmlUhPR2GA@imap.linux.ibm.com> From: Paulo Flabiano Smorigo/Brazil/IBM To: grub-devel@gnu.org Subject: [PATCH] powerpc: fix startup bss cleaning User-Agent: Internet Messaging Program (IMP) H4 (5.0.22) Content-Type: multipart/mixed; boundary="=_REgcEZir309R5EmlUe3h2GA" MIME-Version: 1.0 X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13071519-0320-0000-0000-000000480E83 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 32.97.182.138 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Jul 2013 19:12:53 -0000 This message is in MIME format. --=_REgcEZir309R5EmlUe3h2GA Content-Type: text/plain; charset=ISO-8859-1; format=flowed; DelSp=Yes Content-Disposition: inline Hi, The trunk version of GRUB is crashing on power machines. Openfirmware returns the following message: Welcome to GRUB! DEFAULT CATCH!, exception-handler=fff00700 at %SRR0: 0000000000003940 %SRR1: 0000000000083002 Open Firmware exception handler entered from non-OF code Client's Fix Pt Regs: 00 000000000020a074 0000000001a3ff40 0000000000000000 00000000001e3de0 04 00000000001e3eb0 0000000000000004 00000000001d1fd0 000000000000007c 08 0000000000004000 0000000000003940 00000000001d4810 0000000001a3ff40 0c 0000000040000084 0000000000000000 0000000000000000 0000000000000000 10 0000000000000000 0000000000000000 0000000000000000 0000000000000000 14 0000000000c00000 0000000000000008 0000000000000000 0000000000000000 18 0000000000000000 0000000000000000 0000000000000000 0000000000000000 1c 0000000000219620 00000000001e3eb0 0000000000219620 00000000001e3de0 Special Regs: %IV: 00000700 %CR: 20000084 %XER: 00000000 %DSISR: 00000000 %SRR0: 0000000000003940 %SRR1: 0000000000083002 %LR: 000000000020a0a4 %CTR: 0000000000003940 %DAR: 0000000000000000 Virtual PID = 0 ok 0 > After some investigation, my colleague Gustavo Duarte discover that the problem is caused by grub_file_filters_enabled. Its initial value isn't zero: grub_file_filters_enabled[0]@0x219614 0x0 grub_file_filters_enabled[1]@0x219618 0x0 grub_file_filters_enabled[2]@0x21961c 0x0 grub_file_filters_enabled[3]@0x219620 0x3940 Using objdump I noticed that this variable is the last one from the bss section: $objdump -t grub-core/kernel.exec | sort ... 00218d14 l O .bss 00000004 count.2347 00218d18 l O .bss 00000100 buf.1909 00218e18 l O .bss 00000100 linebuf 00218f18 g O .bss 00000100 grub_errmsg 00219018 g O .bss 00000010 grub_file_filters_all 00219028 g O .bss 00000010 grub_file_filters_enabled 00219038 g .bss 00000000 _end It seems that startup.S for powerpc skips the last bytes, so I made a patch to fix it. Tried again and the problem was gone: grub_file_filters_enabled[0]@0x219614 0x0 grub_file_filters_enabled[1]@0x219618 0x0 grub_file_filters_enabled[2]@0x21961c 0x0 grub_file_filters_enabled[3]@0x219620 0x0 Best regards! -- Paulo Flabiano Smorigo Software Engineer Linux Technology Center - IBM Systems & Technology Group --=_REgcEZir309R5EmlUe3h2GA Content-Type: text/x-patch; charset=us-ascii; name=grub_ppc_fix_bss_cleanup.patch Content-Disposition: attachment; filename=grub_ppc_fix_bss_cleanup.patch; size=971 === modified file 'ChangeLog' --- ChangeLog 2013-07-14 21:10:27 +0000 +++ ChangeLog 2013-07-15 19:04:03 +0000 @@ -1,3 +1,6 @@ +2013-07-15 Paulo Flabiano Smorigo + * grub-core/kern/powerpc/ieee1275/startup.S: Fix bss clean up. + 2013-07-14 Vladimir Testov * grub-core/gfxmenu/gui_list.c: USe viewport when drawing strings. === modified file 'grub-core/kern/powerpc/ieee1275/startup.S' --- grub-core/kern/powerpc/ieee1275/startup.S 2011-10-18 13:21:51 +0000 +++ grub-core/kern/powerpc/ieee1275/startup.S 2013-07-15 18:59:29 +0000 @@ -32,10 +32,10 @@ li 13, 0 /* Stage1 won't zero BSS for us. In other cases, why not do it again? */ - lis 6, (__bss_start - 4)@h - ori 6, 6, (__bss_start - 4)@l - lis 7, (_end - 4)@h - ori 7, 7, (_end - 4)@l + lis 6, __bss_start@h + ori 6, 6, __bss_start@l + lis 7, _end@h + ori 7, 7, _end@l subf 7, 6, 7 srwi 7, 7, 2 /* We store 4 bytes at a time. */ mtctr 7 --=_REgcEZir309R5EmlUe3h2GA--