linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RE: [PATCH] ACPI: fix vendor resource length computation
@ 2006-02-15  0:04 Moore, Robert
  2006-02-15 17:49 ` Thomas Renninger
  0 siblings, 1 reply; 10+ messages in thread
From: Moore, Robert @ 2006-02-15  0:04 UTC (permalink / raw)
  To: Bjorn Helgaas, Andreas Schwab
  Cc: Thomas Renninger, Luck, Tony, Brown, Len, linux-acpi, linux-ia64,
	Andrew Morton, efocht

I think the original code may have been attempting to subtract off the
size of the descriptor header to obtain the length of the vendor data
bytes. However, something like a global replace may have broken it.



> -----Original Message-----
> From: Bjorn Helgaas [mailto:bjorn.helgaas@hp.com]
> Sent: Tuesday, February 14, 2006 3:13 PM
> To: Andreas Schwab
> Cc: Thomas Renninger; Moore, Robert; Luck, Tony; Brown, Len; linux-
> acpi@vger.kernel.org; linux-ia64@vger.kernel.org; Andrew Morton;
> efocht@hpce.nec.com
> Subject: [PATCH] ACPI: fix vendor resource length computation
> 
> acpi_rs_get_list_length() needs to account for all the vendor-defined
> data bytes.  Failing to include these causes buffers to be sized too
> small, which causes slab corruption when we later convert AML to
> resources and run off the end of the buffer.
> 
> I'm no expert on this code, so please scrutinize this carefully.
> 
> This causes slab corruption on machines that use ACPI vendor-defined
> resources.  All HP ia64 machines do, and I'm told that some NEC
> machines may as well.  So if the fix is correct, it would be good
> to have it in 2.6.16.
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 
> Index: work-mm4/drivers/acpi/resources/rscalc.c
> ===================================================================
> --- work-mm4.orig/drivers/acpi/resources/rscalc.c	2006-02-14
> 13:32:50.000000000 -0700
> +++ work-mm4/drivers/acpi/resources/rscalc.c	2006-02-14
> 13:33:25.000000000 -0700
> @@ -391,8 +391,7 @@
>  			 * Ensure a 32-bit boundary for the structure
>  			 */
>  			extra_struct_bytes =
> -			    ACPI_ROUND_UP_to_32_bITS(resource_length) -
> -			    resource_length;
> +			    ACPI_ROUND_UP_to_32_bITS(resource_length);
>  			break;
> 
>  		case ACPI_RESOURCE_NAME_END_TAG:
> @@ -408,8 +407,7 @@
>  			 * Add vendor data and ensure a 32-bit boundary
for the
> structure
>  			 */
>  			extra_struct_bytes =
> -			    ACPI_ROUND_UP_to_32_bITS(resource_length) -
> -			    resource_length;
> +			    ACPI_ROUND_UP_to_32_bITS(resource_length);
>  			break;
> 
>  		case ACPI_RESOURCE_NAME_ADDRESS32:

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] ACPI: fix vendor resource length computation
@ 2006-02-16 22:54 Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2006-02-16 22:54 UTC (permalink / raw)
  To: Thomas Renninger, Luck, Tony
  Cc: Bjorn Helgaas, Andreas Schwab, Brown, Len, linux-acpi, linux-ia64,
	Andrew Morton, efocht

I recently added a new interface to ACPICA to support this kind of
debugging. It enables/disables debug for a specific control method:

ACPI_STATUS
AcpiDebugTrace (
    char                    *Name,
    UINT32                  DebugLevel,
    UINT32                  DebugLayer,
    UINT32                  Flags);

It would be nice to see this exposed in Linux somehow.

Bob


> -----Original Message-----
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Thursday, February 16, 2006 12:59 AM
> To: Luck, Tony
> Cc: Moore, Robert; Bjorn Helgaas; Andreas Schwab; Brown, Len; linux-
> acpi@vger.kernel.org; linux-ia64@vger.kernel.org; Andrew Morton;
> efocht@hpce.nec.com
> Subject: Re: [PATCH] ACPI: fix vendor resource length computation
> 
> Luck, Tony wrote:
> >> I'm working on the alignment issue also, should be a fix this week.
> >
> > With Bjorn's tip on using console=uart,mmio,0x{address} I can now
> > get a complete trace from boot using acpi_dbg_level = 0xffffff ...
> > well in theory I can, I started the boot two days ago and have
> > 2.2 million lines of output so far, and it is still going!  Now
> > I'm just curious as to whether this will actually complete, but
> > if it doesn't do so in the next few days I'll have to abort the
> > boot and get back to using that system for regression testing on
> > other patches.
> >
> > Sadly, I think that using the "console=uart,..." flag may have
> > caused the kernel to skip the bit of acpi probing that caused the
> > unaligned traps, as I don't see any "unaligned" messages in the
> > output so far ... so this might be a completely futile exercise.
> >
> Better don't use the boot parameters. Try to identify at which point
> the culprit might lie and then embed the code you like to
> debug in the sources into:
> acpi_dbg_level=0xXY (whatever debug level, avoid mutex and other
>                         unnecessary stuff you don't need)
> ... bad code to debug
> 
> acpi_dbg_level=0xF
> 
> I expect the output will never end, there will pop up an acpi
interrupt
> or some polling is done by ACPI and you are trapped in endless
output...
> 
>     Thomas

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] ACPI: fix vendor resource length computation
@ 2006-02-15 19:05 Luck, Tony
  2006-02-16  8:59 ` Thomas Renninger
  0 siblings, 1 reply; 10+ messages in thread
From: Luck, Tony @ 2006-02-15 19:05 UTC (permalink / raw)
  To: Moore, Robert, Thomas Renninger
  Cc: Bjorn Helgaas, Andreas Schwab, Brown, Len, linux-acpi, linux-ia64,
	Andrew Morton, efocht

> I'm working on the alignment issue also, should be a fix this week.

With Bjorn's tip on using console=uart,mmio,0x{address} I can now
get a complete trace from boot using acpi_dbg_level = 0xffffff ...
well in theory I can, I started the boot two days ago and have
2.2 million lines of output so far, and it is still going!  Now
I'm just curious as to whether this will actually complete, but
if it doesn't do so in the next few days I'll have to abort the
boot and get back to using that system for regression testing on
other patches.

Sadly, I think that using the "console=uart,..." flag may have
caused the kernel to skip the bit of acpi probing that caused the
unaligned traps, as I don't see any "unaligned" messages in the
output so far ... so this might be a completely futile exercise.

-Tony

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] ACPI: fix vendor resource length computation
@ 2006-02-15 18:38 Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2006-02-15 18:38 UTC (permalink / raw)
  To: Thomas Renninger
  Cc: Bjorn Helgaas, Andreas Schwab, Luck, Tony, Brown, Len, linux-acpi,
	linux-ia64, Andrew Morton, efocht

I'm working on the alignment issue also, should be a fix this week.
Bob


> -----Original Message-----
> From: Thomas Renninger [mailto:trenn@suse.de]
> Sent: Wednesday, February 15, 2006 9:50 AM
> To: Moore, Robert
> Cc: Bjorn Helgaas; Andreas Schwab; Luck, Tony; Brown, Len; linux-
> acpi@vger.kernel.org; linux-ia64@vger.kernel.org; Andrew Morton;
> efocht@hpce.nec.com
> Subject: Re: [PATCH] ACPI: fix vendor resource length computation
> 
> Moore, Robert wrote:
> > I think the original code may have been attempting to subtract off
the
> > size of the descriptor header to obtain the length of the vendor
data
> > bytes. However, something like a global replace may have broken it.
> >
> Thanks, this one fixes the mem corruption.
> Unaligned access messages still remain...
> 
> 
>    Thomas

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: [PATCH] ACPI: fix vendor resource length computation
@ 2006-02-14 23:25 Moore, Robert
  2006-02-14 23:34 ` Bjorn Helgaas
  0 siblings, 1 reply; 10+ messages in thread
From: Moore, Robert @ 2006-02-14 23:25 UTC (permalink / raw)
  To: Bjorn Helgaas, Andreas Schwab
  Cc: Thomas Renninger, Luck, Tony, Brown, Len, linux-acpi, linux-ia64,
	Andrew Morton, efocht

I'll look at this. 

Does this fix all of the slab corruptions issues we have been hearing
about?

Bob


> -----Original Message-----
> From: Bjorn Helgaas [mailto:bjorn.helgaas@hp.com]
> Sent: Tuesday, February 14, 2006 3:13 PM
> To: Andreas Schwab
> Cc: Thomas Renninger; Moore, Robert; Luck, Tony; Brown, Len; linux-
> acpi@vger.kernel.org; linux-ia64@vger.kernel.org; Andrew Morton;
> efocht@hpce.nec.com
> Subject: [PATCH] ACPI: fix vendor resource length computation
> 
> acpi_rs_get_list_length() needs to account for all the vendor-defined
> data bytes.  Failing to include these causes buffers to be sized too
> small, which causes slab corruption when we later convert AML to
> resources and run off the end of the buffer.
> 
> I'm no expert on this code, so please scrutinize this carefully.
> 
> This causes slab corruption on machines that use ACPI vendor-defined
> resources.  All HP ia64 machines do, and I'm told that some NEC
> machines may as well.  So if the fix is correct, it would be good
> to have it in 2.6.16.
> 
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> 
> Index: work-mm4/drivers/acpi/resources/rscalc.c
> ===================================================================
> --- work-mm4.orig/drivers/acpi/resources/rscalc.c	2006-02-14
> 13:32:50.000000000 -0700
> +++ work-mm4/drivers/acpi/resources/rscalc.c	2006-02-14
> 13:33:25.000000000 -0700
> @@ -391,8 +391,7 @@
>  			 * Ensure a 32-bit boundary for the structure
>  			 */
>  			extra_struct_bytes =
> -			    ACPI_ROUND_UP_to_32_bITS(resource_length) -
> -			    resource_length;
> +			    ACPI_ROUND_UP_to_32_bITS(resource_length);
>  			break;
> 
>  		case ACPI_RESOURCE_NAME_END_TAG:
> @@ -408,8 +407,7 @@
>  			 * Add vendor data and ensure a 32-bit boundary
for the
> structure
>  			 */
>  			extra_struct_bytes =
> -			    ACPI_ROUND_UP_to_32_bITS(resource_length) -
> -			    resource_length;
> +			    ACPI_ROUND_UP_to_32_bITS(resource_length);
>  			break;
> 
>  		case ACPI_RESOURCE_NAME_ADDRESS32:

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: some new unaligned access while booting ia64 (HP rx2620)
@ 2006-02-10 23:31 Moore, Robert
  2006-02-13 22:57 ` Andreas Schwab
  0 siblings, 1 reply; 10+ messages in thread
From: Moore, Robert @ 2006-02-10 23:31 UTC (permalink / raw)
  To: Luck, Tony, Thomas Renninger, Brown, Len; +Cc: linux-acpi, linux-ia64

This only contains the output of stores to the ACPI "debug" object, not
the full trace output. However, "_CRS 0" may help


i.e., like this:

> exstoren-0075 [18] ex_resolve_object     : ----Entry
> exstoren-0155 [18] ex_resolve_object     : ----Exit- AE_OK


> -----Original Message-----
> From: Luck, Tony
> Sent: Friday, February 10, 2006 3:25 PM
> To: Moore, Robert; 'Thomas Renninger'; Brown, Len
> Cc: 'linux-acpi@vger.kernel.org'; 'linux-ia64@vger.kernel.org'
> Subject: RE: some new unaligned access while booting ia64 (HP rx2620)
> 
> A 16MB log_buf was enough.
> 
> Here is the initial trace up until the unaligned access messages:
> 
> Linux version 2.6.16-rc2-zx1-smp (aegl@linux-t10) (gcc version 3.4.3
> [ACPI Debug]  Integer: 0x00000000
> [ACPI Debug]  String: [0x1F] "PARS.GUID: evaluating for COMP2"
> [ACPI Debug]  Integer: 0x00000001
> [ACPI Debug]  String: [0x12] "SERIAL DEV Ptr is "
> [ACPI Debug]  Integer: 0x3FEF99A0
> kernel unaligned access to 0xe000004040e7a434, ip=0xa0000001003c81a0
> kernel unaligned access to 0xe000004040e7a46c, ip=0xa0000001003c81a0
> kernel unaligned access to 0xe000004040e7a4bc, ip=0xa0000001003c81a0
> kernel unaligned access to 0xe000004040e7a42c, ip=0xa0000001003c6ca1
> kernel unaligned access to 0xe000004040e7a434, ip=0xa0000001003c6cb1
> [ACPI Debug]  String: [0x06] "_CRS 0"
> [ACPI Debug]  String: [0x0A] "CLIB.LBA 1"
> [ACPI Debug]  Integer: 0x00000000
> [ACPI Debug]  String: [0x0B] "PARS.GPTR 2"

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

end of thread, other threads:[~2006-02-16 22:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-15  0:04 [PATCH] ACPI: fix vendor resource length computation Moore, Robert
2006-02-15 17:49 ` Thomas Renninger
  -- strict thread matches above, loose matches on Subject: below --
2006-02-16 22:54 Moore, Robert
2006-02-15 19:05 Luck, Tony
2006-02-16  8:59 ` Thomas Renninger
2006-02-15 18:38 Moore, Robert
2006-02-14 23:25 Moore, Robert
2006-02-14 23:34 ` Bjorn Helgaas
2006-02-10 23:31 some new unaligned access while booting ia64 (HP rx2620) Moore, Robert
2006-02-13 22:57 ` Andreas Schwab
2006-02-14  0:22   ` Bjorn Helgaas
2006-02-14 23:13     ` [PATCH] ACPI: fix vendor resource length computation Bjorn Helgaas
2006-02-14 23:19       ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).