[RFC PATCH 1/1] PPC64: Release memory before exiting

2014-07-11 Thread Ram Pai
nstance of grub exited without releasing memory. This problem is seen when grub is booted from some device; either disk or cdrom or network, and then exited followed by boot from another device. The following patch releases memory allocated to grub by SLOF/Openfirmware before exiting. Signed-off-b

Re: [PATCH 1/1] grub: fix hang in netboot

2014-04-28 Thread Ram Pai
On Thu, Apr 24, 2014 at 03:07:33PM -0700, Ram Pai wrote: > Grub can busy-loop and hang while network booting, if the network has > some fair amount of activity. This is because grub's net module sniffs > the network for packets, and busy-loops in receive_packets() till it > finds

[PATCH 1/1] grub: fix hang in netboot

2014-04-24 Thread Ram Pai
nd to any user input, thus hanging up the system. The following patch lets grub to relax every few iterations, so that it can respond to other user inputs. Signed-off-by: Ram Pai diff --git a/grub-core/net/net.c b/grub-core/net/net.c index 0e57e93..4b316fa 100644 --- a/grub-2.02~beta2/grub

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-04 Thread Ram Pai
On Fri, Apr 04, 2014 at 10:29:13PM +0200, Dinar Valeev wrote: > On Fri, 2014-04-04 at 23:12 +0400, Andrey Borzenkov wrote: > > В Fri, 04 Apr 2014 20:24:58 +0200 > > Dinar Valeev пишет: > > > > > > > > Right, my mistake. I recall a message message with 64bit LE patches. But > > > seems that came

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-04 Thread Ram Pai
On Fri, Apr 04, 2014 at 06:28:51AM +0400, Andrey Borzenkov wrote: > В Thu, 3 Apr 2014 13:32:22 -0700 > Ram Pai пишет: > > > > > They generate a 32bit BE grub binary on a LE system? No. I dont think > > so. Because the cross-compile tool chain is not enabled do so.

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-03 Thread Ram Pai
On Thu, Apr 03, 2014 at 11:54:46PM +0400, Andrey Borzenkov wrote: > В Thu, 3 Apr 2014 12:26:57 -0700 > Ram Pai пишет: > > > > > > > > > > > > Well. that is the issue. Various distros have varied support for > > > > > > cr

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-03 Thread Ram Pai
On Thu, Apr 03, 2014 at 09:42:54PM +0200, Vladimir 'φ-coder/phcoder' Serbinenko wrote: > On 03.04.2014 21:26, Ram Pai wrote: > >> > BOOTCFLAGS:= -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ > >> > -fno-s

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-03 Thread Ram Pai
On Thu, Apr 03, 2014 at 11:03:29PM +0400, Andrey Borzenkov wrote: > В Thu, 3 Apr 2014 11:37:05 -0700 > Ram Pai пишет: > > > On Thu, Apr 03, 2014 at 09:53:56PM +0400, Andrey Borzenkov wrote: > > > В Thu, 3 Apr 2014 10:33:36 -0700 > > > Ram Pai пишет: > > &

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-03 Thread Ram Pai
On Thu, Apr 03, 2014 at 09:53:56PM +0400, Andrey Borzenkov wrote: > В Thu, 3 Apr 2014 10:33:36 -0700 > Ram Pai пишет: > > > On Tue, Apr 01, 2014 at 10:22:10PM +0200, Vladimir 'φ-coder/phcoder' > > Serbinenko wrote: > > > > > > > > &g

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-03 Thread Ram Pai
st regularly. RP > > _______ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel -- Ram Pai ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

Re: [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues

2014-04-02 Thread Ram Pai
On Wed, Apr 02, 2014 at 09:56:54PM +0400, Andrey Borzenkov wrote: > В Wed, 2 Apr 2014 10:48:34 -0700 > Ram Pai пишет: > > > On Wed, Apr 02, 2014 at 09:19:59PM +0400, Andrey Borzenkov wrote: > > > В Wed, 2 Apr 2014 10:06:05 -0700 > > > Ram Pai пишет: > > &

Re: [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues

2014-04-02 Thread Ram Pai
On Wed, Apr 02, 2014 at 09:19:59PM +0400, Andrey Borzenkov wrote: > В Wed, 2 Apr 2014 10:06:05 -0700 > Ram Pai пишет: > > > On Tue, Apr 01, 2014 at 09:27:19PM +0400, Andrey Borzenkov wrote: > > > В Wed, 26 Feb 2014 10:31:10 -0800 > > > Ram Pai пишет: >

Re: [RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-04-02 Thread Ram Pai
On Tue, Apr 01, 2014 at 09:49:45PM +0400, Andrey Borzenkov wrote: > В Wed, 26 Feb 2014 10:31:20 -0800 > Ram Pai пишет: > > > From: Anton Blanchard > > > > powerpc64 is not necessarily BigEndian anymore! :) > > > > Signed-off-by: Ram Pai > &g

Re: [RFC PATCH 20/23] fix parameter to firmware calls

2014-04-02 Thread Ram Pai
On Tue, Apr 01, 2014 at 09:45:35PM +0400, Andrey Borzenkov wrote: > В Wed, 26 Feb 2014 10:31:19 -0800 > Ram Pai пишет: > > > -#define IEEE1275_ADDR(x) (grub_uint32_t)(grub_addr_t)(x) > > - > > +#define IEEE1275_ADDR(x) > > (grub_uint32_t

Re: [RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues

2014-04-02 Thread Ram Pai
On Tue, Apr 01, 2014 at 09:27:19PM +0400, Andrey Borzenkov wrote: > В Wed, 26 Feb 2014 10:31:10 -0800 > Ram Pai пишет: > > > From: Anton Blanchard > > > > Fix powerpc setjmp/longjmp 64bit issues > > > > Signed-off-by: Ram Pai > > From: Anton

Re: [RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit

2014-04-02 Thread Ram Pai
On Tue, Apr 01, 2014 at 09:21:46PM +0400, Andrey Borzenkov wrote: > В Wed, 26 Feb 2014 10:31:08 -0800 > Ram Pai пишет: > > > From: Anton Blanchard > > > > Fix warnings when building powerpc linux loader 64bit > > > > Signed-off-by: Ram Pai > >

Re: [RFC PATCH 08/23] Add powerpc64 types

2014-04-02 Thread Ram Pai
On Tue, Apr 01, 2014 at 09:15:03PM +0400, Andrey Borzenkov wrote: > В Wed, 26 Feb 2014 10:31:07 -0800 > Ram Pai пишет: > > > From: Anton Blanchard > > > > Add powerpc64 types > > > > Signed-off-by: Ram Pai > > From: Anton Blanchard

[RFC PATCH 07/23] Fix some more warnings when casting.

2014-02-26 Thread Ram Pai
From: Anton Blanchard Fix some more warnings when casting. Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/disk/ieee1275/ofdisk.c | 2 +- grub-core/lib/powerpc/relocator.c | 8 grub-core/net/drivers/ieee1275/ofnet.c | 2 +- 3 files changed, 6 insertions(+), 6

[RFC PATCH 05/23] set ABI version in e_flag of the PPC64LE ELF image.

2014-02-26 Thread Ram Pai
set the ABI version to 0x02 in the e_flag of the PPC64LE ELF image. Signed-off-by: Ram Pai --- include/grub/elf.h| 1 + util/grub-mkimagexx.c | 4 2 files changed, 5 insertions(+) diff --git a/include/grub/elf.h b/include/grub/elf.h index caa7963..bee7583 100644 --- a/include/grub

[RFC PATCH 22/23] fix segfaults if initrd

2014-02-26 Thread Ram Pai
lized stack variable. The stack variable can incorrectly indicate something is malloced, which leads the module to free some unallocated memory. This patch fixes the problem by initializing the stack variable. Signed-off-by: Ram Pai --- grub-core/loader/powerpc/ieee1275/linux.c | 4 1 file ch

[RFC PATCH 12/23] Add powerpc64 ieee1275 trampoline

2014-02-26 Thread Ram Pai
From: Anton Blanchard Add a trampoline so a 64bit grub can call a 32 bit OF Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/Makefile.core.def | 2 + grub-core/kern/powerpc/ieee1275/entry.S | 150 +++ include/grub/powerpc/ieee1275

[RFC PATCH 18/23] .TOC. symbol is special in ppc64le

2014-02-26 Thread Ram Pai
.TOC. symbol is special in ppc64le . It maps to the address of the .toc section. Signed-off-by: Ram Pai --- grub-core/kern/dl.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/dl.c b/grub-core/kern/dl.c index de2d0ed

[RFC PATCH 19/23] align .toc section on 4byte boundary.

2014-02-26 Thread Ram Pai
the .toc section in powerpc64le modules are sometimes not aligned on a four byte boundary. This fails the module linker especially when processing R_PPC64_TOC16_LO_DS, since the addresses are expected to be aligned on 4byte boundary. Signed-off-by: Ram Pai --- grub-core/kern/dl.c | 5

[RFC PATCH 16/23] ppc64 doesn't need libgcc routines

2014-02-26 Thread Ram Pai
From: Anton Blanchard ppc64 doesn't need libgcc routines Signed-off-by: Ram Pai From: Anton Blanchard --- include/grub/libgcc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/grub/libgcc.h b/include/grub/libgcc.h index fdc6611..69a95bc 100644 --- a/include

[RFC PATCH 21/23] powerpc64 is not necessarily BigEndian anymore! :)

2014-02-26 Thread Ram Pai
From: Anton Blanchard powerpc64 is not necessarily BigEndian anymore! :) Signed-off-by: Ram Pai --- include/grub/powerpc/types.h | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/include/grub/powerpc/types.h b/include/grub/powerpc/types.h index 7a2fc6b..ab138d4

[RFC PATCH 04/23] grub-install can now recognize and install a LE grub boot loader

2014-02-26 Thread Ram Pai
grub-install can now recognize and install a LE grub boot loader Signed-off-by: Ram Pai --- include/grub/offsets.h | 5 + include/grub/util/install.h | 1 + util/grub-install-common.c | 1 + util/grub-install.c | 15 +-- util/mkimage.c | 19

[RFC PATCH 23/23] Optional: Power7 VSX instructions workaround.

2014-02-26 Thread Ram Pai
Power7 cannot handle VSX instructions correctly. It segfaults. This patch is applicable only for power7 systems. Signed-off-by: Ram Pai --- grub-core/fs/fshelp.c | 10 ++ grub-core/kern/term.c | 11 +++ grub-core/normal/term.c | 42

[RFC PATCH 10/23] GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader.

2014-02-26 Thread Ram Pai
GRUB_ELF_R_PPC_* processing is applicable only for 32 bit bootloader. Signed-off-by: Ram Pai --- grub-core/kern/powerpc/dl.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/kern/powerpc/dl.c b/grub-core/kern/powerpc/dl.c index 3a7fa3e..7677e5a 100644 --- a

[RFC PATCH 15/23] Add ppc64 relocations

2014-02-26 Thread Ram Pai
From: Anton Blanchard Add ppc64 relocations Signed-off-by: Ram Pai From:Anton Blanchard --- grub-core/kern/powerpc/dl.c | 179 +--- include/grub/elf.h | 3 + 2 files changed, 172 insertions(+), 10 deletions(-) diff --git a/grub-core

[RFC PATCH 17/23] Use FUNC_START/FUNC_END for powerpc function definitions

2014-02-26 Thread Ram Pai
From: Anton Blanchard Use FUNC_START/FUNC_END for powerpc function definitions Signed-off-by: Ram Pai From:Anton Blanchard --- grub-core/kern/powerpc/cache.S | 6 -- grub-core/lib/powerpc/setjmp.S | 8 +--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/grub-core

[RFC PATCH 20/23] fix parameter to firmware calls

2014-02-26 Thread Ram Pai
all parameter to firmware calls should to be BigEndian and the results should be CPU endian. Signed-off-by: Ram Pai --- grub-core/disk/ieee1275/nand.c | 41 +- grub-core/disk/ieee1275/ofdisk.c | 22 -- grub-core/kern/ieee1275/ieee1275.c | 132

[RFC PATCH 13/23] Add 64bit support to powerpc startup code

2014-02-26 Thread Ram Pai
From: Anton Blanchard Add 64bit support to powerpc startup code Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/kern/powerpc/ieee1275/startup.S | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/grub-core/kern/powerpc/ieee1275

[RFC PATCH 06/23] Add IEEE1275_ADDR helper

2014-02-26 Thread Ram Pai
From: Anton Blanchard If the target pointer size doesn't match the IEEE1275 cell size, we need to cast twice to avoid a warning. Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/disk/ieee1275/ofdisk.c | 4 ++-- grub-core/kern/ieee1275/ieee1275.c

[RFC PATCH 14/23] Add grub_dl_find_section_addr

2014-02-26 Thread Ram Pai
From: Anton Blanchard ppc64 needs to find the address of the toc and opd sections. Create grub_dl_find_section_addr to do this. We also need grub_dl_find_section, so make it global. Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/kern/dl.c | 27

[RFC PATCH 08/23] Add powerpc64 types

2014-02-26 Thread Ram Pai
From: Anton Blanchard Add powerpc64 types Signed-off-by: Ram Pai From: Anton Blanchard --- include/grub/powerpc/types.h | 8 1 file changed, 8 insertions(+) diff --git a/include/grub/powerpc/types.h b/include/grub/powerpc/types.h index a098ae6..7a2fc6b 100644 --- a/include/grub

[RFC PATCH 11/23] Fix powerpc setjmp/longjmp 64bit issues

2014-02-26 Thread Ram Pai
From: Anton Blanchard Fix powerpc setjmp/longjmp 64bit issues Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/lib/powerpc/setjmp.S | 94 +++--- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/grub-core/lib/powerpc/setjmp.S b

[RFC PATCH 03/23] ignore .TOC. symbol

2014-02-26 Thread Ram Pai
powerpc64 LE's linker knows how to handle the undefined symbol .TOC. in grub modules. So just ignore that symbol during build. Signed-off-by: Ram Pai --- grub-core/gensyminfo.sh.in | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/grub-core/gensyminfo.sh.in b/grub

[RFC PATCH 01/23] Add a new architecture to the build process

2014-02-26 Thread Ram Pai
Add a new architecture to the build process Signed-off-by: Ram Pai Signed-off-by: Tomohiro B Berry Signed-off-by: Thomas Falcon --- Makefile.am | 4 config.h.in | 4 configure.ac| 10 +++--- gentpl.py | 7

[RFC PATCH 00/23] grub 64bit little-endian on power

2014-02-26 Thread Ram Pai
Add powerpc64 ieee1275 trampoline Add 64bit support to powerpc startup code Add grub_dl_find_section_addr Add ppc64 relocations ppc64 doesn't need libgcc routines Use FUNC_START/FUNC_END for powerpc function definitions powerpc64 is not necessarily BigEndian anymore! :) Ram Pa

[RFC PATCH 02/23] Build LE grub as O1

2014-02-26 Thread Ram Pai
Build LE grub as O1 until we add savegpr and restgpr Signed-off-by: Ram Pai From: Anton Blanchard --- configure.ac | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 09e9dfb..10856be 100644 --- a/configure.ac +++ b/configure.ac @@ -73,7

[RFC PATCH 09/23] Fix warnings when building powerpc linux loader 64bit

2014-02-26 Thread Ram Pai
From: Anton Blanchard Fix warnings when building powerpc linux loader 64bit Signed-off-by: Ram Pai From: Anton Blanchard --- grub-core/loader/powerpc/ieee1275/linux.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/grub-core/loader/powerpc/ieee1275/linux.c b/grub