[Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug

Heyi Guo posted 1 patch 6 years, 11 months ago
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu failed
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1551407310-32413-1-git-send-email-guoheyi@huawei.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Shannon Zhao <shannon.zhaosl@gmail.com>
There is a newer version of this series
hw/arm/virt-acpi-build.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
[Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Heyi Guo 6 years, 11 months ago
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 <shannon.zhaosl@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Heyi Guo <guoheyi@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 hw/arm/virt-acpi-build.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
index 04b62c7..7849ec5 100644
--- a/hw/arm/virt-acpi-build.c
+++ b/hw/arm/virt-acpi-build.c
@@ -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))));
-- 
1.8.3.1


Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Michael S. Tsirkin 6 years, 11 months ago
On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
> 
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>


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


> ---
>  hw/arm/virt-acpi-build.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 04b62c7..7849ec5 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -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))));
> -- 
> 1.8.3.1

Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Heyi Guo 6 years, 11 months ago

On 2019/3/1 21:47, Michael S. Tsirkin wrote:
> On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
>>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Cc: Peter Maydell <peter.maydell@linaro.org>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>
> 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
>
>> ---
>>   hw/arm/virt-acpi-build.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 04b62c7..7849ec5 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -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))));
>> -- 
>> 1.8.3.1
> .
>



Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Michael S. Tsirkin 6 years, 11 months ago
On Fri, Mar 01, 2019 at 10:04:38PM +0800, Heyi Guo wrote:
> 
> 
> On 2019/3/1 21:47, Michael S. Tsirkin wrote:
> > On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
> > > 
> > > Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> > > Cc: Peter Maydell <peter.maydell@linaro.org>
> > > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > > Cc: Igor Mammedov <imammedo@redhat.com>
> > > Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> > > Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> > 
> > 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.

> > 
> > > ---
> > >   hw/arm/virt-acpi-build.c | 7 ++++++-
> > >   1 file changed, 6 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> > > index 04b62c7..7849ec5 100644
> > > --- a/hw/arm/virt-acpi-build.c
> > > +++ b/hw/arm/virt-acpi-build.c
> > > @@ -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))));
> > > -- 
> > > 1.8.3.1
> > .
> > 
> 

Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Igor Mammedov 6 years, 11 months ago
On Fri, 1 Mar 2019 09:12:33 -0500
"Michael S. Tsirkin" <mst@redhat.com> wrote:

> On Fri, Mar 01, 2019 at 10:04:38PM +0800, Heyi Guo wrote:
> > 
> > 
> > On 2019/3/1 21:47, Michael S. Tsirkin wrote:  
> > > On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
> > > > 
> > > > Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> > > > Cc: Peter Maydell <peter.maydell@linaro.org>
> > > > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > > > Cc: Igor Mammedov <imammedo@redhat.com>
> > > > Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> > > > Signed-off-by: Heyi Guo <heyi.guo@linaro.org>  
> > > 
> > > 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)?

> 
> > >   
> > > > ---
> > > >   hw/arm/virt-acpi-build.c | 7 ++++++-
> > > >   1 file changed, 6 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> > > > index 04b62c7..7849ec5 100644
> > > > --- a/hw/arm/virt-acpi-build.c
> > > > +++ b/hw/arm/virt-acpi-build.c
> > > > @@ -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))));
> > > > -- 
> > > > 1.8.3.1  
> > > .
> > >   
> >   


Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Michael S. Tsirkin 6 years, 11 months ago
On Fri, Mar 01, 2019 at 03:33:11PM +0100, Igor Mammedov wrote:
> On Fri, 1 Mar 2019 09:12:33 -0500
> "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Fri, Mar 01, 2019 at 10:04:38PM +0800, Heyi Guo wrote:
> > > 
> > > 
> > > On 2019/3/1 21:47, Michael S. Tsirkin wrote:  
> > > > On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
> > > > > 
> > > > > Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> > > > > Cc: Peter Maydell <peter.maydell@linaro.org>
> > > > > Cc: "Michael S. Tsirkin" <mst@redhat.com>
> > > > > Cc: Igor Mammedov <imammedo@redhat.com>
> > > > > Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> > > > > Signed-off-by: Heyi Guo <heyi.guo@linaro.org>  
> > > > 
> > > > 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)?

True for PCIe.

> > 
> > > >   
> > > > > ---
> > > > >   hw/arm/virt-acpi-build.c | 7 ++++++-
> > > > >   1 file changed, 6 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> > > > > index 04b62c7..7849ec5 100644
> > > > > --- a/hw/arm/virt-acpi-build.c
> > > > > +++ b/hw/arm/virt-acpi-build.c
> > > > > @@ -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))));
> > > > > -- 
> > > > > 1.8.3.1  
> > > > .
> > > >   
> > >   

Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Heyi Guo 6 years, 11 months ago

On 2019/3/1 23:49, Michael S. Tsirkin wrote:
> On Fri, Mar 01, 2019 at 03:33:11PM +0100, Igor Mammedov wrote:
>> On Fri, 1 Mar 2019 09:12:33 -0500
>> "Michael S. Tsirkin" <mst@redhat.com> wrote:
>>
>>> On Fri, Mar 01, 2019 at 10:04:38PM +0800, Heyi Guo wrote:
>>>>
>>>> On 2019/3/1 21:47, Michael S. Tsirkin wrote:
>>>>> On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
>>>>>>
>>>>>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>>>>>> Cc: Peter Maydell <peter.maydell@linaro.org>
>>>>>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>>>>>> Cc: Igor Mammedov <imammedo@redhat.com>
>>>>>> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
>>>>>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>>>>> 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)?
> True for PCIe.
So may I consider your comments as ACK for this patch :)

Thanks,
Heyi

>>>>>    
>>>>>> ---
>>>>>>    hw/arm/virt-acpi-build.c | 7 ++++++-
>>>>>>    1 file changed, 6 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>>>>>> index 04b62c7..7849ec5 100644
>>>>>> --- a/hw/arm/virt-acpi-build.c
>>>>>> +++ b/hw/arm/virt-acpi-build.c
>>>>>> @@ -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))));
>>>>>> -- 
>>>>>> 1.8.3.1
>>>>> .
>>>>>    
>>>>    
> .
>



Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Michael S. Tsirkin 6 years, 11 months ago
On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
> 
> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

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

Reviewed-by: Michael S. Tsirkin <mst@redhat.com>

Pls feel free to merge through the ARM tree.

> ---
>  hw/arm/virt-acpi-build.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 04b62c7..7849ec5 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -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))));
> -- 
> 1.8.3.1

Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Heyi Guo 6 years, 11 months ago

On 2019/3/4 7:38, Michael S. Tsirkin wrote:
> On Fri, Mar 01, 2019 at 10:28:30AM +0800, Heyi Guo 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.
>>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Cc: Peter Maydell <peter.maydell@linaro.org>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> I don't think you need two Signed-off-by lines.
> Besides that:
>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
>
> 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

>
>> ---
>>   hw/arm/virt-acpi-build.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 04b62c7..7849ec5 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -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))));
>> -- 
>> 1.8.3.1
> .
>



Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Igor Mammedov 6 years, 11 months ago
On Fri, 1 Mar 2019 10:28:30 +0800
Heyi Guo <guoheyi@huawei.com> 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?

> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
> ---
>  hw/arm/virt-acpi-build.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
> index 04b62c7..7849ec5 100644
> --- a/hw/arm/virt-acpi-build.c
> +++ b/hw/arm/virt-acpi-build.c
> @@ -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))));


Re: [Qemu-devel] [PATCH] hw/arm/acpi: enable SHPC native hot plug
Posted by Heyi Guo 6 years, 11 months ago

On 2019/3/1 18:44, Igor Mammedov wrote:
> On Fri, 1 Mar 2019 10:28:30 +0800
> Heyi Guo <guoheyi@huawei.com> 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

>
>> Cc: Shannon Zhao <shannon.zhaosl@gmail.com>
>> Cc: Peter Maydell <peter.maydell@linaro.org>
>> Cc: "Michael S. Tsirkin" <mst@redhat.com>
>> Cc: Igor Mammedov <imammedo@redhat.com>
>> Signed-off-by: Heyi Guo <guoheyi@huawei.com>
>> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
>> ---
>>   hw/arm/virt-acpi-build.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c
>> index 04b62c7..7849ec5 100644
>> --- a/hw/arm/virt-acpi-build.c
>> +++ b/hw/arm/virt-acpi-build.c
>> @@ -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))));
>
> .
>