From nobody Sun Apr 12 00:55:48 2026 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=1771801607; cv=none; d=zohomail.com; s=zohoarc; b=deXlkk56gvEwd5q5eOBbDgFLEcxsTJRA3Z/CZNHxxafWdaHpnuQ8tYv+mE//CSqyBANECzB66oZYy7zQ5RUCgowexmxAZ6h08OxOz0xZhs1WmnnBhwMQwoW4WnZo1AM1q/wYxQNFBOS69mSYd8pZDsK85Npo6IO/ncdLO5vHUDY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801607; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=G8n54m4QbMI8GF9i4s0xEOtozUsr7KAZ+nvUeoqm+sI=; b=gFB1Kl5F/ZU86MtCjXNfbFWoOQRDW74h56lWo0oWywgAtq7IrCrD3kbqHuVWi8YtLTwL8WNyFvAxXe3+zBpTotyVtU0AmBCQtdt2jG0im698wlCgS9CwXI2n5qwasBTY5/lxWM1HZfPxzOvVS3Kjp+bAr47EChWuiCVOQyhhRrw= 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 1771801607418280.9880719480818; Sun, 22 Feb 2026 15:06:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIWo-0001Qx-CO; Sun, 22 Feb 2026 18:06:18 -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 1vuIWj-0001Qp-NV for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:13 -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 1vuIWi-0005vM-5N for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:13 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-48374014a77so38711345e9.3 for ; Sun, 22 Feb 2026 15:06:11 -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-43970d4c626sm16426705f8f.28.2026.02.22.15.06.09 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801570; x=1772406370; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=G8n54m4QbMI8GF9i4s0xEOtozUsr7KAZ+nvUeoqm+sI=; b=b6KuEhjxS2mZMDReC1kaqAO6U3vAh1W6434cQQRQO2bd/NmUCmJFpYNDvUyyJJVFeq kuwlnuaYpBbz2YA1rtVoCNyyKYUKCYrEdhsEQi+7bpKtiVjusfhjnyelKArntx3lbTWE X6TZHtdDVMPm45SlQdgmHlp6djDXse/j3FU6Z91zNgVcTT2uWwN/njfLM51az3gdThJK m2gmVVsVCQiudoxGWjY/b4jTLJaQl1aLNM2ABNY+HOdqSkpvmYabtFGTp9feYgEzti5E RwW4vbpBLUYy2Yt7p/kSAG/1XkJazf3uOUpY+8ahpTTd3fQPJ0bR5aLWjodT64dQ9OiG pyDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801570; x=1772406370; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=G8n54m4QbMI8GF9i4s0xEOtozUsr7KAZ+nvUeoqm+sI=; b=cVfjoIprh9g9YzDUjXWb7g5KQHTXPWKhtqQeasVfhWXfA1t3BLanfgpKGlj7giNq6j fd22QXH/ZYxkou5eA6FzhLwq7bOSzaMhtHmirRJqCVx6ETbx2PjSfvCaxC6HpnY4fhOA gNH6MPI0izeQpzL2vPr7G4ldECqsaOYNR62AaB/4sjTvAGDVH4F6Zg3tI08qHN5gj2sD 2pKdkan/7jKQJbLYLHBzaPk5ya++xMcr1V8pUx1bouosrM63QnbemzzEngxjOQNu5Tp6 lsxKGngWFKL4WZYKijH5usnwK5hxfCRRWqqg/5haRmDKNyPwwM8Z8FyWDssSQD/R1hIM frPg== X-Gm-Message-State: AOJu0YyQnCqDntWihMUhxyeHguGP0yv8zZFrrtWlPnGFbM9WE5Ay/06x eAkVzFopMNfXptBnX6BBAsYPj1Hxijmzm11cSazVYFFIQlAyKXEJMF7B/8jmwg9SL9zpqalUnnJ oQVRPiUw= X-Gm-Gg: AZuq6aK1L4McD61jhJ5iT4X+x8Q0U0OERhGpiEGmkePBtfDtT39hCG2yoE22BiSIzp7 LJVOQufJyU8SqQg750b89/ih9SdeJUVyJUILXlOQvnJ/aHRO3KAsD0b63c/gN/nONDuTIQLZ+Kf W7PgAsCruyKkmEjWDpTh3EsQa7TWkt14//dRmS7cKm1bQsz54B9QHVWlz3ooqBpYWrESn8/1qi5 3rPewmgH+4jJp+vLrhslmRBNHbXyknLFrYlq4OJVSHVWsohXIPMU9AKndKb65/MjDlG3Iyw5MkP NwPJjRMfjJBhpReXFT+IkY8Lx5jz19szDT0v4RVY6JKlc9YnyskYboPQjauuyqZCziv2d22MYdw A3w1Fr/BtWojmsy7h+ILv1G/7pfoAX0nr7SXWazBpzIsIdHALOC4xKF6qcR6pitdPpGyeKJhmRr lRof8auSqBFPrLeHZNMcn079T9VuxHPAEi7/P2+DPyhX2shK4UuDdvY9tmdkdCtfQgsN61320P X-Received: by 2002:a05:600c:4f8a:b0:480:1d0b:2d32 with SMTP id 5b1f17b1804b1-483a95beb5bmr122248265e9.12.1771801570219; Sun, 22 Feb 2026 15:06:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 01/20] hw/misc/virt_ctrl: Fix incorrect trace event in read operation Date: Mon, 23 Feb 2026 00:05:42 +0100 Message-ID: <20260222230602.5756-2-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801609160158500 From: Kuan-Wei Chiu The virt_ctrl_read() function currently invokes trace_virt_ctrl_write() instead of trace_virt_ctrl_read(). This results in read operations appearing as write operations in the trace output, which is misleading during debugging and analysis. Replace the incorrect trace call with the proper read-specific trace event to accurately reflect the hardware behavior. Fixes: 0791bc02b8fb ("m68k: add a system controller") Signed-off-by: Kuan-Wei Chiu Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260111184915.1363318-1-visitorckw@gmail.com> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/virt_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/virt_ctrl.c b/hw/misc/virt_ctrl.c index 40747925a29..9b82e97ffde 100644 --- a/hw/misc/virt_ctrl.c +++ b/hw/misc/virt_ctrl.c @@ -43,7 +43,7 @@ static uint64_t virt_ctrl_read(void *opaque, hwaddr addr,= unsigned size) break; } =20 - trace_virt_ctrl_write(s, addr, size, value); + trace_virt_ctrl_read(s, addr, size, value); =20 return value; } --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801653; cv=none; d=zohomail.com; s=zohoarc; b=DaEbr9hRFALR8cGGE2pJMOFZGUdkdxWBdmf4cMuxhSENL+ieQtBqpnf7BEC68WeHHl4AVrcShs3kWneQdJHzNP3ZwUO+Ma17Rd/g/yiFeUNt5jry2Vqtw/Lx8YKS+5Gvgtnm6L2v6mdf3pKTbVkhR300r9SxNgXdKzk8khDs2I0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801653; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=XHXaASfkbWM1l9xUlj4XeLmv/SGeaBdPv/Pbmq3J3VE=; b=aKB0wqqqfFv5s1k22PZ557jAopdRK/N9kQ3NXaxD3WtUPkQPlNT+leKtxsXiT1muP6UduqRMLrGgR5tynf5FKuW2o9wPBeIdxHrf5y/aZY+4FzP6qqFtdfeEb9q5zxivX48p/s8FNx7QsPl5X/tK19rgXu4KrvYSJw71fxrZr9w= 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 1771801653895958.9915223492366; Sun, 22 Feb 2026 15:07:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIWr-0001Re-DF; Sun, 22 Feb 2026 18:06:22 -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 1vuIWq-0001RW-SO for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:20 -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 1vuIWp-0005vY-BG for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:20 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4837907f535so33151855e9.3 for ; Sun, 22 Feb 2026 15:06: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-483a42b4d5asm109931275e9.5.2026.02.22.15.06.16 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801577; x=1772406377; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=XHXaASfkbWM1l9xUlj4XeLmv/SGeaBdPv/Pbmq3J3VE=; b=r98sZmJXi0x+e6S18zyxOLoT75bSlLP/cEehTAiXCkq+6Jy1V/WlUDS9wEZJzRFXQW lQl5+QiTORzfO1q8rUR9r3YXmXCcdTPdRoUmeP4dImYQhVGb/nVearXRUPjFx1H3jVH4 H8/fJVGCcIUcOG4v/0c30BpvLV5D7cxr6W5tqH8E9gb83dmxfKj0UTAJQXoKKhZdEPWb E/5smryhboWjbR3Mge2j1Isst44vKZXIYEdC0P75pcGQzDtw7/q1FdfG1hGPdzlFZhBV si1rluS6cIJTMdLh2Zph1ZsR1+S4Hmouw4lqReFy6SFSjvolpFDAGoLT9LEZiQzSnHQT 0E8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801577; x=1772406377; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=XHXaASfkbWM1l9xUlj4XeLmv/SGeaBdPv/Pbmq3J3VE=; b=hHa1qvxcFE7So5a41YQ0VoOMFq+zoU9gzMud97XCz9tU31W+op6YtixustvGrbHzHR t8dyES6bgtg9VG8hwjPpYG/3hGHSHMIG3oifzxSp7JRjaADVou2GVFloPKOSvTEQz4O0 ijN5+Rln8uU/PBgIoA3K6yPPLTNhw1WUq05MruAbvf2arRc4aQFdfSEfj2SyT3bdbZqw fNpBmQx4o4MDqZpESUPywXBi/4AJRj4lzL8ToyIHWR9dyLEmNqBIy2rBU5TkoFjvB9Xp 7b7F6USZcmEMzFw7VVw6VB3cWAxSx/wPWpjJ6cFVMvzyJAvRLtNJdrKKRou4UKragmJX QUaQ== X-Gm-Message-State: AOJu0Yxr4Mb97xEcs/lJZ9kUEJ+w/5AoJvT2fLJR1RfuuxhuR91328de uWrf+H3cV6MW/cfxl2yoRj4BIdTWcGQSL+Kg3VS9ON9eONfBcotX7cCKu+tS8XFxBSRGZ/+Rjbg YdSH6SoI= X-Gm-Gg: AZuq6aIE+85432H+x0m2WCCv2m6uKPBODcMpOUuwQIJiEW+5FadSWTzjkvZcANpZJhU AKrSIZy6DHNoGBMMJFPG4zd7WTFFuqYY4yezLCQZyj6jLkl3mnLu9oYwNWDonnbBp7F2WabVxzV 7aWBa7DCXhedpJar5Gf8TsktF6Vo8dJABvqAVnYpF5/idJqyA6YFruezoIzviaZoM5gzCdLuY7l RAT0GL1or7eU2XZPwFZE3Tm/6QBRWb5A1run2+DAeib9xSqQJ2QG8MaUI+5ba+HyGdBhxdIPRRF MuMDM6YwbvMzV53po/CrupHmU/EzPrpioijYTwfF4UI4u3oKYj+R2BtH8opSbDfJ5zeVYVsutD+ SULEttI7pSOTZMi8dDgUhsPfXAUfPEkkmEo7o9wNrzYmscijdFAi2E8n0syr7mDUdDu+qP6tWev hmeyddRhu5xjltuMsQ1ShcK8Bw3c9sjbwuHcpvb6WL70SJ8/OcpGrfcFsGXLH35BZzYeBrtQ7T X-Received: by 2002:a05:600c:314e:b0:482:f12f:f35e with SMTP id 5b1f17b1804b1-483a95c710bmr107438455e9.12.1771801577494; Sun, 22 Feb 2026 15:06:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 02/20] hw/virtio: Constify virtio_is_big_endian() argument Date: Mon, 23 Feb 2026 00:05:43 +0100 Message-ID: <20260222230602.5756-3-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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=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: qemu development 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: 1771801656572154100 VirtIODevice argument is accessed read-only, make it const. Signed-off-by: Pierrick Bouvier Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260206221908.1451528-2-pierrick.bouvier@linaro.org> --- include/hw/virtio/virtio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 27cd98d2fe1..65872f2c54c 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -468,7 +468,7 @@ static inline bool virtio_host_has_feature(VirtIODevice= *vdev, return virtio_has_feature(vdev->host_features, fbit); } =20 -static inline bool virtio_is_big_endian(VirtIODevice *vdev) +static inline bool virtio_is_big_endian(const VirtIODevice *vdev) { if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { assert(vdev->device_endian !=3D VIRTIO_DEVICE_ENDIAN_UNKNOWN); --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801645; cv=none; d=zohomail.com; s=zohoarc; b=PsgUn1Qq7vdZa5W1dM8xGI4rsXoXEleK3SUAfiSI6ugMnjI+l7T9EuBpSfzCDZxF2FSNdu6ySeEmT5tO6fSxj76H+v1DmHgMXeWPbSbpBm6bGLp7HYIexbIzvpKNouiQu6aOJtoA33z262orgNhy3egBGnFEH1t8dQEjcrQONis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801645; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=rr8FkQBr/lYljYmGeFF82bNCM/SiTFsA//YlWk/hsy4=; b=h0eAyeOB4BGeRHFKg5OgqDaeXAgoPLNeUBctTqt1+nQ/18FIeA1fRaK56imnuLpwVQsVFgl0Lzoy5fSnbCBRsoffxnq/ihgZ/NFa91D1vWuvzVksO31Wv/mbGXsdwGxtcaE2afLl75vZtsj7cFiLMoCDNSIsanLkLyqpfVSPJ/o= 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 177180164500577.40319944924931; Sun, 22 Feb 2026 15:07:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIX0-0001TF-Ah; Sun, 22 Feb 2026 18:06:30 -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 1vuIWy-0001SY-C6 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:28 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIWw-0005vm-MA for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:28 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-482f454be5bso42603125e9.0 for ; Sun, 22 Feb 2026 15:06:26 -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-483a429e49csm114613625e9.4.2026.02.22.15.06.23 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801585; x=1772406385; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=rr8FkQBr/lYljYmGeFF82bNCM/SiTFsA//YlWk/hsy4=; b=as1k8jOU7bwtQ5EhPphj8n6lJ8cLCYlRAxLYwhTInp4LZadZiA962ygHwI22Kkuywd AjvEZZ2R5UkBImqou3F9H88j9DJi9bEN5nj5rsbzE5nS436BvD3eajdkQ1mYge0OzsDF fS3gd9em7MQw6XxlRtYiXAD4bx0Zj3TOqR2vQzwacdaLqIMNyt0RkyQht0Q0LQXZQBbb Z5zdOv/0eVtU/Ne50GTleQkXdqEwXkXfNUIvVCXAlNc8BooZnjiBWZJRTURGvmbLhK+a uAmTQwFhSBsxGTCMSwdJWIsPL5Uat3a9NhiK5tSvR4MiSGpsMarqt2Un3OOWA1rMN+95 pYBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801585; x=1772406385; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rr8FkQBr/lYljYmGeFF82bNCM/SiTFsA//YlWk/hsy4=; b=K6NbzRor66gYUj5xF9AjSMkMDnbqIwwE7D7OqpSNywH6/zlcNOQ0MRp6+cVq/vZR+k jbegiIL/mUEzd/XMCJ0kGKxrdj/vWCMEaDhmnBcojX4lS4xcY6uI9sIZe32yDv+X25nx Sg6Kp4F7372PU4wC3kB2pDRvYV8tIZ8ugyaLmaYqnYicaJPrRZQiV66n9lm6O/eY95Mc JmtgVVI3t8xPovG0oxYbB6KvyXtDuuvHxkrdZOZuBBexcknv4cYTOSmL8eBXdBGwufN1 divZch9wiOJrjezq08/DMacSkdqC2baey4wERgxtSC5p1weNQWHDhjOeQgJEu/E6ZKhq wF7g== X-Gm-Message-State: AOJu0Yz58bUQX2nYB3dsT5na63LaN2rL3r6bbW3l807GXEzta8atdZXz abxcD6xURvz70Ff5pMEhG3+2+NcP0T76iyZ7/HlvtVDwE/14GdIPkmOqWgZ6ceV2g4CNnoNprzf U0gF7qpw= X-Gm-Gg: AZuq6aKj4mR+KhYw2CXjNce03GsoUZ3tP3PzYeNCPguZ0RegSi3N7uUBOYiUGRmJY4F CEGtqW4zn4HPq8VAzlaGon2ohFG9zPd14+8ShqnIZ+GEnxe0ycWpT03n1Ee4O+Th/RYCaRoKL90 ZKPIdB03/KCEi+vEspD4ZaHCzTivh3AOekfM/F7QaqZBr4LpGySXZpR4iIOQ3SHxgMDGvA1N7xS 5TS0V3uaCmrW4asmmHU7U+aFK9mZ61T/qjYRVZ28SQAQPUTyI+uWip12KsBRB4n3Xc2NftJ2DOE wWL+2CR8WVcxB0X4ROCvOMRG/w1AGZbqK74H0PJ6flmzR/Jh6y38kgFDDBodxxJXQ6zZsLEfoVa TAuxZBj9IXQ7x9X1AlYCVxiz6jvAv8MgE0u2HYuu5Bl0301J31yOG9tvP8yZNrABSApMQd4kHAv TsyHuUnrlimszYPdIO0rEBP7frTUZcgQqIdNVn5BiulIjFRTMFVVBoc0T/AentfddEuIDaHW5l X-Received: by 2002:a05:600c:6487:b0:47e:e2b8:66e6 with SMTP id 5b1f17b1804b1-483a94d2fb5mr124628665e9.14.1771801584855; Sun, 22 Feb 2026 15:06:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 03/20] hw/virtio: rename virtio_is_big_endian to virtio_vdev_is_big_endian Date: Mon, 23 Feb 2026 00:05:44 +0100 Message-ID: <20260222230602.5756-4-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development 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: 1771801646652158500 From: Pierrick Bouvier Renaming this function removes the confusion with existing virtio_is_big_endian cpu ops. Indeed, virtio_vdev_is_big_endian is *not* calling cpu virtio_is_big_endian everytime. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260212234602.338131-3-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio-access.h | 2 +- include/hw/virtio/virtio.h | 2 +- hw/net/virtio-net.c | 4 ++-- hw/virtio/vhost.c | 4 ++-- hw/virtio/virtio-pci.c | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/hw/virtio/virtio-access.h b/include/hw/virtio/virtio-a= ccess.h index cd17d0c87eb..b58fb6ed7ea 100644 --- a/include/hw/virtio/virtio-access.h +++ b/include/hw/virtio/virtio-access.h @@ -28,7 +28,7 @@ static inline bool virtio_access_is_big_endian(VirtIODevice *vdev) { #if defined(LEGACY_VIRTIO_IS_BIENDIAN) - return virtio_is_big_endian(vdev); + return virtio_vdev_is_big_endian(vdev); #elif TARGET_BIG_ENDIAN if (virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { /* Devices conforming to VIRTIO 1.0 or later are always LE. */ diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h index 65872f2c54c..b3c6a9dc6f4 100644 --- a/include/hw/virtio/virtio.h +++ b/include/hw/virtio/virtio.h @@ -468,7 +468,7 @@ static inline bool virtio_host_has_feature(VirtIODevice= *vdev, return virtio_has_feature(vdev->host_features, fbit); } =20 -static inline bool virtio_is_big_endian(const VirtIODevice *vdev) +static inline bool virtio_vdev_is_big_endian(const VirtIODevice *vdev) { if (!virtio_vdev_has_feature(vdev, VIRTIO_F_VERSION_1)) { assert(vdev->device_endian !=3D VIRTIO_DEVICE_ENDIAN_UNKNOWN); diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index cc89619a433..eccb48ad426 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -301,7 +301,7 @@ static void virtio_net_vhost_status(VirtIONet *n, uint8= _t status) if (n->needs_vnet_hdr_swap) { error_report("backend does not support %s vnet headers; " "falling back on userspace virtio", - virtio_is_big_endian(vdev) ? "BE" : "LE"); + virtio_vdev_is_big_endian(vdev) ? "BE" : "LE"); return; } =20 @@ -343,7 +343,7 @@ static int virtio_net_set_vnet_endian_one(VirtIODevice = *vdev, NetClientState *peer, bool enable) { - if (virtio_is_big_endian(vdev)) { + if (virtio_vdev_is_big_endian(vdev)) { return qemu_set_vnet_be(peer, enable); } else { return qemu_set_vnet_le(peer, enable); diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index 52801c1796b..e98e3a40a07 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -1306,7 +1306,7 @@ int vhost_virtqueue_start(struct vhost_dev *dev, =20 if (vhost_needs_vring_endian(vdev)) { r =3D vhost_virtqueue_set_vring_endian_legacy(dev, - virtio_is_big_endian(v= dev), + virtio_vdev_is_big_end= ian(vdev), vhost_vq_index); if (r) { return r; @@ -1423,7 +1423,7 @@ static int do_vhost_virtqueue_stop(struct vhost_dev *= dev, */ if (vhost_needs_vring_endian(vdev)) { vhost_virtqueue_set_vring_endian_legacy(dev, - !virtio_is_big_endian(vdev= ), + !virtio_vdev_is_big_endian= (vdev), vhost_vq_index); } =20 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index fe13a7a9503..c7b5a79b936 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -586,13 +586,13 @@ static uint64_t virtio_pci_config_read(void *opaque, = hwaddr addr, break; case 2: val =3D virtio_config_readw(vdev, addr); - if (virtio_is_big_endian(vdev)) { + if (virtio_vdev_is_big_endian(vdev)) { val =3D bswap16(val); } break; case 4: val =3D virtio_config_readl(vdev, addr); - if (virtio_is_big_endian(vdev)) { + if (virtio_vdev_is_big_endian(vdev)) { val =3D bswap32(val); } break; @@ -625,13 +625,13 @@ static void virtio_pci_config_write(void *opaque, hwa= ddr addr, virtio_config_writeb(vdev, addr, val); break; case 2: - if (virtio_is_big_endian(vdev)) { + if (virtio_vdev_is_big_endian(vdev)) { val =3D bswap16(val); } virtio_config_writew(vdev, addr, val); break; case 4: - if (virtio_is_big_endian(vdev)) { + if (virtio_vdev_is_big_endian(vdev)) { val =3D bswap32(val); } virtio_config_writel(vdev, addr, val); --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801640; cv=none; d=zohomail.com; s=zohoarc; b=ccT7OqLyM+GPJ/chDoZwDfS/8IUJyu7XaAlqD84o8JL827TGGZlVkQ26llv5vDFwtLs/+VFrKxZM2OPxzxfIiPvlv1cV3BdYLICvh0I7+6kTdUJ9oLSS3orVJN4Ve3Y28BZG0AtR2ggKk5E7oy7aKraQPubOvqwEmAiwm+dwRYU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801640; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=ZGF+7iPYu2bZFwWUIJET2h0atyQWQ2AKTZmx89IP/7Q=; b=M0QOFJiule9bkFmSjBKsn1nU+ZWD1HIa8TUSHbg526Q7E/x10ohDZEK/gsy/wc8xKZ/qi0MT1DHgPW6UY5r7C3RkNww2lnRbWod3MNLtScTyR7f6LnylDbQ9RA/+rScsvNbICrCuy0KrTlLOPgmvpqUNvwsNmMh3MV8Y0m8YbGw= 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 1771801640480254.42283630410247; Sun, 22 Feb 2026 15:07:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIX7-0001aV-GJ; Sun, 22 Feb 2026 18:06:37 -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 1vuIX4-0001Zf-I9 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:34 -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 1vuIX3-0005vy-29 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:34 -0500 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-4362507f0bcso2606370f8f.0 for ; Sun, 22 Feb 2026 15:06:32 -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-43970c00db8sm14540172f8f.12.2026.02.22.15.06.30 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801591; x=1772406391; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ZGF+7iPYu2bZFwWUIJET2h0atyQWQ2AKTZmx89IP/7Q=; b=F1ibXK34wqieoGPGPl373ywjLLuoNq8oCFhQSPMrn+xtLFt+eS2xeOv6VBbE/1jjtD lK1o+4yKsR3y4B67M5k+XJvjXqQAz+VzN37hGybCRM14igc2tJoC7GM/M0tDX1Kf14xq LHaQ02tdpHbTAqDNH0CWxqQp90TjnfeII4IAdVfvuTMrAceoxeuySKneiM2r6kWKtmYS 1E7S/egUd8eq3gOEj6tQD4OH/IV5YqQ+inYhynI0Ifu0AIwVSqCg4xN994Ok4qbsRGTP /MehNF5pgiNRmKks5mGy3WQz802UgwQ2bViXM7q1YxlPWtSynaViOvm+75dxCIdW4+v5 dgwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801591; x=1772406391; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ZGF+7iPYu2bZFwWUIJET2h0atyQWQ2AKTZmx89IP/7Q=; b=JyMlD9ltWAfhlo0isd3SObwIxZ1tBkcJjwT4T37gPIJxyYmbXp+Q2apWw2AI3lTQl+ zuQyo6NVuPsRE6zseoHpXlspa38w7hv1RB9PT69k/xMn4YY/KfS4XUWLBuAV6uNGDETI 2c6JqElPpevffKivV+dlUxGpIwbKyBvxBztQtHkq4QPK0siSN1aDdHIvXTUx1btpBz5y K3hFDMzDPsm3MxRjMsdF3fEAewO+7O29Oj7s6+CIEmzf01BQkyft0/Y6Mb1uqc1tBlMz O37x3Me7Epm/FoBJaUT60wKzbq8udB9Ai9i+0SwqAXmhk0YCLwMsUWbps96v7lSvy3u+ J/1Q== X-Gm-Message-State: AOJu0YxMcjVyDvYnw5ZS7mXiJ5EJMz0adVVBu6MiekJDXTJM+U2DrZ5o cQw1EhWsbU5kZG+b75tEpGMsuJiHFFLX4sRMxtmNVgJJBQ9gl8rK6rcP856QhZ6zbJLMI3YApQE 23pLKGwg= X-Gm-Gg: AZuq6aImETMWy+BF2kB8JfKGTcgh87wTofAnHLxSu39e4r4S6pISNHimarDwOESuyY6 GyrpDkb4OizxyngMKrkq9VuCCskaWU75pu48btbALsLllCrvWlW+R0W4tJj02OpdPK73kqtvqFO IURxdVrSjn0z/wafxW4+sM+E7bh3iVUKNaoXfaYmVFckd5xMDtapsAbLx824rzlG1OBlfBCtTz2 b7v99YqbP6Aaaj9BhYVYUoiVuJCwGqQOKcaKkmb+YbLkKOABQ1Bt/uDNMATco4eLdgitoFLKjam Qhia/V87fQFbvLmUqfL48yF+awOUlodirSmKkZWFsCD10pPOMRWlRROO7UZuIsUdFZjJBoteQI+ lsITqmpzIbCTIeTCksAAQC+BEu/p3UJRv3S5Ujxh2KRO+c5tag5nzlLenwFc5bIeouQ3OpakSzu 9+EVq2H8i9xRD2aQX+r9VZdOdUO7Plw2CMZQvSfWcLch/34oY5wa/e245jgy4VsTN+8OZwRM+5 X-Received: by 2002:a05:6000:1ace:b0:437:7010:1cfd with SMTP id ffacd0b85a97d-4396fd9a3dfmr11725756f8f.4.1771801591295; Sun, 22 Feb 2026 15:06:31 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 04/20] hw/display/macfb: Constify macfb_sense_table[] array Date: Mon, 23 Feb 2026 00:05:45 +0100 Message-ID: <20260222230602.5756-5-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801642668158501 macfb_sense_table[] is only read, never updated, so can be const. Update the single call site, macfb_sense_read(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20260216213121.47122-2-philmd@linaro.org> --- hw/display/macfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 388f8de5070..57ad8ad5587 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -82,7 +82,7 @@ typedef struct MacFbSense { uint8_t ext_sense; } MacFbSense; =20 -static MacFbSense macfb_sense_table[] =3D { +static const MacFbSense macfb_sense_table[] =3D { { MACFB_DISPLAY_APPLE_21_COLOR, 0x0, 0 }, { MACFB_DISPLAY_APPLE_PORTRAIT, 0x1, 0 }, { MACFB_DISPLAY_APPLE_12_RGB, 0x2, 0 }, @@ -342,7 +342,7 @@ static void macfb_invalidate_display(void *opaque) =20 static uint32_t macfb_sense_read(MacfbState *s) { - MacFbSense *macfb_sense; + const MacFbSense *macfb_sense; uint8_t sense; =20 assert(s->type < ARRAY_SIZE(macfb_sense_table)); --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801627; cv=none; d=zohomail.com; s=zohoarc; b=gwfRVTpuQwo5r0O8rkmHSRLernODMGN1SNWuahltYTXKm8c6A7kSqmoW1Jecolzu68rdkzG6LkV+Haa+91485MS75ziiVu38oO1wvJ97uAHndN+iMv/TROEOm2f8D0NrufNszFlK8BhiS4lvnWnBxbtUHWScag/QhVc+r/FKaOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801627; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=OLEzbZM328E3NSLw7igBEUpMihYAhPnmUCU+6xw7L88=; b=AvESArgSndui7ddiNWH2eCnLGEyknu6QVZzQ3sDUH3c5KMKcrv1dabsziMOsor4tTAIBF+5rZfTVhdTLPqxWF6tN0r7/Nodq4tOwpFY7mL9uRG3jW4wD1xPF04QfkwHbrCaXUb3Ee2JFZrw6OKnLho7Wgwk9DdT9weW9Sj15wyE= 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 1771801627820828.8723882424975; Sun, 22 Feb 2026 15:07:07 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIXC-0001bU-Ko; Sun, 22 Feb 2026 18:06:42 -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 1vuIXB-0001b9-50 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:41 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIX9-0005w8-G0 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:40 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-483abed83b6so7662755e9.0 for ; Sun, 22 Feb 2026 15:06:39 -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-483a9caadd4sm139296035e9.11.2026.02.22.15.06.37 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801598; x=1772406398; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=OLEzbZM328E3NSLw7igBEUpMihYAhPnmUCU+6xw7L88=; b=oZkwAFb3H/i2D0pwYjK1OrFq6R7bdtnVIMO17rGAaTADbw1zgibSsGw1TVa6vXV2BR 96hnP28taAltnVtflOsmde/8Ov6PiRghlEmj+5BpmBvkahjTGCzfMFyXQ8Aer31I+gH4 ZwBd4UCHRtYPVxIQ4SrOR0KI0Gs4DoiRatR/88bqUZ88tgXAc2oRxGeU3UdaIJ7xt7Rr vCZB1I3W3fPm6Y6DCjFJQ/UxZgy6GyNAnA7DFL1LBPtavycH8dv0p858JF2S5HSKSNxs MsNm3nM4QlfFMobY+iEJ38+TjC9u7/Pouq2xO9jTA+bE7TKcPaJmtzJFPioiOvavZ/En iPOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801598; x=1772406398; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=OLEzbZM328E3NSLw7igBEUpMihYAhPnmUCU+6xw7L88=; b=D/z/I/NVygZ89V1o3VejutyZm3BbKeFZTPSkYu2R6lnQYxSgAcK0hD+a2VQMUjv8i9 i/kTRs2oU+JkpGre/yBcVsKJqxPQzfL9HjJlhJQCtn6CFwMZG1xt03jTYJTR7qafVF81 WHmBhSXzYElky8rekaQvNasUujriOL51f5ZMPT7s7nm8XAyAtUNB8zkbTAQ4jJoj2tZD 9tj92frgbcX3Y5f1x42KpYPH6sVXxoJRJGGRM+uHmZMPN2Mx99BGDN89kXatW5dT7KhC KLpxssjAGFQY5tUW2izHvSm3Uqg4vaw9BtwMnveBinrHjPC8l9XRqKkf4tdsy318qh7P RdJQ== X-Gm-Message-State: AOJu0Ywy8oMsTC0ic5/UIhBMn9qsV4JMlmIlLCEXT4UZwnBGBgEL1ww3 R8UdlmnQw8X2FOMquQ+Njx3NlW8d+QruMOROOOP35eJJ4vhISn6sdQZ4vJhxAk32hDPZOuFpDwp Q/q+FWc0= X-Gm-Gg: AZuq6aLonjXyWkosdq1kXqShRoyedMtTstCVkhqeGlP7K28T+/bk+iyXILj3fIKsAEa ot9pVs5HKwCm+kOoLLg4wyCyMBT3/+YF2dpLw9rpo2mGTPxzQnAQtB+hUp73EgJH/WYjP6FfSMO dZsR+vNXTaGAy9dgnOQI4DIerzTEEqenbDr8hlO8cfH0brOjc0re2NJwHdqu6QaxqCl4kvMep9Q ak03Qt2IrnORLu86wpFwddifG0DGDXYqbPW28QSf6pCsfbMMv3kLWW57tNNb/CNkfk3SE5MBI2l QuFhEoXxR0R/8CvK2PEZxPTISpEAb18XfkoyZLIEHK9R/XwABsdzhx0JiwbCkMV3/k4/rGM0yW4 /J/gwAq0IqFKZwwKw8FmUpTyKRhHZ/qzHNI70udv8eHGFoZ6w+HCrPgjVo3sxTETQF9IOFy3E2Q tj+JipKczQATcer1faDEC5ptFUWeR/k665bLlVEQA2MYib62U2C7oeMjVQPMV0uLU6zqBzJtuZ X-Received: by 2002:a05:600c:8b44:b0:480:6852:8d94 with SMTP id 5b1f17b1804b1-483a95eabccmr114440005e9.27.1771801597729; Sun, 22 Feb 2026 15:06:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 05/20] hw/display/macfb: Constify macfb_mode_table[] array Date: Mon, 23 Feb 2026 00:05:46 +0100 Message-ID: <20260222230602.5756-6-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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: qemu development 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: 1771801628812158500 macfb_mode_table[] is only read, never updated, so can be const. Update the call sites accordingly. Make the MacfbState::mode pointer to const. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Reviewed-by: Richard Henderson Message-Id: <20260216213121.47122-3-philmd@linaro.org> --- include/hw/display/macfb.h | 2 +- hw/display/macfb.c | 10 +++++----- hw/m68k/q800.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/hw/display/macfb.h b/include/hw/display/macfb.h index 495dead44b5..cb7aac7a4dd 100644 --- a/include/hw/display/macfb.h +++ b/include/hw/display/macfb.h @@ -66,7 +66,7 @@ typedef struct MacfbState { uint8_t type; =20 uint32_t regs[MACFB_NUM_REGS]; - MacFbMode *mode; + const MacFbMode *mode; =20 QEMUTimer *vbl_timer; qemu_irq irq; diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 57ad8ad5587..8ef174dc6df 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -100,7 +100,7 @@ static const MacFbSense macfb_sense_table[] =3D { { MACFB_DISPLAY_SVGA, 0x7, 0x5 }, }; =20 -static MacFbMode macfb_mode_table[] =3D { +static const MacFbMode macfb_mode_table[] =3D { { MACFB_DISPLAY_VGA, 1, 0x100, 0x71e, 640, 480, 0x400, 0x1000 }, { MACFB_DISPLAY_VGA, 2, 0x100, 0x70e, 640, 480, 0x400, 0x1000 }, { MACFB_DISPLAY_VGA, 4, 0x100, 0x706, 640, 480, 0x400, 0x1000 }, @@ -397,7 +397,7 @@ static void macfb_update_mode(MacfbState *s) =20 static void macfb_mode_write(MacfbState *s) { - MacFbMode *macfb_mode; + const MacFbMode *macfb_mode; int i; =20 for (i =3D 0; i < ARRAY_SIZE(macfb_mode_table); i++) { @@ -418,11 +418,11 @@ static void macfb_mode_write(MacfbState *s) } } =20 -static MacFbMode *macfb_find_mode(MacfbDisplayType display_type, +static const MacFbMode *macfb_find_mode(MacfbDisplayType display_type, uint16_t width, uint16_t height, uint8_t depth) { - MacFbMode *macfb_mode; + const MacFbMode *macfb_mode; int i; =20 for (i =3D 0; i < ARRAY_SIZE(macfb_mode_table); i++) { @@ -440,7 +440,7 @@ static MacFbMode *macfb_find_mode(MacfbDisplayType disp= lay_type, static gchar *macfb_mode_list(void) { GString *list =3D g_string_new(""); - MacFbMode *macfb_mode; + const MacFbMode *macfb_mode; int i; =20 for (i =3D 0; i < ARRAY_SIZE(macfb_mode_table); i++) { diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 25ddddb5d9f..4767eb4298f 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -255,7 +255,7 @@ static void q800_machine_init(MachineState *machine) int32_t initrd_size; uint8_t *prom; int i, checksum; - MacFbMode *macfb_mode; + const MacFbMode *macfb_mode; ram_addr_t ram_size =3D machine->ram_size; const char *kernel_filename =3D machine->kernel_filename; const char *initrd_filename =3D machine->initrd_filename; --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801633; cv=none; d=zohomail.com; s=zohoarc; b=PUvcMaYc+QBP0tMZLKG8O0Y6ddkumGM6RhLPyswWFwsDjYY8oIh7TvggYUfnedCqbTOKADWvi6+Oi5Y3NYVbggMjE2CD8AIec9ozg8nH09tj6pWLS702vKuxzp3YTdV1DqkNmn+M6NRz3jfvNpe+grxdgTnwcQQnlUO0C96q3Ks= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801633; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=/lJp/K/sDtW2YKLoXEP9LMb0n0a2kdE5iy2Xn+rwkwk=; b=Xni+ZvkqhAw77Df2TOcLcSVw0o24XkLlhPu3EYaLukJS6AhUb6943qvkWxyLLZBY/+lOzMk+pNrsHjSMuZKizEc3yFElMJatobKZD/eLcuuSCA0duHelTqmLxSFfK70W+zBT+MISKIxwF5UnfJXwZPS7CaGQS3jJXcjiU2wprKY= 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 1771801633072989.3590779374429; Sun, 22 Feb 2026 15:07:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIXI-0001i2-Vy; Sun, 22 Feb 2026 18:06: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 1vuIXH-0001hP-S2 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:47 -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 1vuIXG-0005wM-BP for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:47 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-43945763558so2196557f8f.3 for ; Sun, 22 Feb 2026 15:06:45 -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-483a31b3dd7sm234640785e9.2.2026.02.22.15.06.43 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801604; x=1772406404; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=/lJp/K/sDtW2YKLoXEP9LMb0n0a2kdE5iy2Xn+rwkwk=; b=oZ303TDXCf6eihoVhxrpy+Ctcln73JxNQ5PxktYsXuPIl3jkLMAslIvufKDmTBWskA 7c1w6CCjN/wVgRjpy9fjw0kkAYP2hwxMHu64+1fA899QPYAZjvCliWzF4CXaDJqMRNdc nnkrRMGxLHgcO6ApTfdmFk4LfUzolgFyjN6lnym7c7F54TfdrbfGUMOsVH9sD0PxFlgg VjAXco5mjkkClw3CnxzzuRApj5sOA+kh+yA+LWWgMcaNFMYA2zrww7AAFO+3snT8yoUR AiVHDIgi2bLKZ2DhC4VoBZCP7nnRuEzlHuxmuMFSdCWdyHd7i7Qd+LPmZ1jfTYB4IwgG bmdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801604; x=1772406404; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=/lJp/K/sDtW2YKLoXEP9LMb0n0a2kdE5iy2Xn+rwkwk=; b=UbmubHRwrDvSu2HYKThxzE/8dKoFpXobFXqv8Kb+oXYbrqMkjQ9R+m0Fjz+0wQ1DO3 Yka6ltEirvHYYpA/ydEeqpPtl5SjgYsUqEmyYXWshjf5nigYYcEMp9X/b/X17vW/sD1k qs+NX91UNFAKnTannA9ZMByO84xdOjE/GVqb/BVXROfb6CTV2MPAPEeylkCyjmFoQUdy QGBQjU3pqWlQj9qodilOZ7kinlKRyKpPK/gpH8MGp3e1L90VFjMJlH3Q75aPl8CO+VeY EFmGKXXTWW19e40+A68oVgeaYO6XG1A3uBkyE6BWID9omeZPrLDDlQFq2Dz3xufGgajH P+yQ== X-Gm-Message-State: AOJu0Yz+vER2BE39eC7BJIdoXtHytY/Dy7DyBPRT26ojcHQcn9W3pYeJ 6MCDF5+OTGqihAk2tOVA77/SoAPq2GnJJKSkI2pViX0Hh4c7ZMGCZqVjDH2Q/xwPV5oTigHmke8 uwn+HvVc= X-Gm-Gg: AZuq6aIceFfa2hkB1rBUEwEzbFgiBpH3KqP4CJpoq8VTB1MFqj+TolZHF9BtNtnyYBw 16ueM6uddtcKr5QzK+16es7FWpe5jhly18wc+F8GPGWkJOf84/yMxsBBDNAK0v1AFqUYq848X6L Q1eQGD5QHPq5XvLOU9Agwr5l/2wg8W3q9yMx8SGhgTKZYczLKoKgYC4RLs6B4gCRMOl0N+ZRDtN PhC2bIt9Vkgtl6ATdhmbO7GggnveCq7kFX5hJUAC/Pte5lJ5ccHkwIzMZjVIjdbME1bki6esa98 qXnzJS0fqrn/FtdN5P1GGzLTPTbgj7JX/+GjeaKlgXX8dGXO9zPL53PBOk3r1/hxRgX5MqC9dNh 3J/VbGe4p5K5shB3XHSdSwAOAeywGClJC88msv+kEKqNDmKF/uh5mNA0R+6LQgXrlu2c/t2x70t nM01g98uixOHjApa2oMmXJyqGl7KfKA+K+er3DXlQQx6D/Cg11RWchfvCf5zR6TAMEiVI0+N+C X-Received: by 2002:a05:600c:154b:b0:477:afc5:fb02 with SMTP id 5b1f17b1804b1-483a962e38bmr101858805e9.21.1771801604196; Sun, 22 Feb 2026 15:06:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 06/20] hw/m68k/q800: Use MacFbMode fields in q800_machine_init() Date: Mon, 23 Feb 2026 00:05:47 +0100 Message-ID: <20260222230602.5756-7-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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=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: qemu development 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: 1771801634611158500 Once the Mac Frame Buffer device is realized on the NuBus, its MacFbMode might be different of the global graphic_depth and graphic_width globals. Prefer the device MacFbMode fields to initialize the BootInfo structure. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20260216213121.47122-4-philmd@linaro.org> --- hw/m68k/q800.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index 4767eb4298f..b55c03a90bf 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -605,9 +605,9 @@ static void q800_machine_init(MachineState *machine) BOOTINFO2(param_ptr, BI_MEMCHUNK, 0, ram_size); BOOTINFO1(param_ptr, BI_MAC_VADDR, VIDEO_BASE + macfb_mode->offset); - BOOTINFO1(param_ptr, BI_MAC_VDEPTH, graphic_depth); + BOOTINFO1(param_ptr, BI_MAC_VDEPTH, macfb_mode->depth); BOOTINFO1(param_ptr, BI_MAC_VDIM, - (graphic_height << 16) | graphic_width); + (graphic_height << 16) | macfb_mode->width); BOOTINFO1(param_ptr, BI_MAC_VROW, macfb_mode->stride); BOOTINFO1(param_ptr, BI_MAC_SCCBASE, SCC_BASE); =20 --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801659; cv=none; d=zohomail.com; s=zohoarc; b=hE+0tkw5Ca5loQWIJKvrSf264uDmMXgy8wTtblAoX9+MJTYqMVk7/jOqzyDZuOFSgJWb+1x0OyW3oyoclLhjqsYpgl9ed9ZH0w9DEZPfprEGH5xoEkVbUy2JdWd1wfuniQC8OwpNQtGPUjd2+0TDi510OcHKpF7zA/tE0xcz/vw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801659; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=TRSLoEFEzwSsAV1OIyTMcpc9DCRIvmdEXunZ1hteP4g=; b=j/p5nYkNG0wbkEWke8bPg+sg+FChupv6vME61Q5wh7bznwA/ETIpx4uLQklwzGPZgrRAxyICKGOtgDGItNLxmgKckzu2eBENaoHGYn6wAND2iVIkNGEhqJmPkkWjlhakU/wCAC316zveFExth+wDdTXgmDgaVjqbBHLDBd9qtSs= 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 1771801659906606.6186696174714; Sun, 22 Feb 2026 15:07:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIXP-0001k0-6M; Sun, 22 Feb 2026 18:06:55 -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 1vuIXN-0001jd-PH for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:53 -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 1vuIXM-0005wZ-8B for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:06:53 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-48375f10628so23004355e9.1 for ; Sun, 22 Feb 2026 15:06:51 -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-43970c00d0csm15173759f8f.11.2026.02.22.15.06.49 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801610; x=1772406410; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=TRSLoEFEzwSsAV1OIyTMcpc9DCRIvmdEXunZ1hteP4g=; b=FPZHrQweBVBdM9IXymeE2ClWe74Lr5yc6h+2YyQX8/7M1YtknXfgOFAUnRzUviBnyc +pmLzBCoYApNlFWOOTe2diaeRe6O3XVgqqHH5xxzAoOucZfCXKS01lG3yUE4NFbDn6Um dpXtCxNtzh0Z/qP2qbCdVmO0SKW/QOVFM+nnB3DgHSWUmUBo/ElZz/vyNWoFw5hJ4SK5 w6+VrR+xC5JeKpGidJ750xFJAHCSFFPfvWDJfnmzgqAyRYNtzr/eA+a+hn4hu1HEU8fP E15OR3pyRKHGLXfRfo5sXT09xQFzbQtOgJZVvyuOR3VjLGbo9mFdmA+PdzHIjFO/rvB4 U8RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801610; x=1772406410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=TRSLoEFEzwSsAV1OIyTMcpc9DCRIvmdEXunZ1hteP4g=; b=ozglqpFMQTPFykVO8FlJk74m6eKXNa6eGebeJvI6GOLQg/5Y8fg1zBxXnWwf1jHwTB uHw2L0GZbMVkldBPiMM90l0eTTcRnhqwP43BMtNGo2T3/PVWxnfarF3pAf6Mgjov4o/U 3jBVGD9yb7AAFlRD1w4cMjryYQt/Gmbm1lJRni2P2C2CiuV8kqCj3JQKqWbUlZX+dTjp PCoV2k+yQcZXSg8PgR18voigd+YJS5w/KSA6alubhwaerEIsyhU+uqNsHT5qc+qQd249 EU/Owms1cAZrgTzltQ8KepFRoGzBxRhYujXRFsey0PS6aLayHcWQn5iUCkj3R5rDQv6q oPhg== X-Gm-Message-State: AOJu0YzK9Nto/WWUj0RJvNpidNrjICes42pZ/BDXcZEvxBipfFlyxEP1 MuDft80PSa70VXSQEJXn7RRH21hyadhreoaZjhS5D78w3ZQM9oLIuHdb1cCD9kMGT9fkscSnNRd /nmm458I= X-Gm-Gg: AZuq6aLvwQNVPw5LjFHr7x+MIkGUVcnToRehZ+lRtVZZl+Agqr8tdN2tcUmxW+omvvv KNw4XtOSm0Yiudc2nVdEg1va6D1pemc0huxwdBAorQBvt+8EPX8h077hjkJDOZqVjijjqaSLQcb b8AWepRdGf/5f4VsIZahz8tXs4FgkXWN2uF2vPeLRjH2dFO2DSc+Qmt5HK1mRFgrwNhgmol4egy DlV5lP2JalOJlwOIH8CNRSU19jwho3jk59SLv4pQr5JUqUoISv5LAN3Lg3xgfsZcUS5p5jBJJYg DJZ0zl4OMttalzVeJX3qd+3EiCMj4HtfAyMijT48FSxlk7izV+lQQ3Nufzy+l2yUp/R1YpnZhFb ITzdEAFHXKc334HlyuxqkCgVgqgGidHrxqlqX5wNMWxT6PotAPdTCsJyMbit2iFul+6iGW5qNcr yWBupUQjUh5LSjTLJPj4xagH81msx+HqHYMRIszBNHjGCTpX6WpcE80USAhMErUOxEmg0AcUlP X-Received: by 2002:a05:600c:3b0a:b0:480:4ae2:def1 with SMTP id 5b1f17b1804b1-483a95be7c9mr129820765e9.13.1771801610524; Sun, 22 Feb 2026 15:06:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 07/20] hw/m68k/q800: Set MACFB_DISPLAY_APPLE_21_COLOR within MacFrameBuffer Date: Mon, 23 Feb 2026 00:05:48 +0100 Message-ID: <20260222230602.5756-8-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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=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: qemu development 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: 1771801662489154100 The MACFB_DISPLAY_APPLE_21_COLOR mode is not specific to the Q800 machine. Check and set it once in the MacFB DeviceRealize handler. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20260216213121.47122-5-philmd@linaro.org> --- hw/display/macfb.c | 4 ++++ hw/m68k/q800.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/display/macfb.c b/hw/display/macfb.c index 8ef174dc6df..b8115c2be13 100644 --- a/hw/display/macfb.c +++ b/hw/display/macfb.c @@ -645,6 +645,10 @@ static bool macfb_common_realize(DeviceState *dev, Mac= fbState *s, Error **errp) { DisplaySurface *surface; =20 + if (s->width =3D=3D 1152 && s->height =3D=3D 870) { + s->type =3D MACFB_DISPLAY_APPLE_21_COLOR; + } + s->mode =3D macfb_find_mode(s->type, s->width, s->height, s->depth); if (!s->mode) { gchar *list; diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index b55c03a90bf..ba32da2fa45 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -563,11 +563,6 @@ static void q800_machine_init(MachineState *machine) qdev_prop_set_uint32(dev, "width", graphic_width); qdev_prop_set_uint32(dev, "height", graphic_height); qdev_prop_set_uint8(dev, "depth", graphic_depth); - if (graphic_width =3D=3D 1152 && graphic_height =3D=3D 870) { - qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_APPLE_21_COLOR); - } else { - qdev_prop_set_uint8(dev, "display", MACFB_DISPLAY_VGA); - } qdev_realize(dev, BUS(nubus), &error_fatal); =20 macfb_mode =3D (NUBUS_MACFB(dev)->macfb).mode; --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801671; cv=none; d=zohomail.com; s=zohoarc; b=YiK0rLLDBTVFTCDNrAnqkEHChg6ZJNmkEibaQ4rkC9ZTnecRz9Gzh9H6E3jRWHW3ChXIH34X7nC903K7HVC+DmgNoz84dlxIQ7KjWNN6qaOI0JmLV1fwrUe9gQiGhe1s9S9R1vVgQwee0BcpNiExK+xzSK0t8jpt07OULlmHvMY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801671; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=zPaG6XUhSOgMW4ojj4JskNGIynnfggKUOmhosKoKH0c=; b=HigySQp8tmjlDFQ5zVha34P7ss0yc1m8z0L0q4lGS4Hc6kyy+d1bivmiXQrhJpephE7DDdeatAsB6/JrGxH5yUSsOfjJYWeLNHuEl6gCElkIB2sB7WWpXx1tkdLKOoeE1WqWyC+44fqoVbjaTvX8xo4BqqqBBIb6jpwjIJPbGIQ= 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 1771801671011487.656365210408; Sun, 22 Feb 2026 15:07:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIXW-0001m3-0A; Sun, 22 Feb 2026 18:07: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 1vuIXU-0001lq-V2 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:00 -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 1vuIXT-0005wl-CR for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:00 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-4833115090dso35643235e9.3 for ; Sun, 22 Feb 2026 15:06:58 -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-483a42eb7ccsm72295595e9.14.2026.02.22.15.06.56 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:06:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801617; x=1772406417; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=zPaG6XUhSOgMW4ojj4JskNGIynnfggKUOmhosKoKH0c=; b=CxWe4hVOKii+keB2XItc9tdmgzBdeFAKLLxN3uBR4By6e3xw4afgD68yIgbKwMNtow iEn0mv2RLreaiikx4hNIdyse4RI3PPVXtvrQlH9qbAq8XZd+p22BX9mnK08RkwIZxNiQ ypzo3tZ2JNruDAbnW1985Ju9e+ICLTC6436gKhNWKEOmXl+4QSB7v+b3JjPs0o33Hl46 +dwVTNhetIj9IcthPswvteZDnUXmXTEbuICJvKGDIIV08YmyB3uYXjPvoUoJ2pdYX05s 3PqP3W8idrpAmVR2xVsIPh3WKkwaNH6RSDIFiFxgL1jIcZO/1lZWg19B1Z7lA/ofk95N +zfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801617; x=1772406417; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=zPaG6XUhSOgMW4ojj4JskNGIynnfggKUOmhosKoKH0c=; b=fnjqKY7KbxNVc/zOosPCw7K0rx52H7iy0GI0eD3R2rJykrVA9RFDLbQjPkChTSli8/ CbHoIp4ivSC3Rv1nvnFLULLeff7OKYi+0xRVq9679UXWMoPzOpf5s1mrFBFH4F+7ACir tV8EF7k/WGJM3M3WIt0CJ8vDxHJSTkZvY2PtYYHxI1Apn4C+IkosYDEuUPGECWxUVBvt wTp5zLllt2Y1cDcfg5DiJjQKAyru89y38akSHCpYfJyW1niWSE5PwvQ4UDV4IcAqpC4s 8WDVlRyYprYuwyFrYlxkn30n9Pr8bDGS7Vq1s9ryV2ul2s62HovkEYMzlof4AQuYaXOt KTBQ== X-Gm-Message-State: AOJu0YxMX/oEsd/j0ZRgOp0yoDDgu0rompF8iCvJiDp+njxhzMW9AeLA NwVXi0ONiUjWPKVPqwdgYKdGOvg+gFMEihilczXUcq7COBfXYrVHbb3pppRdwsfjn3ZMx9tPq/E C7nqub0I= X-Gm-Gg: AZuq6aLa49AaRlPTAc25PN0PqLMCODVy8TEaQiq3Kb9CZm4XT40vLhWn9Jjkuk9SNIf qGwwXzKQrFP6iRyoVGk0waKEsyFifTlrEz6Z+LsKjVylbUnHYdx6cVeoCg6q1PaerS9MXY37+FB EHiwMPazkIt3v3UivKMHAqa29GJqSRh4FCNaAtr5mUWiUI6reu2h4Q2syotzSnJzRlnpRko6NlC UQd5Ij/8Uo4JIoZ8Ex//l+I957j2IvfBkWNWXcgZo3Y6nzVSAwcyiyz9mTxJ+kDUTfEsdKVkInG SdAOsa0bDFTfQPhgyZkuS9RZxlR4HKw4zWyMkPj8fQJ01IBItan5S8N6V4pqI/mpIwPTuMghg5M h6nnXxWTv61xaIbJSg/d3kwxNigC/+aO2IzUwgFjb6pl729oNCkD6/YbR1Pkx/02BwKGJ8JQSGV 1u17H/APCJ1Vni5QtFd+b27jRbQAp+PqH3x217uzH9wkiXKfNvjc64lx1FA5oC4ErVwKswHcVU X-Received: by 2002:a05:600c:1d0a:b0:483:9139:4c29 with SMTP id 5b1f17b1804b1-483a95b58e6mr120138825e9.2.1771801617074; Sun, 22 Feb 2026 15:06:57 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 08/20] hw/m68k: Set graphic display dimensions generically Date: Mon, 23 Feb 2026 00:05:49 +0100 Message-ID: <20260222230602.5756-9-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801672613158500 If a dimension is not set, have the machine init code (q800_machine_init) set the default value. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20260216213121.47122-6-philmd@linaro.org> --- hw/m68k/q800.c | 6 +++--- system/globals-target.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index ba32da2fa45..ded531394e6 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -560,9 +560,9 @@ static void q800_machine_init(MachineState *machine) TYPE_NUBUS_MACFB); dev =3D DEVICE(&m->macfb); qdev_prop_set_uint32(dev, "slot", 9); - qdev_prop_set_uint32(dev, "width", graphic_width); - qdev_prop_set_uint32(dev, "height", graphic_height); - qdev_prop_set_uint8(dev, "depth", graphic_depth); + qdev_prop_set_uint32(dev, "width", graphic_width ?: 800); + qdev_prop_set_uint32(dev, "height", graphic_height ?: 600); + qdev_prop_set_uint8(dev, "depth", graphic_depth ?: 8); qdev_realize(dev, BUS(nubus), &error_fatal); =20 macfb_mode =3D (NUBUS_MACFB(dev)->macfb).mode; diff --git a/system/globals-target.c b/system/globals-target.c index 989720591e7..e3f7d846ac0 100644 --- a/system/globals-target.c +++ b/system/globals-target.c @@ -14,9 +14,9 @@ int graphic_width =3D 1024; int graphic_height =3D 768; int graphic_depth =3D 8; #elif defined(TARGET_M68K) -int graphic_width =3D 800; -int graphic_height =3D 600; -int graphic_depth =3D 8; +int graphic_width; +int graphic_height; +int graphic_depth; #else int graphic_width =3D 800; int graphic_height =3D 600; --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801671; cv=none; d=zohomail.com; s=zohoarc; b=Nonve+cXD+UFqeukiM3u6qUE82QX5ELrWnmWp3tDb8nwxGwbrdMPgO1dV8GQHzWlC5q1vhZHU2nesK3eGZKfuhuErppmj8Vkf4E6+NBn8jrzbZcjZdqzVUIc7LSW2zD5iEbCPqvZNjkMtvwdbgIhp7BYOc+Dy2x9OKker3AaZdo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801671; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=WNDBjylFNuXpzrPIF3jnKY2VcMM3yBA2p0uoFcpRvJk=; b=nz/ofVSm3Y5L4yiNCFMeOA/0HfHoM8WJKJXvYSKz2eqqtDdoQogI2kLtObJsCSYF49nQ3Dt3WuOKvqjsxMLvarzXfu7zs0llKFQZso8u9kE7UZrrkKK0y9oQksixkD+hpwgVoLmGltbuUWfqsocL9OA9KmEPQeOQM/Ck1w7wIZw= 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 1771801671007722.5953111483933; Sun, 22 Feb 2026 15:07:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIXd-0001r1-Hd; Sun, 22 Feb 2026 18:07:09 -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 1vuIXc-0001q0-AE for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:08 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIXa-0005x9-AA for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:07 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-4836d4c26d3so33379315e9.2 for ; Sun, 22 Feb 2026 15:07:05 -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-483a31b3d88sm244164275e9.3.2026.02.22.15.07.02 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801624; x=1772406424; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WNDBjylFNuXpzrPIF3jnKY2VcMM3yBA2p0uoFcpRvJk=; b=jfat0mirLhM9ZRME/Jvgap+nJWTvN0kGbTZzRh/L7pCGIVIo+tyNaUz5PfzT1j7xMc qA0mP/l4rI39PdK8nEuszBj9FQuwMz+2UyXES3ObQxjSHCGGDSMQrAgUAqfpdtIDTzdU sSCPkANBz8jKrGPN9tNBBjVFTw1G18yb0q2u5nNYB2bBPxqXKcDzpa8CZ1i5U+6K00wE I9uwd5a9dchD4thkKCXBV1fA4ehIqrLglK59vVu7I7C850KSv1zKIAo8oR5w6jXPvmAx 9L9BFUwcCsU+4+CMskmSmB9F8pVlA4TPhIkFA9DQSDhBu8YUZM/CNcu06RXj/MZols52 QxcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801624; x=1772406424; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WNDBjylFNuXpzrPIF3jnKY2VcMM3yBA2p0uoFcpRvJk=; b=hg1tCDB4KuSQpQ4Rda0vM7TpK24zqMeu8E5OofaAI4SASCYxdPLoeyilJBJ1N14gZc ccdMAJUc3+v4RQHZVzRloazl/l2d2juu37AuTpcOl9bLINHpTlA9bw7e94iEn5CXf0vA 2hAQFFWHl34mPBkIbntq/ATEkFAKxk+dHmjAnyyr9sx3AO23/ogH1XOd/Cno4hbXQ23t fm+ixQZ8f0Vcf1ivEPAmuzFuieXbb23E9b2ME9Z9HqS3m1+u+nIAdYZ8IXNu++l7vQ6S 6930UTiswOCbmMR9iPrjcdCfQl97GP1oFQSoSz/yueM0YKQWwWK7DZZTuyfRM2VvJ713 dtFw== X-Gm-Message-State: AOJu0YwpOoTdLZPRM5YUzfTzrHIpzEcLJTNzesbwklLRSGijXqlOQjfC +FArCCmuHtxP4fIh1dkxGlRzhxmn5LTzRRZ4ExCQ4YrgV4W922COS5lhj8XgaLHm7OfPlozeux1 UvWOfSig= X-Gm-Gg: AZuq6aJi76MzdQAnWvTqUDNbACGx2Uh9GaeXtHwGBDoRATKKA7hNy39FIG/iiu+wmcu 0V6nmpPNTMCDODF4O11XRmEsDWppJzHm7qrznLCZJaAX6hE0iHyj3jquZdzkp1hf2FWX9fk/aXc ub/oxSuVSQiLyfmaJV98fWQmGH7knBYHhMDOiZUcIs6BhA63whFF/rEleWgpTx+MElv3fXCqDNO 4IR+Rqx2hXG0bbZjFd8EV0etTWKEX0gz8aXG+L79Q+HLhUELEWObha6W/UkUD+jD2vhhEGwwzDH Act+SdeDtTah11GNHUUrIXvEEwW06iHC8XtUSVR9cAphtWqoryhDJUAEqn8CwxyUtdwTDH0nfeh 6oPXG625Hq/1i53qnZr+VKDKzfUTQTEMUs94C2PKe2BaKA9bUKGD5ryB7dHdjnd4+S7TvNv+ZTc RbaqWH8VsTxvohQlsLb5m15K8j+vC/Efoju5muKi1vZQKhYKDko1dSncEKUbWOhjh+RSofD1x8 X-Received: by 2002:a05:600c:45ce:b0:477:93f7:bbc5 with SMTP id 5b1f17b1804b1-483a95b5835mr106783085e9.10.1771801624337; Sun, 22 Feb 2026 15:07:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 09/20] hw/sparc: Set graphic display dimensions generically Date: Mon, 23 Feb 2026 00:05:50 +0100 Message-ID: <20260222230602.5756-10-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::329; envelope-from=philmd@linaro.org; helo=mail-wm1-x329.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: qemu development 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: 1771801672982154100 If a dimension is not set, have the machine init code set the default value. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Mark Cave-Ayland Message-Id: <20260216213121.47122-7-philmd@linaro.org> --- hw/sparc/sun4m.c | 9 +++++++++ hw/sparc64/sun4u.c | 10 ++++++++++ system/globals-target.c | 6 +----- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c index 0c0d658d301..a17bdb36927 100644 --- a/hw/sparc/sun4m.c +++ b/hw/sparc/sun4m.c @@ -892,6 +892,15 @@ static void sun4m_hw_init(MachineState *machine) hwdef->esp_base, slavio_irq[18], hwdef->le_base, slavio_irq[16], &hostid); =20 + if (!graphic_width) { + graphic_width =3D 1024; + } + if (!graphic_height) { + graphic_height =3D 768; + } + if (!graphic_depth) { + graphic_depth =3D 8; + } if (graphic_depth !=3D 8 && graphic_depth !=3D 24) { error_report("Unsupported depth: %d", graphic_depth); exit (1); diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c index 5d7787fc1a5..b8bda1eb816 100644 --- a/hw/sparc64/sun4u.c +++ b/hw/sparc64/sun4u.c @@ -666,6 +666,16 @@ static void sun4uv_init(MemoryRegion *address_space_me= m, sysbus_mmio_get_region(s, 0)); nvram =3D NVRAM(dev); =20 + if (!graphic_width) { + graphic_width =3D 1024; + } + if (!graphic_height) { + graphic_height =3D 768; + } + if (!graphic_depth) { + graphic_depth =3D 8; + } + initrd_size =3D 0; initrd_addr =3D 0; kernel_size =3D sun4u_load_kernel(machine->kernel_filename, diff --git a/system/globals-target.c b/system/globals-target.c index e3f7d846ac0..17a27a06218 100644 --- a/system/globals-target.c +++ b/system/globals-target.c @@ -9,11 +9,7 @@ #include "qemu/osdep.h" #include "system/system.h" =20 -#ifdef TARGET_SPARC -int graphic_width =3D 1024; -int graphic_height =3D 768; -int graphic_depth =3D 8; -#elif defined(TARGET_M68K) +#if defined(TARGET_SPARC) || defined(TARGET_M68K) int graphic_width; int graphic_height; int graphic_depth; --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801660; cv=none; d=zohomail.com; s=zohoarc; b=koEaIWMrX+kkblJva96t1AKP/MAgiSNu4NICGj7QX1kT9PpkPlYU6Qpj1b78y9LvCbNhtJjRLIglafR8JXVNPmHFt35I0MTk1+H8wmriF2fTV49fVDCB8w7jJDkAaNSKl6tqY11jPjrinPuduIYTClcC35RX6XKSYb62CzInlQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801660; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=qLCaZvgKAL4MCYLyu+xYgSzKOvD151aNu09KFmgjsEk=; b=QbaJcZDIUn7fIvcqoaPTMN/P6/7JJcd3vH6zJC9EiyzlaLQPWNECbjBEGGSU8V2Yd+XLG/k+LWfO6MIxshW0HOnYPFgMI0oJXszmHqKEeDufQIAnWDqh9E4Srraxp9AfBFRipQ3fKmUkBa0UZdCARxdcuUqMeTr/hUSZt3cNEnM= 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 1771801660039723.9289978717496; Sun, 22 Feb 2026 15:07:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIY0-0002PF-7H; Sun, 22 Feb 2026 18:07:34 -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 1vuIXj-00020G-J4 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:19 -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 1vuIXh-0005yd-MA for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:15 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-48373a4bca3so22360875e9.0 for ; Sun, 22 Feb 2026 15:07:12 -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-483a316eb08sm250407225e9.0.2026.02.22.15.07.10 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801631; x=1772406431; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=qLCaZvgKAL4MCYLyu+xYgSzKOvD151aNu09KFmgjsEk=; b=bIjVuzybo0IarjzWHsFjcTAd45EZmhEQkyXxj58ehkmy4m1QZ69B1wbP0aSURn+oih 4qT2GFdS9fN7ukXjP7z/DxSwhSNnSnnQQlR1A9B7645brchjxQY9TwVhEX4k1EIfgIJV mxWeow3S9QIatSHh50a4kXILpwln4XLwv6uxX84+AyYGTcahMn0jxSOEcsnJKVyV3Npu wNDZ1e9JNbpSMyh5KIf5OAMzEnPwtmfebu1/yCxUtvKQLXdyrYyIXlkIeNLIcAmBo23W MXzoLbs9kM8xXH2Q/n96ibGpTFhWNnTjwlyi4yjw98kSucjRKRqPLGw8w3IPpb8GQfkF /blQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801631; x=1772406431; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=qLCaZvgKAL4MCYLyu+xYgSzKOvD151aNu09KFmgjsEk=; b=D/hfEsB/Q5JMMLBHjw7PyZ4gpPgdLXbd20UNmOA9V+EDDl3QNeT4lx1InfHNuzHAwg Pq5UXv7QWTkNKar+XlYYjWsfskxFl5veXnV+Om9v+cRco/B7JoVemJ1DiCVXeMrYplC9 YBWnTTk688ARC2aUft3n3CjiADBmO1PteRKsPswVfHT0L/45ljLrPInVSUgbiqrIH5qV Vc2qmpbaekOwlKA/Ch+oYYDtnjUvPd+NlAhbDwRDtouFc8xD8TVhXlHOHfvSx/Z4ep5T 8y6fgU7N3iiCkqgxIIMLooi996UlmM3Xf03kVCik2FZ2GkUlEtliDdC0K7Gqlq6N0pDF DmEw== X-Gm-Message-State: AOJu0Yxw1suy3JOP+Cpgl+VYc4jj3KFM+JtkU66OXxTDeI1XNW4/rS9w tZBIE2wdvUoYDCUJt7Ymp//yrU3k1wNASNMxbCWUmfjJJc0S/ntKbz7gSLEVGDddKK0i/tnFAzO DyJHYIsI= X-Gm-Gg: AZuq6aJ4IIlapYuA0N3Ms0f3ocvnUVSrJgq6kUZoNNj5pUmMe/NwjziOsaNq+hORK5k EBdbxnkrATV05HVa9LNwtSmkxiIzQ/fw2QsymOimGpOShlU+ireCjwyrvzaZ+LAswpFHYVqFLUh ob+HdfsJPFN081vfDcx2BCVG3/MU58+eUWyzm5emSMT4tONtIZQWxtGL3Llgk70ENbSMTzVzLpY v4uPq8me5LDlcZIXzWZsJrsUxvB/5t/EwCwsF2solQsH/7jEAAZNFwUZh8LThwTBgfg/SmG8DDq 1inmHaC8KteNmK8lQwNR9f2xumOKJOoF9YS3sH+Vk5mtQD+RTALt45M7pH1m78IFh4BSfltb2T8 unZ1oHkAxgdKgS8WwYgGofWbx+QalBSYoB98qrWg+488sbF/yTvinSmnY08LdgsrQ6aB78rbkFD HLSla2sOhOCQzNLP6XJh0RshraAVewh4yRIWbpVvjz/TGxrTqWyFPSYnKx3QTvWy0C6gY1G2Y4 X-Received: by 2002:a05:600c:a03:b0:483:71f7:2796 with SMTP id 5b1f17b1804b1-483a95c7116mr112821205e9.10.1771801630850; Sun, 22 Feb 2026 15:07:10 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 10/20] hw/ppc: Set graphic display dimensions generically Date: Mon, 23 Feb 2026 00:05:51 +0100 Message-ID: <20260222230602.5756-11-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801662658154100 If a dimension is not set, have the machine init code set the default value by calling the ppc_graphic_dimensions() helper, common to all PowerPC machines. Declare local variables to avoid using the global ones. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20260216213121.47122-8-philmd@linaro.org> --- include/hw/ppc/ppc.h | 2 ++ hw/ppc/mac_newworld.c | 10 ++++++---- hw/ppc/mac_oldworld.c | 10 ++++++---- hw/ppc/ppc.c | 8 ++++++++ hw/ppc/prep.c | 4 ++++ hw/ppc/spapr.c | 4 ++++ system/globals-target.c | 6 ------ 7 files changed, 30 insertions(+), 14 deletions(-) diff --git a/include/hw/ppc/ppc.h b/include/hw/ppc/ppc.h index cb51d704c6d..14cc09ab22b 100644 --- a/include/hw/ppc/ppc.h +++ b/include/hw/ppc/ppc.h @@ -102,6 +102,8 @@ enum { ARCH_MAC99_U3, }; =20 +void ppc_graphic_dimensions(int *width, int *height, int *depth); + #define FW_CFG_PPC_WIDTH (FW_CFG_ARCH_LOCAL + 0x00) #define FW_CFG_PPC_HEIGHT (FW_CFG_ARCH_LOCAL + 0x01) #define FW_CFG_PPC_DEPTH (FW_CFG_ARCH_LOCAL + 0x02) diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index 7275563a155..daf0029c01a 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -156,6 +156,7 @@ static void ppc_core99_init(MachineState *machine) DeviceState *uninorth_internal_dev =3D NULL, *uninorth_agp_dev =3D NUL= L; hwaddr nvram_addr =3D 0xFFF04000; uint64_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ; + int graphic_width, graphic_height, graphic_depth; =20 /* init CPUs */ for (i =3D 0; i < machine->smp.cpus; i++) { @@ -432,10 +433,6 @@ static void ppc_core99_init(MachineState *machine) =20 pci_vga_init(pci_bus); =20 - if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) { - graphic_depth =3D 15; - } - pci_init_nic_devices(pci_bus, mc->default_nic); =20 /* The NewWorld NVRAM is not located in the MacIO device */ @@ -480,6 +477,11 @@ static void ppc_core99_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device); =20 + ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth= ); + if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) { + graphic_depth =3D 15; + } + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index e679d338985..ea1f778877c 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -108,6 +108,7 @@ static void ppc_heathrow_init(MachineState *machine) DriveInfo *dinfo, *hd[MAX_IDE_BUS * MAX_IDE_DEVS]; void *fw_cfg; uint64_t tbfreq =3D kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ; + int graphic_width, graphic_height, graphic_depth; =20 /* init CPUs */ for (i =3D 0; i < machine->smp.cpus; i++) { @@ -288,10 +289,6 @@ static void ppc_heathrow_init(MachineState *machine) pci_create_simple(pci_bus, -1, "pci-ohci"); } =20 - if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) { - graphic_depth =3D 15; - } - /* No PCI init: the BIOS will do it */ =20 dev =3D qdev_new(TYPE_FW_CFG_MEM); @@ -321,6 +318,11 @@ static void ppc_heathrow_init(MachineState *machine) fw_cfg_add_i32(fw_cfg, FW_CFG_INITRD_SIZE, initrd_size); fw_cfg_add_i16(fw_cfg, FW_CFG_BOOT_DEVICE, ppc_boot_device); =20 + ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth= ); + if (graphic_depth !=3D 15 && graphic_depth !=3D 32 && graphic_depth != =3D 8) { + graphic_depth =3D 15; + } + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c index a512d4fa647..d7b4466d701 100644 --- a/hw/ppc/ppc.c +++ b/hw/ppc/ppc.c @@ -29,6 +29,7 @@ #include "qemu/timer.h" #include "exec/cpu-interrupt.h" #include "system/cpus.h" +#include "system/system.h" #include "qemu/log.h" #include "qemu/main-loop.h" #include "qemu/error-report.h" @@ -1557,3 +1558,10 @@ void ppc_irq_reset(PowerPCCPU *cpu) kvmppc_set_interrupt(cpu, PPC_INTERRUPT_EXT, 0); } } + +void ppc_graphic_dimensions(int *width, int *height, int *depth) +{ + *width =3D graphic_width ?: 800; + *height =3D graphic_height ?: 600; + *depth =3D graphic_depth ?: 32; +} diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index c4efd1d3908..7077b047b25 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -43,6 +43,7 @@ #include "exec/target_page.h" #include "system/kvm.h" #include "system/reset.h" +#include "system/system.h" #include "trace.h" #include "elf.h" #include "qemu/units.h" @@ -250,6 +251,7 @@ static void ibm_40p_init(MachineState *machine) uint32_t kernel_base =3D 0, initrd_base =3D 0; long kernel_size =3D 0, initrd_size =3D 0; char boot_device; + int graphic_width, graphic_height, graphic_depth; =20 if (kvm_enabled()) { error_report("machine %s does not support the KVM accelerator", @@ -412,6 +414,8 @@ static void ibm_40p_init(MachineState *machine) fw_cfg_add_i64(fw_cfg, FW_CFG_RAM_SIZE, (uint64_t)machine->ram_size); fw_cfg_add_i16(fw_cfg, FW_CFG_MACHINE_ID, ARCH_PREP); =20 + ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_depth= ); + fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_WIDTH, graphic_width); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_HEIGHT, graphic_height); fw_cfg_add_i16(fw_cfg, FW_CFG_PPC_DEPTH, graphic_depth); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 274f38785f2..c50c7da34d5 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1143,6 +1143,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr,= void *fdt, bool reset) { MachineState *machine =3D MACHINE(spapr); int chosen; + int graphic_width, graphic_height, graphic_depth; =20 _FDT(chosen =3D fdt_add_subnode(fdt, 0, "chosen")); =20 @@ -1177,6 +1178,9 @@ static void spapr_dt_chosen(SpaprMachineState *spapr,= void *fdt, bool reset) if (machine->boot_config.has_menu && machine->boot_config.menu) { _FDT((fdt_setprop_cell(fdt, chosen, "qemu,boot-menu", true))); } + + ppc_graphic_dimensions(&graphic_width, &graphic_height, &graphic_d= epth); + _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-width", graphic_w= idth)); _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-height", graphic_= height)); _FDT(fdt_setprop_cell(fdt, chosen, "qemu,graphic-depth", graphic_d= epth)); diff --git a/system/globals-target.c b/system/globals-target.c index 17a27a06218..ffa6c308b59 100644 --- a/system/globals-target.c +++ b/system/globals-target.c @@ -9,12 +9,6 @@ #include "qemu/osdep.h" #include "system/system.h" =20 -#if defined(TARGET_SPARC) || defined(TARGET_M68K) int graphic_width; int graphic_height; int graphic_depth; -#else -int graphic_width =3D 800; -int graphic_height =3D 600; -int graphic_depth =3D 32; -#endif --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801668; cv=none; d=zohomail.com; s=zohoarc; b=mKhc5E+Y2S6+V3rrhRO4tTRjRNG8I1vu3TkUwjMAcwhhfRoc2pbJIcQwR8uQfFTLgc7X6OJEtuMvIel0ixEt58c0hyq6hGDNBPPzKA9a7P8XjioeKmiQCayUHpg49iyn2BdPxP5+mVQYdcVhmqQrwH+ggKMABbRZD+DM1YPEqSQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801668; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=2DyknkZUpUrAhmdi1X/z4oFKPuWggB5s5lzC0L15D9M=; b=QCBbJKJOhRWvQ2sHxF69KtgpRPvPAA7ViyAeIwsOi7chwTmmK6yvWGpMN4Ft6GW9fMl4rTW4koaUI13EPkuRlfXzf9C9QYLk0ODIMV9Jc2AAI16QIDUxPOTuc5CIH0hca6opZ5PTR/ZTgtw0i8kr1T8b+jDkolExfVS7jNR4OWM= 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 1771801668346345.22538394421383; Sun, 22 Feb 2026 15:07:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIY4-0002it-Uc; Sun, 22 Feb 2026 18:07:36 -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 1vuIXo-0002JU-N4 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:24 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIXn-0005yy-7b for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:20 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4806bf39419so34623295e9.1 for ; Sun, 22 Feb 2026 15:07: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-483a42f3968sm85801695e9.19.2026.02.22.15.07.16 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801637; x=1772406437; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2DyknkZUpUrAhmdi1X/z4oFKPuWggB5s5lzC0L15D9M=; b=tjbUtH5RUqPhwgs56YQzbPd4nnXWcZCoMu6xroMd+Lc8y9whAA68vxdE5Q8+znXKXx oDhH7CWER4BREg4axJVDpcDdQF0QwvFCV2Q9r5DoPMb/824AvIsGshJY94Z64owOxGia MJESP/pi1++lzjyYC0PJW8hz2ro2il+PCZ4bMVFqOdPqq/e3oWwBJNZxp5ggA3Cu/rHn OTN4/D3sOqdEoq27dBLCWN4c5xaLxlbDqnLr6xb63l+vVwinpF82McSJO5xoud98YuQC okXVEQfcIvbB1g/bUgJkYLX00aPs91pvuJmn1XpBaq7zqVBYHGvWmqdlqppg+VlSfufN tD9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801637; x=1772406437; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2DyknkZUpUrAhmdi1X/z4oFKPuWggB5s5lzC0L15D9M=; b=dlzpagqyGdISWfxx/xnhcCJEAHidK8zflyiy4tbLYFfjvIfF/kmrCT6pBeX1GPa6G4 SbbURlJTW91pq4KrWaZ3BkSA+bWu+8LQCudKAuum+ezD7lQZwZGpsm+uiAmQ00aq8QDg 4wBLOVwO2Yy0Swt9y/e627tuU8PriA/6b8pbuxN/kIt+Ctsbu/eKfnthM29onFAAkBAd irY/SPo9uodZOAnlLDLb4hr8I1yVW+4+I5gy3KT8OHVNeEW+g6LOQ9W+LWv2tcJOwLhp esOe7PHjVTQw4FAidQOpBIkMredoUh8eHhsaDuMlC5j1RzugMyzwYYyILS/rkEKNEdDV oY2A== X-Gm-Message-State: AOJu0YyDQusxIfOMBRgP9t8YBcYq3bh/tHTv5I70NNxXJgUsjqmFE48n Whq4AMR6r3XW079H+Txuc6gqOqmHblNfwnxpwGJ7ETWhIAZzkxrWlqZCyTw7Y0dzbbELeT7JH/2 Otpn0Q+g= X-Gm-Gg: AZuq6aKja01CRoBQ1xsff2sZklzBcs3pNnTfPZcHCgXm4SJ4FQshWE4lXmjVMqkp4nt if67V1YtO0stMKnWj4RjnDI5MxjKSOBqo0bv4aCFgTd4oyA9RI39s7i+Y1hMYfbRBh8CztRrO1o QrIcET7hiR2+zL48pK++6eF1aPeJ2dExVXiYW2YL1kDPbx/pNW2sAWLXmFpdp6bZk8qy2z7UYqu nYQdW23ER3amIoE1ksxm+OIXhkVmU1oWUIl6qorMuQ9Deag1hwfjRk1vZrN+f8MuS4UsvBoenwu npxfn4ZBfeMZ++SHb2LKRojInnpSMhDxjj35VA/aMIrtjqHJO1/n1yLQYXI6ge/A56T6tLcpGIG YdxEwrPHuK1vXVsi4xKw5BV8I19CCzujudmuXgrCF4CXX0FsItoc46HG3tiBSIductmYgqkmXZp n6u44kbXjvEYMD3Yee1+9f0Uc2sDH/DZSytzpsSs2dxWtI8CrOP0wMHleyPtRy6R+l4/0HkS98X oS+A9RotIM= X-Received: by 2002:a05:600c:8b5b:b0:483:a352:b4e4 with SMTP id 5b1f17b1804b1-483a949e600mr122205295e9.6.1771801637458; Sun, 22 Feb 2026 15:07:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 11/20] system/globals: Build as common code Date: Mon, 23 Feb 2026 00:05:52 +0100 Message-ID: <20260222230602.5756-12-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.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: qemu development 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: 1771801670677158500 Now than all targets have the graphic dimension variables initialized the same way, we can move them to the common file unit, having them built once. Remove the now empty globals-target.c file. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Pierrick Bouvier Reviewed-by: Richard Henderson Message-Id: <20260216213121.47122-9-philmd@linaro.org> --- system/globals-target.c | 14 -------------- system/globals.c | 3 +++ system/meson.build | 1 - 3 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 system/globals-target.c diff --git a/system/globals-target.c b/system/globals-target.c deleted file mode 100644 index ffa6c308b59..00000000000 --- a/system/globals-target.c +++ /dev/null @@ -1,14 +0,0 @@ -/* - * Global variables that should not exist (target specific) - * - * Copyright (c) 2003-2008 Fabrice Bellard - * - * SPDX-License-Identifier: MIT - */ - -#include "qemu/osdep.h" -#include "system/system.h" - -int graphic_width; -int graphic_height; -int graphic_depth; diff --git a/system/globals.c b/system/globals.c index c33f6ed3902..34fd3ce9c72 100644 --- a/system/globals.c +++ b/system/globals.c @@ -49,6 +49,9 @@ bool enable_cpu_pm; int autostart =3D 1; int vga_interface_type =3D VGA_NONE; bool vga_interface_created; +int graphic_width; +int graphic_height; +int graphic_depth; Chardev *parallel_hds[MAX_PARALLEL_PORTS]; QEMUOptionRom option_rom[MAX_OPTION_ROMS]; int nb_option_roms; diff --git a/system/meson.build b/system/meson.build index 4b69ef0f5fb..035f0ae7de4 100644 --- a/system/meson.build +++ b/system/meson.build @@ -1,6 +1,5 @@ specific_ss.add(when: 'CONFIG_SYSTEM_ONLY', if_true: [files( 'arch_init.c', - 'globals-target.c', )]) =20 system_ss.add(files( --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801682; cv=none; d=zohomail.com; s=zohoarc; b=g4eRiyWHwhj8Tl5+8UlEpXxYBIpwPZfXGJcqCO1uSUWqGlZo5pVuJMOcQ46tuwOFa5VeTTQN9VJSz9SEiI+WWm3ZkKLJ792RlN8UGRDhLfz+T1nUeuw4TK+7OHKXmI+qNdJGzIxLkbDuln4q/yvgEPzgGDHJecbeb6jh1M0Tadw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801682; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=Qd0G+nfyztxAJMOwNcY/97xGBoHYfcp5GPMnR6QZ8mk=; b=Nlus4duILAyHVC3E4ODD+yNc20z/jc1OeQTEt6MpoFEmbZr+MqlgZphKyfBHho3XyY0wrpsLsTXJjt5xl0F2xcOYN5Pr0P3rJ1HwACR+4bxgn+cusDPtYb1eiVc1dt2ydzLZcA2GF5FQuCidJikhky7uPDrWNdYsGd8SX0svXUI= 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 1771801682842549.8888907148798; Sun, 22 Feb 2026 15:08:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIY4-0002eE-Kk; Sun, 22 Feb 2026 18:07:36 -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 1vuIXv-0002Mr-55 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:28 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIXt-0005zb-ME for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:26 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4836d4c26d3so33379885e9.2 for ; Sun, 22 Feb 2026 15:07:25 -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-483a42ea363sm74687245e9.18.2026.02.22.15.07.23 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801644; x=1772406444; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Qd0G+nfyztxAJMOwNcY/97xGBoHYfcp5GPMnR6QZ8mk=; b=DCFZ8x+/7Qs76cfHF4vkaDY1K8f2KnAQwd9nu9AfWulJ6RE6ua8FMxh5r6DISejpRK YikBUUYLsEhfb4h3koktrCKJzvkQZFrHajS2m55JcKtnjNQrH1gnDDIYqqdgHx85VozA oHfH1VgUj0lr4pVY0FayIIzzsrLjP9eH7Rdh/IUKBGShVU18DfzRaaG9J/3anjrJmbOW u0N4WNvQQ1E2GhyQai081URpPeUR8d8EcFBkkqx126nRGZTIblV3yBXwzg8WWzMmv+Z3 4ga9q8mwIBmby4RkYxBjrj4bPG60t/iI3GkEVQOGOKMlq8N1yOVoiQjafsUk3TXcZCQa 5mVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801644; x=1772406444; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=Qd0G+nfyztxAJMOwNcY/97xGBoHYfcp5GPMnR6QZ8mk=; b=a7jD5f0rEWPZ4cmY45sC44nNfHMnsEkPnfxlmOyXm5oCK+d/afDtoFJY1cLPAKv6u9 GVVL2EtEyQynKIwL6kCi5yLEVdBY8d5j3+CQrHELyLVRd57ZvHoF1ZVEcPMFYOigI7sx a/7GL4gpADyqXaoanoKKGRy8dPJ5ajFM7eW8ZXYId9fji6MsPx948BbUi7e+6N+bIrO5 TzOZF+T1cToFeoHJNVogXjZ0+uL00mKjUSA3vORzs5hHNLd+72jTTuWxsSyGoCcgOB2q a0ejdRwwjRbcNGL/WelyVyBFoY/a6mMMIC2BOZ1MXFVEdT9M9LfQTUg4OBt/strdLciB fdAg== X-Gm-Message-State: AOJu0Yyra0AvbAhTwCpw8rdH1pywX6akjY5CksgEtanShrsLAPozW+EO WZh3EALUe0BQiScyr0YzX99iEMOE8v8puFDjuBJcT4iSe//7inwTQvqB/vvLNChTPRrdBPNNCFj KJ2/j1go= X-Gm-Gg: AZuq6aImlMwZohD/nqgFFkVf5yQxnDVplcg9ixc8lUhPwFMm5JiJORP8AS73CEtOHDt 0+gA+bi6cxCNviDzGDI6wPy8gptMz1i12+LYCKNaN2vojLsLmmbXXz/YLctvah+jpyHxIP1BX/W K2UtRC8esJFF/ETglP5iXfhzJyIZcvoKCVNSU75lEO+rwuz7d/drckHIA71T1balaqWm01M7hhO e8Z/VgoMvd4y/47FQqbFYbv2GME/JYed/Dzcuf+9kJzpeDr6jYjoBndSs/K23DJPFw1ZktiHDuJ fVaTTvx1bggR0/GTEaRj+5cCv3Ahu+1Ny3jQsJ8yLEFfGmkNW8DXTvLkC+GYC0aEzgQFH1vi2KW KTaTZFT+PWZJh8bWIhnV2f3acV2/OFyo21uonEtujrf+ud1tAXHHqJDnEa4JrLcIgW75a7Jan5/ ONzp89xD/LiAS1NDl4ks9qLaKjCap8VYHQud7/lpTFB2CWQ3XfitZTAwTSyJYWnUfJWZzy6gxuv rFcsgcV9kQ= X-Received: by 2002:a05:600c:c1c8:20b0:483:47ae:7c00 with SMTP id 5b1f17b1804b1-483b1c6a605mr29498915e9.20.1771801644001; Sun, 22 Feb 2026 15:07:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 12/20] hw/ppc/spapr: extract SPAPR_MAX_RAM_SLOTS in a new header Date: Mon, 23 Feb 2026 00:05:53 +0100 Message-ID: <20260222230602.5756-13-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development 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: 1771801684661158500 From: Pierrick Bouvier Allow to include it from common code (vhost-user, in next commit), else it pulls ppc/cpu.h which has target specifics. Signed-off-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Message-Id: <20260131020100.1115203-4-pierrick.bouvier@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/ppc/spapr.h | 8 +------- include/hw/ppc/spapr_common.h | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 include/hw/ppc/spapr_common.h diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 5476ac7ce7b..b022f8dd25d 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -4,6 +4,7 @@ #include "qemu/units.h" #include "system/dma.h" #include "hw/core/boards.h" +#include "hw/ppc/spapr_common.h" #include "hw/ppc/spapr_drc.h" #include "hw/mem/pc-dimm.h" #include "hw/ppc/spapr_ovec.h" @@ -946,13 +947,6 @@ int spapr_rtc_import_offset(SpaprRtcState *rtc, int64_= t legacy_offset); =20 #define SPAPR_MEMORY_BLOCK_SIZE ((hwaddr)1 << 28) /* 256MB */ =20 -/* - * This defines the maximum number of DIMM slots we can have for sPAPR - * guest. This is not defined by sPAPR but we are defining it to 32 slots - * based on default number of slots provided by PowerPC kernel. - */ -#define SPAPR_MAX_RAM_SLOTS 32 - /* 1GB alignment for hotplug memory region */ #define SPAPR_DEVICE_MEM_ALIGN (1 * GiB) =20 diff --git a/include/hw/ppc/spapr_common.h b/include/hw/ppc/spapr_common.h new file mode 100644 index 00000000000..a315b685805 --- /dev/null +++ b/include/hw/ppc/spapr_common.h @@ -0,0 +1,17 @@ +/* + * Common definitions for PPC sPAPR + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef HW_SPAPR_COMMON_H +#define HW_SPAPR_COMMON_H + +/* + * The maximum number of DIMM slots we can have for sPAPR guest. + * This is not defined by sPAPR but we are defining it to 32 slots + * based on default number of slots provided by PowerPC kernel. + */ +#define SPAPR_MAX_RAM_SLOTS 32 + +#endif /* HW_SPAPR_COMMON_H */ --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801682; cv=none; d=zohomail.com; s=zohoarc; b=U9R3aoWZWAVyCS0BPJbbVHzgy+NyY4co6YN+8InwTEl9cK0eBAFGN6Cb8s9Bl10aZZH+hdJP447NIlWctmjMW15sdFUf37gbVBWk5TDMAMMb9JHUnsSH5kfQ02vXAOwkICYJhfOGhL68d9ucXgBjeEoVig1wUjUcNLxFFSNaWGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801682; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=G+Shgl9Yri5QWTxJtLwdRaSrm/tFNfZ+WrU+G3AQqME=; b=LGjWLJQSycvzZQc/5h+9mNj0pNxtL2Ru1dKx3eL54ha8k1o2cXSdga5kKP7TLkKo8Gi3QGI0fauQMMe7C8QVdeNrN6AftNX0iG7AqzuoPdnMRpoJ1Invea/1qB0sfDxfv3rAWRh1ZJhJRZV9G4FNQw49uewKi8pO5ku3HJRBxq8= 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 17718016827312.6042402042542108; Sun, 22 Feb 2026 15:08:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIY5-0002t0-Qv; Sun, 22 Feb 2026 18:07:37 -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 1vuIY2-0002Zp-PD for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:36 -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 1vuIY1-00060K-7v for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:34 -0500 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-4358fb60802so2737306f8f.1 for ; Sun, 22 Feb 2026 15:07:32 -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-43970d3ff27sm16316578f8f.22.2026.02.22.15.07.29 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801650; x=1772406450; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=G+Shgl9Yri5QWTxJtLwdRaSrm/tFNfZ+WrU+G3AQqME=; b=HlbSDKyyN4+AXz8xtPRMuJJL0v3+m5+s6XXdPZqyZGarcC97s1RWQ7OTCql69LJ42x YcQfq7dUuZVmCxtAMk2D4pRUA/zkz0h98L6fBs0fnKKXxeb9xbQuxTdolaAYGlLYKcu8 FmwULieb5F/sNLSutJaTXKDXW38i23CuQVrdGAX4B12XJmZio8aW3njuNb8p/Fz0h/iq UYUveLpdHNUMM2/UhF1xBwrD/dq6PWxWMcMnRhdU1SjOVq73BciRSHhK7yQ/rJkH73oi 7Dpmd3/VUCrjPIu7g+TAxtY6+2P9A5eq+9sB781NBCiyWDv0gXlV5RXVJOpojw2v7g1f RIWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801650; x=1772406450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=G+Shgl9Yri5QWTxJtLwdRaSrm/tFNfZ+WrU+G3AQqME=; b=p+LJFXAVZbKBh7x9Gx907itWzvBONR1JgSd1QmkrMM72XbZzb77Lx3HZ6QUP9CJWMx 45lJAhYwmfIW3Km4Ps5RYYFvhYRo6jP5m23RsM4QgksBVDk1EEZyNi5lY2B7REqJksQQ 9cVv4SFlwd0qD40VZjeTahtHS2qq1Z+PiW0S94tKM5EEGB15OQTShGER+67+ddkOwkkL GD/7nq6pEHgrP24rENYOpfQDaFfSnYzWCvjlqN7J8mtunmD7I8XvzhhPMwgGSgn2O7ZI KPMNbMO8jN0KaAYILZCbGXK0MZ/Pj/bJj4XA4YPUTU/XAMVcX3H3QS11gHlR7pkO9TVX cbzg== X-Gm-Message-State: AOJu0YxWxIFs0VjL5XJR84sY5LQDkIfP7BJczOep0UOj+2LteWYR3R/1 s6NAXLCn0gbyIYw5Ei15+ucWHH0GC2Wf4HlB0/JSDrIsSaMeBTr0VFDDyPGdUReigHvY6mLY42f /wZz8BS4= X-Gm-Gg: AZuq6aJ8+rgst4pzisOXaRyeqTpJpZJxZSqCm+ky/sMVOkla/2B4vS/VvarV8UpeURh NdD7tG8ZDCBZU2PMIDtHNnYmc6eRBQ5HTUk7Od1209llgjSkmGeI1zTQ2Z7ofFNgZWgZ7qbMm9Z SkX45P+ylHJI0dIQmxmbqxQYemsu77k6jxXp9KHbQ5B6+1bMTZrMA+GV8jEULkswi0IoA7zvhzD 3qLK/WsjSXhr5Fcqz4kSxqCy+HolsI0wDQ2WBj1LDhPHhY0qGWddNJpO5T2UeOVw++2YCFiEfgz TWzhmcOFrTJQgb3XlovD6eGTQqrAJVRy9RdlaJcqvtG+r/VKbXCKTchEvHfMNVCra8v2s4zi9co n7SyGNkCuQB7ehaJdyAkRjZt2vMM0364QzK7WOaMX02eHGy9ks556KS9C2x+8eftXXdCmhBvYRj sCjzzBneuf1fPZI/M0MfIMRNeNrvJoMryFZ0d//uCorfipD790vfmzxLyMv+zeWHC2Z+ttVEZ+ X-Received: by 2002:a5d:4e10:0:b0:435:96a1:ee4d with SMTP id ffacd0b85a97d-4396ffc46a8mr9588352f8f.14.1771801650428; Sun, 22 Feb 2026 15:07:30 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 13/20] hw/alpha: remove unused includes Date: Mon, 23 Feb 2026 00:05:54 +0100 Message-ID: <20260222230602.5756-14-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801684635158500 From: Alex Benn=C3=A9e Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Pierrick Bouvier Message-ID: <20260219171810.602667-12-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/alpha/dp264.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c index 5e64528431e..98219f04569 100644 --- a/hw/alpha/dp264.c +++ b/hw/alpha/dp264.c @@ -16,8 +16,6 @@ #include "hw/rtc/mc146818rtc.h" #include "hw/ide/pci.h" #include "hw/isa/superio.h" -#include "net/net.h" -#include "qemu/cutils.h" #include "qemu/datadir.h" =20 static uint64_t cpu_alpha_superpage_to_phys(void *opaque, uint64_t addr) --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801665; cv=none; d=zohomail.com; s=zohoarc; b=S60qD7UtCTnqmBsDTEVipL8Xc8ZTgYtmh0q1XW+FqPUtJk0QPGVchbVAYPwDlZSGuN21qs6KE2U8ab3Ny/uhYFP4Wi9GLNdJmSBkgiCinq6wQNbR1zDSLaBnAB2bkioRwmbBWaR4vM4TR//rQU7/NUCmbIFpvoh+W2bTfC+IMnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801665; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=SF9Qi5I1V/HMuPsNxz+60IaEmiSzuOlFJb6yrhzRy94=; b=e28APoWNs/LHKZeCtUp74Z2a+XsLz8RquTxG+2/f8opndm7zOHsTSRGAXPqnN9LAEerjJWK6Fv8IctTEgnTiCCx2Idqs3v5E/hafRqnfr1Irj15jW+MU3+lzkvJ8daFXn0oSvJGhQNkpal/ivr8jQv/sEozVpQQn7saeYNzAr8s= 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 1771801665357993.2333784623108; Sun, 22 Feb 2026 15:07:45 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYB-0003gA-Cz; Sun, 22 Feb 2026 18:07:43 -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 1vuIY9-0003OL-4H for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:41 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIY7-00060v-I6 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:40 -0500 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-483703e4b08so29519915e9.1 for ; Sun, 22 Feb 2026 15:07:39 -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-483a31b3d88sm244184425e9.3.2026.02.22.15.07.36 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801657; x=1772406457; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=SF9Qi5I1V/HMuPsNxz+60IaEmiSzuOlFJb6yrhzRy94=; b=iCHOUwYCVwUlBOp0NcN3Z7IFxO7M/OjY9kU6H7PXUQutpZpyuTv27Vc+4YeunoUYpH oEXhJLBIkduQL+ob4GlW9CWwYXYPpj7apjVQEDwT/wIFDKi6f7/IhmW+6dkoS+O0PEeR tDNdS4VvOyLG/6L6SPEDTmslyyWgswsR1T1Q44sKdm9soKHLr0/UJWM5hdcv6ve6ORKt gwC3IJVQeUPQDrgCRxy8+cp8gmHl4lHYFr56sGbgTtrUYR2zrcyjuV0ZR5yb1/5ghT70 oWUEd2BIQi5G3sxcFXKBres+mln5j4clH3II+ObgYSRDXYbeUvrHsZ0K5vWfzEOHP3L1 X82A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801657; x=1772406457; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=SF9Qi5I1V/HMuPsNxz+60IaEmiSzuOlFJb6yrhzRy94=; b=OUBMl9H4qiUb17h9/ADdZ0vWVlSHGaSRB94IAWJCFys7S8vfcBCKsWMv6dOBN+omCq VlGFzpAr77G69SH24Q9bYKz6kc7E8jlLO3pHX4zOUv3d7PtUbG4i7kZ654poN15fo0CJ n3q06GAt7JWQYXhQlWLLoEfAQbgEvCZUgOrdH7aJnkYDEDnq0i4ajPQ6BHlm4CGH+12A bghQX+qwhfmhm9SJnSR5QTi7dRaLE8YkL1XF3evWNiqBaF0Q9Ro27wP+4Whc1HLjQ0Rn K7udv69A63dJPE1JC6QVo2ngaY2OHmMHa5Ko0NRQJcbcmSdgC8EOalBUfscZ9wNW7iBh p2YQ== X-Gm-Message-State: AOJu0YycpgIB2mH6No1pP2uRbF4bHClJPaXC8JkHfbl+D2kU/oiOvKiI pp+Zp17tC4k6+b+bhRycV+0Isv/tazkGFM6/1X31zYcLCkp0S6RbzGjjsOB8G63MbduVgSy1qM5 Vy/j8IVA= X-Gm-Gg: AZuq6aLz5ClKVKZFxLyyXnBVncE80VEkJtnex4OyuahN3XNQDUWxK6nGq8xgw70zjnf zq5/dYY26ihHXcQy3g0fpAY8MHj97/8O1/nhBB0N9P9ngltUCmRuITxJItXnzrpc6BO3JPSytxC Zno/OFdg7tvqusadoMRyNpejtcI6Xy3aLFdItVBHHSv+TW8I7jW9hk2h5KSGjLMOwd7uXBIFd2V CcPIcN8PWVD1GnuFBPpf6Oq/avBuOREILqBcM6gr86DLCQtYwKSrVokvLK/4Fmb6oZOpu3deb0/ ATrej4q3nBL9kcRiLGMnar/M0uZKp/QIOWYqINowhqzlChgqPHpQAP1i2nsfTUhnMTpiebFojc0 BZvEItz5XgVj6kYmazxwOlb5MInVoSUoycdBauKuoar9ER2NXcBHbuRBvpeac3HXOcnZtrx23CM K/u+Wao6LnLwlNF0yEiN7eBt9N1uLC5XH/2T5lt/lsbxR0fNltP4X6cRU6oG0smx2kwAJB70PY9 YYh5rex5Ng= X-Received: by 2002:a05:600d:8445:20b0:47e:e0b3:2437 with SMTP id 5b1f17b1804b1-4839fe96a24mr152986295e9.5.1771801657555; Sun, 22 Feb 2026 15:07:37 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 14/20] hw/core/cpu: expand cpu_reset function docs Date: Mon, 23 Feb 2026 00:05:55 +0100 Message-ID: <20260222230602.5756-15-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::32a; envelope-from=philmd@linaro.org; helo=mail-wm1-x32a.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: qemu development 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: 1771801666591154100 From: Alex Benn=C3=A9e Add a hint to the developer that this should only be called from a reset chain. Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Pierrick Bouvier Message-ID: <20260219171810.602667-15-alex.bennee@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/core/cpu.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index ef20cb356a6..89934b8efe2 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -815,6 +815,9 @@ void cpu_list_remove(CPUState *cpu); /** * cpu_reset: * @cpu: The CPU whose state is to be reset. + * + * You should refrain from calling this during CPU realization and + * make sure this is called from the reset logic instead. */ void cpu_reset(CPUState *cpu); =20 --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801681; cv=none; d=zohomail.com; s=zohoarc; b=Q64dG7Zwo2iUH5w9qYMMZhQjQPcgLlBHF+KAr8/0AviRcyLopMoOXKybVCP0MHKHEgujMsSDMZyOsXoinrS9I5vFFqtDT5aPYH9/8QOZjx7jUfpFKzcPM1Zzw/+QNGclbDz466ncDByiYN3n5ABhlVcOTNbbm7ufW/NR5+19niQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801681; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=F9o91NXnN55Qgm8cd9PGuHzTDVifQlajjk4xjvK6WQo=; b=KPg4uOAapJYHUo8zIxArKmG4cUaaJj9PrVpaNAidfk8zODuzfJ8IkOy8nw2e9OIq6qnhqUDgB6yUq+3KV1hbrSGqRNNM3VR5dajRRBLQelEgFVy/1iNBFs+nfpmBrnQeQopnwtodcYdtLYbIleJafFXt/72EB5YENI/kKhl5NQ8= 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 1771801681318624.0298158774652; Sun, 22 Feb 2026 15:08:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYM-0004ts-OL; Sun, 22 Feb 2026 18:07:56 -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 1vuIYG-0004Yg-Sg for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:48 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIYE-00061E-S4 for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:48 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-48329eb96a7so20555485e9.3 for ; Sun, 22 Feb 2026 15:07:46 -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-483a3df4859sm130017965e9.2.2026.02.22.15.07.43 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801665; x=1772406465; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=F9o91NXnN55Qgm8cd9PGuHzTDVifQlajjk4xjvK6WQo=; b=IgNgE9JzdldJ4fY11e8r0qsEMb8aqqpitz9tYqnMMG0SDKxVyMZb3wluvQSV659Ams PCJFYkf7Es6D6wWrn0KgHFc5clZFfp6R8mRCIb3BfIag8d8en2EvNezw1a/aZ81fx+Dg tmVD7tJ6n3nf+FWBT9sZMp2/RyOT7lfH8DgyHJpsRqcWArSYci0Vuun1AlRoWJSCxE4d 91uwUB0pe+o03G7oHbZTjtDG0Z0ufO4/8DDi5fO7MrRT6EAM8z85ebjIadeuNpqJpaPo n+MeWGIGDmTgPknfyMw5cneDBdDUD5YRWynUZ39gT50gYUFKANWfKjMn2ZbCqUtROrGo DeYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801665; x=1772406465; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=F9o91NXnN55Qgm8cd9PGuHzTDVifQlajjk4xjvK6WQo=; b=N0r0SxBOxhjSpX2v/UrMzNxmGDyF8+jrVo6YT+NrQomqNmd3/YAFDCUSCsGNyIjrAJ SNWA8/prWdNzx4/rWFyStHUab8dnTcoJcd7dMjy/Wo+n1pV/kFg8Z7+KA6wwD23dThz/ +Z0NCxrDcVaceCBGy4+aS5/ZBlfUThRyk2SACW2+vxM70XVRUYp60BCzhPcoB5Rm4/ji vlAepb9+QjkXkgypH3TnkCFOX361sQpLmqmTlzmI55ntVok2Ocx57SXM66esVOPgcN3C B+bz4qQL0qMep/Bz/UgKXVIj0tcyxLY1uibbiY9DVQvHl6iJYMBS/vOolPPyQjXTGOsO Ymug== X-Gm-Message-State: AOJu0Yw7KtDfGuLBCmYF3Oo+zbCqUuQQEYpSWsOo9hslb/oxocG2xnWL IkS8keefMHI5eGusXLIIa1HEBzwUl+k0eKp8jSDeg9hf/HtX6X6tJDeUltB0ANEwmr0dog1ALnq f9sDcFPU= X-Gm-Gg: AZuq6aIj/tCkU+d9e5EQzJx9CbIx8vN5cSugfRbjDj/0JCPNu+82/UQkdFf2lhYah+z xjQfKXhM8Whh2/MZh+i1rw9/6njLOfaXGtx8bUadePBsJLSnzeSQ4+Zbix7W+CCVgiVrrPrmZY3 XQszLov2gSjWde8meHPOCenXef/m5kxnPlw6NBS9UxJBPigFnEn4l99e478YOrksutawfzUpIW6 iK+DiyDWpZJYkVX31gE8A4ATXtVEPw943VfRn6igi+V530xETDUgDsOvShM9n3qj3lJJFyXslnm DcCevo+UQjs+9J13xw8mKOf7nKtkg1oxs4naos29LGX9WrfivS86RAZ4s3/0irPKdBaHaruAJZi rlauJyIFu/e0WBAfh9e8TjYBvTPgJf7e6Ujw4nijm3gqkEkR0MQBZCCvVdLjHd12M6iSjJuXrQX f0aKKG4ZDhIZyYS3A3JSqMcgVhRVBKEGKCGpGNCL6eVh9p5Xw6Rju71mCoIUqyjQC+g7F7pxEp X-Received: by 2002:a05:600c:8b82:b0:483:8062:b2f with SMTP id 5b1f17b1804b1-483a95b3e0dmr107278135e9.6.1771801664690; Sun, 22 Feb 2026 15:07:44 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 15/20] hw/net/rtl8139: Remove ineffective parameter Date: Mon, 23 Feb 2026 00:05:56 +0100 Message-ID: <20260222230602.5756-16-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development 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: 1771801682667158500 From: BALATON Zoltan The do_interrupt parameter for rtl8139_do_receive was originally added in commit 6cadb320c7 to avoid generating interrupt when receiving in loopback mode. Later commit 5311fb805a changed this so that this parameter became ineffective and now this parameter is unused and always 1. If this turns out to be a problem maybe there's a better way to fix this so remove the do_interrupt parameter for now to simplify code. Signed-off-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20260127173849.588F25969F0@zero.eik.bme.hu> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/rtl8139.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 9fd00574d29..2ad6338ebee 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -815,7 +815,8 @@ static bool rtl8139_can_receive(NetClientState *nc) return avail =3D=3D 0 || avail >=3D 1514 || (s->IntrMask & RxOverflow); } =20 -static ssize_t rtl8139_do_receive(NetClientState *nc, const uint8_t *buf, = size_t size_, int do_interrupt) +static ssize_t rtl8139_receive(NetClientState *nc, + const uint8_t *buf, size_t size_) { RTL8139State *s =3D qemu_get_nic_opaque(nc); PCIDevice *d =3D PCI_DEVICE(s); @@ -1173,20 +1174,11 @@ static ssize_t rtl8139_do_receive(NetClientState *n= c, const uint8_t *buf, size_t } =20 s->IntrStatus |=3D RxOK; - - if (do_interrupt) - { - rtl8139_update_irq(s); - } + rtl8139_update_irq(s); =20 return size_; } =20 -static ssize_t rtl8139_receive(NetClientState *nc, const uint8_t *buf, siz= e_t size) -{ - return rtl8139_do_receive(nc, buf, size, 1); -} - static void rtl8139_reset_rxring(RTL8139State *s, uint32_t bufferSize) { s->RxBufferSize =3D bufferSize; @@ -1745,7 +1737,7 @@ static uint32_t rtl8139_RxConfig_read(RTL8139State *s) } =20 static void rtl8139_transfer_frame(RTL8139State *s, uint8_t *buf, int size, - int do_interrupt, const uint8_t *dot1q_buf) + const uint8_t *dot1q_buf) { struct iovec *iov =3D NULL; struct iovec vlan_iov[3]; @@ -1828,7 +1820,7 @@ static int rtl8139_transmit_one(RTL8139State *s, int = descriptor) s->TxStatus[descriptor] |=3D TxHostOwns; s->TxStatus[descriptor] |=3D TxStatOK; =20 - rtl8139_transfer_frame(s, txbuffer, txsize, 0, NULL); + rtl8139_transfer_frame(s, txbuffer, txsize, NULL); =20 DPRINTF("+++ transmitted %d bytes from descriptor %d\n", txsize, descriptor); @@ -2246,7 +2238,7 @@ static int rtl8139_cplus_transmit_one(RTL8139State *s) DPRINTF("+++ C+ mode TSO transferring packet size " "%d\n", tso_send_size); rtl8139_transfer_frame(s, saved_buffer, tso_send_size, - 0, (uint8_t *) dot1q_buffer); + (uint8_t *)dot1q_buffer); =20 /* add transferred count to TCP sequence number */ stl_be_p(&p_tcp_hdr->th_seq, @@ -2323,8 +2315,8 @@ skip_offload: =20 DPRINTF("+++ C+ mode transmitting %d bytes packet\n", saved_size); =20 - rtl8139_transfer_frame(s, saved_buffer, saved_size, 1, - (uint8_t *) dot1q_buffer); + rtl8139_transfer_frame(s, saved_buffer, saved_size, + (uint8_t *)dot1q_buffer); =20 /* restore card space if there was no recursion and reset offset */ if (!s->cplus_txbuffer) --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801693; cv=none; d=zohomail.com; s=zohoarc; b=bnKhw9PT3gIkw9B1cMeZ8Hz6DoBlVFfz9ixBSGdWDng56Bng+CEDCjlFhxSOhJuA/mZLe9OPUIrr3b8mnmZ42l6UovZ9Er9FH7wrAtqdRA4ZMC4iNq65bjrMn3N+KllX4F12KCKS/07NUZvnIRDrMmw1eafYpsmyW+v/2p6cOq4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801693; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=9lUxA4IrfT/TzvGe4MH2Ht92XFPB0EPjYVLyaO2F/Ek=; b=fOs7gY73ybVRGN7vWPOkkDj7MyAFqbJwMM14rYXS/LwTKxu9vpY+gWIUl6+vt7AIADaIBJDHPgQ8pSRh4sxLar2aUF0kOaVd1QZqYTeQ7wl2EtdZ/iNEaDEQNhpYuCBPXEqdYC/VP2kL/rqI4pgB4L8gHNfYisU3pisaRupkzDY= 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 1771801693887590.7760242746004; Sun, 22 Feb 2026 15:08:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYZ-0005LQ-Uh; Sun, 22 Feb 2026 18:08:08 -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 1vuIYO-00050F-KG for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07: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 1vuIYM-00063P-8Q for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:07:55 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4837584120eso26424305e9.1 for ; Sun, 22 Feb 2026 15:07:53 -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-483a31ff4d7sm234773865e9.15.2026.02.22.15.07.50 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801672; x=1772406472; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=9lUxA4IrfT/TzvGe4MH2Ht92XFPB0EPjYVLyaO2F/Ek=; b=kecAu1hgFcB6bzoqCsU+zxlBKo0r9A/IN7e5NXz9k4A8YR18EC6HySgSHoRkNdo5j+ P9XyTQsA0hbKhg3oJongSSyPFaf3qL5Rv8Wxx/k4cg+f8unA677HBZUDIoqyixNB24UH 57kLnP9fW4F+HRetdZPZza93gMDZ62KTgwB++IskzjGr8Vr2wVsmx0XhbAQu87EApljc ncyaLDyjcIt+f3V0//D+hVCxU+Cg/bhEasbDqi3AOSaT5aybZ3PONG/3H3ms8tOaICfD YGRtxUHLYtlDWmWjxY3uZo5EBaJ2YN6B/q88BqOCCaoRBIiexobS+ZMMWsM8EMQjq38l Kbaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801672; x=1772406472; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=9lUxA4IrfT/TzvGe4MH2Ht92XFPB0EPjYVLyaO2F/Ek=; b=bN6FXp65NkwL/HRWUDCXPXheKtH/wxGngBGeT+yXhma+3u+tLYzp5xc2Wv9JaZvJlh knIkwsr6I8PkkFyqgQH+yh8FKqUffv0NjhgPZ/8IAkxjijmNJDhporrZCIq9SWDwNSbt 6PBC2vDgZaBvyBgUPz7OJvIzALtdY29R/S2FRMKUtlst32CTOxuE4OCvNVOIjeYd9HIh oFlflUiRiFMEyFv/QYLXhgER3HnDi6Cm4TgyDo25STP3+HnxFkz3SiHRL6UAiq65o/0k rvNHv0UGzoJGrWe6A+MgoH6Kvteb/sHHtvNLjl85NzqhSibvfH7b3VG1blGNrysqIqlo Id4A== X-Gm-Message-State: AOJu0YyqWkUzDdG6ia2SvcbJk0Xnzn1mr0VHtI+S3Pnkqhyly4GJ3djn TLmNPvYdRhw9XDWN7JkvCGon4TAcxiF5O1ehcgv6ACAUaimEId6f6VZUW/Ema9L4qJzlj9tiCcV +mNTmOyc= X-Gm-Gg: AZuq6aIUsDpD0mMvCzIjKB6zS9JrZyON+Cj8LjDcK9qKhZDiRdngyWNsovK1TQ0x2ce 8zURslzyOsO45kEupPvcnmwXkUbQjuHc86cDdgONjxad97pV7pq46ktyPkO5aNjFftJpCivy+F2 nRYjZbIRZ2ArwjYm4Myu81pQt6xEfzHNzPrt14dk22qzT9z/RQ18Isap1ZtSt5y5qwGD62N8te2 rA0WqVFbb1Ju0lmsmZLBczWiE58T+gZUoNjs5oFSDunqR+j0pvpCDCK2dloFey+VzC0/fUAZpnN nxpI4Sja0pVRcoVa99/I6/eyCSyAuhlLLfdT2E0JlAEfbiLgy/GsAYGKs6YpKP7dVXFOygbVZ/r vXiAV0LYLmZcKFToRdZ7mlInAliBQl5CRchbkeOgnwRnzTN16av5j5/RuajEG4aEgwK5FcM8YWv iGeg6HPuBLdtEZZsUd3Yt3dDtBQNZx6UqDvVbewTarZI6a7AGKUUR2AW2JU1sH+7jTr7VAjLBb X-Received: by 2002:a05:600c:8b2a:b0:47e:e78a:c834 with SMTP id 5b1f17b1804b1-483a96148a7mr99570085e9.34.1771801671842; Sun, 22 Feb 2026 15:07:51 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 16/20] hw/net/rocker: Don't keep pointer to h_proto as uint16_t* in OfDpaFlowPktFields Date: Mon, 23 Feb 2026 00:05:57 +0100 Message-ID: <20260222230602.5756-17-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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: qemu development 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: 1771801694729158500 From: Peter Maydell In rocker_of_dpa.c we assume that the h_proto field in an eth_header struct is aligned, and we copy its address into a uint16_t* in the OfDpaFlowPktFields struct which we then dereference later. This isn't a safe assumption; it will also result in compilation failures with gcc if we mark the eth_header struct as QEMU_PACKED because gcc will not let you take the address of an unaligned struct field. Make the h_proto field in OfDpaFlowPktFields a void*, and make all the places where we previously read through that pointer instead use a new accessor function which allows for the possible lack of alignment. (Compare commit 5814c084679 "hw/net/virtio-net.c: Don't assume IP length field is aligned" which fixed a similar problem elsewhere for an ip_header field.) Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260212140917.1443253-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/net/rocker/rocker_of_dpa.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/hw/net/rocker/rocker_of_dpa.c b/hw/net/rocker/rocker_of_dpa.c index 16b9bc7a4b8..814f19afc58 100644 --- a/hw/net/rocker/rocker_of_dpa.c +++ b/hw/net/rocker/rocker_of_dpa.c @@ -143,7 +143,7 @@ typedef struct of_dpa_flow { typedef struct of_dpa_flow_pkt_fields { uint32_t tunnel_id; struct eth_header *ethhdr; - uint16_t *h_proto; + void *h_proto; /* pointer to unaligned uint16_t data */ struct vlan_header *vlanhdr; struct ip_header *ipv4hdr; struct ip6_header *ipv6hdr; @@ -196,6 +196,11 @@ typedef struct of_dpa_group { }; } OfDpaGroup; =20 +static uint16_t of_dpa_flow_pkt_h_proto(const OfDpaFlowPktFields *fields) +{ + return lduw_he_p(fields->h_proto); +} + static int of_dpa_mask2prefix(uint32_t mask) { return 32 - ctz32(ntohl(mask)); @@ -395,7 +400,7 @@ static void of_dpa_flow_pkt_parse(OfDpaFlowContext *fc, fields->ethhdr =3D iov->iov_base; fields->h_proto =3D &fields->ethhdr->h_proto; =20 - if (ntohs(*fields->h_proto) =3D=3D ETH_P_VLAN) { + if (ntohs(of_dpa_flow_pkt_h_proto(fields) =3D=3D ETH_P_VLAN)) { sofar +=3D sizeof(struct vlan_header); if (iov->iov_len < sofar) { DPRINTF("flow_pkt_parse underrun on vlan_header\n"); @@ -405,7 +410,7 @@ static void of_dpa_flow_pkt_parse(OfDpaFlowContext *fc, fields->h_proto =3D &fields->vlanhdr->h_proto; } =20 - switch (ntohs(*fields->h_proto)) { + switch (ntohs(of_dpa_flow_pkt_h_proto(fields))) { case ETH_P_IP: sofar +=3D sizeof(struct ip_header); if (iov->iov_len < sofar) { @@ -547,7 +552,7 @@ static void of_dpa_term_mac_build_match(OfDpaFlowContex= t *fc, { match->value.tbl_id =3D ROCKER_OF_DPA_TABLE_ID_TERMINATION_MAC; match->value.in_pport =3D fc->in_pport; - match->value.eth.type =3D *fc->fields.h_proto; + match->value.eth.type =3D of_dpa_flow_pkt_h_proto(&fc->fields); match->value.eth.vlan_id =3D fc->fields.vlanhdr->h_tci; memcpy(match->value.eth.dst.a, fc->fields.ethhdr->h_dest, sizeof(match->value.eth.dst.a)); @@ -643,7 +648,7 @@ static void of_dpa_unicast_routing_build_match(OfDpaFlo= wContext *fc, OfDpaFlowMatch *match) { match->value.tbl_id =3D ROCKER_OF_DPA_TABLE_ID_UNICAST_ROUTING; - match->value.eth.type =3D *fc->fields.h_proto; + match->value.eth.type =3D of_dpa_flow_pkt_h_proto(&fc->fields); if (fc->fields.ipv4hdr) { match->value.ipv4.addr.dst =3D fc->fields.ipv4hdr->ip_dst; } @@ -672,7 +677,7 @@ of_dpa_multicast_routing_build_match(OfDpaFlowContext *= fc, OfDpaFlowMatch *match) { match->value.tbl_id =3D ROCKER_OF_DPA_TABLE_ID_MULTICAST_ROUTING; - match->value.eth.type =3D *fc->fields.h_proto; + match->value.eth.type =3D of_dpa_flow_pkt_h_proto(&fc->fields); match->value.eth.vlan_id =3D fc->fields.vlanhdr->h_tci; if (fc->fields.ipv4hdr) { match->value.ipv4.addr.src =3D fc->fields.ipv4hdr->ip_src; @@ -713,7 +718,7 @@ static void of_dpa_acl_build_match(OfDpaFlowContext *fc, sizeof(match->value.eth.src.a)); memcpy(match->value.eth.dst.a, fc->fields.ethhdr->h_dest, sizeof(match->value.eth.dst.a)); - match->value.eth.type =3D *fc->fields.h_proto; + match->value.eth.type =3D of_dpa_flow_pkt_h_proto(&fc->fields); match->value.eth.vlan_id =3D fc->fields.vlanhdr->h_tci; match->value.width =3D FLOW_KEY_WIDTH(eth.type); if (fc->fields.ipv4hdr) { --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801694; cv=none; d=zohomail.com; s=zohoarc; b=NKiMo4s4tjiLJNgrJ4Y6H7jC08Oz8DesodHN1L07AeYcE3fPePwHtA2Sg0V8802E9mCks9AVXs8RS13TsRZKgx3I6znhrLQ1OFA4sulYI21tI1dRgpcg3QlP9d4wRJZp88tmdQxF5diZIV2EPaCYByF4/yWgtB0WfMfrEktTauQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801694; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=aK+ULSuJrjq6iUTZBtmAVuymd25sCvXT9HOk0d4M3v0=; b=LCw/JkzolqTVYj30Yas2a/H28qBCu6+wTXaprzN+gsr9Fmv5WmshhH5RuBspgHdZbncPjKWd4OAEL6cUmUFNeR0xg8IWSYPy9A7cvXxB8BMwyLjrdAuNHsZImYw1CPFcW/UvPBZ/nu9dJXiBes8qyDEo+pQal1qryoWe27QWnIU= 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 1771801694385391.1119392797551; Sun, 22 Feb 2026 15:08:14 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYb-0005bg-ET; Sun, 22 Feb 2026 18:08:09 -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 1vuIYV-0005KZ-Ti for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:04 -0500 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIYS-00064C-CL for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:02 -0500 Received: by mail-wr1-x443.google.com with SMTP id ffacd0b85a97d-43767807da6so2714917f8f.2 for ; Sun, 22 Feb 2026 15:07: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 5b1f17b1804b1-483a9b75e63sm256026795e9.6.2026.02.22.15.07.57 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801678; x=1772406478; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=aK+ULSuJrjq6iUTZBtmAVuymd25sCvXT9HOk0d4M3v0=; b=NKjvDxRfGWDoiWNrsBxWIVJkezoRGcqxaWgLpsTFGQBYD0RDoInpa71dbHYLhitekF ouhUwtCoHU1CwdZN9Ovw3PHrrBkQLh5/WNkpATxme9UEI380eLwqe058ofUG2ZPLKC3T nwdUiTw3fEco9k5RIPO8d63Qbdd66CY9m9Y30QUJ1CogOHnwj2OtjoGbFUm3+dPO9P8/ obr+CBTZKnpPx+o7aGuSwYRAnb2+SAjCls3YJgt9Aa7hBIZLWwBlXYYKCM1zPEgZRHlH NDMiHk5tA91S4KazmLyJPzMQqtut8Y2SuzdBFs/HZcPaCUj9nK7EY7G4FX8sPMQle+vb 2c6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801678; x=1772406478; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=aK+ULSuJrjq6iUTZBtmAVuymd25sCvXT9HOk0d4M3v0=; b=Vtba7nBBtShVBcg5qaaHF3sXPPCCuS/gXamuNjLtep9NX5/ToFH7YyZrCnZAIznvTx XA6qrGUELs6oqj9GMxgb1mD1P9UdDbx+80uC1jZAleaNhkniTDUP6Gvj8ynhggee2K05 OdGAZulrsAy0Y3EMbpRpD1dPeKhw2PEvhd3f3ZJOAMAkvW1Rdf2UNsMnxaTh8vwcI5fh ngtUQ1mn49xGsWKuhyr4kUEUg53ZBASga1suNYL120dL79lHBJoQEg8AWbuNylsspEQN bys/wl3JZQ1dnlSxs7JeQbpn6m0YcNBd3JR2GK/S2umnHZWfT2Wg90DyTBHD9yQ/ON6S X73w== X-Gm-Message-State: AOJu0YwXICu5C9dT3iv3WFtZX58zjpIywj8Mx/IStTRfGhag+qVDl6OF W+E1DUZGnzCKBzLtiS5DYnrrTItBnoa0MvcVpE4gXhQ6/Wt3eNf4Wd/FVDRAHh+hCe6fGGVhF1R X/NzRt+6WPw== X-Gm-Gg: AZuq6aJ92pmSRW0jSBajDp7IyPDzsuNJwmmrfuwkFjUfG3kzZgNRYAMLOcHobvzRmQZ tQpzBeF497P9a/+9ODb7jHl6GcPis/gtVzQ1Sz4HDfYR2pNnXrljvU4vvFh6BAdcpRIZ+NGeYgs iMlccgN3f79Z3FYWVzw+BY+jMGADovdhW5YxTuYBgUf8tal46PSqt8kY03ImcIv6Qx0BI9iVAji CISbqs5vdpffmHxRK/x2b7bWRnPsBAjG14IXwLXVZRZq9urB8u8BVSd2URGQ0NlajMS1nMhjh93 WhpK79CeDpEL4o5E9dSxJys1BcRqSsQmShQx+oofOeWLg3BJOFwkXajLM2OfvbYhQNpHaNCrlPL 6htdbgiTe4UGQO/5tawTPKx4Xpk1ltA8vpRalHrkGC0jQ8LUHBnnXW1K+/Rf8WjgColuLJpXSp5 PCkBFW9CUhS2NOptLQ03QEDdmPQd9yA6R3/r1t3cWR2/iIpdPEXDirq39h6+Uv7pTdpL/xmJQJ X-Received: by 2002:a05:600c:190f:b0:477:9a28:b0a4 with SMTP id 5b1f17b1804b1-483a95574c5mr114461295e9.0.1771801678285; Sun, 22 Feb 2026 15:07:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 17/20] hw/net/rocker: Don't assume h_proto is aligned in eth_strip_vlan_ex() Date: Mon, 23 Feb 2026 00:05:58 +0100 Message-ID: <20260222230602.5756-18-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::443; envelope-from=philmd@linaro.org; helo=mail-wr1-x443.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: qemu development 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: 1771801697123154100 From: Peter Maydell In eth_strip_vlan_ex() we take a pointer to the eth_header h_proto field into a local uint16_t* variable, and then later in the function we dereference that pointer. This isn't safe, because the eth_header struct may not be aligned, and if we mark the struct as QEMU_PACKED then gcc will complain about taking the address of a field in a packed struct. Instead, make the local variable be a void* and use the appropriate functions for accessing 16 bits of possibly unaligned data through it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260212140917.1443253-3-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- net/eth.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/eth.c b/net/eth.c index 3f680cc033a..12ec316e240 100644 --- a/net/eth.c +++ b/net/eth.c @@ -274,7 +274,7 @@ eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, = size_t iovoff, int index, uint16_t *payload_offset, uint16_t *tci) { struct vlan_header vlan_hdr; - uint16_t *new_ehdr_proto; + void *new_ehdr_proto; size_t new_ehdr_size; size_t copied; =20 @@ -298,7 +298,7 @@ eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, = size_t iovoff, int index, return 0; } =20 - if (copied < new_ehdr_size || be16_to_cpu(*new_ehdr_proto) !=3D vet) { + if (copied < new_ehdr_size || lduw_be_p(new_ehdr_proto) !=3D vet) { return 0; } =20 @@ -308,7 +308,7 @@ eth_strip_vlan_ex(const struct iovec *iov, int iovcnt, = size_t iovoff, int index, return 0; } =20 - *new_ehdr_proto =3D vlan_hdr.h_proto; + stw_he_p(new_ehdr_proto, vlan_hdr.h_proto); *payload_offset =3D iovoff + new_ehdr_size + sizeof(vlan_hdr); *tci =3D be16_to_cpu(vlan_hdr.h_tci); =20 --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801696; cv=none; d=zohomail.com; s=zohoarc; b=QYU0sCF3O0f3LtIiZUTj8S684NoisO24cHTNzFL9G0G7D7moysT9N4nH2HBvVWzrWQK28FniCIfbDE8eLA1XQWp49u+w0NBoFE1ZhfdTP5Ugw14eQk1MsT6d76ZJKEXOozv4gTK0f+XKyuoZFVMMhzKAyXxRq1pHbDZl0CnEvoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801696; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=EfTtfTTU3wlW3mcARDFC2+pUKQHiKvLPF7i7ypFyE5Q=; b=hA1r6+SBLfjEEPpPJy/DjSPzBc60ocYX5nPGfK/exLxvo7MEZwicOMOeeaoqsPjTf0LcOYKjjkzFrLAmy3NbVorpt2vCBXuMVdidXO+yeqgLytSbZ4KJwUOjACzhHnJlNxVgUXYefB/ox8LcPIbDSLMDOz/awpJO6c+HL6s2Wfo= 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 1771801696724718.3142174433132; Sun, 22 Feb 2026 15:08:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYc-0005mm-JV; Sun, 22 Feb 2026 18:08: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 1vuIYa-0005Rf-3Y for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:08 -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 1vuIYY-00064l-Ga for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:07 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4837907f535so33156115e9.3 for ; Sun, 22 Feb 2026 15:08: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-43970c09897sm15226445f8f.17.2026.02.22.15.08.04 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:08:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801685; x=1772406485; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=EfTtfTTU3wlW3mcARDFC2+pUKQHiKvLPF7i7ypFyE5Q=; b=DujAFY4RksngvSuLrse5anQOYps/x1pO8B3xNU5kK6hSnpBcadmkbPssBsSXjIkZKf 6z2JHPiyHi8ZseJzcKTG9hB3Ya7lsyaZ1+DDFKmJrgRi1/4d8Y28LytgbEkjNtE1hYpP b8YTxjhUubtC9/upYR4YAnRyPM+OzPWfQc4sHOkB5wNyI+uCf781AMHXen9r8C3JMCIT U/FQyfJnZwqgrMlSFHsluWtFAOyXMnNPi9YvS0M0079z5RCK+5/RGWaaC/NmJTKjE6MS kr8FlNopeoUrCRT3uQsgTq6YjfUjUov7/Uvuu4RQZ9uHix9qdyEdUUw/7ywtaAFLK9nD pVpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801685; x=1772406485; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=EfTtfTTU3wlW3mcARDFC2+pUKQHiKvLPF7i7ypFyE5Q=; b=i6jit8lzPRyaP1WFya6U6uVQq9ABZZk7DBb5Pu5WY3d3O0mougbBOoz4vgiR9bfQ1E UYqjk+7PKvQYMx1bNkGLfbhHTmH32snPlNiv+3mGf//4mUrx4lnqXSIGCwEFov2KUbYY +d7M9zqkgQDl1lNQuH5aOBYNO1YG/zvuTwgWBgRR9GiY2hrj/CFGLB6G2zr1QvB1Rzr3 vGxPVlZrBxFaqg9JbWyXk0pU0jsINrGrW72/pta+TJKiJEzzFQWS7HVHwTHz6z+jn8k5 zACtyB8y4vJlt33Hcgo2H2lBH+ERZAOldZ1M9jPuJXx9hDnxivHi7uJOA5Wil6sVrtfm D7Sw== X-Gm-Message-State: AOJu0YwgPY/xLuJJ8GRq2r/XPdrJhnCqWf4jkTkg4fHU4sJmV3B6oKSR JWez4+++PF1Qj0b7p32hlbNxkBXJniMQnf+rleLujZZpdndEBTtAUx8zbTY+SqU/RGSeBiotQ1B x4vCyW2o= X-Gm-Gg: AZuq6aIy1N4GW2dzDYTokJy8P/WjIrQFd7rNgd+eKRtcLPjL9bE0u3VpCQT6IcUXFGm bsofWWhtY+XjtZuO5SwdFFjt5AFC79VJwhU0kUQHwXIWepqDOqgrNzRoF2RclpmFvXktAJB4Vni kFucQQE617HG+I7fRqTCl9Ib0VmFUCCAMZYVn6V2xJtcgJ+E4oXBfJWQPKrcuVhE3Xs5gvaad0u uZLfDc4kAfjTajKn6RM3/LxdNQRhviFyUamzLJ5MfSK8+gVP+rhzmmrOF8Hr995iqop6XOZbHFT D6nrjx7s7uHBSaviUa+tSWk9XSUsKUDcgLgr9xyuqhANAsN1l7uTpygjxxhnaqLit7/BIgWTcrp 4HomBqZWJ+MmQQxrIzXqC3oV8UI1XCeP2zzI1P2/tvTnPmQu7+Sj3rb5v7CyvM8Anl2uaEdbN5C +bo/GZKGDT9qxUnSWVy2GpDWUmmp409aQtTiPPkAeODDVb4VN3lsEU1DEF3jYoXhqN2e8Rh/7/ X-Received: by 2002:a05:600c:1e1d:b0:483:702f:4633 with SMTP id 5b1f17b1804b1-483a95bd8fdmr117245725e9.4.1771801684671; Sun, 22 Feb 2026 15:08:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 18/20] net: mark struct eth_header as QEMU_PACKED Date: Mon, 23 Feb 2026 00:05:59 +0100 Message-ID: <20260222230602.5756-19-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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=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: qemu development 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: 1771801699145154100 From: Peter Maydell The eth_header is not actually guaranteed to be aligned. We attempt to deal with this in some places such as net_checksum_calculate() by using lduw_be_p() and so on to access the fields, but this is not sufficient to be correct, because even accessing a byte member within a misaligned struct is undefined behaviour. The clang sanitizer will emit an error like this if you run the sifive_u_mmc functional test with sanitizers enabled: ../../net/checksum.c:78:47: runtime error: member access within misaligned = address 0x561f52f35011 for type 'struct eth_header', which requires 2 byte = alignment 0x561f52f35011: note: pointer points here 00 00 00 00 33 33 00 00 00 16 52 54 00 12 34 56 86 dd 60 00 00 00 00 24= 00 01 00 00 00 00 00 00 ^ #0 0x561f20608459 in net_checksum_calculate /home/pm215/qemu/build/clan= g/../../net/checksum.c:78:47 #1 0x561f20117bfa in gem_transmit /home/pm215/qemu/build/clang/../../hw= /net/cadence_gem.c:1386:21 #2 0x561f20115c61 in gem_write /home/pm215/qemu/build/clang/../../hw/ne= t/cadence_gem.c:1650:13 SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../net/checksum.= c:78:47 Fix this by marking the eth_header struct as QEMU_PACKED, so that the compiler knows it might be unaligned and will generate the right code for accessing fields. This is similar to commit f8b94b4c520 ("net: mark struct ip_header as QEMU_PACKED") where we fixed this for a different struct defined in this file. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260212140917.1443253-4-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/eth.h b/include/net/eth.h index 14c34f530fe..63f598d7cdd 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -39,7 +39,7 @@ struct eth_header { uint8_t h_dest[ETH_ALEN]; /* destination eth addr */ uint8_t h_source[ETH_ALEN]; /* source ether addr */ uint16_t h_proto; /* packet type ID field */ -}; +} QEMU_PACKED; =20 struct vlan_header { uint16_t h_tci; /* priority and VLAN ID */ --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801704; cv=none; d=zohomail.com; s=zohoarc; b=C7zkCGm0QTx/5J0A0tn/qKK+IArJPdcpEIK3OQRqKCm07wtG4iTywrLvesuzkxZgTMqrpTZBLDy8bV3FQPIdmK2FgBjImRx2bkl/oqPrL/IiB1XF1KHU55icDLKctAAkWVrDe7CkocwSu1vn3ibK2Hf/klEwy3EKelwZpYGQVmo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801704; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=5dSZ2BRPb9a3u6TkdiLcs4w8cdPWRis2CRSgfa2M8O0=; b=aTfL86RO6DMcVy/pLuk22fn+oDdAtGmYD8Fxa0Z4yfTInZNgQ2lyOW8+ZCyOQbe4o/y46M0HxRf88cycuZPoVIcaJqRXWB/LHKaKI4eQFAtdbQ3x2FV8IZh2A3BHjA3gP2OcZS/8qJWqaIsE/A8VbKQcSRMbETrVuZ7LsOTN9no= 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 1771801704888184.54697227210443; Sun, 22 Feb 2026 15:08:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYj-0006dr-48; Sun, 22 Feb 2026 18:08:19 -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 1vuIYg-0006MQ-MF for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:14 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIYf-00065P-0N for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:14 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4806bf39419so34625075e9.1 for ; Sun, 22 Feb 2026 15:08:12 -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-43970bf9fb2sm15623773f8f.1.2026.02.22.15.08.10 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:08:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801691; x=1772406491; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=5dSZ2BRPb9a3u6TkdiLcs4w8cdPWRis2CRSgfa2M8O0=; b=C6VEib7H8LRi/Wfvj1Xb9YivCLDv4Jgd+H3h7leC3WT1Y08PmupjX8VQNLuGhYxST8 9ot9tiXnjhvVPudDE19LUx1XQ3kuYdmFJ3eL8zL7XXhv8MYPbgNLumUspOFLOzRRE/EW 9mTODDyrNscuPGGr62dZDag47R/sECoDtGymKKu2eZkZv5sQ2qhEJK+N1/LBdN4GZdEb +w3Q9eMNLbLAXbJxDf5/WmS4hEOus3I/P4SJk8VM9nLY/iyHz/M1gIgG7YMRC8uTXFY6 cHaFrpro38HO86l08ZbXV8W+FJdkE/1CnUY3DIadWk7zEy26I1JxRedgYnfrqi3V9SmS +Fzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801691; x=1772406491; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=5dSZ2BRPb9a3u6TkdiLcs4w8cdPWRis2CRSgfa2M8O0=; b=YxgQo1h8NGHj+/xhWOPGX2gbh2PeDZRIy3ovyTtCx6G7R9P4pH815dQ2eLQN6XYxdk IG01Kicbx761zxyqSBw673+U6XqHBwOtJa0OvJDeKC0ImzOmc/jNaPxw4uAfJ0J4CffP 20v6BaevakSrJ3rztRRc6C7M06Tj/N/Gb72/C9H/d9RsItN6W1Lm3NOszpiPrzqv8kkf XSa1GcNKKeUqkore3rfGjdLIMYrShjdD6CDzAxHUvb5ks/ib5qjo8QMrE4Bj7k/5YPGW mGwTLnoQcalAbufq8IradV30f3TGzWSw5ajsOMDD6ClGDC3eKRiRx8+F1IeuKj9cmkjN ijZg== X-Gm-Message-State: AOJu0YwDSCByUoWeAZmgXJsVKtZXhrp5DYMNCfZp3e3oFgwgpnTM4+Bj B4fYi2/fykWB5V9mVu32NCbGNK4rizAMewJi9hH4Q/mCNpugV8I6LAFZcmuVwSdr3kP9xnMp/D7 Mm9nHqb4= X-Gm-Gg: AZuq6aJM644zr0F1sA3WkZP9EdL0q3DhVrLmfPndw5tQ6qM61Ns5XONDIwjE14FHTpU k3SV6zUs/xtkaeo2q24LN96azLipTNiq+Sw4c3CX6VZYFdbLGmq5VqU1AxMo6n75Y6kpFcP7ccw R8+okakmccwEyY4rs0zRw3fI0QZI8Iw0DXwlRPMgdYXWJe79xYWQ9k2pRPKgTsiyhXDsf04fvy7 9hW+on6aBO4RcquWRC4dkCwSPLGV51tP5srT/rIQ8izHQOqiwQ4+uaDKO9mDWyozcIZPEoI+u6T MX7xZauswS0FFT5fEToRIvlW7p75mQpeOa73wCBYtC69XcxvYcBonmDZDXqxKu0at+OGHC2+frA 0DmgVh6CSd6M7dQCcShmfecmY0H8ZHWORW3Om7mnMljPvI4e9hWMIVJt7hoSQS0FJkDpHih4raX 4z6srCDNoWA5PMGG0aeHzU05BiMxYYOKgjkG609a+pLgwEVn93YsnFaaPiUgSWLrz6BlovjMWep FcShzVkzbY= X-Received: by 2002:a05:600c:4fc2:b0:481:a662:b3f3 with SMTP id 5b1f17b1804b1-483a949f791mr107831785e9.7.1771801691187; Sun, 22 Feb 2026 15:08:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 19/20] net: mark struct udp_header as QEMU_PACKED Date: Mon, 23 Feb 2026 00:06:00 +0100 Message-ID: <20260222230602.5756-20-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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: qemu development 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: 1771801706703158500 From: Peter Maydell The eth_header is not actually guaranteed to be aligned. We attempt to deal with this in some places such as net_checksum_calculate() by using lduw_be_p() and so on to access the fields, but this is not sufficient to be correct, because even accessing a byte member within a misaligned struct is undefined behaviour. The clang sanitizer will emit an error like this if you run the sifive_u_mmc functional test with sanitizers enabled: ../../net/checksum.c:168:24: runtime error: member access within misaligned= address 0x5b7a7f829033 for type 'udp_header' (aka 'struct udp_header'), wh= ich requires 2 byte alignment 0x5b7a7f829033: note: pointer points here ff ff ff ff 00 44 00 43 01 34 58 54 01 01 06 00 85 95 80 60 00 00 00 00= 00 00 00 00 00 00 00 00 ^ #0 0x5b7a71a5887e in net_checksum_calculate /home/pm215/qemu/build/clan= g/../../net/checksum.c:168:24 #1 0x5b7a7156819a in gem_transmit /home/pm215/qemu/build/clang/../../hw= /net/cadence_gem.c:1386:21 #2 0x5b7a71566201 in gem_write /home/pm215/qemu/build/clang/../../hw/ne= t/cadence_gem.c:1650:13 Fix this by marking the udp_header struct as QEMU_PACKED, so that the compiler knows it might be unaligned and will generate the right code for accessing fields. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260212140917.1443253-5-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/eth.h b/include/net/eth.h index 63f598d7cdd..df90ff08374 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -85,7 +85,7 @@ typedef struct udp_header { uint16_t uh_dport; /* destination port */ uint16_t uh_ulen; /* udp length */ uint16_t uh_sum; /* udp checksum */ -} udp_header; +} QEMU_PACKED udp_header; =20 typedef struct ip_pseudo_header { uint32_t ip_src; --=20 2.52.0 From nobody Sun Apr 12 00:55:48 2026 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=1771801715; cv=none; d=zohomail.com; s=zohoarc; b=XQuMv7HuhJhrsEn1M1L53I624wMpuhCfrLh79NwQhP1ITYFLf6RkKG1aTLRSVN1KogMFeedwNH+OpVVL58G7ycj+QmQafm+uFuAE0zV8iMz8VYDXf8WFd/sOEl0Kh9SRK8lrouQsUip4857+Ko3E9ao3iAcYYxuu+uhTaQLUluA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771801715; h=Content-Type:Content-Transfer-Encoding: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:Cc; bh=eG1Sb5LxM37W6z2kdxQTI7JotgScD5A/jNfnafdk044=; b=D0aN1EgKwGLsjuWjXmMY0JBlsXTMMBdNOCqjwHg2ODnTC+hypSXTujvGqeR1TjXCeJy2og0VzvWUhqlx5vUCE8gCyLx9p6i7rQVpLfM29RDs/LIa0F8q7fBSHXjDIDcvdIW5JxprUcr/8sjGkq//eizGTvr+SXqQ1xunD65ndkg= 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 177180171591419.76683652249585; Sun, 22 Feb 2026 15:08:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vuIYs-0007aQ-Pt; Sun, 22 Feb 2026 18:08:28 -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 1vuIYn-0007KF-FP for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:22 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vuIYl-00065v-Oa for qemu-devel@nongnu.org; Sun, 22 Feb 2026 18:08:21 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-48375f1defeso26497205e9.0 for ; Sun, 22 Feb 2026 15:08:19 -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-483a9cb3f31sm144097035e9.13.2026.02.22.15.08.16 for (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Feb 2026 15:08:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1771801697; x=1772406497; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=eG1Sb5LxM37W6z2kdxQTI7JotgScD5A/jNfnafdk044=; b=XnFtPXV7RKXjswTupGBxEasVKsMu+o+k8TNr6UJ8eGbnCbu1LkQnyKyK8wXByPDl5h 8mmdrclE3bT9AxFjdYG1qmUzmjLolM5Alda4KOi3QvHWZ/99k0XAHPu4FFj1UQL1xLSU 8CF0povij1vqMxmLJhmD46b/nT8hR8aGgpmRDHif01QMiAJqzMeWBOpDxycleW+72uY9 IB/fneemGkOwU5Ax8/7Bx35KjeJwtdqiky7UiD3XyHQj9l27dFCKMkUCnd2eJ7l1k3IR ThmO3JAquOUTJ5FMk8x+L7kzLHKKX73hNL09PFQ5ZFx4l+Jy0Q+yADM08C0BnqVO7r/Q C7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771801697; x=1772406497; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=eG1Sb5LxM37W6z2kdxQTI7JotgScD5A/jNfnafdk044=; b=SwL0CQ9YOaKhR/CRG4A4ukzV4cGKUzL9nu3LANiHhFeEzVgHpax3gKN3kSn25Yoq9g XX6+93kYV7LIWQDWvj/AQq3CPbewVIFlCcvKvZP0nZa2o3rBNmQ+tfT+DtmPrI4Fp0Zp WoR/RWJB8XX6eu+jy8d+9oazF9rXthpM95dIXtsgSeRHNlqiJCexP72hSnhV7ore85Qe xux1/qQOu49u70bUamnbzBnZ1t90nNnt7iVevRzuM5JUwxYYh2k5tTZrQJLUU6JWQTlE sB2xqPOTucQZ0LIKaYb0miq0moMapCvzw/DSbXdV9NvXU/vnizgIvSjEY56KR+8PL8r9 imFQ== X-Gm-Message-State: AOJu0Yypw+oKreZ0DMh1t5edwjNFckCvXyru/Z5JXuSqzYjdkjRpj2pl s3mvZ1sVCnz8K2QwBo4nbbZwjMAYK06UyoHGQ11qTn148vzMEEA6tuhskMMqvLFJ5s30Wmn/zMb RY6kJq8I= X-Gm-Gg: AZuq6aLd3Ymnf2KsBreQVUD0DkW5yHb1BC6CIpKAjc7Bs4JjdjCFWAsRzUvawM2uQMh PUrH5TswLXiY/r90ImSupQ5tHtSScp3Y+t1KJrbrH/dCyZQnmOdiwuoGvwDhEGw6Hx08qYXKfYJ p9ojRsNqtMsTdDQsC4cp6voOXZErvRwEmb2x/XlTasjsIVdOkAGFYutWIghtx88bZ5yV/mhkJC2 gE72yCAg5Fc7b0Wk3xqbkgMO5v+/utNX5KvGIxR7B61rTGHG5KoTr+mQlTHUUIr7QGO1fWdCViW 3HoMvSeD2HUC+vZvib4jynLfCKVW8ArkWC7s15CDG8JkQZOvZpn1hjOc0BHtBODjJEWi+VB7eOs YEujXHweQpYaTIcf642EPXdbBS8uF1A2JZNjx+GHez5Q/fuk3ZTihLI16bCqwVFGK2WudhJVVng LXWWGM3/SWPwPyyO+0TRV67/YPDQBVHwYmSUZYUtfDfFMaDlxZw1otjjm4QAaeVmYhfXYz52RB X-Received: by 2002:a05:600c:1d29:b0:477:5b0a:e616 with SMTP id 5b1f17b1804b1-483a95eb521mr122970295e9.5.1771801697561; Sun, 22 Feb 2026 15:08:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PULL 20/20] net: mark struct tcp_header as QEMU_PACKED Date: Mon, 23 Feb 2026 00:06:01 +0100 Message-ID: <20260222230602.5756-21-philmd@linaro.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260222230602.5756-1-philmd@linaro.org> References: <20260222230602.5756-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::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.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: qemu development 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: 1771801717394154100 From: Peter Maydell The eth_header is not actually guaranteed to be aligned. We attempt to deal with this in some places such as net_checksum_calculate() by using lduw_be_p() and so on to access the fields, but this is not sufficient to be correct, because even accessing a byte member within a misaligned struct is undefined behaviour. The clang sanitizer will emit an error like this if you run the sifive_u_mmc functional test with sanitizers enabled: ../../net/checksum.c:144:24: runtime error: member access within misaligned= address 0x619a74c32033 for type 'tcp_header' (aka 'struct tcp_header'), wh= ich requires 4 byte alignment 0x619a74c32033: note: pointer points here 0a 00 02 02 86 aa 00 16 52 c1 d3 70 00 00 00 00 a0 02 fa f0 00 00 00 00= 02 04 05 b4 04 02 08 0a ^ #0 0x619a6ba84794 in net_checksum_calculate /home/pm215/qemu/build/clan= g/../../net/checksum.c:144:24 #1 0x619a6b5940da in gem_transmit /home/pm215/qemu/build/clang/../../hw= /net/cadence_gem.c:1386:21 #2 0x619a6b592141 in gem_write /home/pm215/qemu/build/clang/../../hw/ne= t/cadence_gem.c:1650:13 Fix this by marking the tcp_header struct as QEMU_PACKED. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Akihiko Odaki Message-ID: <20260212140917.1443253-6-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/net/eth.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/eth.h b/include/net/eth.h index df90ff08374..efe270dbfe7 100644 --- a/include/net/eth.h +++ b/include/net/eth.h @@ -68,7 +68,7 @@ typedef struct tcp_header { uint16_t th_win; /* window */ uint16_t th_sum; /* checksum */ uint16_t th_urp; /* urgent pointer */ -} tcp_header; +} QEMU_PACKED tcp_header; =20 #define TCP_FLAGS_ONLY(flags) ((flags) & 0x3f) =20 --=20 2.52.0