* [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
@ 2024-06-24 13:14 Shiyuan Gao via
2024-06-24 13:18 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Shiyuan Gao via @ 2024-06-24 13:14 UTC (permalink / raw)
To: qemu-devel; +Cc: mst, imammedo, Shiyuan Gao
SHPC driver will be loaded fail in i440fx platform, the dmesg shows
that OS cannot get control of SHPC hotplug and hotplug device to
the PCI bridge will fail when we use SHPC Native type:
[3.336059] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
[3.337408] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
[3.338710] shpchp 0000:00:03.0: Cannot get control of SHPC hotplug
Add OSHP method support for SHPC driver load, the hotplug device to the PCI bridge will
success when we use SHPC Native type.
[1.703975] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S18_)
[1.704934] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
[1.705855] shpchp 0000:00:03.0: Gained control of SHPC hotplug (\_SB_.PCI0)
[1.707054] shpchp 0000:00:03.0: HPC vendor_id 1b36 device_id 1 ss_vid 0 ss_did 0
According to the acpi_pcihp, the OSHP method don't need parameter and return value now.
shpc_probe
--> acpi_get_hp_hw_control_from_firmware
--> acpi_run_oshp
--> status = acpi_evaluate_object(handle, METHOD_NAME_OSHP, NULL, NULL);
Signed-off-by: Shiyuan Gao <gaoshiyuan@baidu.com>
---
hw/i386/acpi-build.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index f4e366f64f..79622e6939 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -1412,6 +1412,18 @@ static void build_acpi0017(Aml *table)
aml_append(table, scope);
}
+static Aml *build_oshp_method(void)
+{
+ Aml *method;
+
+ /*
+ * Request control of SHPC hotplug via OSHP method,
+ * no need parameter and return value in acpi_pcihp.
+ */
+ method = aml_method("OSHP", 0, AML_NOTSERIALIZED);
+ return method;
+}
+
static void
build_dsdt(GArray *table_data, BIOSLinker *linker,
AcpiPmInfo *pm, AcpiMiscInfo *misc,
@@ -1452,6 +1464,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
aml_append(dev, aml_name_decl("_UID", aml_int(pcmc->pci_root_uid)));
aml_append(dev, aml_pci_edsm());
+ aml_append(dev, build_oshp_method());
aml_append(sb_scope, dev);
aml_append(dsdt, sb_scope);
@@ -1586,6 +1599,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
aml_append(dev, build_q35_osc_method(true));
} else {
aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
+ aml_append(dev, build_oshp_method());
}
if (numa_node != NUMA_NODE_UNASSIGNED) {
--
2.27.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
2024-06-24 13:14 [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load Shiyuan Gao via
@ 2024-06-24 13:18 ` Michael S. Tsirkin
2024-06-24 13:34 ` Gao,Shiyuan via
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2024-06-24 13:18 UTC (permalink / raw)
To: Shiyuan Gao; +Cc: qemu-devel, imammedo
On Mon, Jun 24, 2024 at 09:14:26PM +0800, Shiyuan Gao wrote:
> SHPC driver will be loaded fail in i440fx platform, the dmesg shows
> that OS cannot get control of SHPC hotplug and hotplug device to
> the PCI bridge will fail when we use SHPC Native type:
>
> [3.336059] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
> [3.337408] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> [3.338710] shpchp 0000:00:03.0: Cannot get control of SHPC hotplug
>
> Add OSHP method support for SHPC driver load, the hotplug device to the PCI bridge will
> success when we use SHPC Native type.
>
> [1.703975] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S18_)
> [1.704934] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> [1.705855] shpchp 0000:00:03.0: Gained control of SHPC hotplug (\_SB_.PCI0)
> [1.707054] shpchp 0000:00:03.0: HPC vendor_id 1b36 device_id 1 ss_vid 0 ss_did 0
>
> According to the acpi_pcihp, the OSHP method don't need parameter and return value now.
>
> shpc_probe
> --> acpi_get_hp_hw_control_from_firmware
> --> acpi_run_oshp
> --> status = acpi_evaluate_object(handle, METHOD_NAME_OSHP, NULL, NULL);
>
> Signed-off-by: Shiyuan Gao <gaoshiyuan@baidu.com>
> ---
> hw/i386/acpi-build.c | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> index f4e366f64f..79622e6939 100644
> --- a/hw/i386/acpi-build.c
> +++ b/hw/i386/acpi-build.c
> @@ -1412,6 +1412,18 @@ static void build_acpi0017(Aml *table)
> aml_append(table, scope);
> }
>
> +static Aml *build_oshp_method(void)
> +{
> + Aml *method;
> +
> + /*
> + * Request control of SHPC hotplug via OSHP method,
> + * no need parameter and return value in acpi_pcihp.
> + */
Quote spec and earliest version documenting this, please.
> + method = aml_method("OSHP", 0, AML_NOTSERIALIZED);
> + return method;
> +}
> +
> static void
> build_dsdt(GArray *table_data, BIOSLinker *linker,
> AcpiPmInfo *pm, AcpiMiscInfo *misc,
> @@ -1452,6 +1464,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
> aml_append(dev, aml_name_decl("_UID", aml_int(pcmc->pci_root_uid)));
> aml_append(dev, aml_pci_edsm());
> + aml_append(dev, build_oshp_method());
> aml_append(sb_scope, dev);
> aml_append(dsdt, sb_scope);
>
> @@ -1586,6 +1599,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker,
> aml_append(dev, build_q35_osc_method(true));
> } else {
> aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0A03")));
> + aml_append(dev, build_oshp_method());
> }
>
> if (numa_node != NUMA_NODE_UNASSIGNED) {
> --
> 2.27.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
2024-06-24 13:18 ` Michael S. Tsirkin
@ 2024-06-24 13:34 ` Gao,Shiyuan via
2024-06-24 13:51 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Gao,Shiyuan via @ 2024-06-24 13:34 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel@nongnu.org, imammedo@redhat.com
> > SHPC driver will be loaded fail in i440fx platform, the dmesg shows
> > that OS cannot get control of SHPC hotplug and hotplug device to
> > the PCI bridge will fail when we use SHPC Native type:
> >
> > [3.336059] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
> > [3.337408] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> > [3.338710] shpchp 0000:00:03.0: Cannot get control of SHPC hotplug
> >
> > Add OSHP method support for SHPC driver load, the hotplug device to the PCI bridge will
> > success when we use SHPC Native type.
> >
> > [1.703975] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S18_)
> > [1.704934] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> > [1.705855] shpchp 0000:00:03.0: Gained control of SHPC hotplug (\_SB_.PCI0)
> > [1.707054] shpchp 0000:00:03.0: HPC vendor_id 1b36 device_id 1 ss_vid 0 ss_did 0
> >
> > According to the acpi_pcihp, the OSHP method don't need parameter and return value now.
> >
> > shpc_probe
> > --> acpi_get_hp_hw_control_from_firmware
> > --> acpi_run_oshp
> > --> status = acpi_evaluate_object(handle, METHOD_NAME_OSHP, NULL, NULL);
> >
> > Signed-off-by: Shiyuan Gao <gaoshiyuan@baidu.com>
> > ---
> > hw/i386/acpi-build.c | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > index f4e366f64f..79622e6939 100644
> > --- a/hw/i386/acpi-build.c
> > +++ b/hw/i386/acpi-build.c
> > @@ -1412,6 +1412,18 @@ static void build_acpi0017(Aml *table)
> > aml_append(table, scope);
> > }
> >
> > +static Aml *build_oshp_method(void)
> > +{
> > + Aml *method;
> > +
> > + /*
> > + * Request control of SHPC hotplug via OSHP method,
> > + * no need parameter and return value in acpi_pcihp.
> > + */
>
> Quote spec and earliest version documenting this, please.
I cann't find document describe this, only find in the kernel code
and describe it in the commit message.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
2024-06-24 13:34 ` Gao,Shiyuan via
@ 2024-06-24 13:51 ` Michael S. Tsirkin
2024-06-24 14:40 ` Gao,Shiyuan via
0 siblings, 1 reply; 6+ messages in thread
From: Michael S. Tsirkin @ 2024-06-24 13:51 UTC (permalink / raw)
To: Gao,Shiyuan; +Cc: qemu-devel@nongnu.org, imammedo@redhat.com
On Mon, Jun 24, 2024 at 01:34:08PM +0000, Gao,Shiyuan wrote:
> > > SHPC driver will be loaded fail in i440fx platform, the dmesg shows
> > > that OS cannot get control of SHPC hotplug and hotplug device to
> > > the PCI bridge will fail when we use SHPC Native type:
> > >
> > > [3.336059] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S28_)
> > > [3.337408] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> > > [3.338710] shpchp 0000:00:03.0: Cannot get control of SHPC hotplug
> > >
> > > Add OSHP method support for SHPC driver load, the hotplug device to the PCI bridge will
> > > success when we use SHPC Native type.
> > >
> > > [1.703975] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0.S18_)
> > > [1.704934] shpchp 0000:00:03.0: Requesting control of SHPC hotplug via OSHP (\_SB_.PCI0)
> > > [1.705855] shpchp 0000:00:03.0: Gained control of SHPC hotplug (\_SB_.PCI0)
> > > [1.707054] shpchp 0000:00:03.0: HPC vendor_id 1b36 device_id 1 ss_vid 0 ss_did 0
> > >
> > > According to the acpi_pcihp, the OSHP method don't need parameter and return value now.
> > >
> > > shpc_probe
> > > --> acpi_get_hp_hw_control_from_firmware
> > > --> acpi_run_oshp
> > > --> status = acpi_evaluate_object(handle, METHOD_NAME_OSHP, NULL, NULL);
> > >
> > > Signed-off-by: Shiyuan Gao <gaoshiyuan@baidu.com>
> > > ---
> > > hw/i386/acpi-build.c | 14 ++++++++++++++
> > > 1 file changed, 14 insertions(+)
> > >
> > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > > index f4e366f64f..79622e6939 100644
> > > --- a/hw/i386/acpi-build.c
> > > +++ b/hw/i386/acpi-build.c
> > > @@ -1412,6 +1412,18 @@ static void build_acpi0017(Aml *table)
> > > aml_append(table, scope);
> > > }
> > >
> > > +static Aml *build_oshp_method(void)
> > > +{
> > > + Aml *method;
> > > +
> > > + /*
> > > + * Request control of SHPC hotplug via OSHP method,
> > > + * no need parameter and return value in acpi_pcihp.
> > > + */
> >
> > Quote spec and earliest version documenting this, please.
>
> I cann't find document describe this, only find in the kernel code
> and describe it in the commit message.
Hrrm you really should read the spec not just go by the fact things
happen to work. Look up PCI Firmware Specification
--
MST
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
2024-06-24 13:51 ` Michael S. Tsirkin
@ 2024-06-24 14:40 ` Gao,Shiyuan via
2024-06-24 15:26 ` Michael S. Tsirkin
0 siblings, 1 reply; 6+ messages in thread
From: Gao,Shiyuan via @ 2024-06-24 14:40 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel@nongnu.org, imammedo@redhat.com
> > > > +static Aml *build_oshp_method(void)
> > > > +{
> > > > + Aml *method;
> > > > +
> > > > + /*
> > > > + * Request control of SHPC hotplug via OSHP method,
> > > > + * no need parameter and return value in acpi_pcihp.
> > > > + */
> > >
> > > Quote spec and earliest version documenting this, please.
> >
> > I cann't find document describe this, only find in the kernel code
> > and describe it in the commit message.
>
> Hrrm you really should read the spec not just go by the fact things
> happen to work. Look up PCI Firmware Specification
Thanks and I will quote it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load
2024-06-24 14:40 ` Gao,Shiyuan via
@ 2024-06-24 15:26 ` Michael S. Tsirkin
0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2024-06-24 15:26 UTC (permalink / raw)
To: Gao,Shiyuan; +Cc: qemu-devel@nongnu.org, imammedo@redhat.com
On Mon, Jun 24, 2024 at 02:40:48PM +0000, Gao,Shiyuan wrote:
> > > > > +static Aml *build_oshp_method(void)
> > > > > +{
> > > > > + Aml *method;
> > > > > +
> > > > > + /*
> > > > > + * Request control of SHPC hotplug via OSHP method,
> > > > > + * no need parameter and return value in acpi_pcihp.
> > > > > + */
> > > >
> > > > Quote spec and earliest version documenting this, please.
> > >
> > > I cann't find document describe this, only find in the kernel code
> > > and describe it in the commit message.
> >
> > Hrrm you really should read the spec not just go by the fact things
> > happen to work. Look up PCI Firmware Specification
>
>
> Thanks and I will quote it.
yes and also pls explain why does an empty method make sense
from spec POV.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-06-24 15:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24 13:14 [PATCH 1/1] hw/i386/acpi-build: add OSHP method support for SHPC driver load Shiyuan Gao via
2024-06-24 13:18 ` Michael S. Tsirkin
2024-06-24 13:34 ` Gao,Shiyuan via
2024-06-24 13:51 ` Michael S. Tsirkin
2024-06-24 14:40 ` Gao,Shiyuan via
2024-06-24 15:26 ` Michael S. Tsirkin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).