Re: [PATCH v9 10/10] ACPI ERST: step 6 of bios-tables-test.c

2021-12-09 Thread Eric DeVolder

Ani, thanks!
eric

On 12/9/21 03:29, Ani Sinha wrote:

On Fri, Dec 3, 2021 at 12:39 AM Eric DeVolder  wrote:


Following the guidelines in tests/qtest/bios-tables-test.c, this
is step 6.

Below is the disassembly of tests/data/acpi/pc/ERST.acpierst.

[...]


Note that the contents of tests/data/q35/ERST.acpierst and
tests/data/microvm/ERST.pcie are the same except for differences
due to assigned base address.

Files tests/data/pc/DSDT.acpierst and tests/data/acpi/q35/DSDT.acpierst
are new files (and are included as a result of 'make check' process).
Rather than provide the entire content, I am providing the differences
between pc/DSDT and pc/DSDT.acpierst, and the difference between
q35/DSDT and q35/DSDT.acpierst, with an explanation to follow.

diff pc/DSDT pc/DSDT.acpierst:
  @@ -5,13 +5,13 @@
*
* Disassembling to symbolic ASL+ operators
*
  - * Disassembly of tests/data/acpi/pc/DSDT, Thu Dec  2 10:10:13 2021
  + * Disassembly of tests/data/acpi/pc/DSDT.acpierst, Thu Dec  2 12:59:36 2021
*
* Original Table Header:
* Signature"DSDT"
  - * Length   0x1772 (6002)
  + * Length   0x1751 (5969)
* Revision 0x01  32-bit table (V1), no 64-bit math support
  - * Checksum 0x9E
  + * Checksum 0x95
* OEM ID   "BOCHS "
* OEM Table ID "BXPC"
* OEM Revision 0x0001 (1)
  @@ -964,16 +964,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "

   Device (S18)
   {
  -Name (_SUN, 0x03)  // _SUN: Slot User Number
   Name (_ADR, 0x0003)  // _ADR: Address
  -Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
  -{
  -PCEJ (BSEL, _SUN)
  -}
  -
  +Name (ASUN, 0x03)
   Method (_DSM, 4, Serialized)  // _DSM: Device-Specific Method
   {
  -Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, _SUN))
  +Return (PDSM (Arg0, Arg1, Arg2, Arg3, BSEL, ASUN))
   }
   }

  @@ -1399,11 +1394,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "

   Method (DVNT, 2, NotSerialized)
   {
  -If ((Arg0 & 0x08))
  -{
  -Notify (S18, Arg1)
  -}
  -
   If ((Arg0 & 0x10))
   {
   Notify (S20, Arg1)

diff q35/DSDT and q35/DSDT.acpierst:
  @@ -5,13 +5,13 @@
*
* Disassembling to symbolic ASL+ operators
*
  - * Disassembly of tests/data/acpi/q35/DSDT, Thu Dec  2 10:10:13 2021
  + * Disassembly of tests/data/acpi/q35/DSDT.acpierst, Thu Dec  2 12:59:36 2021
*
* Original Table Header:
* Signature"DSDT"
  - * Length   0x2061 (8289)
  + * Length   0x2072 (8306)
* Revision 0x01  32-bit table (V1), no 64-bit math support
  - * Checksum 0xFA
  + * Checksum 0x9A
* OEM ID   "BOCHS "
* OEM Table ID "BXPC"
* OEM Revision 0x0001 (1)
  @@ -3278,6 +3278,11 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS "
   }
   }

  +Device (S10)
  +{
  +Name (_ADR, 0x0002)  // _ADR: Address
  +}
  +
   Method (PCNT, 0, NotSerialized)
   {
   }

For both pc and q35, there is but a small difference between this
DSDT.acpierst and the corresponding DSDT. In both cases, the changes
occur under the hiearchy:

 Scope (\_SB)
 {
 Scope (PCI0)
 {

which leads me to believe that the change to the DSDT was needed
due to the introduction of the ERST PCI device.


I have convinced myself of the changes we see in the DSDT tables.
On i440fx side, we are adding a non-hotpluggable pci device on slot 3.
So the changes we see are basically replacing an empty hotpluggable
slot on the pci root port with a non-hotplugggable device.
On q35, bsel on pcie root bus is not set (its not hotpluggable bus),
so the change basically adds the address enumeration for the device.


Excellent! I've included the insight into commit message.



Signed-off-by: Eric DeVolder 


Acked-by: Ani Sinha 


---
  tests/data/acpi/microvm/ERST.pcie   | Bin 0 -> 912 bytes
  tests/data/acpi/pc/DSDT.acpierst| Bin 0 -> 5969 bytes
  tests/data/acpi/pc/ERST.acpierst| Bin 0 -> 912 bytes
  tests/data/acpi/q35/DSDT.acpierst   | Bin 0 -> 8306 bytes
  tests/data/acpi/q35/ERST.acpierst   | Bin 0 -> 912 bytes
  tests/qtest/bios-tables-test-allowed-diff.h |   5 -
  6 files changed, 5 deletions(-)

diff --git a/tests/data/acpi/microvm/ERST.pcie 
b/tests/data/acpi/microvm/ERST.pcie
index 
e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d9a2b3211ab5893a50751ad52be3782579e367f2
 100644
GIT 

Re: [PATCH v9 10/10] ACPI ERST: step 6 of bios-tables-test.c

2021-12-09 Thread Ani Sinha
On Fri, Dec 3, 2021 at 12:39 AM Eric DeVolder  wrote:
>
> Following the guidelines in tests/qtest/bios-tables-test.c, this
> is step 6.
>
> Below is the disassembly of tests/data/acpi/pc/ERST.acpierst.
>
>  /*
>   * Intel ACPI Component Architecture
>   * AML/ASL+ Disassembler version 20180508 (64-bit version)
>   * Copyright (c) 2000 - 2018 Intel Corporation
>   *
>   * Disassembly of tests/data/acpi/pc/ERST.acpierst, Thu Dec  2 13:32:07 2021
>   *
>   * ACPI Data Table [ERST]
>   *
>   * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
>   */
>
>  [000h    4]Signature : "ERST"[Error Record 
> Serialization Table]
>  [004h 0004   4] Table Length : 0390
>  [008h 0008   1] Revision : 01
>  [009h 0009   1] Checksum : D6
>  [00Ah 0010   6]   Oem ID : "BOCHS "
>  [010h 0016   8] Oem Table ID : "BXPC"
>  [018h 0024   4] Oem Revision : 0001
>  [01Ch 0028   4]  Asl Compiler ID : "BXPC"
>  [020h 0032   4]Asl Compiler Revision : 0001
>
>  [024h 0036   4]  Serialization Header Length : 0030
>  [028h 0040   4] Reserved : 
>  [02Ch 0044   4]  Instruction Entry Count : 001B
>
>  [030h 0048   1]   Action : 00 [Begin Write Operation]
>  [031h 0049   1]  Instruction : 03 [Write Register Value]
>  [032h 0050   1]Flags (decoded below) : 00
>Preserve Register Bits : 0
>  [033h 0051   1] Reserved : 00
>
>  [034h 0052  12]  Register Region : [Generic Address Structure]
>  [034h 0052   1] Space ID : 00 [SystemMemory]
>  [035h 0053   1]Bit Width : 20
>  [036h 0054   1]   Bit Offset : 00
>  [037h 0055   1] Encoded Access Width : 03 [DWord Access:32]
>  [038h 0056   8]  Address : FEBF3000
>
>  [040h 0064   8]Value : 
>  [048h 0072   8] Mask : 00FF
>
>  [050h 0080   1]   Action : 01 [Begin Read Operation]
>  [051h 0081   1]  Instruction : 03 [Write Register Value]
>  [052h 0082   1]Flags (decoded below) : 00
>Preserve Register Bits : 0
>  [053h 0083   1] Reserved : 00
>
>  [054h 0084  12]  Register Region : [Generic Address Structure]
>  [054h 0084   1] Space ID : 00 [SystemMemory]
>  [055h 0085   1]Bit Width : 20
>  [056h 0086   1]   Bit Offset : 00
>  [057h 0087   1] Encoded Access Width : 03 [DWord Access:32]
>  [058h 0088   8]  Address : FEBF3000
>
>  [060h 0096   8]Value : 0001
>  [068h 0104   8] Mask : 00FF
>
>  [070h 0112   1]   Action : 02 [Begin Clear Operation]
>  [071h 0113   1]  Instruction : 03 [Write Register Value]
>  [072h 0114   1]Flags (decoded below) : 00
>Preserve Register Bits : 0
>  [073h 0115   1] Reserved : 00
>
>  [074h 0116  12]  Register Region : [Generic Address Structure]
>  [074h 0116   1] Space ID : 00 [SystemMemory]
>  [075h 0117   1]Bit Width : 20
>  [076h 0118   1]   Bit Offset : 00
>  [077h 0119   1] Encoded Access Width : 03 [DWord Access:32]
>  [078h 0120   8]  Address : FEBF3000
>
>  [080h 0128   8]Value : 0002
>  [088h 0136   8] Mask : 00FF
>
>  [090h 0144   1]   Action : 03 [End Operation]
>  [091h 0145   1]  Instruction : 03 [Write Register Value]
>  [092h 0146   1]Flags (decoded below) : 00
>Preserve Register Bits : 0
>  [093h 0147   1] Reserved : 00
>
>  [094h 0148  12]  Register Region : [Generic Address Structure]
>  [094h 0148   1] Space ID : 00 [SystemMemory]
>  [095h 0149   1]Bit Width : 20
>  [096h 0150   1]   Bit Offset : 00
>  [097h 0151   1] Encoded Access Width : 03 [DWord Access:32]
>  [098h 0152   8]  Address : FEBF3000
>
>  [0A0h 0160   8]Value : 0003
>  [0A8h 0168   8] Mask : 00FF
>
>  [0B0h 0176   1]   Action : 04 [Set Record Offset]
>  [0B1h 0177   1]  Instruction : 02 [Write Register]
>  [0B2h 0178   1]Flags (decoded below) : 00
>Preserve Register Bits : 0
>  [0B3h 0179   1] Reserved : 00
>
>  [0B4h 0180  12]   

[PATCH v9 10/10] ACPI ERST: step 6 of bios-tables-test.c

2021-12-02 Thread Eric DeVolder
Following the guidelines in tests/qtest/bios-tables-test.c, this
is step 6.

Below is the disassembly of tests/data/acpi/pc/ERST.acpierst.

 /*
  * Intel ACPI Component Architecture
  * AML/ASL+ Disassembler version 20180508 (64-bit version)
  * Copyright (c) 2000 - 2018 Intel Corporation
  *
  * Disassembly of tests/data/acpi/pc/ERST.acpierst, Thu Dec  2 13:32:07 2021
  *
  * ACPI Data Table [ERST]
  *
  * Format: [HexOffset DecimalOffset ByteLength]  FieldName : FieldValue
  */

 [000h    4]Signature : "ERST"[Error Record 
Serialization Table]
 [004h 0004   4] Table Length : 0390
 [008h 0008   1] Revision : 01
 [009h 0009   1] Checksum : D6
 [00Ah 0010   6]   Oem ID : "BOCHS "
 [010h 0016   8] Oem Table ID : "BXPC"
 [018h 0024   4] Oem Revision : 0001
 [01Ch 0028   4]  Asl Compiler ID : "BXPC"
 [020h 0032   4]Asl Compiler Revision : 0001

 [024h 0036   4]  Serialization Header Length : 0030
 [028h 0040   4] Reserved : 
 [02Ch 0044   4]  Instruction Entry Count : 001B

 [030h 0048   1]   Action : 00 [Begin Write Operation]
 [031h 0049   1]  Instruction : 03 [Write Register Value]
 [032h 0050   1]Flags (decoded below) : 00
   Preserve Register Bits : 0
 [033h 0051   1] Reserved : 00

 [034h 0052  12]  Register Region : [Generic Address Structure]
 [034h 0052   1] Space ID : 00 [SystemMemory]
 [035h 0053   1]Bit Width : 20
 [036h 0054   1]   Bit Offset : 00
 [037h 0055   1] Encoded Access Width : 03 [DWord Access:32]
 [038h 0056   8]  Address : FEBF3000

 [040h 0064   8]Value : 
 [048h 0072   8] Mask : 00FF

 [050h 0080   1]   Action : 01 [Begin Read Operation]
 [051h 0081   1]  Instruction : 03 [Write Register Value]
 [052h 0082   1]Flags (decoded below) : 00
   Preserve Register Bits : 0
 [053h 0083   1] Reserved : 00

 [054h 0084  12]  Register Region : [Generic Address Structure]
 [054h 0084   1] Space ID : 00 [SystemMemory]
 [055h 0085   1]Bit Width : 20
 [056h 0086   1]   Bit Offset : 00
 [057h 0087   1] Encoded Access Width : 03 [DWord Access:32]
 [058h 0088   8]  Address : FEBF3000

 [060h 0096   8]Value : 0001
 [068h 0104   8] Mask : 00FF

 [070h 0112   1]   Action : 02 [Begin Clear Operation]
 [071h 0113   1]  Instruction : 03 [Write Register Value]
 [072h 0114   1]Flags (decoded below) : 00
   Preserve Register Bits : 0
 [073h 0115   1] Reserved : 00

 [074h 0116  12]  Register Region : [Generic Address Structure]
 [074h 0116   1] Space ID : 00 [SystemMemory]
 [075h 0117   1]Bit Width : 20
 [076h 0118   1]   Bit Offset : 00
 [077h 0119   1] Encoded Access Width : 03 [DWord Access:32]
 [078h 0120   8]  Address : FEBF3000

 [080h 0128   8]Value : 0002
 [088h 0136   8] Mask : 00FF

 [090h 0144   1]   Action : 03 [End Operation]
 [091h 0145   1]  Instruction : 03 [Write Register Value]
 [092h 0146   1]Flags (decoded below) : 00
   Preserve Register Bits : 0
 [093h 0147   1] Reserved : 00

 [094h 0148  12]  Register Region : [Generic Address Structure]
 [094h 0148   1] Space ID : 00 [SystemMemory]
 [095h 0149   1]Bit Width : 20
 [096h 0150   1]   Bit Offset : 00
 [097h 0151   1] Encoded Access Width : 03 [DWord Access:32]
 [098h 0152   8]  Address : FEBF3000

 [0A0h 0160   8]Value : 0003
 [0A8h 0168   8] Mask : 00FF

 [0B0h 0176   1]   Action : 04 [Set Record Offset]
 [0B1h 0177   1]  Instruction : 02 [Write Register]
 [0B2h 0178   1]Flags (decoded below) : 00
   Preserve Register Bits : 0
 [0B3h 0179   1] Reserved : 00

 [0B4h 0180  12]  Register Region : [Generic Address Structure]
 [0B4h 0180   1] Space ID : 00 [SystemMemory]
 [0B5h 0181   1]Bit Width : 20
 [0B6h 0182   1]   Bit Offset : 00
 [0B7h 0183   1]