From nobody Mon Feb 9 06:58: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=1765391903; cv=none; d=zohomail.com; s=zohoarc; b=Hwcro/4BKHOEpnlZ53BQ6bec8h/0axi03LEf4Kqjj1JDXVABLr7YVSLdcZ7Fe0OUAHMDvGBX7NnonYdBeyP5rSANIS7gORX0ekZNHKleZvBbBVCfyyPnJY8Cx+UuLHVMXDQTJRI/q7POjvNObqWfO2c88FLQgoZlKq+OEiv0zMk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391903; h=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=OO+cLH1Fn44N6BJ+Ju5C9CU5XD8M5vZpp8/zUAFjH0k=; b=BKSgPx5aRPlPN9HSg03/6+gV6+9qeeIqQs+ssxV/Iist7M/nd3uvdGChaDECs/sUmnVGkzzEZpgVmIXrQI684Z1/zZrQL+LIqfWj7KDbux8rlywwWVkGdSYLw4XHPOdxFowOdlvjVJBNfb2QClFuBD8OZPvlKzru1827lJj5hBc= 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 176539190342498.86575542140577; Wed, 10 Dec 2025 10:38:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3m-00010S-MN; Wed, 10 Dec 2025 13:37: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 1vTP3k-0000yn-Qm for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:08 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vTP3i-0002Pt-C1 for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:08 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-42f9ed40b8fso42649f8f.0 for ; Wed, 10 Dec 2025 10:37:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391824; x=1765996624; 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=OO+cLH1Fn44N6BJ+Ju5C9CU5XD8M5vZpp8/zUAFjH0k=; b=y5P8rpNUYPCxoI42ITwGKEOZRr/ZeMMnZfWYJt7eF+xQOP/vvSpqr2ctMWEFaGvzbH JkIcmzqxJqXXlYJ8ikTjmmzck3eaPOIee54jRQK6LRUdndb3R7s6Th41ayUySPRG3kDV tLjU4uLnamaJdwqktFTMNGJxzScPqpptCFBYwSFAMqJQ4HlQD4OFc55aZamT/bosHIt7 hxs/71EpjMCnomY/gHPPSN/r+Ht9cU5Gl4vJ6+sAO9vEn7SQBgqkNOBM1cQGqURjSmXD mQEYEGJmU7twSKOGX7UB1CUvTzVEJkHLVlno2WHTv+lSc9pPOhpeEJGlDk4wmVHdGZCL aXyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391824; x=1765996624; 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=OO+cLH1Fn44N6BJ+Ju5C9CU5XD8M5vZpp8/zUAFjH0k=; b=tAJe0PodVvwm2Wo8htzR5FvgcNfFjf3mgz89kuKjqQffhOafADyFeEjZl1ij7+WKn5 7aNsEabXuHP+fVLOqwsZ8U7RI/1x0B6vVMfMiGKwH5Fz90uVrHr5ZF2SJ5E5ag2DJVPH Gso6ulwmIyDYiXb3yKQo/m4hlJ7f4Q0SMA6bjXnFU8ImlRXbLKtMvOhsSm3gWPVPU2ik 1IL5RQwkoeR1R5wKDluAxuwUDJ6i66JYZyJ6d6S1cqxlKHHIDAMLyv++kgwfREmRI0+p VKCCBuhCdblDWyVELEES3ufXo81dMNiuxUvDJYA6pNdatkAJAcL2E2MKirPTug/r9YaJ JI2Q== X-Forwarded-Encrypted: i=1; AJvYcCX0kgyPa3yp9pwpRSC1Kn9E5cdagNE1SqPArAtp0LI+hun+zQghodgjqM42qsThVtXlv+DYigb4tzpv@nongnu.org X-Gm-Message-State: AOJu0YxXs5f/0CmyDtjpB9U8scZ0wsh3ZEJIviHATLiY/BMsyaNuqs7t vQ3o8bYeC+aiX0oRXffQbWaUGxDrcNnHQoUm12UYjoCwVA6+oGNcconWug9kBvNrH/8= X-Gm-Gg: AY/fxX6uuKbgK7urFy9mXMNSRngBwFBzOVqiJfs0SR2JZNgyi+SkaIxyc2Fle6KuISO Inva4As0JoRsLO0Xz6TSUeW2AmTVnSKvI+hInm3zL39oGNUY6R+gSaxGH/8WhQCFTl7nxYp8tCv 7EY3UbaR7emvd44l2lyMBPMyjPny5Pz8AvNfupELkS6PydjEN6ijyp0DoAOYk0yo27rNwsqu66r wNoFkUTRpNaobBSM129x2QUbD2g0krXU9qqF0redM2mjHkMxjqoycgDS9NUobMc57UNlV5n3XdX KfVYbm4tkmkvp+29TP7paA23aOigvpydjgYOLAF876RDdR4cugoNFl5+rd2vSSao5hUydQYu836 dh48lJKd+pdJTzrTe3QskvOh8rn5Zf6/ufYyXyHH4BwVyd0n4nFzpRguNDafEl8paRxtMtS/hXV wzG+80/AvKaOhHe+jd X-Google-Smtp-Source: AGHT+IE3bolWOmvs2CMbvn221/S+x1oSCLq8dvScR2LMq1m7Off0r9p2KzEfsES25RlI+dek+JSabg== X-Received: by 2002:a5d:64e6:0:b0:42f:8816:a507 with SMTP id ffacd0b85a97d-42fa3b1ef97mr3775327f8f.60.1765391824332; Wed, 10 Dec 2025 10:37:04 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 1/7] hw/sd/omap_mmc: Remove omap_badwidth_* calls Date: Wed, 10 Dec 2025 18:36:54 +0000 Message-ID: <20251210183700.3446237-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391904350158500 Content-Type: text/plain; charset="utf-8" The omap_badwidth_read* and omap_badwidth_write* functions are used by various OMAP devices when the guest makes an access to registers with an invalid width; they do two things: - log a GUEST_ERROR for the access - call cpu_physical_memory_read() or cpu_physical_memory_write() with the offset they are passed in The first of these produces an unhelpful log message because the function name that is printed is that of the omap-badwidth_* function, not that of the read or write function of the device that called it; this means you can't tell what device is involved. The second is wrong because the offset is an offset into the device but we use it as an absolute physical address, so we will access whatever is at low memory. That happens to be the boot ROM, so we will ignore a write and return random garbage on a read. This bug has been present since 2011, when we did the conversions to the MemoryRegion APIs, which involved changing all devices from working with absolute physical addresses to working with offsets within their MemoryRegions. We must have missed updating these functions. Replace the uses of these functions in omap_mmc.c with an open-coded call to qemu_log_mask() and RAZ/WI behaviour. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/omap_mmc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/sd/omap_mmc.c b/hw/sd/omap_mmc.c index 5a1d25defaa..98c1c376ee1 100644 --- a/hw/sd/omap_mmc.c +++ b/hw/sd/omap_mmc.c @@ -335,7 +335,9 @@ static uint64_t omap_mmc_read(void *opaque, hwaddr offs= et, unsigned size) OMAPMMCState *s =3D opaque; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, offset); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, offset, size); + return 0; } =20 switch (offset) { @@ -428,7 +430,8 @@ static void omap_mmc_write(void *opaque, hwaddr offset, OMAPMMCState *s =3D opaque; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, offset, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, offset, size); return; } =20 --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391867; cv=none; d=zohomail.com; s=zohoarc; b=E923QOhnDETwGbu0rzovM55BW/2MD3h3hvrtvZoEDF7ti5znHqX4TFjD/jpIqGOMGKjN9jU033Dmw7xtKD4pKOfUWHN0n62bA4q33mVS/wfaw4H/HevoKcjVfzfqRpQbbXUi5nMSrfuYVHjHWHxqEJuaho51gqVuXXvQYFzX2gY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391867; h=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=fG/gu0LeD5v9nk/CxhJjrI+Pm2/1k+dVpVQVmGRBqxg=; b=AkREdtn5feXS+V7ZlnQXFJzD320EfrH2LhoEe21cPP1OEu4E/oimlkQT0/GEfAyCh5XPbsqOVoWPo0JzcOh05UMBKe+i3Se8/M3qib8lIbs3vEhy7l4bQ/WQmZcSlgyxCVWx9R+GRuW2/2QpYRrcgl9B11w5ZGLp8tQtrqTZEvU= 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 1765391867873191.79499350078902; Wed, 10 Dec 2025 10:37:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3n-00011Y-Mh; Wed, 10 Dec 2025 13:37:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vTP3l-0000zU-Uf for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:09 -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 1vTP3j-0002QG-9w for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:09 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-477bf34f5f5so1103675e9.0 for ; Wed, 10 Dec 2025 10:37:06 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391826; x=1765996626; 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=fG/gu0LeD5v9nk/CxhJjrI+Pm2/1k+dVpVQVmGRBqxg=; b=O9htXtaeM+2NVyu+9C+1jBV0n8Rni0iQwr9LQqLgZluKIfkmltjwalwkN/hkJbKGb1 b9Hs0ta93kRdIRX0SMt+jPjquhYANIjTE5L7VEKbrXT9lgyjquKOkD8ehp6Qdiy7tdIv ha7rN89t8bkX/ui5VlrLrvCt0VYmIIpq/tFHetoXO0o4cyaSZtSUJX6Jpm7bHLsK44iV Z4YwII4BMxrfVgkEz0RngvFabJsrxzLA2+i6jwKqhgaGSD3/ci6+G8jnIkvHu8JVw+by Kv7u2Cmvh0ExW1RAC98kWmZTuOpVM6760EOqXpDN0RrloSxId7aDw4ziZ3/RCewA/O9k 41fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391826; x=1765996626; 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=fG/gu0LeD5v9nk/CxhJjrI+Pm2/1k+dVpVQVmGRBqxg=; b=rV4hz1MlZHJ/EJmFnFFFUigDTe71MfY3eTUcH0bF2Ta6zikGviMYb/VZC21seTG3U0 Cysj/Mp8h6SSBXdgcvAZ6XLHmxQQll8UsfTETkJiXypkPEcgqys9bb5kUt1f2AFZ6scy iXx3z5XrN7uZoZuf6ZcCmaXSRaolOv4vy+tMAoG4DwxT8NZK+ykhfLMbyIeaC+UwoQkF V4LI29AjhtH4U00VKXRHhcOT3WHmQF95z1li7krcOOT4iI5vl/FtCd2NjYphh0Mfb3Fn 4gr5835f3sD5XpJw8TDQIPF24coZXU+/hJrRxbQxtOl90QiEFK5JWNeNn40dNegYOvYY UYxA== X-Forwarded-Encrypted: i=1; AJvYcCWdlr6P9KXuqPU10RWw7NFLJkgzVc+HIcZiOGOhQsEqDSLN4vuFz37CzFqvAHXlmP62ZscQwZW0xkfM@nongnu.org X-Gm-Message-State: AOJu0YxRFdqnX3ltCwB3iNMSU1QUwmJ/y2mDbb+da57GExKLktiKr2P2 wkVT5S3ArCA4RaHJXDtpRAiHyDZ6GGRGX+0M7/Nj6A0fsobbqMXhQRxQLQH8GIRycIiOG4PwTaO VQydx X-Gm-Gg: AY/fxX5nV4YyTNIY+odxsmpvsfUXSa4PGU3BKIaZFDud8lUVFuZM73NEVb3p96Ma0Y1 uMHly2ZPcVbSgsOQ8pt4y7DrCLRSNyD8aU8WB/Z3e3ciIoFjjzdq0NXtIgqHKwDEKX2kzfDrzbE 0NtkHqAnZjx8QMibxQ78wGa+U+zZhLRUa6XAI3ud+T9QBQPxVMIybnPfjdzn9rOshzkhr1ZnHsm XgOrDC6Lajf51jq4bmw8NqlsuNutYYfglZCddYsa0UNs1JbdcG0VfSo8S4Ba0messpTHbrmb3Yf Jt2lFYzTdzfJ9Qnhd+wqT/CJqz5mb7EE91kX17OR0DR2hfNVa1Y6vPfTMDSz0RJYad3BvbKMQ9j MkTnBzm91K3Av2pD4Q/6MnRh2cBAcCIR/SR+bx0+wu/J+rV/Cl4DTg6O/pc3qocDKms8XHUG0XN n/jZdggmjiY+aDH5BfDAcbXA7GBUg= X-Google-Smtp-Source: AGHT+IFIuPNseeW6DRMEtziMjvkY+W7bylAb8pcQkbEvEsTd6oJmlwC279VLSyepHX4q7A5rTqks8w== X-Received: by 2002:a05:6000:26cd:b0:429:cd3f:f45f with SMTP id ffacd0b85a97d-42fa39cc91dmr3402890f8f.7.1765391825564; Wed, 10 Dec 2025 10:37:05 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 2/7] hw/i2c/omap_i2c: Remove omap_badwidth_* calls Date: Wed, 10 Dec 2025 18:36:55 +0000 Message-ID: <20251210183700.3446237-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391870095158501 Content-Type: text/plain; charset="utf-8" The omap_badwidth_read* and omap_badwidth_write* functions are used by various OMAP devices when the guest makes an access to registers with an invalid width; they do two things: - log a GUEST_ERROR for the access - call cpu_physical_memory_read() or cpu_physical_memory_write() with the offset they are passed in The first of these produces an unhelpful log message because the function name that is printed is that of the omap-badwidth_* function, not that of the read or write function of the device that called it; this means you can't tell what device is involved. The second is wrong because the offset is an offset into the device but we use it as an absolute physical address, so we will access whatever is at low memory. That happens to be the boot ROM, so we will ignore a write and return random garbage on a read. This bug has been present since 2011, when we did the conversions to the MemoryRegion APIs, which involved changing all devices from working with absolute physical addresses to working with offsets within their MemoryRegions. We must have missed updating these functions. Replace the uses of these functions in omap_i2c.c with an open-coded call to qemu_log_mask() and RAZ/WI behaviour. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/omap_i2c.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/i2c/omap_i2c.c b/hw/i2c/omap_i2c.c index 751bf748fd9..be2b7eb5306 100644 --- a/hw/i2c/omap_i2c.c +++ b/hw/i2c/omap_i2c.c @@ -441,7 +441,9 @@ static uint64_t omap_i2c_readfn(void *opaque, hwaddr ad= dr, case 2: return omap_i2c_read(opaque, addr); default: - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } } =20 @@ -457,7 +459,8 @@ static void omap_i2c_writefn(void *opaque, hwaddr addr, omap_i2c_write(opaque, addr, value); break; default: - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); break; } } --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391917; cv=none; d=zohomail.com; s=zohoarc; b=HhdH2g1Hmfkvbm4TiB5DOUY3cZY5cglF+IDyvjk0XcApaIVtBIvczbz5cw+yt7VwY3e2eerlSqywDxX/GHqrKQV+2ZrP9Y56koJPsoyJAM6N4e6nh0rD7fjedNu5QaPWUdmG4fqJ4oc3oNvd3wWOPpcdtZu9S+jJEU1412Ozpoo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391917; h=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=Mz5t4JBtFZ7Mb0qu6rwAgOyZr0gZygWWn60jyz5mSJk=; b=gi8ftUNayuR3FEKbVaS8+8qoGUCqvvw42PIFlQb2DCPeHNi+4sl1JLgVPg6YIL3BL1bI+C0bDcpr/LkdoHykw7GzWl2iNXL6vLmux0fKE/Nl5gQ5YyV602QFV+xPqfe7V3mCVjMbo7Jfd6iYHVRZ0IzOZwoNWp8pnKdchqXzyNY= 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 1765391916963513.2699530678664; Wed, 10 Dec 2025 10:38:36 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3o-00011u-CW; Wed, 10 Dec 2025 13:37:12 -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 1vTP3m-0000zb-4X for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:10 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vTP3k-0002Qc-HV for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:09 -0500 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-42e2d44c727so30455f8f.0 for ; Wed, 10 Dec 2025 10:37:08 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391827; x=1765996627; 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=Mz5t4JBtFZ7Mb0qu6rwAgOyZr0gZygWWn60jyz5mSJk=; b=MunvsppJwIyRE6vl/L+UWzZ4iFJDtFW4DVqhLqEMvZXqBc8KKSeU6qX+ipeoYho2VA Ge/cS0/ZnzQvSdTCtidCZndEftYqiY3J/jq3aJl605UWkrqenHa70459xSXfFDMF3bRU c4IkGXQTYnsKf3RsQHuY8CREZTSQvMHhaH4aEntERBXPkIV7iPLGYUOrwLLdOK6+Bwys wPBxcHA8j0ywKy0bS0stuXRgpMTBE2UEofKk8jbqStUH7xORLiIaxO8PYNsO4lZgvF+f w0IJ8/zkGYyy3Exc8fKbiCPov9Apd5ugnvGmvOx4EOjsmmK+yekviFXxuGYK720jBfR7 BHDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391827; x=1765996627; 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=Mz5t4JBtFZ7Mb0qu6rwAgOyZr0gZygWWn60jyz5mSJk=; b=COkqdLWvZ0Hg9ptd+wn9cnNPNUkypRjAE3RyZ93iDWcMcYqv93AZAKtG1w+z2AOzeo 6dPgUUdxffZ/YbXt+v1JiJj4h5qJKD2KmT3X6FD5nZBmTXEAQ/3Ql8cp2OAnp6t/Zg7k 9CIKvC4+X29RI03TGGU4f4IRRoKwma5D+wD3pzsVreod8/FSKftHWXTB2MYa9s+LeIn2 yxXnOR4UgBXZCL7D2aj66zr0EczXtbm/B8/imxlFZkx+0kdnJI7GzkRjSkFba9tjsLVG tFGQa7feSMONh0BfdA2JRByRrrhoE+NFqckKH0OZ+NJ5GH1254UQbjXnj1PP0i6Iztfp qDEQ== X-Forwarded-Encrypted: i=1; AJvYcCU34qCjx5f0SgezGU5IT9ftbySJImQGTPfgdB05md2x+ew1p3lsSEJBUPz68xLtWabhypsISgxqDZjj@nongnu.org X-Gm-Message-State: AOJu0YwI6K2ekEyLmbXxsyhAcJe0XJL0A3DjIyCRqW8cBdo1z3mEGLTB zJOXp0ywEfSXbtX1vAag1U66cS2+a1dasOdwJBdlSbrSEKID/GTtAO03n8gJrXeL4us= X-Gm-Gg: AY/fxX7V/MALX1AEecohE7qdp5972JChlCv44w3S4tH+ZYME2n18mvM3zv6wwouSXPk jktaByKGdV+6ETGBCbEPEnL6e5M9KErSnuIlZFSVBUxjwHpPTXkT/K5PSLS8fDPkKxIv2psZPKy oPHaEDSa2EN+oyz2UuU3Y0gEFyBxupMNYSM1eC1Ik2tKMoHhd7iVbF/AV2GdDBduvL9Gr/y5Mci YusxoetloJ1u1dcGb9n5SDuGcVSEe9LH7VDugDhuCkIXGBRDlPBDYILCok3Oy3XSDC+WzddiVYP r1UV5Ka2rTULdJWBgIzAZ7i2PsjDekW4SaqZGpaJ+Tj6yysRbYJ2QMiZWM4SeOBoy5VSUzt6Pf4 W/mYbb8VrFMVNQ1hK0Aowhq7nFsEQ+mtf9HSZwWm4mwj8aGNqDXME9fZhsY/5yACts9kO4xUjh3 IHQ00a41hud7j4FxlR X-Google-Smtp-Source: AGHT+IGhiR1s9trv79NqmlvNx0Ov0ZH6YpiNOfaeWDYN7GVVmzUVnMC6WtLMYmn5qDF8fw4GdtgoUA== X-Received: by 2002:a05:6000:402b:b0:42b:3c3e:5d2f with SMTP id ffacd0b85a97d-42fa3b0fb55mr3769802f8f.39.1765391826733; Wed, 10 Dec 2025 10:37:06 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 3/7] hw/gpio/omap_gpio: Remove omap_badwidth_* calls Date: Wed, 10 Dec 2025 18:36:56 +0000 Message-ID: <20251210183700.3446237-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391918259158500 Content-Type: text/plain; charset="utf-8" The omap_badwidth_read* and omap_badwidth_write* functions are used by various OMAP devices when the guest makes an access to registers with an invalid width; they do two things: - log a GUEST_ERROR for the access - call cpu_physical_memory_read() or cpu_physical_memory_write() with the offset they are passed in The first of these produces an unhelpful log message because the function name that is printed is that of the omap-badwidth_* function, not that of the read or write function of the device that called it; this means you can't tell what device is involved. The second is wrong because the offset is an offset into the device but we use it as an absolute physical address, so we will access whatever is at low memory. That happens to be the boot ROM, so we will ignore a write and return random garbage on a read. This bug has been present since 2011, when we did the conversions to the MemoryRegion APIs, which involved changing all devices from working with absolute physical addresses to working with offsets within their MemoryRegions. We must have missed updating these functions. Replace the uses of these functions in omap_gpio.c with an open-coded call to qemu_log_mask() and RAZ/WI behaviour. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/gpio/omap_gpio.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/gpio/omap_gpio.c b/hw/gpio/omap_gpio.c index f27806b774a..170c8d1ab53 100644 --- a/hw/gpio/omap_gpio.c +++ b/hw/gpio/omap_gpio.c @@ -76,7 +76,9 @@ static uint64_t omap_gpio_read(void *opaque, hwaddr addr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -116,7 +118,8 @@ static void omap_gpio_write(void *opaque, hwaddr addr, int ln; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391951; cv=none; d=zohomail.com; s=zohoarc; b=dK/1GOFfZuqceycEEpEqxUb/bsQAVaTUdmpBK94CmLWoNnqD4Z4Wg/eZ0HL0FVbu/Vr48Yopl/jAUxbqzUTmHxJJyzE7efgRyyfWeA69KmLV1gRkW4xq9D4Z5KTlvC242OtjFcZeaqmF/HR+I44CtHM1xpcF1UadHUxgUe0qY38= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391951; h=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=Na4A9EVrRfdr3jYLfoHtm27o0F9yOsabtMSqgfRALf8=; b=miuJmMd0cDD+egKio24F+EzhznICwnLXROslOlakoatSIKhk5MaKVzc0pgpwuUL3bcNNGwuoq8k7MvN+pOQJmbYGkTmXyqihwKVErVVgyVzmSN2iLLJuwsc6CgWL8V5JSywqrN0BadlFvrfzqo+8MEySVeiUPylvngtaiyTOtLI= 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 1765391951861866.2250128992156; Wed, 10 Dec 2025 10:39:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3p-00013J-Lk; Wed, 10 Dec 2025 13:37:13 -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 1vTP3n-00011E-DD for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:11 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vTP3l-0002R5-PP for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:11 -0500 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-42e2e628f8aso30724f8f.1 for ; Wed, 10 Dec 2025 10:37:09 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391828; x=1765996628; 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=Na4A9EVrRfdr3jYLfoHtm27o0F9yOsabtMSqgfRALf8=; b=sNtb4w5L4zVo1nElXk1TK1ItRYQF0KSNvl1Jb3tLHBi9jOCxk+GJFbw8NCzGy530Qv qVRMOocNLxKNJf1f70njk6wG3WXNwNAUOVB3/KTmh6GNXFUgdkWyqydGOALlz0B7qxdT qi6e/SdVuMHNQpMOehnvDu/jI9UYlBQeFmP4xuuYpsJG/AMqa74cdl7As4Yxp2nCj7SS txm7VXF9FkzIXV7f/o9CnKz5RBXXDqYhyNfR2UFmTAj6IQJKzYTdu0CICSkav6Kl0J1e 3p9P+GTloNMSIer+5refy4079BekJPKeSGF1LoHvEjQREZdjoaLveBhyXx3N2znI5h10 h2Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391828; x=1765996628; 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=Na4A9EVrRfdr3jYLfoHtm27o0F9yOsabtMSqgfRALf8=; b=HktdvsUfttsjem5b3EQaTuAvNOgZsfzW43QDoisco5YR/sNV9fTY3U1Z4nQwcdmIQ5 xdiRYVRho6nnNXkMgQyrJzbf0iJwPWhBOWOF9GMDYlxJ77FRz5odbuMKT8ocYz9AOoVV wF62r0ZFKzXExNLeMU2d3+YK64RnJ8LCqCeB6n7zqSPUMMaUTcCgo8itdlLvihtORJNH SG7bzw/gRJe84JM5hiKP5pRCk0C4cXSKuILbxVyoIwV2qQOjIiaj8tuBNJNVBAfVvdCU xXBVuqb8SWwMUb8WvwblZ54TJwR3zItG//SsGrtOeq54fUaHXVQG+RbbZYOaLVWz9kQd FSSw== X-Forwarded-Encrypted: i=1; AJvYcCUnOdL4vSQ97+XXWqfYEgnXaFguqZJTBa9Qpcz6dWcdEqlYO1k7+xyYVFcZgU3y2lnCcbtoZX9OXzaP@nongnu.org X-Gm-Message-State: AOJu0YxGS5xRDa9qwYaEVsIYfDmDemKtPesTB7jP6pCRvTrQZ+DHDltW HoNYjCLP0I1qJ32pKQfNaHX09igVEfmArJvM1kOhopKAOM7uIdNcHyLSVZ3pB0VL4n/THBd1WAD BQlYL X-Gm-Gg: AY/fxX4JTFj2RzHxmqjPBGX7Rgks7NMj/4qV7mxXySv9TvVTJFqHz93NBHY6rcoV9aj n3MGsso9bu/vW5TUMhkA/hun0ZMxoHxjPnD0XH1SgpjlgFbroKp2xEaiaGWki8WeUFuAoQZL2RF jAEkwr/4eeFzR6VafqQeoyLOT3pAgOVbPkkC17ohJAT9WwDpBuWZFGT7cus5jC9ER7bcorgK5cL CPLQmnZPlaML3wze7T6CDIl7Q8YxK3Ud1JBA5o5MV4MXTN3GaaYQXGtHZlUbAbYaRCb6cHwsdL/ YvujXELz/zIOoAaATu7GqoRqVYcDOqSQVRxh+lkyjTgHUmINTv4kI5t16waUQirAkzf4dCCMd83 OvZUoyZL1q+CEKcIl83CKQE0/WsRQpUHnzPoOrrJPY0sYhGSvqfnC83aE3B0J5SaM+bHYi54DoY o4M1xYfRYzxyQzkTO9 X-Google-Smtp-Source: AGHT+IFHX0TyibFMSZXaK4hYbmFYXdOe2vDbl4o4QgkSvWN7Bz1sH9BErRPyiSmVmIkmLOICj8j8kA== X-Received: by 2002:a05:6000:2c08:b0:42b:389a:b49 with SMTP id ffacd0b85a97d-42fa39d7eefmr3716134f8f.28.1765391828137; Wed, 10 Dec 2025 10:37:08 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 4/7] hw/dma/omap_dma: Remove omap_badwidth_* calls Date: Wed, 10 Dec 2025 18:36:57 +0000 Message-ID: <20251210183700.3446237-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391952352158500 Content-Type: text/plain; charset="utf-8" The omap_badwidth_read* and omap_badwidth_write* functions are used by various OMAP devices when the guest makes an access to registers with an invalid width; they do two things: - log a GUEST_ERROR for the access - call cpu_physical_memory_read() or cpu_physical_memory_write() with the offset they are passed in The first of these produces an unhelpful log message because the function name that is printed is that of the omap-badwidth_* function, not that of the read or write function of the device that called it; this means you can't tell what device is involved. The second is wrong because the offset is an offset into the device but we use it as an absolute physical address, so we will access whatever is at low memory. That happens to be the boot ROM, so we will ignore a write and return random garbage on a read. This bug has been present since 2011, when we did the conversions to the MemoryRegion APIs, which involved changing all devices from working with absolute physical addresses to working with offsets within their MemoryRegions. We must have missed updating these functions. Replace the uses of these functions in omap_dma.c with an open-coded call to qemu_log_mask() and RAZ/WI behaviour. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/omap_dma.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 101f91f4a33..ba0a70d84bd 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -1454,7 +1454,9 @@ static uint64_t omap_dma_read(void *opaque, hwaddr ad= dr, unsigned size) uint16_t ret; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1501,7 +1503,8 @@ static void omap_dma_write(void *opaque, hwaddr addr, int reg, ch; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391917; cv=none; d=zohomail.com; s=zohoarc; b=b+9gDfxvE2ejW9GtX4iDZj9i2LPUi+roXReXdL7uFV1eg1LcmgQ5d7aL3opWoyEHXEKuoJtDTKA6WXMyDTaJZDpI1CBcyzFYC6fzsZ1SHPOyeqq1FwQ2MpuDAyrJXoHNKx6+5XzLBJq9ZhU4X5xvxv6oaEYi9YyJn8XwQ96V+AE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391917; h=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=ZNi2Z4/gvQscPF42VGqB/Ys1+1b9Ayka2budxzuzvwc=; b=h0A/UHWFXVqaAVG6hgo8HwHLGc9HBg9584CcERWFeg1rF8w+RBH0JqG7uu8+kwfi+qmfoxyEV3MkBKhPTV2PuLDxI/+ELhYHOhksUWE1RZM4pJvYAhayi5lqL2zthLpiN+r2LYBbhZMyGidT1qSfSIsELZ6MZWevbDivHgUVmwo= 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 1765391917704739.18393034434; Wed, 10 Dec 2025 10:38:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3s-00016C-4c; Wed, 10 Dec 2025 13:37:16 -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 1vTP3p-00012x-9c for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:13 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vTP3n-0002Rp-0f for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:12 -0500 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-42e2e6aa22fso26377f8f.2 for ; Wed, 10 Dec 2025 10:37:10 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391829; x=1765996629; 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=ZNi2Z4/gvQscPF42VGqB/Ys1+1b9Ayka2budxzuzvwc=; b=W3Mins6RLdDcHGikkGit+cj1DeHndBrZYS8c2Pzec/NGsm/PCP0PQIJiqubx8mA1if pzmjWsOJBQxcNNitbe9ulPvyGGsetZL2uut/sNUmNOZ+PG/0aFSvRsI9J/KlU4ZWGi5c ZSRdOoWYz2vyidPNMmShrZY4m82ng75obeKUcoBJznx1yw74vVe3p9wyxIPZDwYkuDko GHw/ow0lGAsTz1HMI5LPxWRtx0YpnTHsP7URM0v8xL0G2UHAX1JK7SRdjOOIXFl84frb Iw0DluQFPWwBkC/FEdO93QtDHTWV2VJRUPR+5oG4yfDCjVgxhiNRiZpEIjq4MZ7MZ1Vb 7khA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391829; x=1765996629; 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=ZNi2Z4/gvQscPF42VGqB/Ys1+1b9Ayka2budxzuzvwc=; b=Pad/sXZH4oxgtjELmSMnrhdzhKMryvRFGLYP1jUQ+5oUxVU46NBZEgg/sWFOPsBR1D Oz0PsB21ubBhcP/71hUEXWeEMDnCOeDx++aAmmslqrAY8Lo9DR+tFiaEZncT/6mGimgl 8bd5W+/RrtBvX0UozqKFd+5iAYgG8lk00U+jkd6wYec3FY5O6huLoFjYh39WGQYLEHi+ E5XK6MR9IyK2HQaPDFhcNNNsi0nvrWBOH5N6u5VPMXZHiyrrvSleC+DbM2lGTMLZZZCd ksXrjqLtIwuq+97IroGTaLS5H6JZH9b/Eq2qDgwzRXbXHfG5ohRXE8xiOb18qIgplwxA plXA== X-Forwarded-Encrypted: i=1; AJvYcCXl1hcaGboAe57Ooz5lVhUa+ZB7yRpldjCi5PIVXL2VWnt2bo67b22uFYh1LTy7I2Cskm/VyH+zEoWh@nongnu.org X-Gm-Message-State: AOJu0Yy2FEEX7626Ss+d8fqTWw/humOGFPFkEvHnEcuLxBguf1W+0xiU o659QXeIYUhw3cml8x67JCBpsPg7R00Dm9h5KqOB3Pqy+q883fq8u4TdNilZSksj/T0grJj0Vpc bl+O4 X-Gm-Gg: AY/fxX6OwfisB4T/wYxAP7F9iMxg70OoWJGpDDgl4q64RBLtj2OYBnRvL+JqPzS6nhk cnUO8m2EHwBf932hG5Il6CjPE055WDJjk9c/ePvYcJ1EmQvsC+rBM8/T3mAtLnHZY3u5IniTRUe 89kE/YPMjsaOC/TcdjJCWy+Vd8vEgq9T3ZuFdN7BfoQkcWgphzNkJNMy1z2qPsx9QGAkwX3Bhvl 7kM4lFq1HKb5b/B05c49la3YVQOTOAUgWx8Xa1g9PSyCopDfCnNYnPHGIZ9Eg7W74AlyPObygl6 0leR+HInZq26cJ5nXCUsCr962UNBW1psFGd3FJEJ73VUJd0Ywpk3r9toCyqT62561Uun5ZqFB28 7twtrbx3pO04MJNl0BMqrM+BaIwDbgk548QPOnVanLb/Kvr7lQVP31HCF6wTH3sWUM8lpQaAxTa sfBikrCM6TrEJz7A2l X-Google-Smtp-Source: AGHT+IGtVjchF08HaTnFV0xRV/UeOIwfw3gpot5GT5ocYup5d0UFslziKABN+CtH/NDpZ/RxVVqQZQ== X-Received: by 2002:a05:6000:220b:b0:42f:9ff2:9086 with SMTP id ffacd0b85a97d-42fa3b0674dmr3572827f8f.48.1765391829480; Wed, 10 Dec 2025 10:37:09 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 5/7] hw/arm/omap1: Remove omap_badwidth_read* calls Date: Wed, 10 Dec 2025 18:36:58 +0000 Message-ID: <20251210183700.3446237-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391918295158500 Content-Type: text/plain; charset="utf-8" The omap_badwidth_read* and omap_badwidth_write* functions are used by various OMAP devices when the guest makes an access to registers with an invalid width; they do two things: - log a GUEST_ERROR for the access - call cpu_physical_memory_read() or cpu_physical_memory_write() with the offset they are passed in The first of these produces an unhelpful log message because the function name that is printed is that of the omap-badwidth_* function, not that of the read or write function of the device that called it; this means you can't tell what device is involved. The second is wrong because the offset is an offset into the device but we use it as an absolute physical address, so we will access whatever is at low memory. That happens to be the boot ROM, so we will ignore a write and return random garbage on a read. This bug has been present since 2011, when we did the conversions to the MemoryRegion APIs, which involved changing all devices from working with absolute physical addresses to working with offsets within their MemoryRegions. We must have missed updating these functions. Replace the uses of the omap_badwidth_read* functions in omap1.c with an open-coded call to qemu_log_mask() and RAZ/WI behaviour. We do just the reads here because there are a lot of callsites in omap1.c; the writes will be done in the next commit. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/omap1.c | 80 +++++++++++++++++++++++++++++++++++++------------- 1 file changed, 60 insertions(+), 20 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index 74458fb7c69..a187672897e 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -208,7 +208,9 @@ static uint64_t omap_mpu_timer_read(void *opaque, hwadd= r addr, struct omap_mpu_timer_s *s =3D opaque; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -314,7 +316,9 @@ static uint64_t omap_wd_timer_read(void *opaque, hwaddr= addr, struct omap_watchdog_timer_s *s =3D opaque; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -438,7 +442,9 @@ static uint64_t omap_os_timer_read(void *opaque, hwaddr= addr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -539,7 +545,9 @@ static uint64_t omap_ulpd_pm_read(void *opaque, hwaddr = addr, uint16_t ret; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -771,7 +779,9 @@ static uint64_t omap_pin_cfg_read(void *opaque, hwaddr = addr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -994,7 +1004,9 @@ static uint64_t omap_id_read(void *opaque, hwaddr addr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1076,7 +1088,9 @@ static uint64_t omap_mpui_read(void *opaque, hwaddr a= ddr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1174,7 +1188,9 @@ static uint64_t omap_tipb_bridge_read(void *opaque, h= waddr addr, struct omap_tipb_bridge_s *s =3D opaque; =20 if (size < 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1276,7 +1292,9 @@ static uint64_t omap_tcmi_read(void *opaque, hwaddr a= ddr, uint32_t ret; =20 if (size !=3D 4) { - return omap_badwidth_read32(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1390,7 +1408,9 @@ static uint64_t omap_dpll_read(void *opaque, hwaddr a= ddr, struct dpll_ctl_s *s =3D opaque; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 if (addr =3D=3D 0x00) /* CTL_REG */ @@ -1470,7 +1490,9 @@ static uint64_t omap_clkm_read(void *opaque, hwaddr a= ddr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1763,7 +1785,9 @@ static uint64_t omap_clkdsp_read(void *opaque, hwaddr= addr, CPUState *cpu =3D CPU(s->cpu); =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (addr) { @@ -1955,7 +1979,9 @@ static uint64_t omap_mpuio_read(void *opaque, hwaddr = addr, uint16_t ret; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -2205,7 +2231,9 @@ static uint64_t omap_uwire_read(void *opaque, hwaddr = addr, unsigned size) int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -2346,7 +2374,9 @@ static uint64_t omap_pwl_read(void *opaque, hwaddr ad= dr, unsigned size) int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - return omap_badwidth_read8(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -2439,7 +2469,9 @@ static uint64_t omap_pwt_read(void *opaque, hwaddr ad= dr, unsigned size) int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - return omap_badwidth_read8(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -2573,7 +2605,9 @@ static uint64_t omap_rtc_read(void *opaque, hwaddr ad= dr, unsigned size) uint8_t i; =20 if (size !=3D 1) { - return omap_badwidth_read8(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -3117,7 +3151,9 @@ static uint64_t omap_mcbsp_read(void *opaque, hwaddr = addr, uint16_t ret; =20 if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -3546,7 +3582,9 @@ static uint64_t omap_lpg_read(void *opaque, hwaddr ad= dr, unsigned size) int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - return omap_badwidth_read8(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 switch (offset) { @@ -3627,7 +3665,9 @@ static uint64_t omap_mpui_io_read(void *opaque, hwadd= r addr, unsigned size) { if (size !=3D 2) { - return omap_badwidth_read16(opaque, addr); + qemu_log_mask(LOG_GUEST_ERROR, "%s: read at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); + return 0; } =20 if (addr =3D=3D OMAP_MPUI_BASE) /* CMR */ --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391979; cv=none; d=zohomail.com; s=zohoarc; b=Nzf7T3kwdGaWTS/F9bV17z0/UB9DEkfSpl5yyDuOVfLkjwVrp/Yeo1J6X5vOEwhU6frSr0vQM9qgCrafJwwwUjk+Hotzz7JhZAeGXUqW+K3egWHPGkAFtuM+YuPwVnOkHH/g4oovWSlR2G4vb9zEdB71YyNqgv5j9GCpRBYDWpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391979; h=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=CBYAOqR6DQdV0opqI8zQoE/MhBB6IG5uZhpAhusYcwI=; b=nXavTu/e5W7KP5qYC6hT8WtRhrMKfiPOoYrde7yg0LAfvny5/yWvu+8p47LJxrs1eY2INsd1Drmd7RhbjweOU1yH8b4KbPtt7xAreXN562N5Tf+I7eW5N4FcSZbMCadOyB8wZNQUisy5Yecd7aDsM08x/D3INJ+IASVl3ZzCRGE= 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 1765391979572239.19347205044755; Wed, 10 Dec 2025 10:39:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3u-00017Y-3p; Wed, 10 Dec 2025 13:37: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 1vTP3q-00014X-SR for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:14 -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 1vTP3o-0002SE-FW for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:14 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-477b1cc8fb4so733545e9.1 for ; Wed, 10 Dec 2025 10:37:12 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391831; x=1765996631; 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=CBYAOqR6DQdV0opqI8zQoE/MhBB6IG5uZhpAhusYcwI=; b=tGxGUXsi26i5/xor4IJMSHcrq4CzKSVr+RhTQVmhibfTTu50f89rJU8578MprhwW80 1n9ucV53LWg09ToiKiX0s9c0iegAAv5QGPNLGpzZqCvTJH2lgc53NSNYx4B6rHbpu/OH F40QGxhriatJj3W8pNUJq+g0L15T4lhkBIm0tdECpMD2Hydufh4SDdKKmYPyX3K/SBV+ qMYD0GFLsmhcyTwNtmzKAUMkvuI0MNz4Nw2kftCA6/TED6tXkGynmioBqZMWScTMRd2N 8hgqlYtVGCL9Cn5236UDg1QhwB00mubZ+mAUUryfNMyfNfXBx97c+S2NfDDrW0RgDLkY CKcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391831; x=1765996631; 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=CBYAOqR6DQdV0opqI8zQoE/MhBB6IG5uZhpAhusYcwI=; b=Xz6XzQaLwH39cjEpS0Xt+lHC9Egpyfan9x3mZT6H77w39+XTksDTbPNn61+OG3oKnq EF/f6+QH7w/FvuPEefNAwXQGi2lRIpPkete1u+gciifqxG8EONgYHjh8FBi/pfv2w9Z6 VsXffMkcpartoKGHADIEes5AUtbejdTgz1ZADFf3WBdSfw1b2muOda9nTaPVfyXWavZk B2sHH6lIgOTx7lOvqaLN1Uv7qhE2DfdJICiHMSWp3yH1+YFZENTh3RiSgcMJ75GFb1qA SWFQtx1bOSOAlDP+gYtkKiqUDf9uB89sOnuaNWA9z5kfRx1n5J56LKcUCeUc2ngoe19f qwhw== X-Forwarded-Encrypted: i=1; AJvYcCVYwjJctWO7B1XOoR6Q5jpYwcH7EvktL5FpRVxVRlloDI7/WDTlQXqNqwiot+JRY0xboHSChm0G32z3@nongnu.org X-Gm-Message-State: AOJu0YznXBkr8QNZloG7PjFoPdogyOMskkpplKqF1O0wHHtQ5WWjG7pN 9m/Hk84xAxaKndSZcVM6eeVyO4q6p9UMmgDZ31hYazQqnT0SVcKAMOs0ORi5ezYmcHapQ2JxrLr rkIwE X-Gm-Gg: ASbGnctK/J715uphmwLrHx4/AmVjjAPueGv6pjw60AFNIw3STlAYurF7m28U6nSH8zd E+sGtUkGKOMLMyG9bzn9DbdbYj8LFmVj0pR9PptoSFseakbD3VLfN+ht2StrAvkK9sANtGaoM4M 6HsACiO6U7yFFjNIK3c0Zx7U+1brEhl2xmkcLMzOvajbN/LPow1tcp/iXlanp0/IkILGLwfcCJi sGWJI/XMXE92225qYGm9/mBthb2q4JCyYwemxsGYAgul1Kfd6VVCXQVyn1x8do7iWbMRSes3ZAF 3FpcB0AOGghPWM0zYFzZsLjav0sTpoc1eCNvBEw4/llAoB24/yhZrBI7w0RZc5a58+o8C+b9az+ r21i17IxZ+nlFut96r9uuvTaCyivD/jtVe29rYvupuKGmKBTOS8kHSsQzYN32CN+CxYNvjIIgCY WxTMbb/jP4XMzn9Plr X-Google-Smtp-Source: AGHT+IGiNXYDZ4E5NusjbQ22dbl3SmP45MUzcyrZ/T4S8IOo6muLNwTZwxq5yX/EVYMFT3rYYgAdww== X-Received: by 2002:a05:600c:8210:b0:479:2651:3f9c with SMTP id 5b1f17b1804b1-47a8377e72fmr34196405e9.14.1765391830632; Wed, 10 Dec 2025 10:37:10 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 6/7] hw/arm/omap1: Remove omap_badwidth_write* calls Date: Wed, 10 Dec 2025 18:36:59 +0000 Message-ID: <20251210183700.3446237-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 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=peter.maydell@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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391980467158500 Content-Type: text/plain; charset="utf-8" Complete the conversion started in the previous commit by changing all the omap_badwidth_write* calls to open-coded log-and-ignore behaviour. We can delete a FIXME comment about an infinite loop, because that only looped infinitely back before 2011 when the device was still using absolute physical addresses. Now that we are simply logging the error we can clearly see that there's no loop. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/omap1.c | 64 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index a187672897e..cfa4e1f677c 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -234,7 +234,8 @@ static void omap_mpu_timer_write(void *opaque, hwaddr a= ddr, struct omap_mpu_timer_s *s =3D opaque; =20 if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -343,7 +344,8 @@ static void omap_wd_timer_write(void *opaque, hwaddr ad= dr, struct omap_watchdog_timer_s *s =3D opaque; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -471,7 +473,8 @@ static void omap_os_timer_write(void *opaque, hwaddr ad= dr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -618,7 +621,8 @@ static void omap_ulpd_pm_write(void *opaque, hwaddr add= r, uint16_t diff; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -893,7 +897,8 @@ static void omap_pin_cfg_write(void *opaque, hwaddr add= r, uint32_t diff; =20 if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1051,7 +1056,8 @@ static void omap_id_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1123,7 +1129,8 @@ static void omap_mpui_write(void *opaque, hwaddr addr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1220,7 +1227,8 @@ static void omap_tipb_bridge_write(void *opaque, hwad= dr addr, struct omap_tipb_bridge_s *s =3D opaque; =20 if (size < 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1331,7 +1339,8 @@ static void omap_tcmi_write(void *opaque, hwaddr addr, struct omap_mpu_state_s *s =3D opaque; =20 if (size !=3D 4) { - omap_badwidth_write32(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1429,7 +1438,8 @@ static void omap_dpll_write(void *opaque, hwaddr addr, int div, mult; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1702,7 +1712,8 @@ static void omap_clkm_write(void *opaque, hwaddr addr, }; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -1832,7 +1843,8 @@ static void omap_clkdsp_write(void *opaque, hwaddr ad= dr, uint16_t diff; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -2042,7 +2054,8 @@ static void omap_mpuio_write(void *opaque, hwaddr add= r, int ln; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -2267,7 +2280,8 @@ static void omap_uwire_write(void *opaque, hwaddr add= r, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 2) { - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -2396,7 +2410,8 @@ static void omap_pwl_write(void *opaque, hwaddr addr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - omap_badwidth_write8(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -2493,7 +2508,8 @@ static void omap_pwt_write(void *opaque, hwaddr addr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - omap_badwidth_write8(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -2690,7 +2706,8 @@ static void omap_rtc_write(void *opaque, hwaddr addr, time_t ti[2]; =20 if (size !=3D 1) { - omap_badwidth_write8(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -3418,7 +3435,8 @@ static void omap_mcbsp_writew(void *opaque, hwaddr ad= dr, return; } =20 - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, 4); } =20 static void omap_mcbsp_write(void *opaque, hwaddr addr, @@ -3432,7 +3450,8 @@ static void omap_mcbsp_write(void *opaque, hwaddr add= r, omap_mcbsp_writew(opaque, addr, value); break; default: - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); } } =20 @@ -3606,7 +3625,8 @@ static void omap_lpg_write(void *opaque, hwaddr addr, int offset =3D addr & OMAP_MPUI_REG_MASK; =20 if (size !=3D 1) { - omap_badwidth_write8(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PR= Ix + " with bad width %d\n", __func__, addr, size); return; } =20 @@ -3680,8 +3700,8 @@ static uint64_t omap_mpui_io_read(void *opaque, hwadd= r addr, static void omap_mpui_io_write(void *opaque, hwaddr addr, uint64_t value, unsigned size) { - /* FIXME: infinite loop */ - omap_badwidth_write16(opaque, addr, value); + qemu_log_mask(LOG_GUEST_ERROR, "%s: write at offset 0x%" HWADDR_PRIx + " with bad width %d\n", __func__, addr, size); } =20 static const MemoryRegionOps omap_mpui_io_ops =3D { --=20 2.43.0 From nobody Mon Feb 9 06:58: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=1765391920; cv=none; d=zohomail.com; s=zohoarc; b=EXtUy3DKYkAEprzGQU6dXO2eB4KCAoeNnUAPtf/ZVLvn1rWoRmIcg92ZYzxjHu4gE51H4zbo0HIgcWJPLaquS4mfk+OpDpLiNMK8Q39GPO3QyOo7nlv3hVJwERRtPchKUq1fWNbzSwIIfRC22q63osDxprCfSnQ3M+szkvrhcjY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765391920; h=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=rmuruirWl2Hf5ekYVz4hPWVOUqfIMTyLIVh2I054+1w=; b=FaILVFTVg/07UxPjgDCnfnX6Xl9OlCIAhc+qbc9J9O5crYKHWYtrNDx9CKLARkQMS8PvJqgW3WvnreFAoAN+O56Hotl9Rsx9SlXUc2iXAMjvWqSrcv0ZWyIRbUy3Oksl2+Qpx4ivpoWa+/uCikk7F9wwLinocpn0F3SEenQn0FI= 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 1765391920640124.1777324758176; Wed, 10 Dec 2025 10:38:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vTP3u-00017c-N1; Wed, 10 Dec 2025 13:37: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 1vTP3r-00015Z-B9 for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:15 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vTP3p-0002Sn-FK for qemu-devel@nongnu.org; Wed, 10 Dec 2025 13:37:14 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-42e2d5e119fso18323f8f.2 for ; Wed, 10 Dec 2025 10:37:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fa8a7044csm477702f8f.15.2025.12.10.10.37.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 10:37:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1765391832; x=1765996632; 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=rmuruirWl2Hf5ekYVz4hPWVOUqfIMTyLIVh2I054+1w=; b=lPf1ng1m+syMAWv97M961lmlISdr0FiIEk0KTMWAzZTDmT4/2GVlGauTE+IcI8mfkf ttDFhpju8A8nWM0BbeqooV2RSL87OlQ640hGgDKLu4xmp5Z1NbTIHpU+SZ3uvU2bBiKI ZBOl+nVn+NuSw4aY+SgYg/Zpk4fPu/drEEU08AtVMerHCBDjDZaKYCOLeKuEN5iQt18C qp9EcE4mWaVAVMcPPhf+6P3Gj6fUr+EEqYLMZXRnxRQYsrkmrmUtJZ/9IqCndL9ICN0K Y4Y4nEmZdK779+8YhkYwDrg6uUYrd+hRlj7Qy76HbegQUV3/odckKa8GDi39MksDIrmY cj0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765391832; x=1765996632; 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=rmuruirWl2Hf5ekYVz4hPWVOUqfIMTyLIVh2I054+1w=; b=Z/1m1sRJcv33gdrWWnJveoGhjCVVmcQFwJuEdNyAnRczv+TiS/sfLSJ+wc6HiROTZ7 MssqIP0xhxRGYnFQeZhZp5abFWtJmuv5/XkWWoI/Vr1XgUkaFemERyavVMFK4ifkcJFP xx8e/AyBU+/WE+rmiPSJxrfUZ1kHMYlhxvaDusglTApoeqN0LoGDwHghhRcA6Lk09jkm kpaH+3GHQwuAR7WYkym23DRpdSZM4Mmbjd3X6QmjOLwT0yWPty6uDzyYosSc+co0GMLa pTLBGGFMz0IBNJkAXEsye0WIfC++P4fdjx/VMiJOug2GQpkhVOCs6E7KHPkbcQH0gAnk WzCg== X-Forwarded-Encrypted: i=1; AJvYcCVlw7qxJPd1S1QDv4cKGUqER1G15szphOUUsPU/KYhDdpgvg8d7x/rY+n5M3QGIOQP3t6zp2v2oyFid@nongnu.org X-Gm-Message-State: AOJu0YzHdmErfWlyCwAZZPZre5fevNN9trTV+4vG7NiCwyLg/VNFjItq SVD2XkfTC7iEoSiT7L49tH3CBlTfUR0PTWPDfolTYnaieofEirFSstLN3d0tzeK1xII= X-Gm-Gg: AY/fxX7fw+wGWKW65MzJRKxAvgPZ0IlZU4WTaTVv/gvm/UDWzifUM/BxJwoQWwXuQdd tde5PFKdUcchnZQXRxhoaBJORdIhPjsfcq+wFGRzkV7kAlQn+dOvtbF6lUbL711m7gCqbU9xt2O m5WNNf3HqBAmvojA2LL/NgTdTYo/KPFIYfF3f/rND3u17e+jk41Wpmdso8CZRHm7rHGyLlopAK8 3Rm9nS6Beuljbzvajs+B69tjst4AKRt8shDjIHf98yo3fg5UGSfw+AfBJIgMTZDapEYX5s0LWq2 yapouLrso81WwlehEvwL2d576dUORVg+Mkt42NAVGtgXyeSPeDbpR5sZRwZ0K0HjfCjiW2L42Ab oHGWiaJ1ywCbtOW54CQ6Pb/GZMwjqi4MD6Eis0RVVgo08kJqHVLbZx2SmHKlHShNsF5Sy4JQebc Wuh8xhskvNf1D/DJDM X-Google-Smtp-Source: AGHT+IH1iyn5x17R9K9rC7H+NaITv97PoyAn08Em0f2NKaqGMEXqVLZSE34ATuLzYc85qXZ4UwQfig== X-Received: by 2002:a05:6000:2509:b0:42b:3131:5433 with SMTP id ffacd0b85a97d-42fa3ada434mr3916195f8f.26.1765391831880; Wed, 10 Dec 2025 10:37:11 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-11.0 7/7] hw/arm/omap1: Remove omap_badwidth_* implementations Date: Wed, 10 Dec 2025 18:37:00 +0000 Message-ID: <20251210183700.3446237-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251210183700.3446237-1-peter.maydell@linaro.org> References: <20251210183700.3446237-1-peter.maydell@linaro.org> MIME-Version: 1.0 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::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1765391922246158500 Content-Type: text/plain; charset="utf-8" Now there are no callsites for the omap_badwidth_* family of functions we can remove their implementations. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/arm/omap.h | 10 -------- hw/arm/omap1.c | 59 ------------------------------------------- 2 files changed, 69 deletions(-) diff --git a/include/hw/arm/omap.h b/include/hw/arm/omap.h index bdb2e887e47..66a435a3d72 100644 --- a/include/hw/arm/omap.h +++ b/include/hw/arm/omap.h @@ -673,16 +673,6 @@ struct omap_mpu_state_s { struct omap_mpu_state_s *omap310_mpu_init(MemoryRegion *sdram, const char *core); =20 -uint32_t omap_badwidth_read8(void *opaque, hwaddr addr); -void omap_badwidth_write8(void *opaque, hwaddr addr, - uint32_t value); -uint32_t omap_badwidth_read16(void *opaque, hwaddr addr); -void omap_badwidth_write16(void *opaque, hwaddr addr, - uint32_t value); -uint32_t omap_badwidth_read32(void *opaque, hwaddr addr); -void omap_badwidth_write32(void *opaque, hwaddr addr, - uint32_t value); - void omap_mpu_wakeup(void *opaque, int irq, int req); =20 #define OMAP_BAD_REG(paddr) \ diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c index cfa4e1f677c..8fa4195a5fa 100644 --- a/hw/arm/omap1.c +++ b/hw/arm/omap1.c @@ -44,65 +44,6 @@ #include "target/arm/cpu-qom.h" #include "trace.h" =20 -static inline void omap_log_badwidth(const char *funcname, hwaddr addr, in= t sz) -{ - qemu_log_mask(LOG_GUEST_ERROR, "%s: %d-bit register %#08" HWADDR_PRIx = "\n", - funcname, 8 * sz, addr); -} - -/* Should signal the TCMI/GPMC */ -uint32_t omap_badwidth_read8(void *opaque, hwaddr addr) -{ - uint8_t ret; - - omap_log_badwidth(__func__, addr, 1); - cpu_physical_memory_read(addr, &ret, 1); - return ret; -} - -void omap_badwidth_write8(void *opaque, hwaddr addr, - uint32_t value) -{ - uint8_t val8 =3D value; - - omap_log_badwidth(__func__, addr, 1); - cpu_physical_memory_write(addr, &val8, 1); -} - -uint32_t omap_badwidth_read16(void *opaque, hwaddr addr) -{ - uint16_t ret; - - omap_log_badwidth(__func__, addr, 2); - cpu_physical_memory_read(addr, &ret, 2); - return ret; -} - -void omap_badwidth_write16(void *opaque, hwaddr addr, - uint32_t value) -{ - uint16_t val16 =3D value; - - omap_log_badwidth(__func__, addr, 2); - cpu_physical_memory_write(addr, &val16, 2); -} - -uint32_t omap_badwidth_read32(void *opaque, hwaddr addr) -{ - uint32_t ret; - - omap_log_badwidth(__func__, addr, 4); - cpu_physical_memory_read(addr, &ret, 4); - return ret; -} - -void omap_badwidth_write32(void *opaque, hwaddr addr, - uint32_t value) -{ - omap_log_badwidth(__func__, addr, 4); - cpu_physical_memory_write(addr, &value, 4); -} - /* MPU OS timers */ struct omap_mpu_timer_s { MemoryRegion iomem; --=20 2.43.0