All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] hvmloader: fix iasl warnings
@ 2015-01-08 16:22 Jan Beulich
  2015-01-08 16:31 ` [PATCH 1/2] hvmloader: avoid named helper symbols Jan Beulich
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jan Beulich @ 2015-01-08 16:22 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Keir Fraser

1: avoid named helper symbols
2: certain methods are not supposed to have a return value

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

* [PATCH 1/2] hvmloader: avoid named helper symbols
  2015-01-08 16:22 [PATCH 0/2] hvmloader: fix iasl warnings Jan Beulich
@ 2015-01-08 16:31 ` Jan Beulich
  2015-01-08 16:32 ` [PATCH 2/2] hvmloader: certain methods are not supposed to have a return value Jan Beulich
  2015-01-08 17:04 ` [PATCH 0/2] hvmloader: fix iasl warnings Ian Campbell
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2015-01-08 16:31 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Keir Fraser

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

Newer iasl validly complains that such routines would otherwise need to
be marked Serialized (in the SSDT case it can't know that explicit
serialization is being enforced), which is undesirable. Use Local<N>
instead.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -109,7 +109,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
 
            Method (_CRS, 0, NotSerialized)
            {
-               Name (PRT0, ResourceTemplate ()
+               Store (ResourceTemplate ()
                {
                    /* bus number is from 0 - 255*/
                    WordBusNumber(
@@ -167,11 +167,11 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                         0x0000000000000010,
                         ,, _Y02)
 
-                })
+                }, Local1)
 
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._MIN, MMIN)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._MAX, MMAX)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._LEN, MLEN)
 
                 Store(\_SB.PMIN, MMIN)
                 Store(\_SB.PLEN, MLEN)
@@ -192,12 +192,12 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                 } Else {
                     Store(\_SB.PCI0._CRS._Y02, Local0)
                 }
-                CreateDWordField(PRT0, Add(Local0, 14), MINL)
-                CreateDWordField(PRT0, Add(Local0, 18), MINH)
-                CreateDWordField(PRT0, Add(Local0, 22), MAXL)
-                CreateDWordField(PRT0, Add(Local0, 26), MAXH)
-                CreateDWordField(PRT0, Add(Local0, 38), LENL)
-                CreateDWordField(PRT0, Add(Local0, 42), LENH)
+                CreateDWordField(Local1, Add(Local0, 14), MINL)
+                CreateDWordField(Local1, Add(Local0, 18), MINH)
+                CreateDWordField(Local1, Add(Local0, 22), MAXL)
+                CreateDWordField(Local1, Add(Local0, 26), MAXH)
+                CreateDWordField(Local1, Add(Local0, 38), LENL)
+                CreateDWordField(Local1, Add(Local0, 42), LENH)
 
                 Store(\_SB.LMIN, MINL)
                 Store(\_SB.HMIN, MINH)
@@ -215,7 +215,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                     Subtract(MAXL, One, MAXL)
                 }
 
-                Return (PRT0)
+                Return (Local1)
             }
 
             Device(HPET) {
--- a/tools/firmware/hvmloader/acpi/ssdt_pm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
@@ -276,14 +276,13 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 HLP8 (Arg0, Local0)
                 Increment (Local0)
             }
+            Return (Arg0)
         }
 
         Method (HLPA, 0, NotSerialized)
         {
             Store (HLP6 (), Local0)
-            Name (TMP, Buffer (Local0) {})
-            HLP9 (TMP, Local0)
-            Return (TMP)
+            Return (HLP9 (Buffer (Local0) {}, Local0))
         }
 
         Method (REL, 0, NotSerialized)
@@ -372,14 +371,14 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 INIT (0x02)
                 INIT (0x01)
                 HLP5 ()
-                Name (BST0, Package (0x04) {})
-                Store (HLP7 (), Index (BST0, 0x00))
-                Store (HLP7 (), Index (BST0, 0x01))
-                Store (HLP7 (), Index (BST0, 0x02))
-                Store (HLP7 (), Index (BST0, 0x03))
+                Store (Package (0x04) {}, Local0)
+                Store (HLP7 (), Index (Local0, 0x00))
+                Store (HLP7 (), Index (Local0, 0x01))
+                Store (HLP7 (), Index (Local0, 0x02))
+                Store (HLP7 (), Index (Local0, 0x03))
                 REL ()
                 Store (2, \_SB.DBG1)
-                Return (BST0)
+                Return (Local0)
             }
         }
 
@@ -409,13 +408,13 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 INIT (0x02)
                 INIT (0x02)
                 HLP5 ()
-                Name (BST1, Package (0x04) {})
-                Store (HLP7 (), Index (BST1, 0x00))
-                Store (HLP7 (), Index (BST1, 0x01))
-                Store (HLP7 (), Index (BST1, 0x02))
-                Store (HLP7 (), Index (BST1, 0x03))
+                Store (Package (0x04) {}, Local0)
+                Store (HLP7 (), Index (Local0, 0x00))
+                Store (HLP7 (), Index (Local0, 0x01))
+                Store (HLP7 (), Index (Local0, 0x02))
+                Store (HLP7 (), Index (Local0, 0x03))
                 REL ()
-                Return (BST1)
+                Return (Local0)
             }
         }
     }



[-- Attachment #2: hvmloader-ASL-temporaries.patch --]
[-- Type: text/plain, Size: 5071 bytes --]

hvmloader: avoid named helper symbols

Newer iasl validly complains that such routines would otherwise need to
be marked Serialized (in the SSDT case it can't know that explicit
serialization is being enforced), which is undesirable. Use Local<N>
instead.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/firmware/hvmloader/acpi/dsdt.asl
+++ b/tools/firmware/hvmloader/acpi/dsdt.asl
@@ -109,7 +109,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
 
            Method (_CRS, 0, NotSerialized)
            {
-               Name (PRT0, ResourceTemplate ()
+               Store (ResourceTemplate ()
                {
                    /* bus number is from 0 - 255*/
                    WordBusNumber(
@@ -167,11 +167,11 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                         0x0000000000000010,
                         ,, _Y02)
 
-                })
+                }, Local1)
 
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
-                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._MIN, MMIN)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._MAX, MMAX)
+                CreateDWordField(Local1, \_SB.PCI0._CRS._Y01._LEN, MLEN)
 
                 Store(\_SB.PMIN, MMIN)
                 Store(\_SB.PLEN, MLEN)
@@ -192,12 +192,12 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                 } Else {
                     Store(\_SB.PCI0._CRS._Y02, Local0)
                 }
-                CreateDWordField(PRT0, Add(Local0, 14), MINL)
-                CreateDWordField(PRT0, Add(Local0, 18), MINH)
-                CreateDWordField(PRT0, Add(Local0, 22), MAXL)
-                CreateDWordField(PRT0, Add(Local0, 26), MAXH)
-                CreateDWordField(PRT0, Add(Local0, 38), LENL)
-                CreateDWordField(PRT0, Add(Local0, 42), LENH)
+                CreateDWordField(Local1, Add(Local0, 14), MINL)
+                CreateDWordField(Local1, Add(Local0, 18), MINH)
+                CreateDWordField(Local1, Add(Local0, 22), MAXL)
+                CreateDWordField(Local1, Add(Local0, 26), MAXH)
+                CreateDWordField(Local1, Add(Local0, 38), LENL)
+                CreateDWordField(Local1, Add(Local0, 42), LENH)
 
                 Store(\_SB.LMIN, MINL)
                 Store(\_SB.HMIN, MINH)
@@ -215,7 +215,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
                     Subtract(MAXL, One, MAXL)
                 }
 
-                Return (PRT0)
+                Return (Local1)
             }
 
             Device(HPET) {
--- a/tools/firmware/hvmloader/acpi/ssdt_pm.asl
+++ b/tools/firmware/hvmloader/acpi/ssdt_pm.asl
@@ -276,14 +276,13 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 HLP8 (Arg0, Local0)
                 Increment (Local0)
             }
+            Return (Arg0)
         }
 
         Method (HLPA, 0, NotSerialized)
         {
             Store (HLP6 (), Local0)
-            Name (TMP, Buffer (Local0) {})
-            HLP9 (TMP, Local0)
-            Return (TMP)
+            Return (HLP9 (Buffer (Local0) {}, Local0))
         }
 
         Method (REL, 0, NotSerialized)
@@ -372,14 +371,14 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 INIT (0x02)
                 INIT (0x01)
                 HLP5 ()
-                Name (BST0, Package (0x04) {})
-                Store (HLP7 (), Index (BST0, 0x00))
-                Store (HLP7 (), Index (BST0, 0x01))
-                Store (HLP7 (), Index (BST0, 0x02))
-                Store (HLP7 (), Index (BST0, 0x03))
+                Store (Package (0x04) {}, Local0)
+                Store (HLP7 (), Index (Local0, 0x00))
+                Store (HLP7 (), Index (Local0, 0x01))
+                Store (HLP7 (), Index (Local0, 0x02))
+                Store (HLP7 (), Index (Local0, 0x03))
                 REL ()
                 Store (2, \_SB.DBG1)
-                Return (BST0)
+                Return (Local0)
             }
         }
 
@@ -409,13 +408,13 @@ DefinitionBlock ("SSDT_PM.aml", "SSDT", 
                 INIT (0x02)
                 INIT (0x02)
                 HLP5 ()
-                Name (BST1, Package (0x04) {})
-                Store (HLP7 (), Index (BST1, 0x00))
-                Store (HLP7 (), Index (BST1, 0x01))
-                Store (HLP7 (), Index (BST1, 0x02))
-                Store (HLP7 (), Index (BST1, 0x03))
+                Store (Package (0x04) {}, Local0)
+                Store (HLP7 (), Index (Local0, 0x00))
+                Store (HLP7 (), Index (Local0, 0x01))
+                Store (HLP7 (), Index (Local0, 0x02))
+                Store (HLP7 (), Index (Local0, 0x03))
                 REL ()
-                Return (BST1)
+                Return (Local0)
             }
         }
     }

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* [PATCH 2/2] hvmloader: certain methods are not supposed to have a return value
  2015-01-08 16:22 [PATCH 0/2] hvmloader: fix iasl warnings Jan Beulich
  2015-01-08 16:31 ` [PATCH 1/2] hvmloader: avoid named helper symbols Jan Beulich
@ 2015-01-08 16:32 ` Jan Beulich
  2015-01-08 17:04 ` [PATCH 0/2] hvmloader: fix iasl warnings Ian Campbell
  2 siblings, 0 replies; 4+ messages in thread
From: Jan Beulich @ 2015-01-08 16:32 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Keir Fraser

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

Newer iasl complains about this being violated.

Also convert a ShiftLeft(<constant>, <constant>) to a plain constant.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/firmware/hvmloader/acpi/mk_dsdt.c
+++ b/tools/firmware/hvmloader/acpi/mk_dsdt.c
@@ -222,12 +222,9 @@ int main(int argc, char **argv)
 
     /* Define GPE control method. */
     push_block("Scope", "\\_GPE");
-    if (dm_version == QEMU_XEN_TRADITIONAL) {
-        push_block("Method", "_L02");
-    } else {
-        push_block("Method", "_E02");
-    }
-    stmt("Return", "\\_SB.PRSC()");
+    push_block("Method",
+               dm_version == QEMU_XEN_TRADITIONAL ? "_L02" : "_E02");
+    stmt("\\_SB.PRSC ()", NULL);
     pop_block();
     pop_block();
     /**** Processor end ****/
@@ -374,8 +371,7 @@ int main(int argc, char **argv)
             push_block("Device", "S%i", slot); {
                 stmt("Name", "_ADR, %#06x0000", slot);
                 push_block("Method", "_EJ0,1"); {
-                    stmt("Store", "ShiftLeft(1, %#06x), B0EJ", slot);
-                    stmt("Return", "0x0");
+                    stmt("Store", "%#010x, B0EJ", 1 << slot);
                 } pop_block();
                 stmt("Name", "_SUN, %i", slot);
             } pop_block();




[-- Attachment #2: hvmloader-ASL-bogus-retvals.patch --]
[-- Type: text/plain, Size: 1423 bytes --]

hvmloader: certain methods are not supposed to have a return value

Newer iasl complains about this being violated.

Also convert a ShiftLeft(<constant>, <constant>) to a plain constant.

Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/firmware/hvmloader/acpi/mk_dsdt.c
+++ b/tools/firmware/hvmloader/acpi/mk_dsdt.c
@@ -222,12 +222,9 @@ int main(int argc, char **argv)
 
     /* Define GPE control method. */
     push_block("Scope", "\\_GPE");
-    if (dm_version == QEMU_XEN_TRADITIONAL) {
-        push_block("Method", "_L02");
-    } else {
-        push_block("Method", "_E02");
-    }
-    stmt("Return", "\\_SB.PRSC()");
+    push_block("Method",
+               dm_version == QEMU_XEN_TRADITIONAL ? "_L02" : "_E02");
+    stmt("\\_SB.PRSC ()", NULL);
     pop_block();
     pop_block();
     /**** Processor end ****/
@@ -374,8 +371,7 @@ int main(int argc, char **argv)
             push_block("Device", "S%i", slot); {
                 stmt("Name", "_ADR, %#06x0000", slot);
                 push_block("Method", "_EJ0,1"); {
-                    stmt("Store", "ShiftLeft(1, %#06x), B0EJ", slot);
-                    stmt("Return", "0x0");
+                    stmt("Store", "%#010x, B0EJ", 1 << slot);
                 } pop_block();
                 stmt("Name", "_SUN, %i", slot);
             } pop_block();

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

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

* Re: [PATCH 0/2] hvmloader: fix iasl warnings
  2015-01-08 16:22 [PATCH 0/2] hvmloader: fix iasl warnings Jan Beulich
  2015-01-08 16:31 ` [PATCH 1/2] hvmloader: avoid named helper symbols Jan Beulich
  2015-01-08 16:32 ` [PATCH 2/2] hvmloader: certain methods are not supposed to have a return value Jan Beulich
@ 2015-01-08 17:04 ` Ian Campbell
  2 siblings, 0 replies; 4+ messages in thread
From: Ian Campbell @ 2015-01-08 17:04 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel, Keir Fraser

On Thu, 2015-01-08 at 16:22 +0000, Jan Beulich wrote:
> 1: avoid named helper symbols
> 2: certain methods are not supposed to have a return value
> 
> Reported-by: Ian Campbell <Ian.Campbell@citrix.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

FWIW (I'm no asl expect): Acked-by: Ian Campbell <ian.campbell@citrixz.com>

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

end of thread, other threads:[~2015-01-08 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-08 16:22 [PATCH 0/2] hvmloader: fix iasl warnings Jan Beulich
2015-01-08 16:31 ` [PATCH 1/2] hvmloader: avoid named helper symbols Jan Beulich
2015-01-08 16:32 ` [PATCH 2/2] hvmloader: certain methods are not supposed to have a return value Jan Beulich
2015-01-08 17:04 ` [PATCH 0/2] hvmloader: fix iasl warnings Ian Campbell

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.