Skip to contentSkip to conversation

hw/arm/acpi: enable SHPC native hot plug

PATCH Superseded Heyi Guo 3 participants 11 messages Mar 1, 2019 – Mar 4, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Heyi Guo

author
#0 lore raw

PATCH 1/1 hw/arm/acpi: enable SHPC native hot plug

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
---
 hw/arm/virt-acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
         aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
     aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
     aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                 aml_name("CTRL")));
 
     ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 3 lines · On Fri, 1 Mar 2019 10:28:30 +0800 Heyi Guo <[email protected]> wrote:

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Just out of curiosity,
An understand the need for SHPC on plain PCI but in case of PCIe why native PCIe hotplug isn't sufficient?

Quoted 28 lines
Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
---
 hw/arm/virt-acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
         aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
     aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
     aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                 aml_name("CTRL")));
 
     ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
author
#2 lore raw
Quoted 9 lines · Igor Mammedov
Quoted 3 lines · On Fri, 1 Mar 2019 10:28:30 +0800 Heyi Guo <[email protected]> wrote:

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Just out of curiosity,
An understand the need for SHPC on plain PCI but in case of PCIe why native PCIe hotplug isn't sufficient?

For future extension and completeness:
1. PCI is sometimes more flexible than PCIe, for it can have up to 32 devices in virtual world. The shortage for PCIe hot plug is that the number of PCIe root ports is fixed.
2. We have SHPC when booting through device tree mode, but don't have it through ACPI mode.

If I missed something, please let me know.

Thanks,
Heyi

Quoted 32 lines
Quoted 19 lines
Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +0 -0
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));

hw/arm/virt-acpi-build.c static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap, · line 276

Quoted 10 lines
hw/arm/virt-acpi-build.c +6 -1
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
 
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));

.

#3 lore raw
In reply to Heyi Guo
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>

So when OS enables SHPC, should we block ACPI hotplug events?

Quoted 24 lines
---
 hw/arm/virt-acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
         aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
     aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
     aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                 aml_name("CTRL")));
 
     ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1
author
#4 lore raw
Quoted 5 lines · Michael S. Tsirkin
Quoted 4 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Quoted 8 lines
Quoted 6 lines
Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>

So when OS enables SHPC, should we block ACPI hotplug events?

I supposed we don't support ACPI hotplug events on ARM virt; do we have any currently?

Thanks,
Heyi

Quoted 27 lines
Quoted 25 lines
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
 
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1

.

#5 lore raw
Quoted 15 lines · Heyi Guo
Quoted 12 lines · Michael S. Tsirkin
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
Quoted 5 lines
Quoted 1 line

So when OS enables SHPC, should we block ACPI hotplug events?

I supposed we don't support ACPI hotplug events on ARM virt; do we have any currently?

Thanks,
Heyi

Oh I didn't realise. That explains it sorry about the noise.

Quoted 27 lines
Quoted 26 lines
Quoted 24 lines
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1

.

#6 lore raw
Quoted 16 lines · On Fri, 1 Mar 2019 09:12:33 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 15 lines · Heyi Guo
Quoted 12 lines · Michael S. Tsirkin
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 1 line

So when OS enables SHPC, should we block ACPI hotplug events?

I supposed we don't support ACPI hotplug events on ARM virt; do we have any currently?

Thanks,
Heyi

Oh I didn't realise. That explains it sorry about the noise.

And I thought we did not support them on PCIe completely (I mean q35/ich9). (Or did I miss something)?

Quoted 28 lines
Quoted 28 lines
Quoted 27 lines
Quoted 24 lines
  
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -2
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
-- 
Quoted 1 line

1.8.3.1

.

#7 lore raw
Quoted 20 lines · Igor Mammedov
Quoted 17 lines · On Fri, 1 Mar 2019 09:12:33 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 16 lines · Heyi Guo
Quoted 13 lines · Michael S. Tsirkin
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>

So when OS enables SHPC, should we block ACPI hotplug events?

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I supposed we don't support ACPI hotplug events on ARM virt; do we have any currently?

Thanks,
Heyi

Oh I didn't realise. That explains it sorry about the noise.

And I thought we did not support them on PCIe completely (I mean q35/ich9). (Or did I miss something)?

True for PCIe.

Quoted 28 lines
Quoted 28 lines
Quoted 28 lines
Quoted 27 lines
Quoted 24 lines
  
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -2
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
-- 
Quoted 1 line

1.8.3.1

.

author
#8 lore raw
Quoted 19 lines · Michael S. Tsirkin
Quoted 18 lines · Igor Mammedov
Quoted 15 lines · On Fri, 1 Mar 2019 09:12:33 -0500 "Michael S. Tsirkin" <[email protected]> wrote:
Quoted 14 lines · Heyi Guo
Quoted 12 lines · Michael S. Tsirkin
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>

So when OS enables SHPC, should we block ACPI hotplug events?

Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
Quoted 4 lines

I supposed we don't support ACPI hotplug events on ARM virt; do we have any currently?

Thanks,
Heyi

Oh I didn't realise. That explains it sorry about the noise.

And I thought we did not support them on PCIe completely (I mean q35/ich9). (Or did I miss something)?

True for PCIe.

So may I consider your comments as ACK for this patch :)

Thanks,
Heyi

Quoted 29 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
Quoted 19 lines
   
---
   hw/arm/virt-acpi-build.c | 7 ++++++-
   1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +5 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
           aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
       aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
       aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 5 lines
hw/arm/virt-acpi-build.c +1 -0
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                   aml_name("CTRL")));
       ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1

.

.

Reviewed-by on v1 1/1
#9 lore raw
In reply to Heyi Guo
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>

I don't think you need two Signed-off-by lines.
Besides that:

Pls feel free to merge through the ARM tree.

Quoted 24 lines
---
 hw/arm/virt-acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
         aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
     aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
     aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                 aml_name("CTRL")));
 
     ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1
author
#10 lore raw
Quoted 11 lines · Michael S. Tsirkin
Quoted 10 lines · Heyi Guo

After the introduction of generic PCIe root port and PCIe-PCI bridge, we will also have SHPC controller on ARM, so just enalbe SHPC native hot plug.

Cc Shannon Zhao <[email protected]>
Cc Peter Maydell <[email protected]>
Cc "Michael S. Tsirkin" <[email protected]>
Cc Igor Mammedov <[email protected]>
Quoted 6 lines

I don't think you need two Signed-off-by lines.
Besides that:

Pls feel free to merge through the ARM tree.

Thanks, I'll change that and add your R-b, and send a v2 for some dear maintainer to commit it :)

Heyi

Quoted 27 lines
Quoted 25 lines
---
  hw/arm/virt-acpi-build.c | 7 ++++++-
  1 file changed, 6 insertions(+), 1 deletion(-)
hw/arm/virt-acpi-build.c +6 -1
index 04b62c7..7849ec5 100644
@@ -265,7 +265,12 @@ static void acpi_dsdt_add_pci(Aml *scope, const MemMapEntry *memmap,
          aml_create_dword_field(aml_arg(3), aml_int(8), "CDW3"));
      aml_append(ifctx, aml_store(aml_name("CDW2"), aml_name("SUPP")));
      aml_append(ifctx, aml_store(aml_name("CDW3"), aml_name("CTRL")));
-    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1D), NULL),
+
+    /*
+     * Allow OS control for all 5 features:
+     * PCIeHotplug SHPCHotplug PME AER PCIeCapability.
+     */
+    aml_append(ifctx, aml_store(aml_and(aml_name("CTRL"), aml_int(0x1F), NULL),
                                  aml_name("CTRL")));
 
      ifctx1 = aml_if(aml_lnot(aml_equal(aml_arg(1), aml_int(0x1))));
Signature · 1 line
1.8.3.1

.