From patchwork Mon Mar 31 23:04:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 877336 Delivered-To: patch@linaro.org Received: by 2002:a5d:6dae:0:b0:38f:210b:807b with SMTP id u14csp1987737wrs; Mon, 31 Mar 2025 16:05:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIDkDhfRuwm3z5Jj6IgPsziEE2kOmQ2Y/580e1ovUeVIkT9gQrOKglkg+tja6HgdePb1WT4g==@linaro.org X-Google-Smtp-Source: AGHT+IGikhoAl2kTBYGX8cedMrB4xlRnBr9KoRsFnBZLv1v97LuQCF9CX7ILMoRb8UYms19JvIDT X-Received: by 2002:a05:620a:4152:b0:7c5:53ab:a74c with SMTP id af79cd13be357-7c6862ebd01mr1448543585a.10.1743462346098; Mon, 31 Mar 2025 16:05:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1743462346; cv=none; d=google.com; s=arc-20240605; b=HsHa+SmJZa6UbpXclJk/v27CZU8//ZmakO4cP5aNobiYQeCFHB9/OFEai1MxmAqgc5 uScIhTtDVxvEQ+xS+lOrzWu/AY8HWawinfk2Lx14rTo+GKmXJdf5x+ZOuaf121c+EH4T QLsmABfyNlBEdIM5GaWGMrFIwcRi2gCtF3rmbprtfc6W6pTTTqCgG/fpGavqbxbNJT8j 7H3WBoEFHfQOkc9xXkIxQ2jyo1DmO4AZiiNcyxbWUhfGamctQaccrGo5NVPBEves+xHB ged0vGk+B/e4UsU+nCaUKoNZKbDpAk5DRGiqelMW6lFiFf9gep3euxtExrYDuTorBJ9Z o2pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YlaEyhXAp6ocXg8HeW9O6/zASqUSt0dLhdV4fK8vO5o=; fh=V8dBZo/pKotciLd1l91bWiyDHbNrUdpmdA2WAWExemk=; b=FfayKyErYFU9WKQKSxwDZ5QJheyrZ1V3kxfP1ushT3fO2VS8byrvBEqEz3RWK1DvE+ Du2NqSksHg9/7M+WUpigsb1fzSfDAKjRtV/PWJbRiqhntjQO7s8u5yT3RhE8P9mUZLyP Rsa3Gm6SJYWOOZstno6g18Hm0aYusESaWhh019bxmQv3RiGuZrH6DcLRNcqA9BGxr4Rs PVeiNvwiKrrVEqcZrac92BCSomJO2kChusD+BWiyQ2VHN3PxfkajvbTu7dB/RnIeC8QI qiyjXm4Cq3A/dn6oLcsgDptvB+x02C+PivG6T48b0yyMf6ooQtwjkbpQQy3aH4p8npfw ZMeA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C8pT92wb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7c5f7681fcbsi782828385a.16.2025.03.31.16.05.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Mar 2025 16:05:46 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C8pT92wb; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tzOBi-0006pn-6g; Mon, 31 Mar 2025 19:05:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tzOBh-0006pD-Ca for qemu-devel@nongnu.org; Mon, 31 Mar 2025 19:05:01 -0400 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 1tzOBf-0005m4-HN for qemu-devel@nongnu.org; Mon, 31 Mar 2025 19:05:01 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-39c13fa05ebso923076f8f.0 for ; Mon, 31 Mar 2025 16:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1743462298; x=1744067098; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YlaEyhXAp6ocXg8HeW9O6/zASqUSt0dLhdV4fK8vO5o=; b=C8pT92wb0FbRLoZD05rAyMUuPZU+OvOpWqBa7MhNug4tr2LFb56MmepYb17293eUOg 7UG45qPUPNKufVBMgTFneG+8n1mJQmFiD9brduhTjtyZWMvxYPfZrjaA46Lc/+YOfmFF GDPfpdYdl1jzpokQfaS9PQHuwMPWcrZ5Y1W8GAPTixZVqDrPWyjBLIQXDpefg7VFoDdx qK49geabIZiA2FuPzWNsNRUuSaiJYcHx9NjyRVLDcS0dpLnhQ03XF5xWdiNXmYiKnKT9 3tPACA76V9vwflyIKsykY5ZyxYJo/qnroDwvuy3SdBamb8EOVicWPjHs5sStWSGSSNq3 3eqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743462298; x=1744067098; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YlaEyhXAp6ocXg8HeW9O6/zASqUSt0dLhdV4fK8vO5o=; b=vQmo8nAgJQiqaH7CsMGhFfhisnPAxFt49xEa0gWfpAJPmh+eZHcYfvtJGsXsl87hOp iTlyzyjzecKLm+6zZoE7h//P4XiG9crav77NvKTQj+st68tBpgnfzjs/5r9DXwnmV/md 1eepxOh+jPAzOy2ZbfWlmqygD/0snNVOqf+HrvsMhfplq+1RzQcYI/H3SaT3fF5qvr2s QVgBCmHtLeyISMSTcYzOxICV9tcquoEMgrZqN0p279gUZyQ9fY+XJ7eiADXssFv8z6fV iTVxpr9SZ5FHdGsoGP45mXraUCzaP6laJs6FdUuH9STE/5fXEKD/ioaQj5rukwr9YTzE CnRw== X-Gm-Message-State: AOJu0Yz5Ez/I2szd+HRirnu3Gw1/nHFk2WSguMJyEtVoLgM0NUILkj/s XVy9anH1W3SciNqGLhvxjcWaj/bfe/3esRMWLFf6jnYQNFAosxgX2T9Nshtl8zHnGzoO1sBjWit 0 X-Gm-Gg: ASbGncshAbJfRevHcflulLOtHnJpEzZZPJB/0Bt0CRsiyjDEMKWm8gKGpPtC1O8CB6+ Ui4l+SfTqJnvsRn23uDczUjpJ+zoSqDetrQyQfCk+uVmumEnGLQOP67DXxruS8/x2KT3dVX7UCq lFbZrxj1bHEf5Bn0cP0U5kY33iZWIiHQ/u5V2g8IAr965pWrMnfTTrlGnpTWYv8pUHUZkd+zwyR pI4u7PY7n1ev3p/6v74clneqSyzQodiAwRISq2Rm2b9AZ9dRmeItd8YZ8sDaOxJJhehEabVGL+l 0jT8+a0gMuWj/XJtlJFV65bHuQHjZ8S1M7gvUZxTXzic+lQgX215W+VFVd3MtRT9v0RPMqPPMpH ooO7Uz1pCNBn+egqUzxl2mijUtfbTwg== X-Received: by 2002:a5d:6d8d:0:b0:39a:ca04:3dff with SMTP id ffacd0b85a97d-39c1211805dmr7884916f8f.40.1743462297814; Mon, 31 Mar 2025 16:04:57 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b79e0afsm12611613f8f.65.2025.03.31.16.04.55 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 31 Mar 2025 16:04:57 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Steven Lee , Peter Maydell , Jamin Lin , Troy Lee , Joel Stanley , =?utf-8?q?C=C3=A9dric_Le_Goater?= , qemu-arm@nongnu.org, Andrew Jeffery , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Subject: [PATCH-for-10.0 2/2] hw/misc/aspeed_scu: Correct minimum access size for AST2500 / AST2600 Date: Tue, 1 Apr 2025 01:04:44 +0200 Message-ID: <20250331230444.88295-3-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250331230444.88295-1-philmd@linaro.org> References: <20250331230444.88295-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=philmd@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Joel Stanley Guest code was performing a byte load to the SCU MMIO region, leading to the guest code crashing (it should be using proper accessors, but that is not Qemu's bug). Hardware and the documentation[1] both agree that byte loads are okay, so change all of the aspeed SCU devices to accept a minimum access size of 1. [1] See the 'ARM Address Space Mapping' table in the ASPEED docs. This is section 6.1 in the ast2400 and ast2700, and 7.1 in the ast2500 and ast2600 datasheets. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2636 Signed-off-by: Joel Stanley Reviewed-by: Troy Lee Message-ID: <20241118021820.4928-1-joel@jms.id.au> [PMD: Rebased, only including SCU changes] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Andrew Jeffery --- hw/misc/aspeed_scu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/misc/aspeed_scu.c b/hw/misc/aspeed_scu.c index 6703f3f9691..1af1a35a081 100644 --- a/hw/misc/aspeed_scu.c +++ b/hw/misc/aspeed_scu.c @@ -443,7 +443,7 @@ static const MemoryRegionOps aspeed_ast2500_scu_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .impl.min_access_size = 4, .impl.max_access_size = 4, - .valid.min_access_size = 4, + .valid.min_access_size = 1, .valid.max_access_size = 4, .valid.unaligned = false, }; @@ -787,7 +787,7 @@ static const MemoryRegionOps aspeed_ast2600_scu_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .impl.min_access_size = 4, .impl.max_access_size = 4, - .valid.min_access_size = 4, + .valid.min_access_size = 1, .valid.max_access_size = 4, .valid.unaligned = false, };