From patchwork Tue Mar 5 13:42:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 778025 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp440491wrs; Tue, 5 Mar 2024 05:48:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEQVxlYIVUVcLmjrqpR9sky0exSgTPLYiCy2Th3wtx55JO8gJ55869SnF9cAq90Us8mKTjlQTralcvudcTFKdp X-Google-Smtp-Source: AGHT+IH5Ixd+Ch5S5BPdW1Xe4w/B9FbKmfC5IfBgwQno1FdnfJq098DfxjUZAtnpRW+6scx1G28A X-Received: by 2002:a05:6358:8a0:b0:17b:f03e:2bfa with SMTP id m32-20020a05635808a000b0017bf03e2bfamr1648743rwj.21.1709646513521; Tue, 05 Mar 2024 05:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709646513; cv=none; d=google.com; s=arc-20160816; b=AwsgqyKp2KKpf6fUkP725LVZyNQUNgHsBeAj/srHJuBxFMinJCG0p1dqs2ChtxNwdq zezEOvxRHHRE4yDQPbRhip2fWc7YzlJZ7eXcJPicF7wEoEBNXCHeUJ9J7/7FXP+OzYTd ciivQvKhv+7w8+zX8eNCtdZA+AIzI7RmXFC4VPtj71fxzZyObExwL1RMrzNZGaGPEx01 Mr/Ic+eTnzupthgJpCAHM4KmaAaYLq+U2eBv3gys86Bhriqk7mYKdcGnpNy8c3YU90Qj PBI2m+SrV+03d0XHv8Fd3jQkp2N3P8UV3I6TfI28kSfXcKrYsCYkKCQpmO9fgIVrjnzz uTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FzQHy7YOOPXp7F0gjrTW5/+w7YXN5elr0MFrrc4cC28=; fh=lA6yvtwEvDsoPmbdvRiSkKi1PbIkmvp3T23nqm+dAas=; b=FNCjLn0Zq6/VcU51S+qMIGW5Dw4MpsgtFMgKT3z1h529FPwlisNaBNYT3beJibWuP7 rcTYEx3Zas1TbrfwAyLgRmHlSxAiH/ziKTp+D7lU10p9m2Wi1DjpEb4L3z+YHFaVnTUp r94avoc1CdU3St+ENAJgQNo4kZF+4lVPaioU8SQolhm5gqog91Hz0zXBx44lz67OZ9Gw poRmLc52qVbThhCXdH3zGnCHKECBMJ+y4DyWHIRZY+j9HRxwbaUpMisy9QOonkbZclFv 9pJoeA0ojMJO+4COW/Yuq+yLRSj7XICd1Jwxi4yytrl9LwNC3Stbrz5hxflU4VtgXjmx 0KiA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czTuksCW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id h27-20020a05620a10bb00b00787c781083asi7635796qkk.48.2024.03.05.05.48.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2024 05:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=czTuksCW; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhV7M-0005xU-S4; Tue, 05 Mar 2024 08:46:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhV5U-00042C-9C for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:44:15 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhV5S-0004DT-2W for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:44:07 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-33e383546c1so1120806f8f.2 for ; Tue, 05 Mar 2024 05:44:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709646243; x=1710251043; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FzQHy7YOOPXp7F0gjrTW5/+w7YXN5elr0MFrrc4cC28=; b=czTuksCWPuPMJbLBSlnWvjaiX4isNQhxrdXa2RXMGy+AFLrXUVNex8VAKNV3/tq00P htXUsw/hT8t+t/K0TX/h6GN5VTzcBBKyFPGwmRwe+qhLZJlyp3zNIuIhLtoNYv/CHJep 3ZBkpmVoXMBNvBKEUMUAd2CmMIa+TyGVfhKHOEhaJyn/XY+7sTvhIE6+M6y7k/nNPxuF JMVBehLIS2shEwRX49KjgEQM/5OiVEVwqmdAZqj4RHNv/l/kjhBGTptTCGw8I7t7Vmpy rzYs8rSNKvfROnMFEPGpsQCEKYwvLAv7dz4yZcOyqUBdndfTPK44awCVEi/bLEuMjfa0 hjiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709646243; x=1710251043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FzQHy7YOOPXp7F0gjrTW5/+w7YXN5elr0MFrrc4cC28=; b=ZSuPeqkF0Byu9+6eVSWPStS0w9jtGCTZcx1+I01bFSePwBwt8sKsVJMKVUWhT9BBgo oPt4xRZdTf2QGxCnlE3gRAGF5iokrcC0tSKHn4ouC+6f03dqNbFJZBN1DQpkdlZRCisK fhDarn/8i9w2/CmW4BwW9dUF5sawbmrAxorzUbZbsatTcYlqX8/gtK5tyjFCIw+dH6tE tXhYh4kdlCf6bLmJPxvjoMu7fM4QbghKSyKELpAUxfYp+b15mYbcIBqKMUyN0KAC93Rm z3IwfL8uAwamidv4bPfJu0e2/kdotGvhqw4TeTbMnxrBDsDuMTTtgflqhLEs3Ck6Tpu7 yldA== X-Gm-Message-State: AOJu0YxSPrzdll3riyqRiFAK9RMvMoctpoU26Mk/SVKfx0zmzDiF//wf gnVL9lTZ2i5LSEtu1ATxoen1SYbPPXkCuR5mEE34FxO6pdtbBLrzF8+v2Lguft8ZbbrLonsBBiI j X-Received: by 2002:a5d:6e48:0:b0:33d:6c9f:39d6 with SMTP id j8-20020a5d6e48000000b0033d6c9f39d6mr8913204wrz.40.1709646243280; Tue, 05 Mar 2024 05:44:03 -0800 (PST) Received: from m1x-phil.lan ([176.176.177.70]) by smtp.gmail.com with ESMTPSA id f6-20020a5d6646000000b0033e34982311sm6992738wrw.81.2024.03.05.05.44.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Mar 2024 05:44:02 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: Igor Mammedov , Richard Henderson , kvm@vger.kernel.org, Marcelo Tosatti , devel@lists.libvirt.org, David Hildenbrand , Ani Sinha , Paolo Bonzini , Marcel Apfelbaum , "Michael S. Tsirkin" , Gerd Hoffmann , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Eduardo Habkost Subject: [PATCH-for-9.1 14/18] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram Date: Tue, 5 Mar 2024 14:42:16 +0100 Message-ID: <20240305134221.30924-15-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240305134221.30924-1-philmd@linaro.org> References: <20240305134221.30924-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org PCMachineClass::rsdp_in_ram was only used by the pc-i440fx-2.2 machine, which got removed. It is now always true. Remove it, simplifying acpi_setup(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth --- include/hw/i386/pc.h | 1 - hw/i386/acpi-build.c | 35 ++++------------------------------- hw/i386/pc.c | 1 - 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index be3a58c972..b4a9ea46a3 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -100,7 +100,6 @@ struct PCMachineClass { /* ACPI compat: */ bool has_acpi_build; - bool rsdp_in_ram; unsigned acpi_data_size; int pci_root_uid; diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index a56ac8dc90..12bc2b7d54 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2492,7 +2492,6 @@ static void acpi_build(AcpiBuildTables *tables, MachineState *machine) { PCMachineState *pcms = PC_MACHINE(machine); - PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = X86_MACHINE(machine); DeviceState *iommu = pcms->iommu; GArray *table_offsets; @@ -2664,16 +2663,6 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) .rsdt_tbl_offset = &rsdt, }; build_rsdp(tables->rsdp, tables->linker, &rsdp_data); - if (!pcmc->rsdp_in_ram) { - /* We used to allocate some extra space for RSDP revision 2 but - * only used the RSDP revision 0 space. The extra bytes were - * zeroed out and not used. - * Here we continue wasting those extra 16 bytes to make sure we - * don't break migration for machine types 2.2 and older due to - * RSDP blob size mismatch. - */ - build_append_int_noprefix(tables->rsdp, 0, 16); - } } /* We'll expose it all to Guest so we want to reduce @@ -2755,7 +2744,6 @@ static const VMStateDescription vmstate_acpi_build = { void acpi_setup(void) { PCMachineState *pcms = PC_MACHINE(qdev_get_machine()); - PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); X86MachineState *x86ms = X86_MACHINE(pcms); AcpiBuildTables tables; AcpiBuildState *build_state; @@ -2817,25 +2805,10 @@ void acpi_setup(void) tables.vmgenid); } - if (!pcmc->rsdp_in_ram) { - /* - * Keep for compatibility with old machine types. - * Though RSDP is small, its contents isn't immutable, so - * we'll update it along with the rest of tables on guest access. - */ - uint32_t rsdp_size = acpi_data_len(tables.rsdp); - - build_state->rsdp = g_memdup(tables.rsdp->data, rsdp_size); - fw_cfg_add_file_callback(x86ms->fw_cfg, ACPI_BUILD_RSDP_FILE, - acpi_build_update, NULL, build_state, - build_state->rsdp, rsdp_size, true); - build_state->rsdp_mr = NULL; - } else { - build_state->rsdp = NULL; - build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update, - build_state, tables.rsdp, - ACPI_BUILD_RSDP_FILE); - } + build_state->rsdp = NULL; + build_state->rsdp_mr = acpi_add_rom_blob(acpi_build_update, + build_state, tables.rsdp, + ACPI_BUILD_RSDP_FILE); qemu_register_reset(acpi_build_reset, build_state); acpi_build_reset(build_state); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 8139cd4a7d..7f41895d97 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1758,7 +1758,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->pci_enabled = true; pcmc->has_acpi_build = true; - pcmc->rsdp_in_ram = true; pcmc->smbios_defaults = true; pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true;