From patchwork Mon Jun 17 07:11:18 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: 804860 Delivered-To: patch@linaro.org Received: by 2002:adf:fb90:0:b0:360:93e7:1765 with SMTP id a16csp434674wrr; Mon, 17 Jun 2024 00:14:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXR+khxMlnab3RSKOsBmHK5tKD5jNVWBI3+b2Hh8YAXozdhx2ltWKKrAmvfPSjmPElFHeu9qPXMoukBMUg6FOV5 X-Google-Smtp-Source: AGHT+IHfcewGdJYu2fdy5rICXqQ+x8DvO84V+DMWyjnutCz/hlLTBk/7ZAt+9ll7jeCb5674O7h+ X-Received: by 2002:a05:6214:c4d:b0:6b0:82cc:5e7a with SMTP id 6a1803df08f44-6b2afc9a8b6mr111399906d6.21.1718608464606; Mon, 17 Jun 2024 00:14:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718608464; cv=none; d=google.com; s=arc-20160816; b=HzXQoSFzHRhvO7js+d0YqrqJ9x4F8a5cJNnfGTJLwvPoJsBXBq25gSxxIUjQQJN5QE pKnV6htlRm29bOXC6oIXsB4u6qRWkysoOhIl90kcycGjk5xUeU7iedVHLr3XFRExMYSg 093yogOanQOvrUfxRh3WEYSaQZGV1e/utp2DpE+EI4HbcuShjSJ9SLepWr+Kaw2a6rfv +6Iy2i5tehpoF5V+mPHSR6/vPmdNNmn84CczYyfqrp8rL7XO0EK30IBNz4Apa9sufM0I 7klVyU+R2mu+MN0NA3mt5S0cAfzUZpb/XyQB1wFxgwLz2hBJMyxBIfLV9iBOn54cTvIK JaIg== 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=57v2nLJIiPz0NejpbNwNRLwmELDZW6U7/UqbjcDmlgk=; fh=LxU1EPCBVYorV++vrCt2dyzDsbIeuRBouOVrSj5U16k=; b=ZLthUGig7OjqZTwTgekn2Uw/P9qO2Ot33rlSeyXZn608n9aicB2is+OyA5KyuM/SoM mSCMsDWht58UjjPYjK/83qVOHBULuhiObgsPRz5bieqdPxezEePEC4v1JXw3vbDEMSRZ H17NgplwvR4y8V1Q8QVBunhjzUiCgfMSzr/m6rt5sm6KJuGlyIQjRX362jIiZy7tS++S 1cdQzzvVhLvfqOHx3piFIPJZhxcJJXgDDC2yPL1Ue53ByvJconZ/XEeN2CytOtWlxaLC Ser84tetk4dcQsuFb/i5YAoX9shWIBIZdIpnsMvSlVXLjwdSqcJLwcBKJbrjgOPvbB+k 5+nQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XnDEgwj2; 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 6a1803df08f44-6b2a5b88f69si95130326d6.565.2024.06.17.00.14.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 Jun 2024 00:14:24 -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=XnDEgwj2; 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 1sJ6Yj-0001bR-Ey; Mon, 17 Jun 2024 03:13:45 -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 1sJ6YZ-00014f-7N for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:13:35 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sJ6YW-0002T7-I6 for qemu-devel@nongnu.org; Mon, 17 Jun 2024 03:13:34 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-57cbc66a0a6so4729705a12.1 for ; Mon, 17 Jun 2024 00:13:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718608410; x=1719213210; 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=57v2nLJIiPz0NejpbNwNRLwmELDZW6U7/UqbjcDmlgk=; b=XnDEgwj2V4SmUHLgobGnyDNEsYDIKyBTYPLC1lmCIFMjIdU9hnv4dc5FZ9Z7pBlXzV Yzt3YYS8FwP4IftUJh+b9JOQum2krxjw4vyTdk3t3kRv+Y/SwSKwXncPq6GIbui3MYa/ LjwBfOcQ8agjK2Anh54LVustycUZmrSzXmFIWXJftDa9XWKVxg85fIFZi1Xdiwfdvz8B knQjT7vDIRLbmxeecr0iv7ENBQS5OCnbVlH6IS+rImww/AXJ1rlRfVQ/ZpLYVMxXpX46 M0VCAFlAR0rtv8ccawhTZaz9t3gkTPAbE0iEtjvelXA251RLjsFZsoWCy1QmOpXt/xZw yZVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718608410; x=1719213210; 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=57v2nLJIiPz0NejpbNwNRLwmELDZW6U7/UqbjcDmlgk=; b=nhJAvLzwWGja8x+yZhlKCPSe9WLdZDJ/zbeunOf3eEloEi6Kdlb2aJBOjS/oDZuRfM ZGoRmLsqa63v/ZtD/3vnlTggwIuHSvGHTJuxCxPDYJpDemsxQyCHQvHVW+O6jMAjVDL+ /IesbrJ72OBStJGWBS4iBhDh9j7dlibd5ONhW/3TumbIXJP0a1EU3klm0VxAarqW502g SpABdudXCgq5kOXA5B5GpA4O2xCyjvG6vHMEeD/vaHNjzNKBY9ht3JaP9oI62qBQfj9x tmV5bhdL4TH9cleoE6nQzpkhBsxG/FDNNXIVZAjKWoJMG9gdOXzEQE0fwrUVWo+vu3cj D1eQ== X-Gm-Message-State: AOJu0YzFSsz60eFWnwtPIzc1cnPWygNVswm+v+XnXDb4V7MF9XB7hVi0 FTXLw2an4fqSE/5MEI+HSfis9QxNrwxTBM4nNzbRABbom1qZ5zgBdyRBSs0zJEYsDyAUHurBBRp bv6A= X-Received: by 2002:a50:d4d3:0:b0:57c:aac7:1060 with SMTP id 4fb4d7f45d1cf-57cbd8f19b6mr5722236a12.13.1718608410415; Mon, 17 Jun 2024 00:13:30 -0700 (PDT) Received: from m1x-phil.lan ([176.176.169.90]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72cdf68sm5974694a12.20.2024.06.17.00.13.29 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 17 Jun 2024 00:13:30 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Igor Mammedov , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , Thomas Huth , Zhao Liu Subject: [PATCH v6 23/23] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE Date: Mon, 17 Jun 2024 09:11:18 +0200 Message-ID: <20240617071118.60464-24-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240617071118.60464-1-philmd@linaro.org> References: <20240617071118.60464-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=philmd@linaro.org; helo=mail-ed1-x533.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::acpi_data_size was only used by the pc-i440fx-2.0 machine, which got removed. Since it is constant, replace the class field by a definition (local to hw/i386/pc.c, since not used elsewhere). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov --- include/hw/i386/pc.h | 4 ---- hw/i386/pc.c | 19 ++++++++++++------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 0b7a18a882..46bc411063 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -74,9 +74,6 @@ typedef struct PCMachineState { * * Compat fields: * - * @acpi_data_size: Size of the chunk of memory at the top of RAM - * for the BIOS ACPI tables and other BIOS - * datastructures. * @gigabyte_align: Make sure that guest addresses aligned at * 1Gbyte boundaries get mapped to host * addresses aligned at 1Gbyte boundaries. This @@ -100,7 +97,6 @@ struct PCMachineClass { /* ACPI compat: */ bool has_acpi_build; - unsigned acpi_data_size; int pci_root_uid; /* SMBIOS compat: */ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 819a164373..77415064c6 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -265,6 +265,16 @@ GlobalProperty pc_compat_2_4[] = { }; const size_t pc_compat_2_4_len = G_N_ELEMENTS(pc_compat_2_4); +/* + * @PC_FW_DATA: + * Size of the chunk of memory at the top of RAM for the BIOS ACPI tables + * and other BIOS datastructures. + * + * BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K + * reported to be used at the moment, 32K should be enough for a while. + */ +#define PC_FW_DATA (0x20000 + 0x8000) + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) { GSIState *s; @@ -646,8 +656,7 @@ void xen_load_linux(PCMachineState *pcms) fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); rom_set_fw(fw_cfg); - x86_load_linux(x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); + x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled); for (i = 0; i < nb_option_roms; i++) { assert(!strcmp(option_rom[i].name, "linuxboot.bin") || !strcmp(option_rom[i].name, "linuxboot_dma.bin") || @@ -986,8 +995,7 @@ void pc_memory_init(PCMachineState *pcms, } if (linux_boot) { - x86_load_linux(x86ms, fw_cfg, pcmc->acpi_data_size, - pcmc->pvh_enabled); + x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled); } for (i = 0; i < nb_option_roms; i++) { @@ -1743,9 +1751,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->has_reserved_memory = true; pcmc->enforce_amd_1tb_hole = true; pcmc->isa_bios_alias = true; - /* BIOS ACPI tables: 128K. Other BIOS datastructures: less than 4K reported - * to be used at the moment, 32K should be enough for a while. */ - pcmc->acpi_data_size = 0x20000 + 0x8000; pcmc->pvh_enabled = true; pcmc->kvmclock_create_always = true; x86mc->apic_xrupt_override = true;