From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49DABC4743C for ; Wed, 23 Jun 2021 10:28:18 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B1690600CC for ; Wed, 23 Jun 2021 10:28:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B1690600CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37796 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lw07E-00014K-JH for qemu-devel@archiver.kernel.org; Wed, 23 Jun 2021 06:28:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lw05v-0000HW-K2 for qemu-devel@nongnu.org; Wed, 23 Jun 2021 06:26:55 -0400 Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:38715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lw05t-0000ld-AS for qemu-devel@nongnu.org; Wed, 23 Jun 2021 06:26:55 -0400 Received: by mail-ot1-x32d.google.com with SMTP id x17-20020a05683000d1b029045fb1889a9eso978367oto.5 for ; Wed, 23 Jun 2021 03:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=I3F/LUmGafpB3UhYbk0+qE51vZlFsBhqg+7RmeQ4ff0=; b=lpNvPj91YD45n93iKhF5nJ6JqlD51yE5XDZs0K9rV+Wy9SeXOpvVdFfGuse4SWFwGF 7PhclqccxLVE1pQXAG9G/o0N+LRrDdZxkgrhQG23eHnTplOyeL50vaLDg49A+85gRd+C 4nA02+mPhgMCbMfSgFGyGUuFDnragEtQcMCdCp88/tzpI7d3eGsehwK/JQ0lDHZwKeyF hSFCVdZsuhDtyNTCikzAhR4iAuG1DqQD/eqPgdrlY3/1Q3Qpkk91KVh7L+4odzxoao6+ BR867jUlj+Bg7JyfR3flutC0wA8UETjy46eylVfHnSbvoGIA6v/K9Lgj5QBeL+i9M3DI uctg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=I3F/LUmGafpB3UhYbk0+qE51vZlFsBhqg+7RmeQ4ff0=; b=V8yjW0RIhqp/L0jjltTjhsn7OiVJHwFVswnsfnTPX9CoMqKLaH0an8orUveYSFRoNu j9ruSP9HKczsv7mELRJV8uBIEqXjS1FLWknB0TXJjGn/AMhKb32Jt+8z+iyEd/tEZnre /0ZJvn12Cdwag0wmE8CIaxPVXdNaGkbnRjGM/DO2vKRdIEejLg0DR8545JIMwinKx76j IL88IN7PVH3KUFOw2MxlCWt2OgOXGQyHCRDtE4zxek5Z0o9Zyftk7AckazK4ccQ/ZIN/ IjhB/s5jzJnMtcGf6Ou2dG30vzkQSu0PdUURNY+IcpKcPTA0AqBuUTnBVVMNwlQAFCO5 vhbg== X-Gm-Message-State: AOAM5331xtdO0p5mKOqZ7uFR8/rOs0yVtBHpl8itSpw2q8vXeMuq3Eyu jGNWIdP3Ky6aIjZXnkdK59cBeeB/9x6+rAmfJ4g= X-Google-Smtp-Source: ABdhPJz1BpcpHK2YuCh0QOVODo83vAnwPZWB04GGBMBSzQtRrfJ9qxhxXbO5Ys6fZLJCDV0+kZ4qYI5d+nLWpHEOff0= X-Received: by 2002:a9d:2f61:: with SMTP id h88mr7043298otb.190.1624444011622; Wed, 23 Jun 2021 03:26:51 -0700 (PDT) MIME-Version: 1.0 References: <20210617190739.3673064-1-jusual@redhat.com> <20210617190739.3673064-2-jusual@redhat.com> In-Reply-To: <20210617190739.3673064-2-jusual@redhat.com> From: Marcel Apfelbaum Date: Wed, 23 Jun 2021 13:26:40 +0300 Message-ID: Subject: Re: [PATCH v5 1/7] hw/acpi/pcihp: Enhance acpi_pcihp_disable_root_bus() to support Q35 To: Julia Suvorova Content-Type: multipart/alternative; boundary="00000000000045335805c56c58fe" Received-SPF: pass client-ip=2607:f8b0:4864:20::32d; envelope-from=marcel.apfelbaum@gmail.com; helo=mail-ot1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Igor Mammedov , qemu devel list , Eduardo Habkost , "Michael S. Tsirkin" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --00000000000045335805c56c58fe Content-Type: text/plain; charset="UTF-8" On Thu, Jun 17, 2021 at 10:08 PM Julia Suvorova wrote: > PCI Express does not allow hot-plug on pcie.0. Check for Q35 in > acpi_pcihp_disable_root_bus() to be able to forbid hot-plug using the > 'acpi-root-pci-hotplug' flag. > > Signed-off-by: Julia Suvorova > Reviewed-by: Igor Mammedov > --- > hw/acpi/pcihp.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c > index 4999277d57..09f531e941 100644 > --- a/hw/acpi/pcihp.c > +++ b/hw/acpi/pcihp.c > @@ -122,13 +122,14 @@ static void acpi_set_pci_info(void) > static void acpi_pcihp_disable_root_bus(void) > { > static bool root_hp_disabled; > + Object *host = acpi_get_i386_pci_host(); > PCIBus *bus; > > if (root_hp_disabled) { > return; > } > > - bus = find_i440fx(); > + bus = PCI_HOST_BRIDGE(host)->bus; > if (bus) { > /* setting the hotplug handler to NULL makes the bus > non-hotpluggable */ > qbus_set_hotplug_handler(BUS(bus), NULL); > -- > 2.30.2 > > Reviewed-by: Marcel Apfelbaum Thanks, Marcel --00000000000045335805c56c58fe Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jun 17, 2021 at 10:08 PM Juli= a Suvorova <jusual@redhat.com&g= t; wrote:
PCI Ex= press does not allow hot-plug on pcie.0. Check for Q35 in
acpi_pcihp_disable_root_bus() to be able to forbid hot-plug using the
'acpi-root-pci-hotplug' flag.

Signed-off-by: Julia Suvorova <jusual@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
---
=C2=A0hw/acpi/pcihp.c | 3 ++-
=C2=A01 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 4999277d57..09f531e941 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -122,13 +122,14 @@ static void acpi_set_pci_info(void)
=C2=A0static void acpi_pcihp_disable_root_bus(void)
=C2=A0{
=C2=A0 =C2=A0 =C2=A0static bool root_hp_disabled;
+=C2=A0 =C2=A0 Object *host =3D acpi_get_i386_pci_host();
=C2=A0 =C2=A0 =C2=A0PCIBus *bus;

=C2=A0 =C2=A0 =C2=A0if (root_hp_disabled) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
=C2=A0 =C2=A0 =C2=A0}

-=C2=A0 =C2=A0 bus =3D find_i440fx();
+=C2=A0 =C2=A0 bus =3D PCI_HOST_BRIDGE(host)->bus;
=C2=A0 =C2=A0 =C2=A0if (bus) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0/* setting the hotplug handler to NULL ma= kes the bus non-hotpluggable */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0qbus_set_hotplug_handler(BUS(bus), NULL);=
--
2.30.2


Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>= ;

Thanks,
Marcel
=C2=A0
--00000000000045335805c56c58fe--