All of lore.kernel.org
 help / color / mirror / Atom feed
* False positive iasl compiler error on resource object?
@ 2010-09-10  9:33 ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10  9:33 UTC (permalink / raw)
  To: devel; +Cc: linux-acpi, bjorn.helgaas

I have a machine with a _CRS function which shows:

Method (_CRS, 0, NotSerialized)
{
    Name (XY0, ResourceTemplate ()
    {
             WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                        0x0000,             // Granularity
                        0x0000,             // Range Minimum
                        0x0000,             // Range Maximum
                        0x0000,             // Translation Offset
                        0x0000,             // Length
                        ,, _Y10, TypeStatic)
     }
This produces the compiler error:
DSDT.dsl.orig  2364:                         0x0000,             // Length
Error    4122 -                                   ^ Invalid combination of Length and Min/Max fixed flags

Because iasl thinks this hits this condition:
Advanced Configuration and Power Interface Specification
Revision 3.0b October 10, 2006
6.4.3.5 Address Space Resource Descriptors
Table 6-38 Valid combination of Address Space Descriptors fields
..
_LEN   _MIF      _MAF           Definition
0           1            1             (Illegal combination)

But the _CRS function can still fill up the length of this resource object
parts while _CRS gets executed (and the compiler probably does not
take this into account), by e.g.:
                CreateWordField (XY0, \_SB.PCI0._CRS._Y10._LEN, LEN9)
                Store (Local0, LEN9)
and the resource, returned to OS, might fulfill the ACPI specification and
return a valid length, _MIF, _MAF combination:
_LEN   _MIF      _MAF           Definition
  >0       1           1              Fixed size, fixed location resource descriptor.
                                          _GRA must be 0 and _LEN must be (_MAX - _MIN +1).

I wonder whether my above assumptions are correct and the
Error 4122 should get removed from the iasl compiler, at least in this case?

Thanks,

       Thomas

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

* [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10  9:33 ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10  9:33 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1959 bytes --]

I have a machine with a _CRS function which shows:

Method (_CRS, 0, NotSerialized)
{
    Name (XY0, ResourceTemplate ()
    {
             WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode, EntireRange,
                        0x0000,             // Granularity
                        0x0000,             // Range Minimum
                        0x0000,             // Range Maximum
                        0x0000,             // Translation Offset
                        0x0000,             // Length
                        ,, _Y10, TypeStatic)
     }
This produces the compiler error:
DSDT.dsl.orig  2364:                         0x0000,             // Length
Error    4122 -                                   ^ Invalid combination of Length and Min/Max fixed flags

Because iasl thinks this hits this condition:
Advanced Configuration and Power Interface Specification
Revision 3.0b October 10, 2006
6.4.3.5 Address Space Resource Descriptors
Table 6-38 Valid combination of Address Space Descriptors fields
..
_LEN   _MIF      _MAF           Definition
0           1            1             (Illegal combination)

But the _CRS function can still fill up the length of this resource object
parts while _CRS gets executed (and the compiler probably does not
take this into account), by e.g.:
                CreateWordField (XY0, \_SB.PCI0._CRS._Y10._LEN, LEN9)
                Store (Local0, LEN9)
and the resource, returned to OS, might fulfill the ACPI specification and
return a valid length, _MIF, _MAF combination:
_LEN   _MIF      _MAF           Definition
  >0       1           1              Fixed size, fixed location resource descriptor.
                                          _GRA must be 0 and _LEN must be (_MAX - _MIN +1).

I wonder whether my above assumptions are correct and the
Error 4122 should get removed from the iasl compiler, at least in this case?

Thanks,

       Thomas

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 11:59   ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10 11:59 UTC (permalink / raw)
  To: devel; +Cc: linux-acpi, bjorn.helgaas

On Friday 10 September 2010 11:33:31 Thomas Renninger wrote:
> I have a machine with a _CRS function which shows:
Looks like this (wrong?) check got introduced between:
20100304 (does not show the error) and
20100702 (shows this on quite some machines).

Version 20100806 still has this check.

       Thomas

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 11:59   ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10 11:59 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 318 bytes --]

On Friday 10 September 2010 11:33:31 Thomas Renninger wrote:
> I have a machine with a _CRS function which shows:
Looks like this (wrong?) check got introduced between:
20100304 (does not show the error) and
20100702 (shows this on quite some machines).

Version 20100806 still has this check.

       Thomas

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

* RE: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 15:04   ` Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2010-09-10 15:04 UTC (permalink / raw)
  To: Thomas Renninger, devel; +Cc: linux-acpi, bjorn.helgaas

We've provided the -cr option to disable the resource descriptor error checking.

This is an interesting problem. On one hand, we would like to provide static (compile time) error checking as much as possible. On the other hand, the resource descriptors (as well as most any other ASL/AML object) can be dynamically changed.

We've seen many ACPI tables with invalid resource descriptors (at both compile time and runtime), and that is the reason the resource descriptor validation was added to the compiler in the first place.

I don't want to just remove this validation, but yes, perhaps iASL should be able to recognize that this descriptor may be modified at runtime and therefore a static validation cannot be performed.

There are at least a few indicators:

1) The descriptor is basically all zeroes
2) There is a CreateXxxField reference to the descriptor
3) There is a Store to the created field

So, perhaps we could detect the above conditions and then disable validation for this particular descriptor. Note, conditions (2) and (3) may be difficult to detect.

I'm open to suggestions.

Bob


>-----Original Message-----
>From: devel-bounces@acpica.org [mailto:devel-bounces@acpica.org] On Behalf
>Of Thomas Renninger
>Sent: Friday, September 10, 2010 2:34 AM
>To: devel@acpica.org
>Cc: linux-acpi@vger.kernel.org; bjorn.helgaas@hp.com
>Subject: [Devel] False positive iasl compiler error on resource object?
>
>I have a machine with a _CRS function which shows:
>
>Method (_CRS, 0, NotSerialized)
>{
>    Name (XY0, ResourceTemplate ()
>    {
>             WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode,
>EntireRange,
>                        0x0000,             // Granularity
>                        0x0000,             // Range Minimum
>                        0x0000,             // Range Maximum
>                        0x0000,             // Translation Offset
>                        0x0000,             // Length
>                        ,, _Y10, TypeStatic)
>     }
>This produces the compiler error:
>DSDT.dsl.orig  2364:                         0x0000,             // Length
>Error    4122 -                                   ^ Invalid combination of
>Length and Min/Max fixed flags
>
>Because iasl thinks this hits this condition:
>Advanced Configuration and Power Interface Specification
>Revision 3.0b October 10, 2006
>6.4.3.5 Address Space Resource Descriptors
>Table 6-38 Valid combination of Address Space Descriptors fields
>..
>_LEN   _MIF      _MAF           Definition
>0           1            1             (Illegal combination)
>
>But the _CRS function can still fill up the length of this resource object
>parts while _CRS gets executed (and the compiler probably does not
>take this into account), by e.g.:
>                CreateWordField (XY0, \_SB.PCI0._CRS._Y10._LEN, LEN9)
>                Store (Local0, LEN9)
>and the resource, returned to OS, might fulfill the ACPI specification and
>return a valid length, _MIF, _MAF combination:
>_LEN   _MIF      _MAF           Definition
>  >0       1           1              Fixed size, fixed location resource
>descriptor.
>                                          _GRA must be 0 and _LEN must be
>(_MAX - _MIN +1).
>
>I wonder whether my above assumptions are correct and the
>Error 4122 should get removed from the iasl compiler, at least in this
>case?
>
>Thanks,
>
>       Thomas
>_______________________________________________
>Devel mailing list
>Devel@acpica.org
>http://lists.acpica.org/listinfo/devel

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 15:04   ` Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2010-09-10 15:04 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 3609 bytes --]

We've provided the -cr option to disable the resource descriptor error checking.

This is an interesting problem. On one hand, we would like to provide static (compile time) error checking as much as possible. On the other hand, the resource descriptors (as well as most any other ASL/AML object) can be dynamically changed.

We've seen many ACPI tables with invalid resource descriptors (at both compile time and runtime), and that is the reason the resource descriptor validation was added to the compiler in the first place.

I don't want to just remove this validation, but yes, perhaps iASL should be able to recognize that this descriptor may be modified at runtime and therefore a static validation cannot be performed.

There are at least a few indicators:

1) The descriptor is basically all zeroes
2) There is a CreateXxxField reference to the descriptor
3) There is a Store to the created field

So, perhaps we could detect the above conditions and then disable validation for this particular descriptor. Note, conditions (2) and (3) may be difficult to detect.

I'm open to suggestions.

Bob


>-----Original Message-----
>From: devel-bounces(a)acpica.org [mailto:devel-bounces(a)acpica.org] On Behalf
>Of Thomas Renninger
>Sent: Friday, September 10, 2010 2:34 AM
>To: devel(a)acpica.org
>Cc: linux-acpi(a)vger.kernel.org; bjorn.helgaas(a)hp.com
>Subject: [Devel] False positive iasl compiler error on resource object?
>
>I have a machine with a _CRS function which shows:
>
>Method (_CRS, 0, NotSerialized)
>{
>    Name (XY0, ResourceTemplate ()
>    {
>             WordIO (ResourceProducer, MinFixed, MaxFixed, PosDecode,
>EntireRange,
>                        0x0000,             // Granularity
>                        0x0000,             // Range Minimum
>                        0x0000,             // Range Maximum
>                        0x0000,             // Translation Offset
>                        0x0000,             // Length
>                        ,, _Y10, TypeStatic)
>     }
>This produces the compiler error:
>DSDT.dsl.orig  2364:                         0x0000,             // Length
>Error    4122 -                                   ^ Invalid combination of
>Length and Min/Max fixed flags
>
>Because iasl thinks this hits this condition:
>Advanced Configuration and Power Interface Specification
>Revision 3.0b October 10, 2006
>6.4.3.5 Address Space Resource Descriptors
>Table 6-38 Valid combination of Address Space Descriptors fields
>..
>_LEN   _MIF      _MAF           Definition
>0           1            1             (Illegal combination)
>
>But the _CRS function can still fill up the length of this resource object
>parts while _CRS gets executed (and the compiler probably does not
>take this into account), by e.g.:
>                CreateWordField (XY0, \_SB.PCI0._CRS._Y10._LEN, LEN9)
>                Store (Local0, LEN9)
>and the resource, returned to OS, might fulfill the ACPI specification and
>return a valid length, _MIF, _MAF combination:
>_LEN   _MIF      _MAF           Definition
>  >0       1           1              Fixed size, fixed location resource
>descriptor.
>                                          _GRA must be 0 and _LEN must be
>(_MAX - _MIN +1).
>
>I wonder whether my above assumptions are correct and the
>Error 4122 should get removed from the iasl compiler, at least in this
>case?
>
>Thanks,
>
>       Thomas
>_______________________________________________
>Devel mailing list
>Devel(a)acpica.org
>http://lists.acpica.org/listinfo/devel

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 20:19     ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10 20:19 UTC (permalink / raw)
  To: Moore, Robert; +Cc: devel, linux-acpi, bjorn.helgaas

On Friday 10 September 2010 17:04:34 Moore, Robert wrote:
> We've provided the -cr option to disable the resource descriptor error
> checking.
AFAIK, these zeroed resources that get filled up dynamically later are a 
rather common construct. If below additional checks cannot be added
this (these?) specific resource checks should better get disabled.

> This is an interesting problem. On one hand, we would like to provide
> static (compile time) error checking as much as possible. On the other
> hand, the resource descriptors (as well as most any other ASL/AML
> object) can be dynamically changed.
> 
> We've seen many ACPI tables with invalid resource descriptors (at both
> compile time and runtime), and that is the reason the resource
> descriptor validation was added to the compiler in the first place.
> 
> I don't want to just remove this validation, but yes, perhaps iASL
> should be able to recognize that this descriptor may be modified at
> runtime and therefore a static validation cannot be performed.
> 
> There are at least a few indicators:
> 
> 1) The descriptor is basically all zeroes
> 2) There is a CreateXxxField reference to the descriptor
> 3) There is a Store to the created field
> 
> So, perhaps we could detect the above conditions and then disable
> validation for this particular descriptor. Note, conditions (2) and
> (3) may be difficult to detect.
> 
> I'm open to suggestions.
Not sure whether runtime checks for this exist already.
Bjorn has done some great work there in the past.
If not, that should be by far easier, the so called "low hanging 
fruit"...

    Thomas

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 20:19     ` Thomas Renninger
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Renninger @ 2010-09-10 20:19 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

On Friday 10 September 2010 17:04:34 Moore, Robert wrote:
> We've provided the -cr option to disable the resource descriptor error
> checking.
AFAIK, these zeroed resources that get filled up dynamically later are a 
rather common construct. If below additional checks cannot be added
this (these?) specific resource checks should better get disabled.

> This is an interesting problem. On one hand, we would like to provide
> static (compile time) error checking as much as possible. On the other
> hand, the resource descriptors (as well as most any other ASL/AML
> object) can be dynamically changed.
> 
> We've seen many ACPI tables with invalid resource descriptors (at both
> compile time and runtime), and that is the reason the resource
> descriptor validation was added to the compiler in the first place.
> 
> I don't want to just remove this validation, but yes, perhaps iASL
> should be able to recognize that this descriptor may be modified at
> runtime and therefore a static validation cannot be performed.
> 
> There are at least a few indicators:
> 
> 1) The descriptor is basically all zeroes
> 2) There is a CreateXxxField reference to the descriptor
> 3) There is a Store to the created field
> 
> So, perhaps we could detect the above conditions and then disable
> validation for this particular descriptor. Note, conditions (2) and
> (3) may be difficult to detect.
> 
> I'm open to suggestions.
Not sure whether runtime checks for this exist already.
Bjorn has done some great work there in the past.
If not, that should be by far easier, the so called "low hanging 
fruit"...

    Thomas

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

* RE: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 20:32       ` Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2010-09-10 20:32 UTC (permalink / raw)
  To: Thomas Renninger; +Cc: devel, linux-acpi, bjorn.helgaas

I'd also like to catch the case where a resource descriptor is created with all zeroes, then never referenced.



>-----Original Message-----
>From: Thomas Renninger [mailto:trenn@suse.de]
>Sent: Friday, September 10, 2010 1:19 PM
>To: Moore, Robert
>Cc: devel@acpica.org; linux-acpi@vger.kernel.org; bjorn.helgaas@hp.com
>Subject: Re: [Devel] False positive iasl compiler error on resource object?
>
>On Friday 10 September 2010 17:04:34 Moore, Robert wrote:
>> We've provided the -cr option to disable the resource descriptor error
>> checking.
>AFAIK, these zeroed resources that get filled up dynamically later are a
>rather common construct. If below additional checks cannot be added
>this (these?) specific resource checks should better get disabled.
>
>> This is an interesting problem. On one hand, we would like to provide
>> static (compile time) error checking as much as possible. On the other
>> hand, the resource descriptors (as well as most any other ASL/AML
>> object) can be dynamically changed.
>>
>> We've seen many ACPI tables with invalid resource descriptors (at both
>> compile time and runtime), and that is the reason the resource
>> descriptor validation was added to the compiler in the first place.
>>
>> I don't want to just remove this validation, but yes, perhaps iASL
>> should be able to recognize that this descriptor may be modified at
>> runtime and therefore a static validation cannot be performed.
>>
>> There are at least a few indicators:
>>
>> 1) The descriptor is basically all zeroes
>> 2) There is a CreateXxxField reference to the descriptor
>> 3) There is a Store to the created field
>>
>> So, perhaps we could detect the above conditions and then disable
>> validation for this particular descriptor. Note, conditions (2) and
>> (3) may be difficult to detect.
>>
>> I'm open to suggestions.
>Not sure whether runtime checks for this exist already.
>Bjorn has done some great work there in the past.
>If not, that should be by far easier, the so called "low hanging
>fruit"...
>
>    Thomas

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

* Re: [Devel] False positive iasl compiler error on resource object?
@ 2010-09-10 20:32       ` Moore, Robert
  0 siblings, 0 replies; 10+ messages in thread
From: Moore, Robert @ 2010-09-10 20:32 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

I'd also like to catch the case where a resource descriptor is created with all zeroes, then never referenced.



>-----Original Message-----
>From: Thomas Renninger [mailto:trenn(a)suse.de]
>Sent: Friday, September 10, 2010 1:19 PM
>To: Moore, Robert
>Cc: devel(a)acpica.org; linux-acpi(a)vger.kernel.org; bjorn.helgaas(a)hp.com
>Subject: Re: [Devel] False positive iasl compiler error on resource object?
>
>On Friday 10 September 2010 17:04:34 Moore, Robert wrote:
>> We've provided the -cr option to disable the resource descriptor error
>> checking.
>AFAIK, these zeroed resources that get filled up dynamically later are a
>rather common construct. If below additional checks cannot be added
>this (these?) specific resource checks should better get disabled.
>
>> This is an interesting problem. On one hand, we would like to provide
>> static (compile time) error checking as much as possible. On the other
>> hand, the resource descriptors (as well as most any other ASL/AML
>> object) can be dynamically changed.
>>
>> We've seen many ACPI tables with invalid resource descriptors (at both
>> compile time and runtime), and that is the reason the resource
>> descriptor validation was added to the compiler in the first place.
>>
>> I don't want to just remove this validation, but yes, perhaps iASL
>> should be able to recognize that this descriptor may be modified at
>> runtime and therefore a static validation cannot be performed.
>>
>> There are at least a few indicators:
>>
>> 1) The descriptor is basically all zeroes
>> 2) There is a CreateXxxField reference to the descriptor
>> 3) There is a Store to the created field
>>
>> So, perhaps we could detect the above conditions and then disable
>> validation for this particular descriptor. Note, conditions (2) and
>> (3) may be difficult to detect.
>>
>> I'm open to suggestions.
>Not sure whether runtime checks for this exist already.
>Bjorn has done some great work there in the past.
>If not, that should be by far easier, the so called "low hanging
>fruit"...
>
>    Thomas

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

end of thread, other threads:[~2010-09-10 20:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-10  9:33 False positive iasl compiler error on resource object? Thomas Renninger
2010-09-10  9:33 ` [Devel] " Thomas Renninger
2010-09-10 11:59 ` Thomas Renninger
2010-09-10 11:59   ` Thomas Renninger
2010-09-10 15:04 ` Moore, Robert
2010-09-10 15:04   ` Moore, Robert
2010-09-10 20:19   ` Thomas Renninger
2010-09-10 20:19     ` Thomas Renninger
2010-09-10 20:32     ` Moore, Robert
2010-09-10 20:32       ` Moore, Robert

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.