From patchwork Fri Mar 4 15:07:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769334 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 4828AC433F5 for ; Fri, 4 Mar 2022 15:28:43 +0000 (UTC) Received: from localhost ([::1]:54416 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ9rG-0003wz-Ae for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:28:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50706) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ9Wx-0004mj-VS for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:45 -0500 Received: from [2607:f8b0:4864:20::62c] (port=38459 helo=mail-pl1-x62c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ9Ww-0003kf-Je for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:43 -0500 Received: by mail-pl1-x62c.google.com with SMTP id t19so4414500plr.5 for ; Fri, 04 Mar 2022 07:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=untwttg2h9MUzs6wtedAKndtsuh/tYZaw3CDKZL3ZkM=; b=dN0bjUbHMaxc0knlgM/3Sq7j3gEDRSWUe0Ohwy7PKM3k92GICreyZKk7rZ1lAaQ2Q4 qvxqKUN6i6l1QPY+LqgmaOv4QM8w/6uRDYttGiEVJEuTpSr9b4MaglU/OiIEPazngLdW f/rLZdurLx0UEmrlUojGy7BX05KgTbzGZ+Y6FyGgQJtLvjuK5kZv9ubvEzj98+GrI2cT um6XnRKf5QY0j/ZUx6KjfEA+jWdmHmCkAd5H+HeT9yUigf0vY8SfOm3zOgGzUIBJVUQd 22Yj4LS01VqU8Jm08Em9TtP+wKkZwuDM278DwwgDvs3jWvsBaonjMSqNwxoCDqPZheiY iOhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=untwttg2h9MUzs6wtedAKndtsuh/tYZaw3CDKZL3ZkM=; b=EXs3B8OLSF8gN+Vrwn5h75tgK7vnuGW62Hgc0qpk48TkXdb9hZ25ETWaidAcTS1Ta+ B2Wf8kLpt5TmGmOe5MDYPLPvHJbnnX7qjcFaSV1bnAoDe09wiRFmaHY+hFDsOGQC3M3m ll1Y/jdUonxnaC7fCMosYkVJpOKmr5L5XBVj7d6/FQ7CsokpV4CPFyjlTpyi0zv+Pg2C G57TWWNKXfM9SqvxxpAL7G/ci7kqJkt0A95Fm1k7k9s+lUecJTcDW/XHPGvuh2mG9C5M 2gWC5GISqhKGJQyCUXLiDVUGgyIuh1vpL2c9ecqTeVQ+h8zYFcBZe4o9YF4Tpvv8hxSC nj1w== X-Gm-Message-State: AOAM531L5B28NPyDv1NXQgFP+/zcuVhJi1yKEVJbscxMlvInuU7/O3Q0 H5rm9l5MnsHItiitRWSi51Bc4ZJbGDYNEw== X-Google-Smtp-Source: ABdhPJx4eWULUkU5zHmpW5IPDkRE5FVCK2Mz/jlJcOd4Q1IR6Ljr89UjYCyHwTbBMKXK5gWRW5H8eQ== X-Received: by 2002:a17:903:11c6:b0:151:a247:31eb with SMTP id q6-20020a17090311c600b00151a24731ebmr11737290plh.91.1646406461098; Fri, 04 Mar 2022 07:07:41 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id nr22-20020a17090b241600b001bef1964ec7sm8278861pjb.21.2022.03.04.07.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:07:40 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v6 1/4] tests/acpi: i386: allow FACP acpi table changes Date: Fri, 4 Mar 2022 20:37:19 +0530 Message-Id: <20220304150722.2069132-2-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304150722.2069132-1-ani@anisinha.ca> References: <20220304150722.2069132-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62c (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::62c; envelope-from=ani@anisinha.ca; helo=mail-pl1-x62c.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: liavalb@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Liav Albani The FACP table is going to be changed for x86/q35 machines. To be sure the following changes are not breaking any QEMU test this change follows step 2 from the bios-tables-test.c guide on changes that affect ACPI tables. Signed-off-by: Liav Albani Acked-by: Ani Sinha --- tests/qtest/bios-tables-test-allowed-diff.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/qtest/bios-tables-test-allowed-diff.h b/tests/qtest/bios-tables-test-allowed-diff.h index dfb8523c8b..7570e39369 100644 --- a/tests/qtest/bios-tables-test-allowed-diff.h +++ b/tests/qtest/bios-tables-test-allowed-diff.h @@ -1 +1,5 @@ /* List of comma-separated changed AML files to ignore */ +"tests/data/acpi/q35/FACP", +"tests/data/acpi/q35/FACP.nosmm", +"tests/data/acpi/q35/FACP.slic", +"tests/data/acpi/q35/FACP.xapic", From patchwork Fri Mar 4 15:07:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id B14B2C433EF for ; Fri, 4 Mar 2022 15:29:50 +0000 (UTC) Received: from localhost ([::1]:57928 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ9sL-00071k-RC for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:29:49 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ9X1-0004ql-Vq for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:48 -0500 Received: from [2607:f8b0:4864:20::1033] (port=52900 helo=mail-pj1-x1033.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ9X0-0003ks-EE for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:47 -0500 Received: by mail-pj1-x1033.google.com with SMTP id v4so7566095pjh.2 for ; Fri, 04 Mar 2022 07:07:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MC/4yt1MXUGPRfWKzDGwR1zYGtJXYhIlfWpMgyv9Xxg=; b=JjaJBj4xd3tLbleMotqrdkI36pq6yExQeelqVZsGmKO8OzsOyrVk8fD5iChCwGxTPG WmJ3TEC6x8zdueLuPOlm7NIheRrjmMRPvuWj/JGqf7Ao2ZoH+AS4EGDAMYZ7tYh07POg sj20PN0S+0+Qr+uNM5mHAln6jJ+69ByvaAuZihGEKD94EIGmD/S90UaiJ17dTd0AdR4Y BdjCcubgz+9KRDuict30hkkHtFATIW/LTrVYYzEkP53uGalQN7jUV3mnAKGtvpurt1zI hx4RIeuuN+Rdqk8qbi/gXufViPy4CcBqosq7szE/NzndboBUVt+wV7g65aWce/owM6WN X/Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MC/4yt1MXUGPRfWKzDGwR1zYGtJXYhIlfWpMgyv9Xxg=; b=ecnvz/Hr8YQMW5DsNFUtM+U3RYcnMRe44dr60IHeT1WpSK2TfHy6JQYmn2XOvSIZWT pFyE3bWfQRKewlvk9Fn7FZ9cc6oQ+BdMfPFHrWTW9fMPFV+xPXCi95zVDf2tmX04UcmH o+8nkTPyBslkdIqVnN2ZOfn2CKE0Kn47/qSFGrvl9QSD/R4C/k34JijhbFo0azrsFRQY YL7mm2E6SmWPuuxlWM10cvX2J53ye61/VutmfPU1LSZQKUmYfTiKcycIiUcpTGqTAXDM 5AqtJAncRX1iBWqx/ALHHpLTx01TLgmiPFOHx564S9CH8gogrZKav47ClH9TPcgBm20f TGkw== X-Gm-Message-State: AOAM531ulnMReYVsoAIaj9R02xIZY366sRfG4aEaB7sZZaO0VPdknqI+ FQIM18fM4I0tNWurOrSxSuIMDPoN9MOROQ== X-Google-Smtp-Source: ABdhPJzif6xu59xgIn8fF9YXsl7krWVVTcRRpgmKQa4snLEXryiuIxQg/O7baaq0+O6pxnA1gAM/aQ== X-Received: by 2002:a17:902:edcd:b0:14d:c114:b86b with SMTP id q13-20020a170902edcd00b0014dc114b86bmr41440233plk.166.1646406464805; Fri, 04 Mar 2022 07:07:44 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id nr22-20020a17090b241600b001bef1964ec7sm8278861pjb.21.2022.03.04.07.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:07:44 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v6 2/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table Date: Fri, 4 Mar 2022 20:37:20 +0530 Message-Id: <20220304150722.2069132-3-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304150722.2069132-1-ani@anisinha.ca> References: <20220304150722.2069132-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::1033 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::1033; envelope-from=ani@anisinha.ca; helo=mail-pj1-x1033.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: liavalb@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Liav Albani This can allow the guest OS to determine more easily if i8042 controller is present in the system or not, so it doesn't need to do probing of the controller, but just initialize it immediately, before enumerating the ACPI AML namespace. The 8042 bit in IAPC_BOOT_ARCH was introduced from ACPI spec v2 (FADT revision 2 and above). Therefore, in this change, we only enable this bit for x86/q35 machine types since x86/i440fx machines use FADT ACPI table with revision 1. Signed-off-by: Liav Albani Signed-off-by: Ani Sinha --- hw/acpi/aml-build.c | 8 +++++++- hw/i386/acpi-build.c | 8 ++++++++ include/hw/acpi/acpi-defs.h | 1 + include/hw/input/i8042.h | 15 +++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c index 8966e16320..1773cf55f1 100644 --- a/hw/acpi/aml-build.c +++ b/hw/acpi/aml-build.c @@ -2152,7 +2152,13 @@ void build_fadt(GArray *tbl, BIOSLinker *linker, const AcpiFadtData *f, build_append_int_noprefix(tbl, 0, 1); /* DAY_ALRM */ build_append_int_noprefix(tbl, 0, 1); /* MON_ALRM */ build_append_int_noprefix(tbl, f->rtc_century, 1); /* CENTURY */ - build_append_int_noprefix(tbl, 0, 2); /* IAPC_BOOT_ARCH */ + /* IAPC_BOOT_ARCH */ + if (f->rev == 1) { + build_append_int_noprefix(tbl, 0, 2); + } else { + /* since ACPI v2.0 */ + build_append_int_noprefix(tbl, f->iapc_boot_arch, 2); + } build_append_int_noprefix(tbl, 0, 1); /* Reserved */ build_append_int_noprefix(tbl, f->flags, 4); /* Flags */ diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index ebd47aa26f..4ad4d7286c 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -38,6 +38,7 @@ #include "hw/nvram/fw_cfg.h" #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" @@ -192,6 +193,13 @@ static void init_common_fadt_data(MachineState *ms, Object *o, .address = object_property_get_uint(o, ACPI_PM_PROP_GPE0_BLK, NULL) }, }; + + /* + * ACPI v2, Table 5-10 - Fixed ACPI Description Table Boot Architecture + * Flags, bit offset 1 - 8042. + */ + fadt.iapc_boot_arch = iapc_boot_arch_8042(); + *data = fadt; } diff --git a/include/hw/acpi/acpi-defs.h b/include/hw/acpi/acpi-defs.h index c97e8633ad..2b42e4192b 100644 --- a/include/hw/acpi/acpi-defs.h +++ b/include/hw/acpi/acpi-defs.h @@ -77,6 +77,7 @@ typedef struct AcpiFadtData { uint16_t plvl2_lat; /* P_LVL2_LAT */ uint16_t plvl3_lat; /* P_LVL3_LAT */ uint16_t arm_boot_arch; /* ARM_BOOT_ARCH */ + uint16_t iapc_boot_arch; /* IAPC_BOOT_ARCH */ uint8_t minor_ver; /* FADT Minor Version */ /* diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h index 1d90432dae..b3b77bbb32 100644 --- a/include/hw/input/i8042.h +++ b/include/hw/input/i8042.h @@ -23,4 +23,19 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq, void i8042_isa_mouse_fake_event(ISAKBDState *isa); void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out); +static inline bool i8042_present(void) +{ + bool amb = false; + return object_resolve_path_type("", TYPE_I8042, &amb) || amb; +} + +/* + * ACPI v2, Table 5-10 - Fixed ACPI Description Table Boot Architecture + * Flags, bit offset 1 - 8042. + */ +static inline u16 iapc_boot_arch_8042(void) +{ + return i8042_present() ? 0x1 << 1 : 0x0 ; +} + #endif /* HW_INPUT_I8042_H */ From patchwork Fri Mar 4 15:07:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 5E1C5C433EF for ; Fri, 4 Mar 2022 15:33:20 +0000 (UTC) Received: from localhost ([::1]:38128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ9vj-0004pz-F6 for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:33:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ9X4-0004ro-Ku for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:50 -0500 Received: from [2607:f8b0:4864:20::636] (port=36779 helo=mail-pl1-x636.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ9X3-0003l3-4J for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:50 -0500 Received: by mail-pl1-x636.google.com with SMTP id e13so7978535plh.3 for ; Fri, 04 Mar 2022 07:07:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mt6B7mT4/5OJ0gJ2i6HNdOP8FrYBdmtR2VW9Nn/GzUA=; b=WaHXq+SrQC8WaqSDykRHbLhI4FBqTRlhKIyxmsB/iAhAa4sVja1fj5aPhdk9TCE4kK eqtNDfzV/x/F9YmCtGYO3y5zivTjQ24UMLM9JUsJG63h8rhggfzTeDQFPzse7KY0pa6i Mt4qdSLM2iRlh+wTrDIEVYT/EN0thVMFXRkCYj3nN78cAtIJVURdt5G6sZgMchulthLA 0seNUmAqivCUiimWpvbSvhleg0rkMR+W0lXLn7Y6r+fCvWDbZTnAEHk3djAexzT2swZp XiCh/mQpGLX3ZlZ0+Wh8BwL5MoU7vJKQqFJIbzWXmHH2tBQVpZJbvp1nJRIvHjE7PdVi D84Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mt6B7mT4/5OJ0gJ2i6HNdOP8FrYBdmtR2VW9Nn/GzUA=; b=DppvOFSu7JV9S5EHjhW1DikA4i1RBdfkINxY4FCnS3Qvct+/YVc5prPx67oC73QjrF 4atobN7n95VEdnPmkcktmVwC/yWZuNqKhQbbUNwJu5pqQKxlXNP4C6zLVPhVBvFvaavK GHuG1S6a8epsQdrzCYubnb5YuESJ/lWlnlOQloTXhAvJFaijloM3Hyo5ZySsUdwGHKv2 Q3F6vgEoKxpymVgJA1U3tv3yQe89ROcQu9YCZNImrpBiVWEVTb1APz/S873OWxycmoic 9xyItimUOfPEKvS3U1r/0db/MziiPXx80JHWfZJObSHGNXwLnrVyXYoSlMRqdKm27lvy vMdQ== X-Gm-Message-State: AOAM530Vn6pbLzv2R7HYcDYrVy0SKb2kdmqArFqYGG5R1DV6N2VSecaf vKQR1WcKkrTcF4bw0jvRRlbb+g/XO/3/aw== X-Google-Smtp-Source: ABdhPJwyvpZTY+B0JcQEaTEnsRW7Dl1T3iBhEf3yXM7qYTq7ftE1LzPECwaebm9URqp0k4ndHBD0zg== X-Received: by 2002:a17:903:24f:b0:14f:73fa:2b30 with SMTP id j15-20020a170903024f00b0014f73fa2b30mr41900043plh.174.1646406467550; Fri, 04 Mar 2022 07:07:47 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id nr22-20020a17090b241600b001bef1964ec7sm8278861pjb.21.2022.03.04.07.07.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:07:47 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v6 3/4] tests/acpi: i386: update FACP table differences Date: Fri, 4 Mar 2022 20:37:21 +0530 Message-Id: <20220304150722.2069132-4-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304150722.2069132-1-ani@anisinha.ca> References: <20220304150722.2069132-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::636 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::636; envelope-from=ani@anisinha.ca; helo=mail-pl1-x636.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: liavalb@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" From: Liav Albani After changing the IAPC boot flags register to indicate support of i8042 in the machine chipset to help the guest OS to determine its existence "faster", we need to have the updated FACP ACPI binary images in tree. The ASL changes introduced are shown by the following diff: @@ -42,35 +42,35 @@ [059h 0089 1] PM1 Control Block Length : 02 [05Ah 0090 1] PM2 Control Block Length : 00 [05Bh 0091 1] PM Timer Block Length : 04 [05Ch 0092 1] GPE0 Block Length : 10 [05Dh 0093 1] GPE1 Block Length : 00 [05Eh 0094 1] GPE1 Base Offset : 00 [05Fh 0095 1] _CST Support : 00 [060h 0096 2] C2 Latency : 0FFF [062h 0098 2] C3 Latency : 0FFF [064h 0100 2] CPU Cache Size : 0000 [066h 0102 2] Cache Flush Stride : 0000 [068h 0104 1] Duty Cycle Offset : 00 [069h 0105 1] Duty Cycle Width : 00 [06Ah 0106 1] RTC Day Alarm Index : 00 [06Bh 0107 1] RTC Month Alarm Index : 00 [06Ch 0108 1] RTC Century Index : 32 -[06Dh 0109 2] Boot Flags (decoded below) : 0000 +[06Dh 0109 2] Boot Flags (decoded below) : 0002 Legacy Devices Supported (V2) : 0 - 8042 Present on ports 60/64 (V2) : 0 + 8042 Present on ports 60/64 (V2) : 1 VGA Not Present (V4) : 0 MSI Not Supported (V4) : 0 PCIe ASPM Not Supported (V4) : 0 CMOS RTC Not Present (V5) : 0 [06Fh 0111 1] Reserved : 00 [070h 0112 4] Flags (decoded below) : 000084A5 WBINVD instruction is operational (V1) : 1 WBINVD flushes all caches (V1) : 0 All CPUs support C1 (V1) : 1 C2 works on MP system (V1) : 0 Control Method Power Button (V1) : 0 Control Method Sleep Button (V1) : 1 RTC wake not in fixed reg space (V1) : 0 RTC can wake system from S4 (V1) : 1 32-bit PM Timer (V1) : 0 Docking Supported (V1) : 0 Signed-off-by: Liav Albani Acked-by: Ani Sinha --- tests/data/acpi/q35/FACP | Bin 244 -> 244 bytes tests/data/acpi/q35/FACP.nosmm | Bin 244 -> 244 bytes tests/data/acpi/q35/FACP.slic | Bin 244 -> 244 bytes tests/data/acpi/q35/FACP.xapic | Bin 244 -> 244 bytes tests/qtest/bios-tables-test-allowed-diff.h | 4 ---- 5 files changed, 4 deletions(-) diff --git a/tests/data/acpi/q35/FACP b/tests/data/acpi/q35/FACP index f6a864cc863c7763f6c09d3814ad184a658fa0a0..a8f6a8961109d01059aceef9f1869cde09a2f10c 100644 GIT binary patch delta 23 ecmeyu_=S X-Patchwork-Id: 12769336 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6D909C433EF for ; Fri, 4 Mar 2022 15:31:48 +0000 (UTC) Received: from localhost ([::1]:34560 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQ9uF-0002Ix-9t for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:31:47 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQ9X8-0004te-I1 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:56 -0500 Received: from [2607:f8b0:4864:20::52d] (port=45891 helo=mail-pg1-x52d.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQ9X7-0003lU-0y for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:07:54 -0500 Received: by mail-pg1-x52d.google.com with SMTP id z4so7728630pgh.12 for ; Fri, 04 Mar 2022 07:07:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anisinha-ca.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ID9ZZRj4P74EuP2MhIWTtzIMoOckfhqbGZm7DoiN+7k=; b=Aq/WNR89gyUfAdLK7+B7lYtRwgkEbQw3dNG7zit7Elzl8Th1AuEvr/8BikiPUsjiw9 ZdTSPhfg0x/uIJ5WstYFcXXicn1k1ChfiEnQjM2PbHd1NbjsSiIAyLe/CMhPpCHdfwXC VHbHA3px/xdxsRuKAPaIgecYX4OuTajgO3SWqS7NqkVtfpBjvXHEYKeSuYy2ZongcAKp iL2bQNBXmshLaVbArIe7Z80xQc8/Mi+dHEAfSRz55B8/FQgi+3zTiwj7OOOAUeLbRXSR SbT5+WczIVi27+GV0HgYh+UgRkeABU1W8tvfAo7eWERJf0Nt+1wSuF2iQ9SVilIx5an+ rklw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ID9ZZRj4P74EuP2MhIWTtzIMoOckfhqbGZm7DoiN+7k=; b=rt/EjMdFtPvgvf389lCNWe8abLgYy0Rlc2juDMfyxuFY6Cld0tF8t8Z8NdXA10tkZ3 PmHysWkCO/peONw7wS2c8WyjKqca7q2Ogp59AOIIp0ilbkNBnjZToKJqfXGTS+JGgbYY 141ueTG71tjhznc5UUYZOgsdEySh86Im28BcxW8/sDc7mpjza6TwYVfBZtK9UH2q0aHC /ZrI6qB6EZspnfo62KQSYqi9fODy5atU0BJAi+b7W+15ebOI4KFkO/0aZ461QwOF2nx0 1juJxP8ETCyISEDRhAkui1VGZh5oemOvb+UUnDPBmhW3n81RqYYQvn3Y3sVAQ7d+0ReX vrLg== X-Gm-Message-State: AOAM530B9jMzyaBKYxv+fPrlhHGibscW2yiN6QLf5ocRJlYf8OsfFr7P v9dohHQee8AJMHFQvIftVvOk5bBS3+CVqg== X-Google-Smtp-Source: ABdhPJx6/e8YhzNpWia0rM9Uoq0gueAMh2yi15W4Lov4ZuxnOfbp62xpgd0be6+vqtUAFMDbAlngKQ== X-Received: by 2002:a05:6a00:2402:b0:4e1:3df2:5373 with SMTP id z2-20020a056a00240200b004e13df25373mr43397287pfh.40.1646406471288; Fri, 04 Mar 2022 07:07:51 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id nr22-20020a17090b241600b001bef1964ec7sm8278861pjb.21.2022.03.04.07.07.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:07:50 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v6 4/4] hw/acpi/microvm: turn on 8042 bit in FADT boot architecture flags if present Date: Fri, 4 Mar 2022 20:37:22 +0530 Message-Id: <20220304150722.2069132-5-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304150722.2069132-1-ani@anisinha.ca> References: <20220304150722.2069132-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::52d (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::52d; envelope-from=ani@anisinha.ca; helo=mail-pg1-x52d.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: Ani Sinha , imammedo@redhat.com, liavalb@gmail.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The second bit of IAPC_BOOT_ARCH in FADT table indicates the presence of keyboard controller implemented as 8042 or equivalent micro controller. This change enables this flag for microvms if such a device exists (for example, when added explicitly from the QEMU commandline). Change 1f810294bb31bf6ac ("hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table") enabled this flag for i386 q35 based machines. The reason for doing the same for micro-vms is to make sure we provide the correct tables to the guest OS uniformly in all cases when an i8042 device is present. When this bit is not enabled, guest OSes has to find other indirect methods to detect the device which we would like to avoid. Signed-off-by: Ani Sinha --- hw/i386/acpi-microvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/i386/acpi-microvm.c b/hw/i386/acpi-microvm.c index 68ca7e7fc2..fb09185cbd 100644 --- a/hw/i386/acpi-microvm.c +++ b/hw/i386/acpi-microvm.c @@ -37,6 +37,7 @@ #include "hw/pci/pcie_host.h" #include "hw/usb/xhci.h" #include "hw/virtio/virtio-mmio.h" +#include "hw/input/i8042.h" #include "acpi-common.h" #include "acpi-microvm.h" @@ -187,6 +188,11 @@ static void acpi_build_microvm(AcpiBuildTables *tables, .address = GED_MMIO_BASE_REGS + ACPI_GED_REG_RESET, }, .reset_val = ACPI_GED_RESET_VALUE, + /* + * ACPI v2, Table 5-10 - Fixed ACPI Description Table Boot Architecture + * Flags, bit offset 1 - 8042. + */ + .iapc_boot_arch = iapc_boot_arch_8042(), }; table_offsets = g_array_new(false, true /* clear */,