Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-26 Thread Robert Hoo
On Wed, 2022-10-26 at 10:45 -0400, Michael S. Tsirkin wrote:
> On Thu, Sep 22, 2022 at 08:21:55PM +0800, Robert Hoo wrote:
> > And empty bios-tables-test-allowed-diff.h.
> > 
> > Diff of ASL form, from qtest testlog.txt:
> > 
> > --- /tmp/asl-RFWZS1.dsl 2022-09-22 18:25:06.191519589 +0800
> > +++ /tmp/asl-B1ZZS1.dsl 2022-09-22 18:25:06.187519182 +0800
> 
> Adding --- is what broke things here and why this does not apply.
> You need to prefix each line e.g. with a space.
> 
OK, thanks Michael.
How about simply remove the 2 lines?
Do I need to resend a new version of this patch set?
> 
> > @@ -1,30 +1,30 @@
> >  /*
> >   * Intel ACPI Component Architecture
> >   * AML/ASL+ Disassembler version 20180629 (64-bit version)
> >   * Copyright (c) 2000 - 2018 Intel Corporation
> >   *
> >   * Disassembling to symbolic ASL+ operators
> >   *
> > - * Disassembly of tests/data/acpi/pc/SSDT.dimmpxm, Thu Sep 22
> > 18:25:06 2022
> > + * Disassembly of /tmp/aml-YYZZS1, Thu Sep 22 18:25:06 2022
> >   *
> >   * Original Table Header:
> >   * Signature"SSDT"
> > - * Length   0x02DE (734)
> > + * Length   0x0717 (1815)
> >   * Revision 0x01
> > - * Checksum 0x56
> > + * Checksum 0xBC
> >   * OEM ID   "BOCHS "
> >   * OEM Table ID "NVDIMM"
> >   * OEM Revision 0x0001 (1)
> >   * Compiler ID  "BXPC"
> >   * Compiler Version 0x0001 (1)
> >   */
> >  DefinitionBlock ("", "SSDT", 1, "BOCHS ", "NVDIMM", 0x0001)
> >  {
> >  Scope (\_SB)
> >  {
> >  Device (NVDR)
> >  {
> >  Name (_HID, "ACPI0012" /* NVDIMM Root Device */)  //
> > _HID: Hardware ID
> >  Method (NCAL, 5, Serialized)
> >  {
> >  Local6 = MEMA /* \MEMA */
> > @@ -49,52 +49,52 @@
> >  ODAT,   32736
> >  }
> > 
> >  If ((Arg4 == Zero))
> >  {
> >  Local0 = ToUUID ("2f10e7a4-9e91-11e4-89d3-
> > 123b93f75cba")
> >  }
> >  ElseIf ((Arg4 == 0x0001))
> >  {
> >  Local0 = ToUUID ("648b9cf2-cda1-4312-8ad9-
> > 49c4af32bd62")
> >  }
> >  Else
> >  {
> >  Local0 = ToUUID ("4309ac30-0d11-11e4-9191-
> > 0800200c9a66")
> >  }
> > 
> > -If (((Local6 == Zero) | (Arg0 != Local0)))
> > +If (((Local6 == Zero) || (Arg0 != Local0)))
> >  {
> >  If ((Arg2 == Zero))
> >  {
> >  Return (Buffer (One)
> >  {
> >   0x00 
> > // .
> >  })
> >  }
> > 
> >  Return (Buffer (One)
> >  {
> >   0x01 
> > // .
> >  })
> >  }
> > 
> >  HDLE = Arg4
> >  REVS = Arg1
> >  FUNC = Arg2
> > -If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3)
> > == One)))
> > +If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3)
> > == One)))
> >  {
> >  Local2 = Arg3 [Zero]
> >  Local3 = DerefOf (Local2)
> >  FARG = Local3
> >  }
> > 
> >  NTFI = Local6
> >  Local1 = (RLEN - 0x04)
> >  If ((Local1 < 0x08))
> >  {
> >  Local2 = Zero
> >  Name (TBUF, Buffer (One)
> >  {
> >   0x00 
> > // .
> >  })
> >  Local7 = Buffer (Zero){}
> > @@ -161,45 +161,234 @@
> >  Else
> >  {
> >  If ((Local1 == Zero))
> >  {
> >  Return (Local2)
> >  }
> > 
> >  Local3 += Local1
> >  Concatenate (Local2, Local0, Local2)
> >  }
> >  }
> >  }
> > 
> >  Device (NV00)
> >  {
> >  Name (_ADR, One)  // _ADR: Address
> > +Method (_LSI, 0, Serialized)  // _LSI: Label
> > Storage Information
> > +{
> > +Local0 = NCAL (ToUUID ("4309ac30-0d11-11e4-
> > 9191-0800200c9a66"), One, 0x04, Zero, One)
> > +CreateDWordField (Local0, Zero, STTS)
> > +CreateDWordField (Local0, 0x04, SLSA)
> > +CreateDWordField (Local0, 0x08, MAXT)
> > +

Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-26 Thread Michael S. Tsirkin
On Thu, Sep 22, 2022 at 08:21:55PM +0800, Robert Hoo wrote:
> And empty bios-tables-test-allowed-diff.h.
> 
> Diff of ASL form, from qtest testlog.txt:
> 
> --- /tmp/asl-RFWZS1.dsl   2022-09-22 18:25:06.191519589 +0800
> +++ /tmp/asl-B1ZZS1.dsl   2022-09-22 18:25:06.187519182 +0800

Adding --- is what broke things here and why this does not apply.
You need to prefix each line e.g. with a space.


> @@ -1,30 +1,30 @@
>  /*
>   * Intel ACPI Component Architecture
>   * AML/ASL+ Disassembler version 20180629 (64-bit version)
>   * Copyright (c) 2000 - 2018 Intel Corporation
>   *
>   * Disassembling to symbolic ASL+ operators
>   *
> - * Disassembly of tests/data/acpi/pc/SSDT.dimmpxm, Thu Sep 22 18:25:06 2022
> + * Disassembly of /tmp/aml-YYZZS1, Thu Sep 22 18:25:06 2022
>   *
>   * Original Table Header:
>   * Signature"SSDT"
> - * Length   0x02DE (734)
> + * Length   0x0717 (1815)
>   * Revision 0x01
> - * Checksum 0x56
> + * Checksum 0xBC
>   * OEM ID   "BOCHS "
>   * OEM Table ID "NVDIMM"
>   * OEM Revision 0x0001 (1)
>   * Compiler ID  "BXPC"
>   * Compiler Version 0x0001 (1)
>   */
>  DefinitionBlock ("", "SSDT", 1, "BOCHS ", "NVDIMM", 0x0001)
>  {
>  Scope (\_SB)
>  {
>  Device (NVDR)
>  {
>  Name (_HID, "ACPI0012" /* NVDIMM Root Device */)  // _HID: 
> Hardware ID
>  Method (NCAL, 5, Serialized)
>  {
>  Local6 = MEMA /* \MEMA */
> @@ -49,52 +49,52 @@
>  ODAT,   32736
>  }
> 
>  If ((Arg4 == Zero))
>  {
>  Local0 = ToUUID ("2f10e7a4-9e91-11e4-89d3-123b93f75cba")
>  }
>  ElseIf ((Arg4 == 0x0001))
>  {
>  Local0 = ToUUID ("648b9cf2-cda1-4312-8ad9-49c4af32bd62")
>  }
>  Else
>  {
>  Local0 = ToUUID ("4309ac30-0d11-11e4-9191-0800200c9a66")
>  }
> 
> -If (((Local6 == Zero) | (Arg0 != Local0)))
> +If (((Local6 == Zero) || (Arg0 != Local0)))
>  {
>  If ((Arg2 == Zero))
>  {
>  Return (Buffer (One)
>  {
>   0x00
>  // .
>  })
>  }
> 
>  Return (Buffer (One)
>  {
>   0x01 // 
> .
>  })
>  }
> 
>  HDLE = Arg4
>  REVS = Arg1
>  FUNC = Arg2
> -If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3) == One)))
> +If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3) == One)))
>  {
>  Local2 = Arg3 [Zero]
>  Local3 = DerefOf (Local2)
>  FARG = Local3
>  }
> 
>  NTFI = Local6
>  Local1 = (RLEN - 0x04)
>  If ((Local1 < 0x08))
>  {
>  Local2 = Zero
>  Name (TBUF, Buffer (One)
>  {
>   0x00 // 
> .
>  })
>  Local7 = Buffer (Zero){}
> @@ -161,45 +161,234 @@
>  Else
>  {
>  If ((Local1 == Zero))
>  {
>  Return (Local2)
>  }
> 
>  Local3 += Local1
>  Concatenate (Local2, Local0, Local2)
>  }
>  }
>  }
> 
>  Device (NV00)
>  {
>  Name (_ADR, One)  // _ADR: Address
> +Method (_LSI, 0, Serialized)  // _LSI: Label Storage 
> Information
> +{
> +Local0 = NCAL (ToUUID 
> ("4309ac30-0d11-11e4-9191-0800200c9a66"), One, 0x04, Zero, One)
> +CreateDWordField (Local0, Zero, STTS)
> +CreateDWordField (Local0, 0x04, SLSA)
> +CreateDWordField (Local0, 0x08, MAXT)
> +Local1 = Package (0x03)
> +{
> +STTS,
> +SLSA,
> +MAXT
> +}
> +Return (Local1)
> +}
> +
> +Method (_LSR, 2, Serialized)  // _LSR: Label Storage Read
> +{
> +Name (INPT, Buffer (0x08)
> +{
> +   

Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-20 Thread Igor Mammedov
On Thu, 20 Oct 2022 08:01:48 -0400
"Michael S. Tsirkin"  wrote:

> On Thu, Oct 20, 2022 at 01:48:49PM +0200, Igor Mammedov wrote:
> > On Thu, 20 Oct 2022 08:48:36 +0800
> > Robert Hoo  wrote:
> >   
> > > Ping...  
> > 
> > sorry, series got lost among the rest.
> > I've just acked 4/5, but this patch doesn't apply anymore with
> >  error: corrupt patch at line 172  
> 
> 
> updating binaries can be done when applying, this is why
> we have the process of splitting these patches out.
> 
> If the diff looks good to you - then just ack this, and I will
> check it's the diff when applying.


Acked-by: Igor Mammedov 

> 
> 
> > > On Fri, 2022-10-07 at 21:27 +0800, Robert Hoo wrote:  
> > > > Ping...
> > > > On Tue, 2022-09-27 at 08:30 +0800, Robert Hoo wrote:
> > > > > On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:
> > > > > > > > 0800200c9a66"), One, 0x05, Local0, One)
> > > > > > > > +CreateDWordField (Local3, Zero, STTS)
> > > > > > > > +CreateField (Local3, 0x20, (LEN <<
> > > > > > > > 0x03),
> > > > > > > > LDAT)
> > > > > > > > +Name (LSA, Buffer (Zero){})
> > > > > > > > +ToBuffer (LDAT, LSA) /*
> > > > > > > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > > > > > > +Local1 = Package (0x02)
> > > > > > > > +{
> > > > > > > > +STTS,
> > > > > > > > +LSA
> > > > > > > > +}  
> > > > > > > 
> > > > > > > Hi Igor,
> > > > > > > 
> > > > > > > Here is a little different from original proposal 
> > > > > > > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > > > > > > 
> > > > > > >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > > > > > > 
> > > > > > > Because in my test, Linux guest complains:
> > > > > > > 
> > > > > > > [3.884656] ACPI Error: AE_SUPPORT, Expressions within
> > > > > > > package
> > > > > > > elements are not supported (20220331/dspkginit-172)
> > > > > > > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR
> > > > > > > due
> > > > > > > to
> > > > > > > previous error (AE_SUPPORT) (20220331/psparse-531)
> > > > > > > 
> > > > > > > 
> > > > > > > So I have to move toBuffer() out of Package{} and name LSA to
> > > > > > > hold
> > > > > > > the
> > > > > > > buffer. If you have better idea, pls. let me know.
> > > > > > 
> > > > > > Would something like following work?
> > > > > > 
> > > > > > LocalX =  Buffer (Zero){}
> > > > > > LocalY = Package (0x01) { LocalX }
> > > > > 
> > > > > 
> > > > > No, Package{} doesn't accept LocalX as elements.
> > > > > 
> > > > > PackageTerm :=
> > > > > Package (
> > > > > NumElements // Nothing | ByteConstExpr | TermArg => Integer
> > > > > ) {PackageList} => Package
> > > > > 
> > > > > PackageList :=
> > > > > Nothing | 
> > > > > 
> > > > > PackageElement :=
> > > > > DataObject | NameString
> > >   
> 




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-20 Thread Michael S. Tsirkin
On Thu, Oct 20, 2022 at 01:48:49PM +0200, Igor Mammedov wrote:
> On Thu, 20 Oct 2022 08:48:36 +0800
> Robert Hoo  wrote:
> 
> > Ping...
> 
> sorry, series got lost among the rest.
> I've just acked 4/5, but this patch doesn't apply anymore with
>  error: corrupt patch at line 172


updating binaries can be done when applying, this is why
we have the process of splitting these patches out.

If the diff looks good to you - then just ack this, and I will
check it's the diff when applying.


> > On Fri, 2022-10-07 at 21:27 +0800, Robert Hoo wrote:
> > > Ping...
> > > On Tue, 2022-09-27 at 08:30 +0800, Robert Hoo wrote:  
> > > > On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:  
> > > > > > > 0800200c9a66"), One, 0x05, Local0, One)
> > > > > > > +CreateDWordField (Local3, Zero, STTS)
> > > > > > > +CreateField (Local3, 0x20, (LEN <<
> > > > > > > 0x03),
> > > > > > > LDAT)
> > > > > > > +Name (LSA, Buffer (Zero){})
> > > > > > > +ToBuffer (LDAT, LSA) /*
> > > > > > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > > > > > +Local1 = Package (0x02)
> > > > > > > +{
> > > > > > > +STTS,
> > > > > > > +LSA
> > > > > > > +}
> > > > > > 
> > > > > > Hi Igor,
> > > > > > 
> > > > > > Here is a little different from original proposal 
> > > > > > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > > > > > 
> > > > > >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > > > > > 
> > > > > > Because in my test, Linux guest complains:
> > > > > > 
> > > > > > [3.884656] ACPI Error: AE_SUPPORT, Expressions within
> > > > > > package
> > > > > > elements are not supported (20220331/dspkginit-172)
> > > > > > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR
> > > > > > due
> > > > > > to
> > > > > > previous error (AE_SUPPORT) (20220331/psparse-531)
> > > > > > 
> > > > > > 
> > > > > > So I have to move toBuffer() out of Package{} and name LSA to
> > > > > > hold
> > > > > > the
> > > > > > buffer. If you have better idea, pls. let me know.  
> > > > > 
> > > > > Would something like following work?
> > > > > 
> > > > > LocalX =  Buffer (Zero){}
> > > > > LocalY = Package (0x01) { LocalX }  
> > > > 
> > > > 
> > > > No, Package{} doesn't accept LocalX as elements.
> > > > 
> > > > PackageTerm :=
> > > > Package (
> > > > NumElements // Nothing | ByteConstExpr | TermArg => Integer
> > > > ) {PackageList} => Package
> > > > 
> > > > PackageList :=
> > > > Nothing | 
> > > > 
> > > > PackageElement :=
> > > > DataObject | NameString  
> > 




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-20 Thread Igor Mammedov
On Thu, 20 Oct 2022 08:48:36 +0800
Robert Hoo  wrote:

> Ping...

sorry, series got lost among the rest.
I've just acked 4/5, but this patch doesn't apply anymore with
 error: corrupt patch at line 172

> On Fri, 2022-10-07 at 21:27 +0800, Robert Hoo wrote:
> > Ping...
> > On Tue, 2022-09-27 at 08:30 +0800, Robert Hoo wrote:  
> > > On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:  
> > > > > > 0800200c9a66"), One, 0x05, Local0, One)
> > > > > > +CreateDWordField (Local3, Zero, STTS)
> > > > > > +CreateField (Local3, 0x20, (LEN <<
> > > > > > 0x03),
> > > > > > LDAT)
> > > > > > +Name (LSA, Buffer (Zero){})
> > > > > > +ToBuffer (LDAT, LSA) /*
> > > > > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > > > > +Local1 = Package (0x02)
> > > > > > +{
> > > > > > +STTS,
> > > > > > +LSA
> > > > > > +}
> > > > > 
> > > > > Hi Igor,
> > > > > 
> > > > > Here is a little different from original proposal 
> > > > > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > > > > 
> > > > >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > > > > 
> > > > > Because in my test, Linux guest complains:
> > > > > 
> > > > > [3.884656] ACPI Error: AE_SUPPORT, Expressions within
> > > > > package
> > > > > elements are not supported (20220331/dspkginit-172)
> > > > > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR
> > > > > due
> > > > > to
> > > > > previous error (AE_SUPPORT) (20220331/psparse-531)
> > > > > 
> > > > > 
> > > > > So I have to move toBuffer() out of Package{} and name LSA to
> > > > > hold
> > > > > the
> > > > > buffer. If you have better idea, pls. let me know.  
> > > > 
> > > > Would something like following work?
> > > > 
> > > > LocalX =  Buffer (Zero){}
> > > > LocalY = Package (0x01) { LocalX }  
> > > 
> > > 
> > > No, Package{} doesn't accept LocalX as elements.
> > > 
> > > PackageTerm :=
> > > Package (
> > > NumElements // Nothing | ByteConstExpr | TermArg => Integer
> > > ) {PackageList} => Package
> > > 
> > > PackageList :=
> > > Nothing | 
> > > 
> > > PackageElement :=
> > > DataObject | NameString  
> 




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-19 Thread Robert Hoo
Ping...
On Fri, 2022-10-07 at 21:27 +0800, Robert Hoo wrote:
> Ping...
> On Tue, 2022-09-27 at 08:30 +0800, Robert Hoo wrote:
> > On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:
> > > > > 0800200c9a66"), One, 0x05, Local0, One)
> > > > > +CreateDWordField (Local3, Zero, STTS)
> > > > > +CreateField (Local3, 0x20, (LEN <<
> > > > > 0x03),
> > > > > LDAT)
> > > > > +Name (LSA, Buffer (Zero){})
> > > > > +ToBuffer (LDAT, LSA) /*
> > > > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > > > +Local1 = Package (0x02)
> > > > > +{
> > > > > +STTS,
> > > > > +LSA
> > > > > +}  
> > > > 
> > > > Hi Igor,
> > > > 
> > > > Here is a little different from original proposal 
> > > > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > > > 
> > > >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > > > 
> > > > Because in my test, Linux guest complains:
> > > > 
> > > > [3.884656] ACPI Error: AE_SUPPORT, Expressions within
> > > > package
> > > > elements are not supported (20220331/dspkginit-172)
> > > > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR
> > > > due
> > > > to
> > > > previous error (AE_SUPPORT) (20220331/psparse-531)
> > > > 
> > > > 
> > > > So I have to move toBuffer() out of Package{} and name LSA to
> > > > hold
> > > > the
> > > > buffer. If you have better idea, pls. let me know.
> > > 
> > > Would something like following work?
> > > 
> > > LocalX =  Buffer (Zero){}
> > > LocalY = Package (0x01) { LocalX }
> > 
> > 
> > No, Package{} doesn't accept LocalX as elements.
> > 
> > PackageTerm :=
> > Package (
> > NumElements // Nothing | ByteConstExpr | TermArg => Integer
> > ) {PackageList} => Package
> > 
> > PackageList :=
> > Nothing | 
> > 
> > PackageElement :=
> > DataObject | NameString




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-10-07 Thread Robert Hoo
Ping...
On Tue, 2022-09-27 at 08:30 +0800, Robert Hoo wrote:
> On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:
> > > > 0800200c9a66"), One, 0x05, Local0, One)
> > > > +CreateDWordField (Local3, Zero, STTS)
> > > > +CreateField (Local3, 0x20, (LEN << 0x03),
> > > > LDAT)
> > > > +Name (LSA, Buffer (Zero){})
> > > > +ToBuffer (LDAT, LSA) /*
> > > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > > +Local1 = Package (0x02)
> > > > +{
> > > > +STTS,
> > > > +LSA
> > > > +}  
> > > 
> > > Hi Igor,
> > > 
> > > Here is a little different from original proposal 
> > > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > > 
> > >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > > 
> > > Because in my test, Linux guest complains:
> > > 
> > > [3.884656] ACPI Error: AE_SUPPORT, Expressions within package
> > > elements are not supported (20220331/dspkginit-172)
> > > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR
> > > due
> > > to
> > > previous error (AE_SUPPORT) (20220331/psparse-531)
> > > 
> > > 
> > > So I have to move toBuffer() out of Package{} and name LSA to
> > > hold
> > > the
> > > buffer. If you have better idea, pls. let me know.
> > 
> > Would something like following work?
> > 
> > LocalX =  Buffer (Zero){}
> > LocalY = Package (0x01) { LocalX }
> 
> 
> No, Package{} doesn't accept LocalX as elements.
> 
> PackageTerm :=
> Package (
> NumElements // Nothing | ByteConstExpr | TermArg => Integer
> ) {PackageList} => Package
> 
> PackageList :=
> Nothing | 
> 
> PackageElement :=
> DataObject | NameString




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-09-26 Thread Robert Hoo
On Mon, 2022-09-26 at 15:22 +0200, Igor Mammedov wrote:
> > > 0800200c9a66"), One, 0x05, Local0, One)
> > > +CreateDWordField (Local3, Zero, STTS)
> > > +CreateField (Local3, 0x20, (LEN << 0x03),
> > > LDAT)
> > > +Name (LSA, Buffer (Zero){})
> > > +ToBuffer (LDAT, LSA) /*
> > > \_SB_.NVDR.NV00._LSR.LSA_ */
> > > +Local1 = Package (0x02)
> > > +{
> > > +STTS,
> > > +LSA
> > > +}  
> > 
> > Hi Igor,
> > 
> > Here is a little different from original proposal 
> > https://lore.kernel.org/qemu-devel/80b09055416c790922c7c3db60d2ba865792d1b0.ca...@linux.intel.com/
> > 
> >Local1 = Package (0x2) {STTS, toBuffer(LDAT)}
> > 
> > Because in my test, Linux guest complains:
> > 
> > [3.884656] ACPI Error: AE_SUPPORT, Expressions within package
> > elements are not supported (20220331/dspkginit-172)
> > [3.887104] ACPI Error: Aborting method \_SB.NVDR.NV00._LSR due
> > to
> > previous error (AE_SUPPORT) (20220331/psparse-531)
> > 
> > 
> > So I have to move toBuffer() out of Package{} and name LSA to hold
> > the
> > buffer. If you have better idea, pls. let me know.
> 
> Would something like following work?
> 
> LocalX =  Buffer (Zero){}
> LocalY = Package (0x01) { LocalX }


No, Package{} doesn't accept LocalX as elements.

PackageTerm :=
Package (
NumElements // Nothing | ByteConstExpr | TermArg => Integer
) {PackageList} => Package

PackageList :=
Nothing | 

PackageElement :=
DataObject | NameString




Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-09-26 Thread Igor Mammedov
On Thu, 22 Sep 2022 20:29:12 +0800
Robert Hoo  wrote:

> On Thu, 2022-09-22 at 20:21 +0800, Robert Hoo wrote:
> > And empty bios-tables-test-allowed-diff.h.
> > 
> > Diff of ASL form, from qtest testlog.txt:
> > 
> > --- /tmp/asl-RFWZS1.dsl 2022-09-22 18:25:06.191519589 +0800
> > +++ /tmp/asl-B1ZZS1.dsl 2022-09-22 18:25:06.187519182 +0800
> > @@ -1,30 +1,30 @@
> >  /*
> >   * Intel ACPI Component Architecture
> >   * AML/ASL+ Disassembler version 20180629 (64-bit version)
> >   * Copyright (c) 2000 - 2018 Intel Corporation
> >   *
> >   * Disassembling to symbolic ASL+ operators
> >   *
> > - * Disassembly of tests/data/acpi/pc/SSDT.dimmpxm, Thu Sep 22
> > 18:25:06 2022
> > + * Disassembly of /tmp/aml-YYZZS1, Thu Sep 22 18:25:06 2022
> >   *
> >   * Original Table Header:
> >   * Signature"SSDT"
> > - * Length   0x02DE (734)
> > + * Length   0x0717 (1815)
> >   * Revision 0x01
> > - * Checksum 0x56
> > + * Checksum 0xBC
> >   * OEM ID   "BOCHS "
> >   * OEM Table ID "NVDIMM"
> >   * OEM Revision 0x0001 (1)
> >   * Compiler ID  "BXPC"
> >   * Compiler Version 0x0001 (1)
> >   */
> >  DefinitionBlock ("", "SSDT", 1, "BOCHS ", "NVDIMM", 0x0001)
> >  {
> >  Scope (\_SB)
> >  {
> >  Device (NVDR)
> >  {
> >  Name (_HID, "ACPI0012" /* NVDIMM Root Device */)  //
> > _HID: Hardware ID
> >  Method (NCAL, 5, Serialized)
> >  {
> >  Local6 = MEMA /* \MEMA */
> > @@ -49,52 +49,52 @@
> >  ODAT,   32736
> >  }
> > 
> >  If ((Arg4 == Zero))
> >  {
> >  Local0 = ToUUID ("2f10e7a4-9e91-11e4-89d3-
> > 123b93f75cba")
> >  }
> >  ElseIf ((Arg4 == 0x0001))
> >  {
> >  Local0 = ToUUID ("648b9cf2-cda1-4312-8ad9-
> > 49c4af32bd62")
> >  }
> >  Else
> >  {
> >  Local0 = ToUUID ("4309ac30-0d11-11e4-9191-
> > 0800200c9a66")
> >  }
> > 
> > -If (((Local6 == Zero) | (Arg0 != Local0)))
> > +If (((Local6 == Zero) || (Arg0 != Local0)))
> >  {
> >  If ((Arg2 == Zero))
> >  {
> >  Return (Buffer (One)
> >  {
> >   0x00   
> >   // .
> >  })
> >  }
> > 
> >  Return (Buffer (One)
> >  {
> >   0x01   
> >   // .
> >  })
> >  }
> > 
> >  HDLE = Arg4
> >  REVS = Arg1
> >  FUNC = Arg2
> > -If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3) ==
> > One)))
> > +If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3)
> > == One)))
> >  {
> >  Local2 = Arg3 [Zero]
> >  Local3 = DerefOf (Local2)
> >  FARG = Local3
> >  }
> > 
> >  NTFI = Local6
> >  Local1 = (RLEN - 0x04)
> >  If ((Local1 < 0x08))
> >  {
> >  Local2 = Zero
> >  Name (TBUF, Buffer (One)
> >  {
> >   0x00   
> >   // .
> >  })
> >  Local7 = Buffer (Zero){}
> > @@ -161,45 +161,234 @@
> >  Else
> >  {
> >  If ((Local1 == Zero))
> >  {
> >  Return (Local2)
> >  }
> > 
> >  Local3 += Local1
> >  Concatenate (Local2, Local0, Local2)
> >  }
> >  }
> >  }
> > 
> >  Device (NV00)
> >  {
> >  Name (_ADR, One)  // _ADR: Address
> > +Method (_LSI, 0, Serialized)  // _LSI: Label Storage
> > Information
> > +{
> > +Local0 = NCAL (ToUUID ("4309ac30-0d11-11e4-9191-
> > 0800200c9a66"), One, 0x04, Zero, One)
> > +CreateDWordField (Local0, Zero, STTS)
> > +CreateDWordField (Local0, 0x04, SLSA)
> > +CreateDWordField (Local0, 0x08, MAXT)
> > +Local1 = Package (0x03)
> > +{
> > +STTS,
> > +SLSA,
> > +MAXT
> > +}
> > +Return (Local1)
> > +  

Re: [PATCH v4 5/5] test/acpi/bios-tables-test: SSDT: update golden master binaries

2022-09-22 Thread Robert Hoo
On Thu, 2022-09-22 at 20:21 +0800, Robert Hoo wrote:
> And empty bios-tables-test-allowed-diff.h.
> 
> Diff of ASL form, from qtest testlog.txt:
> 
> --- /tmp/asl-RFWZS1.dsl   2022-09-22 18:25:06.191519589 +0800
> +++ /tmp/asl-B1ZZS1.dsl   2022-09-22 18:25:06.187519182 +0800
> @@ -1,30 +1,30 @@
>  /*
>   * Intel ACPI Component Architecture
>   * AML/ASL+ Disassembler version 20180629 (64-bit version)
>   * Copyright (c) 2000 - 2018 Intel Corporation
>   *
>   * Disassembling to symbolic ASL+ operators
>   *
> - * Disassembly of tests/data/acpi/pc/SSDT.dimmpxm, Thu Sep 22
> 18:25:06 2022
> + * Disassembly of /tmp/aml-YYZZS1, Thu Sep 22 18:25:06 2022
>   *
>   * Original Table Header:
>   * Signature"SSDT"
> - * Length   0x02DE (734)
> + * Length   0x0717 (1815)
>   * Revision 0x01
> - * Checksum 0x56
> + * Checksum 0xBC
>   * OEM ID   "BOCHS "
>   * OEM Table ID "NVDIMM"
>   * OEM Revision 0x0001 (1)
>   * Compiler ID  "BXPC"
>   * Compiler Version 0x0001 (1)
>   */
>  DefinitionBlock ("", "SSDT", 1, "BOCHS ", "NVDIMM", 0x0001)
>  {
>  Scope (\_SB)
>  {
>  Device (NVDR)
>  {
>  Name (_HID, "ACPI0012" /* NVDIMM Root Device */)  //
> _HID: Hardware ID
>  Method (NCAL, 5, Serialized)
>  {
>  Local6 = MEMA /* \MEMA */
> @@ -49,52 +49,52 @@
>  ODAT,   32736
>  }
> 
>  If ((Arg4 == Zero))
>  {
>  Local0 = ToUUID ("2f10e7a4-9e91-11e4-89d3-
> 123b93f75cba")
>  }
>  ElseIf ((Arg4 == 0x0001))
>  {
>  Local0 = ToUUID ("648b9cf2-cda1-4312-8ad9-
> 49c4af32bd62")
>  }
>  Else
>  {
>  Local0 = ToUUID ("4309ac30-0d11-11e4-9191-
> 0800200c9a66")
>  }
> 
> -If (((Local6 == Zero) | (Arg0 != Local0)))
> +If (((Local6 == Zero) || (Arg0 != Local0)))
>  {
>  If ((Arg2 == Zero))
>  {
>  Return (Buffer (One)
>  {
>   0x00   
>   // .
>  })
>  }
> 
>  Return (Buffer (One)
>  {
>   0x01   
>   // .
>  })
>  }
> 
>  HDLE = Arg4
>  REVS = Arg1
>  FUNC = Arg2
> -If (((ObjectType (Arg3) == 0x04) & (SizeOf (Arg3) ==
> One)))
> +If (((ObjectType (Arg3) == 0x04) && (SizeOf (Arg3)
> == One)))
>  {
>  Local2 = Arg3 [Zero]
>  Local3 = DerefOf (Local2)
>  FARG = Local3
>  }
> 
>  NTFI = Local6
>  Local1 = (RLEN - 0x04)
>  If ((Local1 < 0x08))
>  {
>  Local2 = Zero
>  Name (TBUF, Buffer (One)
>  {
>   0x00   
>   // .
>  })
>  Local7 = Buffer (Zero){}
> @@ -161,45 +161,234 @@
>  Else
>  {
>  If ((Local1 == Zero))
>  {
>  Return (Local2)
>  }
> 
>  Local3 += Local1
>  Concatenate (Local2, Local0, Local2)
>  }
>  }
>  }
> 
>  Device (NV00)
>  {
>  Name (_ADR, One)  // _ADR: Address
> +Method (_LSI, 0, Serialized)  // _LSI: Label Storage
> Information
> +{
> +Local0 = NCAL (ToUUID ("4309ac30-0d11-11e4-9191-
> 0800200c9a66"), One, 0x04, Zero, One)
> +CreateDWordField (Local0, Zero, STTS)
> +CreateDWordField (Local0, 0x04, SLSA)
> +CreateDWordField (Local0, 0x08, MAXT)
> +Local1 = Package (0x03)
> +{
> +STTS,
> +SLSA,
> +MAXT
> +}
> +Return (Local1)
> +}
> +
> +Method (_LSR, 2, Serialized)  // _LSR: Label Storage
> Read
> +{
> +Name (INPT, Buffer (0x08)
> +{
> + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
> 0x00   // 
> +})
> +