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=-6.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 1894EC43461 for ; Tue, 8 Sep 2020 14:54:24 +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 7DF1721D82 for ; Tue, 8 Sep 2020 14:54:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=anisinha-ca.20150623.gappssmtp.com header.i=@anisinha-ca.20150623.gappssmtp.com header.b="szxe3qqi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DF1721D82 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=anisinha.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kFf0o-00012Z-K0 for qemu-devel@archiver.kernel.org; Tue, 08 Sep 2020 10:54:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFf09-0000Cd-LZ for qemu-devel@nongnu.org; Tue, 08 Sep 2020 10:53:41 -0400 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]:45525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kFf07-0002HA-3Z for qemu-devel@nongnu.org; Tue, 08 Sep 2020 10:53:41 -0400 Received: by mail-pg1-x544.google.com with SMTP id 67so10184451pgd.12 for ; Tue, 08 Sep 2020 07:53:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:message-id:in-reply-to:references:subject :mime-version; bh=jJMQ6sxV5fSajY6xcN8uoqkrTF+NY5ydm90VEbWqZZk=; b=szxe3qqiHHTG9JBEoWcQ7G4sm8Wy+bYVH+kg3//XkIj8AbOSyOKINHhBRSJ9S0ZpXN /Fo0w9oRlRP+DTcaGO1qwQw8FCrclmQ3n9IHg+wisSTs3Txjd1hS/IqF1GmUv3P8q9WF cFQ8177HmPd4ShEMoZm29o4wUkbNERDb5L+BAnWeiBU3wbKm5Qfv1ORBdp4ham4A7iY/ gsnr2aY4sy1AKjNRa6v6+TafdbZGeUpIMOG0SkBw5BL5bwq+AX6nC93ADu9LSG8wTXBp MMBIbzEZJ/VlzlPiDAFbRxbhXE2nwZrvLgNFE0+0a3SsMGtdSynXfsFLcK/5IPhPY2Et 6N6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:message-id:in-reply-to :references:subject:mime-version; bh=jJMQ6sxV5fSajY6xcN8uoqkrTF+NY5ydm90VEbWqZZk=; b=OgXO3anPx5FqTjMkmYkHvkdBSehJQwu8kxPbG7bxdHrahY1L3BIBnt0TObxKm01uyj vO30fl+dyYtkT/+iPMIYdRDRsNLY+netd1tiX2y+8z+fOW42pmT8t4v7vi+ifNPGqU0k lbOtT/qz7DRWNh5HwQgWyOfGzSgJ2SsUFB5Jh+iSCRjkvkgq2qFMpYQJZxrLdfXQXluU TN2CLB9Np6EOMGxSP7/RJMYNT3RMUGKfbb9dFjM7R5uHQveY6EQvS+iMgH8Zesp6f/Hm aQmpxF8MxtLY1m/kOklRBN5KIduRFYY6Ih70RfyRPw0BF47cqr0ZLR2dHH0WHNyMRzTq KzUw== X-Gm-Message-State: AOAM5313toc00+aJb2knQxo92Ew/PBGaEoySXIoOc9PiiIyoajruFXpx IjAd6R1HIO6iWEY661xxFFhMHA== X-Google-Smtp-Source: ABdhPJwwgrbQSjXISI7ZyY2v3rjotpF5ninFHjXXXXid0/+2h6faRRNmbI5647ptTOkQl5dPTZqp9g== X-Received: by 2002:a05:6a00:f:b029:13e:d13d:a089 with SMTP id h15-20020a056a00000fb029013ed13da089mr1378290pfk.32.1599576816958; Tue, 08 Sep 2020 07:53:36 -0700 (PDT) Received: from [192.168.1.4] ([115.96.137.74]) by smtp.gmail.com with ESMTPSA id q11sm14810377pgj.92.2020.09.08.07.53.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Sep 2020 07:53:36 -0700 (PDT) Date: Tue, 8 Sep 2020 20:23:09 +0530 From: Ani Sinha To: "Michael S. Tsirkin" Message-ID: In-Reply-To: <20200908100429-mutt-send-email-mst@kernel.org> References: <20200901094922.25514-1-ani@anisinha.ca> <20200901094922.25514-2-ani@anisinha.ca> <20200908100429-mutt-send-email-mst@kernel.org> Subject: Re: [PATCH] piix4: don't reserve hw resources when hotplug is off globally X-Readdle-Message-ID: eca6c69e-3fc0-4876-8f28-995ce38271eb@Spark MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="5f579ae9_66334873_dc4" Received-SPF: none client-ip=2607:f8b0:4864:20::544; envelope-from=ani@anisinha.ca; helo=mail-pg1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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: Eduardo Habkost , jusual@redhat.com, qemu-devel@nongnu.org, Aleksandar Markovic , Paolo Bonzini , Igor Mammedov , =?utf-8?Q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --5f579ae9_66334873_dc4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sep 8, 2020, 19:35 +0530, Michael S. Tsirkin , wrote: > On Tue, Sep 01, 2020 at 03:19:22PM +0530, Ani Sinha wrote: > > When acpi hotplug is turned off for both root pci bus as well as for pci > > bridges, we should not generate the related amls for DSDT table or initialize > > related hw ports or reserve hw resources. This change makes sure all those > > operations are turned off in the case acpi pci hotplug is off globally. > > > > Signed-off-by: Ani Sinha > > Queued. in the future pls do not reply to patch with a new version. What new version? This is the only version for this patch. You must be getting confused with some other patch I sent. I sent quite a few. > > Thanks! > > > --- > > hw/acpi/piix4.c | 6 ++++-- > > hw/i386/acpi-build.c | 10 ++++++++-- > > 2 files changed, 12 insertions(+), 4 deletions(-) > > > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > > index e6163bb6ce..b70b1f98af 100644 > > --- a/hw/acpi/piix4.c > > +++ b/hw/acpi/piix4.c > > @@ -596,8 +596,10 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent, > > "acpi-gpe0", GPE_LEN); > > memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe); > > > > - acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, > > - s->use_acpi_hotplug_bridge); > > + if (s->use_acpi_hotplug_bridge || s->use_acpi_root_pci_hotplug) { > > + acpi_pcihp_init(OBJECT(s), &s->acpi_pci_hotplug, bus, parent, > > + s->use_acpi_hotplug_bridge); > > + } > > > > s->cpu_hotplug_legacy = true; > > object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy", > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > index b7bcbbbb2a..5365b3d290 100644 > > --- a/hw/i386/acpi-build.c > > +++ b/hw/i386/acpi-build.c > > @@ -95,6 +95,7 @@ typedef struct AcpiPmInfo { > > bool s3_disabled; > > bool s4_disabled; > > bool pcihp_bridge_en; > > + bool pcihp_root_en; > > uint8_t s4_val; > > AcpiFadtData fadt; > > uint16_t cpu_hp_io_base; > > @@ -245,6 +246,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) > > pm->pcihp_bridge_en = > > object_property_get_bool(obj, "acpi-pci-hotplug-with-bridge-support", > > NULL); > > + pm->pcihp_root_en = > > + object_property_get_bool(obj, "acpi-root-pci-hotplug", > > + NULL); > > } > > > > static void acpi_get_misc_info(AcpiMiscInfo *info) > > @@ -1504,7 +1508,9 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > build_hpet_aml(dsdt); > > build_piix4_isa_bridge(dsdt); > > build_isa_devices_aml(dsdt); > > - build_piix4_pci_hotplug(dsdt); > > + if (pm->pcihp_bridge_en || pm->pcihp_root_en) { > > + build_piix4_pci_hotplug(dsdt); > > + } > > build_piix4_pci0_int(dsdt); > > } else { > > sb_scope = aml_scope("_SB"); > > @@ -1698,7 +1704,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > crs_range_set_free(&crs_range_set); > > > > /* reserve PCIHP resources */ > > - if (pm->pcihp_io_len) { > > + if (pm->pcihp_io_len && (pm->pcihp_bridge_en || pm->pcihp_root_en)) { > > dev = aml_device("PHPR"); > > aml_append(dev, aml_name_decl("_HID", aml_string("PNP0A06"))); > > aml_append(dev, > > -- > > 2.17.1 > --5f579ae9_66334873_dc4 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On Sep 8, 2020, 19:35 +0530, Michael S. Tsirkin <= ;mst=40redhat.com>, wrote:
On Tue, Sep 01, 2020 at 03:19:22= PM +0530, Ani Sinha wrote:
When acpi hotplug is turned off = for both root pci bus as well as for pci
bridges, we should not generate = the related amls for DSDT table or initialize
related hw ports or reserve hw r= esources. This change makes sure all those
operations are turned off in the= case acpi pci hotplug is off globally.

Signed-off-by: Ani Sinha <ani= =40anisinha.ca>

Queued. in the future pls do not= reply to patch with a new version.

What new version=3F This is the only version for this patch.&=23160;

You must be getting confused with some other patch I sent. I sent quite a= few.


Thanks=21

---
hw/acpi/piix4.c =7C 6 ++++--
hw/i386/acpi-build.c =7C 10 ++++= ++++--
2 files changed, 12 insertions(+= ), 4 deletions(-)

diff --git a/hw/acpi/piix4.c b/h= w/acpi/piix4.c
index e6163bb6ce..b70b1f98af 100= 644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
=40=40 -596,8 +596,10 =40=40 sta= tic void piix4=5Facpi=5Fsystem=5Fhot=5Fadd=5Finit(MemoryRegion *parent,
=22acpi-gpe0=22, GPE=5FLEN);
memory=5Fregion=5Fadd=5Fsubregio= n(parent, GPE=5FBASE, &s->io=5Fgpe);

- acpi=5Fpcihp=5Finit(OBJECT(s),= &s->acpi=5Fpci=5Fhotplug, bus, parent,
- s->use=5Facpi=5Fhotplug=5Fb= ridge);
+ if (s->use=5Facpi=5Fhotplug= =5Fbridge =7C=7C s->use=5Facpi=5Froot=5Fpci=5Fhotplug) =7B
+ acpi=5Fpcihp=5Finit(OBJECT(s),= &s->acpi=5Fpci=5Fhotplug, bus, parent,
+ s->use=5Facpi=5Fhotplug=5Fb= ridge);
+ =7D

s->cpu=5Fhotplug=5Flegacy =3D= true;
object=5Fproperty=5Fadd=5Fbool(O= BJECT(s), =22cpu-hotplug-legacy=22,
diff --git a/hw/i386/acpi-build.= c b/hw/i386/acpi-build.c
index b7bcbbbb2a..5365b3d290 100= 644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
=40=40 -95,6 +95,7 =40=40 typede= f struct AcpiPmInfo =7B
bool s3=5Fdisabled;
=
bool s4=5Fdisabled;
=
bool pcihp=5Fbridge=5Fen;
+ bool pcihp=5Froot=5Fen;
uint8=5Ft s4=5Fval;
=
Acpi=46adtData fadt;
uint16=5Ft cpu=5Fhp=5Fio=5Fbase;=
=40=40 -245,6 +246,9 =40=40 stat= ic void acpi=5Fget=5Fpm=5Finfo(MachineState *machine, AcpiPmInfo *pm)
pm->pcihp=5Fbridge=5Fen =3D
object=5Fproperty=5Fget=5Fbool(o= bj, =22acpi-pci-hotplug-with-bridge-support=22,
NULL);
+ pm->pcihp=5Froot=5Fen =3D
+ object=5Fproperty=5Fget=5Fbool= (obj, =22acpi-root-pci-hotplug=22,
+ NULL);
=7D

static void acpi=5Fget=5Fmisc=5F= info(AcpiMiscInfo *info)
=40=40 -1504,7 +1508,9 =40=40 bu= ild=5Fdsdt(GArray *table=5Fdata, BIOSLinker *linker,
build=5Fhpet=5Faml(dsdt);
build=5Fpiix4=5Fisa=5Fbridge(dsd= t);
build=5Fisa=5Fdevices=5Faml(dsdt= );
- build=5Fpiix4=5Fpci=5Fhotplug(= dsdt);
+ if (pm->pcihp=5Fbridge=5Fen= =7C=7C pm->pcihp=5Froot=5Fen) =7B
+ build=5Fpiix4=5Fpci=5Fhotplug(= dsdt);
+ =7D
build=5Fpiix4=5Fpci0=5Fint(dsdt)= ;
=7D else =7B
sb=5Fscope =3D aml=5Fscope(=22=5F= SB=22);
=40=40 -1698,7 +1704,7 =40=40 bu= ild=5Fdsdt(GArray *table=5Fdata, BIOSLinker *linker,
crs=5Frange=5Fset=5Ffree(&cr= s=5Frange=5Fset);

/* reserve PCIHP resources */
- if (pm->pcihp=5Fio=5Flen) =7B=
+ if (pm->pcihp=5Fio=5Flen &a= mp;& (pm->pcihp=5Fbridge=5Fen =7C=7C pm->pcihp=5Froot=5Fen)) =7B=
dev =3D aml=5Fdevice(=22PHPR=22)= ;
aml=5Fappend(dev, aml=5Fname=5Fd= ecl(=22=5FHID=22, aml=5Fstring(=22PNP0A06=22)));
aml=5Fappend(dev,
--
2.17.1

--5f579ae9_66334873_dc4--