mbox series

[v1,0/3] unit tests for change 'do not add hotplug related amls for cold plugged bridges'

Message ID 20200905103520.12626-1-ani@anisinha.ca
Headers show
Series unit tests for change 'do not add hotplug related amls for cold plugged bridges' | expand

Message

Ani Sinha Sept. 5, 2020, 10:35 a.m. UTC
The following patchset adds the unit test for the change:
f80ba9e599 ("tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag")

Please compare the diff of the DSDT table attached with the commit log with the following diff which
was generated before appplying the above change. The major difference between the diffs are the absence
of the following lines in the diff corresponding to this change:

+                Name (_SUN, 0x03)  // _SUN: Slot User Number
+                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                 {
+                    PCEJ (BSEL, _SUN)

+                If ((Arg0 & 0x08))
+                {
+                    Notify (S18, Arg1)
+                }
+

These are hotplug related amls which were present for slot 3 in the root pci bus before this change was applied.
With the change, these amls have been removed. Hence, slot 3 where the bridge is attached is no longer hotplug
capable.

--Ani

@@ -1,30 +1,30 @@
 /*
  * Intel ACPI Component Architecture
  * AML/ASL+ Disassembler version 20180105 (64-bit version)
  * Copyright (c) 2000 - 2018 Intel Corporation
  * 
  * Disassembling to symbolic ASL+ operators
  *
- * Disassembly of tests/data/acpi/pc/DSDT.bridge, Fri Sep  4 11:08:58 2020
+ * Disassembly of /tmp/aml-IEQEQ0, Fri Sep  4 11:08:58 2020
  *
  * Original Table Header:
  *     Signature        "DSDT"
- *     Length           0x00001A89 (6793)
+ *     Length           0x00001346 (4934)
  *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
- *     Checksum         0x08
+ *     Checksum         0xBF
  *     OEM ID           "BOCHS "
  *     OEM Table ID     "BXPCDSDT"
  *     OEM Revision     0x00000001 (1)
  *     Compiler ID      "BXPC"
  *     Compiler Version 0x00000001 (1)
  */
 DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPCDSDT", 0x00000001)
 {
     Scope (\)
     {
         OperationRegion (DBG, SystemIO, 0x0402, One)
         Field (DBG, ByteAcc, NoLock, Preserve)
         {
             DBGB,   8
         }
 
@@ -859,521 +859,36 @@
                 }
 
                 Method (_S2D, 0, NotSerialized)  // _S2D: S2 Device State
                 {
                     Return (Zero)
                 }
 
                 Method (_S3D, 0, NotSerialized)  // _S3D: S3 Device State
                 {
                     Return (Zero)
                 }
             }
 
             Device (S18)
             {
                 Name (_ADR, 0x00030000)  // _ADR: Address
-                Name (BSEL, One)
-                Device (S00)
-                {
-                    Name (_SUN, Zero)  // _SUN: Slot User Number
-                    Name (_ADR, Zero)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S08)
-                {
-                    Name (_SUN, One)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00010000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S10)
-                {
-                    Name (_SUN, 0x02)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00020000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S18)
-                {
-                    Name (_SUN, 0x03)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00030000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S20)
-                {
-                    Name (_SUN, 0x04)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00040000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S28)
-                {
-                    Name (_SUN, 0x05)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00050000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S30)
-                {
-                    Name (_SUN, 0x06)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00060000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S38)
-                {
-                    Name (_SUN, 0x07)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00070000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S40)
-                {
-                    Name (_SUN, 0x08)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00080000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S48)
-                {
-                    Name (_SUN, 0x09)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00090000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S50)
-                {
-                    Name (_SUN, 0x0A)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000A0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S58)
-                {
-                    Name (_SUN, 0x0B)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000B0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S60)
-                {
-                    Name (_SUN, 0x0C)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000C0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S68)
-                {
-                    Name (_SUN, 0x0D)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000D0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S70)
-                {
-                    Name (_SUN, 0x0E)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000E0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S78)
-                {
-                    Name (_SUN, 0x0F)  // _SUN: Slot User Number
-                    Name (_ADR, 0x000F0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S80)
-                {
-                    Name (_SUN, 0x10)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00100000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S88)
-                {
-                    Name (_SUN, 0x11)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00110000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S90)
-                {
-                    Name (_SUN, 0x12)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00120000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (S98)
-                {
-                    Name (_SUN, 0x13)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00130000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SA0)
-                {
-                    Name (_SUN, 0x14)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00140000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SA8)
-                {
-                    Name (_SUN, 0x15)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00150000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SB0)
-                {
-                    Name (_SUN, 0x16)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00160000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SB8)
-                {
-                    Name (_SUN, 0x17)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00170000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SC0)
-                {
-                    Name (_SUN, 0x18)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00180000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SC8)
-                {
-                    Name (_SUN, 0x19)  // _SUN: Slot User Number
-                    Name (_ADR, 0x00190000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SD0)
-                {
-                    Name (_SUN, 0x1A)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001A0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SD8)
-                {
-                    Name (_SUN, 0x1B)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001B0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SE0)
-                {
-                    Name (_SUN, 0x1C)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001C0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SE8)
-                {
-                    Name (_SUN, 0x1D)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001D0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SF0)
-                {
-                    Name (_SUN, 0x1E)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001E0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Device (SF8)
-                {
-                    Name (_SUN, 0x1F)  // _SUN: Slot User Number
-                    Name (_ADR, 0x001F0000)  // _ADR: Address
-                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
-                    {
-                        PCEJ (BSEL, _SUN)
-                    }
-                }
-
-                Method (DVNT, 2, NotSerialized)
-                {
-                    If ((Arg0 & One))
-                    {
-                        Notify (S00, Arg1)
-                    }
-
-                    If ((Arg0 & 0x02))
-                    {
-                        Notify (S08, Arg1)
-                    }
-
-                    If ((Arg0 & 0x04))
-                    {
-                        Notify (S10, Arg1)
-                    }
-
-                    If ((Arg0 & 0x08))
-                    {
-                        Notify (S18, Arg1)
-                    }
-
-                    If ((Arg0 & 0x10))
-                    {
-                        Notify (S20, Arg1)
-                    }
-
-                    If ((Arg0 & 0x20))
-                    {
-                        Notify (S28, Arg1)
-                    }
-
-                    If ((Arg0 & 0x40))
-                    {
-                        Notify (S30, Arg1)
-                    }
-
-                    If ((Arg0 & 0x80))
-                    {
-                        Notify (S38, Arg1)
-                    }
-
-                    If ((Arg0 & 0x0100))
-                    {
-                        Notify (S40, Arg1)
-                    }
-
-                    If ((Arg0 & 0x0200))
-                    {
-                        Notify (S48, Arg1)
-                    }
-
-                    If ((Arg0 & 0x0400))
-                    {
-                        Notify (S50, Arg1)
-                    }
-
-                    If ((Arg0 & 0x0800))
-                    {
-                        Notify (S58, Arg1)
-                    }
-
-                    If ((Arg0 & 0x1000))
-                    {
-                        Notify (S60, Arg1)
-                    }
-
-                    If ((Arg0 & 0x2000))
-                    {
-                        Notify (S68, Arg1)
-                    }
-
-                    If ((Arg0 & 0x4000))
-                    {
-                        Notify (S70, Arg1)
-                    }
-
-                    If ((Arg0 & 0x8000))
-                    {
-                        Notify (S78, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00010000))
-                    {
-                        Notify (S80, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00020000))
-                    {
-                        Notify (S88, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00040000))
-                    {
-                        Notify (S90, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00080000))
-                    {
-                        Notify (S98, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00100000))
-                    {
-                        Notify (SA0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00200000))
-                    {
-                        Notify (SA8, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00400000))
-                    {
-                        Notify (SB0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x00800000))
-                    {
-                        Notify (SB8, Arg1)
-                    }
-
-                    If ((Arg0 & 0x01000000))
-                    {
-                        Notify (SC0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x02000000))
-                    {
-                        Notify (SC8, Arg1)
-                    }
-
-                    If ((Arg0 & 0x04000000))
-                    {
-                        Notify (SD0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x08000000))
-                    {
-                        Notify (SD8, Arg1)
-                    }
-
-                    If ((Arg0 & 0x10000000))
-                    {
-                        Notify (SE0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x20000000))
-                    {
-                        Notify (SE8, Arg1)
-                    }
-
-                    If ((Arg0 & 0x40000000))
-                    {
-                        Notify (SF0, Arg1)
-                    }
-
-                    If ((Arg0 & 0x80000000))
-                    {
-                        Notify (SF8, Arg1)
-                    }
-                }
-
-                Method (PCNT, 0, NotSerialized)
+                Name (_SUN, 0x03)  // _SUN: Slot User Number
+                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                 {
-                    BNUM = One
-                    DVNT (PCIU, One)
-                    DVNT (PCID, 0x03)
+                    PCEJ (BSEL, _SUN)
                 }
             }
 
             Device (S20)
             {
                 Name (_SUN, 0x04)  // _SUN: Slot User Number
                 Name (_ADR, 0x00040000)  // _ADR: Address
                 Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                 {
                     PCEJ (BSEL, _SUN)
                 }
             }
 
             Device (S28)
             {
                 Name (_SUN, 0x05)  // _SUN: Slot User Number
@@ -1633,32 +1148,37 @@
                     PCEJ (BSEL, _SUN)
                 }
             }
 
             Device (SF8)
             {
                 Name (_SUN, 0x1F)  // _SUN: Slot User Number
                 Name (_ADR, 0x001F0000)  // _ADR: Address
                 Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
                 {
                     PCEJ (BSEL, _SUN)
                 }
             }
 
             Method (DVNT, 2, NotSerialized)
             {
+                If ((Arg0 & 0x08))
+                {
+                    Notify (S18, Arg1)
+                }
+
                 If ((Arg0 & 0x10))
                 {
                     Notify (S20, Arg1)
                 }
 
                 If ((Arg0 & 0x20))
                 {
                     Notify (S28, Arg1)
                 }
 
                 If ((Arg0 & 0x40))
                 {
                     Notify (S30, Arg1)
                 }
 
                 If ((Arg0 & 0x80))
@@ -1779,22 +1299,21 @@
                 If ((Arg0 & 0x40000000))
                 {
                     Notify (SF0, Arg1)
                 }
 
                 If ((Arg0 & 0x80000000))
                 {
                     Notify (SF8, Arg1)
                 }
             }
 
             Method (PCNT, 0, NotSerialized)
             {
                 BNUM = Zero
                 DVNT (PCIU, One)
                 DVNT (PCID, 0x03)
-                ^S18.PCNT ()
             }
         }
     }
 }
 

***

Ani Sinha (3):
  tests/acpi: list added acpi table binary file for pci bridge hotplug
    test
  tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support'
    bridge flag
  tests/acpi: add newly added acpi DSDT table blob for pci bridge
    hotplug flag

 tests/data/acpi/pc/DSDT.hpbridge | Bin 0 -> 4895 bytes
 tests/qtest/bios-tables-test.c   |  15 +++++++++++++++
 2 files changed, 15 insertions(+)
 create mode 100644 tests/data/acpi/pc/DSDT.hpbridge

Comments

Ani Sinha Sept. 5, 2020, 12:26 p.m. UTC | #1
On Sat, Sep 5, 2020 at 4:05 PM Ani Sinha <ani@anisinha.ca> wrote:
>
> The following patchset adds the unit test for the change:
> f80ba9e599 ("tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag")

Apologies. This change is incorrect. It should be :
e78c1c9a2e ("i440fx/acpi: do not add hotplug related amls for cold
plugged bridges")

>
> Please compare the diff of the DSDT table attached with the commit log with the following diff which
> was generated before appplying the above change. The major difference between the diffs are the absence
> of the following lines in the diff corresponding to this change:
>
> +                Name (_SUN, 0x03)  // _SUN: Slot User Number
> +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
>                  {
> +                    PCEJ (BSEL, _SUN)
>
> +                If ((Arg0 & 0x08))
> +                {
> +                    Notify (S18, Arg1)
> +                }
> +
>
> These are hotplug related amls which were present for slot 3 in the root pci bus before this change was applied.
> With the change, these amls have been removed. Hence, slot 3 where the bridge is attached is no longer hotplug
> capable.
>
> --Ani
>
> @@ -1,30 +1,30 @@
>  /*
>   * Intel ACPI Component Architecture
>   * AML/ASL+ Disassembler version 20180105 (64-bit version)
>   * Copyright (c) 2000 - 2018 Intel Corporation
>   *
>   * Disassembling to symbolic ASL+ operators
>   *
> - * Disassembly of tests/data/acpi/pc/DSDT.bridge, Fri Sep  4 11:08:58 2020
> + * Disassembly of /tmp/aml-IEQEQ0, Fri Sep  4 11:08:58 2020
>   *
>   * Original Table Header:
>   *     Signature        "DSDT"
> - *     Length           0x00001A89 (6793)
> + *     Length           0x00001346 (4934)
>   *     Revision         0x01 **** 32-bit table (V1), no 64-bit math support
> - *     Checksum         0x08
> + *     Checksum         0xBF
>   *     OEM ID           "BOCHS "
>   *     OEM Table ID     "BXPCDSDT"
>   *     OEM Revision     0x00000001 (1)
>   *     Compiler ID      "BXPC"
>   *     Compiler Version 0x00000001 (1)
>   */
>  DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPCDSDT", 0x00000001)
>  {
>      Scope (\)
>      {
>          OperationRegion (DBG, SystemIO, 0x0402, One)
>          Field (DBG, ByteAcc, NoLock, Preserve)
>          {
>              DBGB,   8
>          }
>
> @@ -859,521 +859,36 @@
>                  }
>
>                  Method (_S2D, 0, NotSerialized)  // _S2D: S2 Device State
>                  {
>                      Return (Zero)
>                  }
>
>                  Method (_S3D, 0, NotSerialized)  // _S3D: S3 Device State
>                  {
>                      Return (Zero)
>                  }
>              }
>
>              Device (S18)
>              {
>                  Name (_ADR, 0x00030000)  // _ADR: Address
> -                Name (BSEL, One)
> -                Device (S00)
> -                {
> -                    Name (_SUN, Zero)  // _SUN: Slot User Number
> -                    Name (_ADR, Zero)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S08)
> -                {
> -                    Name (_SUN, One)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00010000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S10)
> -                {
> -                    Name (_SUN, 0x02)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00020000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S18)
> -                {
> -                    Name (_SUN, 0x03)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00030000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S20)
> -                {
> -                    Name (_SUN, 0x04)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00040000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S28)
> -                {
> -                    Name (_SUN, 0x05)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00050000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S30)
> -                {
> -                    Name (_SUN, 0x06)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00060000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S38)
> -                {
> -                    Name (_SUN, 0x07)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00070000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S40)
> -                {
> -                    Name (_SUN, 0x08)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00080000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S48)
> -                {
> -                    Name (_SUN, 0x09)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00090000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S50)
> -                {
> -                    Name (_SUN, 0x0A)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000A0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S58)
> -                {
> -                    Name (_SUN, 0x0B)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000B0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S60)
> -                {
> -                    Name (_SUN, 0x0C)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000C0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S68)
> -                {
> -                    Name (_SUN, 0x0D)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000D0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S70)
> -                {
> -                    Name (_SUN, 0x0E)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000E0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S78)
> -                {
> -                    Name (_SUN, 0x0F)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x000F0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S80)
> -                {
> -                    Name (_SUN, 0x10)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00100000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S88)
> -                {
> -                    Name (_SUN, 0x11)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00110000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S90)
> -                {
> -                    Name (_SUN, 0x12)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00120000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (S98)
> -                {
> -                    Name (_SUN, 0x13)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00130000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SA0)
> -                {
> -                    Name (_SUN, 0x14)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00140000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SA8)
> -                {
> -                    Name (_SUN, 0x15)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00150000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SB0)
> -                {
> -                    Name (_SUN, 0x16)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00160000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SB8)
> -                {
> -                    Name (_SUN, 0x17)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00170000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SC0)
> -                {
> -                    Name (_SUN, 0x18)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00180000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SC8)
> -                {
> -                    Name (_SUN, 0x19)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x00190000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SD0)
> -                {
> -                    Name (_SUN, 0x1A)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001A0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SD8)
> -                {
> -                    Name (_SUN, 0x1B)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001B0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SE0)
> -                {
> -                    Name (_SUN, 0x1C)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001C0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SE8)
> -                {
> -                    Name (_SUN, 0x1D)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001D0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SF0)
> -                {
> -                    Name (_SUN, 0x1E)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001E0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Device (SF8)
> -                {
> -                    Name (_SUN, 0x1F)  // _SUN: Slot User Number
> -                    Name (_ADR, 0x001F0000)  // _ADR: Address
> -                    Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
> -                    {
> -                        PCEJ (BSEL, _SUN)
> -                    }
> -                }
> -
> -                Method (DVNT, 2, NotSerialized)
> -                {
> -                    If ((Arg0 & One))
> -                    {
> -                        Notify (S00, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x02))
> -                    {
> -                        Notify (S08, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x04))
> -                    {
> -                        Notify (S10, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x08))
> -                    {
> -                        Notify (S18, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x10))
> -                    {
> -                        Notify (S20, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x20))
> -                    {
> -                        Notify (S28, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x40))
> -                    {
> -                        Notify (S30, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x80))
> -                    {
> -                        Notify (S38, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x0100))
> -                    {
> -                        Notify (S40, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x0200))
> -                    {
> -                        Notify (S48, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x0400))
> -                    {
> -                        Notify (S50, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x0800))
> -                    {
> -                        Notify (S58, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x1000))
> -                    {
> -                        Notify (S60, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x2000))
> -                    {
> -                        Notify (S68, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x4000))
> -                    {
> -                        Notify (S70, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x8000))
> -                    {
> -                        Notify (S78, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00010000))
> -                    {
> -                        Notify (S80, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00020000))
> -                    {
> -                        Notify (S88, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00040000))
> -                    {
> -                        Notify (S90, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00080000))
> -                    {
> -                        Notify (S98, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00100000))
> -                    {
> -                        Notify (SA0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00200000))
> -                    {
> -                        Notify (SA8, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00400000))
> -                    {
> -                        Notify (SB0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x00800000))
> -                    {
> -                        Notify (SB8, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x01000000))
> -                    {
> -                        Notify (SC0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x02000000))
> -                    {
> -                        Notify (SC8, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x04000000))
> -                    {
> -                        Notify (SD0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x08000000))
> -                    {
> -                        Notify (SD8, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x10000000))
> -                    {
> -                        Notify (SE0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x20000000))
> -                    {
> -                        Notify (SE8, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x40000000))
> -                    {
> -                        Notify (SF0, Arg1)
> -                    }
> -
> -                    If ((Arg0 & 0x80000000))
> -                    {
> -                        Notify (SF8, Arg1)
> -                    }
> -                }
> -
> -                Method (PCNT, 0, NotSerialized)
> +                Name (_SUN, 0x03)  // _SUN: Slot User Number
> +                Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
>                  {
> -                    BNUM = One
> -                    DVNT (PCIU, One)
> -                    DVNT (PCID, 0x03)
> +                    PCEJ (BSEL, _SUN)
>                  }
>              }
>
>              Device (S20)
>              {
>                  Name (_SUN, 0x04)  // _SUN: Slot User Number
>                  Name (_ADR, 0x00040000)  // _ADR: Address
>                  Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
>                  {
>                      PCEJ (BSEL, _SUN)
>                  }
>              }
>
>              Device (S28)
>              {
>                  Name (_SUN, 0x05)  // _SUN: Slot User Number
> @@ -1633,32 +1148,37 @@
>                      PCEJ (BSEL, _SUN)
>                  }
>              }
>
>              Device (SF8)
>              {
>                  Name (_SUN, 0x1F)  // _SUN: Slot User Number
>                  Name (_ADR, 0x001F0000)  // _ADR: Address
>                  Method (_EJ0, 1, NotSerialized)  // _EJx: Eject Device
>                  {
>                      PCEJ (BSEL, _SUN)
>                  }
>              }
>
>              Method (DVNT, 2, NotSerialized)
>              {
> +                If ((Arg0 & 0x08))
> +                {
> +                    Notify (S18, Arg1)
> +                }
> +
>                  If ((Arg0 & 0x10))
>                  {
>                      Notify (S20, Arg1)
>                  }
>
>                  If ((Arg0 & 0x20))
>                  {
>                      Notify (S28, Arg1)
>                  }
>
>                  If ((Arg0 & 0x40))
>                  {
>                      Notify (S30, Arg1)
>                  }
>
>                  If ((Arg0 & 0x80))
> @@ -1779,22 +1299,21 @@
>                  If ((Arg0 & 0x40000000))
>                  {
>                      Notify (SF0, Arg1)
>                  }
>
>                  If ((Arg0 & 0x80000000))
>                  {
>                      Notify (SF8, Arg1)
>                  }
>              }
>
>              Method (PCNT, 0, NotSerialized)
>              {
>                  BNUM = Zero
>                  DVNT (PCIU, One)
>                  DVNT (PCID, 0x03)
> -                ^S18.PCNT ()
>              }
>          }
>      }
>  }
>
>
> ***
>
> Ani Sinha (3):
>   tests/acpi: list added acpi table binary file for pci bridge hotplug
>     test
>   tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support'
>     bridge flag
>   tests/acpi: add newly added acpi DSDT table blob for pci bridge
>     hotplug flag
>
>  tests/data/acpi/pc/DSDT.hpbridge | Bin 0 -> 4895 bytes
>  tests/qtest/bios-tables-test.c   |  15 +++++++++++++++
>  2 files changed, 15 insertions(+)
>  create mode 100644 tests/data/acpi/pc/DSDT.hpbridge
>
> --
> 2.17.1
>
Ani Sinha Sept. 10, 2020, 5:04 p.m. UTC | #2
On Sep 5, 2020, 16:05 +0530, Ani Sinha <ani@anisinha.ca>, wrote:
> This change adds a new unit test for the global flag
> 'acpi-pci-hotplug-with-bridge-support' which is available for cold plugged pci
> bridges in i440fx. The flag can be used to turn off acpi based hotplug support
> for all the slots of the pci bus.
>
> Tested on the upstream qemu master branch on top of tag v5.1.0

Can someone please review this?
>
> Signed-off-by: Ani Sinha <ani@anisinha.ca>
>
>
> ---
> tests/qtest/bios-tables-test.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> index a2c0070306..e52a36e775 100644
> --- a/tests/qtest/bios-tables-test.c
> +++ b/tests/qtest/bios-tables-test.c
> @@ -723,6 +723,20 @@ static void test_acpi_piix4_root_hotplug(void)
> free_test_data(&data);
> }
>
> +static void test_acpi_piix4_bridge_hotplug(void)
> +{
> + test_data data;
> +
> + memset(&data, 0, sizeof(data));
> + data.machine = MACHINE_PC;
> + data.variant = ".hpbridge";
> + data.required_struct_types = base_required_struct_types;
> + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
> + test_acpi_one("-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off "
> + "-device pci-bridge,chassis_nr=1", &data);
> + free_test_data(&data);
> +}
> +
> static void test_acpi_q35_tcg(void)
> {
> test_data data;
> @@ -1117,6 +1131,7 @@ int main(int argc, char *argv[])
> qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
> qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
> qtest_add_func("acpi/piix4/hotplug", test_acpi_piix4_root_hotplug);
> + qtest_add_func("acpi/piix4/brhotplug", test_acpi_piix4_bridge_hotplug);
> qtest_add_func("acpi/q35", test_acpi_q35_tcg);
> qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
> qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);
> --
> 2.17.1
>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div name="messageReplySection">
<div dir="auto">On Sep 5, 2020, 16:05 +0530, Ani Sinha &lt;ani@anisinha.ca&gt;, wrote:</div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">This change adds a new unit test for the global flag</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">'acpi-pci-hotplug-with-bridge-support' which is available for cold plugged pci</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">bridges in i440fx. The flag can be used to turn off acpi based hotplug support</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">for all the slots of the pci bus.</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">Tested on the upstream qemu master branch on top of tag v5.1.0</blockquote>
<div dir="auto"><br />
Can someone please review this?&#160;<br /></div>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">Signed-off-by: Ani Sinha &lt;ani@anisinha.ca&gt;</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">---</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">tests/qtest/bios-tables-test.c | 15 +++++++++++++++</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">1 file changed, 15 insertions(+)</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">index a2c0070306..e52a36e775 100644</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">--- a/tests/qtest/bios-tables-test.c</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+++ b/tests/qtest/bios-tables-test.c</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">@@ -723,6 +723,20 @@ static void test_acpi_piix4_root_hotplug(void)</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">free_test_data(&amp;data);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">}</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+static void test_acpi_piix4_bridge_hotplug(void)</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+{</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ test_data data;</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ memset(&amp;data, 0, sizeof(data));</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ data.machine = MACHINE_PC;</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ data.variant = ".hpbridge";</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ data.required_struct_types = base_required_struct_types;</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ test_acpi_one("-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off "</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ "-device pci-bridge,chassis_nr=1", &amp;data);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ free_test_data(&amp;data);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+}</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">static void test_acpi_q35_tcg(void)</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">{</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">test_data data;</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">@@ -1117,6 +1131,7 @@ int main(int argc, char *argv[])</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/piix4/hotplug", test_acpi_piix4_root_hotplug);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">+ qtest_add_func("acpi/piix4/brhotplug", test_acpi_piix4_bridge_hotplug);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/q35", test_acpi_q35_tcg);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">--</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;">2.17.1</blockquote>
<blockquote style="border-left-color: rgb(26, 188, 156); margin: 0px; padding-left: 10px; border-left-width: thin; border-left-style: solid; padding-bottom: 5px; padding-top: 5px;"><br /></blockquote>
</div>
</body>
</html>
Igor Mammedov Sept. 11, 2020, 12:45 p.m. UTC | #3
On Thu, 10 Sep 2020 22:34:20 +0530
Ani Sinha <ani@anisinha.ca> wrote:

> On Sep 5, 2020, 16:05 +0530, Ani Sinha <ani@anisinha.ca>, wrote:
> > This change adds a new unit test for the global flag
> > 'acpi-pci-hotplug-with-bridge-support' which is available for cold plugged pci
> > bridges in i440fx. The flag can be used to turn off acpi based hotplug support
> > for all the slots of the pci bus.
> >
> > Tested on the upstream qemu master branch on top of tag v5.1.0  
> 
> Can someone please review this?
Hi,
Are there other patches of yours,
that should be applied/reviewed before this one?

> >
> > Signed-off-by: Ani Sinha <ani@anisinha.ca>
> >
> >
> > ---
> > tests/qtest/bios-tables-test.c | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c
> > index a2c0070306..e52a36e775 100644
> > --- a/tests/qtest/bios-tables-test.c
> > +++ b/tests/qtest/bios-tables-test.c
> > @@ -723,6 +723,20 @@ static void test_acpi_piix4_root_hotplug(void)
> > free_test_data(&data);
> > }
> >
> > +static void test_acpi_piix4_bridge_hotplug(void)
> > +{
> > + test_data data;
> > +
> > + memset(&data, 0, sizeof(data));
> > + data.machine = MACHINE_PC;
> > + data.variant = ".hpbridge";
> > + data.required_struct_types = base_required_struct_types;
> > + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
> > + test_acpi_one("-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off "
> > + "-device pci-bridge,chassis_nr=1", &data);
> > + free_test_data(&data);
> > +}
> > +
> > static void test_acpi_q35_tcg(void)
> > {
> > test_data data;
> > @@ -1117,6 +1131,7 @@ int main(int argc, char *argv[])
> > qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
> > qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
> > qtest_add_func("acpi/piix4/hotplug", test_acpi_piix4_root_hotplug);
> > + qtest_add_func("acpi/piix4/brhotplug", test_acpi_piix4_bridge_hotplug);
> > qtest_add_func("acpi/q35", test_acpi_q35_tcg);
> > qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
> > qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);
> > --
> > 2.17.1
> >
Michael S. Tsirkin Sept. 11, 2020, 2:59 p.m. UTC | #4
On Thu, Sep 10, 2020 at 10:34:20PM +0530, Ani Sinha wrote:
> On Sep 5, 2020, 16:05 +0530, Ani Sinha <ani@anisinha.ca>, wrote:
> 
>     This change adds a new unit test for the global flag
> 
>     'acpi-pci-hotplug-with-bridge-support' which is available for cold plugged
>     pci
> 
>     bridges in i440fx. The flag can be used to turn off acpi based hotplug
>     support
> 
>     for all the slots of the pci bus.
> 
> 
> 
>     Tested on the upstream qemu master branch on top of tag v5.1.0
> 
> 
> Can someone please review this? 
> 
> 
> 
>     Signed-off-by: Ani Sinha <ani@anisinha.ca>
> 
> 
> 
> 
I queues this.

>     ---
> 
>     tests/qtest/bios-tables-test.c | 15 +++++++++++++++
> 
>     1 file changed, 15 insertions(+)
> 
> 
> 
>     diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/
>     bios-tables-test.c
> 
>     index a2c0070306..e52a36e775 100644
> 
>     --- a/tests/qtest/bios-tables-test.c
> 
>     +++ b/tests/qtest/bios-tables-test.c
> 
>     @@ -723,6 +723,20 @@ static void test_acpi_piix4_root_hotplug(void)
> 
>     free_test_data(&data);
> 
>     }
> 
> 
> 
>     +static void test_acpi_piix4_bridge_hotplug(void)
> 
>     +{
> 
>     + test_data data;
> 
>     +
> 
>     + memset(&data, 0, sizeof(data));
> 
>     + data.machine = MACHINE_PC;
> 
>     + data.variant = ".hpbridge";
> 
>     + data.required_struct_types = base_required_struct_types;
> 
>     + data.required_struct_types_len = ARRAY_SIZE(base_required_struct_types);
> 
>     + test_acpi_one("-global PIIX4_PM.acpi-pci-hotplug-with-bridge-support=off
>     "
> 
>     + "-device pci-bridge,chassis_nr=1", &data);
> 
>     + free_test_data(&data);
> 
>     +}
> 
>     +
> 
>     static void test_acpi_q35_tcg(void)
> 
>     {
> 
>     test_data data;
> 
>     @@ -1117,6 +1131,7 @@ int main(int argc, char *argv[])
> 
>     qtest_add_func("acpi/piix4", test_acpi_piix4_tcg);
> 
>     qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge);
> 
>     qtest_add_func("acpi/piix4/hotplug", test_acpi_piix4_root_hotplug);
> 
>     + qtest_add_func("acpi/piix4/brhotplug", test_acpi_piix4_bridge_hotplug);
> 
>     qtest_add_func("acpi/q35", test_acpi_q35_tcg);
> 
>     qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge);
> 
>     qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64);
> 
>     --
> 
>     2.17.1
> 
> 
>
Michael S. Tsirkin Sept. 11, 2020, 4:08 p.m. UTC | #5
I am not sure why, but the expected files did not match for me.

I dropped these for now:

tests/acpi: add a new ACPI table in order to test root pci hotplug on/off
tests/acpi: add a new unit test to test hotplug off/on feature on the root pci bus
tests/acpi: document addition of table DSDT.roothp for unit testing root pci hotplug on/off
tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag
tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag
tests/acpi: list added acpi table binary file for pci bridge hotplug test

I suspect you have another change in there.

Pls check and post a single series with all these tests.
Ani Sinha Sept. 11, 2020, 4:11 p.m. UTC | #6
On Fri, Sep 11, 2020 at 9:38 PM Michael S. Tsirkin <mst@redhat.com> wrote:
>
>
> I am not sure why, but the expected files did not match for me.
>
> I dropped these for now:
>
> tests/acpi: add a new ACPI table in order to test root pci hotplug on/off
> tests/acpi: add a new unit test to test hotplug off/on feature on the root pci bus
> tests/acpi: document addition of table DSDT.roothp for unit testing root pci hotplug on/off

This was already reviewed by Igor.

> tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag
> tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag
> tests/acpi: list added acpi table binary file for pci bridge hotplug test
>

I will double check this one.

> I suspect you have another change in there.
>
> Pls check and post a single series with all these tests.
>
> --
> MST
>
Ani Sinha Sept. 11, 2020, 4:21 p.m. UTC | #7
I can't repro the breakage. What test command line are you running
with? I am using " make check-qtest-x86_64 V=1"

On Fri, Sep 11, 2020 at 9:41 PM Ani Sinha <ani@anisinha.ca> wrote:
>
> On Fri, Sep 11, 2020 at 9:38 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> >
> >
> > I am not sure why, but the expected files did not match for me.
> >
> > I dropped these for now:
> >
> > tests/acpi: add a new ACPI table in order to test root pci hotplug on/off
> > tests/acpi: add a new unit test to test hotplug off/on feature on the root pci bus
> > tests/acpi: document addition of table DSDT.roothp for unit testing root pci hotplug on/off
>
> This was already reviewed by Igor.
>
> > tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag
> > tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag
> > tests/acpi: list added acpi table binary file for pci bridge hotplug test
> >
>
> I will double check this one.
>
> > I suspect you have another change in there.
> >
> > Pls check and post a single series with all these tests.
> >
> > --
> > MST
> >
Ani Sinha Sept. 11, 2020, 6:10 p.m. UTC | #8
On Fri, Sep 11, 2020 at 9:51 PM Ani Sinha <ani@anisinha.ca> wrote:
>
> I can't repro the breakage. What test command line are you running
> with? I am using " make check-qtest-x86_64 V=1"

Ok I was working off v5.1.0 tag. Did not realize. I rebased all my
patches to the latest master and reworked the unit tests.
I have sent you the entire patch set as exists in my workspace. It
passes unit tests.

>
> On Fri, Sep 11, 2020 at 9:41 PM Ani Sinha <ani@anisinha.ca> wrote:
> >
> > On Fri, Sep 11, 2020 at 9:38 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> > >
> > >
> > > I am not sure why, but the expected files did not match for me.
> > >
> > > I dropped these for now:
> > >
> > > tests/acpi: add a new ACPI table in order to test root pci hotplug on/off
> > > tests/acpi: add a new unit test to test hotplug off/on feature on the root pci bus
> > > tests/acpi: document addition of table DSDT.roothp for unit testing root pci hotplug on/off
> >
> > This was already reviewed by Igor.
> >
> > > tests/acpi: add newly added acpi DSDT table blob for pci bridge hotplug flag
> > > tests/acpi: unit test for 'acpi-pci-hotplug-with-bridge-support' bridge flag
> > > tests/acpi: list added acpi table binary file for pci bridge hotplug test
> > >
> >
> > I will double check this one.
> >
> > > I suspect you have another change in there.
> > >
> > > Pls check and post a single series with all these tests.
> > >
> > > --
> > > MST
> > >