From nobody Wed Apr 16 11:55:14 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail header.i=@wdc.com; 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=fail(p=none dis=none) header.from=wdc.com ARC-Seal: i=1; a=rsa-sha256; t=1599762172; cv=none; d=zohomail.com; s=zohoarc; b=QWfrlYti7bP34CSGXIMbNvKgUNo/6nF+JsrjjqhY7GWc4kS/Who8aXZEkphS0VcjjUcGpLaBrswSErIeQMJG5bG4V3n/H6r381wp09HAIiUaijZVJsJXmKEjmsVMOH4sRpkbP+q4oIUQC9JLYHnRhI+ErZS46TzyQHx2YmD2eTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1599762172; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fCMIaz73KOPUOsUfn8f+bREvB+VmMpErFhkgpcJqXwc=; b=YBXtk//XdV6qa6Dsf++PB9Sxb0ZV0LeQfPMvWNw6JYR41N5Q4ntfMAodshC9lHriR/BGFb/8qZ8cxpVpTbq2uh/+WsMCOJpK0q6MCXNyqTzM7jHJyUIrG1OR5ClZ6Tz8ZEsN4hzYclRFEyNEpeZTMoE/tT+Z2AFuPbBoNWufI38= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail header.i=@wdc.com; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15997621723001012.3907313211988; Thu, 10 Sep 2020 11:22:52 -0700 (PDT) Received: from localhost ([::1]:57282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGRDe-00073U-SU for importer@patchew.org; Thu, 10 Sep 2020 14:22:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56998) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGRBK-0003ed-Ak; Thu, 10 Sep 2020 14:20:26 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:28254) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGRBH-0002kZ-R0; Thu, 10 Sep 2020 14:20:25 -0400 Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 11 Sep 2020 02:20:14 +0800 Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2020 11:07:31 -0700 Received: from fwvkpc2.ad.shared (HELO risc6-mainframe.hgst.com) ([10.86.59.152]) by uls-op-cesaip01.wdc.com with ESMTP; 10 Sep 2020 11:20:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1599762023; x=1631298023; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KB3dWLk2WQBSmIbfJFgcXf3TDb7sLydLaxLIXsEB1Bo=; b=dw+MndgCNvEo1cB+1GmVs00HUgFyyv5kc5ijT9NHBc/WWWgediIcv/VE UDxE2GW65rrlantaqxP1MY17NKakbeZ6i8dDxJT8xb7ljiT6JWpKeLRC1 zld2MFVWqhGKVXGiOn3sXmjSxi6w+x3BolZW7ssrCKPPIiJoRFh23jLkW aTsRGvzCkos2SfZu4T9/EsE/Ks2nHsxt9o1OZIZ2iFrOfjbrAgBtX4b1f xteHEK1S2/csELkt+aZqNMsOkksjug+GByulKT0O42bRsSml0Ty7RAIQe UTLnfJtQIsqreYQMq1Rc98wUJzYT9oc0dXt2xsNJfOFSX0z0EgmnyxZXm Q==; IronPort-SDR: BqeGeAppZrm0Dr2Ig0RYZT6wyz4WUk4VCbdgAS6v75wDfo+ftvSWty1//OHz6TmVi5DgvCkgO7 YNjrkeuYYcUS3zH1RV6RXnspZw2F0UU8hiCMg9xzuSk38RL49ch3nC5DCELtjXOzUeAQ34gBBA w92IXjDQscWoCg51X/eL2bLtOYJi5QKXXU5c+wUWUZFxTdNLICvucAK3GXo5vfeqrLIDmKfoTR m1EmQ5ByDG2rG9R4ebfxSN5LcKJPK9JMbwS1KLQTmMbZgnKazK0JAF5/yNjiC1J8NOO/3VUeHT Soo= X-IronPort-AV: E=Sophos;i="5.76,413,1592841600"; d="scan'208";a="146979204" IronPort-SDR: c0ADv9N1XqY5NRYGiQEQbjsC04XV0GwK2zMKQbLPwRdBizLjeNZk3PsBERh8JNk5cBEUaylxjK zTncfUcSW6uQ== IronPort-SDR: jpES+eWP0NDgFF7j+sACicub7+b+v1O+hfee4qgfvwLUnpAQSgfPdk+ZHXip4YsuKY/VKdJsVX ZTNAa4L4L8Dw== WDCIronportException: Internal From: Alistair Francis To: peter.maydell@linaro.org, qemu-devel@nongnu.org Subject: [PULL 02/30] riscv: sifive_test: Allow 16-bit writes to memory region Date: Thu, 10 Sep 2020 11:09:10 -0700 Message-Id: <20200910180938.584205-3-alistair.francis@wdc.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200910180938.584205-1-alistair.francis@wdc.com> References: <20200910180938.584205-1-alistair.francis@wdc.com> 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=216.71.154.42; envelope-from=prvs=515d47f05=alistair.francis@wdc.com; helo=esa4.hgst.iphmx.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/10 14:20:04 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_MED=-2.3, SPF_HELO_PASS=-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, Nathan Chancellor , Alistair Francis , qemu-stable@nongnu.org, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Nathan Chancellor When shutting down the machine running a mainline Linux kernel, the following error happens: $ build/riscv64-softmmu/qemu-system-riscv64 -bios default -M virt \ -display none -initrd rootfs.cpio -kernel Image -m 512m \ -nodefaults -serial mon:stdio ... Requesting system poweroff [ 4.999630] reboot: Power down sbi_trap_error: hart0: trap handler failed (error -2) sbi_trap_error: hart0: mcause=3D0x0000000000000007 mtval=3D0x00000000001000= 00 sbi_trap_error: hart0: mepc=3D0x000000008000d4cc mstatus=3D0x00000000000018= 22 sbi_trap_error: hart0: ra=3D0x000000008000999e sp=3D0x0000000080015c78 sbi_trap_error: hart0: gp=3D0xffffffe000e76610 tp=3D0xffffffe0081b89c0 sbi_trap_error: hart0: s0=3D0x0000000080015c88 s1=3D0x0000000000000040 sbi_trap_error: hart0: a0=3D0x0000000000000000 a1=3D0x0000000080004024 sbi_trap_error: hart0: a2=3D0x0000000080004024 a3=3D0x0000000080004024 sbi_trap_error: hart0: a4=3D0x0000000000100000 a5=3D0x0000000000005555 sbi_trap_error: hart0: a6=3D0x0000000000004024 a7=3D0x0000000080011158 sbi_trap_error: hart0: s2=3D0x0000000000000000 s3=3D0x0000000080016000 sbi_trap_error: hart0: s4=3D0x0000000000000000 s5=3D0x0000000000000000 sbi_trap_error: hart0: s6=3D0x0000000000000001 s7=3D0x0000000000000000 sbi_trap_error: hart0: s8=3D0x0000000000000000 s9=3D0x0000000000000000 sbi_trap_error: hart0: s10=3D0x0000000000000000 s11=3D0x0000000000000008 sbi_trap_error: hart0: t0=3D0x0000000000000000 t1=3D0x0000000000000000 sbi_trap_error: hart0: t2=3D0x0000000000000000 t3=3D0x0000000000000000 sbi_trap_error: hart0: t4=3D0x0000000000000000 t5=3D0x0000000000000000 sbi_trap_error: hart0: t6=3D0x0000000000000000 The kernel does a 16-bit write when powering off the machine, which was allowed before commit 5d971f9e67 ("memory: Revert "memory: accept mismatching sizes in memory_region_access_valid""). Make min_access_size match reality so that the machine can shut down properly now. Cc: qemu-stable@nongnu.org Fixes: 88a07990fa ("SiFive RISC-V Test Finisher") Fixes: 5d971f9e67 ("memory: Revert "memory: accept mismatching sizes in mem= ory_region_access_valid"") Signed-off-by: Nathan Chancellor Acked-by: Michael S. Tsirkin Reviewed-by: Alistair Francis Message-Id: <20200901055822.2721209-1-natechancellor@gmail.com> Signed-off-by: Alistair Francis --- hw/riscv/sifive_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/riscv/sifive_test.c b/hw/riscv/sifive_test.c index 0c78fb2c93..8c70dd69df 100644 --- a/hw/riscv/sifive_test.c +++ b/hw/riscv/sifive_test.c @@ -59,7 +59,7 @@ static const MemoryRegionOps sifive_test_ops =3D { .write =3D sifive_test_write, .endianness =3D DEVICE_NATIVE_ENDIAN, .valid =3D { - .min_access_size =3D 4, + .min_access_size =3D 2, .max_access_size =3D 4 } }; --=20 2.28.0