lkml.org 
[lkml]   [2005]   [Oct]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 6 Oct 2005 05:48:32 -0400 (EDT)
FromSteven Rostedt <>
SubjectRe: 2.6.14-rc3-rt2

On Thu, 6 Oct 2005, Ingo Molnar wrote:

>
> * Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > > ahh ... I would not be surprised if this caused actual problems on x64
> > > in the upstream kernel too: using save_flags() over u32 will corrupt a
> > > word on the stack ...
> > >
> >
> > Actually, it's still safe upstream.  The locks are taken via a function
> > defined as:
> >
> > unsigned long acpi_os_acquire_lock(acpi_handle handle)
> > {
> > 	unsigned long flags;
> > 	spin_lock_irqsave((spinlock_t *) handle, flags);
> > 	return flags;
> > }
> >
> > So a u32 flags with
> >
> >   flags = acpi_os_acquire_lock(lock);
> >
> > would be safe, unless a 64 bit machine stored the value of IR in the
> > upper word, which I don't know of any archs that do that.
>
> ok. But this still looks very volatile. Nowhere do we guarantee (or can
> we guarantee) that silently zeroing out the upper 32 bits of flags is
> safe!
>

Andi,

So, should I send my patch upstream?

There's three files that need to be changed:

 drivers/acpi/events/evgpe.c
 drivers/acpi/events/evgpeblk.c
 drivers/acpi/events/evxface.c

They store flags as u32, but it does it through acpi_os_acquire_lock, so
you won't get any warnings.

-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-10-06 09:52    [from the cache]
©2003-2008