From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742377; cv=none; d=zohomail.com; s=zohoarc; b=OMMePtcKcw2LybgBvQ6n2+Uc7EIAABJv+zDUrg7FYTm2ifTpNfZb90DJ0dzOJNntZeAu/HEL/Lwo/xc+TFH9UEtt9Ys189KiUDgZHMb8E03Aq/gLBdZj3G7pz9LR/xp5CWDp9cFCCQjLwEmw0G4TcyIrE0OU3zEbhkQQkz0Z1bY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742377; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5u32GnbEayk/ZbK+2L0211NCDKiKLwsWPQOA+q6KCV0=; b=Lm/1VlfRpOn3gfz2wIEqZD6F8WMXlad7kCtxkH4J7EzmyzqgMcqFzKVRBS4SUKRnBM2coCngdT6RBP+wqLBkmWAZhjw8wff8Ou4r36zXetJ9NhgtYPBpDyVS61Q9p68a5as0tuszLRN/k/ehpfb8sDvAN3HOyLAxZPoOb7zBrco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742377577411.470176030091; Tue, 2 Dec 2025 22:12:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg3s-00051G-Cq; Wed, 03 Dec 2025 01:10:00 -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 1vQg3p-0004x6-26 for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:09:58 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg3l-0000jr-1l for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:09:56 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-477563e28a3so3486115e9.1 for ; Tue, 02 Dec 2025 22:09:52 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792a79dd0esm27638635e9.4.2025.12.02.22.09.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:09:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742191; x=1765346991; 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=5u32GnbEayk/ZbK+2L0211NCDKiKLwsWPQOA+q6KCV0=; b=laPKl4Byok+7fWqWUDJw8klpigyHUq/Pis6DkZkPC7LWDMnj4wlehb3elNXk6k7qVm xh3xa8PPD4Z2iv8Pv8JHyVw7Md7lzxSXsGU70lcXKMssm9oYa1te+kphuEoS2V4tMelW j/1kXjRIGEzLM0eMESHrEMbal8aqLHtA0wqiqz/n4jffFu9zFu/c/U2VxGmtoMcnMDSr 58DzftISku2STLhn9dgympXtZ64oYUEx69hvgfDHZ7Wg8Q4Le2VPbQAkcL0M2X51DVFC SJCgnbqzSO/iT/LEKgioKZWxcXLJAsx4evnw5GlfvxC9ZJtgIlsoGdJWHq/pDvaNlRif QyIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742191; x=1765346991; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5u32GnbEayk/ZbK+2L0211NCDKiKLwsWPQOA+q6KCV0=; b=xKyLfJOvjOPeE2rVxtTa41CViYC7RQbvLTdxVHG8+nUJoNPCroGzoIXMaHOHyVR27Y lFjZLQN8bgchFo2XCCcHwnG9uj9nMU4LTBptDQpmrjY0PE+e2ungtpZoMvaMOF0hMKtS nQkh0EEVFuAJET3HzV6P9R2qpzMljgH+9yB5/ADugL16huzVtskvqskPjEnu2Xidic2l ioqmaZ3WZeaFesrScT08oCpojEIRl8CZirCrxNDOW40cqvtV3NuG7/HRv2DKCSAvt7AV Die1g7J/tU+rRnJIeNoiSxXFIV7mrwWQSSLcFwFaaiuXkBsrzvZ9IqWyIOremLCdf7Ec mWjw== X-Forwarded-Encrypted: i=1; AJvYcCVJSVz73fQA7/HZlLYDvuBqsVlsNEXqkTmyRBgzeVqcGB+BAL5dPPZ/9dYKYjnssrJKVr03IlCLAOiQ@nongnu.org X-Gm-Message-State: AOJu0YyoCR8Fy8o2KHuYGdgQJ+zAT2SsabEwodrr8oClMtxAdbCEQHi4 00xkLu0jptkaB3mnNd9/PQxvF2irr18/CFOCobsxWu1D3r+oq857ucP1gHUXC2mv5Ag= X-Gm-Gg: ASbGnctdgEQwkf3DG3CGw1tOCPLJ4hCKOCY91wL5xu+6Au4Udgmbk8vHjMAYeJOKEMM 1XFJIEFbHs3i0xUMM9B8NlQOllWLfn9qbt0ALgXZGCdQonRqovrqnFpOwBhYr+Dw1+zRM+79ocm 5DkzgdLYzap8RlO+sg0d8mTWmq4cqk2CngkejFAVOcknDx+olPBVz5lWDhC+5BggvFSoWhacrjR yM406as1zQHCP+obKcFu8hJ83cQGj857Z1vujatcoe0XNGu3On6iOVL+htPwD3WgUP/ZvJ7IuA1 jcjQcKSrsZPYgOw5xWVV4hd4+6JDL1Tqh90g/8iuv3CHlvNF+hW4Xr3oK53DFV5yXQ6wfELhbOv ZAeympafxV97/umBVZatB2Bn2TzZB9/jIe8fLRarcfSf2IjrxQoPIuz2WM0j6GVHT+WF1ctyxJt Wa4ja386uaULkLdpdExTslh4+UnbUWVMmiJixMdlWjUoaNc3Y2j6jXEHN4l/K1 X-Google-Smtp-Source: AGHT+IHyqzLifzMM5fV6KNGaF2zmFaEUl4habTG48tM4Bpx8cOpFrQ0UprGIJBJm2fslY5abnS9CRw== X-Received: by 2002:a05:600c:470c:b0:475:d9de:952e with SMTP id 5b1f17b1804b1-4792aee0404mr9789495e9.1.1764742191145; Tue, 02 Dec 2025 22:09:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-11.0 v6 01/13] hw/ppc/mac: Use fw_cfg_init_mem_nodma() Date: Wed, 3 Dec 2025 07:09:29 +0100 Message-ID: <20251203060942.57851-2-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742379723019200 Use fw_cfg_init_mem_nodma() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu --- hw/ppc/mac_newworld.c | 11 +---------- hw/ppc/mac_oldworld.c | 11 +---------- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 951de4bae4b..89cd1ed0311 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -453,16 +453,7 @@ static void ppc_core99_init(MachineState *machine) pmac_format_nvram_partition(nvr, MACIO_NVRAM_SIZE); /* No PCI init: the BIOS will do it */ =20 - dev =3D qdev_new(TYPE_FW_CFG_MEM); - fw_cfg =3D FW_CFG(dev); - qdev_prop_set_uint32(dev, "data_width", 1); - qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)= ); - s =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, CFG_ADDR); - sysbus_mmio_map(s, 1, CFG_ADDR + 2); - + fw_cfg =3D fw_cfg_init_mem_nodma(CFG_ADDR, CFG_ADDR + 2, 1); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index cd2bb46442f..25fb8ed070d 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -294,16 +294,7 @@ static void ppc_heathrow_init(MachineState *machine) =20 /* No PCI init: the BIOS will do it */ =20 - dev =3D qdev_new(TYPE_FW_CFG_MEM); - fw_cfg =3D FW_CFG(dev); - qdev_prop_set_uint32(dev, "data_width", 1); - qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(machine), TYPE_FW_CFG, OBJECT(fw_cfg)= ); - s =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, CFG_ADDR); - sysbus_mmio_map(s, 1, CFG_ADDR + 2); - + fw_cfg =3D fw_cfg_init_mem_nodma(CFG_ADDR, CFG_ADDR + 2, 1); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742318; cv=none; d=zohomail.com; s=zohoarc; b=XFBq/a+e5W0UKjO72qbj31V8yW3pI9SuXVqyV5u5phfN9tJ7Xk7lrFoOVvqX6bXLL4nGlTNTxK0zh7b0DkNN6DjdwXMbBMD9aJrCTGYMlfYMCgIxdqspO/K93Xb+6/YAPB3dmpy9y6mSAXhT2dQX7u79MGvQBylVeR5nNLVWEac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742318; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cHfjTNJ4DNmllXF9FNZFtldAjCRS1zE4NJobhra0HGY=; b=Z5DpRbcbivh0dPdKi5bbhtXcKch3WFYz3yQda5S+ZBfgHZKuMmrK4qrHWDEExxpJnREeYzkagNh8flyMdD+iEfnQUf6/vtvi4guyPN+E+Jz7BocgyVi71FP+1hBwNnOaWhGcsJmmteaZZbpYtMWAYMvGvBvzD92MpvLTYfHKzvU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742318092954.779772521455; Tue, 2 Dec 2025 22:11:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg3v-00056N-Sm; Wed, 03 Dec 2025 01:10:03 -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 1vQg3t-00053w-E1 for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:01 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg3r-0000kY-Jj for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:01 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-42e2e08b27eso1630187f8f.1 for ; Tue, 02 Dec 2025 22:09:59 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5d6133sm40172746f8f.16.2025.12.02.22.09.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:09:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742198; x=1765346998; 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=cHfjTNJ4DNmllXF9FNZFtldAjCRS1zE4NJobhra0HGY=; b=l2XigEqQdz92EICntFS7uhYFuWKDekkNXp4+Vm3ukZIMM8Jp2mcLJ9tpZVZ6A6EbGm G0bctUVU9OiTZnyPfVw7EP9HzoRaSeJVnYdwLokypPGvYQ7KdJVvM2GkZ2noc3qAkBav XEdxuH/L0oFV+ZRAueVzasMUv0R9M/pQI3QuOWgE/QrXHLfdzCWNhDXwDUxixv8ua9mv dE2ABc6adSs7O/sMPRhA/Mat7sE+w/ut4kxzqsJXyp8Q07gW5uTvBpXXW5MnWJ/D1acW 89WN4XFJF0hEfr46GNE7vBVH8LzRFBUaaENlxSahJFMN4Et6cq7Z7OwFWZ9oJQjPSKhI t2+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742198; x=1765346998; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cHfjTNJ4DNmllXF9FNZFtldAjCRS1zE4NJobhra0HGY=; b=ZknVkMVK4jeouqgPElGDZgkHQpAiY3LpFPoel9l5DzlNHUU77D8VEh5Wb6qX0mF8Z4 t8Ih1SsZ+BZ1ARPm376zuNIK8uGm+Fvs2kOZ2n2N1yXKKBzdLZxEMEcMnmmMteGrBADr Fx0BQeZEX93gFInriDb9Glvrm9h/cQMi1GmXj1iXsZND3cRK7hR8DuVXTw1WQr3UxCME pCBenw2azkfLs8KN45s16oQi3bri9v0SmWDxPXbppJYMk+7nyH9vmBUYJsCcg4lAxTwK zFdSpATX19IHNCB9JKx01vlD/gcWI6d1xatF8C2YsHQt6L6EM1gmS1WBbxhQsGNRyj2J Us+g== X-Forwarded-Encrypted: i=1; AJvYcCUH3+1D7UyY9U/Gz9OEVuwVod7NxQYmQkAXjFOOR5SMEz4widlzxM1kW1W9lW5D6nImynkXuxuqg3b/@nongnu.org X-Gm-Message-State: AOJu0YzdTdepWOczLaEsbr0wFpO1E5XRfZINs24VAFmh4DvMp3ph+kWv xfhtEmwQbDppidAwHVntymMXB1jLbfAEC7l+OU8tMC9gaVfjxRR9VO2YtZnfLainawobg4ZNMWu Dw32qwRE= X-Gm-Gg: ASbGncuG/BSEVOWy6tkGE0aIxB22TjBYYpyj3z6zPL9ZTQ835MfIy0CoLaz8+vY/5aL trJAgzfpQiPwk8eRj6vQkUPLmZWCZr5kS14k4PQX5pQflvB9aJVOcN/UZLkHfH8mVhcbrSy8Lpi +zyPcMLngpS3lXYZYqFlfhsDIcVq+JOuP6xVflwe70+GV+6PD+8gWsUjFou1EDPEG7SFuT8piXu XUTdQhjRIuAGDCNBf7dK2fAAo7/acDoy+j9M20L87lhSafBvQ0Gly5BF0SBHaXHxZpcax9Z/rkd YAR8Dk7YXr9bwM0lLhoiGHbCouXambpchlzhRjQMeVrurtRF1qgxwopvfiF2baGnnHGYu7TKePh hsDTgjEU/ye88silidm5yg1MK5gl3sKnM1kjwaSS2dGQ86dZEwpUxD9FbGqvDkOJOtFcaPxkc3A wxQScwFemELEUXTPB4mw+WwKKfsPZd6fe7uS+IL2aAUietp4Q/wkDxg5dB0oId X-Google-Smtp-Source: AGHT+IEXrG8Si7AT2Cc6U+aSqmTwXk/o9+TllQfQZrLykuMH28UNBbl33EUUCCsdH3rcHz/u08XJnQ== X-Received: by 2002:a05:6000:184a:b0:42b:4185:e590 with SMTP id ffacd0b85a97d-42f731d18f4mr829824f8f.58.1764742198168; Tue, 02 Dec 2025 22:09:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko Subject: [PATCH-for-11.0 v6 02/13] hw/sparc/sun4m: Use fw_cfg_init_mem_nodma() Date: Wed, 3 Dec 2025 07:09:30 +0100 Message-ID: <20251203060942.57851-3-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=philmd@linaro.org; helo=mail-wr1-x42e.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742319456019200 Use fw_cfg_init_mem_nodma() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu --- hw/sparc/sun4m.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 53d7ae08ae9..85c8d727594 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -1051,17 +1051,7 @@ static void sun4m_hw_init(MachineState *machine) ecc_init(hwdef->ecc_base, slavio_irq[28], hwdef->ecc_version); =20 - dev =3D qdev_new(TYPE_FW_CFG_MEM); - fw_cfg =3D FW_CFG(dev); - qdev_prop_set_uint32(dev, "data_width", 1); - qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG, - OBJECT(fw_cfg)); - s =3D SYS_BUS_DEVICE(dev); - sysbus_realize_and_unref(s, &error_fatal); - sysbus_mmio_map(s, 0, CFG_ADDR); - sysbus_mmio_map(s, 1, CFG_ADDR + 2); - + fw_cfg =3D fw_cfg_init_mem_nodma(CFG_ADDR, CFG_ADDR + 2, 1); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742259; cv=none; d=zohomail.com; s=zohoarc; b=KZAEEVBt7wp1j11Y0SnQSA0vEgrneWhsJh+/tRr5kfw/W1NfYM/74tMU2WYva33raHYBHK7BWQaiIZgjYZ6P6l+CFAN4WhD+zxzkRxyd9Vgv5BvBQEA2EGZdQTEEGiWe/cljIUaN3GJIGvspLwXsskujavDpySTMYThhLrANIZg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742259; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AUczG/p4f5yoluuGUkVYvQx6mSQhYMxYgU12rhZJcv0=; b=ZwICQhLBQCx/3gBp5P8XHUgGsEVapnr7xOKkLgi4IVEfvMqkdLzEBFyN9aFrHKHU70RjI+mqq07q+lsPgsBCxyKZhch7WQYwwFqb/LRx+u4xLmDO1JJIsWllPPEsBJuXfsH4NnTWMZ3OsCvq7legwXL1sN6dXpDTMsxuaIBFmRg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742259200557.4014579666655; Tue, 2 Dec 2025 22:10:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg43-0005AO-Iw; Wed, 03 Dec 2025 01:10:11 -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 1vQg41-00058z-Qv for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:09 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg3y-0000y3-Mp for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:09 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-42e2e3c0dccso1963214f8f.2 for ; Tue, 02 Dec 2025 22:10:06 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5c304csm36722072f8f.8.2025.12.02.22.10.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742205; x=1765347005; 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=AUczG/p4f5yoluuGUkVYvQx6mSQhYMxYgU12rhZJcv0=; b=OyB7u95WC1p08b2iWJa/gwYrnhtr6EZ/LD3OBLkjT45Mm0PM/5nUybP+vAhhzpdjjk UuEWEVIunpLmIn/WHnbjYbfIQbDpbSzBxWQaEEdKiq5x/MtBFHvkYk4bN03XyMs+O6i7 RDPYYPA4e/nhysntzDbKWaolA0y46kmRPznJkCTR0cNsBS/d/ySXp5IhC8S2LJpSK7Re ViQmOTSGN2C6bFFwLbEUwcHsXSLVUG125+dlM6wccTMiFHJJ+ZMhlJuewjE2DVRhayAu Jx0jLDHu7cIIhiQoGcPxW+Peulw2hSe2hDegLHvV+Pm0zO6/VWjUiGvASUMRkVDuz/Rn 3QHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742205; x=1765347005; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AUczG/p4f5yoluuGUkVYvQx6mSQhYMxYgU12rhZJcv0=; b=YJXx4fi7grfkjxwe5oTy7yVOaUCkBHqyutI3QLo5J055ME3uyaPpM2Y3S6OiBrP6zF ZSJQHmCYWkXGVqpoOpWK3JpabmxUEDHFFPoQtdXW93bYknTfV1pvIaVkmFXbjIcA8HMW FL789PcbvISTcsNJsqk9nJg+K+v4S77Rgux3KO3iOd6I+YgQFTTjbqcvdQTkqDIB5H02 nB/ayivfNZQwZcXrcTFGbcUPFGXAkJ1hPAk8dSCFVnXLU0ppgXJ0tY/YdXK8LFb0vVN0 IDDKA94fn+zj3jhhHtIe6If4YXvWBr3l7D69Upp2WK/HCRsUX385LXY4ju8tGZ7K5639 7ubA== X-Forwarded-Encrypted: i=1; AJvYcCX+yUuV0YtMZk0F7wp70bhpGYbrPPgxDNobwcay8hfMiE58G2tUmZ8dYmYq7ui4gWJNYRR0mEqU+qty@nongnu.org X-Gm-Message-State: AOJu0YwR3aWlirZ1APY7KCDMnvL9rNNChrOELeEnWZ5E3WK0WryrLdSz uTYmLWul8R+gzLsJnfU8Qp70bLGI2QszEw4coOGipJWEHsKEH2gxjGfNmNEnEImfGkk= X-Gm-Gg: ASbGncvEMdU/OVLFo73MF0GFAglGuv3IAcMhGnmlzlH+8qiXWXZrK2TgWpyOQhkYcsK 6vHMD+tL1cGO9RWPPp4Jgqw8TigD0N6Py/jMP8GLLajWkepAlfw2/O45iwgBDkiLGo75fgUl47Z 80b/0RPDPJHtCJSXsIZ2hehBCLeYWqmNLVosZcBIpqa8N4VMFl58qAVyWapy4ttlL89Uw3qc82U L+IvLqeXjYGVmA//Rm54QCNUzwfcOUV7xh5X80R0wffRQC8XPgAD8Ce3dm8Z15RODAT6wQ80c/X V9o/vAuUJ+OK/nI6W0InQ+BLrnh+TAxUDl57+oRXCOW7KtUvdbWNVtSamsfk4vVHTOp9FEQZi7A LFo3NMXGrivs3E6ryQJ26tGFEwibTFFEziWl1mNIbew2JFxg6HwMsWuzRRYzVBIha74VLawvkoD YEg/UqqXK28r+rEAlGaj1qkYbSY+ihJWN3Eo/uLaq/0nVZmKLdaSPbgnka9fdC X-Google-Smtp-Source: AGHT+IE22k9yxCvZOYe9YhjyN+DdWq4PFkHWWGEu8Y8vIYjFFLKFYQp0V3g9ZFALoeQ4/kScq0zoog== X-Received: by 2002:a05:6000:40cc:b0:42b:2e39:6d58 with SMTP id ffacd0b85a97d-42f731bc534mr726343f8f.51.1764742205225; Tue, 02 Dec 2025 22:10:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH-for-11.0 v6 03/13] hw/nvram/fw_cfg: Factor fw_cfg_init_mem_internal() out Date: Wed, 3 Dec 2025 07:09:31 +0100 Message-ID: <20251203060942.57851-4-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742260818019200 Factor fw_cfg_init_mem_internal() out of fw_cfg_init_mem_wide(). In fw_cfg_init_mem_wide(), assert DMA arguments are provided. Callers without DMA have to use the fw_cfg_init_mem() helper. Reviewed-by: Igor Mammedov Reviewed-by: Zhao Liu Reviewed-by: Xiaoyao Li Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- hw/nvram/fw_cfg.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 2b8715679fe..c65deeb7c38 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1054,9 +1054,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint3= 2_t dma_iobase, return s; } =20 -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as) +static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr, + hwaddr data_addr, uint32_t dat= a_width, + hwaddr dma_addr, AddressSpace = *dma_as) { DeviceState *dev; SysBusDevice *sbd; @@ -1088,10 +1088,19 @@ FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, return s; } =20 +FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as) +{ + assert(dma_addr && dma_as); + return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, + dma_addr, dma_as); +} + FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, unsigned data_width) { - return fw_cfg_init_mem_wide(ctl_addr, data_addr, data_width, 0, NULL); + return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, 0, NU= LL); } =20 =20 --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742259; cv=none; d=zohomail.com; s=zohoarc; b=M2TONzWOZWGCNWd2yTv6FtZbToZEfTac3WxQLkEA5CT4CwetuSvvtoqqzrVV4VpoD8LbFo8D0xvSuZPu8uNKuSWLM8eR+mYk+2IS7c6jrMlY70mRirBiSFIxSKrVq3t8vngEjS8JWAFldMj4V3J5Fe/P/Rw3gn60SQ7TdU/Q1aw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742259; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1Aelh7UWqNgbcmPHyVQy8EjDJIrtSb25vmBSRy1lOpo=; b=RXNMPax9b3Ay11bVFXJtxn3z9bvLden9TRlQvOYTRP06gHpdrBP6JyB55c+lqgXgaqmTe+NMBvU7y4Lgsh0Ee9x2UbTLOBcm0te33FIu8i904VfPUiWQdGJj4vKg4mdw4QfldYv/CjReu8qXv/60l8r6FfGMbYro4WRc9jQJZOg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742259290520.7985362353438; Tue, 2 Dec 2025 22:10:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4C-0005Jq-2j; Wed, 03 Dec 2025 01:10:20 -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 1vQg4A-0005JL-Sc for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:18 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg49-0000za-2z for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:18 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-42e2e50c233so1655992f8f.3 for ; Tue, 02 Dec 2025 22:10:13 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5d618csm36467457f8f.14.2025.12.02.22.10.11 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742213; x=1765347013; 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=1Aelh7UWqNgbcmPHyVQy8EjDJIrtSb25vmBSRy1lOpo=; b=sJ5A75c1BFdxUVH8XlnYwJEQW+qTM0CMCrXSPb0UwYHHbQk3YCsQrM81MgO06814p3 xB3FScXvrE9KLRxd3TVXywJrFYhvJ6jhYpmZHAe/ziaiD7/iRhxVDxAYJaCp4z64od1K WQLbegUnPBthJks8c++hUKdJveJYagtG/iTyDCpeQUyWcZ6JBwCS5X74h1PnFq3/rtXL 56Stmy6fXXNpbTd7pF+qRftMZL8DbORgbtjEfts+KoQ6MWQcr6zH4q7wr1tHoyHBxs2A mbmRNBFhFyU7lm9rBf5O5KvL40NVJfUBEAtY43F6nMby5kKnUsNXN2JUy1y8hMIDbpOE EntQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742213; x=1765347013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1Aelh7UWqNgbcmPHyVQy8EjDJIrtSb25vmBSRy1lOpo=; b=OWE4lxduebRilbOlQKiE+8B5CFmB8BwGBLUksc0ZUQazL7dDeUuSuAsKj/xtaM+xPo TA8qFKIamTQnviQIfUuHl+xUgWNMwrcRCNWPtC9C1FXmUydjDtVCVemlBQlE4spV5/4c jtmwdzpLSseFwhh7+aYzNjPm1qxBGXgsJsuBfqEjTkL94X8a5bspfbcTk44BormU0L1P VeCuEaSx8/9homMfmT/cxM9t9TOB2OKM97S8DAYCRNsvngro5oV/lESAzr3h7c3VyNre x4ANUgv4m8JiP70mbc86oeKPIg7Au3AdJBgmqV+F75nPd6gxALzsGH8W6XOiUyT71LjU hj8Q== X-Forwarded-Encrypted: i=1; AJvYcCW9v5gdcGQCpCLoZaAQD7OwofsQn76kwDmS+hUTlZudkhKaiT+brQ/aioeVdNLe4XMkmoCq5CIEvdW4@nongnu.org X-Gm-Message-State: AOJu0YwZyEiPRpDDLNmxjzFaFfDTqOpVsoLqEARsmKJSgyajatGbpEW1 TbQyZyckx/AAPhK8OBq9YMOnSlfPvLDm/xSlQSqjneWPWbKmjI3EV/ETFKoZ2xbMoxM= X-Gm-Gg: ASbGncsLtAjP7tTKmENV5NdnUOIq9gHRHp8iFbN6j2wi9RFGUN+b6cOXEO0dpd6ZFbT ZMJUsUjAx31bciJxXMJzIE6j90Gop4/QHc9l7Tm4H0QZTSWF3KO9fVA0lTJHCeG6blTqBTUYZwL A8pstLohZbBb8E58/nMKOEYue73R2Z8UIDJgtjRaVorLoT1/KOZSi1g9XGuf1v7PlaKk2iNAah6 Rj1rISjA3ZwQffbYexNsNBTcewyKwGw3CJ+ZxQ9CSXzcljbrPriXXaxyi+XXyBV+y6/1pMuw13s C5Ntga6I+gr7hE0VO8npjvX+GdbSw4cS7t2iSCOTlYl+86h8OM8hgyHqV6qsM+dIn+OCanMK3RK ArFmL7DiKouAO8SYHbuUYhpMulqsrjnmC6gW3yRIsvbQ18HL6tKLWRwd5bE06Cfe7qvzNbg9sbz vW81//vSk1fGBGSKBw4ZBYgcvDyrCNCcoWtJ9R0ICIIEycrFckLRdJqgGwwf+p X-Google-Smtp-Source: AGHT+IHRw9eH1u/Tjksz7z2yBy1gzSLCZcDugsLH106IbTnKIiOWLmvHbO9jCXsIaCxf4X8O14gYUw== X-Received: by 2002:a5d:5c89:0:b0:42b:3339:c7ff with SMTP id ffacd0b85a97d-42f731bcd33mr861328f8f.43.1764742212594; Tue, 02 Dec 2025 22:10:12 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Song Gao , Bibo Mao , Jiaxun Yang , Gerd Hoffmann , Palmer Dabbelt , Alistair Francis , Weiwei Li , Daniel Henrique Barboza , Liu Zhiwei Subject: [PATCH-for-11.0 v6 04/13] hw/nvram/fw_cfg: Rename fw_cfg_init_mem_wide() -> fw_cfg_init_mem_dma() Date: Wed, 3 Dec 2025 07:09:32 +0100 Message-ID: <20251203060942.57851-5-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=philmd@linaro.org; helo=mail-wr1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742261536019200 "wide" in fw_cfg_init_mem_wide() means "DMA support". Rename for clarity. Suggested-by: Zhao Liu Reviewed-by: Xiaoyao Li Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- include/hw/nvram/fw_cfg.h | 6 +++--- hw/arm/virt.c | 2 +- hw/loongarch/fw_cfg.c | 4 ++-- hw/nvram/fw_cfg.c | 6 +++--- hw/riscv/virt.c | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index d5161a79436..c4c49886754 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -309,9 +309,9 @@ FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_= t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, unsigned data_width); -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as); +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as); =20 FWCfgState *fw_cfg_find(void); bool fw_cfg_dma_enabled(void *opaque); diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 25fb2bab568..23d88e2fd01 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1412,7 +1412,7 @@ static FWCfgState *create_fw_cfg(const VirtMachineSta= te *vms, AddressSpace *as) FWCfgState *fw_cfg; char *nodename; =20 - fw_cfg =3D fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, as); + fw_cfg =3D fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, as); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); =20 nodename =3D g_strdup_printf("/fw-cfg@%" PRIx64, base); diff --git a/hw/loongarch/fw_cfg.c b/hw/loongarch/fw_cfg.c index 493563669e5..d2a79efbf76 100644 --- a/hw/loongarch/fw_cfg.c +++ b/hw/loongarch/fw_cfg.c @@ -23,8 +23,8 @@ FWCfgState *virt_fw_cfg_init(ram_addr_t ram_size, Machine= State *ms) int max_cpus =3D ms->smp.max_cpus; int smp_cpus =3D ms->smp.cpus; =20 - fw_cfg =3D fw_cfg_init_mem_wide(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, = 8, - VIRT_FWCFG_BASE + 16, &address_space_mem= ory); + fw_cfg =3D fw_cfg_init_mem_dma(VIRT_FWCFG_BASE + 8, VIRT_FWCFG_BASE, 8, + VIRT_FWCFG_BASE + 16, &address_space_memo= ry); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)max_cpus); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)smp_cpus); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index c65deeb7c38..3f0d337eb9c 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1088,9 +1088,9 @@ static FWCfgState *fw_cfg_init_mem_internal(hwaddr ct= l_addr, return s; } =20 -FWCfgState *fw_cfg_init_mem_wide(hwaddr ctl_addr, - hwaddr data_addr, uint32_t data_width, - hwaddr dma_addr, AddressSpace *dma_as) +FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr, + hwaddr data_addr, uint32_t data_width, + hwaddr dma_addr, AddressSpace *dma_as) { assert(dma_addr && dma_as); return fw_cfg_init_mem_internal(ctl_addr, data_addr, data_width, diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 17909206c7e..bfbb28f5bd2 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -1274,8 +1274,8 @@ static FWCfgState *create_fw_cfg(const MachineState *= ms, hwaddr base) { FWCfgState *fw_cfg; =20 - fw_cfg =3D fw_cfg_init_mem_wide(base + 8, base, 8, base + 16, - &address_space_memory); + fw_cfg =3D fw_cfg_init_mem_dma(base + 8, base, 8, base + 16, + &address_space_memory); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); =20 return fw_cfg; --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742265; cv=none; d=zohomail.com; s=zohoarc; b=iv8fUmzopPRkhryHhh6MY2q5fXlk99Sxvo1PZQ5isCjLkuJkp7PBsqyxn5QLZBm13GigFCBcNiOL6fdaA53pMFqgBgoOTHhL/S+5szNKy0o6xyeZhaysPyJRoVjN4DUu1txgyUWBAVNfcqJuB+xM9qFErPf+fVVvLWrLiNlvMXI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742265; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d59yEPBhvNs72oBt/pK6ap8zRJfPgKjJjvIkF2NPKTI=; b=c6aLEiNbqZQOUg8TFh2d5Cvz27Ftefj79R4SP1apXT7jmEAaQhK5D/0LzyNgNxymI0BJ6TDCb6tN2laQgyujSQSGHZKjQdaUcbEYzsYUikaHO1fc5xW64+75luDgZE6SuorgqciOlB1Uct0vRzpA/0DRRng5F8t2VVFleQAoy5M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 176474226535849.50249087091561; Tue, 2 Dec 2025 22:11:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4c-0005SU-S2; Wed, 03 Dec 2025 01:10:47 -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 1vQg4G-0005NX-Ie for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:26 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4D-00010w-KS for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:24 -0500 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-477563e28a3so3488465e9.1 for ; Tue, 02 Dec 2025 22:10:21 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792a7a78a0sm28527625e9.10.2025.12.02.22.10.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742220; x=1765347020; 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=d59yEPBhvNs72oBt/pK6ap8zRJfPgKjJjvIkF2NPKTI=; b=wIXebwFxR4LB6OQOR0wgB4Fzs7ZP86aJn2hiDTT+zzox/nG3C9cFpAil86Py6A/bJX a72JPMKVbubw7HX1yXH9AHs2QlY084W8voPLH0OD0+BbH6wyJLeeIz5ggHTtxhyTFdMo 08YCnfzkYBxpgfqBJyRYrJqdljf9o2DG1Hfceam8KOpqKvasXrE/38bum8AYr5XSejQ5 I0dmplBuqZ5VYh3UHJ/vtj3a+LYYzyCHVOtXcyhh575Ps9GcpSaGKxGbAgTX31DRxjDt 3lnws6oaawNr7utglpMy/Ua8/Vt36sObzkfCrFbkXHF6cKddbQeRGhOs5hvIGLnlHahF +4tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742220; x=1765347020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=d59yEPBhvNs72oBt/pK6ap8zRJfPgKjJjvIkF2NPKTI=; b=LocmRKBYA9ylsYKLdpAM2BMR9OfMIlUYZeGEMIy7g1Qe3sc6WuJ9wz7yR3EFFHN4Iu n+kBLbq+J6TPnqZUg8xJc3BSE9ca6Nc9PjESHuQGxyxcYJP5HK2qjEeLdHBpJ2jzmJay FA7iwCBoPiVVUuHudXLRgGiNHWLHajq26yPcT0bdE3f5fFnQBa0z/K/4RIREdXORKxGd KXM46RkN8uDE8STpjDOPo9SukRLtc0vOSQLcXvFbDezt5miR3QcqxHhOm3G+lO6VurAV cgAxevn8BT3HLQ/N82hnZxfHp65QY962TXpaYUitsNWrljxKpWQ+NIFXuiJCUKTFkYSy FgoQ== X-Forwarded-Encrypted: i=1; AJvYcCUMPuPe6V7yTqTCwu5DOcXaFwsa/fxtHwNeKFEYE8/3GvYBc00Eq9co5pvZteeWLSmQIMXJhZmfN+h+@nongnu.org X-Gm-Message-State: AOJu0Yy27G6zYe8pKbG+EwMSieAWltZquJhJEiyBE9VBQxxBrJ2ym4/g hOI2bmEIwbxaNOPLRO2uDEwr2dq0ZvRkkOSUAopHjoCj07d3H4yAwyzpO5BW3EmFVnM= X-Gm-Gg: ASbGncuoEOekWGWlpBxQhHIy/zu7qJDB9bGNHTax80pvukuQ6IlSja5ANzUcWyWSQEt 2J+zZcT7fj8RJ8DlZm3SUDn+RTchHAF8XNWFTolOtGWMPlKm4nkKy28b1S4wxFGa1dCHv+Sofjx MvHZqJNmnURtsqhqTFIGad0Av/IvhMakgKxTkZECNCMSxjTsTHKaBjHmB3YMFN2T6n1TLIFkGMT VoYiaUYFFtBkvolxfK/oCXtKscMAGiMV6cp/oUKYmXBTzcXAJwcsmEtJQnIv5WJAzZqqFXd9a+o qe1O7/hc57n82JMMr2OfStZ5O+FIwlScoSeiI1CVU5yNwDiRObNU5qu/go78AZLkTBxpqP+frVW e/KE74EIrdd3qztSgUJ0KSgQpuoPrvzafchnzImGW+oaPHwxrvakxVIFsPPpdnuqd2r118r0GKT yklNlUYncFQZEUzZ6PMlGLd+Lo8mTVYJBEZ+2pGHSvQRQCn1ogtn1+bTWoa0VDyCU9Lfe+bng= X-Google-Smtp-Source: AGHT+IHUidWQpMcxdt+65fXbL6Az7BDfr44WOMQhwWGw2toVqgrgtYVbDbr4/vzDHtFJ29DqoWz37Q== X-Received: by 2002:a05:600c:3145:b0:477:9e0c:f59 with SMTP id 5b1f17b1804b1-4792aee03eamr10306385e9.2.1764742219861; Tue, 02 Dec 2025 22:10:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , Sergio Lopez , Gerd Hoffmann Subject: [PATCH-for-11.0 v6 05/13] hw/nvram/fw_cfg: Propagate I/O MemoryRegion to fw_cfg_init_io_dma() Date: Wed, 3 Dec 2025 07:09:33 +0100 Message-ID: <20251203060942.57851-6-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=philmd@linaro.org; helo=mail-wm1-x32b.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742267230019200 To allow callers to use I/O MemoryRegion different than the global get_system_io(), pass it as argument. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu --- include/hw/nvram/fw_cfg.h | 4 ++-- hw/i386/fw_cfg.c | 3 ++- hw/i386/microvm.c | 3 ++- hw/i386/pc.c | 3 ++- hw/nvram/fw_cfg.c | 5 ++--- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index c4c49886754..7348cbfbc34 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -305,8 +305,8 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s, Object *parent, const char *part, const char *filename, Error **errp); =20 -FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, - AddressSpace *dma_as); +FWCfgState *fw_cfg_init_io_dma(MemoryRegion *io, uint32_t iobase, + uint32_t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, unsigned data_width); FWCfgState *fw_cfg_init_mem_dma(hwaddr ctl_addr, diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 5c0bcd5f8a9..498da9ec69c 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -127,7 +127,8 @@ FWCfgState *fw_cfg_arch_create(MachineState *ms, const CPUArchIdList *cpus =3D mc->possible_cpu_arch_ids(ms); int nb_numa_nodes =3D ms->numa_state->num_nodes; =20 - fw_cfg =3D fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, + fw_cfg =3D fw_cfg_init_io_dma(get_system_io(), + FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, &address_space_memory); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, boot_cpus); =20 diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 94d22a232ac..69f04d74a15 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -289,6 +289,7 @@ static void microvm_memory_init(MicrovmMachineState *mm= s) X86MachineState *x86ms =3D X86_MACHINE(mms); MemoryRegion *ram_below_4g, *ram_above_4g; MemoryRegion *system_memory =3D get_system_memory(); + MemoryRegion *io_memory =3D get_system_io(); FWCfgState *fw_cfg; ram_addr_t lowmem =3D 0xc0000000; /* 3G */ int i; @@ -319,7 +320,7 @@ static void microvm_memory_init(MicrovmMachineState *mm= s) e820_add_entry(0x100000000ULL, x86ms->above_4g_mem_size, E820_RAM); } =20 - fw_cfg =3D fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, + fw_cfg =3D fw_cfg_init_io_dma(io_memory, FW_CFG_IO_BASE, FW_CFG_IO_BAS= E + 4, &address_space_memory); =20 fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, machine->smp.cpus); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 2b8d3982c4a..5c52079be31 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -659,7 +659,8 @@ void xen_load_linux(PCMachineState *pcms) =20 assert(MACHINE(pcms)->kernel_filename !=3D NULL); =20 - fw_cfg =3D fw_cfg_init_io_dma(FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, + fw_cfg =3D fw_cfg_init_io_dma(get_system_io(), + FW_CFG_IO_BASE, FW_CFG_IO_BASE + 4, &address_space_memory); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, x86ms->boot_cpus); rom_set_fw(fw_cfg); diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 3f0d337eb9c..34d7d107678 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1019,14 +1019,13 @@ static void fw_cfg_common_realize(DeviceState *dev,= Error **errp) qemu_add_machine_init_done_notifier(&s->machine_ready); } =20 -FWCfgState *fw_cfg_init_io_dma(uint32_t iobase, uint32_t dma_iobase, - AddressSpace *dma_as) +FWCfgState *fw_cfg_init_io_dma(MemoryRegion *iomem, uint32_t iobase, + uint32_t dma_iobase, AddressSpace *dma_as) { DeviceState *dev; SysBusDevice *sbd; FWCfgIoState *ios; FWCfgState *s; - MemoryRegion *iomem =3D get_system_io(); bool dma_requested =3D dma_iobase && dma_as; =20 dev =3D qdev_new(TYPE_FW_CFG_IO); --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742373; cv=none; d=zohomail.com; s=zohoarc; b=kUJDYvQJ0fWN3DYkOoBEr8uKUjbhBRcFAsUJzGbZOq1wpdVh2UB62kQGluadRs3E1xcMvn8e7R5zj2jGWHsBsIDWMeKYoncRrntr1DwwowtUXwkcfI9sJTWDh9ejwdUNuLNNJro2oOQAgmiHP3Lr5paWZ2H6ElE3R2cx53mMlYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742373; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=JVXB3iRjkS/JqWijITJpgknPo95A88NyGKC2Fvc8rOY=; b=AIJE5gEFohVw1QTGamb07NtqWhAv9Hys+Ooog/+maDvRvOPTTh9thlzj+sahN5na6LxrQ2oHqMMfuO6QoZzPdfZnTy9EW9grw7QWVG7YeAUHIkeezW03w8Inio7tNQIlX04n8Auog/js8X14dD00eTqZcXntfsdBg+54hkno/VM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742373618694.4370096016033; Tue, 2 Dec 2025 22:12:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4f-0005je-C8; Wed, 03 Dec 2025 01:10:49 -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 1vQg4W-0005Si-UZ for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:43 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4P-000126-NU for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:38 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-42e2e2eccd2so2390257f8f.1 for ; Tue, 02 Dec 2025 22:10:28 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5c3c8csm44612355f8f.2.2025.12.02.22.10.25 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742227; x=1765347027; 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=JVXB3iRjkS/JqWijITJpgknPo95A88NyGKC2Fvc8rOY=; b=d7gmmpL8KutWywFMZBw+T1uxQfOvoPExh5YzzW49dNyb/QVRyZrjeu+hGRmxnqACSb zyhabj/VE6unwwkv3vyc+vWtp9BFxUwPlLx+qDliyDI5A4947J0PsqaCnOSw6EXIDk1M hJGPYRVG6nMjAtVZmdA4I3kaAJSjH43ycUFyY0V1LPxd3qQur7d8RIxYceNxSDYiEuUB 6mmozPyutCsgOqmnI5Oo1lNwskDI8EEcmoJefsmFDXqgT8C26e/DZfKTEiPl2J5XgdDi c20a2DTTSThqfUg+DumpWZHldL5rhlVe3UozRgBw0aX/vdNiVecO8puJou9rsqHXQAnw Sv6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742227; x=1765347027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=JVXB3iRjkS/JqWijITJpgknPo95A88NyGKC2Fvc8rOY=; b=J3q5GdV3D4ypCW0d6cNJdb3sai2xx4vbLmytUk6XGBhFPVPITkUhKyCcQJ+JU+k3b+ itrWmiL7+fji4ZRhtBA6G67dtV0Fwa18KEx0rTBDmfEYKSy93ylGhaDtEnkaMHw2s5p2 BbniMfisr/5e6fzAISRFCQAGGAOSvaVncAbeLVhBgWpIy0G5RduzYwi69gOF7go0bLd7 xloVX+Lfnf9tL0V5jmqKZ8lHD9NpnzHW4bIBFiFxfDOOrRfxMDcnbwK/e+26cXdsy4my o9JTr6D6L4EHgfLK7o/VquCycdxsyePUblrDKzqHdVcRMVV6VgzSPL8owRWHjifhkpNU PY/A== X-Forwarded-Encrypted: i=1; AJvYcCXzVY5Vvft27Evs/KU/wC5zAHH7xFfpJJgAYaYzXbsrXIrMxaDy6aW1wPQDSVHQlx3A9pgxEGZZv024@nongnu.org X-Gm-Message-State: AOJu0YzK8N5W5TXv3q+NpYyiO2tXcppEjr3oy/fOZoRwbwClIzXgQstm RHl+IdsXQLKJsHEXlLv5oI7RQI4sBro+Q4gyiqdRqguk1rbuHhF8abFReiCOoPvDGD7N4KPE36W uYlf0UwM= X-Gm-Gg: ASbGnctYnkCUOMjrmmQeE9WZKEgbvzGyNcz9plnomlcHT3y6tW8q+51xJCbakdjgf1J /UTAK0hmO2PV8PVR+hpWfW4z/RbkZ+1sJlx8NgQPD+dSgiYyrV9h/YcsvExiDcFw8tG67Dey/3d X4SUP04eH6jtCU2GHpXtyUEjM6EuwIfx32TmynztC3ANU6jgXI4Wdb6X4hkvhjRBYBa15LcOZY+ TmABG5x1a7oLEVEWN+qYS8v3DFdGWApln4ZQATL625t50HYkg6Q9HJDSLtLtp8UXGBr/bbRM2lY s2Edi95ON3C5ZygoYT39DrNc9gsqF3wjKo4ydInNfP1vXcb7lrwasOgv6QlXhX4YyyUAJ/oS5Tq Gjp+lHg3B05kbA+nghFQfW1+IPwZLwREvZBPycqD8o2tRtIyaCPUFNHQuMqkQtHbz8mshnnELLE 11KxM9zd4UlXCgZx0Jl6ms9zVNLIYP6BpBDM1pYpK6W5GSN6w0oAZQTktplT58 X-Google-Smtp-Source: AGHT+IHwBGOUJJmGg47LMcX4Itx+dFea8UbTf5C3SnGsCjzHfNNw9xAGFgYsn7layyaV9ofxhYknRg== X-Received: by 2002:a05:6000:2504:b0:42b:4177:7135 with SMTP id ffacd0b85a97d-42f731a2fc1mr770032f8f.41.1764742227111; Tue, 02 Dec 2025 22:10:27 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH-for-11.0 v6 06/13] hw/nvram/fw_cfg: Factor fw_cfg_init_io_internal() out Date: Wed, 3 Dec 2025 07:09:34 +0100 Message-ID: <20251203060942.57851-7-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742375891019200 Factor fw_cfg_init_io_internal() out of fw_cfg_init_io_dma(). In fw_cfg_init_io_dma(), assert DMA arguments are provided. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu --- hw/nvram/fw_cfg.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 34d7d107678..2699e593860 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1019,8 +1019,9 @@ static void fw_cfg_common_realize(DeviceState *dev, E= rror **errp) qemu_add_machine_init_done_notifier(&s->machine_ready); } =20 -FWCfgState *fw_cfg_init_io_dma(MemoryRegion *iomem, uint32_t iobase, - uint32_t dma_iobase, AddressSpace *dma_as) +static FWCfgState *fw_cfg_init_io_internal(MemoryRegion *iomem, + uint32_t iobase, uint32_t dma_i= obase, + AddressSpace *dma_as) { DeviceState *dev; SysBusDevice *sbd; @@ -1053,6 +1054,13 @@ FWCfgState *fw_cfg_init_io_dma(MemoryRegion *iomem, = uint32_t iobase, return s; } =20 +FWCfgState *fw_cfg_init_io_dma(MemoryRegion *iomem, uint32_t iobase, + uint32_t dma_iobase, AddressSpace *dma_as) +{ + assert(dma_iobase); + return fw_cfg_init_io_internal(iomem, iobase, dma_iobase, dma_as); +} + static FWCfgState *fw_cfg_init_mem_internal(hwaddr ctl_addr, hwaddr data_addr, uint32_t dat= a_width, hwaddr dma_addr, AddressSpace = *dma_as) --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742292; cv=none; d=zohomail.com; s=zohoarc; b=Y5FtHMZUTZEwg+We+K51Lbni3N0l3rsoTWPY8g4hpsn2b9bI7NTkoQJlFF22Av6z67PF5QPqhHrW/0zQ8zYjbIpYH6lvpRZp8jXFXt2TFRKdDppIkAqqVFCnP+W0n8uhhkRXeVZdnbWps0E1OqjI4mhClE5ULbqsogc7lza7GQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742292; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NmzdRNy+XVrnKgfA7Np3tADI6SbGw+r+ug99GdFxAXA=; b=ecMTKB1P0BuNZRgUL3WJNd0mqyErb7TXkpvVfrROzBpeuT7HWENunp1tiO6IO6NcAO67niDPVRmBykJWWbX4hrYexQt+rsytjxWEc+we0hGOMUqK4xnTCvNDJJ6UTjzKeHbBDrxp4uV2tDL+tbNPntjYeORbwQNUDhgsjl6zCy0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742292015985.5343900980407; Tue, 2 Dec 2025 22:11:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4d-0005cW-K5; Wed, 03 Dec 2025 01:10:47 -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 1vQg4W-0005Sh-UZ for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:43 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4T-00012v-7q for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:39 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4779a637712so39508275e9.1 for ; Tue, 02 Dec 2025 22:10:35 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5d6277sm37152129f8f.17.2025.12.02.22.10.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742234; x=1765347034; 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=NmzdRNy+XVrnKgfA7Np3tADI6SbGw+r+ug99GdFxAXA=; b=h8mfNrtSzAGk+R50v6+ZsAAGFSEf53GVAX5lTIxjFQsZIgiSiZYdx3uVYpIabSXAgQ q2H96XyNsLshx+hhq/IFdvYHpFXjT4BeFr0f26PH6umYlLFRgYccQU1cTfZeCdbdUcVB Lmz4debdB08X2ehsokoeRhtNPo75XQDnnT/9Do3OkD9zhRbl95IilbBvUbjORzMW3iue SQXqVbDcuj1xEEYKrz/JUeYN4fSsTjaBlef8QxxGvEdSs7wCBnFAnIgrDPDp5+mXUg7a 8YcrIRgB++WQ93Xq1pVlVcVJMe0T87NCbzhJa7FCxDL8JinixpvuOirQ/yj7Ga5PSicL zKZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742234; x=1765347034; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NmzdRNy+XVrnKgfA7Np3tADI6SbGw+r+ug99GdFxAXA=; b=vWNtGzkAT6xGFo74nat1pcM0KX7knnpY0KW2+cKopg5hGigXuWSSJMk/fm1s+JRw8g E3atUX7P9jU0tcULXML1+noA+taSbxKRGJE2P2OL5L9M1eob6QOo68o1FP+nTYtMzZ2m FfrkC9pE8aBYQ6xUh/IlXe65Wgs8I2l6SUk9zYT4eXi4K0UrHOyZ5NxbHgcYmP4tgF/D Q4AtSoYOvWwveLiYFhCpVFSSNMLe7z4vi+UTyU/ZWQyYkLRXp0J9Rbj2SVGsu86z0CfH 4eqhNsno+DZsGT5TWCvtlNEgp/peog2oGu4hq7/pv1csCHBtwWniC1RIqi70+ccKb9DR 1lvA== X-Forwarded-Encrypted: i=1; AJvYcCU52q1CBkw2FokLbCO7ErEBka+6LE5SC9Tm6gYIShSDuKG0GQvlEm5BXNx3vfUzhvY1WNoQAeebpVnY@nongnu.org X-Gm-Message-State: AOJu0YzUSsdTXV6LZLg1YM41vvMjGJJUpy0h2UkOIx23ao29T/unzr6I yE3DNrvD1TUmBXWlDDdDzpOeT4PcKX7Q48CeYjhl2RxnVwoFTVCTQhx1pPEES50WmEbKQ+zhgYE SfRB5VQc= X-Gm-Gg: ASbGncu41M+6PuKdYJVQ1kT61dXz+m3NCbqT8Zmte9HHDuum94QIYC4r0nTlCX4NaHJ 9NGZeVFBrxWGvcO4tgL/tstj2VjOfhdo3aUpzfmdWwJCup4EEaaE21yVp7RMeolReuKidnZOi48 o5lNgaE2Wcs8FUtCCDf7L7JWx2aBUH69Bsnl7tgcqtcMlcMtPaplkTYdXJaPnPB/D8a5jcY8yHs sZ2rjwUqq+L0hy63a2p4D8qgGhOLht1Cmc3RCWPmufv5LsyULhn8EPIbNdcabCMzxWeV1k2yb4D bbCs9i8UINVMc2BSm8TmmiP+bXNSTuBhfgjE0ZJ06ah8f077PeHYfop+snPqGAayjFmNUT42OG2 YwDmO15zpHhkPXw2HJHoroJd0J7Twi4D11L+lMATW24IvS08h/uY0+1D/hZqC+gW33cCwDv7uPC 5nzDRluw41Wo0wqJD9Jq3AptrZAyuEMVFbM8ywdfFhRoLdgfrRqeh0hrGiBIXW X-Google-Smtp-Source: AGHT+IEPApft5PGZWsFPz//8A8cqjaVIx5m13oFIf9W/WuBW9rwX9Y+20LttgbfbDUMnp9zRiB+bCw== X-Received: by 2002:a05:600c:1f0d:b0:477:952d:fc00 with SMTP id 5b1f17b1804b1-4792aef32d7mr9426015e9.12.1764742234286; Tue, 02 Dec 2025 22:10:34 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH-for-11.0 v6 07/13] hw/nvram/fw_cfg: Add fw_cfg_init_io_nodma() helper Date: Wed, 3 Dec 2025 07:09:35 +0100 Message-ID: <20251203060942.57851-8-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=philmd@linaro.org; helo=mail-wm1-x331.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742293243019200 Calling fw_cfg_init_io_nodma(...) is more explicit than fw_cfg_init_io_dma(..., 0, NULL). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Zhao Liu --- include/hw/nvram/fw_cfg.h | 1 + hw/nvram/fw_cfg.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/include/hw/nvram/fw_cfg.h b/include/hw/nvram/fw_cfg.h index 7348cbfbc34..a2b8f7fa864 100644 --- a/include/hw/nvram/fw_cfg.h +++ b/include/hw/nvram/fw_cfg.h @@ -305,6 +305,7 @@ bool fw_cfg_add_file_from_generator(FWCfgState *s, Object *parent, const char *part, const char *filename, Error **errp); =20 +FWCfgState *fw_cfg_init_io_nodma(MemoryRegion *io, uint32_t iobase); FWCfgState *fw_cfg_init_io_dma(MemoryRegion *io, uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as); FWCfgState *fw_cfg_init_mem_nodma(hwaddr ctl_addr, hwaddr data_addr, diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 2699e593860..079c28f9212 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1054,6 +1054,11 @@ static FWCfgState *fw_cfg_init_io_internal(MemoryReg= ion *iomem, return s; } =20 +FWCfgState *fw_cfg_init_io_nodma(MemoryRegion *iomem, uint32_t iobase) +{ + return fw_cfg_init_io_internal(iomem, iobase, 0, NULL); +} + FWCfgState *fw_cfg_init_io_dma(MemoryRegion *iomem, uint32_t iobase, uint32_t dma_iobase, AddressSpace *dma_as) { --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742377; cv=none; d=zohomail.com; s=zohoarc; b=O89YHzrklsSyFcuRa1bq9Et6D5Y/o27koFZgI11wYsjH88DcqxJwVTpqW+zEczRt2O6FMhEyR2p54tlcgr+4ACu2gsMl1JNiDz3v1hwzBMARuGbitoHyxpGYyBEIVCHkPKoQTrqVIsMtEWAGFyRVbduq4WT0TrSW8QAW7H1BU9g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742377; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cJ7ely9hzqgs7VmHKEXFRsGMqnx7PoNMDpzJyHt0paQ=; b=CxUitkv7qlsipnbA97WG64/bxPRDUhqMFSYQw3eCDN4usFfmzidJQZC/GQMsGEfhUaVryhkfl1DnyIJksDrqSn8UMRBbiw4za8+JJG3GmQT64VQFP+1zjFJlek0Glff/Uk6YJ1z/p3vsSwYV81eb2VyNuzGQn4slZZjnRW0yV70= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742377620256.9016108482822; Tue, 2 Dec 2025 22:12:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4f-0005kU-JF; Wed, 03 Dec 2025 01:10:49 -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 1vQg4b-0005Yo-Qg for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:46 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4Z-00014M-1Z for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:45 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-42b38de7940so3094474f8f.3 for ; Tue, 02 Dec 2025 22:10:42 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1ca7880asm37423781f8f.31.2025.12.02.22.10.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742241; x=1765347041; 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=cJ7ely9hzqgs7VmHKEXFRsGMqnx7PoNMDpzJyHt0paQ=; b=HKzOMzNPnRa0XbZSYPGTKUZ1LPKYR8AMuIyLf/JZao2X3d44WsuNywz4VXzIBJGvGA AOcrOqqsz0ANMl5msze7b+iD2ndVmfCXrqXT9Yoe+MQ7Q0fMIy+NEzUCkbHXf5xMNQOA yXS9Ui672YzWYdwE9uEZwzQshb6SESOvAGkex11jkKPnLn1Wx6yeUAvS3f7M7iWLy5sd lrQX5uiB5XXle4rv8L2UHS6Xd/Vy9ipWgqh9Mi38cSuT40e6/32JICTe/ykkRZu3YVHE dP/iIy5B96kU654w3cWYtTTMwv1bbxWBYAxGZtE2JJH/0RkWGvjtf06rbeyFSDjp/gzh PK7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742241; x=1765347041; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cJ7ely9hzqgs7VmHKEXFRsGMqnx7PoNMDpzJyHt0paQ=; b=sW8+KrzX97gz6TpT05G5TfuYoDr/iaeOPGIpp4MQ/sjPPtLj5Dbv/jvcUb+9JClDpM dqhcoDFl5vrfBpQUsMsUEh5KhCdQM4JXwkQPehUKYt5zxrY6KhCCBhSl5Y+hyaUJB11U PgqVQLBqL1JWTmzYGWHFqlVURmcZojMjZWyEYLaxYJYb//LztZOqjvnQ5A4vkiG7g3T+ b3arqWUrXtSJrBJRR221lFaHttXF1ihXh9DlgrDruzhRGXk5NtrplA+lXb+cTPhvF3ya N5r3mwSaGRKUetCPi5Q25EPm1bUBhbbKGpPijXP51sWgOC3VJdu/k7pEL1YXpNVonf4h 9Mmg== X-Forwarded-Encrypted: i=1; AJvYcCVFzsz1SdQbUndUowrDwU7O6HaWpGfXL8R6lnwYgIWHYGIaviv4fktXDn9JfCnwOInFIrz/yTIG/XNZ@nongnu.org X-Gm-Message-State: AOJu0YxM8fOAUHGMeS56E3lFhFkZXMI7XogI/skv/Z971dpmPnuAcmdy LQam7s691dHdWIYNE5KyzKLwi6Fve/3huf8s/JomjpGC0YILLxiM4Ced3ZwuP+Q8ZuY= X-Gm-Gg: ASbGncuR0PLytOtEkZT4xamn8f4LGJLmgXjT5EPZIQrSdjriKguCWWvPmHq4kJan/Su mToA+GiP9KfSKp74GEeLdg3ZHmNjwWIvBgclcewhuxEq2qQWBFdlKMIwgsxNJyPCZkM3onNM4B3 D0T6OGb6HQ9S0nImbpjxo0oMnKVq5g8H4Jy0RByN9rbu1aif+lD32TSjqQWbM9AxPE1nmQISVOE seEdqWk+E6lBQg78B+0QjxPANiqHegEHVcj1oqUZvmrpI+BZOR6c+eCVoQgLMMfR3DTmeFPsYZr T6QmRUMROSYjGtwFFs0kw6pxOewMwWHfzLs4ARADRbbQ+gMK0LlJIZD3DmMhRSvuYV7ObHdJ7VB krFbybRsyySk32OHTWjEurQXvffvCKgnMqLRdhgJAyFzeBXdZNEj6cUMBSsRr+EzQkt4OUi71Kg 7yPIDS+bCPzfeM4bpm08tfv1KD59zGaj1/jnxLVuzI3a7qYwrH8WuP3ltqnsfF X-Google-Smtp-Source: AGHT+IFQb/Dad/BvwX+uiwS8U+3g2hp5gcX664TQgINFZ5o5vj0uy/SDcWEx8w4i5DBAvKfEJ4x4KQ== X-Received: by 2002:adf:fe4a:0:b0:42b:41d3:daf8 with SMTP id ffacd0b85a97d-42f73196803mr592087f8f.18.1764742241187; Tue, 02 Dec 2025 22:10:41 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko Subject: [PATCH-for-11.0 v6 08/13] hw/sparc64/sun4u: Use fw_cfg_init_io_nodma() Date: Wed, 3 Dec 2025 07:09:36 +0100 Message-ID: <20251203060942.57851-9-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742379692019200 Use fw_cfg_init_io_nodma() instead of open-coding it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin --- hw/sparc64/sun4u.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 82c3e7c855b..6dc9f64b74d 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -683,14 +683,7 @@ static void sun4uv_init(MemoryRegion *address_space_me= m, graphic_width, graphic_height, graphic_depth, (uint8_t *)&macaddr); =20 - dev =3D qdev_new(TYPE_FW_CFG_IO); - qdev_prop_set_bit(dev, "dma_enabled", false); - object_property_add_child(OBJECT(ebus), TYPE_FW_CFG, OBJECT(dev)); - sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); - memory_region_add_subregion(pci_address_space_io(ebus), BIOS_CFG_IOPOR= T, - &FW_CFG_IO(dev)->comb_iomem); - - fw_cfg =3D FW_CFG(dev); + fw_cfg =3D fw_cfg_init_io_nodma(pci_address_space_io(ebus), BIOS_CFG_I= OPORT); fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)machine->smp.cpus); fw_cfg_add_i16(fw_cfg, FW_CFG_MAX_CPUS, (uint16_t)machine->smp.max_cpu= s); fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742335; cv=none; d=zohomail.com; s=zohoarc; b=S51pdEYfKXNlKQ5AHeNa5ggtMeN7/P/ooQy3weiNbstGiiQIdc71nkPW36Ye4A5CVvshyHp2K62q6NWaC6YIbW1Rdq+7Q9xXeQItlz7ya6vW57y4zsu2u0eCyE6bnePAYM2Y6MNNnmHaHIXa7PN+koOWsP/AtycWKB7gan9e2FA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742335; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=quCJPogV7nRUmrNwgtt7+y1aIO17eQXRGgz3UisICQs=; b=hsPRm2Zb0jx7eUMLWiM46nIeNwL7nXIZeT6ge1QHOJ+Xon9aNWvM0z4X17WyXaGPwauc+cdiT2QnBU+IhCE+6kF27WXwKMmgwL4iydNvywH0mHmUJPz00p07g/jGqfYFcmnQnjH+hywJU44IWHe+jE27t+rStC9QKItGiWIGsno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742335214891.3885083539511; Tue, 2 Dec 2025 22:12:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4k-00061Q-4k; Wed, 03 Dec 2025 01:10: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 1vQg4i-0005vd-3t for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:52 -0500 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4g-00016F-1k for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:10:51 -0500 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-477a219db05so40866675e9.2 for ; Tue, 02 Dec 2025 22:10:49 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792a79dd66sm29299405e9.6.2025.12.02.22.10.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742248; x=1765347048; 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=quCJPogV7nRUmrNwgtt7+y1aIO17eQXRGgz3UisICQs=; b=LxRjV1mOd5EfdizpnEuiyZ2yu+2+6/LkUVNjX0gUwb3RCkXx6eHqmUItNK20iMv+3P NK9il66ke4f3P1FPnHF85kKbKqiMvi8+2BValQzmqJhL3IalxjT/v0Ber4w4/jOuOeeG CTqvshnbJGZ/75STFu4LmuaE9Lc7TVey++ZS6+EHPEKbyNTEHZTRRt+7s7w884g2C34l 8mclUArtLAcqf/CtdyaeBrUDNoEm7YmI+J19weeGo6xX6l9YIO9cNklje5tril6jepgD t8z064PXdO7iF4nl4DJvtPqZL4qi5RCE3g82Z7seR7AC6XgVc4chZSaCPsGwaIohfQS+ f2jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742248; x=1765347048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=quCJPogV7nRUmrNwgtt7+y1aIO17eQXRGgz3UisICQs=; b=mQVdKDTgiek28bEqKC02Owqz3iUmLD6vkQcU+4eIwkOrmMwUgnwfoPtoXfa8ucH27X 3zuJOReuN/ieZcYIIt39FUNJn6BKSkI1uHgOdc0t5+MBQuVr0Pjos2a0nJmIIjB6ekmj PKsMN5ZgCQ5cELcIzEuApO43M/H4AOoftaE353ANJZf5G9lPPuln5tfVpCQ6F00x9E24 E0D4PL+0PDuey+JWzfROg7TOmCEx4Ia9BEyAVyufApPaq/07zkKPjaP2B455URX4jJyi /2WAtzgYt/oE3EPnKjqOj4QnsT1BFnZoIGxi47z/pHu6cQSCXkmfEOuZtIsfLEqnl7nQ +FOQ== X-Forwarded-Encrypted: i=1; AJvYcCWhEaekonaSxIWXcdYJYJ1T3wlP9A2dFp5LQbnk5VKVZYWCtMjeRAv2Lag9d+ijdmeOus0OjRFDKiSQ@nongnu.org X-Gm-Message-State: AOJu0Yw2Ykx8HGcscMiQgXsnFOQa+h/VAUGFd1LPYOJwvq9zn4PQE03a YggQTfFNmet0jllHim3n9qUsajPuxSuBUEXNu9iZVrRu0SDndORkDA3xbRJ9OqV/pkw= X-Gm-Gg: ASbGncshBq6M9gOIPmfVvPiTsvM4Q2POARFSjB/u/3U+r0kqmgZz63OHS8XC0C0UfTQ 4etLTMnPcZf1RzzBDOeUjphlQFD4/LWVeMvMabnBsq7zgo/woxokdYCYxJM0xhBXTO0sEDL6F6t v9B68GJUSN6xO18HUV2aMQOwCZT4UlRmecmD4hXW4VhostN0iBSterUds0PphSNjTtobuBEbKim HTcINpfv6VIqIn3ioc9SY9F40vt3ooeKBpN8M8sVpdQSrLke6YBynZIW7MnLjZbAHxUM7cH0WD9 3BxDvD1XwVUZssCWromqCAr5mb7BMxw8QekHVhtPAsEKLT4detN8HsXxG71RyUkLdJhE2Xk+NMF 5IyoIEMKEV8UJ1CFdeNcUkod2IT2Ionn8tX1dIjiTc4OEHuq/zUURjP0rVgkrvoc09FILF7qE3f 3hHjwlZEF3JoSafn5NsqOe0ILRli/p+FocJ7Ewob6NVvi3NsdF1yNTLsJyuJdB X-Google-Smtp-Source: AGHT+IHb5GGL3dNPV8pAWpWQo+oO1ln71vxDjpnW98Ij7PAUP87vZLn4REjuXe0G0YBrVVytO5PbnQ== X-Received: by 2002:a05:600c:3b97:b0:46e:33b2:c8da with SMTP id 5b1f17b1804b1-4792af40489mr10490725e9.32.1764742248380; Tue, 02 Dec 2025 22:10:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Gerd Hoffmann Subject: [PATCH-for-11.0 v6 09/13] hw/nvram/fw_cfg: Remove fw_cfg_io_properties::dma_enabled Date: Wed, 3 Dec 2025 07:09:37 +0100 Message-ID: <20251203060942.57851-10-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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-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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742335486019200 Now than all calls to fw_cfg_init_io_dma() pass DMA arguments, the 'dma_enabled' of the TYPE_FW_CFG_IO type is not used anymore. Remove it, simplifying fw_cfg_init_io_dma() and fw_cfg_io_realize(). Note, we can not remove the equivalent in fw_cfg_mem_properties[] because it is still used in HPPA and MIPS Loongson3 machines: $ git grep -w fw_cfg_init_mem_nodma hw/hppa/machine.c:204: fw_cfg =3D fw_cfg_init_mem_nodma(addr, addr + 4= , 1); hw/mips/loongson3_virt.c:289: fw_cfg =3D fw_cfg_init_mem_nodma(cfg_add= r, cfg_addr + 8, 8); 'linuxboot.bin' isn't used anymore, we'll remove it in the next commit. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- hw/i386/fw_cfg.c | 15 +++++++-------- hw/nvram/fw_cfg.c | 26 ++++++++------------------ 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index 498da9ec69c..bf38338fb47 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -216,18 +216,17 @@ void fw_cfg_build_feature_control(MachineState *ms, F= WCfgState *fw_cfg) #ifdef CONFIG_ACPI void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cfg) { + uint8_t io_size; + Aml *dev =3D aml_device("FWCF"); + Aml *crs =3D aml_resource_template(); + /* * when using port i/o, the 8-bit data register *always* overlaps * with half of the 16-bit control register. Hence, the total size - * of the i/o region used is FW_CFG_CTL_SIZE; when using DMA, the - * DMA control register is located at FW_CFG_DMA_IO_BASE + 4 + * of the i/o region used is FW_CFG_CTL_SIZE; And the DMA control + * register is located at FW_CFG_DMA_IO_BASE + 4 */ - Object *obj =3D OBJECT(fw_cfg); - uint8_t io_size =3D object_property_get_bool(obj, "dma_enabled", NULL)= ? - ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t) : - FW_CFG_CTL_SIZE; - Aml *dev =3D aml_device("FWCF"); - Aml *crs =3D aml_resource_template(); + io_size =3D ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t); =20 aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); =20 diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c index 079c28f9212..e0a140d01c0 100644 --- a/hw/nvram/fw_cfg.c +++ b/hw/nvram/fw_cfg.c @@ -1027,12 +1027,9 @@ static FWCfgState *fw_cfg_init_io_internal(MemoryReg= ion *iomem, SysBusDevice *sbd; FWCfgIoState *ios; FWCfgState *s; - bool dma_requested =3D dma_iobase && dma_as; =20 + assert(dma_iobase); dev =3D qdev_new(TYPE_FW_CFG_IO); - if (!dma_requested) { - qdev_prop_set_bit(dev, "dma_enabled", false); - } =20 object_property_add_child(OBJECT(qdev_get_machine()), TYPE_FW_CFG, OBJECT(dev)); @@ -1043,13 +1040,10 @@ static FWCfgState *fw_cfg_init_io_internal(MemoryRe= gion *iomem, memory_region_add_subregion(iomem, iobase, &ios->comb_iomem); =20 s =3D FW_CFG(dev); - - if (s->dma_enabled) { - /* 64 bits for the address field */ - s->dma_as =3D dma_as; - s->dma_addr =3D 0; - memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem); - } + /* 64 bits for the address field */ + s->dma_as =3D dma_as; + s->dma_addr =3D 0; + memory_region_add_subregion(iomem, dma_iobase, &s->dma_iomem); =20 return s; } @@ -1198,8 +1192,6 @@ static void fw_cfg_file_slots_allocate(FWCfgState *s,= Error **errp) } =20 static const Property fw_cfg_io_properties[] =3D { - DEFINE_PROP_BOOL("dma_enabled", FWCfgIoState, parent_obj.dma_enabled, - true), DEFINE_PROP_UINT16("x-file-slots", FWCfgIoState, parent_obj.file_slots, FW_CFG_FILE_SLOTS_DFLT), }; @@ -1220,11 +1212,9 @@ static void fw_cfg_io_realize(DeviceState *dev, Erro= r **errp) memory_region_init_io(&s->comb_iomem, OBJECT(s), &fw_cfg_comb_mem_ops, FW_CFG(s), "fwcfg", FW_CFG_CTL_SIZE); =20 - if (FW_CFG(s)->dma_enabled) { - memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s), - &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma", - sizeof(dma_addr_t)); - } + memory_region_init_io(&FW_CFG(s)->dma_iomem, OBJECT(s), + &fw_cfg_dma_mem_ops, FW_CFG(s), "fwcfg.dma", + sizeof(dma_addr_t)); =20 fw_cfg_common_realize(dev, errp); } --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742373; cv=none; d=zohomail.com; s=zohoarc; b=myOqQ2JvwprQydFuxChFLDtUnUd1cMalU7WT36ZmlNHgWleKJXrzjC6moG8j2l4kNGRjtB+fn/9ZwSbR+WrkJeUcYao0NcIG3cz3CF4xkt2vzxlY5w0EwprKk/pbMAsG37R9WKQoYHGh5a3l5Pb+WolpSPJseyF45Zot3J6876Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742373; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NHRX2PHd2udelGOqyOgj0hRR5PBHd5ge4rOssALUElU=; b=DwYi+cBCX0hRakwxXlM3b3cOhvjuqke6raR1OnbBquak+HaszP7k+XcyNJ/AjZFQivZvHxsnKxJXtWNuW949Edv0oSNx7l7ro4OqjRRTHRka0ACLOpBOGox0FiMotDkotcmY4IU3XN3KwesyUx1JTVy+Xp2Fg5RrKhDHeUD9pJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742373398454.11183724677903; Tue, 2 Dec 2025 22:12:53 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg4s-0006Gg-8J; Wed, 03 Dec 2025 01:11:02 -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 1vQg4q-0006BZ-8y for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:00 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4n-000186-MS for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:00 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-42e2ddb8a13so1525614f8f.0 for ; Tue, 02 Dec 2025 22:10:56 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5d6181sm37271744f8f.18.2025.12.02.22.10.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:10:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742256; x=1765347056; 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=NHRX2PHd2udelGOqyOgj0hRR5PBHd5ge4rOssALUElU=; b=gY6yUhdX9e4uxPTueQk2C8uTqfreWys6rh84/XkeQ/m5WBov0eorkVRjgvXLePmkuq +KukL3cSpYT3pRqG23VMEKaMKM5thl6t0Ce9aLUUS7Yk7B7bVcuIsZyXfwFdDwodbrF0 KjQEnDPHNZTcIm3UMAvvUF2LsbJLiAtYE6WrQyyXCFRwyeOFebhbtmhEyo6Ql/vYxjOO b12iRtYr+wdDUybdCtG//jNisFGz7NZCibo2ojZN+JM1JhRgqJsIcxWjXEOFvTGkzXNC FmMU0LR62n6Y+foEIJLN1bN97g4pMzP0P4nacVehNlD5ltif2Do3N5z+2HrfCasjwklG SjkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742256; x=1765347056; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NHRX2PHd2udelGOqyOgj0hRR5PBHd5ge4rOssALUElU=; b=ZyMX5T5Q5YuMNVe72lQQhgsXEU1GTYvIxVuNG0ky74ZU3hFZpO3iZdTdPGBnn1aZdR 8g0E/oA889WVg1CfEbasT0mmOWjE51LvqD+TEbPR+kLFm9mclTprdzKuKDh9p0tlWUUQ u74g/X2QrHj8yxwunzPSJUZICcfXU/gOkjDs66KSPqeof8J3AJ2btg9Rwlp/Whidixmq FnwqAA2ZdkqiAsv0whgEyqD3vor6K3UKHRkq78ybDQN2i7M4U2Gpp+MdShuCJI5P6q3h y5xntVpqvxv1InZLU3MPJuZQqXcuywRII66StqgrirE89XvoR3BZDMtcbpMVYkPzzYWL BPAg== X-Forwarded-Encrypted: i=1; AJvYcCXAdRgwB+r5caZ6WjtRgn73g0aEXVTcjVkJDt8p9z17M69o2l4gQM4+yVCOVy64odTka8G8OFtF2Yl5@nongnu.org X-Gm-Message-State: AOJu0Yxob15kCCCpc5QlxpS/06Uv7K/NFCP8m/JcuXP9wHJ+Vrbm/xGm EdugSBDeTnM3+m4cAxxCQEIgCmSP6w43oZkyvfipcvj5u8R6uqSXxlPrapM+sC9nzaQ= X-Gm-Gg: ASbGnctr0IWZZzfk7nnQF2r0BwNzh8OduQwUnggdCdgRtWXd5KSaEImNO/DnkVLOtLO haWUV4vCnhfUjsGEJzXF6gkwr4T2kQhVMQZWfq+8eBeUQjL3Hf5qUx4tpmIsmc1q8TkHYQpXmOJ h2wzz8Rq5d6Wz2giIxRrZA22II3Z+rcNuwpsThWsJvjnkL84PQFGaCdWt+BWXxfh1tpVrwMfQJn dYLo1zXA+gFHXD7zUoHjcCNIqpSw4LPi91DFwYlEZipQHh4CSaS49Sv9xlUhq64wHfTuuuWiBH+ qAyjyqX62TLKgkRMMTEDoqgaqAP+9ij28K80a7ySswXyCG63QhUpYsJhg8DLXPB3uftGWm7jGcz vz4dI2qtlMoYEku8bvk9fiWANtKiqJAz/7tMdNGdjNcJbT7eRnRljEoEFNRZI7yJ4wgaUn8g3Xs t3VX1YvXkUfxip3HYKlJ1dxk8IAOXgD71+2dmYod+6HXWLzGaNEvH4k9HhuW38 X-Google-Smtp-Source: AGHT+IFKuw1jPjM//8+kLiiOD5oufj6Fdb9uBQLN84ztWIhzXUwriiQZtCRvdyWaXSYlgaVP9Db7Jw== X-Received: by 2002:a05:6000:4383:b0:429:cce9:9b76 with SMTP id ffacd0b85a97d-42f731c43d1mr779951f8f.50.1764742255535; Tue, 02 Dec 2025 22:10:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Sergio Lopez , Paolo Bonzini , "Michael S. Tsirkin" , Marcel Apfelbaum , Richard Henderson , Eduardo Habkost Subject: [PATCH-for-11.0 v6 10/13] hw/i386/x86: Remove X86MachineClass::fwcfg_dma_enabled field Date: Wed, 3 Dec 2025 07:09:38 +0100 Message-ID: <20251203060942.57851-11-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philmd@linaro.org; helo=mail-wr1-x431.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742373760019200 The X86MachineClass::fwcfg_dma_enabled boolean was only used by the pc-q35-2.6 and pc-i440fx-2.6 machines, which got removed. Remove it and simplify. 'multiboot.bin' isn't used anymore, we'll remove it in the next commit. Reviewed-by: Zhao Liu Reviewed-by: Igor Mammedov Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- include/hw/i386/x86.h | 2 -- hw/i386/microvm.c | 3 --- hw/i386/multiboot.c | 7 +------ hw/i386/x86-common.c | 3 +-- hw/i386/x86.c | 2 -- 5 files changed, 2 insertions(+), 15 deletions(-) diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h index 8755cad50a3..201eee80eb7 100644 --- a/include/hw/i386/x86.h +++ b/include/hw/i386/x86.h @@ -30,8 +30,6 @@ struct X86MachineClass { MachineClass parent; =20 - /* use DMA capable linuxboot option rom */ - bool fwcfg_dma_enabled; /* CPU and apic information: */ bool apic_xrupt_override; }; diff --git a/hw/i386/microvm.c b/hw/i386/microvm.c index 69f04d74a15..8521df83584 100644 --- a/hw/i386/microvm.c +++ b/hw/i386/microvm.c @@ -641,7 +641,6 @@ GlobalProperty microvm_properties[] =3D { =20 static void microvm_class_init(ObjectClass *oc, const void *data) { - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(oc); MicrovmMachineClass *mmc =3D MICROVM_MACHINE_CLASS(oc); MachineClass *mc =3D MACHINE_CLASS(oc); HotplugHandlerClass *hc =3D HOTPLUG_HANDLER_CLASS(oc); @@ -675,8 +674,6 @@ static void microvm_class_init(ObjectClass *oc, const v= oid *data) hc->unplug_request =3D microvm_device_unplug_request_cb; hc->unplug =3D microvm_device_unplug_cb; =20 - x86mc->fwcfg_dma_enabled =3D true; - object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto", microvm_machine_get_rtc, microvm_machine_set_rtc, diff --git a/hw/i386/multiboot.c b/hw/i386/multiboot.c index 78690781b74..3b993126edb 100644 --- a/hw/i386/multiboot.c +++ b/hw/i386/multiboot.c @@ -153,7 +153,6 @@ int load_multiboot(X86MachineState *x86ms, int kernel_file_size, uint8_t *header) { - bool multiboot_dma_enabled =3D X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma= _enabled; int i, is_multiboot =3D 0; uint32_t flags =3D 0; uint32_t mh_entry_addr; @@ -402,11 +401,7 @@ int load_multiboot(X86MachineState *x86ms, fw_cfg_add_bytes(fw_cfg, FW_CFG_INITRD_DATA, mb_bootinfo_data, sizeof(bootinfo)); =20 - if (multiboot_dma_enabled) { - option_rom[nb_option_roms].name =3D "multiboot_dma.bin"; - } else { - option_rom[nb_option_roms].name =3D "multiboot.bin"; - } + option_rom[nb_option_roms].name =3D "multiboot_dma.bin"; option_rom[nb_option_roms].bootindex =3D 0; nb_option_roms++; =20 diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 60b7ab80433..1ee55382dab 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -645,7 +645,6 @@ void x86_load_linux(X86MachineState *x86ms, int acpi_data_size, bool pvh_enabled) { - bool linuxboot_dma_enabled =3D X86_MACHINE_GET_CLASS(x86ms)->fwcfg_dma= _enabled; uint16_t protocol; int setup_size, kernel_size, cmdline_size; int dtb_size, setup_data_offset; @@ -1004,7 +1003,7 @@ void x86_load_linux(X86MachineState *x86ms, =20 option_rom[nb_option_roms].bootindex =3D 0; option_rom[nb_option_roms].name =3D "linuxboot.bin"; - if (linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) { + if (fw_cfg_dma_enabled(fw_cfg)) { option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; } nb_option_roms++; diff --git a/hw/i386/x86.c b/hw/i386/x86.c index f80533df1c5..dbf104d60af 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -375,14 +375,12 @@ static void x86_machine_initfn(Object *obj) static void x86_machine_class_init(ObjectClass *oc, const void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); - X86MachineClass *x86mc =3D X86_MACHINE_CLASS(oc); NMIClass *nc =3D NMI_CLASS(oc); =20 mc->cpu_index_to_instance_props =3D x86_cpu_index_to_props; mc->get_default_cpu_node_id =3D x86_get_default_cpu_node_id; mc->possible_cpu_arch_ids =3D x86_possible_cpu_arch_ids; mc->kvm_type =3D x86_kvm_type; - x86mc->fwcfg_dma_enabled =3D true; nc->nmi_monitor_handler =3D x86_nmi; =20 object_class_property_add(oc, X86_MACHINE_SMM, "OnOffAuto", --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742326; cv=none; d=zohomail.com; s=zohoarc; b=A1JUblYbzTU13nIiXeCeHdMSroOD3+LmZVqe4LO49FsM07yQYqSmN7r+47smdEJ5JuobOqnSQ5/hW3Thn9zJUNRoTNliN14tGwlU6+6bn3+TTDBPsFmGeFR14Cy64qSoGLphhUFBIrj3HhXv15wCN8RbD2z2u/ANEjc4DrwEIis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742326; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cMxfe4ov4WmNjsTPrNW2SCp7e5pEivmzbHveo/n71po=; b=mO27dZf5WPHj6YMECdL654zCsgpdFlLFKUWpiQuixlXtXlb7v8RpDEFGD4A4TnTCk+l7SJWD06/Pmh7KQPy2Dc3M/GOPIX9jit1JdxcIrH32POhnwZv/PhSP2vha3878Iw1ZP+vKz0NteXKpP7sqIhMHSlrZQyZu+FynKD45ZXQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17647423260580.776446351410641; Tue, 2 Dec 2025 22:12:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg50-0006hI-7t; Wed, 03 Dec 2025 01:11:10 -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 1vQg4x-0006cV-TT for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:07 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg4u-00019L-Jv for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:07 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-42e2cf93f7dso2481163f8f.1 for ; Tue, 02 Dec 2025 22:11:04 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1ca1a303sm39294494f8f.27.2025.12.02.22.11.01 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:11:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742263; x=1765347063; 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=cMxfe4ov4WmNjsTPrNW2SCp7e5pEivmzbHveo/n71po=; b=iS80TfM/hjUPPMMy7Ah/zqW6sBBS3gmFL/mDtholq/u+HYgx73IAjz6o4PhjVf7kxB d9M74u4GBqJ1NyBarW2gdf9SJdZMuJSC9rDZx0Epzin5LQ2JwM1LuzPd1Pf51AeXuI45 J2JY6IDu3h7bpaoU2Ilp4eOlu0L84U2AVy8mSc3rHkwt4RI3XzAf3xIolkYzI2PsXwzm X8+1wXxPA1K2lbRBZkxRKtb6fsi/BrsRlPqnPvxHzrX8W53vhqrcLm3MiHAOIvx8vRiF fM4PLD4IeUnTL/otdIF+73rVfaD+dQW/LX/46Lo5nTLTyKpnVz/oY9+DRMKuRgQ9IPTB yDZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742263; x=1765347063; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cMxfe4ov4WmNjsTPrNW2SCp7e5pEivmzbHveo/n71po=; b=aGI5ow561rQoQ+eLPtFIuKQ9fHa/Ye+1gzQYmiHQft9tSCybLWRP6LSsy3xCXsSWM7 0pQM5hOYSF56hC1ggOldU5ben/UE9CTI04n9wQ2DsChFjoHOZ2SXawcF9s0zTVHbSQkl UZNJwlgeEal/wyZ5OodhIWFgKQrJUuXVtrqieyt+r9zMlk7cwEepZ39PE5GDHMHAR7Qq I2uqBcPyMvoGtRFQ57crikCagrNMjqeJp8oResLgD3M+633iO1giLbWRZIa0cNttqzLN HaoX0TP455Mgs/b9va6lDKhd1zL3gViy15b6O8324w0oIL9jWUWvI1Gw1VqsmMJCt4DO mfjw== X-Forwarded-Encrypted: i=1; AJvYcCVvysljIm7sfLho7QnCpPehBrayLUWQhSdHwGihz3LC30/rjviAtH4yikF6xzbTHXiYdZKKe6ccQnGx@nongnu.org X-Gm-Message-State: AOJu0YzFU5f+N4+cUA29eYVkPif/gz2pwCvD3PAtnwfNpFrMlz3g24Dv nsPtd/EpkOUIlzc677urEXLAva/3+AinN8Gm2Gm27rimqeyH5VEKQ6G/23NL/vm7mLA= X-Gm-Gg: ASbGncvJhvpKWd0icTkiUPfqTgms7b9+TkugboKaCFyjkLwYur89h+d0tkv6IsPaHZo xRXaE7fT1+cFeD2cMguBHlCplYCSP2H6KDnEKq3Rdpj46u8uyc+hZL0BGAoRuTrr3Meas1r57X7 12JIbEgSiryBqG9C5iYOyyNv21MiGlyEFEQ8L1dl/EcnWuI78GRXxnxS9Z7x5rtjYgqeETu8Jh1 8Qb3dq8FnRuI0eP169Y0xEONxu6BjvNHueV0dYgjmLTA76082hsJbVSIcQI34zcl/QrGHIi+9+S RAGnLeuDa+41LoUQCEdBfTuhaPtRMS0ZFeDPzhhe9AC5VGPdyZyBUWpPGS2Ix78p1uN341MVKCv xFZgzXGQX0LOZXQj92QC+frYobi3sC0cFTOayQGT2vsm0NkW3TRC8jki0n1iwDZIgyfgIDC/FUj ++HYWMcGVsay7kVN+fK5zgV/FsksYZ18HuWJfQoL2FRkXwNxne4oXy1rhlBnfE X-Google-Smtp-Source: AGHT+IE0l2Zzhk64PIfhz6+M9b5bgqGM5x4IUDlJDXjKRTcqPNJww2f7XpYf6TzdE34Cj16Eb2NoRQ== X-Received: by 2002:a05:6000:12c1:b0:42b:41dc:1b61 with SMTP id ffacd0b85a97d-42f731a4dc4mr632856f8f.35.1764742262752; Tue, 02 Dec 2025 22:11:02 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH-for-11.0 v6 11/13] hw/i386/pc: Remove multiboot.bin Date: Wed, 3 Dec 2025 07:09:39 +0100 Message-ID: <20251203060942.57851-12-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742327570019200 All PC machines now use the multiboot_dma.bin binary, we can remove the non-DMA version (multiboot.bin). This doesn't change multiboot_dma binary file. Suggested-by: Thomas Huth Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- pc-bios/optionrom/optionrom.h | 4 - hw/i386/pc.c | 1 - pc-bios/meson.build | 1 - pc-bios/multiboot.bin | Bin 1024 -> 0 bytes pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/multiboot.S | 232 ----------------------------- pc-bios/optionrom/multiboot_dma.S | 234 +++++++++++++++++++++++++++++- 7 files changed, 233 insertions(+), 241 deletions(-) delete mode 100644 pc-bios/multiboot.bin delete mode 100644 pc-bios/optionrom/multiboot.S diff --git a/pc-bios/optionrom/optionrom.h b/pc-bios/optionrom/optionrom.h index 7bcdf0eeb24..2e6e2493f83 100644 --- a/pc-bios/optionrom/optionrom.h +++ b/pc-bios/optionrom/optionrom.h @@ -117,16 +117,12 @@ * * Clobbers: %eax, %edx, %es, %ecx, %edi and adresses %esp-20 to %esp */ -#ifdef USE_FW_CFG_DMA #define read_fw_blob_dma(var) \ read_fw var ## _SIZE; \ mov %eax, %ecx; \ read_fw var ## _ADDR; \ mov %eax, %edi ; \ read_fw_dma var ## _DATA, %ecx, %edi -#else -#define read_fw_blob_dma(var) read_fw_blob(var) -#endif =20 #define read_fw_blob_pre(var) \ read_fw var ## _SIZE; \ diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 5c52079be31..edba8e4b97d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -670,7 +670,6 @@ void xen_load_linux(PCMachineState *pcms) assert(!strcmp(option_rom[i].name, "linuxboot.bin") || !strcmp(option_rom[i].name, "linuxboot_dma.bin") || !strcmp(option_rom[i].name, "pvh.bin") || - !strcmp(option_rom[i].name, "multiboot.bin") || !strcmp(option_rom[i].name, "multiboot_dma.bin")); rom_add_option(option_rom[i].name, option_rom[i].bootindex); } diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 9260aaad78e..efe45c16705 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -62,7 +62,6 @@ blobs =3D [ 'efi-e1000e.rom', 'efi-vmxnet3.rom', 'qemu-nsis.bmp', - 'multiboot.bin', 'multiboot_dma.bin', 'linuxboot.bin', 'linuxboot_dma.bin', diff --git a/pc-bios/multiboot.bin b/pc-bios/multiboot.bin deleted file mode 100644 index e772713c95749bee82c20002b50ec6d05b2d4987..000000000000000000000000000= 0000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1024 zcmeHFF-Tic6utlZQ$OjD#Hxcx2u0GNQv6GySOkZR(ulaX<>%N!Y#>cWhY}nf36J7X zN(%*X6NHY>xcqO11dG^02a8L@B~ihln|%1*|7(haWa`)l@80w7;U4Ziyv0rZ8{K-w zX(Ib3tLZ)RgZ}w1ei{~QEqQq9q1J-iHc} z{m%E-b32A??+@XljSYirtWObwngil#NmvPZ7KCt40l-CQ}*)y. - * - * Copyright Novell Inc, 2009 - * Authors: Alexander Graf - */ - -#include "optionrom.h" - -#define BOOT_ROM_PRODUCT "multiboot loader" - -#define MULTIBOOT_MAGIC 0x2badb002 - -#define GS_PROT_JUMP 0 -#define GS_GDT_DESC 6 - - -BOOT_ROM_START - -run_multiboot: - - cli - cld - - mov %cs, %eax - shl $0x4, %eax - - /* set up a long jump descriptor that is PC relative */ - - /* move stack memory to %gs */ - mov %ss, %ecx - shl $0x4, %ecx - mov %esp, %ebx - add %ebx, %ecx - sub $0x20, %ecx - sub $0x30, %esp - shr $0x4, %ecx - mov %cx, %gs - - /* now push the indirect jump descriptor there */ - mov (prot_jump), %ebx - add %eax, %ebx - movl %ebx, %gs:GS_PROT_JUMP - mov $8, %bx - movw %bx, %gs:GS_PROT_JUMP + 4 - - /* fix the gdt descriptor to be PC relative */ - movw (gdt_desc), %bx - movw %bx, %gs:GS_GDT_DESC - movl (gdt_desc+2), %ebx - add %eax, %ebx - movl %ebx, %gs:GS_GDT_DESC + 2 - - xor %eax, %eax - mov %eax, %es - - /* Read the bootinfo struct into RAM */ - read_fw_blob_dma(FW_CFG_INITRD) - - /* FS =3D bootinfo_struct */ - read_fw FW_CFG_INITRD_ADDR - shr $4, %eax - mov %ax, %fs - - /* Account for the EBDA in the multiboot structure's e801 - * map. - */ - int $0x12 - cwtl - movl %eax, %fs:4 - - /* ES =3D mmap_addr */ - mov %fs:48, %eax - shr $4, %eax - mov %ax, %es - - /* Initialize multiboot mmap structs using int 0x15(e820) */ - xor %ebx, %ebx - /* Start storing mmap data at %es:0 */ - xor %edi, %edi - -mmap_loop: - /* The multiboot entry size has offset -4, so leave some space */ - add $4, %di - /* entry size (mmap struct) & max buffer size (int15) */ - movl $20, %ecx - /* e820 */ - movl $0x0000e820, %eax - /* 'SMAP' magic */ - movl $0x534d4150, %edx - int $0x15 - -mmap_check_entry: - /* Error or last entry already done? */ - jb mmap_done - -mmap_store_entry: - /* store entry size */ - /* old as(1) doesn't like this insn so emit the bytes instead: - movl %ecx, %es:-4(%edi) - */ - .dc.b 0x26,0x67,0x66,0x89,0x4f,0xfc - - /* %edi +=3D entry_size, store as mbs_mmap_length */ - add %ecx, %edi - movw %di, %fs:0x2c - - /* Continuation value 0 means last entry */ - test %ebx, %ebx - jnz mmap_loop - -mmap_done: - /* Calculate upper_mem field: The amount of memory between 1 MB and - the first upper memory hole. Get it from the mmap. */ - xor %di, %di - mov $0x100000, %edx -upper_mem_entry: - cmp %fs:0x2c, %di - je upper_mem_done - add $4, %di - - /* Skip if type !=3D 1 */ - cmpl $1, %es:16(%di) - jne upper_mem_next - - /* Skip if > 4 GB */ - movl %es:4(%di), %eax - test %eax, %eax - jnz upper_mem_next - - /* Check for contiguous extension (base <=3D %edx < base + length) */ - movl %es:(%di), %eax - cmp %eax, %edx - jb upper_mem_next - addl %es:8(%di), %eax - cmp %eax, %edx - jae upper_mem_next - - /* If so, update %edx, and restart the search (mmap isn't ordered) */ - mov %eax, %edx - xor %di, %di - jmp upper_mem_entry - -upper_mem_next: - addl %es:-4(%di), %edi - jmp upper_mem_entry - -upper_mem_done: - sub $0x100000, %edx - shr $10, %edx - mov %edx, %fs:0x8 - -real_to_prot: - /* Load the GDT before going into protected mode */ -lgdt: - data32 lgdt %gs:GS_GDT_DESC - - /* get us to protected mode now */ - movl $1, %eax - movl %eax, %cr0 - - /* the LJMP sets CS for us and gets us to 32-bit */ -ljmp: - data32 ljmp *%gs:GS_PROT_JUMP - -prot_mode: -.code32 - - /* initialize all other segments */ - movl $0x10, %eax - movl %eax, %ss - movl %eax, %ds - movl %eax, %es - movl %eax, %fs - movl %eax, %gs - - /* Read the kernel and modules into RAM */ - read_fw_blob_dma(FW_CFG_KERNEL) - - /* Jump off to the kernel */ - read_fw FW_CFG_KERNEL_ENTRY - mov %eax, %ecx - - /* EBX contains a pointer to the bootinfo struct */ - read_fw FW_CFG_INITRD_ADDR - movl %eax, %ebx - - /* EAX has to contain the magic */ - movl $MULTIBOOT_MAGIC, %eax -ljmp2: - jmp *%ecx - -/* Variables */ -.align 4, 0 -prot_jump: .long prot_mode - .short 8 - -.align 8, 0 -gdt: - /* 0x00 */ -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 - - /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 - - /* 0x18: code segment (base=3D0, limit=3D0x0ffff, type=3D16bit code exec/= read/conf, DPL=3D0, 1b) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00 - - /* 0x20: data segment (base=3D0, limit=3D0x0ffff, type=3D16bit data read/= write, DPL=3D0, 1b) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00 - -gdt_desc: -.short (5 * 8) - 1 -.long gdt - -BOOT_ROM_END diff --git a/pc-bios/optionrom/multiboot_dma.S b/pc-bios/optionrom/multiboo= t_dma.S index d809af3e23f..c95e35c9cb6 100644 --- a/pc-bios/optionrom/multiboot_dma.S +++ b/pc-bios/optionrom/multiboot_dma.S @@ -1,2 +1,232 @@ -#define USE_FW_CFG_DMA 1 -#include "multiboot.S" +/* + * Multiboot Option ROM + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see . + * + * Copyright Novell Inc, 2009 + * Authors: Alexander Graf + */ + +#include "optionrom.h" + +#define BOOT_ROM_PRODUCT "multiboot loader" + +#define MULTIBOOT_MAGIC 0x2badb002 + +#define GS_PROT_JUMP 0 +#define GS_GDT_DESC 6 + + +BOOT_ROM_START + +run_multiboot: + + cli + cld + + mov %cs, %eax + shl $0x4, %eax + + /* set up a long jump descriptor that is PC relative */ + + /* move stack memory to %gs */ + mov %ss, %ecx + shl $0x4, %ecx + mov %esp, %ebx + add %ebx, %ecx + sub $0x20, %ecx + sub $0x30, %esp + shr $0x4, %ecx + mov %cx, %gs + + /* now push the indirect jump descriptor there */ + mov (prot_jump), %ebx + add %eax, %ebx + movl %ebx, %gs:GS_PROT_JUMP + mov $8, %bx + movw %bx, %gs:GS_PROT_JUMP + 4 + + /* fix the gdt descriptor to be PC relative */ + movw (gdt_desc), %bx + movw %bx, %gs:GS_GDT_DESC + movl (gdt_desc+2), %ebx + add %eax, %ebx + movl %ebx, %gs:GS_GDT_DESC + 2 + + xor %eax, %eax + mov %eax, %es + + /* Read the bootinfo struct into RAM */ + read_fw_blob_dma(FW_CFG_INITRD) + + /* FS =3D bootinfo_struct */ + read_fw FW_CFG_INITRD_ADDR + shr $4, %eax + mov %ax, %fs + + /* Account for the EBDA in the multiboot structure's e801 + * map. + */ + int $0x12 + cwtl + movl %eax, %fs:4 + + /* ES =3D mmap_addr */ + mov %fs:48, %eax + shr $4, %eax + mov %ax, %es + + /* Initialize multiboot mmap structs using int 0x15(e820) */ + xor %ebx, %ebx + /* Start storing mmap data at %es:0 */ + xor %edi, %edi + +mmap_loop: + /* The multiboot entry size has offset -4, so leave some space */ + add $4, %di + /* entry size (mmap struct) & max buffer size (int15) */ + movl $20, %ecx + /* e820 */ + movl $0x0000e820, %eax + /* 'SMAP' magic */ + movl $0x534d4150, %edx + int $0x15 + +mmap_check_entry: + /* Error or last entry already done? */ + jb mmap_done + +mmap_store_entry: + /* store entry size */ + /* old as(1) doesn't like this insn so emit the bytes instead: + movl %ecx, %es:-4(%edi) + */ + .dc.b 0x26,0x67,0x66,0x89,0x4f,0xfc + + /* %edi +=3D entry_size, store as mbs_mmap_length */ + add %ecx, %edi + movw %di, %fs:0x2c + + /* Continuation value 0 means last entry */ + test %ebx, %ebx + jnz mmap_loop + +mmap_done: + /* Calculate upper_mem field: The amount of memory between 1 MB and + the first upper memory hole. Get it from the mmap. */ + xor %di, %di + mov $0x100000, %edx +upper_mem_entry: + cmp %fs:0x2c, %di + je upper_mem_done + add $4, %di + + /* Skip if type !=3D 1 */ + cmpl $1, %es:16(%di) + jne upper_mem_next + + /* Skip if > 4 GB */ + movl %es:4(%di), %eax + test %eax, %eax + jnz upper_mem_next + + /* Check for contiguous extension (base <=3D %edx < base + length) */ + movl %es:(%di), %eax + cmp %eax, %edx + jb upper_mem_next + addl %es:8(%di), %eax + cmp %eax, %edx + jae upper_mem_next + + /* If so, update %edx, and restart the search (mmap isn't ordered) */ + mov %eax, %edx + xor %di, %di + jmp upper_mem_entry + +upper_mem_next: + addl %es:-4(%di), %edi + jmp upper_mem_entry + +upper_mem_done: + sub $0x100000, %edx + shr $10, %edx + mov %edx, %fs:0x8 + +real_to_prot: + /* Load the GDT before going into protected mode */ +lgdt: + data32 lgdt %gs:GS_GDT_DESC + + /* get us to protected mode now */ + movl $1, %eax + movl %eax, %cr0 + + /* the LJMP sets CS for us and gets us to 32-bit */ +ljmp: + data32 ljmp *%gs:GS_PROT_JUMP + +prot_mode: +.code32 + + /* initialize all other segments */ + movl $0x10, %eax + movl %eax, %ss + movl %eax, %ds + movl %eax, %es + movl %eax, %fs + movl %eax, %gs + + /* Read the kernel and modules into RAM */ + read_fw_blob_dma(FW_CFG_KERNEL) + + /* Jump off to the kernel */ + read_fw FW_CFG_KERNEL_ENTRY + mov %eax, %ecx + + /* EBX contains a pointer to the bootinfo struct */ + read_fw FW_CFG_INITRD_ADDR + movl %eax, %ebx + + /* EAX has to contain the magic */ + movl $MULTIBOOT_MAGIC, %eax +ljmp2: + jmp *%ecx + +/* Variables */ +.align 4, 0 +prot_jump: .long prot_mode + .short 8 + +.align 8, 0 +gdt: + /* 0x00 */ +.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 + + /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 + + /* 0x18: code segment (base=3D0, limit=3D0x0ffff, type=3D16bit code exec/= read/conf, DPL=3D0, 1b) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9e, 0x00, 0x00 + + /* 0x20: data segment (base=3D0, limit=3D0x0ffff, type=3D16bit data read/= write, DPL=3D0, 1b) */ +.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00 + +gdt_desc: +.short (5 * 8) - 1 +.long gdt + +BOOT_ROM_END --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742326; cv=none; d=zohomail.com; s=zohoarc; b=bGPd4faIPpG7bIzOYZud5SUmH1nmLijSI0pAFFg6Uvm6/VAvUCrktXBCCoXc3OXPeWqN83cZngaYhCry3CxJbigi9hZzZAltGStDHIhP0OZJOga7BTYqy++RbmoRKpi/Hxq7//DACvTiTo/3qb8kqOLGvYc9O3CJmQ9S32VaBes= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742326; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=46vnfSxGy1j6e0vUyHlJU/9mdbC6bpVvSwQgBjgZ5ZI=; b=eYi7911yIlgx55l3bbR7GJ3NI5/he7RDLexjZWTcAlinmlKLN/ZMEcaRMJkBhbITzMd5DhrWxaaZ1cFvdJOyeEqeYctdkYwrauZZL2zXj4cJZh/rx6YrA7tUSdeO7uWqddyLIpdXn5K03I6viFHqraOCJ8I0E0pb+Pfa8jsBWRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742326317618.7206199863456; Tue, 2 Dec 2025 22:12:06 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg53-0006uq-Up; Wed, 03 Dec 2025 01:11:14 -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 1vQg52-0006t6-NG for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:12 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg51-0001As-75 for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:12 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-47118259fd8so61546665e9.3 for ; Tue, 02 Dec 2025 22:11:10 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42e1c5d618csm36471747f8f.14.2025.12.02.22.11.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742270; x=1765347070; 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=46vnfSxGy1j6e0vUyHlJU/9mdbC6bpVvSwQgBjgZ5ZI=; b=k/nyHj2BkUlWnN/gtgSqGWn1h5p9lff32E6voN4cOhTAZ23X+EeV8gMnTcAUMACf11 odwG3vuiQMNfh71PaXByCOAuFjrmrxcQ6K6eQcpUOJuUpUDCfO9ZahXKFygVyS7usykZ tJysK+K/idmCFUu+JU/OmJGoDCF+GiBlF1i4qPTRHpuzN3ZxKCnlFm+W0J6GoGfOkp+2 iE4Ho0QEExouA8kqINtS2owyB3H3/Iv6q/rSHN9d4X4kuBUvsDtGJuuKAri0g+y/iatS cmbQPOmRxPkGH4LK8CiIcZznGmjRsdjqvMUqvWsBEdhr+Eg8I9xMy2BxtK7KD7EyAG90 4bkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742270; x=1765347070; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=46vnfSxGy1j6e0vUyHlJU/9mdbC6bpVvSwQgBjgZ5ZI=; b=RgHwP4nvTHImIe/lzC94hNUxfFGaqw269vjgQycXbfo7DDliYd2t9ur7ogstSc06FL WbcOEzBDeJlZ+m01/GwR6cA4ocvlspIDoGjUIK3/dtrv9CDVWaXlWjy9fBg3UIcSPgEV 8iBquejUyyu6u0J0tBsdX8E4x16LEdID1A4paC8HY/L/vUv52m9UAHWDXPxgiFIgP0e5 ii1jWLC5g0upLiZGfOkqTlVz+8BXCuOUvD2+S1w1EGlKEgqWLs4IoMnnjj+1etTFQe/n Ljxqn//31JKA3q+l9WSFPXSxIPfUjo39GGRg+4RNbPHDrpEkXPY34L3MKK5nMeYKUyxp jzqA== X-Forwarded-Encrypted: i=1; AJvYcCUVjCTJtTJ23UrdvBK4QnzSuDn3RnCRXFpTt6A/wJ6L0LVWua/4al7nSYn+f0fshBHLNRCHKIqwQt9m@nongnu.org X-Gm-Message-State: AOJu0YwAmW5zDD7RxgPSARv3pwX3cV+Mg+TrDf6UlA/khUdOP+xzGiG1 I+OxLPwErRh+52OnjRFmVMwayjprcmlmjzJeeUGZinsf17Svlzmu+JIsDfqvk5gSmoo= X-Gm-Gg: ASbGnctuIYhiLTDCNAQMBA8ZGSqmvWSU+/3+GkpxrwZJWrRtwG2CVzq9JeCVI4iNhvh PehiR/rc+Rd1+08VR3CgrK5G4NZ5Q84mO977WwRg7oXXvayMvTUf9jdwVzp4oOqojDVkW0Ezfn+ Doxsy8I3vvVRuRp59WaifM88H8bfMHI8z4Vxyv9DyYZiAhkmBw4jtrdgGoTspuEh5ROajcvVm9O nM1FoKQT0C/VNyz0YiC8In50IPkn0EntWd7uwvx4KyZoFHJXWM77P+Q/uynTEdhg9msI/eCqOu4 27mAZDuYKZ6mcvDBmairNOa7FgwfPs1xxkH0hhwkIZ2NfMJfi0WZoGk6c5yzKNWcLtDut6do4PU 3MQwH3kAHgugcJFx50ggeTH3vSkQhgtexq8HwELjPqLpXWF4gGlhKOnXRZR9oUFz69sAKX6hMxf zYIP3Iw56bZjcOT/ZD5hPyHcIfppwxr+fhEuder1Q80nQpc/QqE9m5S8+pQ9VU X-Google-Smtp-Source: AGHT+IGzIDwCTKOLlr77oNq8MxfixjC7xfMHSOwbndl59QPqIUvmZvz3PAzc9CbmGpRB+GWaMuMioA== X-Received: by 2002:a05:6000:612:b0:42b:5603:3ce6 with SMTP id ffacd0b85a97d-42f73173debmr899975f8f.18.1764742269796; Tue, 02 Dec 2025 22:11:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH-for-11.0 v6 12/13] hw/i386: Assume fw_cfg DMA is always enabled Date: Wed, 3 Dec 2025 07:09:40 +0100 Message-ID: <20251203060942.57851-13-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742327411019200 From: Zhao Liu Now all calls of x86 machines to fw_cfg_init_io_dma() pass DMA arguments, so the FWCfgState (FWCfgIoState) created by x86 machines enables DMA by default. Then 'linuxboot.bin' isn't used anymore, and it will be removed in the next commit. Signed-off-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Michael S. Tsirkin Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/fw_cfg.c | 1 + hw/i386/x86-common.c | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c index bf38338fb47..528862d2e33 100644 --- a/hw/i386/fw_cfg.c +++ b/hw/i386/fw_cfg.c @@ -226,6 +226,7 @@ void fw_cfg_add_acpi_dsdt(Aml *scope, FWCfgState *fw_cf= g) * of the i/o region used is FW_CFG_CTL_SIZE; And the DMA control * register is located at FW_CFG_DMA_IO_BASE + 4 */ + assert(fw_cfg_dma_enabled(fw_cfg)); io_size =3D ROUND_UP(FW_CFG_CTL_SIZE, 4) + sizeof(dma_addr_t); =20 aml_append(dev, aml_name_decl("_HID", aml_string("QEMU0002"))); diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c index 1ee55382dab..e8dc4d903bd 100644 --- a/hw/i386/x86-common.c +++ b/hw/i386/x86-common.c @@ -1002,10 +1002,8 @@ void x86_load_linux(X86MachineState *x86ms, } =20 option_rom[nb_option_roms].bootindex =3D 0; - option_rom[nb_option_roms].name =3D "linuxboot.bin"; - if (fw_cfg_dma_enabled(fw_cfg)) { - option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; - } + assert(fw_cfg_dma_enabled(fw_cfg)); + option_rom[nb_option_roms].name =3D "linuxboot_dma.bin"; nb_option_roms++; } =20 --=20 2.51.0 From nobody Sun Dec 14 06:34:32 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1764742342; cv=none; d=zohomail.com; s=zohoarc; b=DkF/M3P1dkepcYziLFRKLBZq6p7NLAuxZMJnbYdPZXSelIx9GV3CTHmfT5D/CrncLU55R4oojigb5AMf00yX+VwdKnN8jKXKO+OQmksq61dxQDGhQUXpzCSXM0byXVFK5qRB12/4deZbpVc1eYLY1/DvGTFE0TpCvfA7Nlp3BG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1764742342; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DE3yZ1NezYm9j02BHfqvoIAZcoZs87VQEmFWXloIjT8=; b=cP3tcjpxXR4zwod/GTmLsadO7qD58nmQnDp6wZkXDdv0e3VsCVtJDJEk35ZvaxVyXwcH/pN7xP9DyWo/Xva1d/aHEmz7mLDIsn/fQfTaEIVyA1WiIxzeUmld6tVZIQV/KE8F4BtrXqdP+u89SAWV6Jj3FswqK2tkg6cDFZ94PYc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1764742342923813.1930066971993; Tue, 2 Dec 2025 22:12:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vQg5e-0007cr-Ir; Wed, 03 Dec 2025 01:11:51 -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 1vQg5C-000795-SA for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:30 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vQg5A-0001C7-7t for qemu-devel@nongnu.org; Wed, 03 Dec 2025 01:11:22 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-477a219db05so40869325e9.2 for ; Tue, 02 Dec 2025 22:11:18 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4792a8c614esm26123685e9.11.2025.12.02.22.11.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 02 Dec 2025 22:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1764742277; x=1765347077; 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=DE3yZ1NezYm9j02BHfqvoIAZcoZs87VQEmFWXloIjT8=; b=nAcq39+UzDGcwFqrZs2uR98Up6OwppyzCx4RYy3ASPf+/lKdeAqLEY5J2YEOs8rTs0 6/1EyDY/Kspb350qgg6R7YGDeI6JiSfmEQSIXF5yBzHitJS0aalyFxj6UoxT7scznE05 hdv+K9x15aCn9vZjbvSjcs3+NQNObri0UOn97Jl8R6pkoDr855CFiMbLNlE1qXYFEtuz LDNQqhDbWj+wSJRN2/px0qnqYuaCw+A0JvR61VwE569oaydAwJ+8lP3AEuzjcrPC+K8K L0pJowfAHsnud56YvosbbFFiR2hVhwrvrq8YM8FurQTIMfizW/TOp3bHa2QECSPovbXb W0ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764742277; x=1765347077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DE3yZ1NezYm9j02BHfqvoIAZcoZs87VQEmFWXloIjT8=; b=SKY/lw2+/8k8KHEglEQOkyl7Nee9qXcK1tcOxkym6QfdXbln7tjmG1I9fdlGFv6kPo eoOvMX2Qmjg3racGpp5lJD21LeSGu5wBWM6Wlx5mwvYBHDVH5v5PVLMSJi53IMPi6lvh VF7j65zRgdf7rg+tOZm1aiDDQZgRwGJYYR29tE5y/cozLt5iMqA2IdlfMJqK8H9lJk0X fOzrwPd2q9XlOqbMQBr38vF0vAs0Rzgqls2QdTI7+r8JPuf5Oc8rQMVVNOt2vfyVA3bR pK3DciEve2l7AeE7fsbEfgkWOiDSOZnWULzlsHCOChE940Yw79xcABVUDKIJ1phyaYt4 yq1w== X-Forwarded-Encrypted: i=1; AJvYcCWh9aJIlJ6C0CoRhylkTIoRdn2EkeY2/prFzOjcKyzczEVXwJLtqHhfdKjL7YHgfSs7iJ97lf+/ms6i@nongnu.org X-Gm-Message-State: AOJu0YwciUJwPbM1yG8o0C8uT1eewQw9CDbLxL9DFUSkSIJfy2ZXMXXO whcZTH9pucGx4gPFLbgnD9+/wrHhqnARPsfbaTMyUZ4f7ls2iAGEG9n759iYF58boxI= X-Gm-Gg: ASbGncv2CissxlyfeB2RsGAZ4uGtpVAW538bHKOO39uijTx9XQkHQ5m0rV3Bn4ZJW0m JdIMLnQpUMn3WRhSIcW74KJv508hCrGRUfHNZYTpL1YQGY/6Q53Ce3EW+1S2QERv7fY6lwu9xQO heJMvkDMjaBn8r+CxVP7bbqq7OhPEY23GQfte9y6+UDQfgtJX5rTNs5rSeJlE62yBMCvXjEmriV ms6t38kaEBo4AUB0Dl47a+6YpRrbCJ2w3p+vS/53JGGULCwk6m8/oAtZVWMv0sKI6UxO+e2zcsS dllBe+t01TJ83b6jaK2SPiOnBuHZMmLlgPP+1EXKODyBhV1Q/nqqtECGX6lyif0Ob/Flso6f0Rh oRbjatgr+KGPczQ+MgTqTvgLYOtP1LNgcnDcE2WHOAc9YsPFnHBCXHeZK2ItJ0TCAVFRKvLpfuy DX0DJ8J3oMJcGFPqKQh39XZ2oaf8mONjJLR7p9qz/IOxeaofEzE+BvplF4r66w X-Google-Smtp-Source: AGHT+IEq/86+CzKzCTytHX4tZkZlNU5G/sXLlnLZ3vAB9xUpFuB3omWGH1/kYggSr0K+xsKwnaFOEA== X-Received: by 2002:a05:600c:450a:b0:477:b0b8:4dd0 with SMTP id 5b1f17b1804b1-4792af1b10fmr9009105e9.17.1764742277023; Tue, 02 Dec 2025 22:11:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Zhao Liu , qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Igor Mammedov , Xiaoyao Li , Mark Cave-Ayland , qemu-riscv@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Thomas Huth , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost Subject: [PATCH-for-11.0 v6 13/13] hw/i386: Remove linuxboot.bin Date: Wed, 3 Dec 2025 07:09:41 +0100 Message-ID: <20251203060942.57851-14-philmd@linaro.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251203060942.57851-1-philmd@linaro.org> References: <20251203060942.57851-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, LOTS_OF_MONEY=0.001, MONEY_NOHTML=1.499, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1764742343579019200 All machines now use the linuxboot_dma.bin binary, so it's safe to remove the non-DMA version (linuxboot.bin). Suggested-by: Thomas Huth Reviewed-by: Zhao Liu Signed-off-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Zhao Liu Reviewed-by: Michael S. Tsirkin --- hw/i386/pc.c | 3 +- pc-bios/meson.build | 1 - pc-bios/optionrom/Makefile | 2 +- pc-bios/optionrom/linuxboot.S | 195 ---------------------------------- 4 files changed, 2 insertions(+), 199 deletions(-) delete mode 100644 pc-bios/optionrom/linuxboot.S diff --git a/hw/i386/pc.c b/hw/i386/pc.c index edba8e4b97d..08aa28e6a8d 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -667,8 +667,7 @@ void xen_load_linux(PCMachineState *pcms) =20 x86_load_linux(x86ms, fw_cfg, PC_FW_DATA, pcmc->pvh_enabled); for (i =3D 0; i < nb_option_roms; i++) { - assert(!strcmp(option_rom[i].name, "linuxboot.bin") || - !strcmp(option_rom[i].name, "linuxboot_dma.bin") || + assert(!strcmp(option_rom[i].name, "linuxboot_dma.bin") || !strcmp(option_rom[i].name, "pvh.bin") || !strcmp(option_rom[i].name, "multiboot_dma.bin")); rom_add_option(option_rom[i].name, option_rom[i].bootindex); diff --git a/pc-bios/meson.build b/pc-bios/meson.build index efe45c16705..2f470ed1294 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -63,7 +63,6 @@ blobs =3D [ 'efi-vmxnet3.rom', 'qemu-nsis.bmp', 'multiboot_dma.bin', - 'linuxboot.bin', 'linuxboot_dma.bin', 'kvmvapic.bin', 'pvh.bin', diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile index 1183ef88922..e694c7aac00 100644 --- a/pc-bios/optionrom/Makefile +++ b/pc-bios/optionrom/Makefile @@ -2,7 +2,7 @@ include config.mak SRC_DIR :=3D $(TOPSRC_DIR)/pc-bios/optionrom VPATH =3D $(SRC_DIR) =20 -all: multiboot_dma.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin +all: multiboot_dma.bin linuxboot_dma.bin kvmvapic.bin pvh.bin # Dummy command so that make thinks it has done something @true =20 diff --git a/pc-bios/optionrom/linuxboot.S b/pc-bios/optionrom/linuxboot.S deleted file mode 100644 index ba821ab922d..00000000000 --- a/pc-bios/optionrom/linuxboot.S +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Linux Boot Option ROM - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, see . - * - * Copyright Novell Inc, 2009 - * Authors: Alexander Graf - * - * Based on code in hw/pc.c. - */ - -#include "optionrom.h" - -#define BOOT_ROM_PRODUCT "Linux loader" - -BOOT_ROM_START - -run_linuxboot: - - cli - cld - - jmp copy_kernel -boot_kernel: - - read_fw FW_CFG_SETUP_ADDR - - mov %eax, %ebx - shr $4, %ebx - - /* All segments contain real_addr */ - mov %bx, %ds - mov %bx, %es - mov %bx, %fs - mov %bx, %gs - mov %bx, %ss - - /* CX =3D CS we want to jump to */ - add $0x20, %bx - mov %bx, %cx - - /* SP =3D cmdline_addr-real_addr-16 */ - read_fw FW_CFG_CMDLINE_ADDR - mov %eax, %ebx - read_fw FW_CFG_SETUP_ADDR - sub %eax, %ebx - sub $16, %ebx - mov %ebx, %esp - - /* Build indirect lret descriptor */ - pushw %cx /* CS */ - xor %ax, %ax - pushw %ax /* IP =3D 0 */ - - /* Clear registers */ - xor %eax, %eax - xor %ebx, %ebx - xor %ecx, %ecx - xor %edx, %edx - xor %edi, %edi - xor %ebp, %ebp - - /* Jump to Linux */ - lret - - -copy_kernel: - /* Read info block in low memory (0x10000 or 0x90000) */ - read_fw FW_CFG_SETUP_ADDR - shr $4, %eax - mov %eax, %es - xor %edi, %edi - read_fw_blob_addr32_edi(FW_CFG_SETUP) - - cmpw $0x203, %es:0x206 // if protocol >=3D 0x203 - jae 1f // have initrd_max - movl $0x37ffffff, %es:0x22c // else assume 0x37ffffff -1: - - /* Check if using kernel-specified initrd address */ - read_fw FW_CFG_INITRD_ADDR - mov %eax, %edi // (load_kernel wants it in %edi) - read_fw FW_CFG_INITRD_SIZE // find end of initrd - add %edi, %eax - xor %es:0x22c, %eax // if it matches es:0x22c - and $-4096, %eax // (apart from padding for page) - jz load_kernel // then initrd is not at top - // of memory - - /* pc.c placed the initrd at end of memory. Compute a better - * initrd address based on e801 data. - */ - mov $0xe801, %ax - xor %cx, %cx - xor %dx, %dx - int $0x15 - - /* Output could be in AX/BX or CX/DX */ - or %cx, %cx - jnz 1f - or %dx, %dx - jnz 1f - mov %ax, %cx - mov %bx, %dx -1: - - or %dx, %dx - jnz 2f - addw $1024, %cx /* add 1 MB */ - movzwl %cx, %edi - shll $10, %edi /* convert to bytes */ - jmp 3f - -2: - addw $16777216 >> 16, %dx /* add 16 MB */ - movzwl %dx, %edi - shll $16, %edi /* convert to bytes */ - -3: - read_fw FW_CFG_INITRD_SIZE - subl %eax, %edi - andl $-4096, %edi /* EDI =3D start of initrd */ - movl %edi, %es:0x218 /* put it in the header */ - -load_kernel: - /* We need to load the kernel into memory we can't access in 16 bit - mode, so let's get into 32 bit mode, write the kernel and jump - back again. */ - - /* Reserve space on the stack for our GDT descriptor. */ - mov %esp, %ebp - sub $16, %esp - - /* Now create the GDT descriptor */ - movw $((3 * 8) - 1), -16(%bp) - mov %cs, %eax - movzwl %ax, %eax - shl $4, %eax - addl $gdt, %eax - movl %eax, -14(%bp) - - /* And load the GDT */ - data32 lgdt -16(%bp) - mov %ebp, %esp - - /* Get us to protected mode now */ - mov $1, %eax - mov %eax, %cr0 - - /* So we can set ES to a 32-bit segment */ - mov $0x10, %eax - mov %eax, %es - - /* We're now running in 16-bit CS, but 32-bit ES! */ - - /* Load kernel and initrd */ - read_fw_blob_addr32_edi(FW_CFG_INITRD) - read_fw_blob_addr32(FW_CFG_KERNEL) - read_fw_blob_addr32(FW_CFG_CMDLINE) - - /* And now jump into Linux! */ - mov $0, %eax - mov %eax, %cr0 - - /* ES =3D CS */ - mov %cs, %ax - mov %ax, %es - - jmp boot_kernel - -/* Variables */ - -.align 4, 0 -gdt: - /* 0x00 */ -.byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - - /* 0x08: code segment (base=3D0, limit=3D0xfffff, type=3D32bit code exec/= read, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x9a, 0xcf, 0x00 - - /* 0x10: data segment (base=3D0, limit=3D0xfffff, type=3D32bit data read/= write, DPL=3D0, 4k) */ -.byte 0xff, 0xff, 0x00, 0x00, 0x00, 0x92, 0xcf, 0x00 - -BOOT_ROM_END --=20 2.51.0