All of lore.kernel.org
 help / color / mirror / Atom feed
* grub2 resets machine when reading from an xfs filesystem
       [not found]                 ` <20080129212257.GA4487@thorin>
@ 2008-01-29 21:34                   ` Peter Hicks
       [not found]                   ` <479F9B60.1080509@poggs.co.uk>
  1 sibling, 0 replies; 11+ messages in thread
From: Peter Hicks @ 2008-01-29 21:34 UTC (permalink / raw)
  To: grub-devel; +Cc: 463081, Robert Millan

Hello

Please see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=463081 - it
outlines a bug I discovered in the CVS from 20080128, packaged in to Debian
unstable.

It appears that grub is no longer able to read from an xfs filesystem, and an
example 32Mb image is contained in a .bz2 file linked to from the bug page above.

I can reproduce the problem on qemu, so I don't believe it's limited to my
hardware platform.  To get around the issue, I've copied some files over to
/boot, which is ext3 on my system.

Please let me know if you need any further information on how to reproduce the
problem, I'm happy to help.

Best wishes,


Peter

-- 
Peter Hicks | e: my.name@poggs.co.uk | g: 0xE7C839F4 | w: www.poggs.com

   A: Because it destroys the flow of the conversation
   Q: Why is top-posting bad?





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
       [not found]                   ` <479F9B60.1080509@poggs.co.uk>
@ 2008-01-29 21:39                     ` Robert Millan
  2008-01-30  7:11                       ` Bean
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Millan @ 2008-01-29 21:39 UTC (permalink / raw)
  To: Peter Hicks; +Cc: grub-devel, 463081

On Tue, Jan 29, 2008 at 09:32:16PM +0000, Peter Hicks wrote:
> 
> It appears that grub is no longer able to read from an xfs filesystem, and 
> an example 32Mb image is contained in a .bz2 file linked to from the bug 
> page above.

Available at:  http://stash.poggs.com/grub-xfs-example.bz2

It can be reproduced with qemu at least.  I gave it a try but get lost too
easily on filesystem stuff.  Anyone feels like having a look? Bean what do
you think? :-)

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-29 21:39                     ` Robert Millan
@ 2008-01-30  7:11                       ` Bean
  2008-01-30 10:17                         ` Bean
  0 siblings, 1 reply; 11+ messages in thread
From: Bean @ 2008-01-30  7:11 UTC (permalink / raw)
  To: The development of GRUB 2

On Jan 30, 2008 5:39 AM, Robert Millan <rmh@aybabtu.com> wrote:
> On Tue, Jan 29, 2008 at 09:32:16PM +0000, Peter Hicks wrote:
> >
> > It appears that grub is no longer able to read from an xfs filesystem, and
> > an example 32Mb image is contained in a .bz2 file linked to from the bug
> > page above.
>
> Available at:  http://stash.poggs.com/grub-xfs-example.bz2
>
> It can be reproduced with qemu at least.  I gave it a try but get lost too
> easily on filesystem stuff.  Anyone feels like having a look? Bean what do
> you think? :-)

when using grub-fstest, i can list and compare files in the example
xfs, but if i run it in qemu, it shows

qemu: fatal: Trying to execute code outside RAM or ROM at 0x2e2e002e

i guess it's caused by invalid memory access somewhere.

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30  7:11                       ` Bean
@ 2008-01-30 10:17                         ` Bean
  2008-01-30 12:08                           ` Marco Gerards
  2008-01-30 13:43                           ` Robert Millan
  0 siblings, 2 replies; 11+ messages in thread
From: Bean @ 2008-01-30 10:17 UTC (permalink / raw)
  To: The development of GRUB 2

I figure it out, the problem is caused by nested function:

int call_hook (grub_uint64_t ino, char *filename)

it would take 3 registry to pass the parameter ! (2 for ino), so %ecx
will be overwritten agian.

NESTED_FUNC_ATTR doesn't help, because there is only 2 parameters
here, so you need to use  __attribute__ ((regparm (1))) explicitly.

diff --git a/fs/xfs.c b/fs/xfs.c
index b3154c7..0e5f323 100644
--- a/fs/xfs.c
+++ b/fs/xfs.c
@@ -306,9 +306,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
 				grub_fshelp_node_t node))
 {
   struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
-  auto int call_hook (grub_uint64_t ino, char *filename);
+  auto int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino,
char *filename);

-  int call_hook (grub_uint64_t ino, char *filename)
+  int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino, char
*filename)
     {
       struct grub_fshelp_node *fdiro;


-- 
Bean



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30 10:17                         ` Bean
@ 2008-01-30 12:08                           ` Marco Gerards
  2008-01-30 12:36                             ` Bean
  2008-01-30 13:43                           ` Robert Millan
  1 sibling, 1 reply; 11+ messages in thread
From: Marco Gerards @ 2008-01-30 12:08 UTC (permalink / raw)
  To: The development of GRUB 2

Bean <bean123ch@gmail.com> writes:

> I figure it out, the problem is caused by nested function:
>
> int call_hook (grub_uint64_t ino, char *filename)
>
> it would take 3 registry to pass the parameter ! (2 for ino), so %ecx
> will be overwritten agian.
>
> NESTED_FUNC_ATTR doesn't help, because there is only 2 parameters
> here, so you need to use  __attribute__ ((regparm (1))) explicitly.
>
> diff --git a/fs/xfs.c b/fs/xfs.c
> index b3154c7..0e5f323 100644
> --- a/fs/xfs.c
> +++ b/fs/xfs.c
> @@ -306,9 +306,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
>  				grub_fshelp_node_t node))
>  {
>    struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
> -  auto int call_hook (grub_uint64_t ino, char *filename);
> +  auto int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino,
> char *filename);
>
> -  int call_hook (grub_uint64_t ino, char *filename)
> +  int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino, char
> *filename)
>      {
>        struct grub_fshelp_node *fdiro;

Do you have a more generic solution to this?  Something that can be
compared with NESTED_FUNC_ATTR?  This is an i386 only bug...

Besides that, XFS is still not finished as BTrees are not yet
supported.  So big files/directories cannot be accessed yet :-/

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30 12:08                           ` Marco Gerards
@ 2008-01-30 12:36                             ` Bean
  2008-01-30 15:02                               ` Marco Gerards
  2008-02-01 11:36                               ` Yoshinori K. Okuji
  0 siblings, 2 replies; 11+ messages in thread
From: Bean @ 2008-01-30 12:36 UTC (permalink / raw)
  To: The development of GRUB 2

On Jan 30, 2008 8:08 PM, Marco Gerards <mgerards@xs4all.nl> wrote:
>
> Bean <bean123ch@gmail.com> writes:
>
> > I figure it out, the problem is caused by nested function:
> >
> > int call_hook (grub_uint64_t ino, char *filename)
> >
> > it would take 3 registry to pass the parameter ! (2 for ino), so %ecx
> > will be overwritten agian.
> >
> > NESTED_FUNC_ATTR doesn't help, because there is only 2 parameters
> > here, so you need to use  __attribute__ ((regparm (1))) explicitly.
> >
> > diff --git a/fs/xfs.c b/fs/xfs.c
> > index b3154c7..0e5f323 100644
> > --- a/fs/xfs.c
> > +++ b/fs/xfs.c
> > @@ -306,9 +306,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
> >                               grub_fshelp_node_t node))
> >  {
> >    struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir;
> > -  auto int call_hook (grub_uint64_t ino, char *filename);
> > +  auto int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino,
> > char *filename);
> >
> > -  int call_hook (grub_uint64_t ino, char *filename)
> > +  int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino, char
> > *filename)
> >      {
> >        struct grub_fshelp_node *fdiro;
>
> Do you have a more generic solution to this?  Something that can be
> compared with NESTED_FUNC_ATTR?  This is an i386 only bug...

perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1)))  ?

> Besides that, XFS is still not finished as BTrees are not yet
> supported.  So big files/directories cannot be accessed yet :-/

i'll check this out later.

-- 
Bean



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30 10:17                         ` Bean
  2008-01-30 12:08                           ` Marco Gerards
@ 2008-01-30 13:43                           ` Robert Millan
  1 sibling, 0 replies; 11+ messages in thread
From: Robert Millan @ 2008-01-30 13:43 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Jan 30, 2008 at 06:17:18PM +0800, Bean wrote:
> I figure it out, the problem is caused by nested function:
> 
> int call_hook (grub_uint64_t ino, char *filename)
> 
> it would take 3 registry to pass the parameter ! (2 for ino), so %ecx
> will be overwritten agian.
> 
> NESTED_FUNC_ATTR doesn't help, because there is only 2 parameters
> here, so you need to use  __attribute__ ((regparm (1))) explicitly.

Cool.  I wonder, how do you manage to catch this kind of things.  Do you
use a debugger in qemu, or just read the code and then you see it :-) ?

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30 12:36                             ` Bean
@ 2008-01-30 15:02                               ` Marco Gerards
  2008-02-01 11:36                               ` Yoshinori K. Okuji
  1 sibling, 0 replies; 11+ messages in thread
From: Marco Gerards @ 2008-01-30 15:02 UTC (permalink / raw)
  To: The development of GRUB 2

Bean <bean123ch@gmail.com> writes:

[...]

>> > -  int call_hook (grub_uint64_t ino, char *filename)
>> > +  int __attribute__ ((regparm(1))) call_hook (grub_uint64_t ino, char
>> > *filename)
>> >      {
>> >        struct grub_fshelp_node *fdiro;
>>
>> Do you have a more generic solution to this?  Something that can be
>> compared with NESTED_FUNC_ATTR?  This is an i386 only bug...
>
> perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1)))  ?

Sounds ok to me.

>> Besides that, XFS is still not finished as BTrees are not yet
>> supported.  So big files/directories cannot be accessed yet :-/
>
> i'll check this out later.

Great! :-)

Currently XFS is not usable because of this.

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-01-30 12:36                             ` Bean
  2008-01-30 15:02                               ` Marco Gerards
@ 2008-02-01 11:36                               ` Yoshinori K. Okuji
  2008-02-01 11:48                                 ` Robert Millan
  1 sibling, 1 reply; 11+ messages in thread
From: Yoshinori K. Okuji @ 2008-02-01 11:36 UTC (permalink / raw)
  To: The development of GRUB 2

On Wednesday 30 January 2008 13:36, Bean wrote:
> > Do you have a more generic solution to this?  Something that can be
> > compared with NESTED_FUNC_ATTR?  This is an i386 only bug...
>
> perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1)))  ?

Is it bad to just change the definition of NESTED_FUNC_ADDR to use regparm(1)? 
I know that it is not optimal, but does anybody care?

Okuji



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-02-01 11:36                               ` Yoshinori K. Okuji
@ 2008-02-01 11:48                                 ` Robert Millan
  2008-02-01 12:02                                   ` Marco Gerards
  0 siblings, 1 reply; 11+ messages in thread
From: Robert Millan @ 2008-02-01 11:48 UTC (permalink / raw)
  To: The development of GRUB 2

On Fri, Feb 01, 2008 at 12:36:36PM +0100, Yoshinori K. Okuji wrote:
> On Wednesday 30 January 2008 13:36, Bean wrote:
> > > Do you have a more generic solution to this?  Something that can be
> > > compared with NESTED_FUNC_ATTR?  This is an i386 only bug...
> >
> > perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1)))  ?
> 
> Is it bad to just change the definition of NESTED_FUNC_ADDR to use regparm(1)? 
> I know that it is not optimal, but does anybody care?

I don't..

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: grub2 resets machine when reading from an xfs filesystem
  2008-02-01 11:48                                 ` Robert Millan
@ 2008-02-01 12:02                                   ` Marco Gerards
  0 siblings, 0 replies; 11+ messages in thread
From: Marco Gerards @ 2008-02-01 12:02 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan <rmh@aybabtu.com> writes:

> On Fri, Feb 01, 2008 at 12:36:36PM +0100, Yoshinori K. Okuji wrote:
>> On Wednesday 30 January 2008 13:36, Bean wrote:
>> > > Do you have a more generic solution to this?  Something that can be
>> > > compared with NESTED_FUNC_ATTR?  This is an i386 only bug...
>> >
>> > perhaps define NESTED_FUNC_ADDR2 as __attribute__ ((regparm(1)))  ?
>> 
>> Is it bad to just change the definition of NESTED_FUNC_ADDR to use regparm(1)? 
>> I know that it is not optimal, but does anybody care?
>
> I don't..

And fine for me :-)

--
Marco




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-02-01 12:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20080129115843.3620.68940.reportbug@neasden.st-albans.poggs.net>
     [not found] ` <20080129122733.GA24823@thorin>
     [not found]   ` <20080129124316.GC18831@tufnell.london.poggs.net>
     [not found]     ` <20080129132922.GC26291@thorin>
     [not found]       ` <20080129144733.GF18831@tufnell.london.poggs.net>
     [not found]         ` <20080129151529.GB3869@thorin>
     [not found]           ` <20080129155021.GG18831@tufnell.london.poggs.net>
     [not found]             ` <20080129183005.GC12993@thorin>
     [not found]               ` <479F8A02.9050901@poggs.co.uk>
     [not found]                 ` <20080129212257.GA4487@thorin>
2008-01-29 21:34                   ` grub2 resets machine when reading from an xfs filesystem Peter Hicks
     [not found]                   ` <479F9B60.1080509@poggs.co.uk>
2008-01-29 21:39                     ` Robert Millan
2008-01-30  7:11                       ` Bean
2008-01-30 10:17                         ` Bean
2008-01-30 12:08                           ` Marco Gerards
2008-01-30 12:36                             ` Bean
2008-01-30 15:02                               ` Marco Gerards
2008-02-01 11:36                               ` Yoshinori K. Okuji
2008-02-01 11:48                                 ` Robert Millan
2008-02-01 12:02                                   ` Marco Gerards
2008-01-30 13:43                           ` Robert Millan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.