From patchwork Fri Jun 10 07:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641631 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=T9C6YVG4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKCy61RXbz9s5V for ; Fri, 10 Jun 2022 17:58:20 +1000 (AEST) Received: from localhost ([::1]:57774 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZX6-0006Ck-E8 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 03:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW5-0006BD-IN for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW2-0006AO-4R for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847828; 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=8bLVep2EYejM+CSte9uhOkNEEH+/TvGtAdS7QoYWadU=; b=T9C6YVG447STDptPj/FoyfoB4i34WMGTh2ikR8uLP57lTnNi4TK/8mc6k8Gn3IwpK0hYQ2 WExYpsvrKcF1UmmnSkrl9e7c4tHror5un8OAOKkt7CO0gEmRnlLnZG+nXbr985+DJYpEJf kDVP2zmPfCIMotbHeeCMlraQgftroYU= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-44-OMRpcT8BNcmHeikivTmkHw-1; Fri, 10 Jun 2022 03:57:07 -0400 X-MC-Unique: OMRpcT8BNcmHeikivTmkHw-1 Received: by mail-wm1-f72.google.com with SMTP id c187-20020a1c35c4000000b003970013833aso9327255wma.1 for ; Fri, 10 Jun 2022 00:57:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8bLVep2EYejM+CSte9uhOkNEEH+/TvGtAdS7QoYWadU=; b=xBD2JPbaBXZ1jqoP9/ZkWUl5xo941liZ2rO2TM30pvlq1ihfDn6yAyutw0RxCy8xhg TAH71TnUC5otwUuM/KEsOHG9s1l4Uz7Hdi/7PEkc9KRy0cnNE9zwMLUpO16uKiAFp+oF EnboYy4da9a2eaRVuQ5iXupe1wAcM425/dmbOb8Bv2RCq5FUh2fSUFVnjC6l6S+LX5Jz CRotOeDEEu914i3eDFgstrtJwXOun+mJRPMR1MZiH+IY9YFv2BtR5I6bBYF96regTUST I+VSWwjBWwMaU5AkqggedXX9xEmgFI0RO6U1620y6HUTsL5vkbJB1D8ERYtMkZGpor/4 Tkag== X-Gm-Message-State: AOAM533MOt05Asoy6LU67wEa1SjnOtvYPd4BClio8xpVG41sbvaRuwUE kZdB2jfoOJZvshYDV1bmN4F4AxvGaRuoFSkHMp0n0Tc1vQF96398Lbox0S4Y6CmO2oP1/ndT4bd MmZS7nFmuhKwN+WR/Si/25qYmUgQOBJsaWujV/rfgCvH8IAWdZaiLIdZ5hp+z X-Received: by 2002:a5d:624e:0:b0:210:a42:f29d with SMTP id m14-20020a5d624e000000b002100a42f29dmr41879774wrv.615.1654847825943; Fri, 10 Jun 2022 00:57:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9Asp08y1nTCx9VVow0GXHefMdNRdk9F+ZpvVocsGmGTzGhDqO2sdlZTZNYwKuXOItnnIkWA== X-Received: by 2002:a5d:624e:0:b0:210:a42:f29d with SMTP id m14-20020a5d624e000000b002100a42f29dmr41879733wrv.615.1654847825505; Fri, 10 Jun 2022 00:57:05 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003973435c517sm2091576wmg.0.2022.06.10.00.57.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:05 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:02 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha Subject: [PULL 01/54] acpi: add interface to build device specific AML Message-ID: <20220610075631.367501-2-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov There is already ISADeviceClass::build_aml() callback which builds device specific AML blob for some ISA devices. To extend the same idea to other devices, add TYPE_ACPI_DEV_AML_IF Interface that will provide a more generic callback which will be used not only for ISA but other devices. It will allow get rid of some data-mining and ad-hoc AML building, by asking device(s) to generate its own AML blob like it's done for ISA devices. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-2-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/acpi_aml_interface.h | 40 ++++++++++++++++++++++++++++ hw/acpi/acpi_interface.c | 8 ++++++ hw/acpi/meson.build | 2 +- 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 include/hw/acpi/acpi_aml_interface.h diff --git a/include/hw/acpi/acpi_aml_interface.h b/include/hw/acpi/acpi_aml_interface.h new file mode 100644 index 0000000000..ab76f0e55d --- /dev/null +++ b/include/hw/acpi/acpi_aml_interface.h @@ -0,0 +1,40 @@ +#ifndef ACPI_AML_INTERFACE_H +#define ACPI_AML_INTERFACE_H + +#include "qom/object.h" +#include "hw/acpi/aml-build.h" + +#define TYPE_ACPI_DEV_AML_IF "acpi-dev-aml-interface" +typedef struct AcpiDevAmlIfClass AcpiDevAmlIfClass; +DECLARE_CLASS_CHECKERS(AcpiDevAmlIfClass, ACPI_DEV_AML_IF, TYPE_ACPI_DEV_AML_IF) +#define ACPI_DEV_AML_IF(obj) \ + INTERFACE_CHECK(AcpiDevAmlIf, (obj), TYPE_ACPI_DEV_AML_IF) + +typedef struct AcpiDevAmlIf AcpiDevAmlIf; +typedef void (*dev_aml_fn)(AcpiDevAmlIf *adev, Aml *scope); + +/** + * AcpiDevAmlIfClass: + * + * build_dev_aml: adds device specific AML blob to provided scope + * + * Interface is designed for providing generic callback that builds device + * specific AML blob. + */ +struct AcpiDevAmlIfClass { + /* */ + InterfaceClass parent_class; + + /* */ + dev_aml_fn build_dev_aml; +}; + +static inline void call_dev_aml_func(DeviceState *dev, Aml *scope) +{ + if (object_dynamic_cast(OBJECT(dev), TYPE_ACPI_DEV_AML_IF)) { + AcpiDevAmlIfClass *klass = ACPI_DEV_AML_IF_GET_CLASS(dev); + klass->build_dev_aml(ACPI_DEV_AML_IF(dev), scope); + } +} + +#endif diff --git a/hw/acpi/acpi_interface.c b/hw/acpi/acpi_interface.c index 6583917b8e..c668d361f6 100644 --- a/hw/acpi/acpi_interface.c +++ b/hw/acpi/acpi_interface.c @@ -1,5 +1,6 @@ #include "qemu/osdep.h" #include "hw/acpi/acpi_dev_interface.h" +#include "hw/acpi/acpi_aml_interface.h" #include "qemu/module.h" void acpi_send_event(DeviceState *dev, AcpiEventStatusBits event) @@ -18,8 +19,15 @@ static void register_types(void) .parent = TYPE_INTERFACE, .class_size = sizeof(AcpiDeviceIfClass), }; + static const TypeInfo acpi_dev_aml_if_info = { + .name = TYPE_ACPI_DEV_AML_IF, + .parent = TYPE_INTERFACE, + .class_size = sizeof(AcpiDevAmlIfClass), + }; + type_register_static(&acpi_dev_if_info); + type_register_static(&acpi_dev_aml_if_info); } type_init(register_types) diff --git a/hw/acpi/meson.build b/hw/acpi/meson.build index cea2f5f93a..f8c820ca94 100644 --- a/hw/acpi/meson.build +++ b/hw/acpi/meson.build @@ -29,7 +29,7 @@ acpi_ss.add(when: 'CONFIG_PC', if_false: files('acpi-x86-stub.c')) if have_tpm acpi_ss.add(files('tpm.c')) endif -softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c')) +softmmu_ss.add(when: 'CONFIG_ACPI', if_false: files('acpi-stub.c', 'aml-build-stub.c', 'ghes-stub.c', 'acpi_interface.c')) softmmu_ss.add_all(when: 'CONFIG_ACPI', if_true: acpi_ss) softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('acpi-stub.c', 'aml-build-stub.c', 'acpi-x86-stub.c', 'ipmi-stub.c', 'ghes-stub.c', From patchwork Fri Jun 10 07:57:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641630 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=F3zZJjiC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKCy60Y0Lz9s09 for ; Fri, 10 Jun 2022 17:58:20 +1000 (AEST) Received: from localhost ([::1]:57780 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZX6-0006F5-Qv for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 03:58:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW5-0006C6-Oy for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:37538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW4-0006As-Ac for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847831; 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=kO7ZymzZRMHV3HTDQI9d5yNC5sEwLHsMcUWYcMukFFs=; b=F3zZJjiCln1XDY2pPP0Rn3RoBOhktiFBOo7jAU5cAL7xGwxS14SnbFB+OvGp9WPdvBm8ki veKGeYwopAxkH6DL2cvwTaikfL82d/pQkhj9jFwl4b91cOln/PIXcmW+Biayz71VbZMBOc 5iFMwFpXh4R82bR+mgu+Zb/g8btX7do= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-373-472rpzfMNUaIe2VLwAyBcQ-1; Fri, 10 Jun 2022 03:57:10 -0400 X-MC-Unique: 472rpzfMNUaIe2VLwAyBcQ-1 Received: by mail-wm1-f71.google.com with SMTP id o3-20020a05600c510300b0039743540ac7so9320305wms.5 for ; Fri, 10 Jun 2022 00:57:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kO7ZymzZRMHV3HTDQI9d5yNC5sEwLHsMcUWYcMukFFs=; b=6c1KPSkOxYcykLfyQVVkP7N1gYDxpXtYMdjMhYyknk4OT9RUzReGi2OnmMDa90TO8y ctaA2CYpzDWhrC2IF5nkCyHlzQVA2kKHV9s2yHzpmMhqcYCuSex/mWhirZXB5OcM+Asp wc5Lv2DucG+Z/FQUXSxiJaWJrrKYMSsMRLtyoIPDrdMKEeflkNVK8buXAa0D1hAtMqWn oqPAsdc4x0lRszxt5m8e267QC4jIWAhQNH/GXsgdnz1Wwy82+oQ8hZ7Kr6zO/jTjSDGA XylOPCPpEtr2uDUb7bhrpJjawrWGkK1nyYcdx4uZ8e9sErxWHnyGMI+YzR8bxtibmMdE kMmw== X-Gm-Message-State: AOAM533620daeZNauuQCQ7jfVz+lum/rkDrdRK917E2Gg1nTOlx9cSQN MrBJtz8gVatof1glj3uqwrMl7fHUJIzoGdGMFmVvUz0Yh4aq5z03eeaAAA2z9j6d3x2K1XUtz2l Ioc6h7+4EJdO3kMnfpUe0V1Lw1rvCZPp48BH247s43GhLivWOWCYsv+C6w0MD X-Received: by 2002:a05:600c:3b0c:b0:39c:7d91:26d0 with SMTP id m12-20020a05600c3b0c00b0039c7d9126d0mr1695677wms.40.1654847829213; Fri, 10 Jun 2022 00:57:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRKZKWvo++a9/RtHZ1eDJl7h20l4/5aDmmgiJKXTc0cTa5Cv3eqkSA+On8HbCuw1r4KMnGzw== X-Received: by 2002:a05:600c:3b0c:b0:39c:7d91:26d0 with SMTP id m12-20020a05600c3b0c00b0039c7d9126d0mr1695654wms.40.1654847828992; Fri, 10 Jun 2022 00:57:08 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id z13-20020adfe54d000000b002103cfd2fbasm28105979wrm.65.2022.06.10.00.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:08 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:05 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Gerd Hoffmann , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Bernhard Beschow , Thomas Huth Subject: [PULL 02/54] acpi: make isa_build_aml() support AcpiDevAmlIf interface Message-ID: <20220610075631.367501-3-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov To allow incremental conversion from ISADeviceClass::build_aml to AcpiDevAmlIf, add support for the later without removing the former. Once conversion is complete, another commit will drop ISADeviceClass::build_aml related code. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-3-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/isa/isa-bus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index cd5ad3687d..237e2cee12 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "sysemu/sysemu.h" #include "hw/isa/isa.h" +#include "hw/acpi/acpi_aml_interface.h" static ISABus *isabus; @@ -196,8 +197,12 @@ void isa_build_aml(ISABus *bus, Aml *scope) QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) { dev = ISA_DEVICE(kid->child); dc = ISA_DEVICE_GET_CLASS(dev); + bool has_build_dev_aml = !!object_dynamic_cast(OBJECT(dev), + TYPE_ACPI_DEV_AML_IF); if (dc->build_aml) { dc->build_aml(dev, scope); + } else if (has_build_dev_aml) { + call_dev_aml_func(DEVICE(dev), scope); } } } From patchwork Fri Jun 10 07:57:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641633 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=M6aEOgC6; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKCyG0Hxyz9s09 for ; Fri, 10 Jun 2022 17:58:30 +1000 (AEST) Received: from localhost ([::1]:58494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZXI-00073a-2s for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 03:58:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW9-0006EX-TU for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:19 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZW8-0006BE-91 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847835; 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=gDvKZYSn1i5sLA5v+UQUqZsPgY/wWGLuWICs9bpjlPE=; b=M6aEOgC6i2IW+v1waZZRlSG06SvKMbtJJGirLwSnAg119exERr2a5+n5fj767hqTH8CBQA FZPEqkHkOUI5KSGHs0A5pfz2A18IedfSkIkgpbZi0gQEBJ2FuQESSB3lHyhfwMOxNYB+r1 9825rjC3mgub4epO3+twCIWk0hkv86g= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-Ot177_faPkGNnFUiZTVuXQ-1; Fri, 10 Jun 2022 03:57:14 -0400 X-MC-Unique: Ot177_faPkGNnFUiZTVuXQ-1 Received: by mail-wr1-f69.google.com with SMTP id d9-20020adfe849000000b00213375a746aso5462266wrn.18 for ; Fri, 10 Jun 2022 00:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=gDvKZYSn1i5sLA5v+UQUqZsPgY/wWGLuWICs9bpjlPE=; b=AiOGFWP44GyxIg4d+RIfRP+Y7EM3l9Fx4vIUx/ehwO5dxklUc2iZSAJgqbMBl0qaDG XlHEFsja1aWDx51kHOeqiAAoJAPv3KYXQYZb1J3/1gEcIQtamHhSzbOhK65CuLzIy0ep 16uOxMQaHrP0/FPqOJ4jLmxNgqy7VfJTjl+EQBZxd7UAabcwZpcbL8DAswKKuKbHiHS/ x/B1/hqS3dADjVHuLwGQ1AiajiCuwNs7pu/ThzII5LQHbxrGPJtp5k3mEQORyEKuNNmj IdRYSu6GP6xTADvZOejNscCBuT15Q+eW0p0QdXOdX5tYPcEfeNg+omKQwZ9VHLcp0am6 i9rQ== X-Gm-Message-State: AOAM533lAuLjndm8gFz6BrXI+Iul8Ia14h/6HsSfZaxlN2Co9hMpJMgw MeY0E8+uAu2JEqoB5nQgYBOvZKPq5pH5KRo5Yx0TnDc220FCeog+Va79FtRHqP45w/2J6Whe5GW U+GRQtNuceZqVc+B0h7ucWjQp3wYrCvRxG1b4cTi6I7w6zDsMmxxJVoKh1Vke X-Received: by 2002:a05:600c:a4c:b0:39c:6517:1136 with SMTP id c12-20020a05600c0a4c00b0039c65171136mr7615407wmq.12.1654847832993; Fri, 10 Jun 2022 00:57:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw78w7JNCTYr72DKpM//Ez718ny/OJ8J1A2iPLLbpLYwz6DLdkvuKr0oGDHw0FEct0yApQOYw== X-Received: by 2002:a05:600c:a4c:b0:39c:6517:1136 with SMTP id c12-20020a05600c0a4c00b0039c65171136mr7615364wmq.12.1654847832699; Fri, 10 Jun 2022 00:57:12 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id i19-20020a7bc953000000b0039c1396b495sm2059605wml.9.2022.06.10.00.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:12 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , John Snow , Kevin Wolf , Hanna Reitz , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , qemu-block@nongnu.org Subject: [PULL 03/54] acpi: fdc-isa: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml Message-ID: <20220610075631.367501-4-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-4-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/block/fdc-isa.c | 16 ++++++++++------ hw/i386/acpi-build.c | 1 - 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/block/fdc-isa.c b/hw/block/fdc-isa.c index fa20450747..fee1ca68a8 100644 --- a/hw/block/fdc-isa.c +++ b/hw/block/fdc-isa.c @@ -32,7 +32,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/timer.h" -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -214,9 +214,9 @@ int cmos_get_fd_drive_type(FloppyDriveType fd0) return val; } -static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) +static void build_fdc_aml(AcpiDevAmlIf *adev, Aml *scope) { - FDCtrlISABus *isa = ISA_FDC(isadev); + FDCtrlISABus *isa = ISA_FDC(adev); Aml *dev; Aml *crs; int i; @@ -241,7 +241,7 @@ static void fdc_isa_build_aml(ISADevice *isadev, Aml *scope) aml_append(dev, aml_name_decl("_CRS", crs)); for (i = 0; i < MIN(MAX_FD, ACPI_FDE_MAX_FD); i++) { - FloppyDriveType type = isa_fdc_get_drive_type(isadev, i); + FloppyDriveType type = isa_fdc_get_drive_type(ISA_DEVICE(adev), i); if (type < FLOPPY_DRIVE_TYPE_NONE) { fde_buf[i] = cpu_to_le32(1); /* drive present */ @@ -283,14 +283,14 @@ static Property isa_fdc_properties[] = { static void isabus_fdc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->desc = "virtual floppy controller"; dc->realize = isabus_fdc_realize; dc->fw_name = "fdc"; dc->reset = fdctrl_external_reset_isa; dc->vmsd = &vmstate_isa_fdc; - isa->build_aml = fdc_isa_build_aml; + adevc->build_dev_aml = build_fdc_aml; device_class_set_props(dc, isa_fdc_properties); set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); } @@ -313,6 +313,10 @@ static const TypeInfo isa_fdc_info = { .instance_size = sizeof(FDCtrlISABus), .class_init = isabus_fdc_class_init, .instance_init = isabus_fdc_instance_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void isa_fdc_register_types(void) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index c125939ed6..1449832aa9 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -40,7 +40,6 @@ #include "hw/acpi/bios-linker-loader.h" #include "hw/isa/isa.h" #include "hw/input/i8042.h" -#include "hw/block/fdc.h" #include "hw/acpi/memory_hotplug.h" #include "sysemu/tpm.h" #include "hw/acpi/tpm.h" From patchwork Fri Jun 10 07:57:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641638 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dBXAeUSC; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKD3g5pKPz9s09 for ; Fri, 10 Jun 2022 18:03:11 +1000 (AEST) Received: from localhost ([::1]:37952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZbp-0004M0-Ok for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:03:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35006) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWD-0006GX-H8 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55276) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWB-0006BY-VI for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847839; 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=ldRwzPF0bs4mAZLHM5QvztMOUvUDJ2ffkwJ5V0o7Rdk=; b=dBXAeUSCMaVpBhXJjt9AJ+qyuY6GQM1f6M+zPgDr8b4iLAc75cpH+nWWpd9kEDT7D4dbPd +Q177RT6i8sf3ovVVJIPmXeXc84cLAbwslG4LWDiZ1E5m9aDlUmrtdZHU5ahZWsveg1lGw xIHa8eaIkE+eQKW72b4XXJtH5c+skp0= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-17-bMaBW4qFM6OFCL3t31rrvQ-1; Fri, 10 Jun 2022 03:57:17 -0400 X-MC-Unique: bMaBW4qFM6OFCL3t31rrvQ-1 Received: by mail-wr1-f72.google.com with SMTP id r13-20020adff10d000000b002160e9d64f8so4473509wro.0 for ; Fri, 10 Jun 2022 00:57:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ldRwzPF0bs4mAZLHM5QvztMOUvUDJ2ffkwJ5V0o7Rdk=; b=5hBjCV93TEo1CJsPlxT0gmMlEr/F+9/NC4Twk/i8Bs4uJ1cGBptH2st/T6oUlUKC/u fJycr8kKq3fRwiyk58a2ANwgQiYYeh+aDG/DQQvsQeWVUWEP7EsXBjYkiR5VC44OxLD4 AFUYZ6tTHYL+iTkgox98eTuA4RODCiDaCe7zm8s8sIzxsPnBW28XnexycTjuXoy4eWPk LZCa476ptUNevvNIhoxiBI1WUZuG47NAameglccuyMV55yFBHcpa/+EXIo0SLUwYJb5W 8K7wg0aF7fBSRVdNNOX3ZEHPpsNLflUspj0jjvbkqFdVyZRfbIL5eai+zaZ+0ty/6PnZ V/tA== X-Gm-Message-State: AOAM530zW3oZbdIRYBhrRtu0WUVrAdeCm7x5H0lT9ZbFTf8NEkXAqCeP cQFLdX8wsLZ4238bcyxzbCcfbngb51cdlyvqxdDM9C3xIpXTg8mqKe8ft1Knqj7EN/ultRmgXZf E5BRJ3eVCa5IPKFbSlzYKJ2Ic0AMKUE9sBZ06Xe1/czQNDs7jezninp2Vge2A X-Received: by 2002:a05:600c:25cd:b0:39c:6bc0:a1fb with SMTP id 13-20020a05600c25cd00b0039c6bc0a1fbmr7495737wml.179.1654847836021; Fri, 10 Jun 2022 00:57:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYzrGeoD/ag+7ybBFRktt08892rOAnJeC0m6doxsbpD4NUVONPlVkvS9wW3w4d4thUGWsb4A== X-Received: by 2002:a05:600c:25cd:b0:39c:6bc0:a1fb with SMTP id 13-20020a05600c25cd00b0039c6bc0a1fbmr7495714wml.179.1654847835745; Fri, 10 Jun 2022 00:57:15 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id d11-20020adffbcb000000b002183ee5c0c5sm14174618wrs.50.2022.06.10.00.57.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:15 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:13 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9?= Lureau Subject: [PULL 04/54] acpi: parallel port: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml Message-ID: <20220610075631.367501-5-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-5-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/char/parallel.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/char/parallel.c b/hw/char/parallel.c index f735a6cd7f..1c9ca47820 100644 --- a/hw/char/parallel.c +++ b/hw/char/parallel.c @@ -28,7 +28,7 @@ #include "qemu/module.h" #include "chardev/char-parallel.h" #include "chardev/char-fe.h" -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/irq.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -570,9 +570,9 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp) s, "parallel"); } -static void parallel_isa_build_aml(ISADevice *isadev, Aml *scope) +static void parallel_isa_build_aml(AcpiDevAmlIf *adev, Aml *scope) { - ISAParallelState *isa = ISA_PARALLEL(isadev); + ISAParallelState *isa = ISA_PARALLEL(adev); Aml *dev; Aml *crs; @@ -645,11 +645,11 @@ static Property parallel_isa_properties[] = { static void parallel_isa_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = parallel_isa_realizefn; dc->vmsd = &vmstate_parallel_isa; - isa->build_aml = parallel_isa_build_aml; + adevc->build_dev_aml = parallel_isa_build_aml; device_class_set_props(dc, parallel_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -659,6 +659,10 @@ static const TypeInfo parallel_isa_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(ISAParallelState), .class_init = parallel_isa_class_initfn, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void parallel_register_types(void) From patchwork Fri Jun 10 07:57:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Cb0LPDqb; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDFv6QdFz9s09 for ; Fri, 10 Jun 2022 18:12:02 +1000 (AEST) Received: from localhost ([::1]:46242 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZkN-0001lJ-4S for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:11:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWH-0006L3-C9 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:60613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWE-0006Bl-Gb for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847842; 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=8p3UZMvp53oc6TrQpok0PBaJsGrimApsLOLod59ne8I=; b=Cb0LPDqbdm4pshRI+tTQuzVxyO4eCchO8n9aouDweVGAHEvynZa3GAnaO9JJ8CmQz+X8Lb cJ7Mx117z3eEgkQV88p7xzs3ctmiVjYtuP5KmDuo0QDVR4Mfncj9J8LLbTuNUB9XrIugWg kMp2l39j0Qjq3A/7+eSAWyoQCtWTxn4= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-92-TEbBjkbqNJedg2PRHzc1NQ-1; Fri, 10 Jun 2022 03:57:20 -0400 X-MC-Unique: TEbBjkbqNJedg2PRHzc1NQ-1 Received: by mail-wm1-f69.google.com with SMTP id p18-20020a05600c23d200b0039c40c05687so6229083wmb.2 for ; Fri, 10 Jun 2022 00:57:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8p3UZMvp53oc6TrQpok0PBaJsGrimApsLOLod59ne8I=; b=5si/C60oT27IG0VIhWMFy+1vdxL1bMdWs1usTlZfh5PxxyLVJZ2iP2uiBGWIbV5DM2 IEzuCMH26NAlBVfDdTBmz5blpw4KO8WAKl5wZdbzz9oPciWchcxAT5AyI68Dhpq2NvOh Z7EDWGbzkEgpVGiP6WJCCyM1hkeniUSNv6KHsSiR9uYaloQ7cNOpHt3lGIwMoNRPza+/ utzl6EOO6zwKPWPwLa4nG/xnw4Z9RQMDedxFbuNZJvxn1xZMLQKFIAx35XFvDnGv5JK6 GwJR9ag7RRt6zO7sYbVMHB2xL2hDBVX4Xn5Rwgxr/mqgSIR6K9mMXnLatBv0QIQEggLJ RzxA== X-Gm-Message-State: AOAM5301U5vcmX4rvdH6+xoTx8bNLQQug0ng7wIQV8i1jpnThnDoIiV6 t0d8R0RjbtWzgQ1GHOv/TrEm64UK5kfoESmmmB1Sq34mIV7MT01wizVIJiayUsybUE4QZa2cefw AV9BQYsLMgeYaItigI6vYhu40TzSBHTJOwazgQ7Ar4FphI0xKfENW2NfCYbLE X-Received: by 2002:a5d:62c7:0:b0:216:fa41:2f81 with SMTP id o7-20020a5d62c7000000b00216fa412f81mr30700194wrv.249.1654847839204; Fri, 10 Jun 2022 00:57:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJzzlbe0XREW4OivmvtwBnjRhBcjHnkBkYJW7T1avOB5e4BhPeO0Jl5toexgEmtikUu3tkkQ== X-Received: by 2002:a5d:62c7:0:b0:216:fa41:2f81 with SMTP id o7-20020a5d62c7000000b00216fa412f81mr30700174wrv.249.1654847838928; Fri, 10 Jun 2022 00:57:18 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id 16-20020a05600c231000b0039c463e909asm1984721wmo.18.2022.06.10.00.57.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:18 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9?= Lureau Subject: [PULL 05/54] acpi: serial-is: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml Message-ID: <20220610075631.367501-6-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-6-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/char/serial-isa.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/char/serial-isa.c b/hw/char/serial-isa.c index 7a7ed239cd..141a6cb168 100644 --- a/hw/char/serial-isa.c +++ b/hw/char/serial-isa.c @@ -27,7 +27,7 @@ #include "qapi/error.h" #include "qemu/module.h" #include "sysemu/sysemu.h" -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/char/serial.h" #include "hw/isa/isa.h" #include "hw/qdev-properties.h" @@ -83,9 +83,9 @@ static void serial_isa_realizefn(DeviceState *dev, Error **errp) isa_register_ioport(isadev, &s->io, isa->iobase); } -static void serial_isa_build_aml(ISADevice *isadev, Aml *scope) +static void serial_isa_build_aml(AcpiDevAmlIf *adev, Aml *scope) { - ISASerialState *isa = ISA_SERIAL(isadev); + ISASerialState *isa = ISA_SERIAL(adev); Aml *dev; Aml *crs; @@ -122,11 +122,11 @@ static Property serial_isa_properties[] = { static void serial_isa_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = serial_isa_realizefn; dc->vmsd = &vmstate_isa_serial; - isa->build_aml = serial_isa_build_aml; + adevc->build_dev_aml = serial_isa_build_aml; device_class_set_props(dc, serial_isa_properties); set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -146,6 +146,10 @@ static const TypeInfo serial_isa_info = { .instance_size = sizeof(ISASerialState), .instance_init = serial_isa_initfn, .class_init = serial_isa_class_initfn, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void serial_register_types(void) From patchwork Fri Jun 10 07:57:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=d2PJrEmJ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKD4M33d0z9s09 for ; Fri, 10 Jun 2022 18:03:46 +1000 (AEST) Received: from localhost ([::1]:38906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZcM-0004y5-Ou for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:03:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35034) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWK-0006NM-RM for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:33882) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWI-0006Bw-LN for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847845; 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=cLORGfaruhYv2bPWorlB7iLm1JTkrMOr7JSAOkHYBXQ=; b=d2PJrEmJVZ7pwr5+Dre2di5EoxrvA/m3T5fMQnvbQdsnZB4caQvrIpX/uQOPgfacynL1dw ozDTtc8Ds3FmiQ+4h6H6uTtkQoZh2IvK2jLLDbsjVr3DOVekcVN/T9fStbUzVv1D8Ax2vv QjL9ssTMp4CnZVkUKkBFGzytt0FEL84= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-526-0QoStz0wOwee4gmcPPiF0A-1; Fri, 10 Jun 2022 03:57:23 -0400 X-MC-Unique: 0QoStz0wOwee4gmcPPiF0A-1 Received: by mail-wm1-f69.google.com with SMTP id ay28-20020a05600c1e1c00b0039c5cbe76c1so952308wmb.1 for ; Fri, 10 Jun 2022 00:57:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cLORGfaruhYv2bPWorlB7iLm1JTkrMOr7JSAOkHYBXQ=; b=oq3uj3oM7Pjavo4rsTbH6uWBk0bbnRDKMr0hh/Mx7VTXxRFNvvEDr2RkzShx9U+xxr mvy5XSC+bY+4W1TtRlp3ycaZlq4cWk8A6vFfwke5UojpNKa3jGkRIVhJCcR3glAcisfY OYR66Ock6rr3bdSj0UvSZfxmv424vlSZrL8Iew9XN1rDxfKDpPjK4LAZkmAoqc9CPXUt 0RwIU9hHbTjRJ4M6/2jTUi/Lm1y7WqJf3E/l1CdpduLOFyej5kE2g0Zs3Qk6PvjMEDLg B4N/Qn2eatZUmjud+zmUhNYFyYNLXpg7pBFItXZNx8rSIqwE3tg01nJV76vC0p460EXk F17A== X-Gm-Message-State: AOAM532XIJGzXRDII3GBXeqLrxfivojX5yUbnEMIj7TkNXvizDngrtbP UDP7b1a7KnCggJaacJ2aCrHM21g+zJImjTVK8ian/eXKF7eeHp5Ftjh+0Jza8EjWsPBulnS8EdM v2d6+ODlAYySKIIFivMd01GvYxwhy1ZYYajhBkOp/3qcDA9Icpct/P/T7pi4Q X-Received: by 2002:adf:e186:0:b0:213:3b79:370d with SMTP id az6-20020adfe186000000b002133b79370dmr41193630wrb.151.1654847842159; Fri, 10 Jun 2022 00:57:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRvyy36uljo0vNsYLNk4BSZY1HE4TD5JAR5WKLcHCvPCW5PqtJjJrQDgqnefnv4BwgQSuHrQ== X-Received: by 2002:adf:e186:0:b0:213:3b79:370d with SMTP id az6-20020adfe186000000b002133b79370dmr41193601wrb.151.1654847841810; Fri, 10 Jun 2022 00:57:21 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l15-20020a05600c4f0f00b003942a244f39sm2656763wmq.18.2022.06.10.00.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:21 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:19 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Paolo Bonzini Subject: [PULL 06/54] acpi: mc146818rtc: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml Message-ID: <20220610075631.367501-7-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-7-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/rtc/mc146818rtc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c index f235c2ddbe..ef9765bb8f 100644 --- a/hw/rtc/mc146818rtc.c +++ b/hw/rtc/mc146818rtc.c @@ -26,7 +26,7 @@ #include "qemu/cutils.h" #include "qemu/module.h" #include "qemu/bcd.h" -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/irq.h" #include "hw/qdev-properties.h" #include "hw/qdev-properties-system.h" @@ -1017,9 +1017,9 @@ static void rtc_reset_hold(Object *obj) qemu_irq_lower(s->irq); } -static void rtc_build_aml(ISADevice *isadev, Aml *scope) +static void rtc_build_aml(AcpiDevAmlIf *adev, Aml *scope) { - RTCState *s = MC146818_RTC(isadev); + RTCState *s = MC146818_RTC(adev); Aml *dev; Aml *crs; @@ -1043,13 +1043,13 @@ static void rtc_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); ResettableClass *rc = RESETTABLE_CLASS(klass); - ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = rtc_realizefn; dc->vmsd = &vmstate_rtc; rc->phases.enter = rtc_reset_enter; rc->phases.hold = rtc_reset_hold; - isa->build_aml = rtc_build_aml; + adevc->build_dev_aml = rtc_build_aml; device_class_set_props(dc, mc146818rtc_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); } @@ -1059,6 +1059,10 @@ static const TypeInfo mc146818rtc_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(RTCState), .class_init = rtc_class_initfn, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void mc146818rtc_register_types(void) From patchwork Fri Jun 10 07:57:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641647 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ghsjtXI2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDGv68GJz9s5V for ; Fri, 10 Jun 2022 18:12:55 +1000 (AEST) Received: from localhost ([::1]:47382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZlF-0002cf-Ro for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:12:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWM-0006Nr-AO for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWK-0006C4-Oo for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847848; 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=vZxTEcfc/oiDaPD6fjEHiXEYXxysVM4UQYltODL875E=; b=ghsjtXI2lY6nOoFfeOLehz3VmX/oLP2/TA4T7NyXAPocKwT3rAOjgdX4y/yY4agtORy0ut DfeUoxK6kdBjIGgSRV7wisnpVf9CpJJG5J5LYKm98RqyYXEMQNSdCdwZWFVf48lvXwpaxa SmUq05fKgRh5uvPZGBMozLgwvp0PluY= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-463-vapPNx1zM-6VjY5vHwz3eA-1; Fri, 10 Jun 2022 03:57:26 -0400 X-MC-Unique: vapPNx1zM-6VjY5vHwz3eA-1 Received: by mail-wm1-f71.google.com with SMTP id bi22-20020a05600c3d9600b0039c4144992cso955657wmb.5 for ; Fri, 10 Jun 2022 00:57:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vZxTEcfc/oiDaPD6fjEHiXEYXxysVM4UQYltODL875E=; b=B8rleWYOfDNaLybqSK+4CtN8KKuNavbKZ5F1blKeEpg10AdWNd0H44pikRqPxgJXnG jta1Xb/1dC2VSznhFTzbahbCg6ywfly/gWZCPkqlfRpWBXA2k2GpLLNgsJauVvKbu+6I GiICc2+yDvp0KRtkdgbBrkz059Qe0NdT7mSUAnS2IyRkIxAZrBcSQmiF2ItNIGTV8nBD vcKKO1rnLAy4GO9ZDSoKJT2PD5B6k61Mb72DT+yMIc9DPfk2rKLOEI3Gsc+PdHiawdUf 6aupxUWQS0v+ISuuS/hquwjcn/FiXaOsYRukrRP7oRvdykqiUg+G5M+wPTv/gZuvDkVM Pi1w== X-Gm-Message-State: AOAM532hvxBLFzj/S3iHYb0j37ejZjQyh29Ts+6wIGbJtcMvFKqFOUEs pFm9mBxuU02CVF/q8eocukEt3+4wArn3SQ+7+xHZnVMnyZVg1efJtK1C3b1PUAPIa0CmSu8djZc t4GlOs611klNRD/QvtTQ00Owr8R5LzvJutrcDmY4fQP4vok+XzcR1kjoTiYs3 X-Received: by 2002:a05:600c:19cf:b0:39c:63cb:9303 with SMTP id u15-20020a05600c19cf00b0039c63cb9303mr7599643wmq.9.1654847845034; Fri, 10 Jun 2022 00:57:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYxh1UKPQSi6MlCUXv3zCOq1nI7eEvX1wKpe8qPTBHX8EAFiIgi+HFRkDparVHBRdAKNfWNQ== X-Received: by 2002:a05:600c:19cf:b0:39c:63cb:9303 with SMTP id u15-20020a05600c19cf00b0039c63cb9303mr7599612wmq.9.1654847844714; Fri, 10 Jun 2022 00:57:24 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id c13-20020adffb0d000000b002183cf9cd69sm14222126wrr.15.2022.06.10.00.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:24 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:22 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Paolo Bonzini Subject: [PULL 07/54] acpi: pckbd: replace ISADeviceClass::build_aml with AcpiDevAmlIfClass:build_dev_aml Message-ID: <20220610075631.367501-8-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-8-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/input/pckbd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 4efdf75620..45c40fe3f3 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -29,7 +29,7 @@ #include "qapi/error.h" #include "hw/isa/isa.h" #include "migration/vmstate.h" -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/input/ps2.h" #include "hw/irq.h" #include "hw/input/i8042.h" @@ -767,9 +767,9 @@ static void i8042_realizefn(DeviceState *dev, Error **errp) qemu_register_reset(kbd_reset, s); } -static void i8042_build_aml(ISADevice *isadev, Aml *scope) +static void i8042_build_aml(AcpiDevAmlIf *adev, Aml *scope) { - ISAKBDState *isa_s = I8042(isadev); + ISAKBDState *isa_s = I8042(adev); Aml *kbd; Aml *mou; Aml *crs; @@ -807,12 +807,12 @@ static Property i8042_properties[] = { static void i8042_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - ISADeviceClass *isa = ISA_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); device_class_set_props(dc, i8042_properties); dc->realize = i8042_realizefn; dc->vmsd = &vmstate_kbd_isa; - isa->build_aml = i8042_build_aml; + adevc->build_dev_aml = i8042_build_aml; set_bit(DEVICE_CATEGORY_INPUT, dc->categories); } @@ -822,6 +822,10 @@ static const TypeInfo i8042_info = { .instance_size = sizeof(ISAKBDState), .instance_init = i8042_initfn, .class_init = i8042_class_initfn, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void i8042_register_types(void) From patchwork Fri Jun 10 07:57:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iTeVWvSw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDGX4LtRz9s09 for ; Fri, 10 Jun 2022 18:12:36 +1000 (AEST) Received: from localhost ([::1]:46568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZkw-0001yb-9m for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:12:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWR-0006Re-Jv for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48330) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWP-0006Cd-Vt for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847851; 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=n3YNKpaHVU6aZSU6CCGsDhinShLfgV49ZMxOmpgL2m8=; b=iTeVWvSw+HbxW+sFpMNMribpOXN1Y4ASshgJuk7ZwaBtdbyaOA+8ny8Y0gLi9UtzKFG72r hag5Opqw8n4YIfD2eSFuflUzoKrCyDD+5CZdCKE13/FVSyrNp8DMx6ZUbM6FyT9toHFCPy f1leziDPN6r6FE0x/ygXzDQHRABzJYc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-343-bA8vhfUYMtSgd0xpOklR1w-1; Fri, 10 Jun 2022 03:57:29 -0400 X-MC-Unique: bA8vhfUYMtSgd0xpOklR1w-1 Received: by mail-wm1-f69.google.com with SMTP id v8-20020a7bcb48000000b0039c62488f77so3162417wmj.4 for ; Fri, 10 Jun 2022 00:57:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=n3YNKpaHVU6aZSU6CCGsDhinShLfgV49ZMxOmpgL2m8=; b=KJtRZjEiHc81iyZI+XZjVDVNZwuY2LVxoElG4CJ90v+VtfGGT2n8sB4KE6u77ytQn0 m+JbcwMICKqyCNcWJ1/Y6L0h1vINkuDlgH0mwt78ot44TcCz+MrwC5ItKW3bssmg0oQJ 7k9PTH6MkbV+eWvGJYWuHnPgtxpYu7H2cD8rvfy7TIENfZCsbykM0AUZzRu+V4m4qLnK EfKcRLNHwQT+1corKy0z8JYe3lmdiLEiyqxSHDyO/U4fcfFSmhhl5eS2JN5QvOajOpyG k2OliqSYa/oE06Q/ng7eDLjheQUMmLtSxgb7RA23lfAw9YggC+c97aIERm2Vjr/dYwnE JGWQ== X-Gm-Message-State: AOAM532/0tD4Mga245+Ssntga9aeMz37whxanXJkhda4bnLgM0MYl4rB 2XlEa+YIom9tphE4u8GD7yyveCf0WlZpWMhK21XU0lHiyz7JpnUu4pnYlOHV8NvQjGgCMNaw+Eb b0BXDWh9/T2ZngGS8Wtw5moUiaAK6xdkBCpsQGnylYcltrcVH2KDibtDSJJWo X-Received: by 2002:a5d:67c2:0:b0:215:7a0f:71f9 with SMTP id n2-20020a5d67c2000000b002157a0f71f9mr36335157wrw.486.1654847848331; Fri, 10 Jun 2022 00:57:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdN0HiWFHJUycji3w97PvFjOmwGRPynxaGRo+k5XZ6TSTs0RG+8zW2hG4mjnFP1JGyU/6EkA== X-Received: by 2002:a5d:67c2:0:b0:215:7a0f:71f9 with SMTP id n2-20020a5d67c2000000b002157a0f71f9mr36335129wrw.486.1654847848069; Fri, 10 Jun 2022 00:57:28 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id p5-20020adfce05000000b002102739add8sm32691430wrn.54.2022.06.10.00.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:27 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:24 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Bernhard Beschow , Thomas Huth Subject: [PULL 08/54] isa-bus: drop no longer used ISADeviceClass::build_aml Message-ID: <20220610075631.367501-9-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-9-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/isa/isa.h | 1 - hw/isa/isa-bus.c | 12 +----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 034d706ba1..5c5a3d43a7 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -64,7 +64,6 @@ struct IsaDmaClass { struct ISADeviceClass { DeviceClass parent_class; - void (*build_aml)(ISADevice *dev, Aml *scope); }; struct ISABus { diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c index 237e2cee12..1bee1a47f1 100644 --- a/hw/isa/isa-bus.c +++ b/hw/isa/isa-bus.c @@ -191,19 +191,9 @@ ISADevice *isa_vga_init(ISABus *bus) void isa_build_aml(ISABus *bus, Aml *scope) { BusChild *kid; - ISADevice *dev; - ISADeviceClass *dc; QTAILQ_FOREACH(kid, &bus->parent_obj.children, sibling) { - dev = ISA_DEVICE(kid->child); - dc = ISA_DEVICE_GET_CLASS(dev); - bool has_build_dev_aml = !!object_dynamic_cast(OBJECT(dev), - TYPE_ACPI_DEV_AML_IF); - if (dc->build_aml) { - dc->build_aml(dev, scope); - } else if (has_build_dev_aml) { - call_dev_aml_func(DEVICE(dev), scope); - } + call_dev_aml_func(DEVICE(kid->child), scope); } } From patchwork Fri Jun 10 07:57:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=U115ihR9; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKD3n27gtz9s09 for ; Fri, 10 Jun 2022 18:03:17 +1000 (AEST) Received: from localhost ([::1]:38162 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZbv-0004UJ-8i for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:03:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35106) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWR-0006Rd-Eb for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21988) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWP-0006Cq-Vq for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847853; 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=5kDyfM4SfFP+l7PSGm7C9/Ykz21RiBvUGS+3VSOcz54=; b=U115ihR91mi2MDzcCDnSJPXgFPYQX4p2l6I2GH0lQS3y8qnIZRuuPfJ/7LyllVBy9C26P8 /vYC4GEQvvUzcl0u2MSC1b9NWNlioWvwwhvoRJXVB5Ua0ZC74c1MOgJDF4wHwyjIkyN0cQ slrUTxDHpvIjRI3OgjXV7UYwsjpY0jQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-416-45tM1UOdNWOQA844vSngCA-1; Fri, 10 Jun 2022 03:57:32 -0400 X-MC-Unique: 45tM1UOdNWOQA844vSngCA-1 Received: by mail-wm1-f69.google.com with SMTP id k5-20020a05600c0b4500b003941ca130f9so9342624wmr.0 for ; Fri, 10 Jun 2022 00:57:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5kDyfM4SfFP+l7PSGm7C9/Ykz21RiBvUGS+3VSOcz54=; b=nCUAkpNSPY8Ya/AbhUweDQf9p4Ky6mCv/GsvcIMtsE53MMBaYp9jInyuZp3rv9ta8W zIRE/MTMg0UHo9FTptIP1o24Ppk3D+fDK/RTWCZcBLg9wJNOCgnqukJRkpiDP+NCImiM JYX/ltn062KU0wX6QTHWU6xeuhL75ZuMqgNz+qlm33gl8kDu+5zxHq0wvQZbWPZQCKVR +i8l0BORIQegiOtRth1N7wlOKwFxNmyPGsLQY6i09HhSeFvCjibu16bcc4YLSXeSUEoU LFLO8cFdM6m9Dl5lmYQ8BBpELR2Hs0pOSM2wIeFqMpPN+41E7CrFKTggN/NUZ7FNxWTL 0HaQ== X-Gm-Message-State: AOAM530MFqiSgKXeH12bbYUzH8SMRmQNm9UwFUxRwEAOnWo9EhV9M16T Udd30aSTxktuOSzcZibH2lI/aRJqsDpud76qeSSHgh88ASaa/qWcV/2V/ZEvgjaHvckr/rYkxAX eItKYOyPUB5rQxKyjGtU2FWyVJ3IA05nOY3SJ1SYgvEIwJ8lDrDdvEDaLD3RU X-Received: by 2002:a5d:4ad0:0:b0:217:d2cb:d6d4 with SMTP id y16-20020a5d4ad0000000b00217d2cbd6d4mr27297161wrs.211.1654847851021; Fri, 10 Jun 2022 00:57:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzExv7GpJj4RpNgvWDZIAneZOVIlPDbRdELvaHXCvKTxPngWrx5U0XzjIUayBX9wzE6X/k5XA== X-Received: by 2002:a5d:4ad0:0:b0:217:d2cb:d6d4 with SMTP id y16-20020a5d4ad0000000b00217d2cbd6d4mr27297136wrs.211.1654847850781; Fri, 10 Jun 2022 00:57:30 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id y4-20020a5d4704000000b0020c5253d907sm25979853wrq.83.2022.06.10.00.57.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:30 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:28 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 09/54] tests: acpi: add and whitelist DSDT.ipmismbus expected blob Message-ID: <20220610075631.367501-10-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov .. which will be used by follow up smbus-ipmi test-case Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-10-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/q35/DSDT.ipmismbus | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/q35/DSDT.ipmismbus diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..b4687d1cc8 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.ipmismbus", diff --git a/tests/data/acpi/q35/DSDT.ipmismbus b/tests/data/acpi/q35/DSDT.ipmismbus new file mode 100644 index 0000000000..e69de29bb2 From patchwork Fri Jun 10 07:57:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641685 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Frg47rPz; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDRQ2qrYz9s09 for ; Fri, 10 Jun 2022 18:20:18 +1000 (AEST) Received: from localhost ([::1]:55982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZsO-0000cT-D2 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:20:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35124) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWW-0006V9-8y for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:40 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:32539) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWT-0006DI-MP for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847857; 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=txbr1/Eph1tCF7BwGxf4OagG96JT8d5zHt5JyHeAurY=; b=Frg47rPzFomF4Tn3Pho+ixcNdgdAZ+dcGf1Znaut9r7/HtlUbwLBmxKiVcEdLrAwy5tJr8 SEZWLPL6iH0L4UQBLBQmOpajO57zGDLpXvTHiU3NPyNHRTH899Rfhn6qT8XeIhrTBcK1JV IkIQ9PgxYrj34B3/P14avHBbN2N9BM8= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-379-VRssWpOsMq2EEEdHGe_Ukw-1; Fri, 10 Jun 2022 03:57:35 -0400 X-MC-Unique: VRssWpOsMq2EEEdHGe_Ukw-1 Received: by mail-wm1-f70.google.com with SMTP id v184-20020a1cacc1000000b0039c7efa3e95so71486wme.3 for ; Fri, 10 Jun 2022 00:57:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=txbr1/Eph1tCF7BwGxf4OagG96JT8d5zHt5JyHeAurY=; b=mHu89hvo+7XD+rJhwpyRgzjEnIqBmgInzakXn8lsoK9S3mc/swKwA9ZckOy30RyKF0 7T0APGUgwyKD1H6pdAPmjNoRq0DE4nc3X8pirQ0jwQEykrKOJ7rukLHbvDkoUTpW1IBY l/IFSN/9nwT8RrFv1Riro8vdv6ivwP8RePYQsztPJaRTk6wlOwHerorrCV4gCk0d6h64 5om1izMCcUmqB2uee+Ok/xAvEisjfoVVey86SDtap9UVI3iLCortMIbx0d5E9yaGdKXK XOgt4h9eE9YhE6jJVCwqlNtNvknxjzKp9Vjov84K9f8EHn1h5lw37A/6M0+9fGS3h3Fy w98w== X-Gm-Message-State: AOAM532q+eaaK0rBYtwxLzQVAurm+ZQOZKl5hfDpJxzAiBt8sWRvnfuK mEcG3Sfwp/jSYt/LntLrgX9XMT/NfTum2qhSAAyLI5nTIf6dFZIEiB+DcmTbDhKt1YASEpR9Xrn y1oipJ3CMN2iwTb6cN+bv05cmuGWuipV8xIgeFodsNhSmaSVLTRESdWOc+B6W X-Received: by 2002:a05:600c:3d8d:b0:39c:5232:107a with SMTP id bi13-20020a05600c3d8d00b0039c5232107amr7466279wmb.191.1654847853892; Fri, 10 Jun 2022 00:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw9sPGnNB50gwsWmvyA9uHtNDJytWYtUYlBFV0rJmxu4fmb4au7T2jgir/WPngm4jAEGMQDsQ== X-Received: by 2002:a05:600c:3d8d:b0:39c:5232:107a with SMTP id bi13-20020a05600c3d8d00b0039c5232107amr7466258wmb.191.1654847853597; Fri, 10 Jun 2022 00:57:33 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id u10-20020adfdd4a000000b002102cc4d63asm31466888wrm.81.2022.06.10.00.57.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:33 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha Subject: [PULL 10/54] tests: acpi: q35: add test for smbus-ipmi device Message-ID: <20220610075631.367501-11-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov expected new device node: Device (MI1) { Name (_HID, EisaId ("IPI0001")) // _HID: Hardware ID Name (_STR, "ipmi_smbus") // _STR: Description String Name (_UID, One) // _UID: Unique ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { I2cSerialBusV2 (0x0000, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.SMB0", 0x00, ResourceProducer, , Exclusive, ) }) Name (_IFT, 0x04) // _IFT: IPMI Interface Type Name (_SRV, 0x0200) // _SRV: IPMI Spec Revision } Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-11-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index a4a46e97f0..d896840270 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -955,6 +955,21 @@ static void test_acpi_q35_tcg_ipmi(void) free_test_data(&data); } +static void test_acpi_q35_tcg_smbus_ipmi(void) +{ + test_data data; + + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_Q35; + data.variant = ".ipmismbus"; + data.required_struct_types = ipmi_required_struct_types; + data.required_struct_types_len = ARRAY_SIZE(ipmi_required_struct_types); + test_acpi_one("-device ipmi-bmc-sim,id=bmc0" + " -device smbus-ipmi,bmc=bmc0", + &data); + free_test_data(&data); +} + static void test_acpi_piix4_tcg_ipmi(void) { test_data data; @@ -1743,6 +1758,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/mmio64", test_acpi_q35_tcg_mmio64); qtest_add_func("acpi/piix4/ipmi", test_acpi_piix4_tcg_ipmi); qtest_add_func("acpi/q35/ipmi", test_acpi_q35_tcg_ipmi); + qtest_add_func("acpi/q35/smbus/ipmi", test_acpi_q35_tcg_smbus_ipmi); qtest_add_func("acpi/piix4/cpuhp", test_acpi_piix4_tcg_cphp); qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp); qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); From patchwork Fri Jun 10 07:57:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641686 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VRvwk9r8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDSN3BMDz9s09 for ; Fri, 10 Jun 2022 18:21:08 +1000 (AEST) Received: from localhost ([::1]:57450 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZtC-0001tD-4C for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:21:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWY-0006Zl-29 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37424) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWW-0006DT-6n for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847859; 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=50FCA+oPa/o4bY0cQp3Iu96JutDknUJ/vBONIzdl2ek=; b=VRvwk9r8JYmTQvG3BWrFxNarnVgLdBWbEh2zJa+ztKbQI0cSloJsrd+FGXn18f/bfL4mE2 77heevOBFVYoBKP4+Aybqicig39lftzG6iaodlGJ//BlgPzvZMIUfzP5t7B0vpmqVIpSZT NtLkG4Bt2SJrEffu6PcZVVc2hUG+Fdg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632-6rfebNeuPeaninKlWhNvLQ-1; Fri, 10 Jun 2022 03:57:38 -0400 X-MC-Unique: 6rfebNeuPeaninKlWhNvLQ-1 Received: by mail-wm1-f69.google.com with SMTP id r205-20020a1c44d6000000b0039c7b23a1c7so49428wma.2 for ; Fri, 10 Jun 2022 00:57:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=50FCA+oPa/o4bY0cQp3Iu96JutDknUJ/vBONIzdl2ek=; b=eQZTtYEiTpilsD8XjaKQTgeLC8/TyUPa0Tr/MMzRvs6a+mJLYbuMUjug6ohqLTlPTu +XWZFTheCFF++uLqnQNXdgQvjfkojudYQ9PX+99YCpeVFRByeZldaDIwoctxkI/lkMvh 8gEQsbzxgPB2GDDTJYnUt9s6bL2teygrEO0AM13L+OmyoHCFHerlBTRiBtnFAIXCi6Ri ETC/Pn4ckSmYsw7kYJcUZ4XROOuDlImWKk3cw4W3hqFtIEz8AAIlbBeE+Yehih7TMWdF heL3SPufhZ5adCoIocPdULXOFVmNnNDSHutMcjIUcUGOE/p7n5PFCUQaDpswaJ9NN06P sdig== X-Gm-Message-State: AOAM532CBHMg7LXcrAX6FZwdr4BIcv87aN50/kLTinjcev8yd+IX5LXh jB3Asl/2n/U2MpaaxS+Yu/NNXOW43pU6cWZBy0p3uqV+MtPfEvBlxeDXBX0zIPBCAZsrcZxKU9c MHVsgxbAZeEY/VsTRiLE3qcW6c+dEjOIBMNgQhHSxCvNOQRaLKcU0oIdmJc16 X-Received: by 2002:a5d:6d0f:0:b0:213:1c53:6c85 with SMTP id e15-20020a5d6d0f000000b002131c536c85mr39016068wrq.18.1654847856756; Fri, 10 Jun 2022 00:57:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwS/rc7b+hawOw6DrpYpz4V2wVP+oqG+Jg78Myfg6aCwwEUIKV/xT22D1//H8zKYlBrytC11w== X-Received: by 2002:a5d:6d0f:0:b0:213:1c53:6c85 with SMTP id e15-20020a5d6d0f000000b002131c536c85mr39016044wrq.18.1654847856460; Fri, 10 Jun 2022 00:57:36 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id n9-20020a05600c4f8900b0039c362311d2sm2671731wmq.9.2022.06.10.00.57.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:36 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 11/54] tests: acpi: update expected blob DSDT.ipmismbus Message-ID: <20220610075631.367501-12-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov basic q35 DSDT with an extra device node: Device (MI1) { Name (_HID, EisaId ("IPI0001")) // _HID: Hardware ID Name (_STR, "ipmi_smbus") // _STR: Description String Name (_UID, One) // _UID: Unique ID Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { I2cSerialBusV2 (0x0000, ControllerInitiated, 0x000186A0, AddressingMode7Bit, "\\_SB.PCI0.SMB0", 0x00, ResourceProducer, , Exclusive, ) }) Name (_IFT, 0x04) // _IFT: IPMI Interface Type Name (_SRV, 0x0200) // _SRV: IPMI Spec Revision } Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-12-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/DSDT.ipmismbus | Bin 0 -> 8391 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/DSDT.ipmismbus b/tests/data/acpi/q35/DSDT.ipmismbus index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..07ba873b79caadd73ed9721fcbeee84c57676e2a 100644 GIT binary patch literal 8391 zcmb7JOKcm*8J^`!tL0K!Qk3OaY{E{`M+%3s^JhY z_y6rLX27<-bna|z1|Qz)Z7~AvZ3UJ^2Tp0O>leG7zH2qz zTHfqdYo1-WZ<%J-6-QCCTku-U>~7RNmR+6cuK8~4_G`@bt}G85@xe}d!E!qFe_s0b z?CD>Aapmp8y%I{g>CR>9?cOf?(LyqjM}zucCeK5L!+c!@Ea28TX>9F0bQ7KhAv zmpOG)s4SV)W~nVz8qh|nI{VdTyUuLJ?thnLvCd70;)Rz=4KLShdEH$0xvt+Xuz*^6 z0X1#D*R!17(Ee=DV}o9DG&*3zxz7fh?6;dX`}hCi2kgL_7kx`xb05u8U+#a$VvM0T zPhOzj(0F(HCu@G8%ZC`{&!Q{MT5COG^(@<2nSVMefrRSxpIIq-0E=rBMeoroS?0L4 zSTTC6#|)!lTw~YpdoF@%o&MwXwT(m8{DQ_Zt@t?_p-%teYO}p8bH~K>HZ-hbr7Ffd z(RZSzd2XL)zUZ#i4>@t5F`832526pE%sl6C&J(S+d)S*~c>Q?lfCbDj&oKi-)JQ)Z zqy47qw~gdI+cI%!C~z@$8##P=xz4^{x{O)yH`~I6OH$w#^QFr;QEb#(M)JO(QQ#IE z8}(eX=DnQj7{yh0g=L>;x~0pJ&UuPPqhN;+!MnyTqa2+dQ1b!HK2-o`8j5lS^wkTo zy{wmLdVYOwxEfB4`_KRVKmN1t)jwPMrheitZatt}ufNe7o*!Ii!xMvDD}ovD0l$xI z+_ocjkd7KR>5JW68ZHj5TQfl>9$_iA8T4*#GIp?OHfwH~W$iA0jbMi&=hIgVx>+3e z8$OYnt#&iBa$`S}jN$HNtBsWs6UPRQ%PeD4yA?rDkwFwem1R;f^aC?V;KGPl0M3bX zoCl~3iHZCi8{te~!-$v?8eyCXC}$!hCVIoMQO=Y-h%#bIXjCu(5OxxgvJF^b{?UsGok5BaHfPNbe#xQoim!w8BOPmt`niE)6{gD znod*KiBQ#vCy+AIvzpFXT_-|Sr={t%G@X{N6QQazsp(8=I+MCigsM(F3zh3>YdURR zCqh+cO4FIrbf$Ej2vwbPn$9^*=bWw+p{jFU(>br{oY!?CRCPLqMyP%xF3@n$C=_6QQbeLDRXQ>0HotB2;x|HJw>aXI9sVP}RAp>0H!wF6ufF zsydHpI*(~OkLfxQsygu|fxAyWhn6&*OS(>ks?Ot@&f}WSO(lj!`%? zPy{F|f+zx66b34A+>#7NEZIK;MFsTGKoLr5Fi?S&2C6{GKn3*BKoO!h(m(|^jHsq+ zpaObmpa{_;j)j2=Y#4`0?L_Wpa`W-7^uKV$y` zEN8+%6(|{~fN~}oC_Az;Y%GRDqI#3Mglifg+ST zVW0xbnJ`cVN(L&RoJj_XQ0jz%3M^;BKouw%sDN@N87M-j69y``0?L_Wpa`W-7^uKf}LawZulLa7r5ibyd~M5=)zR1FlNVxS5W2C6X0Kouq# zsKSJSDohxt!XyJ#m}H;|69%d)R`Lm~^^j|8iYS4Oz(QK_3;JE8W`f};ZGa1%i)=P9;rmqTpRn6=|Z5^ut!`b(( z{T(c_%pO?D>@&4>w>1kuE1#aTlAk2lEMEzFm))i|D~|74@cxc9&*%u9XkqDPbq4PU z1-ay5W4VSFgG_YWPam@uKAB^)QMen!^PAyGjMa{g>1U()qM5=9b5an zWuDff7!YoY$4gzmo>Jc9<-M`;-Vx=!uzYE}eC!d* zmz44)UcNL|zH~(SQdqt`UOxT^<;zO>GA~~qD_=gMd^s#%884rBgz^=oe1(^7MBCJK6Z0~or^5@#L^{znHQmHK!xAvfGbs#jB@^jH+thRu^CqjO z!>h_fI?*;Y-NZat)YIYpWg?wuo0@LozCNa>!%NLXI?*;Y-Nb#mq^HB1&O|!Vrl)fX z=EDW;zBl97i`ZSsp9@-eZ>4sFH+H)>-q_l^akw5&yB$wj z=Rbvg;}6?J2{!zQ4z6PL_X3&f1c_Sd#yWA6aY zM+@{{+m_wA`9lf{Eax^$4a2Q9e8X+kUox=Fo~N&}!J@8P_pp?oA!O9`ORG7+y+S*O z742H1W(JHJF}E&V<%5O}iB6^pZnKupFXyQnVtXo{O}p*#E0Li!*kK>J`FwsiTTNh( zpfKAxfA#5@+(03rB!CwA$D2_sV7=kV!T1T15LokA+@CnJx^mFV*5f4W(Fz&ksgPl6 z{%rY}>$?r}2pOi^C|$`!MgiLnjB8(dnZY$9VAlep7qHDQSMA>ndd8h?H1&e*@seEd zcq1;#aOuu?D=y3SSHs!CrZqyDuYzgkhmTK;99{Qd`xf6^`~1Y7QsRUJ|p_VzT^Y@fo+&*H}KrU=Ube9U?0XQ z>{K!KU%r*g&(q8IXhbjH^ocNSlh?#%*&oCi_IvHjJ?#E|C(hh^@%B^L7!I?EHX1G3 zX~V#2ABt%!)Qw?q#9lbxXD(oH#G{egm1m;Z9!-k(1pZ9SC2|Ra@26glHLJ~*7-HJ2 zewYMsYPjROaBMa#| X-Patchwork-Id: 1641641 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CjF7vxw2; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKD3p0WWXz9s09 for ; Fri, 10 Jun 2022 18:03:18 +1000 (AEST) Received: from localhost ([::1]:38326 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZbv-0004az-Va for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:03:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWZ-0006fW-Um for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:44 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWY-0006E5-EX for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847861; 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=OWx+CfckBjLGgAwLEqNKdUUoiBgaQnJBO9vst8oxW7k=; b=CjF7vxw2M9o3VfU4QDTv48CK2kZQqCElNJ14E1D+iJjadB380B/cO5xBTiBRYqRsrmo/0e 7ljcTCqRZcD5hCJsLnVhf7R3B3ALVVWlsAUOufEpYM0UNEZp1VDz8HuO3T2kgo0Ulf8onY EjttVjJBGC9yIAjBnJY2Q4r50fyEdM0= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-213-gyK8U0bcNyubHhdOI8dMhQ-1; Fri, 10 Jun 2022 03:57:40 -0400 X-MC-Unique: gyK8U0bcNyubHhdOI8dMhQ-1 Received: by mail-wm1-f69.google.com with SMTP id bg40-20020a05600c3ca800b00394779649b1so946820wmb.3 for ; Fri, 10 Jun 2022 00:57:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=OWx+CfckBjLGgAwLEqNKdUUoiBgaQnJBO9vst8oxW7k=; b=CYngO7GQHicV3KHhw4X9f9wcsmrQfWu9Gmf6h3nDGa0nFpIKAV35SDHJl3GoGE0/AV BJxnJ3L6pJfF/rnDPARSpRg2RGwL+Or0oNnDMlRvQdWsbmyq3vZNgBeZCVefl0/ndiRp pHPGQilwBSVX9c3T4XXJnzn9t+wBTrOZxW7pBsQmEdD87YuE0VKlTaF+SjDjxEoPHZYH IYpLSFmF77mVoJv5VrdXeOtqPj8fN6zmNP9+H/294u47j8uYhcZdl8r3X3RnqoOmz/bg 0Szc5biXYfaHk4PpetmfuBMbotSjr9wF7s+n+w9TPIm2q5Umo26s7avpRJoOkZ6t4n7x Kdzg== X-Gm-Message-State: AOAM530V9X9+jCnlf4JPhQm4CTu8+x9ZKk4a81cm0v/B22pW5mJnGbxp 2UJj1aEI2ru0REAdjFVu022q0eFoK6JdIxb5b/zOzSLVUyGApaSzOpd5QJixyUaJ9dpw9OLla0r xS5zUzb1CEk0fm/eyNnQD9a7Cd7f8utSJw8KhqTALalwMZ9WRjDPqXIhJkaJ5 X-Received: by 2002:a5d:6d8a:0:b0:219:b7fc:f29d with SMTP id l10-20020a5d6d8a000000b00219b7fcf29dmr6900731wrs.665.1654847859341; Fri, 10 Jun 2022 00:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydBoQz931n2Szla5BHqK1A8Ts1SIclY43Mu6nGxL0WB61aUK/ar4hvzZNM1TQbTqW+HDN7gg== X-Received: by 2002:a5d:6d8a:0:b0:219:b7fc:f29d with SMTP id l10-20020a5d6d8a000000b00219b7fcf29dmr6900712wrs.665.1654847859094; Fri, 10 Jun 2022 00:57:39 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id j3-20020a5d4483000000b0020fcc655e4asm26717132wrq.5.2022.06.10.00.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:38 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:36 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 12/54] tests: acpi: whitelist DSDT.ipmismbus expected blob Message-ID: <20220610075631.367501-13-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-13-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..b4687d1cc8 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.ipmismbus", From patchwork Fri Jun 10 07:57:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641693 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=crRgCHxO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDbK3BBTz9s09 for ; Fri, 10 Jun 2022 18:27:09 +1000 (AEST) Received: from localhost ([::1]:36076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZz1-00074e-7F for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:27:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWd-0006sP-9o for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWb-0006ET-Jj for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847865; 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=3iqbkxSoYmAB2JME6Zce7lenT6KOo4YHchMzDk3y2nA=; b=crRgCHxOm49qixaFH6cVJBAH6Ryez+0Xo+xZEeZ0090ZUzT0E9I7GC8Js2v/Opo93PvsKK 7qbO68C2UIF/Hyh5umvsC7dWs+eeAAFeH9ReqGngRctB8qoUmFkmzWgTYEzg2LSHP2r737 uVlxlI6s6EDcSPnt0uUgA+rh9iqLnTI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-372-YuwHv-pzMOq0hAqxrfcy7Q-1; Fri, 10 Jun 2022 03:57:43 -0400 X-MC-Unique: YuwHv-pzMOq0hAqxrfcy7Q-1 Received: by mail-wm1-f69.google.com with SMTP id v125-20020a1cac83000000b0039c6608296dso942878wme.4 for ; Fri, 10 Jun 2022 00:57:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3iqbkxSoYmAB2JME6Zce7lenT6KOo4YHchMzDk3y2nA=; b=RkaKUFyGnATrhOUe5VlnC31ypNzNhQO85w4rp4ffIEvord3+P/P+KSO4vPrgRCTr8k 78trABcRXYoSFjpGxeE3SgqOsrzqDgWsDf6ZhZtoQauQIvugiR6/RIh4pQKCjDa72w0I CTDZagn/UE3sXZIutLM0hogvOsz58T1YvSDlUm1xLRWP3KneHaklyry8KTGBixS0zOI4 1bqy1furZjKyXfupnXCSDb4p1zqM1wVQRkJv9W7rLTq6l2N2+9mH/atBQ5/MbPbwHSrL C2mJoCEeQA426aBWAQDdU4CsGTFmCBAlFxJvQ2bhDbpc6QTPR67g0SvHUuHEv8EOpL7I YgGg== X-Gm-Message-State: AOAM533tjPrOgPeB4GasbS5FmFdNF9qnvbLLPyRdYVEpFgFLdhIU7cOn EYdrCmSDvs8Kz4vlDgYyVkzOFBR8fJBEG3cg6E57h5Xse/jqGdTo2gNrVZOz45FNwqCalDew3sN i0ElrzRy98BxblTKNXXImAgQNyLhIaFpcdnH6dzhz6ANBaVkBJr8BX0o8Xwuk X-Received: by 2002:adf:e28a:0:b0:210:b31:722 with SMTP id v10-20020adfe28a000000b002100b310722mr43052540wri.65.1654847862432; Fri, 10 Jun 2022 00:57:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbZyHjj68hETli8m6Nr50HBG2R3IYBtebbiFNt43cW1rHsuALXHyPvX9R4LFkoCNQvpZlcyQ== X-Received: by 2002:adf:e28a:0:b0:210:b31:722 with SMTP id v10-20020adfe28a000000b002100b310722mr43052510wri.65.1654847862103; Fri, 10 Jun 2022 00:57:42 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l12-20020a05600c2ccc00b0039c4d9737f3sm2094095wmc.34.2022.06.10.00.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:41 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 13/54] ipmi: acpi: use relative path to resource source Message-ID: <20220610075631.367501-14-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov smbus-ipmi AML description needs to specify a path to its parent node in _CRS. The rest of IPMI inplementations (ISA based) do not need path at all. Instead of passing through a full path use relative path to point to smbus-ipmi's parent node, it will let follow up patches to create IPMI device AML in a generic way instead of current ad-hoc way. (i.e. AML will be generated the same way it's done for other ISA device, and smbus will be converted to generate AML for its slave devices the same way as ISA) expected AML change: Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { I2cSerialBusV2 (0x0000, ControllerInitiated, 0x000186A0, - AddressingMode7Bit, "\\_SB.PCI0.SMB0", + AddressingMode7Bit, "^", 0x00, ResourceProducer, , Exclusive, ) }) Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-14-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/ipmi.h | 2 +- hw/acpi/ipmi-stub.c | 2 +- hw/acpi/ipmi.c | 12 ++++++------ hw/i386/acpi-build.c | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/hw/acpi/ipmi.h b/include/hw/acpi/ipmi.h index c14ad682ac..c38483565c 100644 --- a/include/hw/acpi/ipmi.h +++ b/include/hw/acpi/ipmi.h @@ -16,6 +16,6 @@ * bus matches the given bus. The resource is the ACPI resource that * contains the IPMI device, this is required for the I2C CRS. */ -void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource); +void build_acpi_ipmi_devices(Aml *table, BusState *bus); #endif /* HW_ACPI_IPMI_H */ diff --git a/hw/acpi/ipmi-stub.c b/hw/acpi/ipmi-stub.c index 8634fb325c..f525f71c2d 100644 --- a/hw/acpi/ipmi-stub.c +++ b/hw/acpi/ipmi-stub.c @@ -10,6 +10,6 @@ #include "qemu/osdep.h" #include "hw/acpi/ipmi.h" -void build_acpi_ipmi_devices(Aml *table, BusState *bus, const char *resource) +void build_acpi_ipmi_devices(Aml *table, BusState *bus) { } diff --git a/hw/acpi/ipmi.c b/hw/acpi/ipmi.c index 96e48eba15..c30b44fcf5 100644 --- a/hw/acpi/ipmi.c +++ b/hw/acpi/ipmi.c @@ -13,7 +13,7 @@ #include "hw/acpi/acpi.h" #include "hw/acpi/ipmi.h" -static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char *resource) +static Aml *aml_ipmi_crs(IPMIFwInfo *info) { Aml *crs = aml_resource_template(); @@ -49,7 +49,7 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char *resource) break; case IPMI_MEMSPACE_SMBUS: aml_append(crs, aml_i2c_serial_bus_device(info->base_address, - resource)); + "^")); break; default: abort(); @@ -62,7 +62,7 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info, const char *resource) return crs; } -static Aml *aml_ipmi_device(IPMIFwInfo *info, const char *resource) +static Aml *aml_ipmi_device(IPMIFwInfo *info) { Aml *dev; uint16_t version = ((info->ipmi_spec_major_revision << 8) @@ -75,14 +75,14 @@ static Aml *aml_ipmi_device(IPMIFwInfo *info, const char *resource) aml_append(dev, aml_name_decl("_STR", aml_string("ipmi_%s", info->interface_name))); aml_append(dev, aml_name_decl("_UID", aml_int(info->uuid))); - aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info, resource))); + aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info))); aml_append(dev, aml_name_decl("_IFT", aml_int(info->interface_type))); aml_append(dev, aml_name_decl("_SRV", aml_int(version))); return dev; } -void build_acpi_ipmi_devices(Aml *scope, BusState *bus, const char *resource) +void build_acpi_ipmi_devices(Aml *scope, BusState *bus) { BusChild *kid; @@ -102,6 +102,6 @@ void build_acpi_ipmi_devices(Aml *scope, BusState *bus, const char *resource) iic = IPMI_INTERFACE_GET_CLASS(obj); memset(&info, 0, sizeof(info)); iic->get_fwinfo(ii, &info); - aml_append(scope, aml_ipmi_device(&info, resource)); + aml_append(scope, aml_ipmi_device(&info)); } } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1449832aa9..88506d563f 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -873,7 +873,7 @@ static void build_isa_devices_aml(Aml *table) assert(obj && !ambiguous); scope = aml_scope("_SB.PCI0.ISA"); - build_acpi_ipmi_devices(scope, BUS(obj), "\\_SB.PCI0.ISA"); + build_acpi_ipmi_devices(scope, BUS(obj)); isa_build_aml(ISA_BUS(obj), scope); aml_append(table, scope); @@ -1406,7 +1406,7 @@ static void build_smb0(Aml *table, I2CBus *smbus, int devnr, int func) Aml *dev = aml_device("SMB0"); aml_append(dev, aml_name_decl("_ADR", aml_int(devnr << 16 | func))); - build_acpi_ipmi_devices(dev, BUS(smbus), "\\_SB.PCI0.SMB0"); + build_acpi_ipmi_devices(dev, BUS(smbus)); aml_append(scope, dev); aml_append(table, scope); } From patchwork Fri Jun 10 07:57:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641646 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MvmQqv7H; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDGj75Mgz9s09 for ; Fri, 10 Jun 2022 18:12:45 +1000 (AEST) Received: from localhost ([::1]:46900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZl6-0002GZ-16 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:12:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWf-00072r-UI for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWe-0006Em-DY for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847867; 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=lTKRJanXFURgJLxcj5dmeUvRqlcXPToktz3OKgKMDvw=; b=MvmQqv7HMM7/PbsaJkITcjOs8JPwkmPjbUdyqD6wVC3UVI/wLW3yK5OJuESTp4K1b/l1rd E7X2NoETMPDxgfSqfaLK5y0wpXKqWOQjEmzW44qEQZO3ytKiPzbZ2QpPBc4YkpWvZ3a4ta oC4TTthA+zFgivpGaO0oEwxNolazIZU= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-657-5LFBjAHwNq6W6bjRWxlIgA-1; Fri, 10 Jun 2022 03:57:46 -0400 X-MC-Unique: 5LFBjAHwNq6W6bjRWxlIgA-1 Received: by mail-wm1-f71.google.com with SMTP id c187-20020a1c35c4000000b003970013833aso9327994wma.1 for ; Fri, 10 Jun 2022 00:57:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=lTKRJanXFURgJLxcj5dmeUvRqlcXPToktz3OKgKMDvw=; b=ikN5TnFKeMokKEy7BVzkYnh4mF23DIn8WKiTvKlPqDXHjiz8qlQ+3S6KfSD7XN2C+V XWSmyDTAzrPgyu4+wUlO19sNsB9szsJRYv6LhJKBRTHh0h/COoGrygO/FyYWSKvmQsL/ q00srAlPnBEcnyTerL7cqbKb9PuQ12DH8HG5H/scBnrtxuzgi1m2p3nTBDuQPPwULkHc J5Q41a/zceNWdjwWUaaYLPFWSoYFcOB8nDC3vJGdywn0C1ZaTnmLt+omzZqxNp0OKWaQ GR9lbuTS6u4JmlIqUEpr0t4ZbJXNYjL3JjzDrE5w26ILz/RagaZwKpak+6ZVP2sdESjO kxZA== X-Gm-Message-State: AOAM5334slvFBy2N1Tx4//NdNX2mWGgsaiVzcZiqmbZklQZZuBF3w/Ws cDJzEQJY6IhOaI7o2NsXIIkvnf1X85h0wmoh8HNgR51uS31xwdL6PoVcbyx7LSHrJZgxhQtl3rM epFcq5AlmkB1GwajFM60jCvua9Uc3FJTBqiPDXrP+oFgWUpj/si7+9lTzwi/V X-Received: by 2002:a05:600c:4ed4:b0:39c:325e:5d81 with SMTP id g20-20020a05600c4ed400b0039c325e5d81mr7577285wmq.76.1654847865269; Fri, 10 Jun 2022 00:57:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2z22fzJLnEX2S61EHbf4y/mt61gkyRGdRCEfgjfnRsQXeju9V1ApTj19A7NdFcJ1jzSY4bA== X-Received: by 2002:a05:600c:4ed4:b0:39c:325e:5d81 with SMTP id g20-20020a05600c4ed400b0039c325e5d81mr7577267wmq.76.1654847864999; Fri, 10 Jun 2022 00:57:44 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id m2-20020adfe942000000b0020fcaba73bcsm26952181wrn.104.2022.06.10.00.57.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:44 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:42 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 14/54] tests: acpi: update expected DSDT.ipmismbus blob Message-ID: <20220610075631.367501-15-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov expected AML change: Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { I2cSerialBusV2 (0x0000, ControllerInitiated, 0x000186A0, - AddressingMode7Bit, "\\_SB.PCI0.SMB0", + AddressingMode7Bit, "^", 0x00, ResourceProducer, , Exclusive, ) }) Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-15-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/DSDT.ipmismbus | Bin 8391 -> 8378 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/DSDT.ipmismbus b/tests/data/acpi/q35/DSDT.ipmismbus index 07ba873b79caadd73ed9721fcbeee84c57676e2a..415fe08a407690c0e118743d872de79d22f01a4c 100644 GIT binary patch delta 85 zcmX@^xXY2tCD80n^Yqk0Lq6G-v9sr delta 98 zcmdnxc-)c8CD$MJ|5 sqMMx9CjXGsR#xLu?vrC+1VW%jHiiXlAVv&OqaH}39!S?_OQ}XS01jdo-v9sr diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index b4687d1cc8..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/DSDT.ipmismbus", From patchwork Fri Jun 10 07:57:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=LOCk/SiX; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDcs5lLCz9s09 for ; Fri, 10 Jun 2022 18:28:29 +1000 (AEST) Received: from localhost ([::1]:37968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nza0J-0000T0-M8 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:28:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWj-0007Hn-6g for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50950) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWh-0006F0-Km for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847871; 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=E4XMO6SNV8cB5seqMqIW7M9vTpFNU/jgvVEGvtachsk=; b=LOCk/SiX6v80QTFMzru6Iag6NQuZPzdOKl2BjkyjzbG5BrYEVFX1A16jI3uI/hk0ktaIkf ixPR8pYAKlveS6LMbJMvdPbhfyBhwY9EINF47CxYIf2Zpr5fF0NB2XtmR3L0S5+/l8BExr iQizriXGYffyNG+7rzc73cRbhBn2Oak= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-363-Lon3WsnPNxiQCq298IPXOQ-1; Fri, 10 Jun 2022 03:57:49 -0400 X-MC-Unique: Lon3WsnPNxiQCq298IPXOQ-1 Received: by mail-wm1-f71.google.com with SMTP id z13-20020a7bc7cd000000b0039c4a238eadso4998540wmk.9 for ; Fri, 10 Jun 2022 00:57:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=E4XMO6SNV8cB5seqMqIW7M9vTpFNU/jgvVEGvtachsk=; b=AgB460XiGg8BrvwSIIHdLg4DOG5w+DhqDX6/0fY+ztGZWY4mIRUMKKHHreODJKHvsi MZQg1KYi3gbTtsEENP5rk4SokCWegANQFabUq9dpzC3o5Zaq7nsA2JnoClgM0ObHpht8 4+cRNFXiSD9EMhuzSKZ0+gMFKbI7OgshwpvL3Z+QxjTR/xudJ3Gao0hcdLrjdo+aC4Wc 1XHkVLhat3lHVxw54LUVawwtQCmUmEUmAYDpsRWNggv39W+cFNzS2WLiOjCgj5R9TCrp +tpXW+XnNJNQNzagwFP6Z5y0zTD4TEcWLmEcRcfwVpvZ+OQrL1LhmQ7B2Zc81ow2VsTe W9gA== X-Gm-Message-State: AOAM532iBF6WoWD5MdSS0De/H/cPe4iGMqivsK5Wrp1UJ419tRgPI8Sy DU5d7TJ67RRXUcA2VY3Qkr+fVDv+hyEZ1hN8swdKswbyrdgXv/zvpNOQo0P0b7tMYMMSnFzwhmY rrpUsH0mOzuhlQ/H/869vlL/YE/QaEzcTjbEJZoKAgm2jiJXWrxBM2dGSsTG/ X-Received: by 2002:a05:600c:590:b0:39c:5cd4:8623 with SMTP id o16-20020a05600c059000b0039c5cd48623mr7370315wmd.45.1654847868459; Fri, 10 Jun 2022 00:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ7+3FVmCkwWGPf5jxZObIKindZm7wQsebSguW7vfDX3pQkBHmLDiFGG9ukd4kw529Ckc10g== X-Received: by 2002:a05:600c:590:b0:39c:5cd4:8623 with SMTP id o16-20020a05600c059000b0039c5cd48623mr7370292wmd.45.1654847868196; Fri, 10 Jun 2022 00:57:48 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l21-20020a1ced15000000b003942a244ed1sm1973338wmh.22.2022.06.10.00.57.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:47 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:45 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Marcel Apfelbaum Subject: [PULL 15/54] acpi: ich9-smb: add support for AcpiDevAmlIf interface Message-ID: <20220610075631.367501-16-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov wire AcpiDevAmlIf interface to build ich9-smb and its slave devices AML. It will be used by followup patches to switch from creating AML in ad-hoc way to a more systematic one that will scan present devices and ask them to provide their AML code like it's done with ISA devices. This patch is a partial conversion, as it only fetches AML from slave devices attached to its I2C bus. The conversion will be completed when PCI bus is switched to use AcpiDevAmlIf and build_smb0() could be dropped. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-16-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i2c/smbus_ich9.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/i2c/smbus_ich9.c b/hw/i2c/smbus_ich9.c index 44dd5653b7..ee50ba1f2c 100644 --- a/hw/i2c/smbus_ich9.c +++ b/hw/i2c/smbus_ich9.c @@ -29,6 +29,7 @@ #include "hw/i386/ich9.h" #include "qom/object.h" +#include "hw/acpi/acpi_aml_interface.h" OBJECT_DECLARE_SIMPLE_TYPE(ICH9SMBState, ICH9_SMB_DEVICE) @@ -94,10 +95,22 @@ static void ich9_smbus_realize(PCIDevice *d, Error **errp) &s->smb.io); } +static void build_ich9_smb_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + BusChild *kid; + ICH9SMBState *s = ICH9_SMB_DEVICE(adev); + BusState *bus = BUS(s->smb.smbus); + + QTAILQ_FOREACH(kid, &bus->children, sibling) { + call_dev_aml_func(DEVICE(kid->child), scope); + } +} + static void ich9_smb_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_ICH9_6; @@ -112,6 +125,7 @@ static void ich9_smb_class_init(ObjectClass *klass, void *data) * pc_q35_init() */ dc->user_creatable = false; + adevc->build_dev_aml = build_ich9_smb_aml; } static void ich9_smb_set_irq(PMSMBus *pmsmb, bool enabled) @@ -143,6 +157,7 @@ static const TypeInfo ich9_smb_info = { .class_init = ich9_smb_class_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { TYPE_ACPI_DEV_AML_IF }, { }, }, }; From patchwork Fri Jun 10 07:57:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641684 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iYYKVDr7; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDR60xg7z9s09 for ; Fri, 10 Jun 2022 18:20:00 +1000 (AEST) Received: from localhost ([::1]:55146 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZs5-0008JX-2I for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:19:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWn-0007Wv-Cr for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55856) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWl-0006FN-9a for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847874; 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=QNBEO3WCdT3rMEQ7ULvtTtzOXLRUbHLzlRkLDMuJ4gg=; b=iYYKVDr7WZxgDa4YCXwz6SznVbiJW17AvWMrgBadxyoAP3ryYhH6LxlgzxV3NlqvtWGNhd m1JKPZgwdqHD1csAR54abeigdpTQPZ2J77ZoHioxhEc2ryDly2Yi9HnuqQPC85h9QIHEzE HeUTGleWD4P+oEQD48AwkvdthAN5vFg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-664-MqiNa_H1NiCpwRWajwtSfQ-1; Fri, 10 Jun 2022 03:57:53 -0400 X-MC-Unique: MqiNa_H1NiCpwRWajwtSfQ-1 Received: by mail-wm1-f69.google.com with SMTP id l4-20020a05600c1d0400b0039c60535405so3368313wms.6 for ; Fri, 10 Jun 2022 00:57:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QNBEO3WCdT3rMEQ7ULvtTtzOXLRUbHLzlRkLDMuJ4gg=; b=8CTUO27UIdRPkzuVnS2buRNWwZecvbRfFuFu0nI8T9lsdUwhmsJA/MIf0GgQEaU89X AyTT80kjFNOyFfzFjnZHpkekB6orE5Dfl8ACOb3NI+gDfLgOjTy66PXuR/+iBLpKdu3g njE8biXG2Pw+6uyuFWVoTfJIQHZ7no4hVHyLd8I4TObcarFhD0m+DrpITQhSaNBi40hJ YnJmx/9+XgEYVj4RV/5BXcSfcD1lFs6/uwLRfP9vI6ECLPhZM2GuJlpBTvaPfF+Ddb2d +aljIXFvs6U3lVf6bJBAnJ34ED9/ed+BKbaiVakfv4VnEK2ZKCxF3P7yFc7JDTqeQSaS is3w== X-Gm-Message-State: AOAM532WHnat5oBZLHd+SEUjMWSNNY5Za9UUOnvu/BdyCyrQAco1UG/h CNnyw3EQO+3LapHyVir/RTIJtp8AacavYQ6cjq3/+DvaMUx5lbRyxytnfA2Mb9d6GwCNtV7LLkr nKSDdr+5mywF0Er7y3CI9gpkQP2FcaUqiCZE05NBv158HZIToBQkzdhPsDmOl X-Received: by 2002:a05:600c:3553:b0:39c:63a3:f54a with SMTP id i19-20020a05600c355300b0039c63a3f54amr7606395wmq.61.1654847872067; Fri, 10 Jun 2022 00:57:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3cQV5Mam/PQEsFudKZB8icOtKDM5la67HA7MG+pkZc565ahQFOGUSI5LMC8l7xMrRvBkNdQ== X-Received: by 2002:a05:600c:3553:b0:39c:63a3:f54a with SMTP id i19-20020a05600c355300b0039c63a3f54amr7606362wmq.61.1654847871712; Fri, 10 Jun 2022 00:57:51 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id i7-20020a1c3b07000000b0039744bd664esm1922335wma.13.2022.06.10.00.57.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:51 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:48 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Corey Minyard Subject: [PULL 16/54] acpi: ipmi: use AcpiDevAmlIf interface to build IPMI device descriptors Message-ID: <20220610075631.367501-17-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov convert ad-hoc way we use to generate AML for ISA/SMB IPMI devices to a generic approach (i.e. make devices provide its own AML blobs like it is done with other ISA devices (ex. KBD)) Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-17-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/ipmi.h | 9 ++------ hw/acpi/ipmi-stub.c | 2 +- hw/acpi/ipmi.c | 49 +++++++++++++----------------------------- hw/i386/acpi-build.c | 17 ++++++++++----- hw/ipmi/isa_ipmi_bt.c | 4 ++++ hw/ipmi/isa_ipmi_kcs.c | 4 ++++ hw/ipmi/smbus_ipmi.c | 4 ++++ 7 files changed, 42 insertions(+), 47 deletions(-) diff --git a/include/hw/acpi/ipmi.h b/include/hw/acpi/ipmi.h index c38483565c..6c8079c97a 100644 --- a/include/hw/acpi/ipmi.h +++ b/include/hw/acpi/ipmi.h @@ -9,13 +9,8 @@ #ifndef HW_ACPI_IPMI_H #define HW_ACPI_IPMI_H -#include "hw/acpi/aml-build.h" +#include "hw/acpi/acpi_aml_interface.h" -/* - * Add ACPI IPMI entries for all registered IPMI devices whose parent - * bus matches the given bus. The resource is the ACPI resource that - * contains the IPMI device, this is required for the I2C CRS. - */ -void build_acpi_ipmi_devices(Aml *table, BusState *bus); +void build_ipmi_dev_aml(AcpiDevAmlIf *adev, Aml *scope); #endif /* HW_ACPI_IPMI_H */ diff --git a/hw/acpi/ipmi-stub.c b/hw/acpi/ipmi-stub.c index f525f71c2d..befaf0a882 100644 --- a/hw/acpi/ipmi-stub.c +++ b/hw/acpi/ipmi-stub.c @@ -10,6 +10,6 @@ #include "qemu/osdep.h" #include "hw/acpi/ipmi.h" -void build_acpi_ipmi_devices(Aml *table, BusState *bus) +void build_ipmi_dev_aml(AcpiDevAmlIf *adev, Aml *scope) { } diff --git a/hw/acpi/ipmi.c b/hw/acpi/ipmi.c index c30b44fcf5..a20e57d465 100644 --- a/hw/acpi/ipmi.c +++ b/hw/acpi/ipmi.c @@ -62,46 +62,27 @@ static Aml *aml_ipmi_crs(IPMIFwInfo *info) return crs; } -static Aml *aml_ipmi_device(IPMIFwInfo *info) +void build_ipmi_dev_aml(AcpiDevAmlIf *adev, Aml *scope) { Aml *dev; - uint16_t version = ((info->ipmi_spec_major_revision << 8) - | (info->ipmi_spec_minor_revision << 4)); + IPMIFwInfo info = {}; + IPMIInterface *ii = IPMI_INTERFACE(adev); + IPMIInterfaceClass *iic = IPMI_INTERFACE_GET_CLASS(ii); + uint16_t version; - assert(info->ipmi_spec_minor_revision <= 15); + iic->get_fwinfo(ii, &info); + assert(info.ipmi_spec_minor_revision <= 15); + version = ((info.ipmi_spec_major_revision << 8) + | (info.ipmi_spec_minor_revision << 4)); - dev = aml_device("MI%d", info->uuid); + dev = aml_device("MI%d", info.uuid); aml_append(dev, aml_name_decl("_HID", aml_eisaid("IPI0001"))); aml_append(dev, aml_name_decl("_STR", aml_string("ipmi_%s", - info->interface_name))); - aml_append(dev, aml_name_decl("_UID", aml_int(info->uuid))); - aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(info))); - aml_append(dev, aml_name_decl("_IFT", aml_int(info->interface_type))); + info.interface_name))); + aml_append(dev, aml_name_decl("_UID", aml_int(info.uuid))); + aml_append(dev, aml_name_decl("_CRS", aml_ipmi_crs(&info))); + aml_append(dev, aml_name_decl("_IFT", aml_int(info.interface_type))); aml_append(dev, aml_name_decl("_SRV", aml_int(version))); - return dev; -} - -void build_acpi_ipmi_devices(Aml *scope, BusState *bus) -{ - - BusChild *kid; - - QTAILQ_FOREACH(kid, &bus->children, sibling) { - IPMIInterface *ii; - IPMIInterfaceClass *iic; - IPMIFwInfo info; - Object *obj = object_dynamic_cast(OBJECT(kid->child), - TYPE_IPMI_INTERFACE); - - if (!obj) { - continue; - } - - ii = IPMI_INTERFACE(obj); - iic = IPMI_INTERFACE_GET_CLASS(obj); - memset(&info, 0, sizeof(info)); - iic->get_fwinfo(ii, &info); - aml_append(scope, aml_ipmi_device(&info)); - } + aml_append(scope, dev); } diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 88506d563f..5b963cca32 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -39,6 +39,7 @@ #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" #include "hw/isa/isa.h" +#include "hw/acpi/acpi_aml_interface.h" #include "hw/input/i8042.h" #include "hw/acpi/memory_hotplug.h" #include "sysemu/tpm.h" @@ -73,7 +74,6 @@ #include "hw/i386/intel_iommu.h" #include "hw/virtio/virtio-iommu.h" -#include "hw/acpi/ipmi.h" #include "hw/acpi/hmat.h" #include "hw/acpi/viot.h" #include "hw/acpi/cxl.h" @@ -873,7 +873,6 @@ static void build_isa_devices_aml(Aml *table) assert(obj && !ambiguous); scope = aml_scope("_SB.PCI0.ISA"); - build_acpi_ipmi_devices(scope, BUS(obj)); isa_build_aml(ISA_BUS(obj), scope); aml_append(table, scope); @@ -1400,13 +1399,21 @@ static Aml *build_q35_osc_method(bool enable_native_pcie_hotplug) return method; } -static void build_smb0(Aml *table, I2CBus *smbus, int devnr, int func) +static void build_smb0(Aml *table, int devnr, int func) { Aml *scope = aml_scope("_SB.PCI0"); Aml *dev = aml_device("SMB0"); + bool ambiguous; + Object *obj; + /* + * temporarily fish out device hosting SMBUS, build_smb0 will be gone once + * PCI enumeration will be switched to call_dev_aml_func() + */ + obj = object_resolve_path_type("", TYPE_ICH9_SMB_DEVICE, &ambiguous); + assert(obj && !ambiguous); aml_append(dev, aml_name_decl("_ADR", aml_int(devnr << 16 | func))); - build_acpi_ipmi_devices(dev, BUS(smbus)); + call_dev_aml_func(DEVICE(obj), dev); aml_append(scope, dev); aml_append(table, scope); } @@ -1524,7 +1531,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, } 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); + build_smb0(dsdt, ICH9_SMB_DEV, ICH9_SMB_FUNC); } } diff --git a/hw/ipmi/isa_ipmi_bt.c b/hw/ipmi/isa_ipmi_bt.c index 88aa734e9e..a83e7243d6 100644 --- a/hw/ipmi/isa_ipmi_bt.c +++ b/hw/ipmi/isa_ipmi_bt.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "hw/acpi/ipmi.h" #define TYPE_ISA_IPMI_BT "isa-ipmi-bt" OBJECT_DECLARE_SIMPLE_TYPE(ISAIPMIBTDevice, ISA_IPMI_BT) @@ -144,6 +145,7 @@ static void isa_ipmi_bt_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); IPMIInterfaceClass *iic = IPMI_INTERFACE_CLASS(oc); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(oc); dc->realize = isa_ipmi_bt_realize; device_class_set_props(dc, ipmi_isa_properties); @@ -151,6 +153,7 @@ static void isa_ipmi_bt_class_init(ObjectClass *oc, void *data) iic->get_backend_data = isa_ipmi_bt_get_backend_data; ipmi_bt_class_init(iic); iic->get_fwinfo = isa_ipmi_bt_get_fwinfo; + adevc->build_dev_aml = build_ipmi_dev_aml; } static const TypeInfo isa_ipmi_bt_info = { @@ -161,6 +164,7 @@ static const TypeInfo isa_ipmi_bt_info = { .class_init = isa_ipmi_bt_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, + { TYPE_ACPI_DEV_AML_IF }, { } } }; diff --git a/hw/ipmi/isa_ipmi_kcs.c b/hw/ipmi/isa_ipmi_kcs.c index afabb95ebe..b2ed70b9da 100644 --- a/hw/ipmi/isa_ipmi_kcs.c +++ b/hw/ipmi/isa_ipmi_kcs.c @@ -31,6 +31,7 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "hw/acpi/ipmi.h" #define TYPE_ISA_IPMI_KCS "isa-ipmi-kcs" OBJECT_DECLARE_SIMPLE_TYPE(ISAIPMIKCSDevice, ISA_IPMI_KCS) @@ -151,6 +152,7 @@ static void isa_ipmi_kcs_class_init(ObjectClass *oc, void *data) { DeviceClass *dc = DEVICE_CLASS(oc); IPMIInterfaceClass *iic = IPMI_INTERFACE_CLASS(oc); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(oc); dc->realize = ipmi_isa_realize; device_class_set_props(dc, ipmi_isa_properties); @@ -158,6 +160,7 @@ static void isa_ipmi_kcs_class_init(ObjectClass *oc, void *data) iic->get_backend_data = isa_ipmi_kcs_get_backend_data; ipmi_kcs_class_init(iic); iic->get_fwinfo = isa_ipmi_kcs_get_fwinfo; + adevc->build_dev_aml = build_ipmi_dev_aml; } static const TypeInfo isa_ipmi_kcs_info = { @@ -168,6 +171,7 @@ static const TypeInfo isa_ipmi_kcs_info = { .class_init = isa_ipmi_kcs_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, + { TYPE_ACPI_DEV_AML_IF }, { } } }; diff --git a/hw/ipmi/smbus_ipmi.c b/hw/ipmi/smbus_ipmi.c index 1fdf0a66b6..9ef9112dd5 100644 --- a/hw/ipmi/smbus_ipmi.c +++ b/hw/ipmi/smbus_ipmi.c @@ -28,6 +28,7 @@ #include "qemu/error-report.h" #include "hw/ipmi/ipmi.h" #include "qom/object.h" +#include "hw/acpi/ipmi.h" #define TYPE_SMBUS_IPMI "smbus-ipmi" OBJECT_DECLARE_SIMPLE_TYPE(SMBusIPMIDevice, SMBUS_IPMI) @@ -353,6 +354,7 @@ static void smbus_ipmi_class_init(ObjectClass *oc, void *data) DeviceClass *dc = DEVICE_CLASS(oc); IPMIInterfaceClass *iic = IPMI_INTERFACE_CLASS(oc); SMBusDeviceClass *sc = SMBUS_DEVICE_CLASS(oc); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(oc); sc->receive_byte = ipmi_receive_byte; sc->write_data = ipmi_write_data; @@ -363,6 +365,7 @@ static void smbus_ipmi_class_init(ObjectClass *oc, void *data) iic->handle_if_event = smbus_ipmi_handle_event; iic->set_irq_enable = smbus_ipmi_set_irq_enable; iic->get_fwinfo = smbus_ipmi_get_fwinfo; + adevc->build_dev_aml = build_ipmi_dev_aml; } static const TypeInfo smbus_ipmi_info = { @@ -373,6 +376,7 @@ static const TypeInfo smbus_ipmi_info = { .class_init = smbus_ipmi_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_IPMI_INTERFACE }, + { TYPE_ACPI_DEV_AML_IF }, { } } }; From patchwork Fri Jun 10 07:57:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=giQxgK99; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDR624FCz9s5V for ; Fri, 10 Jun 2022 18:20:02 +1000 (AEST) Received: from localhost ([::1]:55428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZs8-00007W-3s for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:20:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWp-0007et-G8 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:59 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:42457) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWo-0006Gj-0F for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:57:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847877; 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=elXeHLdFU6qNWf0ObjOjZw2aP+XfpSSnsKrXOEKW7ZU=; b=giQxgK99SyxH2d3ILW8GlrbAnwhweXSrKNCTavGWVi/j2c1dN4dXS/80h/efZae3n3dakO HQeFdRi4VXd8uE+6+IxlyY9aEMED5wzBtaDVWJw94e/GfIn0QhGcItiOYfZOIMlLUTKUZ9 oyPdVsU5SuwgDdHKwJYtxkY5E/ym7aw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-541-4zFKAB-8O7esUTtqRSeJAQ-1; Fri, 10 Jun 2022 03:57:56 -0400 X-MC-Unique: 4zFKAB-8O7esUTtqRSeJAQ-1 Received: by mail-wm1-f72.google.com with SMTP id bg40-20020a05600c3ca800b00394779649b1so947131wmb.3 for ; Fri, 10 Jun 2022 00:57:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=elXeHLdFU6qNWf0ObjOjZw2aP+XfpSSnsKrXOEKW7ZU=; b=OefhGtZcGSFXDLA6A1CwpO2Aw9mX+Hp8Y7rtEimAWFSzg56ex0Lxrk3GyV76e6pyVM lCpcqA549WdMXd6X4R09q3uv2cpAY+NGzONrYlGTtUpKrIANbxpaHqiduUcIz94KUYd9 CtyDzo1Ev45ptRxreefbmDfx9Amlpds1YxGj4eyejowzuMpkdwKnpVIRpYuraRLsukfQ cIXWIUMEzHqNv//NAvlxVf33C0/DKw6W57zGyLdfKI4OLSWewveoWiAAheNNxyOyhMtV IH32wVdkZbWOQLBH9INzkMgZs2atKM7ADTBpX3K4nKfqe2GLTpvn6NT+dpnGrIo7xVHf 4Btg== X-Gm-Message-State: AOAM530yN9YOHhbbY5cwqGvcsPJ/XRv70XP9i2puBHM4SXGGQ3Vomd4W EN6givrYLSqawhFUgDfnnjNZ9ZqVPfvxEYKC95Y/82TZNLHgXDXV81M/rEVt01S2wGO0wkJhx/8 8v7kXZIQ8W5FC+OT5UvhFrzQ0QlnbJmVAaB22K/tsxZmeDhh2xIUGyvp8H90o X-Received: by 2002:a7b:c1cf:0:b0:39c:4460:cfa8 with SMTP id a15-20020a7bc1cf000000b0039c4460cfa8mr7348552wmj.21.1654847874915; Fri, 10 Jun 2022 00:57:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUD5IaHiCl3DF+c3vNqFiioUGF2n2SpXLyjNbnukWse+bxnRMrx5eyj8qJbGEI/j7Hr0SEjQ== X-Received: by 2002:a7b:c1cf:0:b0:39c:4460:cfa8 with SMTP id a15-20020a7bc1cf000000b0039c4460cfa8mr7348526wmj.21.1654847874645; Fri, 10 Jun 2022 00:57:54 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id b11-20020a5d4d8b000000b0020c7ec0fdf4sm31174293wru.117.2022.06.10.00.57.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:54 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:51 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 17/54] q35: acpi: drop not needed PCMachineClass::do_not_add_smb_acpi Message-ID: <20220610075631.367501-18-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov by default we do not version ACPI AML as it's considered a part of firmware. Drop do_not_add_smb_acpi that blocked SMBUS AML description on 3.1 and older machine types without providing justification. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-18-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 2 +- hw/i386/pc_piix.c | 1 - hw/i386/pc_q35.c | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index ffcac5121e..dee38cfac4 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -104,7 +104,6 @@ struct PCMachineClass { bool rsdp_in_ram; int legacy_acpi_table_size; unsigned acpi_data_size; - bool do_not_add_smb_acpi; int pci_root_uid; /* SMBIOS compat: */ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 5b963cca32..d943354999 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1530,7 +1530,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); } build_q35_pci0_int(dsdt); - if (pcms->smbus && !pcmc->do_not_add_smb_acpi) { + if (pcms->smbus) { build_smb0(dsdt, ICH9_SMB_DEV, ICH9_SMB_FUNC); } } diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 578e537b35..7f777f7aed 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -564,7 +564,6 @@ static void pc_i440fx_3_1_machine_options(MachineClass *m) pc_i440fx_4_0_machine_options(m); m->is_default = false; - pcmc->do_not_add_smb_acpi = true; m->smbus_no_migration_support = true; m->alias = NULL; pcmc->pvh_enabled = false; diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 42eb8b9707..f96cbd04e2 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -514,7 +514,6 @@ static void pc_q35_3_1_machine_options(MachineClass *m) pc_q35_4_0_machine_options(m); m->default_kernel_irqchip_split = false; - pcmc->do_not_add_smb_acpi = true; m->smbus_no_migration_support = true; m->alias = NULL; pcmc->pvh_enabled = false; From patchwork Fri Jun 10 07:57:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641691 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NWJZAizV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDb23ptZz9s09 for ; Fri, 10 Jun 2022 18:26:53 +1000 (AEST) Received: from localhost ([::1]:35342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZyi-0006PS-W1 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:26:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWs-0007ou-29 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWq-0006Gz-Id for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847880; 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=UGM7Pha2fbz/FtClJTsCx1egAuOz3u50vfg5WpAXg6U=; b=NWJZAizVKFvZcuSrHlyYJFi7KOL6P5upBzNxWwfanaqapy4ABquWe7nQcJuVJrXIzD3Kqk DLZwI5CJNBslHX9WVjL6svsqrueIoQbRh0w6yWc7prF22O8CNg3IEYSMBeLQzZzhbymdP+ pzHjfiXacGqZP7IcN2QPEzTcbw4IsvQ= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-299-bBfJ6sDqNDaTkKAX4oMvxg-1; Fri, 10 Jun 2022 03:57:59 -0400 X-MC-Unique: bBfJ6sDqNDaTkKAX4oMvxg-1 Received: by mail-wm1-f69.google.com with SMTP id k16-20020a7bc310000000b0038e6cf00439so977589wmj.0 for ; Fri, 10 Jun 2022 00:57:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=UGM7Pha2fbz/FtClJTsCx1egAuOz3u50vfg5WpAXg6U=; b=hVjBj46BAf0zPCD/BBhQek7gU21jNVioOSeK8BvxDIUtchGH/S+OTmCFLq5V2TFucz hkm8S+5F85Cqvi5ist6K3yBTXXp4O/D99enkL7MESNer5ejO5pGyvJOUdq0rYOOfud1D HVsCo4PdUsSw/xJB6bH91wRJyw6Oz4WS2gzY/SroWFGq/UOnZ+4XiiNLOQtlRJH570YM DrollbmVAVpJXDgl/h3eatvGO0rm/TIf5tCnOp5aqE+jfIMwPsLYkVy1DktK3iTNhcPE dMBaB345Jh/b+Nz/ZokxEryuYV5pF2xwlmrXtTEza3KrOTLzuRW/axo2ONchPl6CCppN oeuw== X-Gm-Message-State: AOAM531+NHes62eVfp5/D8GeSV5h2mEOMkjZVWxDxKCb8RET0QKpbk6D vYPfyFjJIOsJQClYhkm55gKIdSBlDiUn6Hkhj7iF4QILVMdOOM38pT+a90u/1+qs3VRLQgqReSE CYzsl6ClNLhcD0XPusxErqcv8xcl9P5Zad53Q78V4mOmCrVtoe3z4Z0RqgdPB X-Received: by 2002:a1c:19c3:0:b0:39c:6479:3ca with SMTP id 186-20020a1c19c3000000b0039c647903camr7518056wmz.27.1654847877530; Fri, 10 Jun 2022 00:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsavnxbZBvIHIa05XU2d9nWIn1zTHGqa/+mtEhkJwS7XwHXVvbptZ9RsAyU7ji8ZYjpSmk1A== X-Received: by 2002:a1c:19c3:0:b0:39c:6479:3ca with SMTP id 186-20020a1c19c3000000b0039c647903camr7518035wmz.27.1654847877298; Fri, 10 Jun 2022 00:57:57 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id i20-20020a1c5414000000b0039c41686421sm2048491wmb.17.2022.06.10.00.57.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:57:56 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:54 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 18/54] tests: acpi: white-list to be re-factored pc/q35 DSDT Message-ID: <20220610075631.367501-19-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20220609114855.3477822-1-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 32 +++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..666e257bf9 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,33 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/pc/DSDT", +"tests/data/acpi/pc/DSDT.acpierst", +"tests/data/acpi/pc/DSDT.acpihmat", +"tests/data/acpi/pc/DSDT.bridge", +"tests/data/acpi/pc/DSDT.cphp", +"tests/data/acpi/pc/DSDT.dimmpxm", +"tests/data/acpi/pc/DSDT.hpbridge", +"tests/data/acpi/pc/DSDT.ipmikcs", +"tests/data/acpi/pc/DSDT.memhp", +"tests/data/acpi/pc/DSDT.nohpet", +"tests/data/acpi/pc/DSDT.numamem", +"tests/data/acpi/pc/DSDT.roothp", +"tests/data/acpi/pc/DSDT.hpbrroot", +"tests/data/acpi/q35/DSDT", +"tests/data/acpi/q35/DSDT.acpierst", +"tests/data/acpi/q35/DSDT.acpihmat", +"tests/data/acpi/q35/DSDT.bridge", +"tests/data/acpi/q35/DSDT.cphp", +"tests/data/acpi/q35/DSDT.dimmpxm", +"tests/data/acpi/q35/DSDT.ipmibt", +"tests/data/acpi/q35/DSDT.ivrs", +"tests/data/acpi/q35/DSDT.memhp", +"tests/data/acpi/q35/DSDT.mmio64", +"tests/data/acpi/q35/DSDT.multi-bridge", +"tests/data/acpi/q35/DSDT.nohpet", +"tests/data/acpi/q35/DSDT.numamem", +"tests/data/acpi/q35/DSDT.tis.tpm12", +"tests/data/acpi/q35/DSDT.tis.tpm2", +"tests/data/acpi/q35/DSDT.viot", +"tests/data/acpi/q35/DSDT.xapic", +"tests/data/acpi/q35/DSDT.ipmismbus", +"tests/data/acpi/q35/DSDT.cxl", From patchwork Fri Jun 10 07:57:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641722 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=P/TtKWuG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDn74vXnz9s09 for ; Fri, 10 Jun 2022 18:35:39 +1000 (AEST) Received: from localhost ([::1]:46294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nza7F-0006ZI-Mj for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:35:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWw-00081r-JA for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:06 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWt-0006HG-T4 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847883; 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=ad/ttkr30vhbvvPoMvjHQNCv9unFN+kAKCHcdVGXlJA=; b=P/TtKWuGS1QeCStcEM/HkPlQn5YLCnXIKF4Chb4ZBlYJ5yieKrG0S7UjXWwCDs7cU3sdtK TfqhiP0CNZAnl/jp7bS0unVPg3KIMFsSX1zJaVDEWi/zRcDcbMJzQK+DwGVHCYvqcKHXcK AOU5O73GCgF4j0ePuMLipsjSKVxO4pM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-537-iWh4J37ZOtywbxiw59Kbtw-1; Fri, 10 Jun 2022 03:58:02 -0400 X-MC-Unique: iWh4J37ZOtywbxiw59Kbtw-1 Received: by mail-wm1-f70.google.com with SMTP id c187-20020a1c35c4000000b003970013833aso9328279wma.1 for ; Fri, 10 Jun 2022 00:58:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ad/ttkr30vhbvvPoMvjHQNCv9unFN+kAKCHcdVGXlJA=; b=EJ3zRoS6PBqFVTsBEKyg7eD058hJ9PUV+DIgW6RyEhvr3x+cLdwpMmBR/6oujIM+wO 3cq7Ifvox5WzEaXPWTYja23uBHX3YKylfgNuqx6B9l7cptkjLFc783I1d/ULEkL4neKn 1Yqg+W5u4xOr+lrCl5fpUjNa/HK2xIZh2+5Id1U346XRVEt4qeWNgYly8R09Vr1ZRAY8 Cwk9Qy6EAERkwNWat+yBAF3PaFnco9zIigqSGSdhAvvaMVBnqVmdd1K8PcuAvQwnze1H r+6F5YNDJgPMQqUBZ/3RtR915fkG2MEK+Drwr1G9zkVaYg0TmLAugpie1BXOk2reT3MJ UYmw== X-Gm-Message-State: AOAM533/aj2+cUzGBqxWbnqfhJbNB8cXA1KOXcnldNTuybbR+FuIPIIv WFtlRL4pl3+bZ8ze2HDVp5yDpK02Xt7GokJNvQBJgyPndnEVqmD5/a+C9VncRjBiOj10S+HpIkv WBZqfdlLj9+2aVCMPB4EztUHpRTtx98id0mmV1QDyDKq8gcxC6scraaBOM7L/ X-Received: by 2002:adf:eb91:0:b0:20f:fcc2:475c with SMTP id t17-20020adfeb91000000b0020ffcc2475cmr42414708wrn.40.1654847880757; Fri, 10 Jun 2022 00:58:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRGIO0jLskMJl3xzxtNT1KMsmwPlD6gCXNGadEy7jn8Ph2tB65iLVMFTnnCU/533Mi0OAALg== X-Received: by 2002:adf:eb91:0:b0:20f:fcc2:475c with SMTP id t17-20020adfeb91000000b0020ffcc2475cmr42414684wrn.40.1654847880491; Fri, 10 Jun 2022 00:58:00 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id q16-20020adfcd90000000b00213abce60e4sm22640446wrj.111.2022.06.10.00.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:00 -0700 (PDT) Date: Fri, 10 Jun 2022 03:57:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 19/54] acpi: pc: isa bridge: use AcpiDevAmlIf interface to build ISA device descriptors Message-ID: <20220610075631.367501-20-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov replaces ad-hoc build_isa_devices_aml() with generic AcpiDevAmlIf way to build bridge AML including all devices that are attached to its ISA bus. Later when PCI is converted to AcpiDevAmlIf, build_piix4_isa_bridge() will also be dropped since PCI parts itself will take care of building device prologue/epilogue AML for each enumerated PCI device. Expected AML change is contextual, where ISA devices are moved from separately declared _SB.PCI0.ISA scope , directly under Device(ISA) node. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-20-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 16 +++++++++++----- hw/isa/piix3.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index d943354999..f903f30b7e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1280,15 +1280,22 @@ static void build_piix4_isa_bridge(Aml *table) { Aml *dev; Aml *scope; + Object *obj; + bool ambiguous; + + /* + * temporarily fish out isa bridge, build_piix4_isa_bridge() will be dropped + * once PCI is converted to AcpiDevAmlIf and would be ble to generate + * AML for bridge itself + */ + obj = object_resolve_path_type("", TYPE_PIIX3_PCI_DEVICE, &ambiguous); + assert(obj && !ambiguous); scope = aml_scope("_SB.PCI0"); dev = aml_device("ISA"); aml_append(dev, aml_name_decl("_ADR", aml_int(0x00010000))); - /* PIIX PCI to ISA irq remapping */ - aml_append(dev, aml_operation_region("P40C", AML_PCI_CONFIG, - aml_int(0x60), 0x04)); - + call_dev_aml_func(DEVICE(obj), dev); aml_append(scope, dev); aml_append(table, scope); } @@ -1476,7 +1483,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_hpet_aml(dsdt); } build_piix4_isa_bridge(dsdt); - build_isa_devices_aml(dsdt); if (pm->pcihp_bridge_en || pm->pcihp_root_en) { build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); } diff --git a/hw/isa/piix3.c b/hw/isa/piix3.c index dab901c9ad..bfccd666d4 100644 --- a/hw/isa/piix3.c +++ b/hw/isa/piix3.c @@ -32,6 +32,7 @@ #include "sysemu/reset.h" #include "sysemu/runstate.h" #include "migration/vmstate.h" +#include "hw/acpi/acpi_aml_interface.h" #define XEN_PIIX_NUM_PIRQS 128ULL @@ -286,10 +287,24 @@ static void piix3_realize(PCIDevice *dev, Error **errp) qemu_register_reset(piix3_reset, d); } +static void build_pci_isa_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + BusChild *kid; + BusState *bus = qdev_get_child_bus(DEVICE(adev), "isa.0"); + + /* PIIX PCI to ISA irq remapping */ + aml_append(scope, aml_operation_region("P40C", AML_PCI_CONFIG, + aml_int(0x60), 0x04)); + QTAILQ_FOREACH(kid, &bus->children, sibling) { + call_dev_aml_func(DEVICE(kid->child), scope); + } +} + static void pci_piix3_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix3; @@ -304,6 +319,7 @@ static void pci_piix3_class_init(ObjectClass *klass, void *data) * pc_piix.c's pc_init1() */ dc->user_creatable = false; + adevc->build_dev_aml = build_pci_isa_aml; } static const TypeInfo piix3_pci_type_info = { @@ -314,6 +330,7 @@ static const TypeInfo piix3_pci_type_info = { .class_init = pci_piix3_class_init, .interfaces = (InterfaceInfo[]) { { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { TYPE_ACPI_DEV_AML_IF }, { }, }, }; From patchwork Fri Jun 10 07:58:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641692 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bdkSbobx; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDb50L9gz9s09 for ; Fri, 10 Jun 2022 18:26:57 +1000 (AEST) Received: from localhost ([::1]:35518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzZyp-0006Y5-2j for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:26:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35332) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWz-0008Ch-Kj for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:40443) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZWx-0006Ha-RN for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847887; 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=HPYlZOhqsatfUI8giIrHn+a9jLbBfO9Bc7trMdQLAzE=; b=bdkSbobxX8MkUyl3le1wQKsuv3grGgtm+iFzGkUkN+1bCNpRlUiGON1+8jkE3fV2kB02Qu Efewkd+3OLJiaWZioNxfZ8vle6yLTSX0oFZksu6JOhq7FGzsBJiw2rbrIQVLLcKrjybxiK OLCdHd/s2R+S+qMzUSIfAozwr9rE/QM= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-172-1bgbhPsjNUSDEzf9NZInGA-1; Fri, 10 Jun 2022 03:58:05 -0400 X-MC-Unique: 1bgbhPsjNUSDEzf9NZInGA-1 Received: by mail-wr1-f71.google.com with SMTP id bv8-20020a0560001f0800b002183c5d5c26so3827885wrb.20 for ; Fri, 10 Jun 2022 00:58:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=HPYlZOhqsatfUI8giIrHn+a9jLbBfO9Bc7trMdQLAzE=; b=eQAEzJGDKw1/SmhWSi8BwOz1mEjwKsfaRCxARsy886xmP5ltEn44AA+fjDYauYjxWO CKokJVpafeCSm+3t4N/jRiXhiE4h1aKrt7P40EKFTjHy9SlqeFQk3WHBrjUDA/sS2MU/ i3My64CxxxBvm8eBoTFwzxlWm/ifQFLpJ2efmElmdfd3J2/v2ELsUE1XXjQie+3GCsh4 ZXCquAZfJUdASrMV2fYgKMSgeebcCJZFXgEnnG5E4PaUB86VrXrbYB7zgxSuu8khjfdn e13Sz6eZ3M7SaQf1X7oavf1XCbgdvzE/21m2sgyotOI1hVychvyS/cVhGoG4/JTrnqzV grWQ== X-Gm-Message-State: AOAM533b5W32lmok57sO1mdpUfSOcQogGAYP9GdQ77iM49h6Tfq/K3Z6 5JA/qgJ0wKLCF2x38We/ENvKtxh/pL6yQvlJ/J1JRLylgxEbubTLyqaPYdZjOs0TkXQDct6xEq4 bcr8dLvYRdWccB7UvU3CckVJoXsfNUJ4ZAWnRdNf5E+D/zSIn0TqzlO1iCYSw X-Received: by 2002:a5d:678d:0:b0:210:2f33:4399 with SMTP id v13-20020a5d678d000000b002102f334399mr42133036wru.599.1654847883977; Fri, 10 Jun 2022 00:58:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHnYBPJB8zzhKrrdb+QkIJl/yhqq5hivcp/MqmCjmX4D2veOFd3G8Y9W5iz3AMjYsNkOhHYg== X-Received: by 2002:a5d:678d:0:b0:210:2f33:4399 with SMTP id v13-20020a5d678d000000b002102f334399mr42133002wru.599.1654847883597; Fri, 10 Jun 2022 00:58:03 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id 2-20020a05600c228200b0039482d95ab7sm1992724wmf.24.2022.06.10.00.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:03 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 20/54] acpi: q35: isa bridge: use AcpiDevAmlIf interface to build ISA device descriptors Message-ID: <20220610075631.367501-21-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov replaces adhoc build_isa_devices_aml() with generic AcpiDevAmlIf way to build bridge AML including all devices that are attached to its ISA bus. Later when PCI is converted to AcpiDevAmlIf, build_q35_isa_bridge() will also be dropped since PCI parts itself will take care of building device prologue/epilogue AML for each enumerated PCI device. Expected AML change is contextual, where ISA devices are moved from separately declared _SB.PCI0.ISA scope, directly under Device(ISA) node. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-21-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 30 +++++++++++------------------- hw/isa/lpc_ich9.c | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f903f30b7e..f7f1671407 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -864,20 +864,6 @@ static Aml *build_vmbus_device_aml(VMBusBridge *vmbus_bridge) return dev; } -static void build_isa_devices_aml(Aml *table) -{ - bool ambiguous; - Object *obj = object_resolve_path_type("", TYPE_ISA_BUS, &ambiguous); - Aml *scope; - - assert(obj && !ambiguous); - - scope = aml_scope("_SB.PCI0.ISA"); - isa_build_aml(ISA_BUS(obj), scope); - - aml_append(table, scope); -} - static void build_dbg_aml(Aml *table) { Aml *field; @@ -1263,15 +1249,22 @@ static void build_q35_isa_bridge(Aml *table) { Aml *dev; Aml *scope; + Object *obj; + bool ambiguous; + + /* + * temporarily fish out isa bridge, build_q35_isa_bridge() will be dropped + * once PCI is converted to AcpiDevAmlIf and would be ble to generate + * AML for bridge itself + */ + obj = object_resolve_path_type("", TYPE_ICH9_LPC_DEVICE, &ambiguous); + assert(obj && !ambiguous); scope = aml_scope("_SB.PCI0"); dev = aml_device("ISA"); aml_append(dev, aml_name_decl("_ADR", aml_int(0x001F0000))); - /* ICH9 PCI to ISA irq remapping */ - aml_append(dev, aml_operation_region("PIRQ", AML_PCI_CONFIG, - aml_int(0x60), 0x0C)); - + call_dev_aml_func(DEVICE(obj), dev); aml_append(scope, dev); aml_append(table, scope); } @@ -1531,7 +1524,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, build_hpet_aml(dsdt); } build_q35_isa_bridge(dsdt); - build_isa_devices_aml(dsdt); if (pm->pcihp_bridge_en) { build_x86_acpi_pci_hotplug(dsdt, pm->pcihp_io_base); } diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 5f143dca17..4553b5925b 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -50,6 +50,7 @@ #include "hw/core/cpu.h" #include "hw/nvram/fw_cfg.h" #include "qemu/cutils.h" +#include "hw/acpi/acpi_aml_interface.h" /*****************************************************************************/ /* ICH9 LPC PCI to ISA bridge */ @@ -803,12 +804,28 @@ static void ich9_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) acpi_send_gpe_event(&s->pm.acpi_regs, s->pm.irq, ev); } +static void build_ich9_isa_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + BusChild *kid; + ICH9LPCState *s = ICH9_LPC_DEVICE(adev); + BusState *bus = BUS(s->isa_bus); + + /* ICH9 PCI to ISA irq remapping */ + aml_append(scope, aml_operation_region("PIRQ", AML_PCI_CONFIG, + aml_int(0x60), 0x0C)); + + QTAILQ_FOREACH(kid, &bus->children, sibling) { + call_dev_aml_func(DEVICE(kid->child), scope); + } +} + static void ich9_lpc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(klass); AcpiDeviceIfClass *adevc = ACPI_DEVICE_IF_CLASS(klass); + AcpiDevAmlIfClass *amldevc = ACPI_DEV_AML_IF_CLASS(klass); set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->reset = ich9_lpc_reset; @@ -833,6 +850,7 @@ static void ich9_lpc_class_init(ObjectClass *klass, void *data) adevc->ospm_status = ich9_pm_ospm_status; adevc->send_event = ich9_send_gpe; adevc->madt_cpu = pc_madt_cpu_entry; + amldevc->build_dev_aml = build_ich9_isa_aml; } static const TypeInfo ich9_lpc_info = { @@ -845,6 +863,7 @@ static const TypeInfo ich9_lpc_info = { { TYPE_HOTPLUG_HANDLER }, { TYPE_ACPI_DEVICE_IF }, { INTERFACE_CONVENTIONAL_PCI_DEVICE }, + { TYPE_ACPI_DEV_AML_IF }, { } } }; From patchwork Fri Jun 10 07:58:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641726 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=PAtLAVK1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDxM1V42z9s09 for ; Fri, 10 Jun 2022 18:42:47 +1000 (AEST) Received: from localhost ([::1]:54706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaE8-0003yx-N1 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:42:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZX4-0008NN-B5 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZX1-0006Hl-6h for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847890; 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=8KKBC9nNN5tlC4RMSb9dXu1O8QL+WkdkTUPuzpTQNUE=; b=PAtLAVK1e6doVBE155/8RxvtAF7Bgupt0Kz/9ZL9oNNojNz103m9um99wTmYfMcdg1E3AV ed83ylNo0mjPXj4EXQOYYsqksAA3zLhwYUslgXVgGwNqR0PeH5v2rodqCy/wWkCNFnNy9T gR841bYWpsyZTU2BhHsJ3wTIrw6VcLk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-136-W9vnmILcMtCp6_2kFXY7uA-1; Fri, 10 Jun 2022 03:58:09 -0400 X-MC-Unique: W9vnmILcMtCp6_2kFXY7uA-1 Received: by mail-wm1-f70.google.com with SMTP id p42-20020a05600c1daa00b0039c62488f7eso936040wms.7 for ; Fri, 10 Jun 2022 00:58:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8KKBC9nNN5tlC4RMSb9dXu1O8QL+WkdkTUPuzpTQNUE=; b=YhKlo4ges3NOoB1qu1zhlrNoqMYHz9pnXg+wR+V5kAzwaC88tcJbvqJnNGrGFhOhMb O9lkNQPETzVz5BPOKHSQnjPiBGFEgqcAg1qKPWp0JKAIuXPJPvGwSFPF3E13H5krLW0N gDNZlwrQDbG+s2iIUO1IBgDUyTspXcAcZlEdQSg0tSnzrdwA6lnFpKlZVGrMXZjkZ5A8 8nL0q6yZayjO+9yqSPLP8OzAg13Ca28bEPmwgWGNjpX7qJDSCsYWtM2ztrlKGZ3/hZ7D WCcF+eV9bC7/CEadqQveA5kjGt7Ac+StFU72qG8RO8UKn8df9jQ1+xDbgiDhRnkhUqi1 cfHQ== X-Gm-Message-State: AOAM530AngoFGv8mg1HMKgDCUCycc8fa4ScDGASf2MYTIJUoLyo3uszb W3CUxcObBY1YCHGUPF7/elzze5dF5gXgojahHU/qflBNiskljkLKzBD9WRTDFe0i8T/26TFtOC6 mEsjtf3DqvjNhDK9BLGDB0Ka4WavIheeCTZXy+nkVSQ1QDidhTRP1nm68NffG X-Received: by 2002:adf:eacb:0:b0:217:dd5:445f with SMTP id o11-20020adfeacb000000b002170dd5445fmr29597436wrn.359.1654847887272; Fri, 10 Jun 2022 00:58:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzVWJyTaLJ+V0JjvIXvmsJF1J+9+39J8G13XS7oAZSl6Yx2DWOPKPNfneOWngE3Ozv31cVHg== X-Received: by 2002:adf:eacb:0:b0:217:dd5:445f with SMTP id o11-20020adfeacb000000b002170dd5445fmr29597394wrn.359.1654847886734; Fri, 10 Jun 2022 00:58:06 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l37-20020a05600c1d2500b0039c5497deccsm6963786wms.1.2022.06.10.00.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:06 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 21/54] tests: acpi: update expected blobs Message-ID: <20220610075631.367501-22-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Expected AML change: ISA devices under separate _SB.PCI0.ISA scope are moved directly under Device(ISA) node. Example from PC machine, and q35 have similar changes: { Name (_ADR, 0x00010000) // _ADR: Address OperationRegion (P40C, PCI_Config, 0x60, 0x04) - } - } - - Scope (_SB.PCI0.ISA) - { - Device (KBD) - { - Name (_HID, EisaId ("PNP0303") /* IBM Enhanced Keyboard (101/102-key, PS/2 Mouse) */) // _HID: Hardware ID - Name (_STA, 0x0F) // _STA: Status - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + Device (KBD) { - IO (Decode16, - 0x0060, // Range Minimum - 0x0060, // Range Maximum - 0x01, // Alignment - 0x01, // Length - ) - IO (Decode16, - 0x0064, // Range Minimum - 0x0064, // Range Maximum - 0x01, // Alignment - 0x01, // Length - ) - IRQNoFlags () - {1} - }) - } - - Device (MOU) - { - Name (_HID, EisaId ("PNP0F13") /* PS/2 Mouse */) // _HID: Hardware ID - Name (_STA, 0x0F) // _STA: Status - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings - { - IRQNoFlags () - {12} - }) - } + Name (_HID, EisaId ("PNP0303") /* IBM Enhanced Keyboard (101/102-key, PS/2 Mouse) */) // _HID: Hardware ID + Name (_STA, 0x0F) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0060, // Range Minimum + 0x0060, // Range Maximum + 0x01, // Alignment + 0x01, // Length + ) + IO (Decode16, + 0x0064, // Range Minimum + 0x0064, // Range Maximum + 0x01, // Alignment + 0x01, // Length + ) + IRQNoFlags () + {1} + }) + } - Device (FDC0) - { - Name (_HID, EisaId ("PNP0700")) // _HID: Hardware ID - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings - { - IO (Decode16, - 0x03F2, // Range Minimum - 0x03F2, // Range Maximum - 0x00, // Alignment - 0x04, // Length - ) - IO (Decode16, - 0x03F7, // Range Minimum - 0x03F7, // Range Maximum - 0x00, // Alignment - 0x01, // Length - ) - IRQNoFlags () - {6} - DMA (Compatibility, NotBusMaster, Transfer8, ) - {2} - }) - Device (FLPA) + Device (MOU) { - Name (_ADR, Zero) // _ADR: Address - Name (_FDI, Package (0x10) // _FDI: Floppy Drive Information + Name (_HID, EisaId ("PNP0F13") /* PS/2 Mouse */) // _HID: Hardware ID + Name (_STA, 0x0F) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings { - Zero, - 0x05, - 0x4F, - 0x30, - One, - 0xAF, - 0x02, - 0x25, - 0x02, - 0x12, - 0x1B, - 0xFF, - 0x6C, - 0xF6, - 0x0F, - 0x08 + IRQNoFlags () + {12} }) } - Name (_FDE, Buffer (0x14) // _FDE: Floppy Disk Enumerate + Device (FDC0) { - /* 0000 */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ - /* 0010 */ 0x02, 0x00, 0x00, 0x00 // .... - }) - } + Name (_HID, EisaId ("PNP0700")) // _HID: Hardware ID + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x03F2, // Range Minimum + 0x03F2, // Range Maximum + 0x00, // Alignment + 0x04, // Length + ) + IO (Decode16, + 0x03F7, // Range Minimum + 0x03F7, // Range Maximum + 0x00, // Alignment + 0x01, // Length + ) + IRQNoFlags () + {6} + DMA (Compatibility, NotBusMaster, Transfer8, ) + {2} + }) + Device (FLPA) + { + Name (_ADR, Zero) // _ADR: Address + Name (_FDI, Package (0x10) // _FDI: Floppy Drive Information + { + Zero, + 0x05, + 0x4F, + 0x30, + One, + 0xAF, + 0x02, + 0x25, + 0x02, + 0x12, + 0x1B, + 0xFF, + 0x6C, + 0xF6, + 0x0F, + 0x08 + }) + } - Device (LPT1) - { - Name (_HID, EisaId ("PNP0400") /* Standard LPT Parallel Port */) // _HID: Hardware ID - Name (_UID, One) // _UID: Unique ID - Name (_STA, 0x0F) // _STA: Status - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + Name (_FDE, Buffer (0x14) // _FDE: Floppy Disk Enumerate + { + /* 0000 */ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ + /* 0008 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ........ + /* 0010 */ 0x02, 0x00, 0x00, 0x00 // .... + }) + } + + Device (LPT1) { - IO (Decode16, - 0x0378, // Range Minimum - 0x0378, // Range Maximum - 0x08, // Alignment - 0x08, // Length - ) - IRQNoFlags () - {7} - }) - } + Name (_HID, EisaId ("PNP0400") /* Standard LPT Parallel Port */) // _HID: Hardware ID + Name (_UID, One) // _UID: Unique ID + Name (_STA, 0x0F) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0378, // Range Minimum + 0x0378, // Range Maximum + 0x08, // Alignment + 0x08, // Length + ) + IRQNoFlags () + {7} + }) + } - Device (COM1) - { - Name (_HID, EisaId ("PNP0501") /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID - Name (_UID, One) // _UID: Unique ID - Name (_STA, 0x0F) // _STA: Status - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + Device (COM1) { - IO (Decode16, - 0x03F8, // Range Minimum - 0x03F8, // Range Maximum - 0x00, // Alignment - 0x08, // Length - ) - IRQNoFlags () - {4} - }) - } + Name (_HID, EisaId ("PNP0501") /* 16550A-compatible COM Serial Port */) // _HID: Hardware ID + Name (_UID, One) // _UID: Unique ID + Name (_STA, 0x0F) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x03F8, // Range Minimum + 0x03F8, // Range Maximum + 0x00, // Alignment + 0x08, // Length + ) + IRQNoFlags () + {4} + }) + } - Device (RTC) - { - Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */) // _HID: Hardware ID - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + Device (RTC) { - IO (Decode16, - 0x0070, // Range Minimum - 0x0070, // Range Maximum - 0x01, // Alignment - 0x08, // Length - ) - IRQNoFlags () - {8} - }) + Name (_HID, EisaId ("PNP0B00") /* AT Real-Time Clock */) // _HID: Hardware ID + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0070, // Range Minimum + 0x0070, // Range Maximum + 0x01, // Alignment + 0x08, // Length + ) + IRQNoFlags () + {8} + }) + } } } Signed-off-by: Igor Mammedov Message-Id: <20220609115113.3478093-1-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 32 -------------------- tests/data/acpi/pc/DSDT | Bin 6002 -> 5987 bytes tests/data/acpi/pc/DSDT.acpierst | Bin 5969 -> 5954 bytes tests/data/acpi/pc/DSDT.acpihmat | Bin 7327 -> 7312 bytes tests/data/acpi/pc/DSDT.bridge | Bin 8668 -> 8653 bytes tests/data/acpi/pc/DSDT.cphp | Bin 6466 -> 6451 bytes tests/data/acpi/pc/DSDT.dimmpxm | Bin 7656 -> 7641 bytes tests/data/acpi/pc/DSDT.hpbridge | Bin 5969 -> 5954 bytes tests/data/acpi/pc/DSDT.hpbrroot | Bin 3084 -> 3069 bytes tests/data/acpi/pc/DSDT.ipmikcs | Bin 6074 -> 6059 bytes tests/data/acpi/pc/DSDT.memhp | Bin 7361 -> 7346 bytes tests/data/acpi/pc/DSDT.nohpet | Bin 5860 -> 5845 bytes tests/data/acpi/pc/DSDT.numamem | Bin 6008 -> 5993 bytes tests/data/acpi/pc/DSDT.roothp | Bin 6210 -> 6195 bytes tests/data/acpi/q35/DSDT | Bin 8289 -> 8274 bytes tests/data/acpi/q35/DSDT.acpierst | Bin 8306 -> 8291 bytes tests/data/acpi/q35/DSDT.acpihmat | Bin 9614 -> 9599 bytes tests/data/acpi/q35/DSDT.bridge | Bin 11003 -> 10988 bytes tests/data/acpi/q35/DSDT.cphp | Bin 8753 -> 8738 bytes tests/data/acpi/q35/DSDT.cxl | Bin 9615 -> 9600 bytes tests/data/acpi/q35/DSDT.dimmpxm | Bin 9943 -> 9928 bytes tests/data/acpi/q35/DSDT.ipmibt | Bin 8364 -> 8349 bytes tests/data/acpi/q35/DSDT.ipmismbus | Bin 8378 -> 8363 bytes tests/data/acpi/q35/DSDT.ivrs | Bin 8306 -> 8291 bytes tests/data/acpi/q35/DSDT.memhp | Bin 9648 -> 9633 bytes tests/data/acpi/q35/DSDT.mmio64 | Bin 9419 -> 9404 bytes tests/data/acpi/q35/DSDT.multi-bridge | Bin 8583 -> 8568 bytes tests/data/acpi/q35/DSDT.nohpet | Bin 8147 -> 8132 bytes tests/data/acpi/q35/DSDT.numamem | Bin 8295 -> 8280 bytes tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8900 -> 8885 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8921 -> 8906 bytes tests/data/acpi/q35/DSDT.viot | Bin 9398 -> 9383 bytes tests/data/acpi/q35/DSDT.xapic | Bin 35652 -> 35637 bytes 33 files changed, 32 deletions(-) diff --git a/tests/data/acpi/pc/DSDT b/tests/data/acpi/pc/DSDT index cc1223773e9c459a8d2f20666c051a74338d40b7..e80bef30317b5ef3bf0d2fb7aaabd6def109adb6 100644 GIT binary patch delta 44 zcmeyQ_gIh1CDVgT_=4|o6o diff --git a/tests/data/acpi/pc/DSDT.acpierst b/tests/data/acpi/pc/DSDT.acpierst index bb0593eeb8730d51a6f0fe51a00a00df9c83c419..d5a2ca51652dfc3637a817bac4a02d6ff6dc8ac2 100644 GIT binary patch delta 44 zcmcbpcSw)RCDNE47$d)%q+WcmQ+$B4r$Ka+r^IAkM#;_LjK4$y1_}%4 delta 60 zcmX@4cTtbaCD5O59$B_ diff --git a/tests/data/acpi/pc/DSDT.acpihmat b/tests/data/acpi/pc/DSDT.acpihmat index 2d0678eb83277088b156d386067429b0f29f9338..f86c743c4d64041c7fbd9999cc700e88416770b7 100644 GIT binary patch delta 44 zcmbPlIl+?4CDe8-u~CD(^b delta 60 zcmdmNbjXOyCD`pO$^ZZwMi9gR diff --git a/tests/data/acpi/pc/DSDT.hpbridge b/tests/data/acpi/pc/DSDT.hpbridge index bb0593eeb8730d51a6f0fe51a00a00df9c83c419..d5a2ca51652dfc3637a817bac4a02d6ff6dc8ac2 100644 GIT binary patch delta 44 zcmcbpcSw)RCDNE47$d)%q+WcmQ+$B4r$Ka+r^IAkM#;_LjK4$y1_}%4 delta 60 zcmX@4cTtbaCD5O59$B_ diff --git a/tests/data/acpi/pc/DSDT.hpbrroot b/tests/data/acpi/pc/DSDT.hpbrroot index 6ff6f198c7caf445d25c01117a6357b398358cbf..ec99b1622934a0fd8bc316291c33231e4c57dce0 100644 GIT binary patch delta 44 zcmeB?_$$uk66_N4mz#lsk!d5B7$d)%q+WcmQ+$B4r$Ka+r^IAkM#;_Lj9a+?2qz1y delta 60 zcmew>-Xp=~66_Mf!^6P9Xt0q>jFDGOFFx2QKET=2Ai7CvvOc4vpn#vaJ~K?vGuSbH Jvj^i=E�n4z2(I diff --git a/tests/data/acpi/pc/DSDT.ipmikcs b/tests/data/acpi/pc/DSDT.ipmikcs index 2e618e49d357ae1d0ac20d822f71d676ea90f2fc..f0d9e75841ea3d69fed9384e439bc4e94c7a4c4e 100644 GIT binary patch delta 44 zcmdm`zgnNmCD5sPVoWGo(9oPj`q_qyg@S55@oh diff --git a/tests/data/acpi/pc/DSDT.nohpet b/tests/data/acpi/pc/DSDT.nohpet index 623f06a900d12500d2197d101f76f6875e92ed64..cb7bf7d850f340e12a7237c987f570300fd9c92b 100644 GIT binary patch delta 41 xcmaE&dsUaqCD|w< diff --git a/tests/data/acpi/pc/DSDT.roothp b/tests/data/acpi/pc/DSDT.roothp index cee3b4d80b51ad30153953ace46127923ce8b271..46e03d39e00ea70e55d6a12333ca2b98c5e5bb53 100644 GIT binary patch delta 44 zcmX?Pu-SmiCDk-8M! diff --git a/tests/data/acpi/q35/DSDT.acpihmat b/tests/data/acpi/q35/DSDT.acpihmat index f24d4874bff8d327a165ed7c36de507aea114edd..af10345e8806c78a0074b3a8819b5cfca4d70c01 100644 GIT binary patch delta 44 zcmeD4{_n-*66_LEugbu{IC&%2O-6oaLB053r}zM8PlM*Co#F$WJq@Cp+yo|nV3gb}#q>}E0AVT) A?*IS* delta 80 zcmaD8`a6`%CD@~ diff --git a/tests/data/acpi/q35/DSDT.cphp b/tests/data/acpi/q35/DSDT.cphp index f1275606f68eeba54bfb11e63d818420385a62b9..ac8456a43d54209d77917163b282954d7429b331 100644 GIT binary patch delta 44 zcmdn!vdD$YCDF$oF>WK*O-6Gyz4&0K_yA{5gXktH&tS)Rj(A6xARYz=d4}kQ b0MDR6Cawf79szHDeP) diff --git a/tests/data/acpi/q35/DSDT.cxl b/tests/data/acpi/q35/DSDT.cxl index c1206defed0154e9024702bba88453b2790a306d..369ae90196113ec666a4acec7bb7a93be5b60e75 100644 GIT binary patch delta 44 zcmeD8Zt&)E33dr-P-S3Xytk3-CL_PIpk92iQ+$B4r$Ka+o517`jFOwBm`araDH9DJ delta 80 zcmZqh?)T<$33dtTS7l&eWZKAelhIsFFFx2QKET=2Ai7D)GuSbnBi_*^h=+keo*}v+ bz%wY2i7SDNN5Gq3pBbhQq-rxaQ>iilJo#F$WJq@Cp97QL8V3gb}#WYC{05{ML Ap#T5? delta 80 zcmbR1xWv04cW( ABme*a delta 80 zcmZ4OxXY2tCDk-8M! diff --git a/tests/data/acpi/q35/DSDT.memhp b/tests/data/acpi/q35/DSDT.memhp index 4e9cb3dc6896bb79ccac0fe342a404549f6610e8..663456fc0d3c71a51b541f5ab952e05c9dac01e6 100644 GIT binary patch delta 44 zcmdnsz0jM>CDCo#F$WJq@Cp+yo|nV3gb}#WYPB05)0; AjQ{`u delta 80 zcmZ4Jy}_HyCD<^x}h^;scyL4WgT*JcAwMIpQ5%f_NAh-$Gfh(l0GH<#M*si- diff --git a/tests/data/acpi/q35/DSDT.mmio64 b/tests/data/acpi/q35/DSDT.mmio64 index eb5a1c7171c02d153487bfcecfb7019b7c1bf406..91afd01d598c7c2c733387dfb5140d0fcad54adb 100644 GIT binary patch delta 44 zcmX@@xyO^sCD<^x}h^;scyL4WgT*JcAwMIpQ5%f_NAh-$Gi_7?0G&M*X#fBK diff --git a/tests/data/acpi/q35/DSDT.multi-bridge b/tests/data/acpi/q35/DSDT.multi-bridge index 45808eb03b78d07ebbe853f674abfed589d35e26..afde339a181628ae9153251eee026b437ab685bc 100644 GIT binary patch delta 44 zcmZp7{^7*s66_LEp~%3%n6;7XCL_PIpk92iQ+$B4r$Ka+o517`jFOwBm~!O-DNYRX delta 80 zcmez2)b7mX66_MvuE@Z^*te1ECZoBUUVN}qe1Nm3L3ERpXRu>DN4%p;5Dx=`JVSIt bfM-x36ITKkkAOG7J~K=qNY!R;rd)Xdd|?!< diff --git a/tests/data/acpi/q35/DSDT.nohpet b/tests/data/acpi/q35/DSDT.nohpet index 83d1aa00ac5686df479673fb0d7830f946e25dea..0fb09121cf8f6ad8810587c8b77df9552dd31f42 100644 GIT binary patch delta 65 zcmca?f5e{4CDCo#F$WJq@Cp+yo|nV3gb}#k5KR06d2c A!T8>CD<^x}h^;scyL4WgT*JcAwMIpQ5%f_NAh-$Gp$kp0HY)od;kCd diff --git a/tests/data/acpi/q35/DSDT.tis.tpm2 b/tests/data/acpi/q35/DSDT.tis.tpm2 index 00d732e46f5d9d056e557bd026fa30f9db3b8c30..4e16b126cc1c32f2346078fa69c5261c245d15e8 100644 GIT binary patch delta 44 zcmccVddii{CDCo#F$WJq@Cp+yo|nV3gb}#k5}m07~=@ AI{*Lx delta 80 zcmX@*defE5CD diff --git a/tests/data/acpi/q35/DSDT.viot b/tests/data/acpi/q35/DSDT.viot index 1c3b4da5cbe81ecab5e1ef50d383b561c5e0f55f..e20e4ee5e92e11ccf890a18fbdd78181c43f3b5c 100644 GIT binary patch delta 44 zcmdnyx!jY>CD<^x}h^;scyL4WgT*JcAwMIpQ5%f_NAh-$GtE%~0E!3|6aWAK diff --git a/tests/data/acpi/q35/DSDT.xapic b/tests/data/acpi/q35/DSDT.xapic index 17552ce363ae81985f69f9ae85837a1540b79ae0..3cab5956eee60363251a6fab0cc981bbbda64443 100644 GIT binary patch delta 46 zcmX>yjcMyNCN7s?mk`r#1_s8Sja)Yw`JDyz;)9*y1Drh#qMO_VCVya*+$_bU)d>Jm Crw#`I delta 82 zcmdlwjp@iVCN7s?mk^h31_s6r8@X;Wnycx>2Rp?FIC~mIH%WO0JH~UwJGun%Ffhn7 eL^lL@1_d&4C2;Wwc=PKs!xVy4ZRTdu>I4AAB^AK{ diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 666e257bf9..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,33 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/pc/DSDT", -"tests/data/acpi/pc/DSDT.acpierst", -"tests/data/acpi/pc/DSDT.acpihmat", -"tests/data/acpi/pc/DSDT.bridge", -"tests/data/acpi/pc/DSDT.cphp", -"tests/data/acpi/pc/DSDT.dimmpxm", -"tests/data/acpi/pc/DSDT.hpbridge", -"tests/data/acpi/pc/DSDT.ipmikcs", -"tests/data/acpi/pc/DSDT.memhp", -"tests/data/acpi/pc/DSDT.nohpet", -"tests/data/acpi/pc/DSDT.numamem", -"tests/data/acpi/pc/DSDT.roothp", -"tests/data/acpi/pc/DSDT.hpbrroot", -"tests/data/acpi/q35/DSDT", -"tests/data/acpi/q35/DSDT.acpierst", -"tests/data/acpi/q35/DSDT.acpihmat", -"tests/data/acpi/q35/DSDT.bridge", -"tests/data/acpi/q35/DSDT.cphp", -"tests/data/acpi/q35/DSDT.dimmpxm", -"tests/data/acpi/q35/DSDT.ipmibt", -"tests/data/acpi/q35/DSDT.ivrs", -"tests/data/acpi/q35/DSDT.memhp", -"tests/data/acpi/q35/DSDT.mmio64", -"tests/data/acpi/q35/DSDT.multi-bridge", -"tests/data/acpi/q35/DSDT.nohpet", -"tests/data/acpi/q35/DSDT.numamem", -"tests/data/acpi/q35/DSDT.tis.tpm12", -"tests/data/acpi/q35/DSDT.tis.tpm2", -"tests/data/acpi/q35/DSDT.viot", -"tests/data/acpi/q35/DSDT.xapic", -"tests/data/acpi/q35/DSDT.ipmismbus", -"tests/data/acpi/q35/DSDT.cxl", From patchwork Fri Jun 10 07:58:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ANg/mQOR; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDm51xkhz9s09 for ; Fri, 10 Jun 2022 18:34:45 +1000 (AEST) Received: from localhost ([::1]:44644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nza6M-0005OJ-OO for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:34:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZX8-00007n-Gr for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:58725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZX3-0006I5-BL for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847892; 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=rvIx/BoI0pIYAkZbBQ6pra8sY6RBuWirW8hnBbq6FvA=; b=ANg/mQORtoRXwIgtse6Ti9+7bhOeiFBzwkvs4n9KkBY68sM9svMpfuLf3FkqeQZGRbKBnX iwA+PW842wQ6SfATBqA2BAb4vTj0caMSfOxm6lzdUAFaw8dEe0KECNYA2yuF6MZPd3SVzd j8cYrP+0HTYhd9od4iIRVdKKXj7/erM= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-388-s_5sjBxwPcax0XKLKy_01A-1; Fri, 10 Jun 2022 03:58:11 -0400 X-MC-Unique: s_5sjBxwPcax0XKLKy_01A-1 Received: by mail-wm1-f71.google.com with SMTP id be12-20020a05600c1e8c00b0039c506b52a4so1221953wmb.1 for ; Fri, 10 Jun 2022 00:58:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rvIx/BoI0pIYAkZbBQ6pra8sY6RBuWirW8hnBbq6FvA=; b=zRSPCeuC4gcHppaZL81UEpka0SmyKZK5cfHnSIlpdGpMdrYbnAdqokYSNWcUKNVQCd CgIJXKM6z4ifkEFJVaYZ2fljbITmq5HKmSh3+eNUc7a208yxBgTd1PC/1CUAl5yvlfnl Ct+iSUFhBwnKboPZnTSmGzPdaZyATp4vJe9AVik0I6zrGXZVJhHJFZIk+yD7CbJqXV1Z C9blrfpD6pZrqWu9RdSawIUksN4bWBKbw4iJnAG3OFRkP+1PiPVtRNJhP7DlhUeLEv79 kIBD1a+P3/8FHYnWOZL/kpR5qYFW1S8Mde159iM8HJEl2iS7dlJWk0dXD3TahtfHAnWS g4/g== X-Gm-Message-State: AOAM531jEdnU15ekrdCueVUyz5LdIl203sgKCnVmfyMdmp96XAr5LEnc g+5xISO6LE+swRNy6VqiIEq5md1R9O4ftPxYu7pw3JxBNqYKyLtA2NtXLnYwp59E4WuT9k+4TZP VILtO6TsLmzfHFoBtEExtwZtB1LM44CpK/9ZLl+ONn1Ehv5Hbww7GEQS12OK4 X-Received: by 2002:a05:600c:1e09:b0:39c:5351:789a with SMTP id ay9-20020a05600c1e0900b0039c5351789amr7503286wmb.177.1654847889983; Fri, 10 Jun 2022 00:58:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUpl8unYoQ51oxtsAHNrIfW/9XUphk3ITG8TyEpurSXGFnGFSLw0IUC6IIEMXYEJVblLSzyQ== X-Received: by 2002:a05:600c:1e09:b0:39c:5351:789a with SMTP id ay9-20020a05600c1e0900b0039c5351789amr7503263wmb.177.1654847889738; Fri, 10 Jun 2022 00:58:09 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id bv18-20020a0560001f1200b002183cedbf34sm14418933wrb.73.2022.06.10.00.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:09 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:07 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 22/54] tests: acpi: add and white-list DSDT.applesmc expected blob Message-ID: <20220610075631.367501-23-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-23-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/q35/DSDT.applesmc | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/q35/DSDT.applesmc diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..e893029d87 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.applesmc", diff --git a/tests/data/acpi/q35/DSDT.applesmc b/tests/data/acpi/q35/DSDT.applesmc new file mode 100644 index 0000000000..e69de29bb2 From patchwork Fri Jun 10 07:58:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641749 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=fTw53f+t; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKF5N5dMrz9s09 for ; Fri, 10 Jun 2022 18:49:44 +1000 (AEST) Received: from localhost ([::1]:35196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaKs-0002FC-PB for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:49:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXB-0000Iv-Rm for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZX8-0006IX-Sf for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847898; 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=4nmjN6bwgcMzCDQZFw4PNGDXA6/jQ8q9DHYb9d4XDTk=; b=fTw53f+tFLBtUtPoc9FCP6BIoIiJ//7gxqDK/DBXsUUJaWzppXhhOh1CiLronFWWVQxL0Z J0PPvwXChwSGiR3UPBk7f7iFFYNO0DZ/Mz0X7u3imAc+l67ftAJsbzpoM0KzI8gr1IUU7/ BSOCMjsZ5OTk9hu3Fbx0xa3xkLgosOI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-518-tY8HXp18P76mh1OHlhwUlg-1; Fri, 10 Jun 2022 03:58:14 -0400 X-MC-Unique: tY8HXp18P76mh1OHlhwUlg-1 Received: by mail-wm1-f69.google.com with SMTP id v125-20020a1cac83000000b0039c6608296dso943485wme.4 for ; Fri, 10 Jun 2022 00:58:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=4nmjN6bwgcMzCDQZFw4PNGDXA6/jQ8q9DHYb9d4XDTk=; b=AR1cq2OIGt3F9IHQtnT8AMz2gDU7RbdY0yGHPbKfQLq2B6FRspLldPsjRzV7ea0OJ2 dP/U5UfwOTSA04HF0ZKR3RZRyRjAgFmJf78H2esZSS+uHcxUfOPyHCaxlHxYECvj3pyX kq71CGWnH60P3nCFabBX9t+wHH/55J4UnsgRf05mFYtxpsC3M+uSw0K+k8upMjplRr3t /atty++hB/lGp/sFtnVfw5gUI5Gw6xc8aVaBMF2/3qUHGx5kq4ZnU7NpwqSg3jwUrly3 GPv9dnlogQVGDKc92oqml/c0L08tzuH4Cq6gLhYNO3SVCialOQu+b7mCpaKRjonFjftI CRkQ== X-Gm-Message-State: AOAM533olZLsV/h/weNhi7OxCd+CSCO0N4/UQr6shfOONJrU7x2+NnNT vTrl2MYLgeC4WpW8Sh1IlbmsjnQNtjvY1aOH1UcVMNdTq2q+B6t3sN6Bz0pTi6fCnpGDpIP3I3L MH67g73UuACUuoSfQo8VFE+Y0ugDwn4e769aUlPaYniDFu+ldz9rn8I8v4Scq X-Received: by 2002:a5d:64cc:0:b0:20f:e6d6:72e1 with SMTP id f12-20020a5d64cc000000b0020fe6d672e1mr41828588wri.384.1654847892893; Fri, 10 Jun 2022 00:58:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHWshblt7XxWTvVT7sa6NvbHogo/t+ATTnPQkzBo+iy/30nMJXo45HAki3XDscr7BSQ0mCnA== X-Received: by 2002:a5d:64cc:0:b0:20f:e6d6:72e1 with SMTP id f12-20020a5d64cc000000b0020fe6d672e1mr41828566wri.384.1654847892643; Fri, 10 Jun 2022 00:58:12 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id p21-20020a05600c359500b00394708a3d7dsm2191730wmq.15.2022.06.10.00.58.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:12 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha Subject: [PULL 23/54] tests: acpi: add applesmc testcase Message-ID: <20220610075631.367501-24-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-24-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index d896840270..7d238218ca 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1625,6 +1625,17 @@ static void test_acpi_q35_slic(void) free_test_data(&data); } +static void test_acpi_q35_applesmc(void) +{ + test_data data = { + .machine = MACHINE_Q35, + .variant = ".applesmc", + }; + + test_acpi_one("-device isa-applesmc", &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1783,6 +1794,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/q35/acpihmat", test_acpi_q35_tcg_acpi_hmat); qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); + qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); From patchwork Fri Jun 10 07:58:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hV5oqcH1; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDnL41xMz9s09 for ; Fri, 10 Jun 2022 18:35:50 +1000 (AEST) Received: from localhost ([::1]:46944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nza7Q-00071B-LF for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:35:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXD-0000NN-9H for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:23379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXB-0006Ix-AR for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847900; 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=TOvkDkiafeYSAXY0KZc9ourX4zMJEzIbZqDfZoh54AA=; b=hV5oqcH1UhbiChQnvFN5DIxqb7Jmjl+YQI6PjIVp9ckcaGpyykJLbNlZBUol3TBL6kdH9a AOR8TOIQiShQGygXxh0DfPlUn/3JQgVNAsiXZihv6vMIACGVC+hK6sbQVglNLatz5YyeT7 A3qE5w9C19w9hqFK/sI/NjR1o+VGp78= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-dtlkOJAwOfCKMjzDXO1ldA-1; Fri, 10 Jun 2022 03:58:18 -0400 X-MC-Unique: dtlkOJAwOfCKMjzDXO1ldA-1 Received: by mail-wr1-f69.google.com with SMTP id r13-20020adff10d000000b002160e9d64f8so4473903wro.0 for ; Fri, 10 Jun 2022 00:58:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TOvkDkiafeYSAXY0KZc9ourX4zMJEzIbZqDfZoh54AA=; b=gtf/QRR82YthttgZe6PD3CbFHfvtPP9mkThu5lifJhMWnEpwO+y5cFRvkUjCrHn7uD FDLBWRO5rpYDcTHsIm8NHS+9jmiFI24qkJjVJkFCgZG48wpsL465yZhA9oct1SHHNWEw FvXdE8/43MLdXP5CfzwTkOMbn3YHN5g0hIh7OVj05+HgaUlXliKMcXJiblDxt1SqSoBW ysfXAFIrFV/f0sJgM10mKrUgYe4tLeOM0YypraqiLn4jhY1LKG++X/Q1P1n2RjsQgDPn 3vneu9Pjq2fCOm5aNQmZUCS7+90MK1voWuOYRWssTcSvM1XnCZpZkmq6SAHEJlDyF2O9 baOQ== X-Gm-Message-State: AOAM532vfHc0ePcxZsE1Z44pJlf9r4foDWEEUpT+J604S/h6fLnZlao7 qtYwhhq4GT4908WQDv/4NOtfqYdu09G6Z+pealoWzPQYsBI5aPU5KaURViqE5yCA8hrVZD4I0ux Fqr/K9bG6z+CpoMxkXRsQ3LNeq40SC+i0PoPk1sQlvUgCY4rxa/3O88vuaT6o X-Received: by 2002:a1c:a301:0:b0:392:9bc5:203c with SMTP id m1-20020a1ca301000000b003929bc5203cmr7426284wme.67.1654847896445; Fri, 10 Jun 2022 00:58:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwle9W/hD7egAoyjxgjJUj8mhEVM0RSvjL9UDUBmWBpKHlYx95+BmqFY038KhVnromkLjjMrA== X-Received: by 2002:a1c:a301:0:b0:392:9bc5:203c with SMTP id m1-20020a1ca301000000b003929bc5203cmr7426241wme.67.1654847896074; Fri, 10 Jun 2022 00:58:16 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id n39-20020a05600c3ba700b00397342e3830sm7733545wms.0.2022.06.10.00.58.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:15 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:12 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 24/54] acpi: applesmc: use AcpiDevAmlIfClass:build_dev_aml to provide device's AML Message-ID: <20220610075631.367501-25-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov .. and clean up not longer needed conditionals in DSTD build code. applesmc AML will be fetched and included when ISA bridge will build its own AML code (incl. attached devices). Expected AML change: the device under separate _SB.PCI0.ISA scope is moved directly under Device(ISA) node. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-25-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/isa/isa.h | 14 -------------- hw/i386/acpi-build.c | 22 ---------------------- hw/misc/applesmc.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 36 deletions(-) diff --git a/include/hw/isa/isa.h b/include/hw/isa/isa.h index 5c5a3d43a7..6f9380007d 100644 --- a/include/hw/isa/isa.h +++ b/include/hw/isa/isa.h @@ -16,20 +16,6 @@ OBJECT_DECLARE_TYPE(ISADevice, ISADeviceClass, ISA_DEVICE) #define TYPE_ISA_BUS "ISA" OBJECT_DECLARE_SIMPLE_TYPE(ISABus, ISA_BUS) -#define TYPE_APPLE_SMC "isa-applesmc" -#define APPLESMC_MAX_DATA_LENGTH 32 -#define APPLESMC_PROP_IO_BASE "iobase" - -static inline uint16_t applesmc_port(void) -{ - Object *obj = object_resolve_path_type("", TYPE_APPLE_SMC, NULL); - - if (obj) { - return object_property_get_uint(obj, APPLESMC_PROP_IO_BASE, NULL); - } - return 0; -} - #define TYPE_ISADMA "isa-dma" typedef struct IsaDmaClass IsaDmaClass; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f7f1671407..b96705c688 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -121,7 +121,6 @@ typedef struct AcpiMiscInfo { const unsigned char *dsdt_code; unsigned dsdt_size; uint16_t pvpanic_port; - uint16_t applesmc_io_base; } AcpiMiscInfo; typedef struct AcpiBuildPciBusHotplugState { @@ -307,7 +306,6 @@ static void acpi_get_misc_info(AcpiMiscInfo *info) info->tpm_version = tpm_get_version(tpm_find()); #endif info->pvpanic_port = pvpanic_port(); - info->applesmc_io_base = applesmc_port(); } /* @@ -1800,26 +1798,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dsdt, scope); } - if (misc->applesmc_io_base) { - scope = aml_scope("\\_SB.PCI0.ISA"); - dev = aml_device("SMC"); - - aml_append(dev, aml_name_decl("_HID", aml_eisaid("APP0001"))); - /* device present, functioning, decoding, not shown in UI */ - aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); - - crs = aml_resource_template(); - aml_append(crs, - aml_io(AML_DECODE16, misc->applesmc_io_base, misc->applesmc_io_base, - 0x01, APPLESMC_MAX_DATA_LENGTH) - ); - aml_append(crs, aml_irq_no_flags(6)); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(scope, dev); - aml_append(dsdt, scope); - } - if (misc->pvpanic_port) { scope = aml_scope("\\_SB.PCI0.ISA"); diff --git a/hw/misc/applesmc.c b/hw/misc/applesmc.c index 81cd6b6423..5f9c742e50 100644 --- a/hw/misc/applesmc.c +++ b/hw/misc/applesmc.c @@ -37,10 +37,14 @@ #include "qemu/module.h" #include "qemu/timer.h" #include "qom/object.h" +#include "hw/acpi/acpi_aml_interface.h" /* #define DEBUG_SMC */ #define APPLESMC_DEFAULT_IOBASE 0x300 +#define TYPE_APPLE_SMC "isa-applesmc" +#define APPLESMC_MAX_DATA_LENGTH 32 +#define APPLESMC_PROP_IO_BASE "iobase" enum { APPLESMC_DATA_PORT = 0x00, @@ -347,14 +351,35 @@ static Property applesmc_isa_properties[] = { DEFINE_PROP_END_OF_LIST(), }; +static void build_applesmc_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + Aml *crs; + AppleSMCState *s = APPLE_SMC(adev); + uint32_t iobase = s->iobase; + Aml *dev = aml_device("SMC"); + + aml_append(dev, aml_name_decl("_HID", aml_eisaid("APP0001"))); + /* device present, functioning, decoding, not shown in UI */ + aml_append(dev, aml_name_decl("_STA", aml_int(0xB))); + crs = aml_resource_template(); + aml_append(crs, + aml_io(AML_DECODE16, iobase, iobase, 0x01, APPLESMC_MAX_DATA_LENGTH) + ); + aml_append(crs, aml_irq_no_flags(6)); + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(scope, dev); +} + static void qdev_applesmc_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = applesmc_isa_realize; dc->reset = qdev_applesmc_isa_reset; device_class_set_props(dc, applesmc_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); + adevc->build_dev_aml = build_applesmc_aml; } static const TypeInfo applesmc_isa_info = { @@ -362,6 +387,10 @@ static const TypeInfo applesmc_isa_info = { .parent = TYPE_ISA_DEVICE, .instance_size = sizeof(AppleSMCState), .class_init = qdev_applesmc_class_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void applesmc_register_types(void) From patchwork Fri Jun 10 07:58:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=g0ilvrmB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDyF2qpgz9s09 for ; Fri, 10 Jun 2022 18:43:33 +1000 (AEST) Received: from localhost ([::1]:55486 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaEt-0004bS-EA for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:43:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXF-0000U5-1d for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36770) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXD-0006JF-4k for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847902; 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=+cbd0efxfoR4ufLej+0EIFiYfHoWDl51OA/1ATVy/PM=; b=g0ilvrmBNUsu4ye+pRW8HAa0HuHufG6H+M0dIhm2DkW5e/d0BNgdVLbyiG4nIlG+1OQ0Jz V14GQVAe7i+xCQ8Maji+sjazc1FMHYnmz58k90XFra9GV5C+WlQd3RhhHGqD6H1G7X+oND oqigKbq05Dp2zI+lEU9HnxNLU8AQYQg= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-127-b7_BeCy0M4G_eDxhuI6oWQ-1; Fri, 10 Jun 2022 03:58:20 -0400 X-MC-Unique: b7_BeCy0M4G_eDxhuI6oWQ-1 Received: by mail-wm1-f69.google.com with SMTP id u12-20020a05600c19cc00b0038ec265155fso937892wmq.6 for ; Fri, 10 Jun 2022 00:58:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+cbd0efxfoR4ufLej+0EIFiYfHoWDl51OA/1ATVy/PM=; b=mQIhE5sv2TAKwu9KfIeCOH41HlHlUrPk9VV4oqklrxjvFlXv2pk1dqykJ9vaMEuqhB OUBLMezpNKLQhWixybRhTvVlBoJxcUNRXXjmQbhPtsi+PWLYis0QLtE7uoPwrl/AOLbf WIfQ2nvqSEfe4U5nBwxJSUb4t6I+9CM+aWf7sNODZVvRjXTUUt0JtxhUbXea/2RC3wBG bRNFq+y1Vem5cgXGkfQi1nIMehe7wYVOLNKwM/a7efiJ1uoJ6BwN99WlA0vS3yM8QeYV pmAdfcs1k3lmriLuZh2MCDMfW1hCKakht1Ps6hsXzz6kt4GCFyOzrEH2447tM6BYts/b H8xA== X-Gm-Message-State: AOAM533UG/qniJWkphZXiyR+IPwcV2/81U5JjEf5FYDvZgZWb8VmpXaF 6dGl71LQuH3Ug2+XLs6JmVS7ySZrJzmO6/un93lYBtl4R8jIyjeVDAFd6xgsqHybAMGrnfU0470 pCq4vPB/1fL20AP2UOgMgkvd+vUYlbBSkDKHOVF0eJLOH6bbd/ZTht5qVTt1l X-Received: by 2002:adf:c614:0:b0:215:cd85:bd88 with SMTP id n20-20020adfc614000000b00215cd85bd88mr33091456wrg.437.1654847899309; Fri, 10 Jun 2022 00:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy80cVH/exZnWuC9LJRbVZ6Epn/XPEArPTZhMmgKlVxjILHuLMLc6wf96YxW6jH0boisCOTVQ== X-Received: by 2002:adf:c614:0:b0:215:cd85:bd88 with SMTP id n20-20020adfc614000000b00215cd85bd88mr33091435wrg.437.1654847898944; Fri, 10 Jun 2022 00:58:18 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l21-20020a1ced15000000b003942a244ed1sm1975174wmh.22.2022.06.10.00.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:18 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 25/54] tests: acpi: update expected blobs Message-ID: <20220610075631.367501-26-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov @@ -145,6 +145,23 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) + Device (SMC) + { + Name (_HID, EisaId ("APP0001")) // _HID: Hardware ID + Name (_STA, 0x0B) // _STA: Status + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0300, // Range Minimum + 0x0300, // Range Maximum + 0x01, // Alignment + 0x20, // Length + ) + IRQNoFlags () + {6} + }) + } + Device (KBD) { Name (_HID, EisaId ("PNP0303") /* IBM Enhanced Keyboard (101/102-key, PS/2 Mouse) */) // _HID: Hardware ID @@ -3246,26 +3263,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) } } - Scope (\_SB.PCI0.ISA) - { - Device (SMC) - { - Name (_HID, EisaId ("APP0001")) // _HID: Hardware ID - Name (_STA, 0x0B) // _STA: Status - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings - { - IO (Decode16, - 0x0300, // Range Minimum - 0x0300, // Range Maximum - 0x01, // Alignment - 0x20, // Length - ) - IRQNoFlags () - {6} - }) - } - } - Scope (\_SB) { Scope (PCI0) Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-26-imammedo@redhat.com> --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/DSDT.applesmc | Bin 0 -> 8320 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/DSDT.applesmc b/tests/data/acpi/q35/DSDT.applesmc index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..00092aacc6ce44dd8792b00a0fa183e5b06d33c6 100644 GIT binary patch literal 8320 zcmb7JOKcm*8J^`!tL0K!Qk3OaY{E&)_r?xN%s)PQXYx!=g zYz~?&&#oL;ra5rMS<)O-ye=~bn=OwO*X9Q6ft$MXI&;0ttD{bOxRYP9oPPUX7rs4v z`lT-}zf-yQ^MC&0&g)hRfb;lk;_ros4&eu(btW7+za3sTJ|sH7wmMq+?T}vEV}%AEI@ z(>8_5n%VSgJ*m=wHd58!ZTh`7vl%=1F3VE=TMorbFV{L=$?tlDQt`P#(5tYBTEd8$ zw%!jdCmh+I4MR2zv*YnT8!db`++x4mvf01?m)>Xl)}rWJ-dgy0p89g|9ZNBW-c*WD zQFmy-`+MF}E2s?kAfp3k(HXzh-AGuWW%u`<4B9TP(M`!X%z%ns#mb7jj+JW|EXk5a z>D)_5+uwWUQq_ymm4hV25jyV0acj9@ge+u+(J-#DYxsLE!C8;B*EbJYi%S~Iw9@Bj z0Q-CA*Zkh99JrKt9OC}O6?lK%O}?8n&2zgv^Lcl@eaJ}zjlrJ5xu3kBWac@Ca~|*Z zq~gj!Hom<)b;Kf!z&U1M1UvZ$Be?6kLC?tEvn>;Mjsh1WyII1)EA@AS+C@x~zuOk> zYnB4HTCQEhg=(kWHL?eSMuA)HY_>~&%X_8NH>zvyC02agcWW0D{YNPpkE0zzMDH2b z8Rh8zfSUJN@repJvrv>PqC*&C!=jh*y`a4?T8n4S!Snz4Pw?#f?ax-eX`lG3+m0yL z8@~!ij}C9J(TU-8D}f2}A%DzlJk?{ipHCXM=)mr-jFyKtthuO=POu!?io)AljO}lk ze#@=1qCLQ0Bif#Sf?yOluD zkUC}$!hCVIoMNzRl# zNHStdXi_i%FS`?h={^XF>BZQS8uO&aJgGAgs?1Xw^OVLs zr85z#%+nh4w8lKGGZCuHM>OUm8uJmIiBM&p;Y{f=XE;;7G*E$!BdVzysDK_CC_?mzV_~2I8%ME54kZH>P#LN^VW1){ zXTm@gC>bb1>562a2&GOKsK9b23{-)VfeI+ENd}5g>V$y`EN8+%6(|{~fN~}oC_`0?L_Wpa`W-7^uKf}LawZulLa7r5DzKah16818paRO7WS|J8P8g`bawZH^ zfs%m=C})y^B9uB|paRR8Fi-_b1}dPONd}5g>V$y`EN8+%6(|{~fN~}oC_Az;Y%GRDqI#3Mglifg+STVW0xbnJ`cVN(L&RoJj_XQ0jz% zB2o+#k!qj_RRcw+7^uR8fhtTgP=!ebsxV=o3KIsZFv&m_CK;&0gn=qd7^uP|167!0 zpb8TPsxV=o3X=>}VUmF=Oc*F4d3Rx;h;YaFV3L6%#BGovG3D68KoQBYg@GcHV@n2# zP>wAbC_=0xogBbI*~lL9e^&SDAJV%S`cvuO`sve2`Y)9hMrbj_@VgroIPON34lW%$ zlVNFQqeka-IyC6eG>c2E4Xg%?=0C7@cd!OCzi(xW&$Kq&?mPh9a(=_a-Yc6rMpEmtuh+%At-20=G4?(D>Upz_onSFcV~$KuKN zu3lBDS9$d+`lnW}7H3zl_V?PPU97ZWH89q0B_5)@tCV+nd3U0`dqjCRF7HieC8p_HH%LAVknC@a3R&Oh2_>{*Vn%8l<$!Tom^>p~wm`W$wW~Q5(mjyi?K0v0@iME;P zrsf%zfN7pdVfZSUN+;T8rkk2KMLiupRi@I3wwdXs=E1U_4&N_R=|tPibW_juF+CkV zYNpbOwwdXsp3@aQ9lms?(up=bopb8JdiLI8(5_-92D>hH5*q@}`io-oqG?@uIw>~} z{BA9fPpO5;32(}|{${E9<~z|FH-A}r>$SJvy!qDlYj3l@;reTr;-@udSqp2$^()+FA*4 zuhJ`Ft+~}{nGvH#JoOi@a6Rad=wz2drF*k5K<`FVXw^O@ZNQ@)49U0fY^a{gkM#Qc~Mi{ZJFW2nf3`67dZ8U|^_GC#e zc(M^UWwi47WGimV_E)3%;g&T{jU3(gX!|zxaf{vDLa**VKYDfw#-9w_ zzHKWRO$`h#f_HP9_8n^}vGGU=ud;2r<U!5&(Di`{5^XlwjZqK{xLC-#7m}fsN zQ~5D?(e)W)6IqGLR)XG`Y{W3n>|Ot(7wDPB{KpT|1JAX&Pfs^yK)ce*XDyRqwSm4v ziwoFO?PW;}+qr(DcnXuJ;nxPW@_81|c$!G`OgZZ*y2K}bJg3UfvEomFU1c;7hwlfm zW2H3sZin|&LpbeaF;n@b5Z_9@n6>_VJI4}OBEWA<2kaQ$x9{7AiFO0;B>cX`<@@$w zoWmXxWB=uQu>3lG7LUjDSxmnK({^V~Y-9aVTw#CEuH3`6?RVnJy%+C1fgRmAn`ooa zqCGGSoc5!bHYwc{21jgS^9|w(21mRasa<&|Y8$Eiomk40G6vu2yqNNvepd`J?J_?| zf X-Patchwork-Id: 1641756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Y71UBDH/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFK71w9qz9s0r for ; Fri, 10 Jun 2022 18:59:55 +1000 (AEST) Received: from localhost ([::1]:43340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaUi-0008VT-B2 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:59:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXH-0000aa-83 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXF-0006Jb-M9 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847905; 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=/1crx0vve3way+UwYuSFBl+pY/N1VbYbCvLxJyL9VgE=; b=Y71UBDH/LhPpUqSf6xxHPDgHmcHJH4UoqxV/BnOrfHctJZAMUPsmbxLHs07ocqnPPYVEug j2/5IzYq61HRUzUHLb9qqHwKdmvEk4DIyhSKI9IGgyQVq16B3qN0bBz+9OOwnYVwBdNPfZ cT6U8qKxmHbOirnE62eVQyn7tPLnlZQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-237-Nk7BxkK8OdaM9SPATUsv_A-1; Fri, 10 Jun 2022 03:58:23 -0400 X-MC-Unique: Nk7BxkK8OdaM9SPATUsv_A-1 Received: by mail-wm1-f70.google.com with SMTP id p18-20020a05600c23d200b0039c40c05687so6230356wmb.2 for ; Fri, 10 Jun 2022 00:58:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/1crx0vve3way+UwYuSFBl+pY/N1VbYbCvLxJyL9VgE=; b=EPc5+K9FfuoQqFuyxvzCLmRUmOwr0lciwZbn7vEuwWfOm9vqqligSOVPClPn3taZkB zhT63Ks1cYYuf79Idy15DdMIxIxEPlGpSrNK0hcEnh6Gv32uvYa7kh/JX2PEWi17+9fc hDLjfK17/yB1hXAnX1ThEnN/wqKoy6Fip//NcvwfQK1OVUA2Oc6mK9LGTbWPPTWeky6S 5hb+NdeLOw2+744FuP4dOqEg9LExFza6LBwTKyJxyak4TmGasLQJRPWZERf7BGBreOB7 ptyvur513wT/w+Fvx1H+hoP09JsqgBJylnTtMT76w6/7ZOGqMFCE0+zkcUAEA4TO+Qym HpGA== X-Gm-Message-State: AOAM531h6jKaCKIbfygdFt2FM66KcOUxcfu23p46eFS0ITqXzWvIXw5z o9z4qHQFD3JZV9UlWf62R/CwHq1FDctJdrfscgQ8bfNNDPp0ZU3CUOoAdGyiwNzvH2gHsfrx/Qa YjhBhruz0iURDO/FeFRV4kHnoydzBGlZqDEoJFDA6H/ZlpAFC5gKKWctxok6I X-Received: by 2002:adf:fa8b:0:b0:214:1f4f:5e71 with SMTP id h11-20020adffa8b000000b002141f4f5e71mr35309365wrr.149.1654847901986; Fri, 10 Jun 2022 00:58:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9EvJrXPG9vD73UMX3KOsnjx1wnLAPPNJygAkWvx/RDxqAw+4A4gBThIGXcEfdIUT/aMnkOg== X-Received: by 2002:adf:fa8b:0:b0:214:1f4f:5e71 with SMTP id h11-20020adffa8b000000b002141f4f5e71mr35309333wrr.149.1654847901582; Fri, 10 Jun 2022 00:58:21 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c050700b0039749b01ea7sm2300914wmc.32.2022.06.10.00.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:21 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:19 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 26/54] tests: acpi: white-lists expected DSDT.pvpanic-isa blob Message-ID: <20220610075631.367501-27-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-27-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + tests/data/acpi/q35/DSDT.pvpanic-isa | 0 2 files changed, 1 insertion(+) create mode 100644 tests/data/acpi/q35/DSDT.pvpanic-isa diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..d5cd7aa4f5 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.pvpanic-isa", diff --git a/tests/data/acpi/q35/DSDT.pvpanic-isa b/tests/data/acpi/q35/DSDT.pvpanic-isa new file mode 100644 index 0000000000..e69de29bb2 From patchwork Fri Jun 10 07:58:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641725 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=entCqLXD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDvg08qWz9s09 for ; Fri, 10 Jun 2022 18:41:19 +1000 (AEST) Received: from localhost ([::1]:53044 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaCh-0002pb-Gy for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:41:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXK-0000mN-Sc for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58722) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXJ-0006Jq-DW for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847907; 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=weiTji5w6RfPO8HsfZs/BxaRyuDX9+G1lexlo1ANaI8=; b=entCqLXD2WQYJl8nFW8tYkp2/aZr5mfOHpkWRunZ3Gm7k9uuAZTDV1N3UEUyRnXfwpB2hb tHP/WKKYeNrPB6PDKBpb9RgaDZX2mmRxLpq3uP/sR3H2Lp7TAgNDR5zcknGALc1g0rIsoj vzHd6Cg5CgOZXAC9OanwO/43lYdZbEk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-443--L-QoAxoPnGnwbIedhCi3g-1; Fri, 10 Jun 2022 03:58:26 -0400 X-MC-Unique: -L-QoAxoPnGnwbIedhCi3g-1 Received: by mail-wm1-f70.google.com with SMTP id c125-20020a1c3583000000b003978decffedso941994wma.5 for ; Fri, 10 Jun 2022 00:58:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=weiTji5w6RfPO8HsfZs/BxaRyuDX9+G1lexlo1ANaI8=; b=qlWVyYVFHKD2PztQNua6YhLehJSw5vMv3lt8cN0wfN+INMNaYJFlNhRBndpVXSJld4 Y5d3LGQ5wGpei9PnUYpJeqYHkUP8Idb0/Ry+vo2C3A1Zgax0LtNZaDLRZXs8+Rsu3OKA iETV8rsuQEPZGVet9TZz62hjdb7ujt28CnAT37mQnrc+hgOGUr9ixFXVQFYhPG3egGJB euaTmfsMA1UVpZ/gqDRuJ6wsHBhWd6QFF5DUZj5qYGR/MNJWE3q1kGGiJ1SW8Y89M3f7 Z+N9NiES8rGULU3vdWghCqHmCM1y+DeA2vO/w0P7rqHsfilbnXKTrOabsBobdxv9hNJk /D/A== X-Gm-Message-State: AOAM531AT0/3Rms/4pADDhWj/whNNSN3K8kLLWuVO57TgW1Y3UVht4WP mH5c0lWxdu+o69FOZGQkskcEt1QZqG3PB6P3Vgb0LIOZSygjRyksUbvFEjKi/wqY6NDu1yWvMzz zh7QrQtE8LmBe71q23cpOaw7ybQZ5j94XLWAoo12cJJT2eWoryI9VsGA9v12C X-Received: by 2002:a05:6000:1006:b0:210:353e:32b2 with SMTP id a6-20020a056000100600b00210353e32b2mr42370534wrx.303.1654847905227; Fri, 10 Jun 2022 00:58:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlWN/ZI69aplmqUMVIxefgcEOTH60BdkKTer1+fqg0v2D9KsqZwHuAecZWKdjA2wOG4fwQ8A== X-Received: by 2002:a05:6000:1006:b0:210:353e:32b2 with SMTP id a6-20020a056000100600b00210353e32b2mr42370467wrx.303.1654847904159; Fri, 10 Jun 2022 00:58:24 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l4-20020a5d5604000000b0020fffbc122asm31552259wrv.99.2022.06.10.00.58.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:23 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:21 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha Subject: [PULL 27/54] tests: acpi: add pvpanic-isa: testcase Message-ID: <20220610075631.367501-28-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-28-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 7d238218ca..56498bbcc8 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1636,6 +1636,17 @@ static void test_acpi_q35_applesmc(void) free_test_data(&data); } +static void test_acpi_q35_pvpanic_isa(void) +{ + test_data data = { + .machine = MACHINE_Q35, + .variant = ".pvpanic-isa", + }; + + test_acpi_one("-device pvpanic", &data); + free_test_data(&data); +} + static void test_oem_fields(test_data *data) { int i; @@ -1795,6 +1806,7 @@ int main(int argc, char *argv[]) qtest_add_func("acpi/piix4/acpierst", test_acpi_piix4_acpi_erst); qtest_add_func("acpi/q35/acpierst", test_acpi_q35_acpi_erst); qtest_add_func("acpi/q35/applesmc", test_acpi_q35_applesmc); + qtest_add_func("acpi/q35/pvpanic-isa", test_acpi_q35_pvpanic_isa); qtest_add_func("acpi/microvm", test_acpi_microvm_tcg); qtest_add_func("acpi/microvm/usb", test_acpi_microvm_usb_tcg); qtest_add_func("acpi/microvm/rtc", test_acpi_microvm_rtc_tcg); From patchwork Fri Jun 10 07:58:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641776 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=O+on4Pkd; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFS66SGPz9s0r for ; Fri, 10 Jun 2022 19:05:58 +1000 (AEST) Received: from localhost ([::1]:52040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaaa-0007JS-M0 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:05:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35498) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXM-0000si-Qn for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:38913) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXK-0006Jy-UJ for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847910; 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=M1tXPwk1x35lNtfWSfsKo03wk7orBSjzeUaNq+cCX/Q=; b=O+on4PkdgXKj6CD41+aOn9b5F5lIy+YnaQ7enpuLwRT2ima0UxwQWz9h2bVtq3L+FMAdkg /J1UQdGmTsCuJjXIbpx66RslRvacatIVU3T4e9iiuNb7l0G2xm951gA4viiKhKDJbpU8vx WJjO/zIafA1zSlJJL+rjc9FbC+thX5o= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-425-7Gco0GuiMU-_xojMdW5mYQ-1; Fri, 10 Jun 2022 03:58:29 -0400 X-MC-Unique: 7Gco0GuiMU-_xojMdW5mYQ-1 Received: by mail-wm1-f72.google.com with SMTP id m23-20020a05600c3b1700b0039c6e3c169aso960512wms.2 for ; Fri, 10 Jun 2022 00:58:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=M1tXPwk1x35lNtfWSfsKo03wk7orBSjzeUaNq+cCX/Q=; b=mm3c1Pnn/lnQpv+2ijsX0Y2ZQOWSpVpTfic52jf9/0cim/vBYaur2gWa/2cWsyirKb oyjvyCF1JAGe1vgdVjzdyuCZvXSo0TanfVi9X0KfDSDDhwO5EkWyCHBmDJl/6VDty7R9 xedy1VEVFdzJZY7nCW+5Gs3FHdlEAH9LM4BiEylQW1kacJl44e+e7a/BGDOxfOYyVpnq T6bhDQS2AFo4koK4bq8vnjNayWZa/1ipOhBSkCTyjZipFVKVvHaSzbD/vTchOgOTK5k+ oVz8PkZK7lk1K4LJH5WmwKd1Y7TibVMwT/iiwfY1oU/Db3ccIruC4YriWTEWChzl6cIO xndg== X-Gm-Message-State: AOAM530mzhZCZxDaCLz91MCSROiZhAktsnjpCXANOr1MJ8R6D1wqmZyC CDLj2crKg5XXAFPtbGwRPhHYfa4xz5Majg9gcRcmzcz2IYDPNS+JbemraqqFpb1s0EWpCTBiN3D xGP0Tbzl/5J/JRp3QgRwiSpXRnComFhSawngWAhv6sYuWi2L3yPGJr0VJJDEy X-Received: by 2002:a7b:c1cf:0:b0:39c:4460:cfa8 with SMTP id a15-20020a7bc1cf000000b0039c4460cfa8mr7350670wmj.21.1654847907557; Fri, 10 Jun 2022 00:58:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBoOrjjCwMQ1Z1dJuEMFHCqTbscsJiEU0sMQUNzFcOVQq2iKNPgwpZibMwuDHrG0rLtlxyfg== X-Received: by 2002:a7b:c1cf:0:b0:39c:4460:cfa8 with SMTP id a15-20020a7bc1cf000000b0039c4460cfa8mr7350642wmj.21.1654847907269; Fri, 10 Jun 2022 00:58:27 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id ay40-20020a05600c1e2800b00397623ff335sm2069419wmb.10.2022.06.10.00.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:26 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:24 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 28/54] acpi: pvpanic-isa: use AcpiDevAmlIfClass:build_dev_aml to provide device's AML Message-ID: <20220610075631.367501-29-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov .. and clean up not longer needed conditionals in DSTD build code pvpanic-isa AML will be fetched and included when ISA bridge will build its own AML code (including attached devices). Expected AML change: the device under separate _SB.PCI0.ISA scope is moved directly under Device(ISA) node. Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-29-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/misc/pvpanic.h | 9 --------- hw/i386/acpi-build.c | 37 ---------------------------------- hw/misc/pvpanic-isa.c | 42 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 46 deletions(-) diff --git a/include/hw/misc/pvpanic.h b/include/hw/misc/pvpanic.h index 7f16cc9b16..e520566ab0 100644 --- a/include/hw/misc/pvpanic.h +++ b/include/hw/misc/pvpanic.h @@ -33,13 +33,4 @@ struct PVPanicState { void pvpanic_setup_io(PVPanicState *s, DeviceState *dev, unsigned size); -static inline uint16_t pvpanic_port(void) -{ - Object *o = object_resolve_path_type("", TYPE_PVPANIC_ISA_DEVICE, NULL); - if (!o) { - return 0; - } - return object_property_get_uint(o, PVPANIC_IOPORT_PROP, NULL); -} - #endif diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index b96705c688..bbe02b068e 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -31,7 +31,6 @@ #include "hw/cxl/cxl.h" #include "hw/core/cpu.h" #include "target/i386/cpu.h" -#include "hw/misc/pvpanic.h" #include "hw/timer/hpet.h" #include "hw/acpi/acpi-defs.h" #include "hw/acpi/acpi.h" @@ -120,7 +119,6 @@ typedef struct AcpiMiscInfo { #endif const unsigned char *dsdt_code; unsigned dsdt_size; - uint16_t pvpanic_port; } AcpiMiscInfo; typedef struct AcpiBuildPciBusHotplugState { @@ -305,7 +303,6 @@ static void acpi_get_misc_info(AcpiMiscInfo *info) #ifdef CONFIG_TPM info->tpm_version = tpm_get_version(tpm_find()); #endif - info->pvpanic_port = pvpanic_port(); } /* @@ -1798,40 +1795,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, aml_append(dsdt, scope); } - if (misc->pvpanic_port) { - scope = aml_scope("\\_SB.PCI0.ISA"); - - dev = aml_device("PEVT"); - aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0001"))); - - crs = aml_resource_template(); - aml_append(crs, - aml_io(AML_DECODE16, misc->pvpanic_port, misc->pvpanic_port, 1, 1) - ); - aml_append(dev, aml_name_decl("_CRS", crs)); - - aml_append(dev, aml_operation_region("PEOR", AML_SYSTEM_IO, - aml_int(misc->pvpanic_port), 1)); - field = aml_field("PEOR", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); - aml_append(field, aml_named_field("PEPT", 8)); - aml_append(dev, field); - - /* device present, functioning, decoding, shown in UI */ - aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); - - method = aml_method("RDPT", 0, AML_NOTSERIALIZED); - aml_append(method, aml_store(aml_name("PEPT"), aml_local(0))); - aml_append(method, aml_return(aml_local(0))); - aml_append(dev, method); - - method = aml_method("WRPT", 1, AML_NOTSERIALIZED); - aml_append(method, aml_store(aml_arg(0), aml_name("PEPT"))); - aml_append(dev, method); - - aml_append(scope, dev); - aml_append(dsdt, scope); - } - sb_scope = aml_scope("\\_SB"); { Object *pci_host; diff --git a/hw/misc/pvpanic-isa.c b/hw/misc/pvpanic-isa.c index b84d4d458d..ccec50f61b 100644 --- a/hw/misc/pvpanic-isa.c +++ b/hw/misc/pvpanic-isa.c @@ -22,6 +22,7 @@ #include "qom/object.h" #include "hw/isa/isa.h" #include "standard-headers/linux/pvpanic.h" +#include "hw/acpi/acpi_aml_interface.h" OBJECT_DECLARE_SIMPLE_TYPE(PVPanicISAState, PVPANIC_ISA_DEVICE) @@ -63,6 +64,41 @@ static void pvpanic_isa_realizefn(DeviceState *dev, Error **errp) isa_register_ioport(d, &ps->mr, s->ioport); } +static void build_pvpanic_isa_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + Aml *crs, *field, *method; + PVPanicISAState *s = PVPANIC_ISA_DEVICE(adev); + Aml *dev = aml_device("PEVT"); + + aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0001"))); + + crs = aml_resource_template(); + aml_append(crs, + aml_io(AML_DECODE16, s->ioport, s->ioport, 1, 1) + ); + aml_append(dev, aml_name_decl("_CRS", crs)); + + aml_append(dev, aml_operation_region("PEOR", AML_SYSTEM_IO, + aml_int(s->ioport), 1)); + field = aml_field("PEOR", AML_BYTE_ACC, AML_NOLOCK, AML_PRESERVE); + aml_append(field, aml_named_field("PEPT", 8)); + aml_append(dev, field); + + /* device present, functioning, decoding, shown in UI */ + aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); + + method = aml_method("RDPT", 0, AML_NOTSERIALIZED); + aml_append(method, aml_store(aml_name("PEPT"), aml_local(0))); + aml_append(method, aml_return(aml_local(0))); + aml_append(dev, method); + + method = aml_method("WRPT", 1, AML_NOTSERIALIZED); + aml_append(method, aml_store(aml_arg(0), aml_name("PEPT"))); + aml_append(dev, method); + + aml_append(scope, dev); +} + static Property pvpanic_isa_properties[] = { DEFINE_PROP_UINT16(PVPANIC_IOPORT_PROP, PVPanicISAState, ioport, 0x505), DEFINE_PROP_UINT8("events", PVPanicISAState, pvpanic.events, @@ -73,10 +109,12 @@ static Property pvpanic_isa_properties[] = { static void pvpanic_isa_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); dc->realize = pvpanic_isa_realizefn; device_class_set_props(dc, pvpanic_isa_properties); set_bit(DEVICE_CATEGORY_MISC, dc->categories); + adevc->build_dev_aml = build_pvpanic_isa_aml; } static const TypeInfo pvpanic_isa_info = { @@ -85,6 +123,10 @@ static const TypeInfo pvpanic_isa_info = { .instance_size = sizeof(PVPanicISAState), .instance_init = pvpanic_isa_initfn, .class_init = pvpanic_isa_class_init, + .interfaces = (InterfaceInfo[]) { + { TYPE_ACPI_DEV_AML_IF }, + { }, + }, }; static void pvpanic_register_types(void) From patchwork Fri Jun 10 07:58:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=aH8A5ztf; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFmQ3LrDz9s0r for ; Fri, 10 Jun 2022 19:20:05 +1000 (AEST) Received: from localhost ([::1]:60492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaoD-000519-MK for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:20:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXP-00013N-QH for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36056) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXN-0006KG-QB for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847913; 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=kxCfGXt/xIo9/mDOHsdcWZfRGIFMgjOzCdJkdJusL5A=; b=aH8A5ztfKSpjel6Z36aNEE6/0wuWcarWWiG49vfnUDvcGeovNXW1XEC/ZwOiLC/5CIT8mj +IyVDvrBSKQjELtyMHXgXhQ/PWpE0NxK+t3yB0t2VqjdkgQOJeDZJk1+IFKeWI2ZEhh/6Z fBcH22Y/HmXEKm11VYlOtzalt6JUV0o= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-459-nDNjWSgpOsuJdTi1-J99bw-1; Fri, 10 Jun 2022 03:58:31 -0400 X-MC-Unique: nDNjWSgpOsuJdTi1-J99bw-1 Received: by mail-wm1-f71.google.com with SMTP id p18-20020a05600c23d200b0039c40c05687so6230477wmb.2 for ; Fri, 10 Jun 2022 00:58:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kxCfGXt/xIo9/mDOHsdcWZfRGIFMgjOzCdJkdJusL5A=; b=3y6QuzpltKSQAWLV8piJmezd8Itzfpbeo1e3PU7Da0RW5jA4QuWCRyZIoEQZR/cwjw /3wuNpa/KhWsA31otQn1rAmLz2nsj1V28SFl9+L/sr9Cdgj3iPd9KZA2JT+u/tcVZxNN rOSFaImLpZRLRWnISDsjI5Byp3UYoMpccmeW4yVD4/ZjgJeczzu41VlmkAjPtS4P5LUx ldythJJAKDGbxTtQA+NNyAGb049ibwH+HraXzaPt95vVJkGEN4BNqdF2sYM6qJiiwkwE cpuK6uWkUVporIneUacae9z6Y4jI4WF0RvQ79NsCY5JYSLVc9EjyJpBt47sI3ukZQ9Qy aAlA== X-Gm-Message-State: AOAM533krp2ccNWVE7n2xQ8f+XNcle6Uzyt8WZVaDqGBqICXKeytt1Cr BK9hOfLwlKfXndYdVE2F3gRQvAVwog3mrLGxdBZe5Rn80I8mZ0GU5xPqI28hCW6BSGuyYtKEraT au7aGC9v0AIsTTDdkO3bza27YsFyHAAs0W9gsj+mD3WRu7GTCqIb9jt9q9Gsq X-Received: by 2002:a05:6000:1788:b0:219:e28f:dc98 with SMTP id e8-20020a056000178800b00219e28fdc98mr4058363wrg.144.1654847910024; Fri, 10 Jun 2022 00:58:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlyKbi6p+qNskBulXGdacfrn4Eg23ZpX101oM9I6xew+9f/B5Px7NCvwCcRAybNr1au1q0Ew== X-Received: by 2002:a05:6000:1788:b0:219:e28f:dc98 with SMTP id e8-20020a056000178800b00219e28fdc98mr4058336wrg.144.1654847909689; Fri, 10 Jun 2022 00:58:29 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l29-20020a05600c1d1d00b0039c3056c3dfsm2649082wms.27.2022.06.10.00.58.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:29 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 29/54] tests: acpi: update expected DSDT.pvpanic-isa blob Message-ID: <20220610075631.367501-30-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov @@ -145,6 +145,37 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) + Device (PEVT) + { + Name (_HID, "QEMU0001") // _HID: Hardware ID + Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings + { + IO (Decode16, + 0x0505, // Range Minimum + 0x0505, // Range Maximum + 0x01, // Alignment + 0x01, // Length + ) + }) + OperationRegion (PEOR, SystemIO, 0x0505, One) + Field (PEOR, ByteAcc, NoLock, Preserve) + { + PEPT, 8 + } + + Name (_STA, 0x0F) // _STA: Status + Method (RDPT, 0, NotSerialized) + { + Local0 = PEPT /* \_SB_.PCI0.ISA_.PEVT.PEPT */ + Return (Local0) + } + + Method (WRPT, 1, NotSerialized) + { + PEPT = Arg0 + } + } + Device (KBD) { Name (_HID, EisaId ("PNP0303") /* IBM Enhanced Keyboard (101/102-key, PS/2 Mouse) */) // _HID: Hardware ID @@ -3246,40 +3277,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) } } - Scope (\_SB.PCI0.ISA) - { - Device (PEVT) - { - Name (_HID, "QEMU0001") // _HID: Hardware ID - Name (_CRS, ResourceTemplate () // _CRS: Current Resource Settings - { - IO (Decode16, - 0x0505, // Range Minimum - 0x0505, // Range Maximum - 0x01, // Alignment - 0x01, // Length - ) - }) - OperationRegion (PEOR, SystemIO, 0x0505, One) - Field (PEOR, ByteAcc, NoLock, Preserve) - { - PEPT, 8 - } - - Name (_STA, 0x0F) // _STA: Status - Method (RDPT, 0, NotSerialized) - { - Local0 = PEPT /* \_SB_.PCI0.ISA_.PEVT.PEPT */ - Return (Local0) - } - - Method (WRPT, 1, NotSerialized) - { - PEPT = Arg0 - } - } - } - Scope (\_SB) { Scope (PCI0) Signed-off-by: Igor Mammedov Message-Id: <20220608135340.3304695-30-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/DSDT.pvpanic-isa | Bin 0 -> 8375 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/DSDT.pvpanic-isa b/tests/data/acpi/q35/DSDT.pvpanic-isa index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cc545b5d2505246d33f83d2482273968aa1be032 100644 GIT binary patch literal 8375 zcmb7JOKcm*8J^`!tK~{sQk3LZY{E&?~(R|lb;iIo;;J&VO^} z)XzV^_)huW&;I#~+pk+G0M6mBiNEJ#xAeAd5ed_Z*mY;~~sS)V@^Wez=w zBPzLTiz2FO_2BjH{)=9_?D96w1+AdumR8X&w;krrSf@T-Va%q^q2Hf|!{J}WEpu)# zr)dh6zF80aj#Ozt8>#B<)q_rx*^J%)Hp^1on-0Z`FZ(U87__}!vG9B^?37tdB~eU8 z+wVn|6AkQ7`w{C$+2Qbj4dy@XZ?oTR+w9-}OCPWUYeBRvXU%^!OKrLTElV+m*3?&? zrshzGclXzp8)3P}I~ff)gT@4n_GZG0EE}Ve3H+Bud*?R&=2oe6D0$AZYDOAA!?-~t zf1_<=5n(Ry`@j!67)7+(S}4r7y`aNlDvJ)Hf_9f@D-TiaxL1$Igof5Oi(6Ej* zS2NyCzMC}7vwOVebM8j-kdp=)V>E^HAo(E4%(D*XJlXEJhpowuW(BW0W-&9&vkblD zv~mwSelKvtj*-1*TP6ma0v7|aRm8A&BB-L`V_cPL@WU3 z#WT(WREESv{T!R%OkhV5F(ov?I1^CLL`Y1uhGUbQDO-?a#FWsaU;@gS2#G1PV6_S? zuP4Qs5}FcB*?5Gi&a|d8&6yIK7EIZAgsRSrrZdBt5}MI9&fI%jpA2vwbyrqj}NTDnezs?MyYGpp&$>N*jsI`Mv0#?#hx z+PY4Js?Ir0=bWZD>pBstIu|sZ3!2UaT_-|Sr=#g~G@XvF6QQaz zr|HaTI&->CgsRTGrZcbU%u8LB#AprTsNgn=qhGEjul70EymN}VuJf#pmX zr~)Me6;Pg&3>2Z%2?G^a&V+#~P%=;fAz;Y%GRDqI#3Mglifg+ST zVW0xbnJ`cVN(L&RoJj_XQ0jz%3M^;BKouw%sDN@N87M-j69y``0?L_Wpa`W-7^uKf}LawZulLa7r5DzKah16818paRO7WS|J8P8g`bawZH^ zfs%m=C})y^B9uB|paRR8Fi-_b1}dPONd}5g>V$zJQVbN4YM=;J14XD9sKSJSDoip^ zg-HggFkzqy69%d<$v_n*8K}a9fhtTGsKO)zRhVR;3KIsZFkzqylMGa0l7T8r7$_n+ zx-d{g7%|?NWS|H!3^F99>{}QpBH6bvP(-qC$v_dxz9j=ihz+O{Jy<9k*nR%b>H+;j zdN)IV%H5kkc_vB!rP6*1?V%V!d$SD3-K@~XrHf}W?C5OzbYG=QjV^Vwu-MqdZopvn zeQR$QTQ{=@R<`hLW7BQV0?;ny=B?}}88*xJmu|4zRA!}dZN%^IS__Qs(1y_R3gxY@U4Q>=h+@g=epzeQNefVS4sTcfU#6 z#ReTV5l7ms#3Q74mGmx8?~bK+k4W#1(tBg#Eo^9gXZ4%>Ag{Ue>{Ea z5z_lgdY`BF$I|;pr1wYZtK;d@kC48qq_6Vy)v@%|Bhpt#>1*TZGmntIrlha&^tG|{ zwIkBkM(OM0>1Q4xeO*ak=jrQX>FY^|C^SFM0f- zbv>$Xd>LCgy*hkrOjIYzrdBtxF7tYI_yC!xPLxfpZepEb3z*iK6o#*oiRwhz)aoYI zO+l{?pDGj8iL$BHO{{|@y*hlqOjIYzrdBsGub1`e@KG~SohX}H-NZay(W}Fk&O~*h zOs~#4`EWmbe<5sEaDaou8as(|1ZU$VapqCCE@_!94Krp`h*^LB64!$U ziAK(q-JpRZj}kRQ97m-KIk!`NH8HUIyX+$u2O?Js^$d3J%d_3bFFlh|g^~c;ejhJJ zvY17K6aDcABq6pIu{ph^->Xg2Tt;BdKL9dM$qMN6- zuKVGOG^ert@x$`KyfzPLc4GxJ%bi@-G8uLo=sUD9kE7U5mc+2#tJexAv3P2M-}6i7 z*l5MmLZUh4Y^3NBU-+XnReGKkehlm?qmDRyKZp}6r66!yyrmk#X)cMC$`6J33G9We z_2*l2EP*Wo{DySFiQxnLfo+&5H}Fov?;AXRU?0YFI74FWzx?QyKc~;);gCLy>6c*I zp{|KztUrn;><`+LdpPa=Ry?`)((R{k5Im|)lu>Wd85lZF`%z4Xlx_;0BhJ40xpEnu zBVLVEuDlb)!DUuBIDaP=GsTR-PdYE8f_l&vT}+454=X_@O?kgg)^*RmXB)?GO! X-Patchwork-Id: 1641844 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CCrGLDXo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFzX2TPRz9s0r for ; Fri, 10 Jun 2022 19:29:44 +1000 (AEST) Received: from localhost ([::1]:41024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaxZ-0003Xc-E7 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:29:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXR-00017x-1t for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:37 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:34783) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXP-0006KN-Hm for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847915; 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=7IWfIBrFepbsxN61C4a58DCenvK50R6Ziy2eNT6bJSE=; b=CCrGLDXop+JSSThxPbo6L5aREaRVOKvnahrOOy6UFKFyTjszF4T7GSrXEXvfZyHRXvr8yn gK+orrbke8JRewb3avPcYTVc/B+HaPqVYMSINp9SEO6KmXDeLQ5q3+uVGh1kHIu0f4qvgY lqeEoYFIZ2UnDz0EZplSbmw5TY8TAFs= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-27-V7lV73ETMbuQSMif7bMieg-1; Fri, 10 Jun 2022 03:58:34 -0400 X-MC-Unique: V7lV73ETMbuQSMif7bMieg-1 Received: by mail-wm1-f70.google.com with SMTP id j20-20020a05600c1c1400b0039c747a1e5aso949628wms.9 for ; Fri, 10 Jun 2022 00:58:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=7IWfIBrFepbsxN61C4a58DCenvK50R6Ziy2eNT6bJSE=; b=I0Xv67BEa9tPVFi22gpmzqGxjoqEcqyDpVqVJ+DJXjivo/livqK2R5lIfFg1/9XNMx 6saidiZGftIOfvYE40HKqTXE9wTgyCuKkVrNI8nkWNY1uZemwewUos5I3b7ZxXbksQ0j VQUvxE5zphPhpHHD7F3REdn4FG7FH7KSKe2egLPWQg9BCuPl/HV3y0yC2xFO9U7n9fTK c29mpELpysq/G78iJ72yxIrDMOyoWkWoGYyJeDoK/OkQgYqXMIE2P4gjS5fjdHTSZR4/ pSzjuq0o755GPK3XpPz1G7IxywnzMCgZSDHWgm7xVEL6zZIO+LqAzV4JHVYFLZ7+GNKy 65FQ== X-Gm-Message-State: AOAM532u249YmuXI8FLk+M5hAWHv6z7431u9uit9P5C0zfTWOhII9QQe eIA2hMhZ3NrK1RmGvCLb635DaPLBC56a5YxGoKj7p2CnA+ujFcu4MX2avNGMQNAuPNrOCmsZN2l +WpljKqRPnn5HJrxF9O77zoTjR1Wk7wlWRYVzyMahQ9aFwm1ju8DcTeWpvhUL X-Received: by 2002:a5d:6745:0:b0:214:d2b:6fe7 with SMTP id l5-20020a5d6745000000b002140d2b6fe7mr37879943wrw.82.1654847912561; Fri, 10 Jun 2022 00:58:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcTzfhK0p7ZUoY0T/3M6vFVcyTGh/8C3ocR2pGu24q0/xINOAs8iFYnkBJoYy5Tbq0fuQYPg== X-Received: by 2002:a5d:6745:0:b0:214:d2b:6fe7 with SMTP id l5-20020a5d6745000000b002140d2b6fe7mr37879925wrw.82.1654847912318; Fri, 10 Jun 2022 00:58:32 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id h12-20020a5d6e0c000000b0020ff877cfbdsm26309849wrz.87.2022.06.10.00.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:31 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:29 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 30/54] tests: acpi: white-list DSDT.tis.tpm2/DSDT.tis.tpm12 expected blobs Message-ID: <20220610075631.367501-31-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TVD_SPACE_RATIO=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Acked-by: Ani Sinha Message-Id: <20220608135340.3304695-31-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..7b3bf9a207 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,3 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/DSDT.tis.tpm2", +"tests/data/acpi/q35/DSDT.tis.tpm12", From patchwork Fri Jun 10 07:58:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641748 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=HqaaFEFa; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKF4D4zXgz9s09 for ; Fri, 10 Jun 2022 18:48:44 +1000 (AEST) Received: from localhost ([::1]:33340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaJu-0000oO-KG for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:48:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXg-0001f4-Bu for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31634) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXe-0006Lu-Tt for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847930; 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=g4U9bw5pSjHDx4BnmbquU3cG+Yy+OPvWEp846qgpgxU=; b=HqaaFEFa8wcffLPrNyb2DISrAFirGfVmL0C5+mfDN8D9h9uI5N4BBcrexXkguxg3CZf+Rk JbP+ZhlL3hb4NSUDyQvbMchUUekbm8gfJQxC5udIYKy7f/iA5Wltd6J2Nwva9Kja3BNaG8 D0oRhgHvEb1V8io09kaXl4X1Phx5pQE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-542-vkcdR_Z_OdilZ2iU34pE2w-1; Fri, 10 Jun 2022 03:58:37 -0400 X-MC-Unique: vkcdR_Z_OdilZ2iU34pE2w-1 Received: by mail-wm1-f71.google.com with SMTP id z13-20020a7bc7cd000000b0039c4a238eadso4999454wmk.9 for ; Fri, 10 Jun 2022 00:58:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=g4U9bw5pSjHDx4BnmbquU3cG+Yy+OPvWEp846qgpgxU=; b=Jp45T+2ku6gtpp8WmOB8vMFZ8p4l48Sd5mvVJL2cv1qxXWoV9uQCTwGe8fM9RzR9Fb LlLKDZp5pP0Vlj0Sw6Q/iECQi+PCgN0WrWNcQx7hSTyF0aYJh/LYEy1BaOCqdTFd4Sxv E9aWO7CuG2xNUXpfu/H4aOgFam+k5XkQTug6BKdwafsjMg0TPqsqMS33RUVFVbNVHjcz TTTA60ZQ7BD0XO93ewBnB3wa4+WRiCmSMsKwpWwWPWUlGejBi3Zb9NhfwFIsybnJxB67 v5+GW1LyND/8bTIkCggfGlvkWR73d03W5vDIiFRdchsxlzT74Oi0NWOeYrym6QQrYNMf 3Fww== X-Gm-Message-State: AOAM531P3Cp5bmUAdLmEW5lkiREaoCwrx3RUAY2CsFbm7RUCQGBJWDbi U0DkQTCWsmfcQ2G8yvR7ExgTzIJX3tvR34aHOtMlwkrJd3q3p7oThu1a0jAtQoScUJgte3VpPmt HKTdTsFdfYnCg8hdmSLHnom+8sA33bhljDM17qJvRFl8tfVLutQ5EIH+CK+Lm X-Received: by 2002:a05:6000:1c02:b0:218:42ab:281f with SMTP id ba2-20020a0560001c0200b0021842ab281fmr24186962wrb.607.1654847915632; Fri, 10 Jun 2022 00:58:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyVC8d4hpfx44o18cb9H36abqADrJILByXcETDU1ny/htjNDJwlBAUT2GVl2DkDyFpyouHuA== X-Received: by 2002:a05:6000:1c02:b0:218:42ab:281f with SMTP id ba2-20020a0560001c0200b0021842ab281fmr24186934wrb.607.1654847915364; Fri, 10 Jun 2022 00:58:35 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id q18-20020a5d61d2000000b0020d0c9c95d3sm23589645wrv.77.2022.06.10.00.58.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:35 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:32 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 31/54] acpi: pc/q35: tpm-tis: fix TPM device scope Message-ID: <20220610075631.367501-32-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov tpm-tis 2.0, is not a PCI device but ISA one, move it under ISA scope to fix incorrect placement. Fixes: 24cf5413aa0 (acpi: Make TPM 2.0 with TIS available as MSFT0101) Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-32-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index bbe02b068e..6b496480d2 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1813,15 +1813,14 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, #ifdef CONFIG_TPM if (TPM_IS_TIS_ISA(tpm)) { + dev = aml_device("ISA.TPM"); if (misc->tpm_version == TPM_VERSION_2_0) { - dev = aml_device("TPM"); aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device"))); } else { - dev = aml_device("ISA.TPM"); aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C31"))); } From patchwork Fri Jun 10 07:58:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641849 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=VJTR/wig; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKG5Z0Mn6z9s0r for ; Fri, 10 Jun 2022 19:34:58 +1000 (AEST) Received: from localhost ([::1]:49578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzb2d-0001EY-I9 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:34:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXe-0001dQ-G3 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXd-0006Lb-1b for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847928; 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=zi1f1xIZDpfajJzSX/eZblV3mOswJWDLXbmw9h13TIA=; b=VJTR/wigLsjGSRfMGzyx5hu7xUo8Cdyxvr928jEPrskge2erkmq5kANp1laH/+dXuszLyr YJ3T+58Gl5ihp+POb/8FvLV/nyet877pWVXYPJdH7yDdOdpBux0HQskswleYmMWX0v6rHM lhuYtB8So2syFuo+VSthjog3hl6zYmo= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-287-lkjOZ3i2OPes8qthshJL-Q-1; Fri, 10 Jun 2022 03:58:40 -0400 X-MC-Unique: lkjOZ3i2OPes8qthshJL-Q-1 Received: by mail-wm1-f72.google.com with SMTP id k16-20020a7bc310000000b0038e6cf00439so978350wmj.0 for ; Fri, 10 Jun 2022 00:58:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=zi1f1xIZDpfajJzSX/eZblV3mOswJWDLXbmw9h13TIA=; b=d1lUEutKtlxanXAJoFGixF0ehncxMApuYD84LhfgQ99YVYEp+GxrtOypU+brSAvRIN aQZmRrV26YFCq/jViB0k9OOo9nnm+E4JjJgOhaVE+9ivcbvytexUHgqu5YPV82po3hUJ QEifvUm8FCoXgJe17bj1L4FrrQ26Sy7tvdNK71Va8gBSFEZ27PdfIh4VNF2PYdlg87O6 Ahsm+uFMIYu691y9KS6Y5nU+XxWt7sX2OFr8RdnJqc6cccsgHglxZoNnkp+SopegXK9X amlWr8FUld6RwZUGg2ooO30ony5ejjemi9PQbOqcyMMZJ80g0A/WFbQC1P9Mh9utPCpZ N+Cw== X-Gm-Message-State: AOAM530gNXHK6sY4u7usW8MA+dByl9ix1ZGYaJIRUvso1GGfv+JPTfCS Ox0Gn7Fwa4bPpPVL1qDXR+JgHbXMYu7lqcSMBosqfy2MH1Od4sIrG8YVdifSd8hfT/eqgqg0dnQ mKtcos9tO77dJzOlbIiL4Y9avS+xP773ocGdHwHD76r8J4RYJdHFhrwThJ13J X-Received: by 2002:adf:e3cf:0:b0:219:e523:905f with SMTP id k15-20020adfe3cf000000b00219e523905fmr2683099wrm.240.1654847918813; Fri, 10 Jun 2022 00:58:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJN8A/BbUEYP0+J0aGTl17UrcLBFZ3NOQPKmXfY6hJzXlsnlN8Uqe1OwyQqTbmN/chNU+kPw== X-Received: by 2002:adf:e3cf:0:b0:219:e523:905f with SMTP id k15-20020adfe3cf000000b00219e523905fmr2683079wrm.240.1654847918598; Fri, 10 Jun 2022 00:58:38 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id h7-20020a7bc927000000b0039740903c39sm2067545wml.7.2022.06.10.00.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:38 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:35 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Gerd Hoffmann , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 32/54] acpi: pc/q35: remove not needed 'if' condition on pci bus Message-ID: <20220610075631.367501-33-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-33-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 6b496480d2..1204b6da05 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1797,16 +1797,10 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, sb_scope = aml_scope("\\_SB"); { - Object *pci_host; - PCIBus *bus = NULL; - - pci_host = acpi_get_i386_pci_host(); + Object *pci_host = acpi_get_i386_pci_host(); if (pci_host) { - bus = PCI_HOST_BRIDGE(pci_host)->bus; - } - - if (bus) { + PCIBus *bus = PCI_HOST_BRIDGE(pci_host)->bus; Aml *scope = aml_scope("PCI0"); /* Scan all PCI buses. Generate tables to support hotplug. */ build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en); From patchwork Fri Jun 10 07:58:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641757 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MDsZhaUD; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFLC62sNz9s0r for ; Fri, 10 Jun 2022 19:00:51 +1000 (AEST) Received: from localhost ([::1]:43804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaVd-0000le-F8 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:00:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXm-0001m1-8b for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50148) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXk-0006MQ-HE for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847936; 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=Mk7wcvmxLiyC1kUo6mYTYwgkOqmzZq4GWw1BDaiCecM=; b=MDsZhaUD+ZRhWJIdxgWvHP5jfvUHSpBoPvD3683ISW3Hl1fZnvs+rYl6AuWJau6OVZ5Urd gO4HOGzcJu61VmZRWRo4b2Lp8OgZiyvCJnejrbp4ivOjmxlKIqHpIjdrFweuMkYZmg20T8 8jxERKtIt6PqZMJKUXhnzB4++6wMme4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-397-2rTXaEumN66JGcOI-k-rsA-1; Fri, 10 Jun 2022 03:58:43 -0400 X-MC-Unique: 2rTXaEumN66JGcOI-k-rsA-1 Received: by mail-wm1-f71.google.com with SMTP id u12-20020a05600c19cc00b0038ec265155fso938378wmq.6 for ; Fri, 10 Jun 2022 00:58:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Mk7wcvmxLiyC1kUo6mYTYwgkOqmzZq4GWw1BDaiCecM=; b=tVZ7dccaSy05j0YSPAM7gOqBGbMSc/5gQGsG6PRybZ6QJoEu21xtuyuUxR7KaWuCZs E6EiwsLOBu9JJo29XDyTuw4LU5CCNS7LtE3Kvjo/fW7eP8fWOQHtPwmkz8O13eoFjiQK OzoYVhVaaFBAsx81yJQmI2yk2S+ekyXqbX3UP1TpWhFPU3Wv+snfh3QlFF3CKdmzgvzw hCiwFd0o6QCGbZhbrBt1/7A7uWDa40KWx/tSQR3B8xJ+sHmJLBnzMfM9OWKnJs+Uupe2 6KCX+2AW8+IwTLMaMLd40dvffbztNwaaStmGXQeLK2Y66JpIEVvhI4u4bu4fX1bKvvxV 9SUw== X-Gm-Message-State: AOAM531+njdxQIeJxmmae6nJDlYDhNQG7+bMvpbM+x5ZpYnCF9oQi0X9 xqSRk41XT/F+nMp5Bus24vWB35kV8jFlDfulYlWjzz6wylDwN6ZYYEXyL4cPDKymT3y6vd0sgTv dyfgID78j8jKKl5jOcbmGlbYW5sA6YoSxD1KBve8/4E7ya0ZS38h9k3xq5hqK X-Received: by 2002:adf:bc04:0:b0:211:800a:7788 with SMTP id s4-20020adfbc04000000b00211800a7788mr43296541wrg.46.1654847922014; Fri, 10 Jun 2022 00:58:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQXZ8NSna+Vne7Z+oeLV8qjwjRI/3KJB4Dps3PzMx6gZXdIF1FSMiU2PwcwpqKMzZYJ2+fuQ== X-Received: by 2002:adf:bc04:0:b0:211:800a:7788 with SMTP id s4-20020adfbc04000000b00211800a7788mr43296510wrg.46.1654847921695; Fri, 10 Jun 2022 00:58:41 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id g12-20020a5d46cc000000b0020fff0ea0a3sm26075525wrs.116.2022.06.10.00.58.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:41 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:38 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha , Gerd Hoffmann , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum , Stefan Berger Subject: [PULL 33/54] acpi: tpm-tis: use AcpiDevAmlIfClass:build_dev_aml to provide device's AML Message-ID: <20220610075631.367501-34-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov .. and clean up not longer needed conditionals in DSTD build code tpm-tis AML will be fetched and included when ISA bridge will build its own AML code (including attached devices). Expected AML change: the device under separate _SB.PCI0.ISA scope is moved directly under Device(ISA) node. Signed-off-by: Igor Mammedov Reviewed-by: Ani Sinha Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-34-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 34 ---------------------------------- hw/tpm/tpm_tis_isa.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 1204b6da05..0b65fc99cd 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1804,40 +1804,6 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, Aml *scope = aml_scope("PCI0"); /* Scan all PCI buses. Generate tables to support hotplug. */ build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en); - -#ifdef CONFIG_TPM - if (TPM_IS_TIS_ISA(tpm)) { - dev = aml_device("ISA.TPM"); - if (misc->tpm_version == TPM_VERSION_2_0) { - aml_append(dev, aml_name_decl("_HID", - aml_string("MSFT0101"))); - aml_append(dev, - aml_name_decl("_STR", - aml_string("TPM 2.0 Device"))); - } else { - aml_append(dev, aml_name_decl("_HID", - aml_eisaid("PNP0C31"))); - } - aml_append(dev, aml_name_decl("_UID", aml_int(1))); - - aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); - crs = aml_resource_template(); - aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, - TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); - /* - FIXME: TPM_TIS_IRQ=5 conflicts with PNP0C0F irqs, - Rewrite to take IRQ from TPM device model and - fix default IRQ value there to use some unused IRQ - */ - /* aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); */ - aml_append(dev, aml_name_decl("_CRS", crs)); - - tpm_build_ppi_acpi(tpm, dev); - - aml_append(scope, dev); - } -#endif - aml_append(sb_scope, scope); } } diff --git a/hw/tpm/tpm_tis_isa.c b/hw/tpm/tpm_tis_isa.c index 3477afd735..91e3792248 100644 --- a/hw/tpm/tpm_tis_isa.c +++ b/hw/tpm/tpm_tis_isa.c @@ -30,6 +30,7 @@ #include "tpm_prop.h" #include "tpm_tis.h" #include "qom/object.h" +#include "hw/acpi/acpi_aml_interface.h" struct TPMStateISA { /*< private >*/ @@ -138,10 +139,39 @@ static void tpm_tis_isa_realizefn(DeviceState *dev, Error **errp) } } +static void build_tpm_tis_isa_aml(AcpiDevAmlIf *adev, Aml *scope) +{ + Aml *dev, *crs; + TPMStateISA *isadev = TPM_TIS_ISA(adev); + TPMIf *ti = TPM_IF(isadev); + + dev = aml_device("TPM"); + if (tpm_tis_isa_get_tpm_version(ti) == TPM_VERSION_2_0) { + aml_append(dev, aml_name_decl("_HID", aml_string("MSFT0101"))); + aml_append(dev, aml_name_decl("_STR", aml_string("TPM 2.0 Device"))); + } else { + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C31"))); + } + aml_append(dev, aml_name_decl("_UID", aml_int(1))); + aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); + crs = aml_resource_template(); + aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, TPM_TIS_ADDR_SIZE, + AML_READ_WRITE)); + /* + * FIXME: TPM_TIS_IRQ=5 conflicts with PNP0C0F irqs, + * fix default TPM_TIS_IRQ value there to use some unused IRQ + */ + /* aml_append(crs, aml_irq_no_flags(isadev->state.irq_num)); */ + aml_append(dev, aml_name_decl("_CRS", crs)); + tpm_build_ppi_acpi(ti, dev); + aml_append(scope, dev); +} + static void tpm_tis_isa_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); TPMIfClass *tc = TPM_IF_CLASS(klass); + AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass); device_class_set_props(dc, tpm_tis_isa_properties); dc->vmsd = &vmstate_tpm_tis_isa; @@ -151,6 +181,7 @@ static void tpm_tis_isa_class_init(ObjectClass *klass, void *data) tc->request_completed = tpm_tis_isa_request_completed; tc->get_version = tpm_tis_isa_get_tpm_version; set_bit(DEVICE_CATEGORY_MISC, dc->categories); + adevc->build_dev_aml = build_tpm_tis_isa_aml; } static const TypeInfo tpm_tis_isa_info = { @@ -161,6 +192,7 @@ static const TypeInfo tpm_tis_isa_info = { .class_init = tpm_tis_isa_class_init, .interfaces = (InterfaceInfo[]) { { TYPE_TPM_IF }, + { TYPE_ACPI_DEV_AML_IF }, { } } }; From patchwork Fri Jun 10 07:58:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641750 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XTh6OsWV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKF681zfYz9s09 for ; Fri, 10 Jun 2022 18:50:24 +1000 (AEST) Received: from localhost ([::1]:35658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaLW-0002dm-AK for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:50:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXd-0001bQ-Kc for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXc-0006LT-0p for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:58:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847927; 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=IqZ5IuzJUm/KcyZwG3GKfjeGMTTz/V/nC2C5EKqQZDY=; b=XTh6OsWV2gDnHeusarLlAMv8/yRiy1GShPs1Vjm+ureBc0n30WON73em0axM8aNQ72ybMf 6rqgzwj5n4q7LjNC0VbGYSR778NrVgKz1QTFrRMB/JAe1tHE0/AGPSkJx69deK7aJkuoeH KbI1v7iRp/2aw4SMq29adHDpGJ/PL6Q= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-472-SIX9UxUgMb6teJ4vxK-c4w-1; Fri, 10 Jun 2022 03:58:46 -0400 X-MC-Unique: SIX9UxUgMb6teJ4vxK-c4w-1 Received: by mail-wm1-f71.google.com with SMTP id ay28-20020a05600c1e1c00b0039c5cbe76c1so954061wmb.1 for ; Fri, 10 Jun 2022 00:58:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IqZ5IuzJUm/KcyZwG3GKfjeGMTTz/V/nC2C5EKqQZDY=; b=0RlD36dk7raxzSuPYzW9oIpPbLvE4MjWgOMo1uCglfliayqcNEqS/2bTYMMPzkpJV6 Xd5vPeW1YVY6gqD3niuMFe0qdVNrWvAjMoMdj2Ewyy9+JRtIMbSflEtn3rOhZs6qD/hN T9lckQtIS+CxMWr+3p2PnGmGUfg0Adg7NZpH7fIYEPCqUvFjEDkwxl7I2HVAw/jHgWJr l9LM1Cppq1gqHduAE79CvzK0X0vpf+5Lr+7Kzh+l/B15vjJy9S+/aVyZtHEbrpkozj5z PLkyaaw6yzqHxggHxIJB8Br0e8ywQBMvpIt4d8zNg0jEkHijcqIRWcRufNIepzPK7Kmy uw5Q== X-Gm-Message-State: AOAM530lCs03eqvfqkX7Uo41OFB7DjTYJG5ODn+Q2NereVN4NpqRchDa WveSfBx9HFyVuyCq8BqG0YxCAhuzB/rw1muI4e0D+UOet9V7Yoipip1LqIluDWoQNi4rwflhefk JZ2KLeXSKUUL2GB2cAx9hRMi+nWgMb4hRsIVSb43AEkb0bFsUTlULP+BCHe0K X-Received: by 2002:a05:600c:3552:b0:398:3e9c:30f4 with SMTP id i18-20020a05600c355200b003983e9c30f4mr7507747wmq.37.1654847924935; Fri, 10 Jun 2022 00:58:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypD5xJUKwzjo/Px3juscx6ktuoPGs0q1NVOmHDwxHloDBqKLvx21i2cQfUFkdudo9W3snIfA== X-Received: by 2002:a05:600c:3552:b0:398:3e9c:30f4 with SMTP id i18-20020a05600c355200b003983e9c30f4mr7507722wmq.37.1654847924593; Fri, 10 Jun 2022 00:58:44 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id m2-20020a7bca42000000b0039c693a54ecsm2400059wml.23.2022.06.10.00.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:44 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:41 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Ani Sinha Subject: [PULL 34/54] tests: acpi: update expected DSDT.tis.tpm2/DSDT.tis.tpm12 blobs Message-ID: <20220610075631.367501-35-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov expected move of tmp-tis device description directly under Device(ISA) node. for tpm-tis 2.0: @@ -145,6 +145,189 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) + Device (TPM) + { + Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */) // _HID: Hardware ID + Name (_STR, "TPM 2.0 Device") // _STR: Description String + Name (_UID, One) // _UID: Unique ID + Name (_STA, 0x0F) // _STA: Status ... + } @@ -3281,189 +3464,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) Method (PCNT, 0, NotSerialized) { } - - Device (TPM) - { - Name (_HID, "MSFT0101" /* TPM 2.0 Security Device */) // _HID: Hardware ID - Name (_STR, "TPM 2.0 Device") // _STR: Description String - Name (_UID, One) // _UID: Unique ID - Name (_STA, 0x0F) // _STA: Status ... - } for tpm-tis 1.2: @@ -145,6 +145,188 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) { Name (_ADR, 0x001F0000) // _ADR: Address OperationRegion (PIRQ, PCI_Config, 0x60, 0x0C) + Device (TPM) + { + Name (_HID, EisaId ("PNP0C31")) // _HID: Hardware ID + Name (_UID, One) // _UID: Unique ID + Name (_STA, 0x0F) // _STA: Status ... + } @@ -3281,188 +3463,6 @@ DefinitionBlock ("", "DSDT", 1, "BOCHS ", "BXPC ", 0x00000001) Method (PCNT, 0, NotSerialized) { } - - Device (ISA.TPM) - { - Name (_HID, EisaId ("PNP0C31")) // _HID: Hardware ID - Name (_UID, One) // _UID: Unique ID - Name (_STA, 0x0F) // _STA: Status ... - } Signed-off-by: Igor Mammedov Acked-by: Ani Sinha Message-Id: <20220608135340.3304695-35-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 2 -- tests/data/acpi/q35/DSDT.tis.tpm12 | Bin 8885 -> 8880 bytes tests/data/acpi/q35/DSDT.tis.tpm2 | Bin 8906 -> 8906 bytes 3 files changed, 2 deletions(-) diff --git a/tests/data/acpi/q35/DSDT.tis.tpm12 b/tests/data/acpi/q35/DSDT.tis.tpm12 index 0b5c97fdb5da8b7b55d6b5f2af498a447fda7bf8..a97d884c50485f848054c6ac95ecfa055ff59e5b 100644 GIT binary patch delta 89 zcmdn$y1|vpCDCo#F$WJq@Cp+yp#>9pgFT9bJNW7#QRk vq8kD{g94ej61aFa$Fi`>ak*;6fK&_kYEI5ka^Z|_a#hs>Y1z!rg5>c diff --git a/tests/data/acpi/q35/DSDT.tis.tpm2 b/tests/data/acpi/q35/DSDT.tis.tpm2 index 4e16b126cc1c32f2346078fa69c5261c245d15e8..1f5392919b5ea69696b49ff13aab5c37d0615919 100644 GIT binary patch delta 85 zcmX@*ddii{CDCo#F$WJq@Cp+yp#>9pgFT9bJNW7#QRk nq8kD{g94ej61aFam$R_Sad~OSfK&@OX-{rba@owyl*0r7A8!`n diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 7b3bf9a207..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,3 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/q35/DSDT.tis.tpm2", -"tests/data/acpi/q35/DSDT.tis.tpm12", From patchwork Fri Jun 10 07:58:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641853 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CdjpRioO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKGXP1xBtz9s0r for ; Fri, 10 Jun 2022 19:54:43 +1000 (AEST) Received: from localhost ([::1]:39150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzbLk-0007BI-HB for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:54:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35754) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY4-0001zA-O2 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:16 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:26485) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXr-0006Nz-Nv for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847941; 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=H48oDSI/24QHAU16OnoWcXqIkpcM2BnmYIyIVEcKBYY=; b=CdjpRioO9W5GYh2OO57PGJPXpXde30lRtcNRgK7IFsNTCb3Dc9OzoLWlCRx8s1pUwgkVzO 5udll2Nod7nqFAoi869N1eiNXEXG/bzAjlu3U5SzPYEtIFHAVtZsn1l4NkEpuLo9sAJ2XD 9XlWXxer6sYZuFMxo3ChPH7o5x4nZOM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-371-OPmaI4kNO72DAgE-by3Lgg-1; Fri, 10 Jun 2022 03:58:49 -0400 X-MC-Unique: OPmaI4kNO72DAgE-by3Lgg-1 Received: by mail-wm1-f70.google.com with SMTP id o3-20020a05600c510300b0039743540ac7so9322256wms.5 for ; Fri, 10 Jun 2022 00:58:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=H48oDSI/24QHAU16OnoWcXqIkpcM2BnmYIyIVEcKBYY=; b=ik5UplMwoZXaxE106mKbYw2T4FbChbSoetgtcSND33DDZP8LylHoqNYgSPZETvBu2r HOWKYhMEmKbuh45Vh7tVUCh8gsK8NLP7fKmPsT5Q42g8/yG7xUJhcvMNz0bWeNGgTDtV 2zKqiEfnboM2bBT7RUEtBm/BPd/QezOzI4rvMHi7aa9o8Nybq6pSsUd2O8oUSRG/uzCP 0Mh2r01h1torBsDYjABulAcbB538AnZduzlaEC/BqBDKmzWnlAzBfDoI6tJPbXFEdP9M ULmKKda7fKW7dBFhmH/etDjpaeIHevrEGZpNsZL/wVT1x4e2ft5tPoyALfiVanMGowuz jxLA== X-Gm-Message-State: AOAM531pOJ3zkS1sMsvq+EIHrxLS2bsNcIaSWwcd47DZmaeUqnUgON5L 4KkbIQoHoV2hB85yWKkVeeSm65iklUodyLPOrw75IVy3HsJfdPFcjH0cbUySLqCjMPW1mdqckWf RMIKRSOxA2EfiR4G1B6ThRRKaCvKZD5iGg1GisUv2ZFQY6uWMw2aXf4Qca/dR X-Received: by 2002:a05:600c:a01:b0:398:d2f6:b5c6 with SMTP id z1-20020a05600c0a0100b00398d2f6b5c6mr7457659wmp.140.1654847927838; Fri, 10 Jun 2022 00:58:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZygNH8ZPgFkjN50hgBBO5iucanCt8a9gm0BVc2hrd1jYWeENI++q01v+goY9V8WrCU7UYqw== X-Received: by 2002:a05:600c:a01:b0:398:d2f6:b5c6 with SMTP id z1-20020a05600c0a0100b00398d2f6b5c6mr7457641wmp.140.1654847927619; Fri, 10 Jun 2022 00:58:47 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id o17-20020a5d6711000000b00218453adaefsm12573270wru.101.2022.06.10.00.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:47 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:44 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Igor Mammedov , Gerd Hoffmann , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PULL 35/54] x86: acpi-build: do not include hw/isa/isa.h directly Message-ID: <20220610075631.367501-36-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Igor Mammedov the last remaining dependency on ISA in acpi-build.c is iapc_boot_arch_8042() which pulls in in isa.h in its own header hw/input/i8042.h. Clean up not longer needed direct inclusion of isa.h in acpi-build.c Signed-off-by: Igor Mammedov Acked-by: Gerd Hoffmann Message-Id: <20220608135340.3304695-36-imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 0b65fc99cd..f41e14a469 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -37,7 +37,6 @@ #include "hw/acpi/cpu.h" #include "hw/nvram/fw_cfg.h" #include "hw/acpi/bios-linker-loader.h" -#include "hw/isa/isa.h" #include "hw/acpi/acpi_aml_interface.h" #include "hw/input/i8042.h" #include "hw/acpi/memory_hotplug.h" From patchwork Fri Jun 10 07:58:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z7R6J0Db; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDlq5ShPz9s09 for ; Fri, 10 Jun 2022 18:34:30 +1000 (AEST) Received: from localhost ([::1]:43946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nza67-0004tt-A2 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:34:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35716) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXw-0001tZ-T0 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:47887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXr-0006O4-TE for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847942; 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=5HCh4qwsRN83+VkkoX5oIK1hGfa7ooYJz2hPq9Qlx2I=; b=Z7R6J0DbNglqEb2I2zXZttkmMth7j9rnUIpYRz8W1dPXI3iObmoPbWwpwpWwF25I+bIBNy 9cZDhtfWnFqyQxQvfn2gi+z/6CKzLQ2LH0tZELYCKo/ojvBtLJkWiXrEzGnh2Ra8PxqYID SloEaQOVAf38chslQjsW3Kt3Ua8oiA4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-543-6EhJC-plPr6Ho1uuKxnqng-1; Fri, 10 Jun 2022 03:58:53 -0400 X-MC-Unique: 6EhJC-plPr6Ho1uuKxnqng-1 Received: by mail-wm1-f71.google.com with SMTP id v184-20020a1cacc1000000b0039c7efa3e95so73013wme.3 for ; Fri, 10 Jun 2022 00:58:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=5HCh4qwsRN83+VkkoX5oIK1hGfa7ooYJz2hPq9Qlx2I=; b=TPTR0u1NJf+aVCrxL+4iWfkD28lealkQO6ZPwxOSh7MzwmY8HGgwkw9pOjaW5YogHW xLiN/aahy03FrRnUv6HaLRPHX2V97qQ50/9n843HGv21wl7kt7UIGWdNnyGw5XYp2zHt 4NzkzxP74dEYyTpUCWfR63m29z54/B3QwsMiEsixifBPlK6mAx2LOaE1yiMeapPqDckF 4+pk32V2qlRJn+fk1oMOtnz3j5L8VknIPDzZHTyTVeuM4tDs4xyeVZa26uffkeZxBtIq DrLP9rqd2kOszqNyQrbqjrcMciNdfMhw3Pw8Ldmx8AW68RNGCH9lWZXWQ5d7XvARo8TX S/tQ== X-Gm-Message-State: AOAM531t5IKPN75dm7uFZR0Q7AG+riPbqDTyHh8UKl/bTZSWDFSI36fn pmUvuWV90WUdamfRa2Of5MoxAPFkb052LgYJ7ncBN+w6jM8+XlUghq34znIxD/995rsmwc20l8y Vb6RiZRT2s//FgsY4XeBd7CgYNzOfu40mdw5QxI7KqmcUyNc0mkgxfGpdFgoJ X-Received: by 2002:a05:600c:384a:b0:39c:4131:6c61 with SMTP id s10-20020a05600c384a00b0039c41316c61mr7311426wmr.39.1654847931785; Fri, 10 Jun 2022 00:58:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3kfsb1XOH3lYjpP81wTLJA29FYBrMzl6tn38sJ2sOtdJn2Y2k8GTEf4KkjkvaB1r7a/N37A== X-Received: by 2002:a05:600c:384a:b0:39c:4131:6c61 with SMTP id s10-20020a05600c384a00b0039c41316c61mr7311347wmr.39.1654847931105; Fri, 10 Jun 2022 00:58:51 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id c2-20020adffb42000000b00210326c4a90sm26900543wrs.49.2022.06.10.00.58.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:50 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:47 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Davidlohr Bueso , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?q?Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Yanan Wang , Ben Widawsky , Paolo Bonzini , Richard Henderson , Eric Blake , Markus Armbruster , Igor Mammedov , Ani Sinha , Thomas Huth , Laurent Vivier Subject: [PULL 36/54] hw/cxl: Make the CXL fixed memory window setup a machine parameter. Message-ID: <20220610075631.367501-37-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron Paolo Bonzini requested this change to simplify the ongoing effort to allow machine setup entirely via RPC. Includes shortening the command line form cxl-fixed-memory-window to cxl-fmw as the command lines are extremely long even with this change. The json change is needed to ensure that there is a CXLFixedMemoryWindowOptionsList even though the actual element in the json is never used. Similar to existing SgxEpcProperties. Update qemu-options.hx to reflect that this is now a -machine parameter. The bulk of -M / -machine parameters are documented under machine, so use that in preference to M. Update cxl-test and bios-tables-test to reflect new parameters. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Reviewed-by: Davidlohr Bueso Message-Id: <20220608145440.26106-2-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- qapi/machine.json | 13 +++++ include/hw/boards.h | 1 + include/hw/cxl/cxl.h | 7 +-- include/hw/cxl/cxl_host.h | 21 +++++++++ hw/core/machine.c | 22 --------- hw/cxl/cxl-host-stubs.c | 6 +-- hw/cxl/cxl-host.c | 72 ++++++++++++++++++++++++++-- hw/i386/pc.c | 3 ++ hw/pci-bridge/pci_expander_bridge.c | 2 +- softmmu/vl.c | 44 ----------------- tests/qtest/bios-tables-test.c | 4 +- tests/qtest/cxl-test.c | 4 +- docs/system/devices/cxl.rst | 4 +- qemu-options.hx | 73 ++++++++++++++--------------- 14 files changed, 150 insertions(+), 126 deletions(-) create mode 100644 include/hw/cxl/cxl_host.h diff --git a/qapi/machine.json b/qapi/machine.json index f750a16396..6afd1936b0 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -523,6 +523,19 @@ '*interleave-granularity': 'size', 'targets': ['str'] }} +## +# @CXLFMWProperties: +# +# List of CXL Fixed Memory Windows. +# +# @cxl-fmw: List of CXLFixedMemoryWindowOptions +# +# Since 7.1 +## +{ 'struct' : 'CXLFMWProperties', + 'data': { 'cxl-fmw': ['CXLFixedMemoryWindowOptions'] } +} + ## # @X86CPURegister32: # diff --git a/include/hw/boards.h b/include/hw/boards.h index fa57bac4fb..dd9fc56df2 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -362,6 +362,7 @@ struct MachineState { struct NVDIMMState *nvdimms_state; struct CXLState *cxl_devices_state; struct NumaState *numa_state; + CXLFixedMemoryWindowOptionsList *cfmws_list; }; #define DEFINE_MACHINE(namestr, machine_initfn) \ diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index 21d28ca110..84078a484d 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -12,6 +12,7 @@ #include "qapi/qapi-types-machine.h" +#include "qapi/qapi-visit-machine.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" #include "cxl_pci.h" @@ -40,6 +41,7 @@ typedef struct CXLState { MemoryRegion host_mr; unsigned int next_mr_idx; GList *fixed_windows; + CXLFixedMemoryWindowOptionsList *cfmw_list; } CXLState; struct CXLHost { @@ -51,11 +53,6 @@ struct CXLHost { #define TYPE_PXB_CXL_HOST "pxb-cxl-host" OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST) -void cxl_fixed_memory_window_config(MachineState *ms, - CXLFixedMemoryWindowOptions *object, - Error **errp); void cxl_fixed_memory_window_link_targets(Error **errp); -extern const MemoryRegionOps cfmws_ops; - #endif diff --git a/include/hw/cxl/cxl_host.h b/include/hw/cxl/cxl_host.h new file mode 100644 index 0000000000..87a6933de2 --- /dev/null +++ b/include/hw/cxl/cxl_host.h @@ -0,0 +1,21 @@ +/* + * QEMU CXL Host Setup + * + * Copyright (c) 2022 Huawei + * + * This work is licensed under the terms of the GNU GPL, version 2. See the + * COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "hw/cxl/cxl.h" +#include "hw/boards.h" + +#ifndef CXL_HOST_H +#define CXL_HOST_H + +void cxl_machine_init(Object *obj, CXLState *state); + +extern const MemoryRegionOps cfmws_ops; + +#endif diff --git a/hw/core/machine.c b/hw/core/machine.c index c53548d0b1..2e589d99e9 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -629,20 +629,6 @@ static void machine_set_nvdimm_persistence(Object *obj, const char *value, nvdimms_state->persistence_string = g_strdup(value); } -static bool machine_get_cxl(Object *obj, Error **errp) -{ - MachineState *ms = MACHINE(obj); - - return ms->cxl_devices_state->is_enabled; -} - -static void machine_set_cxl(Object *obj, bool value, Error **errp) -{ - MachineState *ms = MACHINE(obj); - - ms->cxl_devices_state->is_enabled = value; -} - void machine_class_allow_dynamic_sysbus_dev(MachineClass *mc, const char *type) { QAPI_LIST_PREPEND(mc->allowed_dynamic_sysbus_devices, g_strdup(type)); @@ -929,8 +915,6 @@ static void machine_class_init(ObjectClass *oc, void *data) mc->default_ram_size = 128 * MiB; mc->rom_file_has_mr = true; - /* Few machines support CXL, so default to off */ - mc->cxl_supported = false; /* numa node memory size aligned on 8MB by default. * On Linux, each node's border has to be 8MB aligned */ @@ -1092,13 +1076,7 @@ static void machine_initfn(Object *obj) } if (mc->cxl_supported) { - Object *obj = OBJECT(ms); - ms->cxl_devices_state = g_new0(CXLState, 1); - object_property_add_bool(obj, "cxl", machine_get_cxl, machine_set_cxl); - object_property_set_description(obj, "cxl", - "Set on/off to enable/disable " - "CXL instantiation"); } if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) { diff --git a/hw/cxl/cxl-host-stubs.c b/hw/cxl/cxl-host-stubs.c index 24465a52ab..de3e8894d5 100644 --- a/hw/cxl/cxl-host-stubs.c +++ b/hw/cxl/cxl-host-stubs.c @@ -6,11 +6,9 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "hw/cxl/cxl.h" - -void cxl_fixed_memory_window_config(MachineState *ms, - CXLFixedMemoryWindowOptions *object, - Error **errp) {}; +#include "hw/cxl/cxl_host.h" void cxl_fixed_memory_window_link_targets(Error **errp) {}; +void cxl_machine_init(Object *obj, CXLState *state) {}; const MemoryRegionOps cfmws_ops; diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 469b3c4ced..3a79c32b42 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -15,14 +15,15 @@ #include "qapi/qapi-visit-machine.h" #include "hw/cxl/cxl.h" +#include "hw/cxl/cxl_host.h" #include "hw/pci/pci_bus.h" #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" #include "hw/pci/pcie_port.h" -void cxl_fixed_memory_window_config(MachineState *ms, - CXLFixedMemoryWindowOptions *object, - Error **errp) +static void cxl_fixed_memory_window_config(CXLState *cxl_state, + CXLFixedMemoryWindowOptions *object, + Error **errp) { CXLFixedWindow *fw = g_malloc0(sizeof(*fw)); strList *target; @@ -62,8 +63,7 @@ void cxl_fixed_memory_window_config(MachineState *ms, fw->enc_int_gran = 0; } - ms->cxl_devices_state->fixed_windows = - g_list_append(ms->cxl_devices_state->fixed_windows, fw); + cxl_state->fixed_windows = g_list_append(cxl_state->fixed_windows, fw); return; } @@ -220,3 +220,65 @@ const MemoryRegionOps cfmws_ops = { .unaligned = true, }, }; + +static void machine_get_cxl(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + CXLState *cxl_state = opaque; + bool value = cxl_state->is_enabled; + + visit_type_bool(v, name, &value, errp); +} + +static void machine_set_cxl(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + CXLState *cxl_state = opaque; + bool value; + + if (!visit_type_bool(v, name, &value, errp)) { + return; + } + cxl_state->is_enabled = value; +} + +static void machine_get_cfmw(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + CXLFixedMemoryWindowOptionsList **list = opaque; + + visit_type_CXLFixedMemoryWindowOptionsList(v, name, list, errp); +} + +static void machine_set_cfmw(Object *obj, Visitor *v, const char *name, + void *opaque, Error **errp) +{ + CXLState *state = opaque; + CXLFixedMemoryWindowOptionsList *cfmw_list = NULL; + CXLFixedMemoryWindowOptionsList *it; + + visit_type_CXLFixedMemoryWindowOptionsList(v, name, &cfmw_list, errp); + if (!cfmw_list) { + return; + } + + for (it = cfmw_list; it; it = it->next) { + cxl_fixed_memory_window_config(state, it->value, errp); + } + state->cfmw_list = cfmw_list; +} + +void cxl_machine_init(Object *obj, CXLState *state) +{ + object_property_add(obj, "cxl", "bool", machine_get_cxl, + machine_set_cxl, NULL, state); + object_property_set_description(obj, "cxl", + "Set on/off to enable/disable " + "CXL instantiation"); + + object_property_add(obj, "cxl-fmw", "CXLFixedMemoryWindow", + machine_get_cfmw, machine_set_cfmw, + NULL, state); + object_property_set_description(obj, "cxl-fmw", + "CXL Fixed Memory Windows (array)"); +} diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 7c39c91335..98e63347f2 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -76,6 +76,7 @@ #include "hw/mem/pc-dimm.h" #include "hw/mem/nvdimm.h" #include "hw/cxl/cxl.h" +#include "hw/cxl/cxl_host.h" #include "qapi/error.h" #include "qapi/qapi-visit-common.h" #include "qapi/qapi-visit-machine.h" @@ -1682,6 +1683,7 @@ static void pc_machine_set_max_fw_size(Object *obj, Visitor *v, static void pc_machine_initfn(Object *obj) { PCMachineState *pcms = PC_MACHINE(obj); + MachineState *ms = MACHINE(obj); #ifdef CONFIG_VMPORT pcms->vmport = ON_OFF_AUTO_AUTO; @@ -1706,6 +1708,7 @@ static void pc_machine_initfn(Object *obj) pcms->pcspk = isa_new(TYPE_PC_SPEAKER); object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); + cxl_machine_init(obj, ms->cxl_devices_state); } static void pc_machine_reset(MachineState *machine) diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 69244decdb..02032360f5 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -468,7 +468,7 @@ static void pxb_cxl_dev_realize(PCIDevice *dev, Error **errp) error_setg(errp, "pxb-cxl devices cannot reside on a PCI bus"); return; } - if (!ms->cxl_devices_state->is_enabled) { + if (!ms->cxl_devices_state || !ms->cxl_devices_state->is_enabled) { error_setg(errp, "Machine does not have cxl=on"); return; } diff --git a/softmmu/vl.c b/softmmu/vl.c index 4c1e94b00e..ff0ad9ab54 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -147,12 +147,6 @@ typedef struct BlockdevOptionsQueueEntry { typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry) BlockdevOptionsQueue; -typedef struct CXLFMWOptionQueueEntry { - CXLFixedMemoryWindowOptions *opts; - Location loc; - QSIMPLEQ_ENTRY(CXLFMWOptionQueueEntry) entry; -} CXLFMWOptionQueueEntry; - typedef struct ObjectOption { ObjectOptions *opts; QTAILQ_ENTRY(ObjectOption) next; @@ -179,8 +173,6 @@ static int snapshot; static bool preconfig_requested; static QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list); static BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); -static QSIMPLEQ_HEAD(, CXLFMWOptionQueueEntry) CXLFMW_opts = - QSIMPLEQ_HEAD_INITIALIZER(CXLFMW_opts); static bool nographic = false; static int mem_prealloc; /* force preallocation of physical target memory */ static const char *vga_model = NULL; @@ -1072,24 +1064,6 @@ static void parse_display(const char *p) } } -static void parse_cxl_fixed_memory_window(const char *optarg) -{ - CXLFMWOptionQueueEntry *cfmws_entry; - Visitor *v; - - v = qobject_input_visitor_new_str(optarg, "cxl-fixed-memory-window", - &error_fatal); - cfmws_entry = g_new(CXLFMWOptionQueueEntry, 1); - visit_type_CXLFixedMemoryWindowOptions(v, NULL, &cfmws_entry->opts, - &error_fatal); - if (!cfmws_entry->opts) { - exit(1); - } - visit_free(v); - loc_save(&cfmws_entry->loc); - QSIMPLEQ_INSERT_TAIL(&CXLFMW_opts, cfmws_entry, entry); -} - static inline bool nonempty_str(const char *str) { return str && *str; @@ -1948,20 +1922,6 @@ static void qemu_create_late_backends(void) qemu_semihosting_console_init(); } -static void cxl_set_opts(void) -{ - while (!QSIMPLEQ_EMPTY(&CXLFMW_opts)) { - CXLFMWOptionQueueEntry *cfmws_entry = QSIMPLEQ_FIRST(&CXLFMW_opts); - - loc_restore(&cfmws_entry->loc); - QSIMPLEQ_REMOVE_HEAD(&CXLFMW_opts, entry); - cxl_fixed_memory_window_config(current_machine, cfmws_entry->opts, - &error_fatal); - qapi_free_CXLFixedMemoryWindowOptions(cfmws_entry->opts); - g_free(cfmws_entry); - } -} - static void qemu_resolve_machine_memdev(void) { if (ram_memdev_id) { @@ -2789,9 +2749,6 @@ void qemu_init(int argc, char **argv, char **envp) exit(1); } break; - case QEMU_OPTION_cxl_fixed_memory_window: - parse_cxl_fixed_memory_window(optarg); - break; case QEMU_OPTION_display: parse_display(optarg); break; @@ -3598,7 +3555,6 @@ void qemu_init(int argc, char **argv, char **envp) qemu_resolve_machine_memdev(); parse_numa_opts(current_machine); - cxl_set_opts(); if (vmstate_dump_file) { /* dump and exit */ diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c index 56498bbcc8..359916c228 100644 --- a/tests/qtest/bios-tables-test.c +++ b/tests/qtest/bios-tables-test.c @@ -1582,8 +1582,8 @@ static void test_acpi_q35_cxl(void) " -device cxl-type3,bus=rp3,memdev=cxl-mem3,lsa=lsa3" " -device cxl-rp,port=1,bus=cxl.2,id=rp4,chassis=0,slot=6" " -device cxl-type3,bus=rp4,memdev=cxl-mem4,lsa=lsa4" - " -cxl-fixed-memory-window targets.0=cxl.1,size=4G,interleave-granularity=8k" - " -cxl-fixed-memory-window targets.0=cxl.1,targets.1=cxl.2,size=4G,interleave-granularity=8k", + " -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=8k," + "cxl-fmw.1.targets.0=cxl.1,cxl-fmw.1.targets.1=cxl.2,cxl-fmw.1.size=4G,cxl-fmw.1.interleave-granularity=8k", tmp_path, tmp_path, tmp_path, tmp_path, tmp_path, tmp_path, tmp_path, tmp_path); test_acpi_one(params, &data); diff --git a/tests/qtest/cxl-test.c b/tests/qtest/cxl-test.c index 079011af6a..2133e973f4 100644 --- a/tests/qtest/cxl-test.c +++ b/tests/qtest/cxl-test.c @@ -10,12 +10,12 @@ #define QEMU_PXB_CMD "-machine q35,cxl=on " \ "-device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 " \ - "-cxl-fixed-memory-window targets.0=cxl.0,size=4G " + "-M cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=4G " #define QEMU_2PXB_CMD "-machine q35,cxl=on " \ "-device pxb-cxl,id=cxl.0,bus=pcie.0,bus_nr=52 " \ "-device pxb-cxl,id=cxl.1,bus=pcie.0,bus_nr=53 " \ - "-cxl-fixed-memory-window targets.0=cxl.0,targets.1=cxl.1,size=4G " + "-M cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=4G " #define QEMU_RP "-device cxl-rp,id=rp0,bus=cxl.0,chassis=0,slot=0 " diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst index 9293cbf01a..bcbfe8c490 100644 --- a/docs/system/devices/cxl.rst +++ b/docs/system/devices/cxl.rst @@ -251,7 +251,7 @@ A very simple setup with just one directly attached CXL Type 3 device:: -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.1 \ -device cxl-rp,port=0,bus=cxl.1,id=root_port13,chassis=0,slot=2 \ -device cxl-type3,bus=root_port13,memdev=cxl-mem1,lsa=cxl-lsa1,id=cxl-pmem0 \ - -cxl-fixed-memory-window targets.0=cxl.1,size=4G + -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G A setup suitable for 4 way interleave. Only one fixed window provided, to enable 2 way interleave across 2 CXL host bridges. Each host bridge has 2 CXL Root Ports, with @@ -277,7 +277,7 @@ the CXL Type3 device directly attached (no switches).:: -device cxl-type3,bus=root_port15,memdev=cxl-mem3,lsa=cxl-lsa3,id=cxl-pmem2 \ -device cxl-rp,port=1,bus=cxl.2,id=root_port16,chassis=0,slot=6 \ -device cxl-type3,bus=root_port16,memdev=cxl-mem4,lsa=cxl-lsa4,id=cxl-pmem3 \ - -cxl-fixed-memory-window targets.0=cxl.1,targets.1=cxl.2,size=4G,interleave-granularity=8k + -M cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.targets.1=cxl.2,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=8k Kernel Configuration Options ---------------------------- diff --git a/qemu-options.hx b/qemu-options.hx index 60cf188da4..377d22fbd8 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -36,7 +36,8 @@ DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ " nvdimm=on|off controls NVDIMM support (default=off)\n" " memory-encryption=@var{} memory encryption object to use (default=none)\n" " hmat=on|off controls ACPI HMAT support (default=off)\n" - " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n", + " memory-backend='backend-id' specifies explicitly provided backend for main RAM (default=none)\n" + " cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]\n", QEMU_ARCH_ALL) SRST ``-machine [type=]name[,prop=value[,...]]`` @@ -124,6 +125,38 @@ SRST -object memory-backend-ram,id=pc.ram,size=512M,x-use-canonical-path-for-ramblock-id=off -machine memory-backend=pc.ram -m 512M + + ``cxl-fmw.0.targets.0=firsttarget,cxl-fmw.0.targets.1=secondtarget,cxl-fmw.0.size=size[,cxl-fmw.0.interleave-granularity=granularity]`` + Define a CXL Fixed Memory Window (CFMW). + + Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM. + + They are regions of Host Physical Addresses (HPA) on a system which + may be interleaved across one or more CXL host bridges. The system + software will assign particular devices into these windows and + configure the downstream Host-managed Device Memory (HDM) decoders + in root ports, switch ports and devices appropriately to meet the + interleave requirements before enabling the memory devices. + + ``targets.X=target`` provides the mapping to CXL host bridges + which may be identified by the id provied in the -device entry. + Multiple entries are needed to specify all the targets when + the fixed memory window represents interleaved memory. X is the + target index from 0. + + ``size=size`` sets the size of the CFMW. This must be a multiple of + 256MiB. The region will be aligned to 256MiB but the location is + platform and configuration dependent. + + ``interleave-granularity=granularity`` sets the granularity of + interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB + 4096KiB, 8192KiB and 16384KiB granularities supported. + + Example: + + :: + + -machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.targets.1=cxl.1,cxl-fmw.0.size=128G,cxl-fmw.0.interleave-granularity=512k ERST DEF("M", HAS_ARG, QEMU_OPTION_M, @@ -467,44 +500,6 @@ SRST -numa hmat-cache,node-id=1,size=10K,level=1,associativity=direct,policy=write-back,line=8 ERST -DEF("cxl-fixed-memory-window", HAS_ARG, QEMU_OPTION_cxl_fixed_memory_window, - "-cxl-fixed-memory-window targets.0=firsttarget,targets.1=secondtarget,size=size[,interleave-granularity=granularity]\n", - QEMU_ARCH_ALL) -SRST -``-cxl-fixed-memory-window targets.0=firsttarget,targets.1=secondtarget,size=size[,interleave-granularity=granularity]`` - Define a CXL Fixed Memory Window (CFMW). - - Described in the CXL 2.0 ECN: CEDT CFMWS & QTG _DSM. - - They are regions of Host Physical Addresses (HPA) on a system which - may be interleaved across one or more CXL host bridges. The system - software will assign particular devices into these windows and - configure the downstream Host-managed Device Memory (HDM) decoders - in root ports, switch ports and devices appropriately to meet the - interleave requirements before enabling the memory devices. - - ``targets.X=firsttarget`` provides the mapping to CXL host bridges - which may be identified by the id provied in the -device entry. - Multiple entries are needed to specify all the targets when - the fixed memory window represents interleaved memory. X is the - target index from 0. - - ``size=size`` sets the size of the CFMW. This must be a multiple of - 256MiB. The region will be aligned to 256MiB but the location is - platform and configuration dependent. - - ``interleave-granularity=granularity`` sets the granularity of - interleave. Default 256KiB. Only 256KiB, 512KiB, 1024KiB, 2048KiB - 4096KiB, 8192KiB and 16384KiB granularities supported. - - Example: - - :: - - -cxl-fixed-memory-window targets.0=cxl.0,targets.1=cxl.1,size=128G,interleave-granularity=512k - -ERST - DEF("add-fd", HAS_ARG, QEMU_OPTION_add_fd, "-add-fd fd=fd,set=set[,opaque=opaque]\n" " Add 'fd' to fd 'set'\n", QEMU_ARCH_ALL) From patchwork Fri Jun 10 07:58:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641771 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XICRXL1F; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFRL1WCGz9s0r for ; Fri, 10 Jun 2022 19:05:18 +1000 (AEST) Received: from localhost ([::1]:50246 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaZw-00066G-6k for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:05:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXv-0001tT-V5 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:50602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXs-0006OH-LW for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847944; 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=BvSCk+gp0FY+trDsLWt66bGN2C04X9sZi/rII2QilmY=; b=XICRXL1FIz2Q1JZMEJktmO2TXQYdtCATWJmEPdTSRtMddLVytFQKPOPfX47a7v7dQOIUFl FmVCrnhOK3R6lf63Nvm0oJ/tG953svemKjvvLkwLqEUHDcxPDPtGzqvL8Ig/lvOAEDuKnh KwaLnwK9XgTVEQ8OmwN2YkQaUF+lbhw= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-537-O0y7nogCPGG_tK6cEffQpw-1; Fri, 10 Jun 2022 03:58:57 -0400 X-MC-Unique: O0y7nogCPGG_tK6cEffQpw-1 Received: by mail-wr1-f69.google.com with SMTP id e9-20020a5d5949000000b00216ffb6df18so4193976wri.14 for ; Fri, 10 Jun 2022 00:58:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BvSCk+gp0FY+trDsLWt66bGN2C04X9sZi/rII2QilmY=; b=Ern9GtZyNDmSmjWAXAzBeFUtCyumTZIjeTYJKM0Nmxnwy1T3Eps4Q0yqgIwjY8m26V hOj2DzylIAa6UTBewhZK/1mZ0gnUGjbcfoAF3hIOCC+oJneokg5wzbV1oImhkSsEnb5z Qvtakqe1ZO5hddGy8b0z2Ga/WIpzYtu5Z4PMH3amsdPv/pIhMPG+8gKG6IpVB9m8BRDu igVDcYQv8aHWLrZ4Z5vITWjwnAzn80CixBJayNhVrUIhApyuk5IZYcpLxGQAZ2ypKheI gz/kBooQ2p0Kn5B9TAKA3OfgGu204tlj9IGc8b3wvqxSTc9bgwTd8qSETk1T/2GylVkz 7GVQ== X-Gm-Message-State: AOAM531ND3rQz6iCrvqpU8y4U4Twgit/kdpwEHjQTp9Tyt59Ob7iyoI0 nVz7ynaB0/3LrZY+iObZ/qE4N14pyQ9tb4y50tZk4atGSoDJ336asJCehkiN4Kp7KmRrX2/LvFQ BwO5Lf9S2bEnTYkPY1ovznQCv44ZAEqOLmQVFMrO44z7fNTCisaXjOuk2mBQF X-Received: by 2002:adf:df8e:0:b0:210:2e5c:695d with SMTP id z14-20020adfdf8e000000b002102e5c695dmr43353752wrl.423.1654847934766; Fri, 10 Jun 2022 00:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCZ9+C2Q1dd6SnDMU8CgIhmjot5zf6DPtlsn6mgBe0psnCY0rjuGE6LjQ8RM36lZZiVK38jg== X-Received: by 2002:adf:df8e:0:b0:210:2e5c:695d with SMTP id z14-20020adfdf8e000000b002102e5c695dmr43353723wrl.423.1654847934448; Fri, 10 Jun 2022 00:58:54 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id l29-20020a05600c1d1d00b0039c3056c3dfsm2651208wms.27.2022.06.10.00.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:54 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:51 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 37/54] hw/acpi/cxl: Pass in the CXLState directly rather than MachineState Message-ID: <20220610075631.367501-38-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron Refactoring step on path to moving all CXL state out of MachineState. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-3-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/acpi/cxl.h | 5 +++-- hw/acpi/cxl.c | 9 ++++----- hw/i386/acpi-build.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/hw/acpi/cxl.h b/include/hw/acpi/cxl.h index 0c496538c0..acf4418886 100644 --- a/include/hw/acpi/cxl.h +++ b/include/hw/acpi/cxl.h @@ -19,10 +19,11 @@ #define HW_ACPI_CXL_H #include "hw/acpi/bios-linker-loader.h" +#include "hw/cxl/cxl.h" -void cxl_build_cedt(MachineState *ms, GArray *table_offsets, GArray *table_data, +void cxl_build_cedt(GArray *table_offsets, GArray *table_data, BIOSLinker *linker, const char *oem_id, - const char *oem_table_id); + const char *oem_table_id, CXLState *cxl_state); void build_cxl_osc_method(Aml *dev); #endif diff --git a/hw/acpi/cxl.c b/hw/acpi/cxl.c index 31d5235136..2bf8c07993 100644 --- a/hw/acpi/cxl.c +++ b/hw/acpi/cxl.c @@ -65,9 +65,8 @@ static void cedt_build_chbs(GArray *table_data, PXBDev *cxl) * Interleave ways encoding in CXL 2.0 ECN: 3, 6, 12 and 16-way memory * interleaving. */ -static void cedt_build_cfmws(GArray *table_data, MachineState *ms) +static void cedt_build_cfmws(GArray *table_data, CXLState *cxls) { - CXLState *cxls = ms->cxl_devices_state; GList *it; for (it = cxls->fixed_windows; it; it = it->next) { @@ -129,9 +128,9 @@ static int cxl_foreach_pxb_hb(Object *obj, void *opaque) return 0; } -void cxl_build_cedt(MachineState *ms, GArray *table_offsets, GArray *table_data, +void cxl_build_cedt(GArray *table_offsets, GArray *table_data, BIOSLinker *linker, const char *oem_id, - const char *oem_table_id) + const char *oem_table_id, CXLState *cxl_state) { Aml *cedt; AcpiTable table = { .sig = "CEDT", .rev = 1, .oem_id = oem_id, @@ -144,7 +143,7 @@ void cxl_build_cedt(MachineState *ms, GArray *table_offsets, GArray *table_data, /* reserve space for CEDT header */ object_child_foreach_recursive(object_get_root(), cxl_foreach_pxb_hb, cedt); - cedt_build_cfmws(cedt->buf, ms); + cedt_build_cfmws(cedt->buf, cxl_state); /* copy AML table into ACPI tables blob and patch header there */ g_array_append_vals(table_data, cedt->buf->data, cedt->buf->len); diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index f41e14a469..663c34b9d1 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2615,8 +2615,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) x86ms->oem_id, x86ms->oem_table_id); } if (machine->cxl_devices_state->is_enabled) { - cxl_build_cedt(machine, table_offsets, tables_blob, tables->linker, - x86ms->oem_id, x86ms->oem_table_id); + cxl_build_cedt(table_offsets, tables_blob, tables->linker, + x86ms->oem_id, x86ms->oem_table_id, machine->cxl_devices_state); } acpi_add_table(table_offsets, tables_blob); From patchwork Fri Jun 10 07:58:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641852 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=c6XdL8b/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKGPZ4TBWz9s0r for ; Fri, 10 Jun 2022 19:48:50 +1000 (AEST) Received: from localhost ([::1]:58758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzbG4-00082D-7S for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:48:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXs-0001sI-4c for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:22604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXp-0006Nv-0U for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847940; 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=YahgfHZHkDDG1UwZ41vbkmzTf6VZZfUOEbVd98dAsq8=; b=c6XdL8b/6BEe7+tVXWXNBgNgV4xl0nreJDCvoChgEFkZBF/0tK111kxWjB84q/hv1K8cc3 hnXrRl6JbDkEurFGBMadfxSTm4ZCKF1Io9Hs498WZDU61frz519N2LBT8OdwxaRw1w+MAu g57WgZkC49SKG0aMoRoic1r9AoQlepk= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-561-ksvPri6QPquDgm225lVDVQ-1; Fri, 10 Jun 2022 03:58:59 -0400 X-MC-Unique: ksvPri6QPquDgm225lVDVQ-1 Received: by mail-wr1-f71.google.com with SMTP id v4-20020adfebc4000000b002102c69be5eso5958543wrn.13 for ; Fri, 10 Jun 2022 00:58:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YahgfHZHkDDG1UwZ41vbkmzTf6VZZfUOEbVd98dAsq8=; b=TFgM5+LSRR93ppzVwyEBNRf99nVnFhM8ccnX3qdl9TR5oHfA4muvDTjsG+uA19wwjD UE+Il5C25l6CjmkENuTLaq3ZlzDIIb7GmCq1DivbpMreGHoS3I4jtcw33pl2a9Da4/+W GZr58TY7y9u9b3I3o54YE998tN1dQBDiTreVKiQvypoi3J/t0jKaVHbEoYD21lBYq+pc Ij/Rpl2T4i9rTGQqVa9kgUlPm4z98VVD9rJoGvCtL41bD74A58iiysEtxOybxla7W9N4 AJl9fA3Xer8NU2zohyYk/+kepiJtvpoaymZsAgMktEtngzP1YfOMuQ8nwfmdASWHuG08 wydA== X-Gm-Message-State: AOAM532P6avw1ciSTw/1l2vV0ACHL9jLtlWhonHy3zrWK26ftmn799Kk UI5znDkbsnYcshp7/mHVgsbaGfWqgGa17JbY6wpEfFdV8mk5INotmxO8d9f5nO5VzcjUjs/z1zn OLG4xVpZabuKlJVUPKLlV04A4fhfM+byG/eqlO8ziLsQUcXY70trxoSwNB+9I X-Received: by 2002:a05:600c:1c25:b0:39c:60cc:397f with SMTP id j37-20020a05600c1c2500b0039c60cc397fmr7526653wms.2.1654847937801; Fri, 10 Jun 2022 00:58:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyigAnB0r8+BdrlOqd+idP8ATfRDW8wLuKONzg845w6aBwxVxPWhFvuJPTrRjOCpDSg99Qrfw== X-Received: by 2002:a05:600c:1c25:b0:39c:60cc:397f with SMTP id j37-20020a05600c1c2500b0039c60cc397fmr7526614wms.2.1654847937485; Fri, 10 Jun 2022 00:58:57 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id z11-20020a5d4c8b000000b0020e5b4ebaecsm26785215wrs.4.2022.06.10.00.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:57 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:54 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Ben Widawsky , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 38/54] hw/cxl: Push linking of CXL targets into i386/pc rather than in machine.c Message-ID: <20220610075631.367501-39-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron Whilst here take the oportunity to shorten the function name. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-4-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl.h | 2 -- include/hw/cxl/cxl_host.h | 1 + hw/cxl/cxl-host-stubs.c | 2 +- hw/cxl/cxl-host.c | 8 +++----- hw/i386/pc.c | 5 +++++ softmmu/vl.c | 2 -- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/hw/cxl/cxl.h b/include/hw/cxl/cxl.h index 84078a484d..134b295b40 100644 --- a/include/hw/cxl/cxl.h +++ b/include/hw/cxl/cxl.h @@ -53,6 +53,4 @@ struct CXLHost { #define TYPE_PXB_CXL_HOST "pxb-cxl-host" OBJECT_DECLARE_SIMPLE_TYPE(CXLHost, PXB_CXL_HOST) -void cxl_fixed_memory_window_link_targets(Error **errp); - #endif diff --git a/include/hw/cxl/cxl_host.h b/include/hw/cxl/cxl_host.h index 87a6933de2..4d642a81fa 100644 --- a/include/hw/cxl/cxl_host.h +++ b/include/hw/cxl/cxl_host.h @@ -15,6 +15,7 @@ #define CXL_HOST_H void cxl_machine_init(Object *obj, CXLState *state); +void cxl_fmws_link_targets(CXLState *stat, Error **errp); extern const MemoryRegionOps cfmws_ops; diff --git a/hw/cxl/cxl-host-stubs.c b/hw/cxl/cxl-host-stubs.c index de3e8894d5..e0d5ec8ad5 100644 --- a/hw/cxl/cxl-host-stubs.c +++ b/hw/cxl/cxl-host-stubs.c @@ -8,7 +8,7 @@ #include "hw/cxl/cxl.h" #include "hw/cxl/cxl_host.h" -void cxl_fixed_memory_window_link_targets(Error **errp) {}; +void cxl_fmws_link_targets(CXLState *stat, Error **errp) {}; void cxl_machine_init(Object *obj, CXLState *state) {}; const MemoryRegionOps cfmws_ops; diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 3a79c32b42..8e7738a65b 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -68,14 +68,12 @@ static void cxl_fixed_memory_window_config(CXLState *cxl_state, return; } -void cxl_fixed_memory_window_link_targets(Error **errp) +void cxl_fmws_link_targets(CXLState *cxl_state, Error **errp) { - MachineState *ms = MACHINE(qdev_get_machine()); - - if (ms->cxl_devices_state && ms->cxl_devices_state->fixed_windows) { + if (cxl_state && cxl_state->fixed_windows) { GList *it; - for (it = ms->cxl_devices_state->fixed_windows; it; it = it->next) { + for (it = cxl_state->fixed_windows; it; it = it->next) { CXLFixedWindow *fw = it->data; int i; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 98e63347f2..6cecd74d58 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -732,6 +732,11 @@ void pc_machine_done(Notifier *notifier, void *data) PCMachineState *pcms = container_of(notifier, PCMachineState, machine_done); X86MachineState *x86ms = X86_MACHINE(pcms); + MachineState *ms = MACHINE(pcms); + + if (ms->cxl_devices_state) { + cxl_fmws_link_targets(ms->cxl_devices_state, &error_fatal); + } /* set the number of CPUs */ x86_rtc_set_cpus_count(x86ms->rtc, x86ms->boot_cpus); diff --git a/softmmu/vl.c b/softmmu/vl.c index ff0ad9ab54..54e920ada1 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -93,7 +93,6 @@ #include "qemu/config-file.h" #include "qemu/qemu-options.h" #include "qemu/main-loop.h" -#include "hw/cxl/cxl.h" #ifdef CONFIG_VIRTFS #include "fsdev/qemu-fsdev.h" #endif @@ -2568,7 +2567,6 @@ void qmp_x_exit_preconfig(Error **errp) qemu_init_board(); qemu_create_cli_devices(); - cxl_fixed_memory_window_link_targets(errp); qemu_machine_creation_done(); if (loadvm) { From patchwork Fri Jun 10 07:58:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=EpWrx9xV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFFQ56Nhz9s09 for ; Fri, 10 Jun 2022 18:56:42 +1000 (AEST) Received: from localhost ([::1]:41592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaRc-000762-94 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:56:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35684) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXu-0001tS-F5 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:28049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXr-0006O7-TV for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847943; 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=Kv4i4hYRpl8dAsvKDB7y+QqINocTUK6WsSIuoyXQ5jg=; b=EpWrx9xV/EoubIjJzR3VB9SmY4WblE+RqSL0NAqGTGrWcaXgTz5cveKJgXDD+4UC6T8c4R JucTqRsf49kf44+zq/vI34o67miHolaeJ55xTLC1IQ2SVIr6VZTJUndRVYPAmgqlPT7e6o SznD6B0dguA/G0FYPa4WLXgYgQxMGjI= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-589-g1im692kNZ-LnslgJn_0WQ-1; Fri, 10 Jun 2022 03:59:02 -0400 X-MC-Unique: g1im692kNZ-LnslgJn_0WQ-1 Received: by mail-wm1-f69.google.com with SMTP id c125-20020a1c3583000000b003978decffedso942745wma.5 for ; Fri, 10 Jun 2022 00:59:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Kv4i4hYRpl8dAsvKDB7y+QqINocTUK6WsSIuoyXQ5jg=; b=q5dT6+wJucGR9UO7F+zARG/SqGAfa3uYU2Z9JNpsY6qLh8AtIwOtMBjXIRTIRnsjEk cyC0oDJ2G63KogbVmBOh/sPpEPXVlkOOK93AVmLl+KLboMg1mrJm5Lld/kw0IxBPNy8M ygfY16nYmyUdaJZfdyS5yQcsyAckko/DQq46CEov6Qr77Ikw8bpOQyxc/w2chMZjeMNZ 8MWa43uzrJRjHMH5M0lr90sZ1io2YPkerFeEy3SeZJj3EbY+UYK0F44VFglUXk6bdYjn oMmEXyvY5T+4nAkZHdUe4smupFGWHVbSNc/ud6UxyNf8QVOcN94n+9Rp0WZS/XRcMG3K fVyQ== X-Gm-Message-State: AOAM533er9OzHZXI32RSVhz21+WV/oA7FcnL5zh54UTu5GkzA+PbSIij VkztvO3LLbkBidThY58UfzdO1uNMx+vSLZWv+CfDCBQ7mEhxgCz/fiHq+nro+LCg6cmsPnAFgBi WHfUAd9VRgGu1bYam7jqvpAPaKAql5h0TZ8HWbXIEgGlgq12qTdEnHVE9OhrC X-Received: by 2002:adf:f892:0:b0:213:3328:7a51 with SMTP id u18-20020adff892000000b0021333287a51mr43349767wrp.640.1654847940615; Fri, 10 Jun 2022 00:59:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyC6brvei4I0ganZjp4CoytsnTE2/tMBGVQXzUbj/EV2fodOIPlikXjTqRV4r4Ubpp78+xneg== X-Received: by 2002:adf:f892:0:b0:213:3328:7a51 with SMTP id u18-20020adff892000000b0021333287a51mr43349739wrp.640.1654847940319; Fri, 10 Jun 2022 00:59:00 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id j18-20020a05600c191200b003974a00697esm2257304wmq.38.2022.06.10.00.58.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:58:59 -0700 (PDT) Date: Fri, 10 Jun 2022 03:58:57 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Igor Mammedov , Ani Sinha Subject: [PULL 39/54] tests/acpi: Allow modification of q35 CXL CEDT table. Message-ID: <20220610075631.367501-40-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron Needed to allow memory address changes as a result of next patch. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-5-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..effa58b75b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/CEDT.cxl", From patchwork Fri Jun 10 07:59:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641796 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Oga1lSpw; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFTJ3Z46z9s0r for ; Fri, 10 Jun 2022 19:07:00 +1000 (AEST) Received: from localhost ([::1]:52554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaba-0007e7-I6 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:06:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35718) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXx-0001u0-6x for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45463) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXv-0006OX-3c for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847946; 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=fF4zkj+lt60cISdNh0bi8uQF74kqrPF+05zKWN2Kk8U=; b=Oga1lSpwQ0rQNqdhI4trNrXal9xbCS6h0Z+Be7KeodFS81XkNJo9rV7fD98CyqlrmuR+Fn 8A5WRQOutJRb93HgB+Yax4sXFEzxUL/TD0NRql/qeW1If033CVAk347AJFCgoqPuNr+bPg edEFhbNShKvDEs0Sslx6qCNm+BC3OAM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-INGOVF8zPWa0cSwb7XYp4A-1; Fri, 10 Jun 2022 03:59:05 -0400 X-MC-Unique: INGOVF8zPWa0cSwb7XYp4A-1 Received: by mail-wm1-f69.google.com with SMTP id l4-20020a05600c1d0400b0039c60535405so3369687wms.6 for ; Fri, 10 Jun 2022 00:59:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fF4zkj+lt60cISdNh0bi8uQF74kqrPF+05zKWN2Kk8U=; b=m9EJq/Zo9Fjfm/bSG02xEx7JGhmdjGyFL91H/Sq79ZGEZ4KEQP+MKzVKZCcqh1d9Qn m5/odfDRZdTnt0xRnN7EVh0fIO/6mCgjN1mCqDpPefKpcFLKqJ3Svb7Tl1rhzF5S5fzz HvjJFjPSpgChFolh3uzY6TIcwXfje5BOJrLrHwsKSYkwDj3qERIuJADxl3523YOx8wZe rzEaU4DrNVWuYohI7s5y6HLkvHg3lF0RgG+prFlfOe1jSRyUkxlLs0dYwgmUx/vdeMjA bj+ok1URxnjZUF3QsrnK0hnFqI5gmxUolRPPOp7sFtzPoJc/9loY8diPpbD1psoV0rCA NXIA== X-Gm-Message-State: AOAM532uokK6HACxmYW7chBKDM1CEkIDnxfR27J6ACOK7i67sZ4H9ITW b9bwLDlkMGoZUArrfKHR2sazFLs78DNaStKaYoWPrBwWTPXXU4zogjO66e9+2tavmBWxWjPh5+8 oL7/GnZQG0/b6qjSagjgdMo3PXVFHK2Z1Fmc+tNTPxDW77SeRRNj1Y5RjrzwP X-Received: by 2002:a05:6000:1e0b:b0:219:d06:de6c with SMTP id bj11-20020a0560001e0b00b002190d06de6cmr11041888wrb.529.1654847943548; Fri, 10 Jun 2022 00:59:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyng4DGI3RSI9zO00yG8xOaNPQzWrDvVxWXh16Y/OHwcT14F79M0GerlDbeDFFCltKRewymhA== X-Received: by 2002:a05:6000:1e0b:b0:219:d06:de6c with SMTP id bj11-20020a0560001e0b00b002190d06de6cmr11041858wrb.529.1654847943196; Fri, 10 Jun 2022 00:59:03 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id p16-20020a05600c205000b0039c5b9e9142sm1953946wmg.17.2022.06.10.00.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:02 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:00 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Ben Widawsky , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PULL 40/54] pci/pci_expander_bridge: For CXL HB delay the HB register memory region setup. Message-ID: <20220610075631.367501-41-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron As the CXLState will no long be accessible via MachineState at time of PXB_CXL realization, come back later from the machine specific code to fill in the missing memory region setup. Only at this stage is it possible to check if cxl=on, so that check is moved to this later point. Note that for multiple host bridges, the allocation order of the register spaces is changed. This will be reflected in ACPI CEDT. Stubs are added to handle case of CONFIG_PXB=n for machines that call these functions. The bus walking logic is common to all machines so add a utility function + stub to cxl-host*. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-6-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/cxl/cxl_host.h | 1 + include/hw/pci-bridge/pci_expander_bridge.h | 12 ++++++++ hw/cxl/cxl-host-stubs.c | 1 + hw/cxl/cxl-host.c | 20 +++++++++++++ hw/i386/pc.c | 3 ++ hw/pci-bridge/pci_expander_bridge.c | 32 +++++++++++++-------- hw/pci-bridge/pci_expander_bridge_stubs.c | 14 +++++++++ hw/pci-bridge/meson.build | 5 +++- 8 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 include/hw/pci-bridge/pci_expander_bridge.h create mode 100644 hw/pci-bridge/pci_expander_bridge_stubs.c diff --git a/include/hw/cxl/cxl_host.h b/include/hw/cxl/cxl_host.h index 4d642a81fa..a1b662ce40 100644 --- a/include/hw/cxl/cxl_host.h +++ b/include/hw/cxl/cxl_host.h @@ -16,6 +16,7 @@ void cxl_machine_init(Object *obj, CXLState *state); void cxl_fmws_link_targets(CXLState *stat, Error **errp); +void cxl_hook_up_pxb_registers(PCIBus *bus, CXLState *state, Error **errp); extern const MemoryRegionOps cfmws_ops; diff --git a/include/hw/pci-bridge/pci_expander_bridge.h b/include/hw/pci-bridge/pci_expander_bridge.h new file mode 100644 index 0000000000..0b3856d615 --- /dev/null +++ b/include/hw/pci-bridge/pci_expander_bridge.h @@ -0,0 +1,12 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef PCI_EXPANDER_BRIDGE_H +#define PCI_EXPANDER_BRIDGE_H + +#include "hw/cxl/cxl.h" + +void pxb_cxl_hook_up_registers(CXLState *state, PCIBus *bus, Error **errp); + +#endif /* PCI_EXPANDER_BRIDGE_H */ diff --git a/hw/cxl/cxl-host-stubs.c b/hw/cxl/cxl-host-stubs.c index e0d5ec8ad5..cae4afcdde 100644 --- a/hw/cxl/cxl-host-stubs.c +++ b/hw/cxl/cxl-host-stubs.c @@ -10,5 +10,6 @@ void cxl_fmws_link_targets(CXLState *stat, Error **errp) {}; void cxl_machine_init(Object *obj, CXLState *state) {}; +void cxl_hook_up_pxb_registers(PCIBus *bus, CXLState *state, Error **errp) {}; const MemoryRegionOps cfmws_ops; diff --git a/hw/cxl/cxl-host.c b/hw/cxl/cxl-host.c index 8e7738a65b..efa14908d8 100644 --- a/hw/cxl/cxl-host.c +++ b/hw/cxl/cxl-host.c @@ -20,6 +20,7 @@ #include "hw/pci/pci_bridge.h" #include "hw/pci/pci_host.h" #include "hw/pci/pcie_port.h" +#include "hw/pci-bridge/pci_expander_bridge.h" static void cxl_fixed_memory_window_config(CXLState *cxl_state, CXLFixedMemoryWindowOptions *object, @@ -280,3 +281,22 @@ void cxl_machine_init(Object *obj, CXLState *state) object_property_set_description(obj, "cxl-fmw", "CXL Fixed Memory Windows (array)"); } + +void cxl_hook_up_pxb_registers(PCIBus *bus, CXLState *state, Error **errp) +{ + /* Walk the pci busses looking for pxb busses to hook up */ + if (bus) { + QLIST_FOREACH(bus, &bus->child, sibling) { + if (!pci_bus_is_root(bus)) { + continue; + } + if (pci_bus_is_cxl(bus)) { + if (!state->is_enabled) { + error_setg(errp, "CXL host bridges present, but cxl=off"); + return; + } + pxb_cxl_hook_up_registers(state, bus, errp); + } + } + } +} diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 6cecd74d58..9f48d02739 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -37,6 +37,7 @@ #include "hw/ide.h" #include "hw/pci/pci.h" #include "hw/pci/pci_bus.h" +#include "hw/pci-bridge/pci_expander_bridge.h" #include "hw/nvram/fw_cfg.h" #include "hw/timer/hpet.h" #include "hw/firmware/smbios.h" @@ -735,6 +736,8 @@ void pc_machine_done(Notifier *notifier, void *data) MachineState *ms = MACHINE(pcms); if (ms->cxl_devices_state) { + cxl_hook_up_pxb_registers(pcms->bus, ms->cxl_devices_state, + &error_fatal); cxl_fmws_link_targets(ms->cxl_devices_state, &error_fatal); } diff --git a/hw/pci-bridge/pci_expander_bridge.c b/hw/pci-bridge/pci_expander_bridge.c index 02032360f5..c9e817aa58 100644 --- a/hw/pci-bridge/pci_expander_bridge.c +++ b/hw/pci-bridge/pci_expander_bridge.c @@ -17,6 +17,7 @@ #include "hw/pci/pci_host.h" #include "hw/qdev-properties.h" #include "hw/pci/pci_bridge.h" +#include "hw/pci-bridge/pci_expander_bridge.h" #include "hw/cxl/cxl.h" #include "qemu/range.h" #include "qemu/error-report.h" @@ -186,25 +187,38 @@ static const TypeInfo pxb_host_info = { static void pxb_cxl_realize(DeviceState *dev, Error **errp) { - MachineState *ms = MACHINE(qdev_get_machine()); SysBusDevice *sbd = SYS_BUS_DEVICE(dev); CXLHost *cxl = PXB_CXL_HOST(dev); CXLComponentState *cxl_cstate = &cxl->cxl_cstate; struct MemoryRegion *mr = &cxl_cstate->crb.component_registers; - hwaddr offset; cxl_component_register_block_init(OBJECT(dev), cxl_cstate, TYPE_PXB_CXL_HOST); sysbus_init_mmio(sbd, mr); +} - offset = memory_region_size(mr) * ms->cxl_devices_state->next_mr_idx; - if (offset > memory_region_size(&ms->cxl_devices_state->host_mr)) { +/* + * Host bridge realization has no means of knowning state associated + * with a particular machine. As such, it is nececssary to delay + * final setup of the host bridge register space until later in the + * machine bring up. + */ +void pxb_cxl_hook_up_registers(CXLState *cxl_state, PCIBus *bus, Error **errp) +{ + PXBDev *pxb = PXB_CXL_DEV(pci_bridge_get_device(bus)); + CXLHost *cxl = pxb->cxl.cxl_host_bridge; + CXLComponentState *cxl_cstate = &cxl->cxl_cstate; + struct MemoryRegion *mr = &cxl_cstate->crb.component_registers; + hwaddr offset; + + offset = memory_region_size(mr) * cxl_state->next_mr_idx; + if (offset > memory_region_size(&cxl_state->host_mr)) { error_setg(errp, "Insufficient space for pxb cxl host register space"); return; } - memory_region_add_subregion(&ms->cxl_devices_state->host_mr, offset, mr); - ms->cxl_devices_state->next_mr_idx++; + memory_region_add_subregion(&cxl_state->host_mr, offset, mr); + cxl_state->next_mr_idx++; } static void pxb_cxl_host_class_init(ObjectClass *class, void *data) @@ -461,17 +475,11 @@ static const TypeInfo pxb_pcie_dev_info = { static void pxb_cxl_dev_realize(PCIDevice *dev, Error **errp) { - MachineState *ms = MACHINE(qdev_get_machine()); - /* A CXL PXB's parent bus is still PCIe */ if (!pci_bus_is_express(pci_get_bus(dev))) { error_setg(errp, "pxb-cxl devices cannot reside on a PCI bus"); return; } - if (!ms->cxl_devices_state || !ms->cxl_devices_state->is_enabled) { - error_setg(errp, "Machine does not have cxl=on"); - return; - } pxb_dev_realize_common(dev, CXL, errp); pxb_dev_reset(DEVICE(dev)); diff --git a/hw/pci-bridge/pci_expander_bridge_stubs.c b/hw/pci-bridge/pci_expander_bridge_stubs.c new file mode 100644 index 0000000000..b35180311f --- /dev/null +++ b/hw/pci-bridge/pci_expander_bridge_stubs.c @@ -0,0 +1,14 @@ +/* + * SPDX-License-Identifier: GPL-2.0-or-later + * + * Stubs for calls made from machines to handle the case where CONFIG_PXB + * is not enabled. + */ +#include "qemu/osdep.h" +#include "qapi/error.h" +#include "hw/pci/pci.h" +#include "hw/pci/pci_bus.h" +#include "hw/pci-bridge/pci_expander_bridge.h" +#include "hw/cxl/cxl.h" + +void pxb_cxl_hook_up_registers(CXLState *state, PCIBus *bus, Error **errp) {}; diff --git a/hw/pci-bridge/meson.build b/hw/pci-bridge/meson.build index b6d26a03d5..fdbe2e07c5 100644 --- a/hw/pci-bridge/meson.build +++ b/hw/pci-bridge/meson.build @@ -3,7 +3,8 @@ pci_ss.add(files('pci_bridge_dev.c')) pci_ss.add(when: 'CONFIG_I82801B11', if_true: files('i82801b11.c')) pci_ss.add(when: 'CONFIG_IOH3420', if_true: files('ioh3420.c')) pci_ss.add(when: 'CONFIG_PCIE_PORT', if_true: files('pcie_root_port.c', 'gen_pcie_root_port.c', 'pcie_pci_bridge.c')) -pci_ss.add(when: 'CONFIG_PXB', if_true: files('pci_expander_bridge.c')) +pci_ss.add(when: 'CONFIG_PXB', if_true: files('pci_expander_bridge.c'), + if_false: files('pci_expander_bridge_stubs.c')) pci_ss.add(when: 'CONFIG_XIO3130', if_true: files('xio3130_upstream.c', 'xio3130_downstream.c')) pci_ss.add(when: 'CONFIG_CXL', if_true: files('cxl_root_port.c')) @@ -13,3 +14,5 @@ pci_ss.add(when: 'CONFIG_DEC_PCI', if_true: files('dec.c')) pci_ss.add(when: 'CONFIG_SIMBA', if_true: files('simba.c')) softmmu_ss.add_all(when: 'CONFIG_PCI', if_true: pci_ss) + +softmmu_ss.add(when: 'CONFIG_ALL', if_true: files('pci_expander_bridge_stubs.c')) From patchwork Fri Jun 10 07:59:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641724 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z/5pHvOu; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKDv210Wrz9s09 for ; Fri, 10 Jun 2022 18:40:44 +1000 (AEST) Received: from localhost ([::1]:52634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaC9-0002Ui-EX for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:40:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXz-0001vu-Fl for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:20796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZXy-0006PC-10 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847949; 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=ORUPsrNOZ6jfimbq8TEFWzi9CHilfKQZLZzyDVuoqOY=; b=Z/5pHvOuUIkY5dtglI/G31e6trdPA2XWNmsUVcAIwFl+UbePeTZrB5+a8/hSDqOrjVTzQP tIzpKQYYeg8Okr8vjRVQGEGmT0SuRBkcodDizqoMAZFvTT2vIx+I4LDXhGQyxEdrRJjHmD inlfNAC4Dlh5mtN8+L9YHtJ1SpsYdok= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-446-1ughob_SO1GvuqKt72LVdQ-1; Fri, 10 Jun 2022 03:59:07 -0400 X-MC-Unique: 1ughob_SO1GvuqKt72LVdQ-1 Received: by mail-wr1-f69.google.com with SMTP id i10-20020a5d55ca000000b002103d76ffcaso5996479wrw.17 for ; Fri, 10 Jun 2022 00:59:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ORUPsrNOZ6jfimbq8TEFWzi9CHilfKQZLZzyDVuoqOY=; b=oY74TrBtmDrJg+uZp9ual1KPsN16A1qrc4y4aWEYxW+X8LhUKTl1pjoWgDNidumD9F tlJd9YrAD2XNQ3rusCCojlnO6AnicsbxcFc4ylxedfTUQzMpaZeuEkzztjN7pPw1E+/I HOy6hl3dSa4CJ6BXpEMJUfgr9/h8V2r9kqcuvVk9kE2HvDzL6B/pPjzzWlS+XuAvZQqq inC5j2JwoCnoEnSR5iB0JHHIpfmuyHJBTLsdG3BpJIJWkW8DfOpkOx1EG+GaJ/KgVzIG g0U/ZZ4ZZqZhn2r1llEPCu2PARmb65WIZcrLdpkbOHQjyuY1ztkVFH7OCXZ7zSzJfzxp gHwQ== X-Gm-Message-State: AOAM5326Skaku0WzV/nano5T92TxizT6VWyDIa2LyDEajIpXub/1AM3C oGGplVLHZ6sEHTwJ+2OfUosjr23jxN5MCsLuTFfsON8hgXe4CsUEq/8bjxmHvO65tFGWqdqR8XP yebDlsgh1NG+Cex9nZA9OflegSYH/X1biuy73697KNSRoNM+8rZgdfkR8ry82 X-Received: by 2002:a05:6000:1861:b0:216:4019:9ee6 with SMTP id d1-20020a056000186100b0021640199ee6mr32868884wri.172.1654847946209; Fri, 10 Jun 2022 00:59:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXOzqFne2CjEVK/+Ft9Ki46MAJp3wdx5iydg1BffPVqOSEfpIS1k+wvgzBi1pYQz0esT+dKg== X-Received: by 2002:a05:6000:1861:b0:216:4019:9ee6 with SMTP id d1-20020a056000186100b0021640199ee6mr32868864wri.172.1654847945966; Fri, 10 Jun 2022 00:59:05 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id m185-20020a1c26c2000000b003974d0d981dsm1956909wmm.35.2022.06.10.00.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:05 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:03 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Igor Mammedov , Ani Sinha Subject: [PULL 41/54] tests/acpi: Update q35/CEDT.cxl for new memory addresses. Message-ID: <20220610075631.367501-42-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron The CEDT table includes addreses of host bridge registers. There are allocated in a different order due to the previous patch, so update to the table is needed. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-7-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/CEDT.cxl | Bin 184 -> 184 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/CEDT.cxl b/tests/data/acpi/q35/CEDT.cxl index b8fa06b00e65712e91e0a5ea0d9277e0146d1c00..ff8203af070241bd23dd0eb8a51460692bb7d229 100644 GIT binary patch delta 18 acmdnNxPx(m*~Boui7rAD&G;s!ga80Nd X-Patchwork-Id: 1641747 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WJFhN8YH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKF3r20v0z9s09 for ; Fri, 10 Jun 2022 18:48:22 +1000 (AEST) Received: from localhost ([::1]:32872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaJX-0000Ri-Iy for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:48:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY8-00025l-VB for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:57348) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY6-0006Pn-IM for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847955; 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=G4auDEbzNLl1MzZt76eehS9c+16DhBQgGfHApQUoen0=; b=WJFhN8YH0kX13uIyn70rZMW/Kb4vUyfwbdAnD9f9M0xUbIUE5Gi/wPVYPMb56MWar6eL7R 74nSy2A7KcnCFIJXBKwFd5CcfPXh7eoJDrrNwJOlMhjgfn8VZjvYWUDikDJuR0vxjZJv7g 7dKQ2Omuv3h5/w7swirHxKn7E6rO3P4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-128-WYfoQdiVMUW97c3z4_on_Q-1; Fri, 10 Jun 2022 03:59:11 -0400 X-MC-Unique: WYfoQdiVMUW97c3z4_on_Q-1 Received: by mail-wr1-f72.google.com with SMTP id ay4-20020a5d6f04000000b002183e363f9bso3820524wrb.22 for ; Fri, 10 Jun 2022 00:59:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=G4auDEbzNLl1MzZt76eehS9c+16DhBQgGfHApQUoen0=; b=O4byXBK50fkwad8h/8ffVUvFIPpnget6St3clTASE5Oqns2Usq1hWp96LM6DMst7An evoBHPBFbIZMBuwX45iIih3Qd9Sj09uZEr9/lGOigHvXzFFrQdJs16FaFaW5jzfI410H +QCQCOAscrJ6sp5aKtY89qhKBdHgRoHx6PRG1t9LQlkxp56RowZVk9rm6aUGSAOUdioI DHMoTwzEMIhyOFlQ9M9NvJu7CTpNP36izOF9vWcNYPzo1dPAIqOCaWD9+hgga2nwtw+6 5G3hGYhja/1DAONtmf2KssLP++TXPb0GZ1d33ir3+vksg5ST6xE5bOKhVMbkxAqlqbfv wL+g== X-Gm-Message-State: AOAM533ZhtcL56WeAEsQR0WOeEIQVNdGTYQUcR3TgzmD/NNfvni5+Ffz pckdLUCHjX3tfaZDkGtbfjo0wxaRPQE+fm7ZJ2qyIqmtA4YcPnEynq36mZ05V70uls0g9A7i7Lf CzodlT73yRmVsjmJiYmclzM2da0+ZA4iUJnV99riZeU7/mcObuvwQHeh4X71e X-Received: by 2002:adf:e2cb:0:b0:20c:c1bb:9fcb with SMTP id d11-20020adfe2cb000000b0020cc1bb9fcbmr43925509wrj.35.1654847949669; Fri, 10 Jun 2022 00:59:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKbFXJR1a5MWJit6J5Uw74QaqXruR3FHn8lBgHM7/DIl+3A6X6xVl3+DVZlFtZzFJK3aD+dw== X-Received: by 2002:adf:e2cb:0:b0:20c:c1bb:9fcb with SMTP id d11-20020adfe2cb000000b0020cc1bb9fcbmr43925476wrj.35.1654847949314; Fri, 10 Jun 2022 00:59:09 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id f6-20020a05600c4e8600b0039c6ce32a2dsm2151359wmq.33.2022.06.10.00.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:08 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:06 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?q?Mathieu-D?= =?utf-8?q?aud=C3=A9?= , Yanan Wang , Igor Mammedov , Ani Sinha , Paolo Bonzini , Richard Henderson Subject: [PULL 42/54] hw/cxl: Move the CXLState from MachineState to machine type specific state. Message-ID: <20220610075631.367501-43-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron This removes the last of the CXL code from the MachineState where it is visible to all Machines to only those that support CXL (currently i386/pc) As i386/pc always support CXL now, stop allocating the state independently. Note the pxb register hookup code runs even if cxl=off in order to detect pxb_cxl host bridges and fail to start if any are present as they won't have the control registers available. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-8-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/boards.h | 1 - include/hw/i386/pc.h | 2 ++ hw/core/machine.c | 6 ------ hw/i386/acpi-build.c | 6 +++--- hw/i386/pc.c | 33 ++++++++++++++++----------------- 5 files changed, 21 insertions(+), 27 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index dd9fc56df2..031f5f884d 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -360,7 +360,6 @@ struct MachineState { CPUArchIdList *possible_cpus; CpuTopology smp; struct NVDIMMState *nvdimms_state; - struct CXLState *cxl_devices_state; struct NumaState *numa_state; CXLFixedMemoryWindowOptionsList *cfmws_list; }; diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index dee38cfac4..003a86b721 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -14,6 +14,7 @@ #include "qom/object.h" #include "hw/i386/sgx-epc.h" #include "hw/firmware/smbios.h" +#include "hw/cxl/cxl.h" #define HPET_INTCAP "hpet-intcap" @@ -55,6 +56,7 @@ typedef struct PCMachineState { hwaddr memhp_io_base; SGXEPCState sgx_epc; + CXLState cxl_devices_state; } PCMachineState; #define PC_MACHINE_ACPI_DEVICE_PROP "acpi-device" diff --git a/hw/core/machine.c b/hw/core/machine.c index 2e589d99e9..a673302cce 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -33,7 +33,6 @@ #include "sysemu/qtest.h" #include "hw/pci/pci.h" #include "hw/mem/nvdimm.h" -#include "hw/cxl/cxl.h" #include "migration/global_state.h" #include "migration/vmstate.h" #include "exec/confidential-guest-support.h" @@ -1075,10 +1074,6 @@ static void machine_initfn(Object *obj) "Valid values are cpu, mem-ctrl"); } - if (mc->cxl_supported) { - ms->cxl_devices_state = g_new0(CXLState, 1); - } - if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) { ms->numa_state = g_new0(NumaState, 1); object_property_add_bool(obj, "hmat", @@ -1116,7 +1111,6 @@ static void machine_finalize(Object *obj) g_free(ms->device_memory); g_free(ms->nvdimms_state); g_free(ms->numa_state); - g_free(ms->cxl_devices_state); } bool machine_usb(MachineState *machine) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 663c34b9d1..73d0bf5937 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -1631,7 +1631,7 @@ build_dsdt(GArray *table_data, BIOSLinker *linker, /* Handle the ranges for the PXB expanders */ if (pci_bus_is_cxl(bus)) { - MemoryRegion *mr = &machine->cxl_devices_state->host_mr; + MemoryRegion *mr = &pcms->cxl_devices_state.host_mr; uint64_t base = mr->addr; cxl_present = true; @@ -2614,9 +2614,9 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) machine->nvdimms_state, machine->ram_slots, x86ms->oem_id, x86ms->oem_table_id); } - if (machine->cxl_devices_state->is_enabled) { + if (pcms->cxl_devices_state.is_enabled) { cxl_build_cedt(table_offsets, tables_blob, tables->linker, - x86ms->oem_id, x86ms->oem_table_id, machine->cxl_devices_state); + x86ms->oem_id, x86ms->oem_table_id, &pcms->cxl_devices_state); } acpi_add_table(table_offsets, tables_blob); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 9f48d02739..a0c0d69698 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -733,12 +733,12 @@ void pc_machine_done(Notifier *notifier, void *data) PCMachineState *pcms = container_of(notifier, PCMachineState, machine_done); X86MachineState *x86ms = X86_MACHINE(pcms); - MachineState *ms = MACHINE(pcms); - if (ms->cxl_devices_state) { - cxl_hook_up_pxb_registers(pcms->bus, ms->cxl_devices_state, - &error_fatal); - cxl_fmws_link_targets(ms->cxl_devices_state, &error_fatal); + cxl_hook_up_pxb_registers(pcms->bus, &pcms->cxl_devices_state, + &error_fatal); + + if (pcms->cxl_devices_state.is_enabled) { + cxl_fmws_link_targets(&pcms->cxl_devices_state, &error_fatal); } /* set the number of CPUs */ @@ -908,8 +908,8 @@ void pc_memory_init(PCMachineState *pcms, &machine->device_memory->mr); } - if (machine->cxl_devices_state->is_enabled) { - MemoryRegion *mr = &machine->cxl_devices_state->host_mr; + if (pcms->cxl_devices_state.is_enabled) { + MemoryRegion *mr = &pcms->cxl_devices_state.host_mr; hwaddr cxl_size = MiB; if (pcmc->has_reserved_memory && machine->device_memory->base) { @@ -927,12 +927,12 @@ void pc_memory_init(PCMachineState *pcms, memory_region_init(mr, OBJECT(machine), "cxl_host_reg", cxl_size); memory_region_add_subregion(system_memory, cxl_base, mr); cxl_resv_end = cxl_base + cxl_size; - if (machine->cxl_devices_state->fixed_windows) { + if (pcms->cxl_devices_state.fixed_windows) { hwaddr cxl_fmw_base; GList *it; cxl_fmw_base = ROUND_UP(cxl_base + cxl_size, 256 * MiB); - for (it = machine->cxl_devices_state->fixed_windows; it; it = it->next) { + for (it = pcms->cxl_devices_state.fixed_windows; it; it = it->next) { CXLFixedWindow *fw = it->data; fw->base = cxl_fmw_base; @@ -974,7 +974,7 @@ void pc_memory_init(PCMachineState *pcms, res_mem_end += memory_region_size(&machine->device_memory->mr); } - if (machine->cxl_devices_state->is_enabled) { + if (pcms->cxl_devices_state.is_enabled) { res_mem_end = cxl_resv_end; } *val = cpu_to_le64(ROUND_UP(res_mem_end, 1 * GiB)); @@ -1010,12 +1010,12 @@ uint64_t pc_pci_hole64_start(void) X86MachineState *x86ms = X86_MACHINE(pcms); uint64_t hole64_start = 0; - if (ms->cxl_devices_state->host_mr.addr) { - hole64_start = ms->cxl_devices_state->host_mr.addr + - memory_region_size(&ms->cxl_devices_state->host_mr); - if (ms->cxl_devices_state->fixed_windows) { + if (pcms->cxl_devices_state.host_mr.addr) { + hole64_start = pcms->cxl_devices_state.host_mr.addr + + memory_region_size(&pcms->cxl_devices_state.host_mr); + if (pcms->cxl_devices_state.fixed_windows) { GList *it; - for (it = ms->cxl_devices_state->fixed_windows; it; it = it->next) { + for (it = pcms->cxl_devices_state.fixed_windows; it; it = it->next) { CXLFixedWindow *fw = it->data; hole64_start = fw->mr.addr + memory_region_size(&fw->mr); } @@ -1691,7 +1691,6 @@ static void pc_machine_set_max_fw_size(Object *obj, Visitor *v, static void pc_machine_initfn(Object *obj) { PCMachineState *pcms = PC_MACHINE(obj); - MachineState *ms = MACHINE(obj); #ifdef CONFIG_VMPORT pcms->vmport = ON_OFF_AUTO_AUTO; @@ -1716,7 +1715,7 @@ static void pc_machine_initfn(Object *obj) pcms->pcspk = isa_new(TYPE_PC_SPEAKER); object_property_add_alias(OBJECT(pcms), "pcspk-audiodev", OBJECT(pcms->pcspk), "audiodev"); - cxl_machine_init(obj, ms->cxl_devices_state); + cxl_machine_init(obj, &pcms->cxl_devices_state); } static void pc_machine_reset(MachineState *machine) From patchwork Fri Jun 10 07:59:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=H7hKzQxI; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFtK1gBBz9s0r for ; Fri, 10 Jun 2022 19:25:11 +1000 (AEST) Received: from localhost ([::1]:35862 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzatA-0007zt-9o for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:25:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY6-00021N-0N for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY4-0006Pq-Ez for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847955; 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=mpocKeoZpGwYugYQgzI+xoZKK3fD0b3UGmcMDjl31wg=; b=H7hKzQxIWBaMj1yrAk0XsnntlwJt4lEZUBpiBmJLJV9ziQjHBva4Vw45Oed8HN8XFUtp6m Ij9ASWiYBBTBp92LQxQbTHnJcSxcfgmlisx/SrT/8CqMEeBUqQCN75ACZNQ2fZ3yQHl01x jgbsKK1XUNHamLDqFMaurtUELwu/pcM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-4azzMMmAPomXGs5RkVY8Hw-1; Fri, 10 Jun 2022 03:59:14 -0400 X-MC-Unique: 4azzMMmAPomXGs5RkVY8Hw-1 Received: by mail-wm1-f72.google.com with SMTP id m22-20020a7bcb96000000b0039c4f6ade4dso4686520wmi.8 for ; Fri, 10 Jun 2022 00:59:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mpocKeoZpGwYugYQgzI+xoZKK3fD0b3UGmcMDjl31wg=; b=wqufkfvhAx9FvaRUdnBd8/YLFT7LBkKMzIRPNA1tCP+NEkWsfBVXJykOAwkDryMb6l 6hy9GINR7udFehdhqrfmC/w2gJhAekDocT1eAd6rTwVtlErCrv1u7xW3TBPAPSCRIkZd Y98hC/SW8cVhmIsNZfASwPUOvr6nMdT5y0YEE43pCYGDBLu2cRRYvxkW4mbdjRPgQxyK r9xekiEEIBYuWFqePYJdqMtu3JOttfj7ZhsbJtP1GSbMsTdnBSAkrANGoCk9WOB07SkK 1qxj3fcwNyQbYuRFW+6gR9t90fXqxElJuYQGseICEl6irdRuSEVmY10I9Q08A70kiqGX 9Ahw== X-Gm-Message-State: AOAM532BemnzA2aLzW89wabuEQpWIVITlgnj70QG9y8Kq7eNp94qIder OjWULevIrtoCHx/vcF9VuCi4I9StiGZqmgmO7kIssKSx5B6yRXdh7Z/fVLwqBfSv+qmUPCV9Md5 WNKSpCs1r4v7GMpg4VSCePCyN+QLyiN/6YyedX4gqO1PahO4qc01duZiR+PDp X-Received: by 2002:a7b:c4d4:0:b0:39c:5bb7:2210 with SMTP id g20-20020a7bc4d4000000b0039c5bb72210mr7371455wmk.99.1654847953125; Fri, 10 Jun 2022 00:59:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuIp3f8pJLKdl9zlo0UNlNJmNTWPIPgwghuh9OX9FBzinVMywquZmPAOUNQ74ROjA6umb7Ag== X-Received: by 2002:a7b:c4d4:0:b0:39c:5bb7:2210 with SMTP id g20-20020a7bc4d4000000b0039c5bb72210mr7371427wmk.99.1654847952851; Fri, 10 Jun 2022 00:59:12 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id w16-20020adff9d0000000b002103de97455sm26203392wrr.69.2022.06.10.00.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:12 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:09 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Philippe =?utf-8?q?Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Yanan Wang Subject: [PULL 43/54] hw/machine: Drop cxl_supported flag as no longer useful Message-ID: <20220610075631.367501-44-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron As all the CXL elements have moved to boards that support CXL, there is no need to maintain a top level flag. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608145440.26106-9-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/boards.h | 1 - hw/i386/pc.c | 1 - 2 files changed, 2 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 031f5f884d..d94edcef28 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -269,7 +269,6 @@ struct MachineClass { bool ignore_boot_device_suffixes; bool smbus_no_migration_support; bool nvdimm_supported; - bool cxl_supported; bool numa_mem_supported; bool auto_enable_numa; SMPCompatProps smp_props; diff --git a/hw/i386/pc.c b/hw/i386/pc.c index a0c0d69698..1b6067ff22 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1804,7 +1804,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) mc->default_cpu_type = TARGET_DEFAULT_CPU_TYPE; mc->nvdimm_supported = true; mc->smp_props.dies_supported = true; - mc->cxl_supported = true; mc->default_ram_id = "pc.ram"; object_class_property_add(oc, PC_MACHINE_MAX_RAM_BELOW_4G, "size", From patchwork Fri Jun 10 07:59:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641846 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=MG45pgEO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKG242crMz9s0r for ; Fri, 10 Jun 2022 19:31:54 +1000 (AEST) Received: from localhost ([::1]:44564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzazf-0006AG-VH for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:31:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYA-00028Z-V5 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:30044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZY7-0006Qf-H8 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847958; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jFf4woivlgGIhUXgkypBGc3W4vwTg3PU5HRExeu4NKE=; b=MG45pgEOK+RegKXzOIq46uaVdN4swAlJoJoeuSUaNlLDR7UEBLH63ORzKSuIMyvkhFT1Ty JdAjb6LuDr/iGvYz6+D6oziBOTN34lUsx1av6JnPG09JY0GUd8NRuSPlK+rQyQvbSwbhsJ ikN6+E7Dc6yZAu3y88BaujOxkv8aQ+o= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-167-rm_JF7_3OKygNvkFajXi0A-1; Fri, 10 Jun 2022 03:59:17 -0400 X-MC-Unique: rm_JF7_3OKygNvkFajXi0A-1 Received: by mail-wr1-f69.google.com with SMTP id c7-20020adfa707000000b002184d715e69so2930504wrd.10 for ; Fri, 10 Jun 2022 00:59:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=jFf4woivlgGIhUXgkypBGc3W4vwTg3PU5HRExeu4NKE=; b=GBBkpeW8E12Jd9Pgo8Tngd9WdC9tS0XULBSeoF37aB8wA4b9prEc6CPCdw8mZnpTsU OV5SnWbJSzPGDdPQb0bDTQy3MWrrkxuka9LrJ7sM55tcLiZQpUKNdzjA8oo2SsG+zXQy Vu8LPnyPGPpPkt87O1VrIAp6Ls0zOaF+1AdH7bCBXdWwxLDQ1XZdCKA7fpBDBWJul/Kv Wl1+iNcharH2+KmlWDRZIBGsB4Ud0YvMLGK/4foL2wNuk3lr9tGcQiZvPEV5jvzj96Bi YKg3yhDl2Z2aHcugHMI6yXWeV1mmXvrw3GI2Buw3Yl3N7xiYjhWYPdlLSvh4p7ZGFdlp emiA== X-Gm-Message-State: AOAM531jyJgPKfqNBoLGs7w/3YkIG5MRedbs0RWOd4ajkfLlM043fSt5 uAgMC1T9xKEJVBQp5lj3KETzNUwjsJJOsTDfKjh3DYfRrZCSBLvV2+4ncMdegBoDrsQe3qRdY84 fPacD9n6vLAte/Nly57Hwo34kKomswl9dU6plEaNEUshkMfJIZTkeytzaWMes X-Received: by 2002:adf:f390:0:b0:218:4de4:510c with SMTP id m16-20020adff390000000b002184de4510cmr19434429wro.475.1654847956323; Fri, 10 Jun 2022 00:59:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzeE9euYqVck6zjVN5GYaZMZkz/ySz2j0Y2UBDbLULqcLLETfX1TJUK7EwwkOyNJnJQkDttUA== X-Received: by 2002:adf:f390:0:b0:218:4de4:510c with SMTP id m16-20020adff390000000b002184de4510cmr19434400wro.475.1654847956000; Fri, 10 Jun 2022 00:59:16 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id h6-20020adfa4c6000000b0020fe61acd09sm28001338wrb.12.2022.06.10.00.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:15 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:13 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Claudio Fontana , Dario Faggioli , Martin =?utf-8?b?TGnFoWth?= , qemu-stable@nongnu.org, Ani Sinha , Marcel Apfelbaum Subject: [PULL 44/54] pci: fix overflow in snprintf string formatting Message-ID: <20220610075631.367501-45-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Claudio Fontana the code in pcibus_get_fw_dev_path contained the potential for a stack buffer overflow of 1 byte, potentially writing to the stack an extra NUL byte. This overflow could happen if the PCI slot is >= 0x10000000, and the PCI function is >= 0x10000000, due to the size parameter of snprintf being incorrectly calculated in the call: if (PCI_FUNC(d->devfn)) snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn)); since the off obtained from a previous call to snprintf is added instead of subtracted from the total available size of the buffer. Without the accurate size guard from snprintf, we end up writing in the worst case: name (32) + "@" (1) + SLOT (8) + "," (1) + FUNC (8) + term NUL (1) = 51 bytes In order to provide something more robust, replace all of the code in pcibus_get_fw_dev_path with a single call to g_strdup_printf, so there is no need to rely on manual calculations. Found by compiling QEMU with FORTIFY_SOURCE=3 as the error: *** buffer overflow detected ***: terminated Thread 1 "qemu-system-x86" received signal SIGABRT, Aborted. [Switching to Thread 0x7ffff642c380 (LWP 121307)] 0x00007ffff71ff55c in __pthread_kill_implementation () from /lib64/libc.so.6 (gdb) bt #0 0x00007ffff71ff55c in __pthread_kill_implementation () at /lib64/libc.so.6 #1 0x00007ffff71ac6f6 in raise () at /lib64/libc.so.6 #2 0x00007ffff7195814 in abort () at /lib64/libc.so.6 #3 0x00007ffff71f279e in __libc_message () at /lib64/libc.so.6 #4 0x00007ffff729767a in __fortify_fail () at /lib64/libc.so.6 #5 0x00007ffff7295c36 in () at /lib64/libc.so.6 #6 0x00007ffff72957f5 in __snprintf_chk () at /lib64/libc.so.6 #7 0x0000555555b1c1fd in pcibus_get_fw_dev_path () #8 0x0000555555f2bde4 in qdev_get_fw_dev_path_helper.constprop () #9 0x0000555555f2bd86 in qdev_get_fw_dev_path_helper.constprop () #10 0x00005555559a6e5d in get_boot_device_path () #11 0x00005555559a712c in get_boot_devices_list () #12 0x0000555555b1a3d0 in fw_cfg_machine_reset () #13 0x0000555555bf4c2d in pc_machine_reset () #14 0x0000555555c66988 in qemu_system_reset () #15 0x0000555555a6dff6 in qdev_machine_creation_done () #16 0x0000555555c79186 in qmp_x_exit_preconfig.part () #17 0x0000555555c7b459 in qemu_init () #18 0x0000555555960a29 in main () Found-by: Dario Faggioli Found-by: Martin Liška Cc: qemu-stable@nongnu.org Signed-off-by: Claudio Fontana Message-Id: <20220531114707.18830-1-cfontana@suse.de> Reviewed-by: Ani Sinha --- hw/pci/pci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index a9b37f8000..6e7015329c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2640,15 +2640,15 @@ static char *pci_dev_fw_name(DeviceState *dev, char *buf, int len) static char *pcibus_get_fw_dev_path(DeviceState *dev) { PCIDevice *d = (PCIDevice *)dev; - char path[50], name[33]; - int off; + char name[33]; + int has_func = !!PCI_FUNC(d->devfn); - off = snprintf(path, sizeof(path), "%s@%x", - pci_dev_fw_name(dev, name, sizeof name), - PCI_SLOT(d->devfn)); - if (PCI_FUNC(d->devfn)) - snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn)); - return g_strdup(path); + return g_strdup_printf("%s@%x%s%.*x", + pci_dev_fw_name(dev, name, sizeof(name)), + PCI_SLOT(d->devfn), + has_func ? "," : "", + has_func, + PCI_FUNC(d->devfn)); } static char *pcibus_get_dev_path(DeviceState *dev) From patchwork Fri Jun 10 07:59:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641850 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Z9yXRJog; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKGDT22pcz9s0r for ; Fri, 10 Jun 2022 19:40:56 +1000 (AEST) Received: from localhost ([::1]:53024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzb8P-0003dB-7T for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:40:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYC-00029h-2V for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44538) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYA-0006R4-Dr for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847961; 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=bpnbN543AcE2EomsO+62PxMhfcQHo0eUqiRvrbZfeFY=; b=Z9yXRJog7YVd7siINCBCvUnI5nmuP5InEtlE8ghKWW1v9F2K8u2iKOBa4Srfmwu4EZhxJ0 EqGPrslpDA85lFyhK+v25MkC7YHRutmbSL3iePxcVB9cKyNQ3TL7fnfeiC6y6UTndjE5lC 2T3cI3ym/o8WiZbiz8Z2+zStBbB2nsM= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-35-qbaX72CFMFS5oJuntdLC8g-1; Fri, 10 Jun 2022 03:59:20 -0400 X-MC-Unique: qbaX72CFMFS5oJuntdLC8g-1 Received: by mail-wm1-f70.google.com with SMTP id be12-20020a05600c1e8c00b0039c506b52a4so1222965wmb.1 for ; Fri, 10 Jun 2022 00:59:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bpnbN543AcE2EomsO+62PxMhfcQHo0eUqiRvrbZfeFY=; b=UCuuwtCTHYsxkUMQKSAmzIYwv9qHXACLL3V27WtFzzvhtmzVNeYOrnOJTpde3c6UOv ZZ6CoPlNlkALElIj3l+bdekKsY2NENCVzx6PAwlQ8SpGHNKUhOUb3rMSyU/ILN6ac1LP CMAAHVVapELJzSCWZeZ/REZFDATPsznbEhp9U8apQpm+AJ+1SoJYw53tTs5IczyMFKUB sBujzuRdzfxk8hVVMG2rD8sLWXY1TSKDu048zeD1BgYX7n8uFno3/zn1XdY3MGynkBAA x1r8izMcJpmIkNe6HgLKTv1SBtB/MiQfSlsJfCfda07OneD4TrrW5yilo+xbCdFXEOHo Ee4w== X-Gm-Message-State: AOAM532QzYDJ7Idth7wnQVJNUDAY8dl6A75nxmxTt7ecg+74XKIV/73n IKsIUP4S1lu6O+F+vGq3wf9FM114atvBh81/YGlOlsLq2drq8RS66K9RyyvgdqOSgrJIsyI6vro nuL2jVzUqmuXSHHT+KmW1Qq7d3dHidjreSF3xu3RAUAt08wrsjyMlKKtoOp8g X-Received: by 2002:a05:600c:2d94:b0:39c:7cb9:5f1d with SMTP id i20-20020a05600c2d9400b0039c7cb95f1dmr2277993wmg.26.1654847959103; Fri, 10 Jun 2022 00:59:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJN+mevoR0Jc8Mn6kOgssEu+bRbpHOmBQizMBX8Ved+qhp6KOQ8KAoFWMV8yaDkAIsoP+GRg== X-Received: by 2002:a05:600c:2d94:b0:39c:7cb9:5f1d with SMTP id i20-20020a05600c2d9400b0039c7cb95f1dmr2277964wmg.26.1654847958770; Fri, 10 Jun 2022 00:59:18 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id u2-20020a7bcb02000000b0039c5cecf206sm2033600wmj.4.2022.06.10.00.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:18 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:16 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Jonathan Cameron , Ben Widawsky , Ben Widawsky Subject: [PULL 45/54] hw/cxl: Fix missing write mask for HDM decoder target list registers Message-ID: <20220610075631.367501-46-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Jonathan Cameron Without being able to write these registers, no interleaving is possible. More refined checks of HDM register state on commit to follow. Signed-off-by: Jonathan Cameron Reviewed-by: Ben Widawsky Message-Id: <20220608130804.25795-1-Jonathan.Cameron@huawei.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/cxl/cxl-component-utils.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/cxl/cxl-component-utils.c b/hw/cxl/cxl-component-utils.c index 7985c9bfca..3edd303a33 100644 --- a/hw/cxl/cxl-component-utils.c +++ b/hw/cxl/cxl-component-utils.c @@ -154,7 +154,8 @@ static void ras_init_common(uint32_t *reg_state, uint32_t *write_msk) reg_state[R_CXL_RAS_ERR_CAP_CTRL] = 0x00; } -static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk) +static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk, + enum reg_type type) { int decoder_count = 1; int i; @@ -174,6 +175,14 @@ static void hdm_init_common(uint32_t *reg_state, uint32_t *write_msk) write_msk[R_CXL_HDM_DECODER0_SIZE_LO + i * 0x20] = 0xf0000000; write_msk[R_CXL_HDM_DECODER0_SIZE_HI + i * 0x20] = 0xffffffff; write_msk[R_CXL_HDM_DECODER0_CTRL + i * 0x20] = 0x13ff; + if (type == CXL2_DEVICE || + type == CXL2_TYPE3_DEVICE || + type == CXL2_LOGICAL_DEVICE) { + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] = 0xf0000000; + } else { + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_LO + i * 0x20] = 0xffffffff; + } + write_msk[R_CXL_HDM_DECODER0_TARGET_LIST_HI + i * 0x20] = 0xffffffff; } } @@ -239,7 +248,7 @@ void cxl_component_register_init_common(uint32_t *reg_state, uint32_t *write_msk } init_cap_reg(HDM, 5, 1); - hdm_init_common(reg_state, write_msk); + hdm_init_common(reg_state, write_msk, type); if (caps < 5) { return; From patchwork Fri Jun 10 07:59:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641752 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=guejeZ2G; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFFJ0Xfsz9s09 for ; Fri, 10 Jun 2022 18:56:34 +1000 (AEST) Received: from localhost ([::1]:41192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaRQ-0006oi-4P for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 04:56:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYF-0002EI-2F for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:45983) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYD-0006RN-G5 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847964; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vY1xzJIzfEFTPvZ1LeJ5oBkWj4oB2geqzTQvd5MgtyA=; b=guejeZ2GF+WJsYslNQimioUyyCGuxix0gTWxzfFs2S+qx++vdnBUFQk4Hcab0CFpG+dYSQ zDe4sW8ApF2qYfjHMUhiIVMa4e1DFilMJSVVF8Bdz3Y0exOzYuh5efxWMulmjspG4PvyRH +52iFeH9vPkZR9dp/Vu/LoUQJMi650I= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-389-kGOw-HiFO1uFQumqw9FeKw-1; Fri, 10 Jun 2022 03:59:23 -0400 X-MC-Unique: kGOw-HiFO1uFQumqw9FeKw-1 Received: by mail-wm1-f72.google.com with SMTP id bi22-20020a05600c3d9600b0039c4144992cso957868wmb.5 for ; Fri, 10 Jun 2022 00:59:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=vY1xzJIzfEFTPvZ1LeJ5oBkWj4oB2geqzTQvd5MgtyA=; b=ls5An+V+oIIM+Z1UeHNNET4CfcK3rQ6qg89Dl1ecUccUZ8uUxcAmL9OIs2GWivhhD1 DkfbStEI8CJ0Ar+rBq1JXy8zsE7Ljyp6IgAtJY1xrstPSeAAoAJAVTC47a8W2V52OlML eVi5yFTA1H7Lvj0BdzEeJsBy7BitaldD22D8bnZq+Oakg1x8roYvXmKsObfwtjZde0Nw 5fOBu+AqH+7S7sqZWjPo3NoXaPnlq4DtW+Trfk1ZackUyhpHqbJGAv1gHAIkGltuxRsq FVbW+V6H0Yoop4D0M8+jTReIcXH8YD/dKpdAcR8lNqor3D74vcTXPNOSJ8/bDVOrnmPw JjdQ== X-Gm-Message-State: AOAM530EzJ4/0C/lV5BDqxbHGz+cbRj26m4Ey31Z9XURrQsxUGGkoxor 4YmPusOgQdu2s0ViuSKk3qGZYE+xExzUpIFoJLwmB6zFDeBFibZD20IkDyfCnUPkTxyjlPr2ja1 If4Xz2Sy6BLsyNsK/FmzbgZRlJ2QVxWpk21px2St91suzoiNS9V3HoTXYbowP X-Received: by 2002:a5d:48c1:0:b0:20c:52e9:6c5b with SMTP id p1-20020a5d48c1000000b0020c52e96c5bmr41179798wrs.233.1654847962170; Fri, 10 Jun 2022 00:59:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyI+bfKtMfNYjPmrar1RUjQATmQM0dzOeCqUk4qqcyEVr4e66H9lzsAVL4NW+8qbaBditF4zA== X-Received: by 2002:a5d:48c1:0:b0:20c:52e9:6c5b with SMTP id p1-20020a5d48c1000000b0020c52e96c5bmr41179780wrs.233.1654847961928; Fri, 10 Jun 2022 00:59:21 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id c2-20020adffb42000000b00210326c4a90sm26901706wrs.49.2022.06.10.00.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:21 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:19 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Ani Sinha , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov Subject: [PULL 46/54] hw/acpi/viot: rename build_pci_range_node() to enumerate_pci_host_bridges() Message-ID: <20220610075631.367501-47-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This is in preparation for separating out the VIOT ACPI table build from the PCI host bridge numeration. Signed-off-by: Mark Cave-Ayland Reviewed-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-2-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/viot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/acpi/viot.c b/hw/acpi/viot.c index c1af75206e..a41daded71 100644 --- a/hw/acpi/viot.c +++ b/hw/acpi/viot.c @@ -17,7 +17,7 @@ struct viot_pci_ranges { }; /* Build PCI range for a given PCI host bridge */ -static int build_pci_range_node(Object *obj, void *opaque) +static int enumerate_pci_host_bridges(Object *obj, void *opaque) { struct viot_pci_ranges *pci_ranges = opaque; GArray *blob = pci_ranges->blob; @@ -78,7 +78,7 @@ void build_viot(MachineState *ms, GArray *table_data, BIOSLinker *linker, }; /* Build the list of PCI ranges that this viommu manages */ - object_child_foreach_recursive(OBJECT(ms), build_pci_range_node, + object_child_foreach_recursive(OBJECT(ms), enumerate_pci_host_bridges, &pci_ranges); /* ACPI table header */ From patchwork Fri Jun 10 07:59:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641770 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=bzn3Rpgq; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFRH6hQxz9s0r for ; Fri, 10 Jun 2022 19:05:14 +1000 (AEST) Received: from localhost ([::1]:49864 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaZr-0005qN-CE for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:05:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYI-0002Hn-52 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:28712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYG-0006Rh-Bc for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847967; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6LDOtJkS4XX2TuIYogbWgSBSiVmv/tgrANZtHtjvS2E=; b=bzn3RpgqjCBfZW0v/z5E3RYywU7mVkef8ErZgd58ekwgMBQJhskkeTs9yhjHj7RvXMGzoj IeBLoUIqB1HldKPxdyY2EDgC6gzu92okW3NtdGgxwGukxeJHapEXyKdT89To/dbBKEpi64 q/hKyOTHq+iJwOsrrmWv5EF+lMnUYBQ= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-130-wjZhrPE4P0yB7IZXLpXvRA-1; Fri, 10 Jun 2022 03:59:26 -0400 X-MC-Unique: wjZhrPE4P0yB7IZXLpXvRA-1 Received: by mail-wm1-f70.google.com with SMTP id c187-20020a1c35c4000000b003970013833aso9329946wma.1 for ; Fri, 10 Jun 2022 00:59:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=6LDOtJkS4XX2TuIYogbWgSBSiVmv/tgrANZtHtjvS2E=; b=Oid9ArJMkCdzPmujn+4Hc1nQE7+qnKDkBYbpKKA2AdgTOWFTNOufJWqTcVeggkgZXJ awqI/B+5ahCQq9zAZiMBKopi1pVfdypJ40JLx58We00UjYU7SRcDvQvq1u7Z5oDzNIXw rPhFsrLqQ8XaOhfVw+oGKwLozYhXzzPezpLbO4QrPADDdJ8RyjJfNk8+znqBi5gMQzC4 lbcJfclzJzTOsvJbkOpnLOP3nBQW4Q8gKPSARtx3iCsw9Bge6TdclqWrpuGx9LvIuUdd 2SfQAYpWJgN2pSPlVE1MXe0LgG72QQShcKgNo/vvycg5+jlHDJEO/5mNVMtbaQvJwAmC 8XzQ== X-Gm-Message-State: AOAM531NmgkqVpBZTCT4DFi0RUuqu5UOWes5B8mXcttzYbHxmA58cqul FXRUirS0NuuayYp9aeDiXJAFWOR8Bixyg62vo7IGrQLgKnt+bZqlRfYkI9vrSBj7YdOdZV6Cnvu LMcK8Z3OYRIc6Nvr+UWImlt97b0m1yMYf/dk83i7yyT3mS5WLFqIr7QFyTaYA X-Received: by 2002:a05:6000:18ae:b0:211:40df:c00e with SMTP id b14-20020a05600018ae00b0021140dfc00emr42749176wri.304.1654847965291; Fri, 10 Jun 2022 00:59:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuCDCo9sZUxu3g33+JpvuDQkcddWPUel6s+fT2JBLSd/0JpvYjYboDnRVbIUJc1u0D3C0fXA== X-Received: by 2002:a05:6000:18ae:b0:211:40df:c00e with SMTP id b14-20020a05600018ae00b0021140dfc00emr42749151wri.304.1654847965000; Fri, 10 Jun 2022 00:59:25 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id q18-20020a5d61d2000000b0020d0c9c95d3sm23591446wrv.77.2022.06.10.00.59.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:24 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:22 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Ani Sinha , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov Subject: [PULL 47/54] hw/acpi/viot: move the individual PCI host bridge entry generation to a new function Message-ID: <20220610075631.367501-48-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Instead of generating each table entry inline, move the individual PCI host bridge table entry generation to a separate build_pci_host_range() function. Signed-off-by: Mark Cave-Ayland Reviewed-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-3-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/viot.c | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/hw/acpi/viot.c b/hw/acpi/viot.c index a41daded71..5dafcbf5ef 100644 --- a/hw/acpi/viot.c +++ b/hw/acpi/viot.c @@ -16,6 +16,31 @@ struct viot_pci_ranges { uint16_t output_node; }; +static void build_pci_host_range(GArray *table_data, int min_bus, int max_bus, + uint16_t output_node) +{ + /* Type */ + build_append_int_noprefix(table_data, 1 /* PCI range */, 1); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 1); + /* Length */ + build_append_int_noprefix(table_data, 24, 2); + /* Endpoint start */ + build_append_int_noprefix(table_data, PCI_BUILD_BDF(min_bus, 0), 4); + /* PCI Segment start */ + build_append_int_noprefix(table_data, 0, 2); + /* PCI Segment end */ + build_append_int_noprefix(table_data, 0, 2); + /* PCI BDF start */ + build_append_int_noprefix(table_data, PCI_BUILD_BDF(min_bus, 0), 2); + /* PCI BDF end */ + build_append_int_noprefix(table_data, PCI_BUILD_BDF(max_bus, 0xff), 2); + /* Output node */ + build_append_int_noprefix(table_data, output_node, 2); + /* Reserved */ + build_append_int_noprefix(table_data, 0, 6); +} + /* Build PCI range for a given PCI host bridge */ static int enumerate_pci_host_bridges(Object *obj, void *opaque) { @@ -30,27 +55,8 @@ static int enumerate_pci_host_bridges(Object *obj, void *opaque) pci_bus_range(bus, &min_bus, &max_bus); - /* Type */ - build_append_int_noprefix(blob, 1 /* PCI range */, 1); - /* Reserved */ - build_append_int_noprefix(blob, 0, 1); - /* Length */ - build_append_int_noprefix(blob, 24, 2); - /* Endpoint start */ - build_append_int_noprefix(blob, PCI_BUILD_BDF(min_bus, 0), 4); - /* PCI Segment start */ - build_append_int_noprefix(blob, 0, 2); - /* PCI Segment end */ - build_append_int_noprefix(blob, 0, 2); - /* PCI BDF start */ - build_append_int_noprefix(blob, PCI_BUILD_BDF(min_bus, 0), 2); - /* PCI BDF end */ - build_append_int_noprefix(blob, PCI_BUILD_BDF(max_bus, 0xff), 2); - /* Output node */ - build_append_int_noprefix(blob, pci_ranges->output_node, 2); - /* Reserved */ - build_append_int_noprefix(blob, 0, 6); - + build_pci_host_range(blob, min_bus, max_bus, + pci_ranges->output_node); pci_ranges->count++; } } From patchwork Fri Jun 10 07:59:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641806 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=abdaw/dg; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFf56J9wz9s0r for ; Fri, 10 Jun 2022 19:14:36 +1000 (AEST) Received: from localhost ([::1]:58406 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaiv-0003WX-Ca for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:14:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYL-0002OW-Qy for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:46072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYJ-0006S4-Ag for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847970; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GChmIMU2dxex7tHilhwT7e7Y+3Ss6WE6zGsqe1kiQZM=; b=abdaw/dgBzMZBlvt+LZ4M3m0BYzPKo5ZmvyWw/sh0PBjs2RHQVy7/TETXyJKZmudLISrIV 2VUN2iKswMECF9COQ1shH0e6SlKjnrUxhpKBdWp/XCS6Y0SuibluxDXsJFdWDxzh/WjqI9 XDMYdRsOjcon0BWeMq4FiQoqf5wu7Xc= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-457-3qYDnNpEOSWyK4S456YUPA-1; Fri, 10 Jun 2022 03:59:29 -0400 X-MC-Unique: 3qYDnNpEOSWyK4S456YUPA-1 Received: by mail-wm1-f69.google.com with SMTP id o2-20020a05600c510200b0039747b0216fso967341wms.0 for ; Fri, 10 Jun 2022 00:59:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=GChmIMU2dxex7tHilhwT7e7Y+3Ss6WE6zGsqe1kiQZM=; b=EsZtdHhmfoK2gMUAlwVuy17Dax9ypNmp8CRSOwZmPq2lr5Cv1ybeVhJFtMsxtxinVo rH8G8rbCSmX67MCeTCX7g4+MTvZ0DaHDouE6W/8B8ccr1062XDeIbwleIb24L1EnECGv wO+2x+SGh82MyT3D8D1Qf4rwht/zkuBbJBOWP2va3hzR8xkCvaQoF1cfJFnDO2897znA PJXhebshv/HHSPKGo9ReYmAvllkucX+E9eGokLqH8qc8UD7w5D37EdYesZN6/43ST6yF pNoPbtblR0J9A4yHMCkOy5beZYE/b+4CXeXtaMY8SNpHyxjkG1wVYrdYXDMSVVZ+Onxp 1qHQ== X-Gm-Message-State: AOAM531GuMVvKYJh86ThkQkh4/Wb0u/6KKO2rN0XI4Qr23LNWtIBVV69 n9HmGX+NL2+w4YpoB8D3JUTB+LTgPK7BJrN2toSBQADWlwTvdjfqiIaVNEt0UzDMQvF4XGV8CuM S/DQy75Xqgyg5UtgcIQzDMpdUkHDMyqITdAvGDs/Ps2CHGUI2FcBTcVsj/HMD X-Received: by 2002:adf:dd8e:0:b0:213:bbe1:ba56 with SMTP id x14-20020adfdd8e000000b00213bbe1ba56mr36486990wrl.559.1654847968023; Fri, 10 Jun 2022 00:59:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAhw2+JCqMUFaz0BZk5Un+3JcZDOZUBKU7hAG8uO68RqLY0bx6DYUnAzfYOsQIeHjb+dYKtQ== X-Received: by 2002:adf:dd8e:0:b0:213:bbe1:ba56 with SMTP id x14-20020adfdd8e000000b00213bbe1ba56mr36486961wrl.559.1654847967718; Fri, 10 Jun 2022 00:59:27 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id k11-20020a05600c054b00b0039c7c4a542csm1740478wmc.47.2022.06.10.00.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:27 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:25 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Ani Sinha , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov Subject: [PULL 48/54] hw/acpi/viot: build array of PCI host bridges before generating VIOT ACPI table Message-ID: <20220610075631.367501-49-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Perform the generation of the VIOT ACPI table in 2 separate passes: the first pass enumerates all of the PCI host bridges and adds the min_bus and max_bus information to an array. Once this is done the VIOT table header is generated using the size of the array to calculate the node count, which means it is no longer necessary to use a sub-array to hold the PCI host bridge range information along with viommu_off. Finally the PCI host bridge array is iterated again to add the required entries to the final VIOT ACPI table. Signed-off-by: Mark Cave-Ayland Reviewed-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-4-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/viot.c | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/hw/acpi/viot.c b/hw/acpi/viot.c index 5dafcbf5ef..c32bbdd180 100644 --- a/hw/acpi/viot.c +++ b/hw/acpi/viot.c @@ -10,10 +10,9 @@ #include "hw/pci/pci.h" #include "hw/pci/pci_host.h" -struct viot_pci_ranges { - GArray *blob; - size_t count; - uint16_t output_node; +struct viot_pci_host_range { + int min_bus; + int max_bus; }; static void build_pci_host_range(GArray *table_data, int min_bus, int max_bus, @@ -44,8 +43,7 @@ static void build_pci_host_range(GArray *table_data, int min_bus, int max_bus, /* Build PCI range for a given PCI host bridge */ static int enumerate_pci_host_bridges(Object *obj, void *opaque) { - struct viot_pci_ranges *pci_ranges = opaque; - GArray *blob = pci_ranges->blob; + GArray *pci_host_ranges = opaque; if (object_dynamic_cast(obj, TYPE_PCI_HOST_BRIDGE)) { PCIBus *bus = PCI_HOST_BRIDGE(obj)->bus; @@ -55,9 +53,11 @@ static int enumerate_pci_host_bridges(Object *obj, void *opaque) pci_bus_range(bus, &min_bus, &max_bus); - build_pci_host_range(blob, min_bus, max_bus, - pci_ranges->output_node); - pci_ranges->count++; + const struct viot_pci_host_range pci_host_range = { + .min_bus = min_bus, + .max_bus = max_bus, + }; + g_array_append_val(pci_host_ranges, pci_host_range); } } @@ -78,19 +78,19 @@ void build_viot(MachineState *ms, GArray *table_data, BIOSLinker *linker, int viommu_off = 48; AcpiTable table = { .sig = "VIOT", .rev = 0, .oem_id = oem_id, .oem_table_id = oem_table_id }; - struct viot_pci_ranges pci_ranges = { - .output_node = viommu_off, - .blob = g_array_new(false, true /* clear */, 1), - }; + GArray *pci_host_ranges = g_array_new(false, true, + sizeof(struct viot_pci_host_range)); + struct viot_pci_host_range *pci_host_range; + int i; /* Build the list of PCI ranges that this viommu manages */ object_child_foreach_recursive(OBJECT(ms), enumerate_pci_host_bridges, - &pci_ranges); + pci_host_ranges); /* ACPI table header */ acpi_table_begin(&table, table_data); /* Node count */ - build_append_int_noprefix(table_data, pci_ranges.count + 1, 2); + build_append_int_noprefix(table_data, pci_host_ranges->len + 1, 2); /* Node offset */ build_append_int_noprefix(table_data, viommu_off, 2); /* Reserved */ @@ -111,9 +111,15 @@ void build_viot(MachineState *ms, GArray *table_data, BIOSLinker *linker, build_append_int_noprefix(table_data, 0, 8); /* PCI ranges found above */ - g_array_append_vals(table_data, pci_ranges.blob->data, - pci_ranges.blob->len); - g_array_free(pci_ranges.blob, true); + for (i = 0; i < pci_host_ranges->len; i++) { + pci_host_range = &g_array_index(pci_host_ranges, + struct viot_pci_host_range, i); + + build_pci_host_range(table_data, pci_host_range->min_bus, + pci_host_range->max_bus, viommu_off); + } + + g_array_free(pci_host_ranges, true); acpi_table_end(linker, &table); } From patchwork Fri Jun 10 07:59:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641808 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ZDyd4SEY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFfM2ynGz9s0r for ; Fri, 10 Jun 2022 19:14:51 +1000 (AEST) Received: from localhost ([::1]:58676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzaj7-0003kb-Jy for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:14:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYN-0002Re-LU for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:36252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYM-0006SZ-7N for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847973; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLoG+6d/H5CJ2YWH5V8iDYChaCq33BzGT2o7sdPVSIU=; b=ZDyd4SEYtjYI8/09hsz8Ks8lQoQa1fHN/IskWRPk3eqSbMj8MP5viUUl2vEFrRgmgANiME lSVfbFJxqvgUP7RB/Pgq06ZkD6zlhcnvf40BUrtxqB+xwvaaZbrwyFSPK/QhfI4XXAYwI/ VmkRQqRKgIglD+NwfgXhPkGuPsqokgY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-27-uDzHF7JbP9CrEuH736RsJw-1; Fri, 10 Jun 2022 03:59:32 -0400 X-MC-Unique: uDzHF7JbP9CrEuH736RsJw-1 Received: by mail-wm1-f72.google.com with SMTP id l3-20020a05600c1d0300b0039c7efa2526so82409wms.3 for ; Fri, 10 Jun 2022 00:59:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=YLoG+6d/H5CJ2YWH5V8iDYChaCq33BzGT2o7sdPVSIU=; b=68gcPflnHTjThQuoDUSPjbge1wakRqMv0HNpXHeukObgpxuSx/zLW8sVOAkYZrMg86 NDQ94y0DVdlPUUnsRXZYv8JjGBP8xUhE7oFcsuCLRsePY7a/M2ZwTqnP8HN3IhgkwzIJ ugIuaeMXy2zTrukqiaNUJZ+3et9+B0GhXD/GBofqx/jb0LM7L6sSWEO5XnHWaKgRjNmS JeFSkl0QOAnDFO4ncr/79fci5PI2ctiwYpQDiXQ0XIl6PWV846V0iQ0aUITNuVMbD1kD BfMreE6ZCmd0kMGaaghfQp9OCMut2wliQKU5JKXZKT9IfU21ebR7fG6QHOE1xfcGIPpS CI2A== X-Gm-Message-State: AOAM532m+gADervrdQSvmpUX74piDvgzDshtmFzV6Wb3vEpwSLhQih3i IoRVTM6MHhtLyutvje+eigBR6F+2mr6HYD1mLmb523RvkdDwowImaTAe1R55hsPIpJd/XLbqJ3G VP3MGxBX7LzUoQyDq7zurBVdjGBMa6r7g7BVNno0drcmJJ6Q7QsTpGRNjl02n X-Received: by 2002:adf:f688:0:b0:215:6e4d:4103 with SMTP id v8-20020adff688000000b002156e4d4103mr35229702wrp.372.1654847970799; Fri, 10 Jun 2022 00:59:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyuYMC98iTOvRIvNXbzXMt4tNh2QNDem+DeyWJH07pl7YgNcc4vyIjdXPEjgoA6lH0F+1RDQ== X-Received: by 2002:adf:f688:0:b0:215:6e4d:4103 with SMTP id v8-20020adff688000000b002156e4d4103mr35229679wrp.372.1654847970567; Fri, 10 Jun 2022 00:59:30 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id z11-20020a5d4c8b000000b0020e5b4ebaecsm26786458wrs.4.2022.06.10.00.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:30 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:27 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Ani Sinha , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov Subject: [PULL 49/54] tests/acpi: virt: allow VIOT acpi table changes Message-ID: <20220610075631.367501-50-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Signed-off-by: Mark Cave-Ayland Acked-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-5-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..8367ffe1d4 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,2 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/virt/VIOT", From patchwork Fri Jun 10 07:59:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641841 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=gJaZ3XtB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFwN1M9Mz9s0r for ; Fri, 10 Jun 2022 19:27:00 +1000 (AEST) Received: from localhost ([::1]:38900 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzauv-00021G-L9 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:26:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35970) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYQ-0002VA-A8 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:27198) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYO-0006Sl-PN for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847976; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Q+gvoPMx9QM9laYWT5x2L/E8Zn2RWI6teIf6Ya2cnjM=; b=gJaZ3XtBBzzwxvodxEvHDKUbtjz6BaOwqq+GQ3Arbhl08oWFjIPuE+54zyWDdwZi+uQSRa XPAaooXiWoZtXV58JXX8mERwH6wXTflTgS+lzlBT4bH/pkCiuWUyGCT+sQ/S+bsUxNbsFm sFMPjXy6o4Yvk72OpVxjO53ofx43htE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-385-2nfE6cpNNda53j7HJVdm0A-1; Fri, 10 Jun 2022 03:59:35 -0400 X-MC-Unique: 2nfE6cpNNda53j7HJVdm0A-1 Received: by mail-wr1-f71.google.com with SMTP id p8-20020a5d4588000000b0021033f1f79aso5968302wrq.5 for ; Fri, 10 Jun 2022 00:59:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=Q+gvoPMx9QM9laYWT5x2L/E8Zn2RWI6teIf6Ya2cnjM=; b=o3zEf/GItnIiPyaKQCFfUL09iOtOrumKqeP7hyLjuAE3orME6qQFiWA4aKFQP8SgNc EVFz6QwN0Q6TMEHX9jyiI5OKHUfoRCEn5XWj3n2raEvVYyiy/b0hFZKlE8VfuTCA9sey obiXY1CoO9MIPtWkf9Nu/GMYXKD8qRy7bg6WfmpaNVtuz8RqOBqr8sJzTt0d625my37p Mecpkpq9i+nqdciNMRnlkQ9nPRHxL4Tf3e+R3lNkOqdGmvromDqMSs8uLTXvNV/7EA2c bBlcW7Bwc4QCky/bpWo5OuLMWpyrikD4apGfDuQ8UpDY0AC3tgrbzGzLu8b3oUsY2cKU xpHA== X-Gm-Message-State: AOAM531RtB0roXf9GAqw/JhH4iG5Xu6wGmFJDGdvAJylWjdsiL1GmZKR 48Cz8L2YlGygFpkkVVQAobq2Bq0rMRJs5Iqt2bEvCKJh3fbMyGwwDmylkKKg8ShsWKyOkwUUhHT sR6euNe3YA1nVw3d2UgJGBh2RgB+qGAPPN7neUOyX7I6krpje9ksvmU9sSF4q X-Received: by 2002:adf:efc3:0:b0:210:3544:4223 with SMTP id i3-20020adfefc3000000b0021035444223mr41663591wrp.581.1654847973862; Fri, 10 Jun 2022 00:59:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx60Ha6ClHAgjcLEmmTJpMdObibGwMAZJifRdSwOUB58mXEAGfWP/SiqhjrjB2OFoZGwwtzAg== X-Received: by 2002:adf:efc3:0:b0:210:3544:4223 with SMTP id i3-20020adfefc3000000b0021035444223mr41663572wrp.581.1654847973625; Fri, 10 Jun 2022 00:59:33 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id h62-20020a1c2141000000b0039c151298b7sm2104191wmh.10.2022.06.10.00.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:33 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:30 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Ani Sinha , Philippe =?utf-8?q?Mathieu-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov Subject: [PULL 50/54] hw/acpi/viot: sort VIOT ACPI table entries by PCI host bridge min_bus Message-ID: <20220610075631.367501-51-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland This ensures that the VIOT ACPI table output is always stable for a given PCI topology by ensuring that entries are ordered according to min_bus. Signed-off-by: Mark Cave-Ayland Reviewed-by: Ani Sinha Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-6-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/viot.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hw/acpi/viot.c b/hw/acpi/viot.c index c32bbdd180..4e0bf69067 100644 --- a/hw/acpi/viot.c +++ b/hw/acpi/viot.c @@ -64,6 +64,20 @@ static int enumerate_pci_host_bridges(Object *obj, void *opaque) return 0; } +static gint pci_host_range_compare(gconstpointer a, gconstpointer b) +{ + struct viot_pci_host_range *range_a = (struct viot_pci_host_range *)a; + struct viot_pci_host_range *range_b = (struct viot_pci_host_range *)b; + + if (range_a->min_bus < range_b->min_bus) { + return -1; + } else if (range_a->min_bus > range_b->min_bus) { + return 1; + } else { + return 0; + } +} + /* * Generate a VIOT table with one PCI-based virtio-iommu that manages PCI * endpoints. @@ -87,6 +101,9 @@ void build_viot(MachineState *ms, GArray *table_data, BIOSLinker *linker, object_child_foreach_recursive(OBJECT(ms), enumerate_pci_host_bridges, pci_host_ranges); + /* Sort the pci host ranges by min_bus */ + g_array_sort(pci_host_ranges, pci_host_range_compare); + /* ACPI table header */ acpi_table_begin(&table, table_data); /* Node count */ From patchwork Fri Jun 10 07:59:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641842 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Of1oD4NO; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKFwg5flWz9s0r for ; Fri, 10 Jun 2022 19:27:15 +1000 (AEST) Received: from localhost ([::1]:39160 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzavB-0002C6-Mg for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:27:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYU-0002e1-Q2 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:42 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:56512) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYT-0006T8-5u for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847980; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=L61B+iVPlX7SkWGOWZhE2yVC/NfYKFF+RYS5CqMawVI=; b=Of1oD4NOgmsPsRZMAa4PWvW519HbjeJ9gJyBSihlp2kwaCuohVM6jLkaCZrfs/Wdo6Kn+7 jwrjgOvBubMXKQY7r3ee0ZR4+3BzZ9qg3trYOpLHImivXFRbm4V76UN8FILR94LmFY+BSM zGoRCg2S3oiHQ8ZHxSNINd+2RvFQAj4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-37-QT5SXQF-N4-eZLbO9ucqRQ-1; Fri, 10 Jun 2022 03:59:39 -0400 X-MC-Unique: QT5SXQF-N4-eZLbO9ucqRQ-1 Received: by mail-wm1-f71.google.com with SMTP id be12-20020a05600c1e8c00b0039c506b52a4so1223226wmb.1 for ; Fri, 10 Jun 2022 00:59:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=L61B+iVPlX7SkWGOWZhE2yVC/NfYKFF+RYS5CqMawVI=; b=sR1iAxI0XnpPzPFIFNukl7BJX307T+osTRUSOfGNVctZAHhn5FalcH2IBltsqVMj7E QoOknl7lW3QsXe2aeHZEjSYrojyuuX16XG/5aNujvEGq7AnUGTbyxfObBGtAMvNpwHr0 qCTpGvs4eYMrQSc5XM6UQoCTnl9Fz9131XAh/FIHuqvFm1rwCavkL3jdWOp8E+y2dFCj Xtg4PT33sUGZHe0AeDhYYKOK77K/tnphwFixvm7IL3/2S94ktfJDuATIn8Rlkjrf1/+W HCEWjqLNQkVANM2Tj84iQe2wEvsZT/Z+c31TNSGwJn2IopOo05euUIKsQra6+BxcMDXA P3JA== X-Gm-Message-State: AOAM532uyXPdzk7VeU5WYG8NpJgT9RPi/XAG6JlKp1XRhI6IWMGlIifr U14sqzfEIgkmbYRIkUcKePptnfDDwUaas6MpTx208lRBTmu+jZFGJ1L4uNu2GGu5aTd3yc3Ujls 8J6xpRUXyOaUEEpnLI/HM1Qzg4TK0L2FqkG7IvhvlO/8iMooTukD349W08d4i X-Received: by 2002:a05:6000:2c6:b0:216:7691:5395 with SMTP id o6-20020a05600002c600b0021676915395mr31449885wry.478.1654847977114; Fri, 10 Jun 2022 00:59:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu50PfiUC/XEW0ruQXfM1Kr6b1/0kakobD+tQpaz+sNptMOzi2n8OPxFii4wVM9tYe7rFXVw== X-Received: by 2002:a05:6000:2c6:b0:216:7691:5395 with SMTP id o6-20020a05600002c600b0021676915395mr31449857wry.478.1654847976795; Fri, 10 Jun 2022 00:59:36 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id d14-20020a5d6dce000000b0020c5253d927sm26884766wrz.115.2022.06.10.00.59.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:36 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Mark Cave-Ayland , Philippe =?utf-8?q?Mathie?= =?utf-8?q?u-Daud=C3=A9?= , Jean-Philippe Brucker , Igor Mammedov , Ani Sinha Subject: [PULL 51/54] tests/acpi: virt: update golden masters for VIOT Message-ID: <20220610075631.367501-52-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Mark Cave-Ayland Differences between disassembled ASL files for VIOT: +++ /tmp/asl-V69GM1.dsl 2022-05-18 10:22:27.239796759 +0100 @@ -36,11 +36,11 @@ [041h 0065 1] Reserved : 00 [042h 0066 2] Length : 0018 -[044h 0068 4] Endpoint start : 00003000 +[044h 0068 4] Endpoint start : 00001000 [048h 0072 2] PCI Segment start : 0000 [04Ah 0074 2] PCI Segment end : 0000 -[04Ch 0076 2] PCI BDF start : 3000 -[04Eh 0078 2] PCI BDF end : 30FF +[04Ch 0076 2] PCI BDF start : 1000 +[04Eh 0078 2] PCI BDF end : 10FF [050h 0080 2] Output node : 0030 [052h 0082 6] Reserved : 000000000000 @@ -48,11 +48,11 @@ [059h 0089 1] Reserved : 00 [05Ah 0090 2] Length : 0018 -[05Ch 0092 4] Endpoint start : 00001000 +[05Ch 0092 4] Endpoint start : 00003000 [060h 0096 2] PCI Segment start : 0000 [062h 0098 2] PCI Segment end : 0000 -[064h 0100 2] PCI BDF start : 1000 -[066h 0102 2] PCI BDF end : 10FF +[064h 0100 2] PCI BDF start : 3000 +[066h 0102 2] PCI BDF end : 30FF [068h 0104 2] Output node : 0030 [06Ah 0106 6] Reserved : 000000000000 @@ -62,6 +62,6 @@ 0010: 42 58 50 43 20 20 20 20 01 00 00 00 42 58 50 43 // BXPC ....BXPC 0020: 01 00 00 00 03 00 30 00 00 00 00 00 00 00 00 00 // ......0......... 0030: 03 00 10 00 00 00 10 00 00 00 00 00 00 00 00 00 // ................ - 0040: 01 00 18 00 00 30 00 00 00 00 00 00 00 30 FF 30 // .....0.......0.0 - 0050: 30 00 00 00 00 00 00 00 01 00 18 00 00 10 00 00 // 0............... - 0060: 00 00 00 00 00 10 FF 10 30 00 00 00 00 00 00 00 // ........0....... + 0040: 01 00 18 00 00 10 00 00 00 00 00 00 00 10 FF 10 // ................ + 0050: 30 00 00 00 00 00 00 00 01 00 18 00 00 30 00 00 // 0............0.. + 0060: 00 00 00 00 00 30 FF 30 30 00 00 00 00 00 00 00 // .....0.00....... Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20220525173232.31429-7-mark.cave-ayland@ilande.co.uk> Reviewed-by: Jean-Philippe Brucker Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- tests/qtest/bios-tables-test-allowed-diff.h | 1 - tests/data/acpi/q35/VIOT.viot | Bin 112 -> 112 bytes 2 files changed, 1 deletion(-) diff --git a/tests/data/acpi/q35/VIOT.viot b/tests/data/acpi/q35/VIOT.viot index 9b179266ccbf84f1c250ee646812d17e27987764..275c78fbe8e93190321d957c91c3f17551f865d4 100644 GIT binary patch delta 10 RcmXRYnBY1wR(PU=1OOI`1E2r^ delta 10 RcmXRYnBY1wR(PU=1OOI`1E2r^ diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index 8367ffe1d4..dfb8523c8b 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1,2 +1 @@ /* List of comma-separated changed AML files to ignore */ -"tests/data/acpi/virt/VIOT", From patchwork Fri Jun 10 07:59:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641847 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=TL6asR0q; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKG4T0VVyz9s0r for ; Fri, 10 Jun 2022 19:34:01 +1000 (AEST) Received: from localhost ([::1]:47546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzb1i-0008GW-SG for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:33:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYY-0002mu-Cj for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36267) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYW-0006TL-Pn for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847984; 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=LI5FhlwlFzEWmRAW1OAJAt8/dWVtDGrVDjAqYRS76zY=; b=TL6asR0qft+b8ir3uMUCPITHNwulec17Vz47mhDE3nhR5sY4xZLQ4oHWhFqxcuhl4/knvo A7k6/HujwYzRJN3HfdAK6WmG0kcIW7j+aYtE9PESbszS0hs3/+JkDzrjohqpOlzv+pYDOS ZptcAw601gyOFYzeW52xq3WQhh31JEs= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-222-EvAIc1fuNMy02TygPPYB5Q-1; Fri, 10 Jun 2022 03:59:41 -0400 X-MC-Unique: EvAIc1fuNMy02TygPPYB5Q-1 Received: by mail-wm1-f69.google.com with SMTP id k32-20020a05600c1ca000b0039c4cf75023so933976wms.9 for ; Fri, 10 Jun 2022 00:59:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=LI5FhlwlFzEWmRAW1OAJAt8/dWVtDGrVDjAqYRS76zY=; b=4RfTBBspvhdD+bLGSCsBARA4A+tHRpiOInIf/989XSl57i/aMRghjmUsCLC1POLKjv G/0t+OPNEWNUq7lYT1O7jN4Va061LkeUMWx967mtT39HOmy2uUGp22AN5em/MaWq6j/s XnX0Q0+Ja9SsvsEHETQGPYJkPBti1hKLRTTLoR6XG3p9jr8/wQjG2rc1x/f9UnT+3wXO S3j7R8rerPAgsIy2Kl1A4OEnKnQQPQHttoJuDrx0VvAV4Y9aA+Yu/ARNMAJXQtwMOzdO TiRpaI2GBFgxk3KbSbiiD+3UhbU1OzHGHCyajlzBZHcJR4FmM8O3ISFVrytDHfwenZwu zseQ== X-Gm-Message-State: AOAM531MVw0eXbSdZ9buy7f40tjyMjFr1LFeJloV2JBuz+Nz6iWFliox /TEnj2bHniPQftX/PMcGc9hmqb/28qUlwArsH8pZrVm+v7G9lQ/lEcGPc4jzbtmZ4zTrLQTrqL8 YksPsHHlx2ZkuOddPjsLPq1Iun1J8cP8taCBBOpuCafFUB4YUbwT4z3hXKPow X-Received: by 2002:a05:6000:178c:b0:218:5e44:e9a0 with SMTP id e12-20020a056000178c00b002185e44e9a0mr13344012wrg.76.1654847979641; Fri, 10 Jun 2022 00:59:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzsJ8jcoT+C0pM2whud7u1QR3FLebThaW0MTENeRG/jHXLGU5Wvh5XovcgOrf2zjLQ++jB+g== X-Received: by 2002:a05:6000:178c:b0:218:5e44:e9a0 with SMTP id e12-20020a056000178c00b002185e44e9a0mr13343987wrg.76.1654847979398; Fri, 10 Jun 2022 00:59:39 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id 4-20020a05600c028400b0039c45fc58c4sm1996972wmk.21.2022.06.10.00.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:39 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:37 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Changpeng Liu Subject: [PULL 52/54] hw/virtio/vhost-user: don't use uninitialized variable Message-ID: <20220610075631.367501-53-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.133.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Changpeng Liu Variable `vdev` in `struct vhost_dev` will not be ready until start the device, so let's not use it for the error output here. Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu Message-Id: <20220525125540.50979-1-changpeng.liu@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu Fixes: 5653493 ("hw/virtio/vhost-user: don't suppress F_CONFIG when supported") Signed-off-by: Changpeng Liu --- hw/virtio/vhost-user.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c index b040c1ad2b..0594178224 100644 --- a/hw/virtio/vhost-user.c +++ b/hw/virtio/vhost-user.c @@ -2031,18 +2031,16 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque, if (supports_f_config) { if (!virtio_has_feature(protocol_features, VHOST_USER_PROTOCOL_F_CONFIG)) { - error_setg(errp, "vhost-user device %s expecting " + error_setg(errp, "vhost-user device expecting " "VHOST_USER_PROTOCOL_F_CONFIG but the vhost-user backend does " - "not support it.", dev->vdev->name); + "not support it."); return -EPROTO; } } else { if (virtio_has_feature(protocol_features, VHOST_USER_PROTOCOL_F_CONFIG)) { warn_reportf_err(*errp, "vhost-user backend supports " - "VHOST_USER_PROTOCOL_F_CONFIG for " - "device %s but QEMU does not.", - dev->vdev->name); + "VHOST_USER_PROTOCOL_F_CONFIG but QEMU does not."); protocol_features &= ~(1ULL << VHOST_USER_PROTOCOL_F_CONFIG); } } From patchwork Fri Jun 10 07:59:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641848 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Wc6MuxFY; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKG511vxKz9s0r for ; Fri, 10 Jun 2022 19:34:29 +1000 (AEST) Received: from localhost ([::1]:47798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzb2B-0008RT-24 for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:34:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36042) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYb-0002tp-IA for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:53708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYY-0006Te-VE for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847986; 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=vNpi+lv9eUeu1Vt5Hknt5gq0K5cS6eTghz588WqWk28=; b=Wc6MuxFY66BX4Vu3FELj/pV0940INbkQ2a3ua7qSXj8EcRvv5vxy9ckzcPLjGMwD3yDVJZ EqZiXOtW5AWzWMsv91Sk8pngpkWUYaOSDx0BkJ+/8GNit/TnYimvyAHeSKIrzJHzqlTe/R eqwQLfRUXT6hd+toRiainET9uhfl/S8= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-59--C4eB1a2NiemjdzdB029TA-1; Fri, 10 Jun 2022 03:59:45 -0400 X-MC-Unique: -C4eB1a2NiemjdzdB029TA-1 Received: by mail-wm1-f71.google.com with SMTP id l4-20020a05600c1d0400b0039c60535405so3370454wms.6 for ; Fri, 10 Jun 2022 00:59:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=vNpi+lv9eUeu1Vt5Hknt5gq0K5cS6eTghz588WqWk28=; b=lF28bypkTHaDtTjb4Wl8CEzX5F5/OlIBC+221m+BUF92MZ/37yyYvPd2m5sEJjx0Q1 oXTfxFKvRZDehfYb6lmVbOK+lhjZlGWm04BPJKZRFRsq6yPyp1s04PVjVCfhD8Bl1627 +gdyX3KnmrLaGNTXkyJMt8ldiCOW1wdOygaDIn+dpJUYRgZr6d0Hz3tg3K0+rRdFNL9F eV9dmGYCyHUy4SEXJUGuLl7QyL/S5Un2kPzyhLdTrxez4jSYNw4or/sPkHTGXKTngrZQ 3sLgOOtioSKjQS1PkEvwK6FkMIHyiY2kEJ1fU0eyUHi9nMzqz5J5WZb7nX8hmYYdK9k9 lwLg== X-Gm-Message-State: AOAM532WVZ8o7qNnhB48Au+uQEWedM82nuS2WhpIprxCQxm9fkr8H/bz IV5IDafxaGUb0DvMa93Os85sCGVjzfduCT+IM8vXavry1UxeKfBset+rDnmQece3xUMsUqnjUmp UE0aCm5RKSKD2MSLRZwxvs6URSEtTNXlnddq2KYzamlrV9fTWiWatg6YrOvra X-Received: by 2002:a5d:6091:0:b0:210:3e16:c600 with SMTP id w17-20020a5d6091000000b002103e16c600mr41220609wrt.456.1654847982696; Fri, 10 Jun 2022 00:59:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRKVNJvAlea7XLwfLaJrLdAZG3ZxaT9XSHywd7uUyex/CiZhk2XehQ8wVCcjpiqu4GZVGXYg== X-Received: by 2002:a5d:6091:0:b0:210:3e16:c600 with SMTP id w17-20020a5d6091000000b002103e16c600mr41220578wrt.456.1654847982395; Fri, 10 Jun 2022 00:59:42 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id f6-20020a05600c4e8600b0039c6ce32a2dsm2153858wmq.33.2022.06.10.00.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:42 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:39 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Changpeng Liu , Raphael Norwitz , Kevin Wolf , Hanna Reitz , Paolo Bonzini , Fam Zheng , qemu-block@nongnu.org Subject: [PULL 53/54] hw/vhost-user-scsi|blk: set `supports_config` flag correctly Message-ID: <20220610075631.367501-54-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Changpeng Liu Currently vhost-user-scsi driver doesn't allow to change the configuration space of virtio_scsi, while vhost-user-blk support that, so here we set the flag in vhost-user-blk driver and unset it in vhost-user-scsi. Signed-off-by: Changpeng Liu Message-Id: <20220525125540.50979-2-changpeng.liu@intel.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin Signed-off-by: Changpeng Liu Signed-off-by: Changpeng Liu --- hw/block/vhost-user-blk.c | 1 + hw/scsi/vhost-user-scsi.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c index 5dca4eab09..9117222456 100644 --- a/hw/block/vhost-user-blk.c +++ b/hw/block/vhost-user-blk.c @@ -337,6 +337,7 @@ static int vhost_user_blk_connect(DeviceState *dev, Error **errp) vhost_dev_set_config_notifier(&s->dev, &blk_ops); + s->vhost_user.supports_config = true; ret = vhost_dev_init(&s->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER, 0, errp); if (ret < 0) { diff --git a/hw/scsi/vhost-user-scsi.c b/hw/scsi/vhost-user-scsi.c index 9be21d07ee..1b2f7eed98 100644 --- a/hw/scsi/vhost-user-scsi.c +++ b/hw/scsi/vhost-user-scsi.c @@ -121,7 +121,6 @@ static void vhost_user_scsi_realize(DeviceState *dev, Error **errp) vsc->dev.backend_features = 0; vqs = vsc->dev.vqs; - s->vhost_user.supports_config = true; ret = vhost_dev_init(&vsc->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER, 0, errp); if (ret < 0) { From patchwork Fri Jun 10 07:59:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1641851 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=RROBAojN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) 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 bilbo.ozlabs.org (Postfix) with ESMTPS id 4LKGLp30Snz9s0r for ; Fri, 10 Jun 2022 19:46:25 +1000 (AEST) Received: from localhost ([::1]:56280 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzbDf-0006KL-UZ for incoming@patchwork.ozlabs.org; Fri, 10 Jun 2022 05:46:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36056) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYg-00031m-0l for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:55842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzZYc-0006UB-34 for qemu-devel@nongnu.org; Fri, 10 Jun 2022 03:59:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654847989; 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=BU33mUC65L9h6uqebkTEG7AsKifgQOEbQZZlVOOT8mQ=; b=RROBAojNvjMc90a9g8bZOK6kOQSUQRVmL7wYD1bmZ2sR6oeARlDTp0R74qw/M8DQcCw5Ru K6msAj9fBsGuWap4Q/tN7uUEg6W6xWJpnTawxnPZFKobi87AMeW5z8qnuIzWpFvAxzEgc4 6b6ZuhrxCLmg/YfhNSoP/mj6TAfP45o= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-xTuJxfFOOeeSMConsAKbdg-1; Fri, 10 Jun 2022 03:59:48 -0400 X-MC-Unique: xTuJxfFOOeeSMConsAKbdg-1 Received: by mail-wr1-f69.google.com with SMTP id e9-20020a5d5949000000b00216ffb6df18so4194352wri.14 for ; Fri, 10 Jun 2022 00:59:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BU33mUC65L9h6uqebkTEG7AsKifgQOEbQZZlVOOT8mQ=; b=Tuyi82ZnXFnRdks8gj5qAgC8q7z7kZGVSzjaXkvFfpAux192d2fgL4TOvgeDkA4GMB d5z4fCz6YQvlEEH3SKsPlKvpJVHs2aFI/IxD9j6bbcK/aXGR7aYIcoe/rqaT6haBoTgc QISv4MbVylt9X+DX/xmmWWXTYGPmR5LZYPkbIRZXXyO9xMkXihhLFl59C8KsmbHetLbk R0+aC+ULgsG232WqFoBtyolD+Osy3+KYFW7Raa0YlkcB2QH4tQQ/dTYhcJuEOVZ0+kfa d9Hig2f2V2nabZR0lsEq03+SwNGZw0ykeyk/157Zl7wp/icwCY7jYH9BBy9oKcpODmeh Iz7A== X-Gm-Message-State: AOAM533F2zHZtWIxftkXDjmv85Xgy4YNW4J9Y2Ku51k9ftSD1lOfOpmw Q6oB0tqAFb46pXsjD9OcVNFqaiP74oXnXnYjt+1iMNyH4R7K9TQKJ9T5WH2pXf0YWnTU5hzbyXc ctP1KoOeyn3/KKMS4K86jUORKYS4GecRbvIV6LrpajIiqgZMj7ExrNafzbYBF X-Received: by 2002:a05:6000:1841:b0:218:be20:a1b7 with SMTP id c1-20020a056000184100b00218be20a1b7mr11389638wri.390.1654847986254; Fri, 10 Jun 2022 00:59:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1GKZin1W2RqasFpnjO0mmbfaPAuJdv6kRthPfPrJCxYARyUOv2CRh2L8HQrvRQAyvxUHKVw== X-Received: by 2002:a05:6000:1841:b0:218:be20:a1b7 with SMTP id c1-20020a056000184100b00218be20a1b7mr11389586wri.390.1654847985495; Fri, 10 Jun 2022 00:59:45 -0700 (PDT) Received: from redhat.com ([212.116.178.142]) by smtp.gmail.com with ESMTPSA id b12-20020a5d4b8c000000b0020feb9c44c2sm26693020wrt.20.2022.06.10.00.59.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 00:59:45 -0700 (PDT) Date: Fri, 10 Jun 2022 03:59:42 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , zhenwei pi , Gonglei Subject: [PULL 54/54] crypto: Introduce RSA algorithm Message-ID: <20220610075631.367501-55-mst@redhat.com> References: <20220610075631.367501-1-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220610075631.367501-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: zhenwei pi There are two parts in this patch: 1, support akcipher service by cryptodev-builtin driver 2, virtio-crypto driver supports akcipher service In principle, we should separate this into two patches, to avoid compiling error, merge them into one. Then virtio-crypto gets request from guest side, and forwards the request to builtin driver to handle it. Test with a guest linux: 1, The self-test framework of crypto layer works fine in guest kernel 2, Test with Linux guest(with asym support), the following script test(note that pkey_XXX is supported only in a newer version of keyutils): - both public key & private key - create/close session - encrypt/decrypt/sign/verify basic driver operation - also test with kernel crypto layer(pkey add/query) All the cases work fine. Run script in guest: rm -rf *.der *.pem *.pfx modprobe pkcs8_key_parser # if CONFIG_PKCS8_PRIVATE_KEY_PARSER=m rm -rf /tmp/data dd if=/dev/random of=/tmp/data count=1 bs=20 openssl req -nodes -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -subj "/C=CN/ST=BJ/L=HD/O=qemu/OU=dev/CN=qemu/emailAddress=qemu@qemu.org" openssl pkcs8 -in key.pem -topk8 -nocrypt -outform DER -out key.der openssl x509 -in cert.pem -inform PEM -outform DER -out cert.der PRIV_KEY_ID=`cat key.der | keyctl padd asymmetric test_priv_key @s` echo "priv key id = "$PRIV_KEY_ID PUB_KEY_ID=`cat cert.der | keyctl padd asymmetric test_pub_key @s` echo "pub key id = "$PUB_KEY_ID keyctl pkey_query $PRIV_KEY_ID 0 keyctl pkey_query $PUB_KEY_ID 0 echo "Enc with priv key..." keyctl pkey_encrypt $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.priv echo "Dec with pub key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.priv enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Sign with priv key..." keyctl pkey_sign $PRIV_KEY_ID 0 /tmp/data enc=pkcs1 hash=sha1 > /tmp/sig echo "Verify with pub key..." keyctl pkey_verify $PRIV_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 echo "Enc with pub key..." keyctl pkey_encrypt $PUB_KEY_ID 0 /tmp/data enc=pkcs1 >/tmp/enc.pub echo "Dec with priv key..." keyctl pkey_decrypt $PRIV_KEY_ID 0 /tmp/enc.pub enc=pkcs1 >/tmp/dec cmp /tmp/data /tmp/dec echo "Verify with pub key..." keyctl pkey_verify $PUB_KEY_ID 0 /tmp/data /tmp/sig enc=pkcs1 hash=sha1 Signed-off-by: zhenwei pi Signed-off-by: lei he Reviewed-by: Gonglei Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/virtio/virtio-crypto.h | 5 +- include/sysemu/cryptodev.h | 83 ++++++-- backends/cryptodev-builtin.c | 274 +++++++++++++++++++++---- backends/cryptodev-vhost-user.c | 34 +++- backends/cryptodev.c | 32 ++- hw/virtio/virtio-crypto.c | 319 ++++++++++++++++++++++++------ 6 files changed, 605 insertions(+), 142 deletions(-) diff --git a/include/hw/virtio/virtio-crypto.h b/include/hw/virtio/virtio-crypto.h index a2228d7b2e..348749f5d5 100644 --- a/include/hw/virtio/virtio-crypto.h +++ b/include/hw/virtio/virtio-crypto.h @@ -50,6 +50,7 @@ typedef struct VirtIOCryptoConf { uint32_t mac_algo_l; uint32_t mac_algo_h; uint32_t aead_algo; + uint32_t akcipher_algo; /* Maximum length of cipher key */ uint32_t max_cipher_key_len; @@ -71,9 +72,7 @@ typedef struct VirtIOCryptoReq { size_t in_len; VirtQueue *vq; struct VirtIOCrypto *vcrypto; - union { - CryptoDevBackendSymOpInfo *sym_op_info; - } u; + CryptoDevBackendOpInfo op_info; } VirtIOCryptoReq; typedef struct VirtIOCryptoQueue { diff --git a/include/sysemu/cryptodev.h b/include/sysemu/cryptodev.h index f4d4057d4d..37c3a360fd 100644 --- a/include/sysemu/cryptodev.h +++ b/include/sysemu/cryptodev.h @@ -50,13 +50,13 @@ typedef struct CryptoDevBackendClient enum CryptoDevBackendAlgType { CRYPTODEV_BACKEND_ALG_SYM, + CRYPTODEV_BACKEND_ALG_ASYM, CRYPTODEV_BACKEND_ALG__MAX, }; /** * CryptoDevBackendSymSessionInfo: * - * @op_code: operation code (refer to virtio_crypto.h) * @cipher_alg: algorithm type of CIPHER * @key_len: byte length of cipher key * @hash_alg: algorithm type of HASH/MAC @@ -74,7 +74,6 @@ enum CryptoDevBackendAlgType { */ typedef struct CryptoDevBackendSymSessionInfo { /* corresponding with virtio crypto spec */ - uint32_t op_code; uint32_t cipher_alg; uint32_t key_len; uint32_t hash_alg; @@ -89,11 +88,36 @@ typedef struct CryptoDevBackendSymSessionInfo { uint8_t *auth_key; } CryptoDevBackendSymSessionInfo; +/** + * CryptoDevBackendAsymSessionInfo: + */ +typedef struct CryptoDevBackendRsaPara { + uint32_t padding_algo; + uint32_t hash_algo; +} CryptoDevBackendRsaPara; + +typedef struct CryptoDevBackendAsymSessionInfo { + /* corresponding with virtio crypto spec */ + uint32_t algo; + uint32_t keytype; + uint32_t keylen; + uint8_t *key; + union { + CryptoDevBackendRsaPara rsa; + } u; +} CryptoDevBackendAsymSessionInfo; + +typedef struct CryptoDevBackendSessionInfo { + uint32_t op_code; + union { + CryptoDevBackendSymSessionInfo sym_sess_info; + CryptoDevBackendAsymSessionInfo asym_sess_info; + } u; +} CryptoDevBackendSessionInfo; + /** * CryptoDevBackendSymOpInfo: * - * @session_id: session index which was previously - * created by cryptodev_backend_sym_create_session() * @aad_len: byte length of additional authenticated data * @iv_len: byte length of initialization vector or counter * @src_len: byte length of source data @@ -119,7 +143,6 @@ typedef struct CryptoDevBackendSymSessionInfo { * */ typedef struct CryptoDevBackendSymOpInfo { - uint64_t session_id; uint32_t aad_len; uint32_t iv_len; uint32_t src_len; @@ -138,6 +161,33 @@ typedef struct CryptoDevBackendSymOpInfo { uint8_t data[]; } CryptoDevBackendSymOpInfo; + +/** + * CryptoDevBackendAsymOpInfo: + * + * @src_len: byte length of source data + * @dst_len: byte length of destination data + * @src: point to the source data + * @dst: point to the destination data + * + */ +typedef struct CryptoDevBackendAsymOpInfo { + uint32_t src_len; + uint32_t dst_len; + uint8_t *src; + uint8_t *dst; +} CryptoDevBackendAsymOpInfo; + +typedef struct CryptoDevBackendOpInfo { + enum CryptoDevBackendAlgType algtype; + uint32_t op_code; + uint64_t session_id; + union { + CryptoDevBackendSymOpInfo *sym_op_info; + CryptoDevBackendAsymOpInfo *asym_op_info; + } u; +} CryptoDevBackendOpInfo; + struct CryptoDevBackendClass { ObjectClass parent_class; @@ -145,13 +195,13 @@ struct CryptoDevBackendClass { void (*cleanup)(CryptoDevBackend *backend, Error **errp); int64_t (*create_session)(CryptoDevBackend *backend, - CryptoDevBackendSymSessionInfo *sess_info, + CryptoDevBackendSessionInfo *sess_info, uint32_t queue_index, Error **errp); int (*close_session)(CryptoDevBackend *backend, uint64_t session_id, uint32_t queue_index, Error **errp); - int (*do_sym_op)(CryptoDevBackend *backend, - CryptoDevBackendSymOpInfo *op_info, + int (*do_op)(CryptoDevBackend *backend, + CryptoDevBackendOpInfo *op_info, uint32_t queue_index, Error **errp); }; @@ -190,6 +240,7 @@ struct CryptoDevBackendConf { uint32_t mac_algo_l; uint32_t mac_algo_h; uint32_t aead_algo; + uint32_t akcipher_algo; /* Maximum length of cipher key */ uint32_t max_cipher_key_len; /* Maximum length of authenticated key */ @@ -247,34 +298,34 @@ void cryptodev_backend_cleanup( Error **errp); /** - * cryptodev_backend_sym_create_session: + * cryptodev_backend_create_session: * @backend: the cryptodev backend object * @sess_info: parameters needed by session creating * @queue_index: queue index of cryptodev backend client * @errp: pointer to a NULL-initialized error object * - * Create a session for symmetric algorithms + * Create a session for symmetric/symmetric algorithms * * Returns: session id on success, or -1 on error */ -int64_t cryptodev_backend_sym_create_session( +int64_t cryptodev_backend_create_session( CryptoDevBackend *backend, - CryptoDevBackendSymSessionInfo *sess_info, + CryptoDevBackendSessionInfo *sess_info, uint32_t queue_index, Error **errp); /** - * cryptodev_backend_sym_close_session: + * cryptodev_backend_close_session: * @backend: the cryptodev backend object * @session_id: the session id * @queue_index: queue index of cryptodev backend client * @errp: pointer to a NULL-initialized error object * - * Close a session for symmetric algorithms which was previously - * created by cryptodev_backend_sym_create_session() + * Close a session for which was previously + * created by cryptodev_backend_create_session() * * Returns: 0 on success, or Negative on error */ -int cryptodev_backend_sym_close_session( +int cryptodev_backend_close_session( CryptoDevBackend *backend, uint64_t session_id, uint32_t queue_index, Error **errp); diff --git a/backends/cryptodev-builtin.c b/backends/cryptodev-builtin.c index 0671bf9f3e..495dbd47d7 100644 --- a/backends/cryptodev-builtin.c +++ b/backends/cryptodev-builtin.c @@ -26,6 +26,7 @@ #include "qapi/error.h" #include "standard-headers/linux/virtio_crypto.h" #include "crypto/cipher.h" +#include "crypto/akcipher.h" #include "qom/object.h" @@ -42,10 +43,11 @@ typedef struct CryptoDevBackendBuiltinSession { QCryptoCipher *cipher; uint8_t direction; /* encryption or decryption */ uint8_t type; /* cipher? hash? aead? */ + QCryptoAkCipher *akcipher; QTAILQ_ENTRY(CryptoDevBackendBuiltinSession) next; } CryptoDevBackendBuiltinSession; -/* Max number of symmetric sessions */ +/* Max number of symmetric/asymmetric sessions */ #define MAX_NUM_SESSIONS 256 #define CRYPTODEV_BUITLIN_MAX_AUTH_KEY_LEN 512 @@ -80,15 +82,17 @@ static void cryptodev_builtin_init( backend->conf.crypto_services = 1u << VIRTIO_CRYPTO_SERVICE_CIPHER | 1u << VIRTIO_CRYPTO_SERVICE_HASH | - 1u << VIRTIO_CRYPTO_SERVICE_MAC; + 1u << VIRTIO_CRYPTO_SERVICE_MAC | + 1u << VIRTIO_CRYPTO_SERVICE_AKCIPHER; backend->conf.cipher_algo_l = 1u << VIRTIO_CRYPTO_CIPHER_AES_CBC; backend->conf.hash_algo = 1u << VIRTIO_CRYPTO_HASH_SHA1; + backend->conf.akcipher_algo = 1u << VIRTIO_CRYPTO_AKCIPHER_RSA; /* * Set the Maximum length of crypto request. * Why this value? Just avoid to overflow when * memory allocation for each crypto request. */ - backend->conf.max_size = LONG_MAX - sizeof(CryptoDevBackendSymOpInfo); + backend->conf.max_size = LONG_MAX - sizeof(CryptoDevBackendOpInfo); backend->conf.max_cipher_key_len = CRYPTODEV_BUITLIN_MAX_CIPHER_KEY_LEN; backend->conf.max_auth_key_len = CRYPTODEV_BUITLIN_MAX_AUTH_KEY_LEN; @@ -148,6 +152,53 @@ err: return -1; } +static int cryptodev_builtin_get_rsa_hash_algo( + int virtio_rsa_hash, Error **errp) +{ + switch (virtio_rsa_hash) { + case VIRTIO_CRYPTO_RSA_MD5: + return QCRYPTO_HASH_ALG_MD5; + + case VIRTIO_CRYPTO_RSA_SHA1: + return QCRYPTO_HASH_ALG_SHA1; + + case VIRTIO_CRYPTO_RSA_SHA256: + return QCRYPTO_HASH_ALG_SHA256; + + case VIRTIO_CRYPTO_RSA_SHA512: + return QCRYPTO_HASH_ALG_SHA512; + + default: + error_setg(errp, "Unsupported rsa hash algo: %d", virtio_rsa_hash); + return -1; + } +} + +static int cryptodev_builtin_set_rsa_options( + int virtio_padding_algo, + int virtio_hash_algo, + QCryptoAkCipherOptionsRSA *opt, + Error **errp) +{ + if (virtio_padding_algo == VIRTIO_CRYPTO_RSA_PKCS1_PADDING) { + opt->padding_alg = QCRYPTO_RSA_PADDING_ALG_PKCS1; + opt->hash_alg = + cryptodev_builtin_get_rsa_hash_algo(virtio_hash_algo, errp); + if (opt->hash_alg < 0) { + return -1; + } + return 0; + } + + if (virtio_padding_algo == VIRTIO_CRYPTO_RSA_RAW_PADDING) { + opt->padding_alg = QCRYPTO_RSA_PADDING_ALG_RAW; + return 0; + } + + error_setg(errp, "Unsupported rsa padding algo: %d", virtio_padding_algo); + return -1; +} + static int cryptodev_builtin_create_cipher_session( CryptoDevBackendBuiltin *builtin, CryptoDevBackendSymSessionInfo *sess_info, @@ -240,26 +291,89 @@ static int cryptodev_builtin_create_cipher_session( return index; } -static int64_t cryptodev_builtin_sym_create_session( +static int cryptodev_builtin_create_akcipher_session( + CryptoDevBackendBuiltin *builtin, + CryptoDevBackendAsymSessionInfo *sess_info, + Error **errp) +{ + CryptoDevBackendBuiltinSession *sess; + QCryptoAkCipher *akcipher; + int index; + QCryptoAkCipherKeyType type; + QCryptoAkCipherOptions opts; + + switch (sess_info->algo) { + case VIRTIO_CRYPTO_AKCIPHER_RSA: + opts.alg = QCRYPTO_AKCIPHER_ALG_RSA; + if (cryptodev_builtin_set_rsa_options(sess_info->u.rsa.padding_algo, + sess_info->u.rsa.hash_algo, &opts.u.rsa, errp) != 0) { + return -1; + } + break; + + /* TODO support DSA&ECDSA until qemu crypto framework support these */ + + default: + error_setg(errp, "Unsupported akcipher alg %u", sess_info->algo); + return -1; + } + + switch (sess_info->keytype) { + case VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PUBLIC: + type = QCRYPTO_AKCIPHER_KEY_TYPE_PUBLIC; + break; + + case VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PRIVATE: + type = QCRYPTO_AKCIPHER_KEY_TYPE_PRIVATE; + break; + + default: + error_setg(errp, "Unsupported akcipher keytype %u", sess_info->keytype); + return -1; + } + + index = cryptodev_builtin_get_unused_session_index(builtin); + if (index < 0) { + error_setg(errp, "Total number of sessions created exceeds %u", + MAX_NUM_SESSIONS); + return -1; + } + + akcipher = qcrypto_akcipher_new(&opts, type, sess_info->key, + sess_info->keylen, errp); + if (!akcipher) { + return -1; + } + + sess = g_new0(CryptoDevBackendBuiltinSession, 1); + sess->akcipher = akcipher; + + builtin->sessions[index] = sess; + + return index; +} + +static int64_t cryptodev_builtin_create_session( CryptoDevBackend *backend, - CryptoDevBackendSymSessionInfo *sess_info, + CryptoDevBackendSessionInfo *sess_info, uint32_t queue_index, Error **errp) { CryptoDevBackendBuiltin *builtin = CRYPTODEV_BACKEND_BUILTIN(backend); - int64_t session_id = -1; - int ret; + CryptoDevBackendSymSessionInfo *sym_sess_info; + CryptoDevBackendAsymSessionInfo *asym_sess_info; switch (sess_info->op_code) { case VIRTIO_CRYPTO_CIPHER_CREATE_SESSION: - ret = cryptodev_builtin_create_cipher_session( - builtin, sess_info, errp); - if (ret < 0) { - return ret; - } else { - session_id = ret; - } - break; + sym_sess_info = &sess_info->u.sym_sess_info; + return cryptodev_builtin_create_cipher_session( + builtin, sym_sess_info, errp); + + case VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION: + asym_sess_info = &sess_info->u.asym_sess_info; + return cryptodev_builtin_create_akcipher_session( + builtin, asym_sess_info, errp); + case VIRTIO_CRYPTO_HASH_CREATE_SESSION: case VIRTIO_CRYPTO_MAC_CREATE_SESSION: default: @@ -268,50 +382,44 @@ static int64_t cryptodev_builtin_sym_create_session( return -1; } - return session_id; + return -1; } -static int cryptodev_builtin_sym_close_session( +static int cryptodev_builtin_close_session( CryptoDevBackend *backend, uint64_t session_id, uint32_t queue_index, Error **errp) { CryptoDevBackendBuiltin *builtin = CRYPTODEV_BACKEND_BUILTIN(backend); + CryptoDevBackendBuiltinSession *session; assert(session_id < MAX_NUM_SESSIONS && builtin->sessions[session_id]); - qcrypto_cipher_free(builtin->sessions[session_id]->cipher); - g_free(builtin->sessions[session_id]); + session = builtin->sessions[session_id]; + if (session->cipher) { + qcrypto_cipher_free(session->cipher); + } else if (session->akcipher) { + qcrypto_akcipher_free(session->akcipher); + } + + g_free(session); builtin->sessions[session_id] = NULL; return 0; } static int cryptodev_builtin_sym_operation( - CryptoDevBackend *backend, - CryptoDevBackendSymOpInfo *op_info, - uint32_t queue_index, Error **errp) + CryptoDevBackendBuiltinSession *sess, + CryptoDevBackendSymOpInfo *op_info, Error **errp) { - CryptoDevBackendBuiltin *builtin = - CRYPTODEV_BACKEND_BUILTIN(backend); - CryptoDevBackendBuiltinSession *sess; int ret; - if (op_info->session_id >= MAX_NUM_SESSIONS || - builtin->sessions[op_info->session_id] == NULL) { - error_setg(errp, "Cannot find a valid session id: %" PRIu64 "", - op_info->session_id); - return -VIRTIO_CRYPTO_INVSESS; - } - if (op_info->op_type == VIRTIO_CRYPTO_SYM_OP_ALGORITHM_CHAINING) { error_setg(errp, "Algorithm chain is unsupported for cryptdoev-builtin"); return -VIRTIO_CRYPTO_NOTSUPP; } - sess = builtin->sessions[op_info->session_id]; - if (op_info->iv_len > 0) { ret = qcrypto_cipher_setiv(sess->cipher, op_info->iv, op_info->iv_len, errp); @@ -333,9 +441,99 @@ static int cryptodev_builtin_sym_operation( return -VIRTIO_CRYPTO_ERR; } } + return VIRTIO_CRYPTO_OK; } +static int cryptodev_builtin_asym_operation( + CryptoDevBackendBuiltinSession *sess, uint32_t op_code, + CryptoDevBackendAsymOpInfo *op_info, Error **errp) +{ + int ret; + + switch (op_code) { + case VIRTIO_CRYPTO_AKCIPHER_ENCRYPT: + ret = qcrypto_akcipher_encrypt(sess->akcipher, + op_info->src, op_info->src_len, + op_info->dst, op_info->dst_len, errp); + break; + + case VIRTIO_CRYPTO_AKCIPHER_DECRYPT: + ret = qcrypto_akcipher_decrypt(sess->akcipher, + op_info->src, op_info->src_len, + op_info->dst, op_info->dst_len, errp); + break; + + case VIRTIO_CRYPTO_AKCIPHER_SIGN: + ret = qcrypto_akcipher_sign(sess->akcipher, + op_info->src, op_info->src_len, + op_info->dst, op_info->dst_len, errp); + break; + + case VIRTIO_CRYPTO_AKCIPHER_VERIFY: + ret = qcrypto_akcipher_verify(sess->akcipher, + op_info->src, op_info->src_len, + op_info->dst, op_info->dst_len, errp); + break; + + default: + return -VIRTIO_CRYPTO_ERR; + } + + if (ret < 0) { + if (op_code == VIRTIO_CRYPTO_AKCIPHER_VERIFY) { + return -VIRTIO_CRYPTO_KEY_REJECTED; + } + return -VIRTIO_CRYPTO_ERR; + } + + /* Buffer is too short, typically the driver should handle this case */ + if (unlikely(ret > op_info->dst_len)) { + if (errp && !*errp) { + error_setg(errp, "dst buffer too short"); + } + + return -VIRTIO_CRYPTO_ERR; + } + + op_info->dst_len = ret; + + return VIRTIO_CRYPTO_OK; +} + +static int cryptodev_builtin_operation( + CryptoDevBackend *backend, + CryptoDevBackendOpInfo *op_info, + uint32_t queue_index, Error **errp) +{ + CryptoDevBackendBuiltin *builtin = + CRYPTODEV_BACKEND_BUILTIN(backend); + CryptoDevBackendBuiltinSession *sess; + CryptoDevBackendSymOpInfo *sym_op_info; + CryptoDevBackendAsymOpInfo *asym_op_info; + enum CryptoDevBackendAlgType algtype = op_info->algtype; + int ret = -VIRTIO_CRYPTO_ERR; + + if (op_info->session_id >= MAX_NUM_SESSIONS || + builtin->sessions[op_info->session_id] == NULL) { + error_setg(errp, "Cannot find a valid session id: %" PRIu64 "", + op_info->session_id); + return -VIRTIO_CRYPTO_INVSESS; + } + + sess = builtin->sessions[op_info->session_id]; + if (algtype == CRYPTODEV_BACKEND_ALG_SYM) { + sym_op_info = op_info->u.sym_op_info; + ret = cryptodev_builtin_sym_operation(sess, sym_op_info, errp); + } else if (algtype == CRYPTODEV_BACKEND_ALG_ASYM) { + asym_op_info = op_info->u.asym_op_info; + ret = cryptodev_builtin_asym_operation(sess, op_info->op_code, + asym_op_info, errp); + } + + return ret; +} + static void cryptodev_builtin_cleanup( CryptoDevBackend *backend, Error **errp) @@ -348,7 +546,7 @@ static void cryptodev_builtin_cleanup( for (i = 0; i < MAX_NUM_SESSIONS; i++) { if (builtin->sessions[i] != NULL) { - cryptodev_builtin_sym_close_session(backend, i, 0, &error_abort); + cryptodev_builtin_close_session(backend, i, 0, &error_abort); } } @@ -370,9 +568,9 @@ cryptodev_builtin_class_init(ObjectClass *oc, void *data) bc->init = cryptodev_builtin_init; bc->cleanup = cryptodev_builtin_cleanup; - bc->create_session = cryptodev_builtin_sym_create_session; - bc->close_session = cryptodev_builtin_sym_close_session; - bc->do_sym_op = cryptodev_builtin_sym_operation; + bc->create_session = cryptodev_builtin_create_session; + bc->close_session = cryptodev_builtin_close_session; + bc->do_op = cryptodev_builtin_operation; } static const TypeInfo cryptodev_builtin_info = { diff --git a/backends/cryptodev-vhost-user.c b/backends/cryptodev-vhost-user.c index bedb452474..5443a59153 100644 --- a/backends/cryptodev-vhost-user.c +++ b/backends/cryptodev-vhost-user.c @@ -259,7 +259,33 @@ static int64_t cryptodev_vhost_user_sym_create_session( return -1; } -static int cryptodev_vhost_user_sym_close_session( +static int64_t cryptodev_vhost_user_create_session( + CryptoDevBackend *backend, + CryptoDevBackendSessionInfo *sess_info, + uint32_t queue_index, Error **errp) +{ + uint32_t op_code = sess_info->op_code; + CryptoDevBackendSymSessionInfo *sym_sess_info; + + switch (op_code) { + case VIRTIO_CRYPTO_CIPHER_CREATE_SESSION: + case VIRTIO_CRYPTO_HASH_CREATE_SESSION: + case VIRTIO_CRYPTO_MAC_CREATE_SESSION: + case VIRTIO_CRYPTO_AEAD_CREATE_SESSION: + sym_sess_info = &sess_info->u.sym_sess_info; + return cryptodev_vhost_user_sym_create_session(backend, sym_sess_info, + queue_index, errp); + default: + error_setg(errp, "Unsupported opcode :%" PRIu32 "", + sess_info->op_code); + return -1; + + } + + return -1; +} + +static int cryptodev_vhost_user_close_session( CryptoDevBackend *backend, uint64_t session_id, uint32_t queue_index, Error **errp) @@ -351,9 +377,9 @@ cryptodev_vhost_user_class_init(ObjectClass *oc, void *data) bc->init = cryptodev_vhost_user_init; bc->cleanup = cryptodev_vhost_user_cleanup; - bc->create_session = cryptodev_vhost_user_sym_create_session; - bc->close_session = cryptodev_vhost_user_sym_close_session; - bc->do_sym_op = NULL; + bc->create_session = cryptodev_vhost_user_create_session; + bc->close_session = cryptodev_vhost_user_close_session; + bc->do_op = NULL; object_class_property_add_str(oc, "chardev", cryptodev_vhost_user_get_chardev, diff --git a/backends/cryptodev.c b/backends/cryptodev.c index 2b105e433c..33eb4e1a70 100644 --- a/backends/cryptodev.c +++ b/backends/cryptodev.c @@ -72,9 +72,9 @@ void cryptodev_backend_cleanup( } } -int64_t cryptodev_backend_sym_create_session( +int64_t cryptodev_backend_create_session( CryptoDevBackend *backend, - CryptoDevBackendSymSessionInfo *sess_info, + CryptoDevBackendSessionInfo *sess_info, uint32_t queue_index, Error **errp) { CryptoDevBackendClass *bc = @@ -87,7 +87,7 @@ int64_t cryptodev_backend_sym_create_session( return -1; } -int cryptodev_backend_sym_close_session( +int cryptodev_backend_close_session( CryptoDevBackend *backend, uint64_t session_id, uint32_t queue_index, Error **errp) @@ -102,16 +102,16 @@ int cryptodev_backend_sym_close_session( return -1; } -static int cryptodev_backend_sym_operation( +static int cryptodev_backend_operation( CryptoDevBackend *backend, - CryptoDevBackendSymOpInfo *op_info, + CryptoDevBackendOpInfo *op_info, uint32_t queue_index, Error **errp) { CryptoDevBackendClass *bc = CRYPTODEV_BACKEND_GET_CLASS(backend); - if (bc->do_sym_op) { - return bc->do_sym_op(backend, op_info, queue_index, errp); + if (bc->do_op) { + return bc->do_op(backend, op_info, queue_index, errp); } return -VIRTIO_CRYPTO_ERR; @@ -123,20 +123,18 @@ int cryptodev_backend_crypto_operation( uint32_t queue_index, Error **errp) { VirtIOCryptoReq *req = opaque; + CryptoDevBackendOpInfo *op_info = &req->op_info; + enum CryptoDevBackendAlgType algtype = req->flags; - if (req->flags == CRYPTODEV_BACKEND_ALG_SYM) { - CryptoDevBackendSymOpInfo *op_info; - op_info = req->u.sym_op_info; - - return cryptodev_backend_sym_operation(backend, - op_info, queue_index, errp); - } else { + if ((algtype != CRYPTODEV_BACKEND_ALG_SYM) + && (algtype != CRYPTODEV_BACKEND_ALG_ASYM)) { error_setg(errp, "Unsupported cryptodev alg type: %" PRIu32 "", - req->flags); - return -VIRTIO_CRYPTO_NOTSUPP; + algtype); + + return -VIRTIO_CRYPTO_NOTSUPP; } - return -VIRTIO_CRYPTO_ERR; + return cryptodev_backend_operation(backend, op_info, queue_index, errp); } static void diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c index c3829e7498..c1243c3f93 100644 --- a/hw/virtio/virtio-crypto.c +++ b/hw/virtio/virtio-crypto.c @@ -83,7 +83,8 @@ virtio_crypto_create_sym_session(VirtIOCrypto *vcrypto, struct iovec *iov, unsigned int out_num) { VirtIODevice *vdev = VIRTIO_DEVICE(vcrypto); - CryptoDevBackendSymSessionInfo info; + CryptoDevBackendSessionInfo info; + CryptoDevBackendSymSessionInfo *sym_info; int64_t session_id; int queue_index; uint32_t op_type; @@ -92,11 +93,13 @@ virtio_crypto_create_sym_session(VirtIOCrypto *vcrypto, memset(&info, 0, sizeof(info)); op_type = ldl_le_p(&sess_req->op_type); - info.op_type = op_type; info.op_code = opcode; + sym_info = &info.u.sym_sess_info; + sym_info->op_type = op_type; + if (op_type == VIRTIO_CRYPTO_SYM_OP_CIPHER) { - ret = virtio_crypto_cipher_session_helper(vdev, &info, + ret = virtio_crypto_cipher_session_helper(vdev, sym_info, &sess_req->u.cipher.para, &iov, &out_num); if (ret < 0) { @@ -105,47 +108,47 @@ virtio_crypto_create_sym_session(VirtIOCrypto *vcrypto, } else if (op_type == VIRTIO_CRYPTO_SYM_OP_ALGORITHM_CHAINING) { size_t s; /* cipher part */ - ret = virtio_crypto_cipher_session_helper(vdev, &info, + ret = virtio_crypto_cipher_session_helper(vdev, sym_info, &sess_req->u.chain.para.cipher_param, &iov, &out_num); if (ret < 0) { goto err; } /* hash part */ - info.alg_chain_order = ldl_le_p( + sym_info->alg_chain_order = ldl_le_p( &sess_req->u.chain.para.alg_chain_order); - info.add_len = ldl_le_p(&sess_req->u.chain.para.aad_len); - info.hash_mode = ldl_le_p(&sess_req->u.chain.para.hash_mode); - if (info.hash_mode == VIRTIO_CRYPTO_SYM_HASH_MODE_AUTH) { - info.hash_alg = ldl_le_p(&sess_req->u.chain.para.u.mac_param.algo); - info.auth_key_len = ldl_le_p( + sym_info->add_len = ldl_le_p(&sess_req->u.chain.para.aad_len); + sym_info->hash_mode = ldl_le_p(&sess_req->u.chain.para.hash_mode); + if (sym_info->hash_mode == VIRTIO_CRYPTO_SYM_HASH_MODE_AUTH) { + sym_info->hash_alg = + ldl_le_p(&sess_req->u.chain.para.u.mac_param.algo); + sym_info->auth_key_len = ldl_le_p( &sess_req->u.chain.para.u.mac_param.auth_key_len); - info.hash_result_len = ldl_le_p( + sym_info->hash_result_len = ldl_le_p( &sess_req->u.chain.para.u.mac_param.hash_result_len); - if (info.auth_key_len > vcrypto->conf.max_auth_key_len) { + if (sym_info->auth_key_len > vcrypto->conf.max_auth_key_len) { error_report("virtio-crypto length of auth key is too big: %u", - info.auth_key_len); + sym_info->auth_key_len); ret = -VIRTIO_CRYPTO_ERR; goto err; } /* get auth key */ - if (info.auth_key_len > 0) { - DPRINTF("auth_keylen=%" PRIu32 "\n", info.auth_key_len); - info.auth_key = g_malloc(info.auth_key_len); - s = iov_to_buf(iov, out_num, 0, info.auth_key, - info.auth_key_len); - if (unlikely(s != info.auth_key_len)) { + if (sym_info->auth_key_len > 0) { + sym_info->auth_key = g_malloc(sym_info->auth_key_len); + s = iov_to_buf(iov, out_num, 0, sym_info->auth_key, + sym_info->auth_key_len); + if (unlikely(s != sym_info->auth_key_len)) { virtio_error(vdev, "virtio-crypto authenticated key incorrect"); ret = -EFAULT; goto err; } - iov_discard_front(&iov, &out_num, info.auth_key_len); + iov_discard_front(&iov, &out_num, sym_info->auth_key_len); } - } else if (info.hash_mode == VIRTIO_CRYPTO_SYM_HASH_MODE_PLAIN) { - info.hash_alg = ldl_le_p( + } else if (sym_info->hash_mode == VIRTIO_CRYPTO_SYM_HASH_MODE_PLAIN) { + sym_info->hash_alg = ldl_le_p( &sess_req->u.chain.para.u.hash_param.algo); - info.hash_result_len = ldl_le_p( + sym_info->hash_result_len = ldl_le_p( &sess_req->u.chain.para.u.hash_param.hash_result_len); } else { /* VIRTIO_CRYPTO_SYM_HASH_MODE_NESTED */ @@ -161,13 +164,10 @@ virtio_crypto_create_sym_session(VirtIOCrypto *vcrypto, } queue_index = virtio_crypto_vq2q(queue_id); - session_id = cryptodev_backend_sym_create_session( + session_id = cryptodev_backend_create_session( vcrypto->cryptodev, &info, queue_index, &local_err); if (session_id >= 0) { - DPRINTF("create session_id=%" PRIu64 " successfully\n", - session_id); - ret = session_id; } else { if (local_err) { @@ -177,11 +177,78 @@ virtio_crypto_create_sym_session(VirtIOCrypto *vcrypto, } err: - g_free(info.cipher_key); - g_free(info.auth_key); + g_free(sym_info->cipher_key); + g_free(sym_info->auth_key); return ret; } +static int64_t +virtio_crypto_create_asym_session(VirtIOCrypto *vcrypto, + struct virtio_crypto_akcipher_create_session_req *sess_req, + uint32_t queue_id, uint32_t opcode, + struct iovec *iov, unsigned int out_num) +{ + VirtIODevice *vdev = VIRTIO_DEVICE(vcrypto); + CryptoDevBackendSessionInfo info = {0}; + CryptoDevBackendAsymSessionInfo *asym_info; + int64_t session_id; + int queue_index; + uint32_t algo, keytype, keylen; + g_autofree uint8_t *key = NULL; + Error *local_err = NULL; + + algo = ldl_le_p(&sess_req->para.algo); + keytype = ldl_le_p(&sess_req->para.keytype); + keylen = ldl_le_p(&sess_req->para.keylen); + + if ((keytype != VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PUBLIC) + && (keytype != VIRTIO_CRYPTO_AKCIPHER_KEY_TYPE_PRIVATE)) { + error_report("unsupported asym keytype: %d", keytype); + return -VIRTIO_CRYPTO_NOTSUPP; + } + + if (keylen) { + key = g_malloc(keylen); + if (iov_to_buf(iov, out_num, 0, key, keylen) != keylen) { + virtio_error(vdev, "virtio-crypto asym key incorrect"); + return -EFAULT; + } + iov_discard_front(&iov, &out_num, keylen); + } + + info.op_code = opcode; + asym_info = &info.u.asym_sess_info; + asym_info->algo = algo; + asym_info->keytype = keytype; + asym_info->keylen = keylen; + asym_info->key = key; + switch (asym_info->algo) { + case VIRTIO_CRYPTO_AKCIPHER_RSA: + asym_info->u.rsa.padding_algo = + ldl_le_p(&sess_req->para.u.rsa.padding_algo); + asym_info->u.rsa.hash_algo = + ldl_le_p(&sess_req->para.u.rsa.hash_algo); + break; + + /* TODO DSA&ECDSA handling */ + + default: + return -VIRTIO_CRYPTO_ERR; + } + + queue_index = virtio_crypto_vq2q(queue_id); + session_id = cryptodev_backend_create_session(vcrypto->cryptodev, &info, + queue_index, &local_err); + if (session_id < 0) { + if (local_err) { + error_report_err(local_err); + } + return -VIRTIO_CRYPTO_ERR; + } + + return session_id; +} + static uint8_t virtio_crypto_handle_close_session(VirtIOCrypto *vcrypto, struct virtio_crypto_destroy_session_req *close_sess_req, @@ -195,7 +262,7 @@ virtio_crypto_handle_close_session(VirtIOCrypto *vcrypto, session_id = ldq_le_p(&close_sess_req->session_id); DPRINTF("close session, id=%" PRIu64 "\n", session_id); - ret = cryptodev_backend_sym_close_session( + ret = cryptodev_backend_close_session( vcrypto->cryptodev, session_id, queue_id, &local_err); if (ret == 0) { status = VIRTIO_CRYPTO_OK; @@ -260,13 +327,22 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) opcode = ldl_le_p(&ctrl.header.opcode); queue_id = ldl_le_p(&ctrl.header.queue_id); + memset(&input, 0, sizeof(input)); switch (opcode) { case VIRTIO_CRYPTO_CIPHER_CREATE_SESSION: - memset(&input, 0, sizeof(input)); session_id = virtio_crypto_create_sym_session(vcrypto, &ctrl.u.sym_create_session, queue_id, opcode, out_iov, out_num); + goto check_session; + + case VIRTIO_CRYPTO_AKCIPHER_CREATE_SESSION: + session_id = virtio_crypto_create_asym_session(vcrypto, + &ctrl.u.akcipher_create_session, + queue_id, opcode, + out_iov, out_num); + +check_session: /* Serious errors, need to reset virtio crypto device */ if (session_id == -EFAULT) { virtqueue_detach_element(vq, elem, 0); @@ -290,10 +366,12 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) virtqueue_push(vq, elem, sizeof(input)); virtio_notify(vdev, vq); break; + case VIRTIO_CRYPTO_CIPHER_DESTROY_SESSION: case VIRTIO_CRYPTO_HASH_DESTROY_SESSION: case VIRTIO_CRYPTO_MAC_DESTROY_SESSION: case VIRTIO_CRYPTO_AEAD_DESTROY_SESSION: + case VIRTIO_CRYPTO_AKCIPHER_DESTROY_SESSION: status = virtio_crypto_handle_close_session(vcrypto, &ctrl.u.destroy_session, queue_id); /* The status only occupy one byte, we can directly use it */ @@ -311,7 +389,6 @@ static void virtio_crypto_handle_ctrl(VirtIODevice *vdev, VirtQueue *vq) case VIRTIO_CRYPTO_AEAD_CREATE_SESSION: default: error_report("virtio-crypto unsupported ctrl opcode: %d", opcode); - memset(&input, 0, sizeof(input)); stl_le_p(&input.status, VIRTIO_CRYPTO_NOTSUPP); s = iov_from_buf(in_iov, in_num, 0, &input, sizeof(input)); if (unlikely(s != sizeof(input))) { @@ -339,28 +416,39 @@ static void virtio_crypto_init_request(VirtIOCrypto *vcrypto, VirtQueue *vq, req->in_num = 0; req->in_len = 0; req->flags = CRYPTODEV_BACKEND_ALG__MAX; - req->u.sym_op_info = NULL; + memset(&req->op_info, 0x00, sizeof(req->op_info)); } static void virtio_crypto_free_request(VirtIOCryptoReq *req) { - if (req) { - if (req->flags == CRYPTODEV_BACKEND_ALG_SYM) { - size_t max_len; - CryptoDevBackendSymOpInfo *op_info = req->u.sym_op_info; + if (!req) { + return; + } - max_len = op_info->iv_len + - op_info->aad_len + - op_info->src_len + - op_info->dst_len + - op_info->digest_result_len; + if (req->flags == CRYPTODEV_BACKEND_ALG_SYM) { + size_t max_len; + CryptoDevBackendSymOpInfo *op_info = req->op_info.u.sym_op_info; - /* Zeroize and free request data structure */ - memset(op_info, 0, sizeof(*op_info) + max_len); + max_len = op_info->iv_len + + op_info->aad_len + + op_info->src_len + + op_info->dst_len + + op_info->digest_result_len; + + /* Zeroize and free request data structure */ + memset(op_info, 0, sizeof(*op_info) + max_len); + g_free(op_info); + } else if (req->flags == CRYPTODEV_BACKEND_ALG_ASYM) { + CryptoDevBackendAsymOpInfo *op_info = req->op_info.u.asym_op_info; + if (op_info) { + g_free(op_info->src); + g_free(op_info->dst); + memset(op_info, 0, sizeof(*op_info)); g_free(op_info); } - g_free(req); } + + g_free(req); } static void @@ -397,6 +485,35 @@ virtio_crypto_sym_input_data_helper(VirtIODevice *vdev, } } +static void +virtio_crypto_akcipher_input_data_helper(VirtIODevice *vdev, + VirtIOCryptoReq *req, int32_t status, + CryptoDevBackendAsymOpInfo *asym_op_info) +{ + size_t s, len; + + if (status != VIRTIO_CRYPTO_OK) { + return; + } + + len = asym_op_info->dst_len; + if (!len) { + return; + } + + s = iov_from_buf(req->in_iov, req->in_num, 0, asym_op_info->dst, len); + if (s != len) { + virtio_error(vdev, "virtio-crypto asym dest data incorrect"); + return; + } + + iov_discard_front(&req->in_iov, &req->in_num, len); + + /* For akcipher, dst_len may be changed after operation */ + req->in_len = sizeof(struct virtio_crypto_inhdr) + asym_op_info->dst_len; +} + + static void virtio_crypto_req_complete(VirtIOCryptoReq *req, uint8_t status) { VirtIOCrypto *vcrypto = req->vcrypto; @@ -404,7 +521,10 @@ static void virtio_crypto_req_complete(VirtIOCryptoReq *req, uint8_t status) if (req->flags == CRYPTODEV_BACKEND_ALG_SYM) { virtio_crypto_sym_input_data_helper(vdev, req, status, - req->u.sym_op_info); + req->op_info.u.sym_op_info); + } else if (req->flags == CRYPTODEV_BACKEND_ALG_ASYM) { + virtio_crypto_akcipher_input_data_helper(vdev, req, status, + req->op_info.u.asym_op_info); } stb_p(&req->in->status, status); virtqueue_push(req->vq, &req->elem, req->in_len); @@ -543,41 +663,100 @@ err: static int virtio_crypto_handle_sym_req(VirtIOCrypto *vcrypto, struct virtio_crypto_sym_data_req *req, - CryptoDevBackendSymOpInfo **sym_op_info, + CryptoDevBackendOpInfo *op_info, struct iovec *iov, unsigned int out_num) { VirtIODevice *vdev = VIRTIO_DEVICE(vcrypto); + CryptoDevBackendSymOpInfo *sym_op_info; uint32_t op_type; - CryptoDevBackendSymOpInfo *op_info; op_type = ldl_le_p(&req->op_type); - if (op_type == VIRTIO_CRYPTO_SYM_OP_CIPHER) { - op_info = virtio_crypto_sym_op_helper(vdev, &req->u.cipher.para, + sym_op_info = virtio_crypto_sym_op_helper(vdev, &req->u.cipher.para, NULL, iov, out_num); - if (!op_info) { + if (!sym_op_info) { return -EFAULT; } - op_info->op_type = op_type; } else if (op_type == VIRTIO_CRYPTO_SYM_OP_ALGORITHM_CHAINING) { - op_info = virtio_crypto_sym_op_helper(vdev, NULL, + sym_op_info = virtio_crypto_sym_op_helper(vdev, NULL, &req->u.chain.para, iov, out_num); - if (!op_info) { + if (!sym_op_info) { return -EFAULT; } - op_info->op_type = op_type; } else { /* VIRTIO_CRYPTO_SYM_OP_NONE */ error_report("virtio-crypto unsupported cipher type"); return -VIRTIO_CRYPTO_NOTSUPP; } - *sym_op_info = op_info; + sym_op_info->op_type = op_type; + op_info->u.sym_op_info = sym_op_info; return 0; } +static int +virtio_crypto_handle_asym_req(VirtIOCrypto *vcrypto, + struct virtio_crypto_akcipher_data_req *req, + CryptoDevBackendOpInfo *op_info, + struct iovec *iov, unsigned int out_num) +{ + VirtIODevice *vdev = VIRTIO_DEVICE(vcrypto); + CryptoDevBackendAsymOpInfo *asym_op_info; + uint32_t src_len; + uint32_t dst_len; + uint32_t len; + uint8_t *src = NULL; + uint8_t *dst = NULL; + + asym_op_info = g_malloc0(sizeof(CryptoDevBackendAsymOpInfo)); + src_len = ldl_le_p(&req->para.src_data_len); + dst_len = ldl_le_p(&req->para.dst_data_len); + + if (src_len > 0) { + src = g_malloc0(src_len); + len = iov_to_buf(iov, out_num, 0, src, src_len); + if (unlikely(len != src_len)) { + virtio_error(vdev, "virtio-crypto asym src data incorrect" + "expected %u, actual %u", src_len, len); + goto err; + } + + iov_discard_front(&iov, &out_num, src_len); + } + + if (dst_len > 0) { + dst = g_malloc0(dst_len); + + if (op_info->op_code == VIRTIO_CRYPTO_AKCIPHER_VERIFY) { + len = iov_to_buf(iov, out_num, 0, dst, dst_len); + if (unlikely(len != dst_len)) { + virtio_error(vdev, "virtio-crypto asym dst data incorrect" + "expected %u, actual %u", dst_len, len); + goto err; + } + + iov_discard_front(&iov, &out_num, dst_len); + } + } + + asym_op_info->src_len = src_len; + asym_op_info->dst_len = dst_len; + asym_op_info->src = src; + asym_op_info->dst = dst; + op_info->u.asym_op_info = asym_op_info; + + return 0; + + err: + g_free(asym_op_info); + g_free(src); + g_free(dst); + + return -EFAULT; +} + static int virtio_crypto_handle_request(VirtIOCryptoReq *request) { @@ -595,8 +774,7 @@ virtio_crypto_handle_request(VirtIOCryptoReq *request) unsigned out_num; uint32_t opcode; uint8_t status = VIRTIO_CRYPTO_ERR; - uint64_t session_id; - CryptoDevBackendSymOpInfo *sym_op_info = NULL; + CryptoDevBackendOpInfo *op_info = &request->op_info; Error *local_err = NULL; if (elem->out_num < 1 || elem->in_num < 1) { @@ -639,15 +817,28 @@ virtio_crypto_handle_request(VirtIOCryptoReq *request) request->in_iov = in_iov; opcode = ldl_le_p(&req.header.opcode); - session_id = ldq_le_p(&req.header.session_id); + op_info->session_id = ldq_le_p(&req.header.session_id); + op_info->op_code = opcode; switch (opcode) { case VIRTIO_CRYPTO_CIPHER_ENCRYPT: case VIRTIO_CRYPTO_CIPHER_DECRYPT: + op_info->algtype = request->flags = CRYPTODEV_BACKEND_ALG_SYM; ret = virtio_crypto_handle_sym_req(vcrypto, - &req.u.sym_req, - &sym_op_info, + &req.u.sym_req, op_info, out_iov, out_num); + goto check_result; + + case VIRTIO_CRYPTO_AKCIPHER_ENCRYPT: + case VIRTIO_CRYPTO_AKCIPHER_DECRYPT: + case VIRTIO_CRYPTO_AKCIPHER_SIGN: + case VIRTIO_CRYPTO_AKCIPHER_VERIFY: + op_info->algtype = request->flags = CRYPTODEV_BACKEND_ALG_ASYM; + ret = virtio_crypto_handle_asym_req(vcrypto, + &req.u.akcipher_req, op_info, + out_iov, out_num); + +check_result: /* Serious errors, need to reset virtio crypto device */ if (ret == -EFAULT) { return -1; @@ -655,11 +846,8 @@ virtio_crypto_handle_request(VirtIOCryptoReq *request) virtio_crypto_req_complete(request, VIRTIO_CRYPTO_NOTSUPP); virtio_crypto_free_request(request); } else { - sym_op_info->session_id = session_id; /* Set request's parameter */ - request->flags = CRYPTODEV_BACKEND_ALG_SYM; - request->u.sym_op_info = sym_op_info; ret = cryptodev_backend_crypto_operation(vcrypto->cryptodev, request, queue_index, &local_err); if (ret < 0) { @@ -674,6 +862,7 @@ virtio_crypto_handle_request(VirtIOCryptoReq *request) virtio_crypto_free_request(request); } break; + case VIRTIO_CRYPTO_HASH: case VIRTIO_CRYPTO_MAC: case VIRTIO_CRYPTO_AEAD_ENCRYPT: @@ -779,6 +968,7 @@ static void virtio_crypto_init_config(VirtIODevice *vdev) vcrypto->conf.mac_algo_l = vcrypto->conf.cryptodev->conf.mac_algo_l; vcrypto->conf.mac_algo_h = vcrypto->conf.cryptodev->conf.mac_algo_h; vcrypto->conf.aead_algo = vcrypto->conf.cryptodev->conf.aead_algo; + vcrypto->conf.akcipher_algo = vcrypto->conf.cryptodev->conf.akcipher_algo; vcrypto->conf.max_cipher_key_len = vcrypto->conf.cryptodev->conf.max_cipher_key_len; vcrypto->conf.max_auth_key_len = @@ -891,6 +1081,7 @@ static void virtio_crypto_get_config(VirtIODevice *vdev, uint8_t *config) stl_le_p(&crypto_cfg.max_cipher_key_len, c->conf.max_cipher_key_len); stl_le_p(&crypto_cfg.max_auth_key_len, c->conf.max_auth_key_len); stq_le_p(&crypto_cfg.max_size, c->conf.max_size); + stl_le_p(&crypto_cfg.akcipher_algo, c->conf.akcipher_algo); memcpy(config, &crypto_cfg, c->config_size); }