From patchwork Tue Apr 16 18:59:34 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: 1924392 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=uqo1AA4M; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJtjM56Xtz1yZC for ; Wed, 17 Apr 2024 05:03:19 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rwo4G-0003it-Qs; Tue, 16 Apr 2024 15:02:08 -0400 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 1rwo3u-0002Vw-Ti for qemu-ppc@nongnu.org; Tue, 16 Apr 2024 15:01:52 -0400 Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rwo3r-0005r0-2w for qemu-ppc@nongnu.org; Tue, 16 Apr 2024 15:01:45 -0400 Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-563cb3ba9daso4833824a12.3 for ; Tue, 16 Apr 2024 12:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713294101; x=1713898901; 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=M+KMTbrbI+PCZ7l2nXt22iBk719lD5OjaX/6s+DU33I=; b=uqo1AA4MdYaITEMhKzBuWX8qibui/rIMAGFD0NpeE2JTo0xa+AHzQkmlTimFPfD4ja VsiWJ/y2gBfD3PSInTWel+VIFUmtMSdoNsTcFCHiAlUNbr+ow3xdTXXtr7+5NZI+CCer /QvxqKIUwuhnZbRknddldKrK+Iwen+LTRJSm8UjwcVLmvAvAdHlkHvTDh+dfnMu1isch bU/Q0TyzQsARe8O8EFWOHz/Y/Qxq3ocnvXaKkdU1l7r0R3J9fDOgNmfv1ttjjOXFVg6i KA8JM8lTzKWZ7s0+bxhIqMbB0Mo9bSYyPvUXnHFtLFfWo//04X/STlertdgH4cDIOOX7 BZ1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713294101; x=1713898901; 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=M+KMTbrbI+PCZ7l2nXt22iBk719lD5OjaX/6s+DU33I=; b=wZ99N6TvV7Sn7uPr+ztE72Ym7GPEVAIFvEEOgLJ8rP1KX2PE5zLz/tQsIZd2KtxM5Z zZKQZhehx5in6CPOjEMZP/3r5VvTIW6U6Gadhw1ghG3FIoCmhMf7EUbWsrf4+ywNHEQK 3tozQO4BMn6MnXyGNERTzNGXAMzLMjuQrRh4/6IhgZ3ZAPfBV9XBkGHuNlAXqZvzc1Zd IYbFvmLo6WHbdD6Y1Ls0m3b+8HI2i2CjKDyr0xklmsIlqhTWZwettTjvPzAE2HIdZC5A o/KTJKglASoVQnAG8bSTyMQkLgdM5a1ZJgBS3VKJpWSnC/Ciwf9WRpaGi8i6ZBP7tEzT /QIA== X-Forwarded-Encrypted: i=1; AJvYcCWaNoqiO/taL+xRYpdKLh5+yO0wvpbxxJDNrcE5vc7ptOqj7dA65hCipmFOJm1V0MPJNRMK45cHmWT2TO2X2umnBXlw X-Gm-Message-State: AOJu0YzBUvxv46RLs+b1YMx6aRAIxoPXhnmQEloH+9KFpAQh5pC20Gwm pZpyBRjULvCUugiNFd9terWa5dyUnghj9u7FC0mdkikVu8mS/c9fJKwKF351mFqj5jw4iaKWQS0 G X-Google-Smtp-Source: AGHT+IHCXF2xNmCPdhDPQJn9LboRzz1geLxNJeviZck2aQ1GPeqJoFoTjUbGAbA50RPwfi6/KvckbA== X-Received: by 2002:a17:907:72c9:b0:a52:53f3:af3c with SMTP id du9-20020a17090772c900b00a5253f3af3cmr8756708ejc.10.1713294101517; Tue, 16 Apr 2024 12:01:41 -0700 (PDT) Received: from m1x-phil.lan ([176.176.155.61]) by smtp.gmail.com with ESMTPSA id cw4-20020a170906c78400b00a4e58c74c9fsm7141780ejb.6.2024.04.16.12.01.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 16 Apr 2024 12:01:41 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org, Thomas Huth Cc: "Michael S. Tsirkin" , qemu-riscv@nongnu.org, David Hildenbrand , Igor Mammedov , kvm@vger.kernel.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org, Paolo Bonzini , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Zhao Liu , Ani Sinha , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost Subject: [PATCH v4 18/22] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram Date: Tue, 16 Apr 2024 20:59:34 +0200 Message-ID: <20240416185939.37984-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240416185939.37984-1-philmd@linaro.org> References: <20240416185939.37984-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=philmd@linaro.org; helo=mail-ed1-x534.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 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@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-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.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 Reviewed-by: Zhao Liu --- 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 10a8ffa0de..96ccb4583f 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 ab2d4d8dcb..ed0adb0e82 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2495,7 +2495,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; @@ -2667,16 +2666,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 c4a7885a3b..a1b0e94523 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1745,7 +1745,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;