From nobody Mon Feb 9 06:07:51 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) client-ip=209.85.128.67; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-f67.google.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1601662236; cv=none; d=zohomail.com; s=zohoarc; b=HGmHYbmPKqDsvFuzkDd/eS+0vk9tWX/7bXMLpmDxEd+487ojIgJgmeK5NF23rQj6Oeir/TvXu/Fjz+s3NtDN5f+YijVj2h0uCdn5PxiEjdGN4o+M6ibKZBCaAPJmYGQQ0uqgvPEK4F3k/4cTh0U94t2HUTbcrU0RjdgzYtHY4SA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601662236; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Sender:Subject:To; bh=oTau936JDmi68zMscEvO3SnFMJ5UWYiOUeAh8uEyVYs=; b=J1kcjlsyKBXLC+jaSyGEf+n0G4/qDoSm+2tnL1xWiW7Ls1x8jtfFROcy5sYS1RINd1zTkbQRaIaq/TsCXoDU9UsyvVfNedLYtnGfA15RVFLEUB5xykx6Nvy9Hdu3JEFhrJ+tIa/SyMyXtKuFbG3DVVSTAp+4ubT9MnxLkwEqCjQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of _spf.google.com designates 209.85.128.67 as permitted sender) smtp.mailfrom=philippe.mathieu.daude@gmail.com; dmarc=fail header.from= (p=none dis=none) header.from= Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by mx.zohomail.com with SMTPS id 1601662236769880.4363809575624; Fri, 2 Oct 2020 11:10:36 -0700 (PDT) Received: by mail-wm1-f67.google.com with SMTP id s13so2517587wmh.4 for ; Fri, 02 Oct 2020 11:10:36 -0700 (PDT) Return-Path: Return-Path: Received: from localhost.localdomain (74.red-83-53-161.dynamicip.rima-tde.net. [83.53.161.74]) by smtp.gmail.com with ESMTPSA id b8sm2615170wmb.4.2020.10.02.11.10.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Oct 2020 11:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oTau936JDmi68zMscEvO3SnFMJ5UWYiOUeAh8uEyVYs=; b=JrWnoIFISmwb7byO4ARGM8f4MeKI/bMTCRH6oDGM9X7j8J0h8nCLCHVlQB51/dwAwT HnF1YFhh6p9skliv8MgMQOaDNmp8haw3rGwAhXDQsCoeepYEQXebXIAO9sMzuyGduDqG hGHkIJ2UYu76EhCLhYpnEdB49RsUyEKrT2p3ksHxROU9EUPmNmBskTdiPpRK0JduYim1 0cxp0taVH/KVeCn9p5LtTTNfCzjQw7daC5ssjEbCweDtYvRo/pqP81PFBlAVqUFlf6Wx fXvHnA5JdlEBydsQO/L5Zc2A90mdpS8v7y8iqB2ig+w58b7vWrO6yGOhnpxtCOXStrpM prJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=oTau936JDmi68zMscEvO3SnFMJ5UWYiOUeAh8uEyVYs=; b=H/7QDGHPUH/8JTGqHVK8GAHT0A0FzPWKSDntapXR/QOjYnQ7/9BlRDvZvPiZZhf38w nC9kWCWn1cRsCcqQ+6Ten26ijSfIlazwy7jfyO/ur/Sib7QRqPb18HfatIuGbqUaXIZ9 JdTdK//T4J2EUQPkgVE/8A5/P6LQK9hm692rn5JHT2bhWlYI1eAtZsxWVvswE0MoZDnY J0zC3kxaySs50nG8Qqr1Y4dhnPFTZkyMgeUYuz/9Zchos7aSGJlbNZII7xVn06muR47H 6g16oebvIKahkq0Psmx8afWRAEzv9uV2CM/pkHdtKb+Ybz24YOdIC9DiuzAraugn8xW+ MlnA== X-Gm-Message-State: AOAM531pXahdvsy5/0aN4bSXHhg0VuOTzKv85mFwE0YbZdAq16LUJtrC kbbF1GFdV22/vNApkLeBrtQ= X-Google-Smtp-Source: ABdhPJzxBMlMGzn93saWRnAAfEI5nE1abnmEK+XMALF8jrsiz2+sSHOb+dmUkt6T5e+DJFxSg31U6Q== X-Received: by 2002:a05:600c:2906:: with SMTP id i6mr4304400wmd.48.1601662234847; Fri, 02 Oct 2020 11:10:34 -0700 (PDT) Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Paul Zimmerman , Andrew Baumann , "Michael S . Tsirkin" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Luc Michel , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , qemu-arm@nongnu.org Subject: [PATCH] hw/char/bcm2835_aux: Allow less than 32-bit accesses Date: Fri, 2 Oct 2020 20:10:32 +0200 Message-Id: <20201002181032.1899463-1-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) The "BCM2835 ARM Peripherals" datasheet [*] chapter 2 ("Auxiliaries: UART1 & SPI1, SPI2"), list the register sizes as 3/8/16/32 bits. We assume this means this peripheral allows 8-bit accesses. This was not an issue until commit 5d971f9e67 which reverted ("memory: accept mismatching sizes in memory_region_access_valid"). The model is implemented as 32-bit accesses (see commit 97398d900c, all registers are 32-bit) so replace MemoryRegionOps.valid as MemoryRegionOps.impl, and re-introduce MemoryRegionOps.valid with a 8/32-bit range. [*] https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals= .pdf Fixes: 97398d900c ("bcm2835_aux: add emulation of BCM2835 AUX (aka UART1) b= lock") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- Noticed while running Trusted Firmware-A on the raspi3: https://www.mail-archive.com/qemu-devel@nongnu.org/msg680115.html --- hw/char/bcm2835_aux.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/char/bcm2835_aux.c b/hw/char/bcm2835_aux.c index ee3dd40e3c..dade2ab5fd 100644 --- a/hw/char/bcm2835_aux.c +++ b/hw/char/bcm2835_aux.c @@ -249,7 +249,9 @@ static const MemoryRegionOps bcm2835_aux_ops =3D { .read =3D bcm2835_aux_read, .write =3D bcm2835_aux_write, .endianness =3D DEVICE_NATIVE_ENDIAN, - .valid.min_access_size =3D 4, + .impl.min_access_size =3D 4, + .impl.max_access_size =3D 4, + .valid.min_access_size =3D 1, .valid.max_access_size =3D 4, }; =20 --=20 2.26.2