From patchwork Wed Mar 27 09:51:19 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: 783119 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2108273wrt; Wed, 27 Mar 2024 02:56:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXBQo4y117ReKbhcsubREYwL5Lrgu38uiOW1w/RA3JQMkDflwYru/ZIYk1iNyRUROapRRk0jAA0nWknksjS/Nh1 X-Google-Smtp-Source: AGHT+IEG10JwAm43aFTswgdrrVotkZfOUnxzpCvtrBstEWPwx28IeuXAIANkZH8cC/Zl1smHVSNi X-Received: by 2002:a67:bd18:0:b0:474:d253:e22a with SMTP id y24-20020a67bd18000000b00474d253e22amr542852vsq.17.1711533393627; Wed, 27 Mar 2024 02:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1711533393; cv=none; d=google.com; s=arc-20160816; b=At4wVzuBoCSOECCk83H8W6/I7Iji0KtI+7tpg0r6VdAiPBw41+wecGM8PF3U/O31rZ 1zI82fZHO3ZG3e+0TbjKgvaA+bSO7ZJxJneCHxmAF5SAinvyWsjuMdeWaFW/JldjjZ4G GX9vFMmgeJDFgbDucbBW+sm4B0CqfFtWYFdbhBoi6XSjiylv8BlaNox26MQoyOzZboNG cczTRI4u9bzdHePATdld41WrGOY1bU7D9QJNqhKHcEuo7fcii/ZcwIbJPRdbIDrdY9vV a5uJiAQXaPKixwk4Ok5GBJhJE+J53xp2ZXR9X3BGPfkvhF1vBHE3/Uvo8VdkeNCMewa4 kdGw== 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=a9YyCBxYzMkp1yNP+M5yr8Vyps4aSvadseHcyYHmLOk=; fh=5LSfKs6tcq/4bEwKDri+gRlqMNuZ+BfHiyRqOOf/NhQ=; b=CwuQLdyvgiAyLi9PGdzJ4kxCxcUwroqmi3o13Z7F/DamqquHEd4xPtM9HLZed/VMgg hxQ5aspGvMdl0DfnW7NhgsnxLHJZQE7DqH3h2HHlUSef7JUqLLtyO+FttbMJ3yRwwKmI A5XEUKf4R2z39hvmEwGpQXaln/6ydbOzSNSypCt19FEJKWjeVvtaIHs6BT/+nLU4tYkm 1a4kBjOzRDvQkjUZdDJ3++U1xoLWRwwX0uovqkpL4lp7oCFwH9jXe88zVvnoRRyMEMAV hMb7/rPkL/Z1t3oaUHFtitGjUQz6FOOtyXasxKG7FFbnOS9J0ZSYkRnARThxkG8fFqBk sfaw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WNGsAH5g; 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 z22-20020a05620a261600b0078a52f0d116si8133339qko.148.2024.03.27.02.56.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Mar 2024 02:56:33 -0700 (PDT) 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=WNGsAH5g; 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 1rpPyB-0006Z4-5b; Wed, 27 Mar 2024 05:53:19 -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 1rpPy8-0006GA-HU for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:53:17 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rpPy6-0006zA-QS for qemu-devel@nongnu.org; Wed, 27 Mar 2024 05:53:16 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a466fc8fcccso829662566b.1 for ; Wed, 27 Mar 2024 02:53:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711533193; x=1712137993; 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=a9YyCBxYzMkp1yNP+M5yr8Vyps4aSvadseHcyYHmLOk=; b=WNGsAH5gAgOSJ3fdKIA3PMmaUybln0NxS7/xabJ63WwF2+NWhmTe4X0YEoEBbroZy3 C7jWXy6Bj8Re7DRbTZeY/ugY25Yw8u0eLVCEDgcvMd0LORKTYFeH6/7xeDHurrfRgsFT dWPqVAIOYVOMS8rRaeGuy3k+oAsuzYgqmKR2ymfldIzS2xiKzizDrEXX9UV9q0yU+IlB Wr5tTOTpYhhdnszE2A11eE6A9gCRWHMecwFYWEtN10M+VOfQeawi3p78j9HPlHXP9csN jnm4yhQA8M5oB5dcg8AnkLP9hnzet+CMJZOyFOFN3/VeV4eNcsStKFeRgRoSKyQASSlv RDVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711533193; x=1712137993; 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=a9YyCBxYzMkp1yNP+M5yr8Vyps4aSvadseHcyYHmLOk=; b=oAnjSFOrBSyi0fD4ugxat55IusJzzw5Oq3+sL0nYYNp5gG5p2lQrQt1HmSZvWOxKCY GZGvW0Qx+B2rQjeui4MrnxkETuclT5t4001qb+5GMxKpK9SnHjiRHgOXh+og+cRs4WS0 nhsYfF13rKGGkSECtF8RsSguhHoDJX+pYr2M816Vv+83RN768xaLOQ71hQlug7hkIu6l v3q77EEFruO/u+rcCtXNAmvITVlbptHOENsJsOGNJMLJEQByGhBlzHTQBSGrNBwfuZuT RYXL7d6ihseqyjN74LuwW7LNq77ACRkB+Kmddsq9j6iqoTZjge9zeavY2mNLTbAaqIyV ibog== X-Forwarded-Encrypted: i=1; AJvYcCV6g88/ekUU1uiyoCgycibLTLh97DufD+pfuAZKNYjMKueu/pHUiLtlXg/MUUcJgfSKIx3MBZEPLuwVTWD/LATZiD1ZZZY= X-Gm-Message-State: AOJu0YwRPh/xwzHGLdKx5JWnOb/diHZ/hMRma6xNVftf8+r6OJP76kQV TKpeRP2K5npSrkem/rB8m98QBe88J9IKq/WoGzMAdyYcGnvKHb9CUJudVsbjFRM= X-Received: by 2002:a17:907:985b:b0:a47:5265:9aac with SMTP id jj27-20020a170907985b00b00a4752659aacmr2631308ejc.55.1711533193384; Wed, 27 Mar 2024 02:53:13 -0700 (PDT) Received: from m1x-phil.lan ([176.187.205.175]) by smtp.gmail.com with ESMTPSA id jw24-20020a170906e95800b00a49856ae93asm3461551ejb.198.2024.03.27.02.53.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 27 Mar 2024 02:53:12 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: Thomas Huth , qemu-devel@nongnu.org, Igor Mammedov Cc: Paolo Bonzini , devel@lists.libvirt.org, Zhao Liu , Gerd Hoffmann , "Michael S. Tsirkin" , Ani Sinha , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , Eduardo Habkost , Marcel Apfelbaum Subject: [PATCH-for-9.1 v2 17/21] hw/i386/pc: Remove PCMachineClass::rsdp_in_ram Date: Wed, 27 Mar 2024 10:51:19 +0100 Message-ID: <20240327095124.73639-18-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240327095124.73639-1-philmd@linaro.org> References: <20240327095124.73639-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=philmd@linaro.org; helo=mail-ej1-x630.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=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 Message-Id: <20240305134221.30924-15-philmd@linaro.org> 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 ae2d220269..5fd83010ba 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -1743,7 +1743,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;