From patchwork Fri Mar 4 15:40:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769358 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 4ACA3C433F5 for ; Fri, 4 Mar 2022 15:45:49 +0000 (UTC) Received: from localhost ([::1]:45794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQA7o-0004NJ-4z for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:45:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60698) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQA30-0003wx-JT for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:51 -0500 Received: from [2607:f8b0:4864:20::62e] (port=45949 helo=mail-pl1-x62e.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQA2z-00084I-99 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:50 -0500 Received: by mail-pl1-x62e.google.com with SMTP id s1so8037527plg.12 for ; Fri, 04 Mar 2022 07:40:47 -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=xmQXtTC1D8YZukvU/3lM8dtfMest9d5YMBYQNwxDmXqwGpo38YWE48OEe51I7hb9++ q6KL2Mp7OE/Q/v0pDJ2qPSux0iHWhfY1dKHiT1B/etfgfM7ClAC/uWv0Ynzjjgp1pqq/ JBH9eUh4GriLcK/mlxLXLMxQKOvZqobWSSMXVMThgqhQLtZfiN5t+bf73Yi2MquFYihB vYNBhcfrVNm1GRisRHHfNlkOllKXRKHrbgPC/VEC9JmBXq5XWm50OGBFtWIZJb1ibRXk nOLa7QU1MWh8GSci2wcI40qj84mWfVAsVxwcUGDs53hegKoQ17f3KyI8pLR/97cLvd8X qYSw== 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=PLT60h4fUAKJBdXlqJ5PGSrzTA4Ak/0RpfF01zuDZ/s0F8SYxMwfLhYDUdAC4rznH3 5VqCwrF5tSKBJh7bHePKMgdIMNGIsZK7tnhPS9xGarxUhH6D63DocrrhD/zY0jKr3k3D yiCGuu9ckhu+7/woz+Py1jWmEmM5cEEkkHmBdOIWN+MF+UPVHuEur3cMXsCDJ+ELqadM 94oOsa9TKz5YMNd+YysU/flTEa92F0f0BsWgDuMMcoT5QmXmBhUz7KB8FS6x3nKaM2ED CPEwvHk8qS2TJ0OdgCueJZGJTg+iflQb89BZUJ57vcamuUS9U/k7HDW/oE8GvYLj/jf/ RC1g== X-Gm-Message-State: AOAM532u1Hotf+EC0EmK7AcKwnGd2udE7EWJu5wn08ptEenR/0h6Obt/ fCs4Gp+Y7aL/CgFkhHd7tZSQlx6Vp678wQ== X-Google-Smtp-Source: ABdhPJycj7NsxQoIdRsQshuAdrj+fZCWD3MxPSY+kN9K76ArBFiSpExO8CnrBDH8K6PXbpMyAedr+Q== X-Received: by 2002:a17:902:8a85:b0:151:b3c6:87f8 with SMTP id p5-20020a1709028a8500b00151b3c687f8mr6525312plo.129.1646408446606; Fri, 04 Mar 2022 07:40:46 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id ck20-20020a17090afe1400b001bd0494a4e7sm5448366pjb.16.2022.03.04.07.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:40:46 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v7 1/4] tests/acpi: i386: allow FACP acpi table changes Date: Fri, 4 Mar 2022 21:10:29 +0530 Message-Id: <20220304154032.2071585-2-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304154032.2071585-1-ani@anisinha.ca> References: <20220304154032.2071585-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62e (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::62e; envelope-from=ani@anisinha.ca; helo=mail-pl1-x62e.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:40:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769360 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 71803C433EF for ; Fri, 4 Mar 2022 15:47:59 +0000 (UTC) Received: from localhost ([::1]:54428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQA9u-0001vy-Jb for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:47:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQA34-0003yJ-J1 for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:55 -0500 Received: from [2607:f8b0:4864:20::532] (port=43553 helo=mail-pg1-x532.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQA32-00084z-9U for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:54 -0500 Received: by mail-pg1-x532.google.com with SMTP id 27so7808195pgk.10 for ; Fri, 04 Mar 2022 07:40:51 -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=sGIFQsTVcpSNbU2XIIqMTeq9b/UUx7DW84vJyVg1osg=; b=GFsNk28baYWp8zPisvEqUn39ITl7pzlAAFRncdg0OfHvwdj29Lt3Ait75kIyVgF1Bc /abl2rtn4lQT4O1feLfBO7Jtrx5IfopZjshvdFENG43AgPf3CayeU+O80/LFAmdiW0Vk 87BvQxQf0atbdV2NlcBVwuUj2cHmgP7SV1SyP4RON8hJLk13/qKKfp1AwPNTF0BAiOGi BxgRQwIFQY7AauCY1E2sA9qnnwgEVFoUnvNv8M5KSHTZa45f2qbaBYYydCs7hEe6V2lT Uoo/I7lYv6za/fjNR4Rb6ZFI00jDeKzsuGEVw6IubnYAd6xG3N1VxGU0Wum5R6qJhurx a4NA== 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=sGIFQsTVcpSNbU2XIIqMTeq9b/UUx7DW84vJyVg1osg=; b=dlQhBoGVF2lgdwWIq3KPo2Vd5DlK983jlvm17MnTGcIkQRskFkPJf1YkNwiXM8V4jw GJAfXodrhj3jz/9UzeRodyASDU5pI7+tJekrI8UKIt2je50p8NQbn9qiM2PULeUB+I3M SHz7wT0eVkj/rD9NFnEBg2B2fvvw5pK522qTVBc/va0g9wNtg3uIZP4EWLUYmD6qjK5u 3Xz9xqoPpPaCqBcBwbgANoF1S8SRFGP97xDaZFd+br4QFi7HFgWYJTcweRFYJeIpgN32 vXeVdTy/d2cQM/tJRIZsPYaNpqBpabSESeZMoATVKLx+UhJYc6r2PV9aBb/uFMLy+79Z cGKg== X-Gm-Message-State: AOAM530iD9m/lmzxEouuQ18jzQzPOlC8/7b1lt5x8uAwNN3Wl/yF+pBz RjfPlQVu2Pkayd7iFSCjRCc9Y5WloiAFBg== X-Google-Smtp-Source: ABdhPJxVSS/giDZ/k9dIO8xscYqIUv/UdSLz0h/13Qkt4G0LVcIw833ZnGqQllKelvFDUPiy8HzAKQ== X-Received: by 2002:aa7:8432:0:b0:4f6:6dcd:4f19 with SMTP id q18-20020aa78432000000b004f66dcd4f19mr8907124pfn.53.1646408450308; Fri, 04 Mar 2022 07:40:50 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id ck20-20020a17090afe1400b001bd0494a4e7sm5448366pjb.16.2022.03.04.07.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:40:49 -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 v7 2/4] hw/acpi: add indication for i8042 in IA-PC boot flags of the FADT table Date: Fri, 4 Mar 2022 21:10:30 +0530 Message-Id: <20220304154032.2071585-3-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304154032.2071585-1-ani@anisinha.ca> References: <20220304154032.2071585-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::532 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::532; envelope-from=ani@anisinha.ca; helo=mail-pg1-x532.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..e070f546e4 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 uint16_t iapc_boot_arch_8042(void) +{ + return i8042_present() ? 0x1 << 1 : 0x0 ; +} + #endif /* HW_INPUT_I8042_H */ From patchwork Fri Mar 4 15:40:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ani Sinha X-Patchwork-Id: 12769361 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 D96EBC433EF for ; Fri, 4 Mar 2022 15:48:33 +0000 (UTC) Received: from localhost ([::1]:55614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQAAS-0002jb-N7 for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:48:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60730) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQA36-0003zW-MC for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:57 -0500 Received: from [2607:f8b0:4864:20::536] (port=34378 helo=mail-pg1-x536.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQA35-000859-2L for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:40:56 -0500 Received: by mail-pg1-x536.google.com with SMTP id t187so3553207pgb.1 for ; Fri, 04 Mar 2022 07:40:54 -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=yIblgX8+Z9Fm0+lQIK4zT8Lms7btEZ0AR3towVlA8TRKqOTYih/C/zSO5yHh0zK90s TQJzembsEFO2Wiwf0ZPB/hEs+oXbBey5cgNnFJRBeotZJvYv1HxexfruD/HnfhufgVxQ 8jBnMP948Hkb4AO/YV1jUj/vnaRXbafC1epPuyuM56ew3u+fiXmdodhqlUSuA4R8hbVR M3/e+D6E0EUj2WTnovKxURgo3Z+sQ0HpWBB6qXAFFlUmrvhvWlDMi0BsReskMoO6xqhK OwTHqXVl/JdAv88vvpLOGbjxe6crll9JgGc/01T9xvezFXV4ucuJYUnfkFFo1TYcl8kc UZVw== 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=e7NJ71k8A3SG14rXRjOzQBaIlfglpyrRhynTLpKQpm0T3riEn1ebgzwDKldYfvXiyA uUropzx23FBXf0PJaMkcQRPVKBWdHlcAgfc6H6kmrbnPbSQPPBX+IcWv/XMB/Tuei905 Fyea4AOatIGl1ZV3xXo7ETPZp6UKE/FqLOVad0KduqWSaSFlDewmZkMRvNuZX6M3ZY91 sdlPCP3i1nIwMu+z7JKoML11+OZmxj/gs1CiLpG8EqHub/GveBhMoiPE9nMMahvrulgT CZkPBqlFucQ2ScZJlxbJ1gxoizs5l44fNlYc5s4ze3qY5SU8cwuroZBEFm5RO7AtvPGf 4JQQ== X-Gm-Message-State: AOAM533dM1Lx8XWcpWPXiPqjwkAI6nJ7cz3vTrzpnLwuy5IyGxyw5sL1 h70vl2O6lFvIF+5A5JpCDK0ARnzpFDdc7w== X-Google-Smtp-Source: ABdhPJys9wfDdg6cs8Ezb2hTxYJ/9kWJcEBgi1mhKZtusshEX60BajTzfD0dtopOzmW+Lc0qn7lW7w== X-Received: by 2002:a63:6c8a:0:b0:37c:62da:a647 with SMTP id h132-20020a636c8a000000b0037c62daa647mr5661166pgc.423.1646408453033; Fri, 04 Mar 2022 07:40:53 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id ck20-20020a17090afe1400b001bd0494a4e7sm5448366pjb.16.2022.03.04.07.40.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:40:52 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Igor Mammedov , Ani Sinha Subject: [PATCH v7 3/4] tests/acpi: i386: update FACP table differences Date: Fri, 4 Mar 2022 21:10:31 +0530 Message-Id: <20220304154032.2071585-4-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304154032.2071585-1-ani@anisinha.ca> References: <20220304154032.2071585-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::536 (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::536; envelope-from=ani@anisinha.ca; helo=mail-pg1-x536.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: 12769368 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 ADE64C433F5 for ; Fri, 4 Mar 2022 15:56:32 +0000 (UTC) Received: from localhost ([::1]:47892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQAIB-0000Bv-MH for qemu-devel@archiver.kernel.org; Fri, 04 Mar 2022 10:56:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60774) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQA3C-000458-Aq for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:41:02 -0500 Received: from [2607:f8b0:4864:20::62b] (port=45947 helo=mail-pl1-x62b.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQA39-00085U-1v for qemu-devel@nongnu.org; Fri, 04 Mar 2022 10:41:02 -0500 Received: by mail-pl1-x62b.google.com with SMTP id s1so8037955plg.12 for ; Fri, 04 Mar 2022 07:40:58 -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=fIdHbE6ykIml5KAjQxjqLsHwkFzYo1FQ7reN0RwOBhM=; b=gC5Ze8gzzfieB9TKDHhteYpwHCw+z2CtjW9sIU+e7Pb0N9N2dcV1wOuGPQylPTug5y Lr4ajH/aldnUg8YyU9w9NSIKbhwE4XrQGQZE1FrtEjhGnME7oD4sRSX9SOBDHBoAcbcI 4JKHqfnACIXNlDEKJbLAQs4PGWxZiLCeSf77JfmtKXfvzoV2zFsJm6rkNGZJeVGn9Evs I1I2ITnJ+uOowIkMTgaWcKIEVfC6OGQCPzCgEtVzFPKeFnsTkiJ77os9EhSc7AvLK8Fv HtH6em1FCpAh6oEs+BV5ToyGhjPIrB6Ebgfey8Uuh6baTO2FuC3xRMhKTymSqqZYQVDb sLZA== 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=fIdHbE6ykIml5KAjQxjqLsHwkFzYo1FQ7reN0RwOBhM=; b=aSApmyh5pFnTRb36FTbyywF/Lm/ZA22eg3JXoBjwG21mYAGft8u0TVTaaMJGyyPxDy LD/m7Yy8jYjVjk8Q9eweD7vD/9rPsLJin8YGVVNGnJ/rXMs3zm87dbvQVVsGDUU9djJq WoSNiKTGi0ffOBJUkBvv4Px+7XJ6kv2jhnLnGA60ZgjDr3W+u/kyhxbOaPDswErspgM9 Pzd2o/lbmQHlwqAEp9lDX5I9Nku57k9PZGhcVI6SgnbzyF1AkrXV92odPHKx7obhen39 BuKyb6YFkCW0uS0dRDjNznlduOqDCXp1s9ZsSLr9pvy0dvT9T5rYtZO2jjd27sPjFCwJ cyQw== X-Gm-Message-State: AOAM530+3gkm/BG7LPS9DbxT0jwTTxz5SdvRqZS1fPu2qnNiWy+Mdigi rff+N5mVG9shLF7VzfHRQ4Ge/dhIpuk92g== X-Google-Smtp-Source: ABdhPJw2fi+nf7cKtcrst9WCFFwKB9m5YS/Yz8QyWp73ja/Sq43gFulVrDidczRrrxblEmrELihCGw== X-Received: by 2002:a17:902:bb02:b0:151:56a8:f80b with SMTP id im2-20020a170902bb0200b0015156a8f80bmr29929396plb.30.1646408456854; Fri, 04 Mar 2022 07:40:56 -0800 (PST) Received: from anisinha-lenovo.ba.nuagenetworks.net ([115.96.152.50]) by smtp.googlemail.com with ESMTPSA id ck20-20020a17090afe1400b001bd0494a4e7sm5448366pjb.16.2022.03.04.07.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 07:40:56 -0800 (PST) From: Ani Sinha To: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH v7 4/4] hw/acpi/microvm: turn on 8042 bit in FADT boot architecture flags if present Date: Fri, 4 Mar 2022 21:10:32 +0530 Message-Id: <20220304154032.2071585-5-ani@anisinha.ca> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304154032.2071585-1-ani@anisinha.ca> References: <20220304154032.2071585-1-ani@anisinha.ca> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::62b (failed) Received-SPF: none client-ip=2607:f8b0:4864:20::62b; envelope-from=ani@anisinha.ca; helo=mail-pl1-x62b.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 654701e292d98b308b0 ("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 */,