From patchwork Tue Mar 5 13:42:20 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: 778018 Delivered-To: patch@linaro.org Received: by 2002:a5d:48c8:0:b0:33e:474f:8c56 with SMTP id p8csp439727wrs; Tue, 5 Mar 2024 05:46:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVBLoayytzubkeS9zYwDqfh3l+1jIDow33xrrHbuW0csUd1tw4TH7c1F/Yg9w2C7NNMZx+WDjr7MgTq16I7yIq0 X-Google-Smtp-Source: AGHT+IHkPRswzbWRM0SIa5nB+WnbF5HAPhewa44CFrGO+b79O2DF08uydbHjQ3+70WTdi53Hoxu0 X-Received: by 2002:a81:73c1:0:b0:609:9e71:1585 with SMTP id o184-20020a8173c1000000b006099e711585mr8139121ywc.3.1709646409732; Tue, 05 Mar 2024 05:46:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709646409; cv=none; d=google.com; s=arc-20160816; b=S6DHMURiSSGM99SgoFCZPW/+GL5w951XCf9g2tF/sMMAwrvjSnSU2l9Z0YM353LIEC heM+6XjlC5OQWZVZZBIp8+zF4d5WGEylwt1gt8V72yxrQitRIbD78XAzRPg1yjWnAcSr SA/V6MS8A2JKztNS1WAUWdzZwoBMwDbvR5nnhzDSdS+92VC/7QKE2UY8pcrwpb2vBdBw DolZtixbbY4CYyRVF63PTiV65C0jLtd6T0Mdcgwh1cfRCtSTEhyArdP41Mzl9ij0oxpW x0ZpbAJjxYKP/FTjI8QTsY7psNwkWrczlikN/fFs1kseVcYeF0SmnYoEd0l5/jWNFt1U 9j5g== 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=iOxnYUajpBTpGKSyr9S0Yy8S7gw3p/1QBOxX+w9BDyM=; fh=lA6yvtwEvDsoPmbdvRiSkKi1PbIkmvp3T23nqm+dAas=; b=K6ZRcUbFEY/KE6J9gedT0Zk8gwj8RFoxfRIpmoSH667/z7kgpaAsh1yAc/lcF9UcCi 2iySav8Bsh2lBlwxYhahjp9CSOGfvxIo7P6XesgkUoL7Ku8kYX1aWGdU8LguanxCPy1d zXd7VqwWo7lHIvA6yPLdSjT++tgIRJDhaQlR4+G2dPvyoLSrCEknLwEeTtC6eCXni+PD merSe2We+OCZcbg/KzlJUGVXix46El7v7YuQA5D405GMUH8HAiNHRlBOTe2/VG0e4f2C oggZmV7ByoZz6khwv1hmNgknG8cEUKKugsQZjSgM4myXhDE/b1mImXjS6q+kPnxRbYZy VZuw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BcGyntEl; 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 jo20-20020a056214501400b0068f43478f32si12243834qvb.70.2024.03.05.05.46.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Mar 2024 05:46:49 -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=BcGyntEl; 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 1rhV77-0005Fh-OP; Tue, 05 Mar 2024 08:45:54 -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 1rhV5v-0004Py-9v for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:44:38 -0500 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhV5t-0004J2-J4 for qemu-devel@nongnu.org; Tue, 05 Mar 2024 08:44:35 -0500 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5131c48055cso875969e87.1 for ; Tue, 05 Mar 2024 05:44:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709646271; x=1710251071; 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=iOxnYUajpBTpGKSyr9S0Yy8S7gw3p/1QBOxX+w9BDyM=; b=BcGyntElQvi+nCVmOH8W61Vrfi0XwkkwMs6sOzD5ShzIlU8Q57BR05UnfP7SG4dF2W QI2JvQkx+LVvUGSNAros4rktqbFb9JxNEIDa+ISG5hnZ8i668bFxSYO4tuFBzRU2LfVO S9mljKrttARTE7KMQrHVXvBhaSUVOUF1kQG0v/II2MTSO9cjLnddQJTVnlQeRJhr6DcL 9wmNtiwCoG6IEutzJpumIpmwbHaJ6T5w11yR1i+PpJ+B23ed8Z+XAUUI7cCFL9MggpNK Qu4b/YG2RFobv6r7pd3Oh9dToibTWqb3nSqf+epmm4JztumZMRVocRcHVtO9yRyO5IpX ZRBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709646271; x=1710251071; 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=iOxnYUajpBTpGKSyr9S0Yy8S7gw3p/1QBOxX+w9BDyM=; b=AWI/1fI+9ojMEXn4t5KkBNHIPvsf9t5q9t539akRX5bT7U24wz4s6AckAue2X0py8f G/2XTsdXeiikEQpMBjcEQb1LbVOJGgepbi2ajY4K/beLuuanWS+FX5jKsnMSfZBmlVtS 3y9RboJPAhpMnMKQtNFB6spM+uak2fgda0dZOX4MsJ+CGucZGqSnKerDfXTfnWxUmL3S Ef3OmomZlCeSHNSRnhukAZ4HyGVFem33DsSlThJkpbHPNtaL6zqWlvThJnOeg0iVEW8n qbzYn8XjWMTJVrcj3iyQl1v7j9+6Y2T3uYrV5K5r1wVmzcJoeJxq2XH6r9cspZn5a2ta cz0Q== X-Gm-Message-State: AOJu0Yz1C17JKajbA/WsNMldtC4BFY3307QFPWlun5OiJEF6hOJ5o1Da titpcP1edhivZAsG4Jep/YChz9INpUDgxpLGbl+P42EbkI4ckOmayb2Wn9zXCN/YMMzzr8s/Gii v X-Received: by 2002:a05:6512:10ce:b0:513:588a:260f with SMTP id k14-20020a05651210ce00b00513588a260fmr510188lfg.38.1709646271091; Tue, 05 Mar 2024 05:44:31 -0800 (PST) Received: from m1x-phil.lan ([176.176.177.70]) by smtp.gmail.com with ESMTPSA id bu16-20020a056000079000b0033dc3f3d689sm15142258wrb.93.2024.03.05.05.44.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Mar 2024 05:44:30 -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 18/18] hw/i386/pc: Replace PCMachineClass::acpi_data_size by PC_ACPI_DATA_SIZE Date: Tue, 5 Mar 2024 14:42:20 +0100 Message-ID: <20240305134221.30924-19-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::12f; envelope-from=philmd@linaro.org; helo=mail-lf1-x12f.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. Signed-off-by: Philippe Mathieu-Daudé --- 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 b4a9ea46a3..2e57a1b5da 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 4b9f4c5c2c..ce9e6b6272 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -256,6 +256,16 @@ GlobalProperty pc_compat_2_4[] = { }; const size_t pc_compat_2_4_len = G_N_ELEMENTS(pc_compat_2_4); +/* + * @PC_ACPI_DATA_SIZE: + * 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_ACPI_DATA_SIZE (0x20000 + 0x8000) + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) { GSIState *s; @@ -652,8 +662,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_ACPI_DATA_SIZE, 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") || @@ -987,8 +996,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_ACPI_DATA_SIZE, pcmc->pvh_enabled); } for (i = 0; i < nb_option_roms; i++) { @@ -1737,9 +1745,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) pcmc->gigabyte_align = true; pcmc->has_reserved_memory = true; pcmc->enforce_amd_1tb_hole = 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;