Cover Letter Detail
Show a cover letter.
GET /api/covers/2194952/?format=api
{ "id": 2194952, "url": "http://patchwork.ozlabs.org/api/covers/2194952/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/cover/20260210094044.72591-1-ganboing@gmail.com/", "project": { "id": 67, "url": "http://patchwork.ozlabs.org/api/projects/67/?format=api", "name": "OpenSBI development", "link_name": "opensbi", "list_id": "opensbi.lists.infradead.org", "list_email": "opensbi@lists.infradead.org", "web_url": "https://github.com/riscv/opensbi", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "https://github.com/riscv/opensbi/commit/{}" }, "msgid": "<20260210094044.72591-1-ganboing@gmail.com>", "list_archive_url": null, "date": "2026-02-10T09:40:37", "name": "[0/7] Fixes for load/store misaligned and access faults", "submitter": { "id": 86401, "url": "http://patchwork.ozlabs.org/api/people/86401/?format=api", "name": "Bo Gan", "email": "ganboing@gmail.com" }, "mbox": "http://patchwork.ozlabs.org/project/opensbi/cover/20260210094044.72591-1-ganboing@gmail.com/mbox/", "series": [ { "id": 491635, "url": "http://patchwork.ozlabs.org/api/series/491635/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=491635", "date": "2026-02-10T09:40:41", "name": "Fixes for load/store misaligned and access faults", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/491635/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/covers/2194952/comments/", "headers": { "Return-Path": "\n <opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n secure) header.d=lists.infradead.org header.i=@lists.infradead.org\n header.a=rsa-sha256 header.s=bombadil.20210309 header.b=yFMj11FB;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=IK2M8NRp;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=none (no SPF record) smtp.mailfrom=lists.infradead.org\n (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org;\n envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org;\n receiver=patchwork.ozlabs.org)" ], "Received": [ "from bombadil.infradead.org (bombadil.infradead.org\n [IPv6:2607:7c80:54:3::133])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4f9Gp24lqtz1yBN\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 10 Feb 2026 20:43:02 +1100 (AEDT)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vpkGh-0000000GlWp-0srr;\n\tTue, 10 Feb 2026 09:42:51 +0000", "from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vpkGe-0000000GlVn-0PVO\n\tfor opensbi@lists.infradead.org;\n\tTue, 10 Feb 2026 09:42:49 +0000", "by mail-pl1-x629.google.com with SMTP id\n d9443c01a7336-2a91215c158so4832855ad.0\n for <opensbi@lists.infradead.org>;\n Tue, 10 Feb 2026 01:42:47 -0800 (PST)", "from m91p.airy.home ([172.92.174.155])\n by smtp.gmail.com with ESMTPSA id\n d9443c01a7336-2a9521b8d79sm133219215ad.61.2026.02.10.01.42.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 10 Feb 2026 01:42:45 -0800 (PST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=lists.infradead.org; s=bombadil.20210309; h=Sender:\n\tContent-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post:\n\tList-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=x3FlDISwIbLY1Y+XFuMwCsWMiYiVA6Urx9X1Ae4DxcM=; b=yFMj11FBRFXdeq\n\tLpHpZ9T1YnuvZ49rTP5FrgOF5gePpmG5dGiWFclTfw6xAZejc4HRD6pZV1C7QYddTdZXXQ1l+vww/\n\tSpki/2qVEDCUnlLcljeKVBXD2QNSEHqf0dCPTPqBO3vfoKEnOKT0RHvqsridtcGiGNsTNkJf9deLY\n\telA+ya4FGgsLBk8pOaRMZQwau/YA/CmyJcr8ftjw8aYotAEMzUNYgiPBm7tzuEGwPjyC78h72Ubrn\n\tjFaTRAJMjGv316gh0Y45dI6pp4W3fu7y8fPovokRemjMjXjGDctoQ9vBdUZtY4PxLfoBj0YupnAL2\n\t0qzJk86cSuSx071gbIzA==;", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1770716566; x=1771321366;\n darn=lists.infradead.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=sGR7lirTgLKQxGdn88rUhQCecqu4BT9uGtDXpZyXtWU=;\n b=IK2M8NRp6beoYGT/XDsNxKd9qMRahDKp4dQh7kGdV11w82RQZLjo3aGQvVDMNUPfIH\n uvakY/VqwXDobSD04goxuPEJfp35MdC+gEHmeYOW4JDRYQqPZ5QQ1uYmvWYw4eFJ3qA9\n qKK83VmxtvfOxjnBgI0dSQwXW6569BWJhsW0fXFChvFgV8jrS7oKUN01RE8cB7xq3wYQ\n OBJ4j/a2bLK+Mq/sOoyuZ6zK0nTzSRi/pflNriwIhWxr8zkdFC5tf/tTje+1sX1cC188\n arfxhs+QQIbdkdy1cS+8QqZHECm6mCcyGP2QJvn2aj1PmOn0XbNZN/ZRFsO8UqTNutTU\n AeQQ==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770716566; x=1771321366;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=sGR7lirTgLKQxGdn88rUhQCecqu4BT9uGtDXpZyXtWU=;\n b=UA/TfYkUZqQJemgzW/gD+Y4g/e21WvRekSM4x/NNU5aX1bYTT+vSJOUX/yqyxo08te\n vz1Bd/Pk61090FnYxlkuTR6HzTrnb9/O040ZjqjiRXI6zIR5ZIgEkESskzNZiX7nIKuD\n 9WlBEynq5DknShhhENURkJA35EEEt3hth9VuWs0yP4CH/401QwTrKI5rN6N9GB9OBvg0\n fb8erFJ+vE3tvwMcEuXye9RuXExSz0XSi89Zz3ut7unSlv+0TM3HwG8Iz9VShQ6qklXF\n ZXNpZvYGFI4+Qqo8lrTFKtt9pdlKRKA0iyjMmSxTqiH0aLuIaTjKOdYHsOFuZaDm4AOf\n FG8Q==", "X-Gm-Message-State": "AOJu0YwOUnbaZUm1n5wX8k+3BwYVVsSmw5qWOrcXqIlsaKXKsropVsX/\n\txds2UqxZUwuNkODrE9EMazFA9D+FRNZgxAN44/YnNsC8gjkwXkMe81KcqanxBA==", "X-Gm-Gg": "AZuq6aJ9uS7gRuw7RTy53qTyX9pfKkdI8bkNx5htWBRBW0+Xw1KKe3gYmvtI80MI6WX\n\ti6jIrK5BYYWKlQXW2yO0MruLtsOciPTQj0IruhK7k39mul6NN0QTrHtqmwVH+/9372SpJLqcG+G\n\tgBaxULtE7oykwC2AGTJGt4jEVH1bl6+oHrIwJM/BIUCMCFsU5z36cwOqOOYGPEBCRMpvokyT2KD\n\tR7MbVz/3keTZI166bikUz/sqq2ekAZ9DDVbGt2tRqCqPlfk1TozOmCJUaNytM2IQZMfeWm1IuUc\n\trkXK5Mysvg6xgLSWdkPMW+EzDiXEO2zPl9Nwp78GAGJVlVP0T9ys58SLuUJRXPF1COWnt6Bz1L1\n\taomrxmMBe4RtPIEMqn6Ti+FDU6VnC1TjQj29UJvB6QawI245q6i9pbmTOfzyARWdWfSuB8QW7Ix\n\tRzIopN1zpKoWz+QnjN4dBF1Elc", "X-Received": "by 2002:a17:902:f687:b0:2a7:d5c0:c659 with SMTP id\n d9443c01a7336-2a95160bfa3mr150883715ad.5.1770716566231;\n Tue, 10 Feb 2026 01:42:46 -0800 (PST)", "From": "Bo Gan <ganboing@gmail.com>", "To": "opensbi@lists.infradead.org,\n\tdramforever@live.com,\n\tanup.patel@oss.qualcomm.com", "Cc": "anup@brainfault.org,\n\tcleger@rivosinc.com,\n\tsamuel.holland@sifive.com", "Subject": "[PATCH 0/7] Fixes for load/store misaligned and access faults", "Date": "Tue, 10 Feb 2026 01:40:37 -0800", "Message-Id": "<20260210094044.72591-1-ganboing@gmail.com>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260210_014248_135704_E03B4A9B ", "X-CRM114-Status": "GOOD ( 12.38 )", "X-Spam-Score": "-2.1 (--)", "X-Spam-Report": "Spam detection software,\n running on the system \"bombadil.infradead.org\",\n has NOT identified this incoming email as spam. The original\n message has been attached to this so you can view it or label\n similar future email. If you have any questions, see\n the administrator of that system for details.\n Content preview: Re-visit the load/store misaligned and access fault\n handlers\n to fix issues related to coding patterns, floating-point state,\n and instruction\n decoding: a. Vector misaligned load/store emulator is invoked improperly\n b. vsstatus.FS is not set dirty when V=1 c. No checking of previous XLEN,\n resulting in wrong insn decoding d. Load/Store base address is [...]\n Content analysis details: (-2.1 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no\n trust\n [2607:f8b0:4864:20:0:0:0:629 listed in]\n [list.dnswl.org]\n 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS SPF: sender matches SPF record\n -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from\n author's\n domain\n -0.1 DKIM_VALID Message has at least one valid DKIM or DK\n signature\n 0.1 DKIM_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from\n envelope-from domain\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]\n 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\n provider\n [ganboing(at)gmail.com]", "X-BeenThere": "opensbi@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<opensbi.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/opensbi/>", "List-Post": "<mailto:opensbi@lists.infradead.org>", "List-Help": "<mailto:opensbi-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/opensbi>,\n <mailto:opensbi-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"opensbi\" <opensbi-bounces@lists.infradead.org>", "Errors-To": "opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "Re-visit the load/store misaligned and access fault handlers to fix\nissues related to coding patterns, floating-point state, and instruction\ndecoding:\n\n a. Vector misaligned load/store emulator is invoked improperly\n b. vsstatus.FS is not set dirty when V=1\n c. No checking of previous XLEN, resulting in wrong insn decoding\n d. Load/Store base address is wrongly assumed to be trap address\n e. High 32-bits of tinst needs to be checked against 0\n\nThe pathset is validated on a modified QEMU[1] that exposed misaligned\nfaults, and QEMU[2], which further disabled the insn transformation.\n[2] covers more insn decoding branches, including the particular ones\nwhich can trigger the wrong decoding (c)\n\nThe patchset is also validated on Sifive P550 core (ESWIN EIC7700),\nwhich is RV64-only in M/(V)S/(V)U, no HW misaligned support, no vector,\nand mtinst always 0. Refer to [3] for the git repo/branch that has all\n6 patches applied along with the test case that exercises all integer\nand floating-point load/store instructions.\n\nTest case used is available in PATCH 7.\n\nThere's no change to the behavior of the vector misaligned load/store\nhandler. However, I've found additional issues with them:\n\n - `uint8_t mask[VLEN_MAX / 8]` in sbi_trap_v_ldst.c is 8KB, which\n can overflow the default 4KB stack.\n - tinst should be zero'ed out to not confuse previous mode when\n redirecting faults, otherwise the vector insn can be mistaken\n as a regular load/store.\n - VS in previous mode must be set dirty for loads.\n\nThese will be addressed in follow-up patches.\n\n[1] https://github.com/ganboing/qemu/tree/ganboing-misalign\n[2] https://github.com/ganboing/qemu/tree/ganboing-misalign-no-tinst\n[3] https://github.com/ganboing/opensbi/tree/fix-ldst-v1\n\nBo Gan (7):\n include: sbi: Add more mstatus and instruction encoding\n include: sbi: Add sbi_regs_prev_xlen\n include: sbi: Add GET_RDS_NUM/SET(_FP32/_FP64)_RDS macros\n include: sbi: set FS dirty in vsstatus when V=1\n lib: sbi: Do not override emulator callback for vector load/store\n lib: sbi: Rework load/store emulator instruction decoding\n [NOT-FOR-UPSTREAM] Test program for misaligned load/store\n\n include/sbi/riscv_encoding.h | 21 +-\n include/sbi/riscv_fp.h | 30 ++-\n include/sbi/sbi_platform.h | 92 ++++---\n include/sbi/sbi_trap.h | 59 ++++\n include/sbi/sbi_trap_ldst.h | 4 +-\n lib/sbi/sbi_trap_ldst.c | 502 ++++++++++++++++++++++++-----------\n lib/sbi/sbi_trap_v_ldst.c | 25 +-\n tests/ldst.S | 134 ++++++++++\n tests/ldst.h | 170 ++++++++++++\n tests/test-misaligned-ldst.c | 154 +++++++++++\n 10 files changed, 986 insertions(+), 205 deletions(-)\n create mode 100644 tests/ldst.S\n create mode 100644 tests/ldst.h\n create mode 100644 tests/test-misaligned-ldst.c" }