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=-9.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 58EBEC433E5 for ; Tue, 14 Jul 2020 09:23:05 +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 221452053B for ; Tue, 14 Jul 2020 09:23:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="aToWjyqp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 221452053B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jvH9U-0004ck-Fa for qemu-devel@archiver.kernel.org; Tue, 14 Jul 2020 05:23:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jvH8v-0004B6-Ti for qemu-devel@nongnu.org; Tue, 14 Jul 2020 05:22:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57492 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jvH8u-0008Tk-6x for qemu-devel@nongnu.org; Tue, 14 Jul 2020 05:22:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594718547; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=M3t1bq4CUoNn/AA04AXC4uVYJX8ueX8wsnFj6FZyRMs=; b=aToWjyqpnW7Ciu6r8PArPajD5iJTz4BvHCoiRiJZuev0reL7Rx+Rncbff/s5OPUh0HA4lz plZWWCi9Er91WrF6bGdvBkK4z49QO128XO1KADCSzvac25+rUlryhJR1Hqoo7yMY6VxEOZ 3OxnKbc7dhQMQ9U+BAt4NOLcpKBqbQg= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-447-MVD466hKOdyfrF09IdGDdA-1; Tue, 14 Jul 2020 05:22:25 -0400 X-MC-Unique: MVD466hKOdyfrF09IdGDdA-1 Received: by mail-wm1-f72.google.com with SMTP id o13so3028388wmh.9 for ; Tue, 14 Jul 2020 02:22:25 -0700 (PDT) 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:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=M3t1bq4CUoNn/AA04AXC4uVYJX8ueX8wsnFj6FZyRMs=; b=RZ2fmjZJh5jJS0eWE4ewQ6sMAF39S+UTbVMeEm0zJpJn5+dqlbH7DQikUGVU5rfoFL FJ6aAC58XiAb8maKVEzUVicBdi0hwt1BpXViV3Qdcg49bWnCOkPMi9WhnkytJjtepjvl VZ5vdGg6/syE417pqZ3xcN6UYkaGZNLq6MlLyQZaYZZDDv8vZpS4Hz9/T398VFMWV4Vq uK8419xd9nMiEq1/aarHLWcsNp73X5VRW4VPRV9sF5omksHJbuyN2yVki9NOmQZTSd9+ QmACkB/O3Dm9YEZjLne0zP3mo1/c5jT4Qrlmex4ZYa9Ymm401sQCIVyDX2lkXTyYFiHg npAw== X-Gm-Message-State: AOAM5317RemuCo6m4AwkjeUNIryzKcJ0XWlY27kesDHmlnaUqHJ/U0vH 0jjlV/1QB7oQ98wNjFBUgRYQinUdNZtWqO7mQx/QQRs+TgozfwPI76aQoVzu0q4TsIAnfhfh5I9 t1X2qOd+lmAnD3fk= X-Received: by 2002:adf:edc8:: with SMTP id v8mr3920062wro.125.1594718544369; Tue, 14 Jul 2020 02:22:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHFwWeg5biEpXtjbjxcTZmaNkJiDG6aBFgxdsxLeVZownuLxZiAuD1iCbC4FpZImySIkZqXw== X-Received: by 2002:adf:edc8:: with SMTP id v8mr3920046wro.125.1594718544152; Tue, 14 Jul 2020 02:22:24 -0700 (PDT) Received: from redhat.com (bzq-79-180-10-140.red.bezeqint.net. [79.180.10.140]) by smtp.gmail.com with ESMTPSA id g13sm28899975wro.84.2020.07.14.02.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 02:22:23 -0700 (PDT) Date: Tue, 14 Jul 2020 05:22:20 -0400 From: "Michael S. Tsirkin" To: Igor Mammedov Subject: Re: [RFC PATCH 3/5] hw/i386/acpi-build: Add ACPI PCI hot-plug methods to q35 Message-ID: <20200714052137-mutt-send-email-mst@kernel.org> References: <20200708224615.114077-1-jusual@redhat.com> <20200708224615.114077-4-jusual@redhat.com> <20200713163954.565722a5@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200713163954.565722a5@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=207.211.31.120; envelope-from=mst@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/13 21:44:01 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, 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: Julia Suvorova , qemu-devel@nongnu.org, kraxel@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, Jul 13, 2020 at 04:39:54PM +0200, Igor Mammedov wrote: > On Thu, 9 Jul 2020 00:46:13 +0200 > Julia Suvorova wrote: > > > Implement notifications and gpe to support q35 ACPI PCI hot-plug. > > The addresses specified in [1] remain the same to make fewer changes. > > > > [1] docs/spec/acpi_pci_hotplug.txt > > CCing Gerd his opinion on reusing piix4 IO port range for q35 > > > > Signed-off-by: Julia Suvorova > > --- > > hw/i386/acpi-build.c | 20 +++++++++++++------- > > 1 file changed, 13 insertions(+), 7 deletions(-) > > > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > > index 11c598f955..5c5ad88ad6 100644 > > --- a/hw/i386/acpi-build.c > > +++ b/hw/i386/acpi-build.c > > @@ -201,10 +201,6 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) > > /* w2k requires FADT(rev1) or it won't boot, keep PC compatible */ > > pm->fadt.rev = 1; > > pm->cpu_hp_io_base = PIIX4_CPU_HOTPLUG_IO_BASE; > > - pm->pcihp_io_base = > > - object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); > > - pm->pcihp_io_len = > > - object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); > > } > > if (lpc) { > > struct AcpiGenericAddress r = { .space_id = AML_AS_SYSTEM_IO, > > @@ -214,6 +210,10 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) > > pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; > > pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; > > } > > + pm->pcihp_io_base = > > + object_property_get_uint(obj, ACPI_PCIHP_IO_BASE_PROP, NULL); > > + pm->pcihp_io_len = > > + object_property_get_uint(obj, ACPI_PCIHP_IO_LEN_PROP, NULL); > > > > /* The above need not be conditional on machine type because the reset port > > * happens to be the same on PIIX (pc) and ICH9 (q35). */ > > @@ -472,7 +472,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, > > QLIST_FOREACH(sec, &bus->child, sibling) { > > int32_t devfn = sec->parent_dev->devfn; > > > > - if (pci_bus_is_root(sec) || pci_bus_is_express(sec)) { > > + if (pci_bus_is_root(sec)) { > > continue; > > } > > > > @@ -1586,7 +1586,12 @@ static void build_piix4_pci_hotplug(Aml *table) > > aml_append(table, scope); > > } > > > > -static Aml *build_q35_osc_method(void) > > +static void build_q35_pci_hotplug(Aml *table) > > +{ > > + build_piix4_pci_hotplug(table); > > +} > > s/build_piix4_pci_hotplug/build_i386_acpi_pci_hotplug/ > > and reuse it in both cases, instead of adding wrapper? I'm not sure about that - we have microvm too ... > > + > > +static Aml *build_q35_osc_method(AcpiPmInfo *pm) > > { > > Aml *if_ctx; > > Aml *if_ctx2; > > @@ -1698,6 +1703,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > build_hpet_aml(dsdt); > > build_q35_isa_bridge(dsdt); > > build_isa_devices_aml(dsdt); > > + build_q35_pci_hotplug(dsdt); > > build_q35_pci0_int(dsdt); > > if (pcms->smbus && !pcmc->do_not_add_smb_acpi) { > > build_smb0(dsdt, pcms->smbus, ICH9_SMB_DEV, ICH9_SMB_FUNC); > > @@ -1724,7 +1730,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, > > { > > aml_append(scope, aml_name_decl("_HID", aml_string("ACPI0006"))); > > > > - if (misc->is_piix4) { > > + if (misc->is_piix4 || pm->pcihp_bridge_en) { > > method = aml_method("_E01", 0, AML_NOTSERIALIZED); > > aml_append(method, > > aml_acquire(aml_name("\\_SB.PCI0.BLCK"), 0xFFFF));