From patchwork Tue Jun 18 15:59:40 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: 13702568 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 82D79C2BA18 for ; Tue, 18 Jun 2024 16:04:56 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJbIH-00065E-5c; Tue, 18 Jun 2024 12:02:51 -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 1sJbI0-0005cb-B0 for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:02:34 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJbHy-0006yi-Km for qemu-devel@nongnu.org; Tue, 18 Jun 2024 12:02:32 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-57a44c2ce80so6727664a12.0 for ; Tue, 18 Jun 2024 09:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718726549; x=1719331349; 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=CNrfF+9zyhqG7px96ZTTBVocmseyNqId2IhLUn86KlM=; b=E42MexKaj0uqBcecbpBBt+TPukBqnAmatAvaWFZFl99tb6wV5JGNUWqbuI3kt7O2Fe znFnAbuSdTiWrOM9zmc0mWxbQvHoVERu/XgKIG/8qns5zR1tnGzhAhbeTlwCzpfe71UJ f1ZBbUthNLqmIFIaWs7ODNxzfN4RWddZh5TbMbU1PSNTD/OJUF1nsD/8gWinfY47LkPz +rsMLHCPKkB3euCRnJV2DGoVIZ6iA9akIWDTm396FfyvOH2eiSl3UUl8ChYbV+OMAbqR VegckJUglxDIZKdbmvfDgWE7KlXShhFq3wPF34txVo4wcK0BAyGdHI6oDIRa3/Uk1ho9 qOKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718726549; x=1719331349; 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=CNrfF+9zyhqG7px96ZTTBVocmseyNqId2IhLUn86KlM=; b=OJrRGJlZdD5CE1eBoPooXyTizTqdxacFznNb0DjyjZRBOG8mlehhkkPHw64jO3gneR Yz/WXZQ6R4blFfuVkGtLUZnY8ueey9s5tLQurW5sMMbWxXDAgLipDbI0YaXu6Shb/HuC Ex1sc4/WHkfWhEyU837GoIe5aqVmZI36j1bRdV4wUwKlN9quaaV8KMa+gYKTTV2hMLke amIJxB0lOpuuIIoviKNMot5gskcNvA/vy+8sDE6biXVrYZLO70SqtzFv6BWRZXkPMr3h mpsutK4g0pkD/xitTipHt4WuQJcZCyA2oBv5uwix0vFjXH7TjerOS4F95TNau6kpgm93 zG0Q== X-Gm-Message-State: AOJu0Yy1zK5kNP1LBm34GcWHb2InQKFWlZzuJx5C10mzxlxP4Mg7eoag wx6An+Ubjm0z6VvcFVilPbvGvMGossEo7iMcte33aBJOeTK07Si9Fm7uDPn1KJ8F4KmGanAv/WJ / X-Google-Smtp-Source: AGHT+IFIzDA5tfjiF/bVIXS6gjimHOqPBprk8wn7sxmBTLAJqIPNEy9DifTVSgndNk0SBQIH0115zg== X-Received: by 2002:a50:cd09:0:b0:57c:947c:f9cf with SMTP id 4fb4d7f45d1cf-57cbd6839b8mr8609721a12.11.1718726548977; Tue, 18 Jun 2024 09:02:28 -0700 (PDT) Received: from m1x-phil.lan ([176.187.212.55]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72e9dd7sm7821785a12.57.2024.06.18.09.02.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 18 Jun 2024 09:02:28 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Thomas Huth , Zhao Liu , Igor Mammedov Subject: [PULL 18/76] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram Date: Tue, 18 Jun 2024 17:59:40 +0200 Message-ID: <20240618160039.36108-19-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240618160039.36108-1-philmd@linaro.org> References: <20240618160039.36108-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52d; envelope-from=philmd@linaro.org; helo=mail-ed1-x52d.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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 Reviewed-by: Igor Mammedov Message-Id: <20240617071118.60464-19-philmd@linaro.org> --- 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 d01ddc4618..0b7a18a882 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 eafc3761c8..158e74f64a 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2494,7 +2494,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; @@ -2666,16 +2665,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 @@ -2754,7 +2743,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; @@ -2816,25 +2804,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 a6d50df500..b0fc8686d8 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1763,7 +1763,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;