Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2230450/?format=api
{ "id": 2230450, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230450/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260429181747.160033-1-vulab@iscas.ac.cn/", "project": { "id": 67, "url": "http://patchwork.ozlabs.org/api/1.1/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": "" }, "msgid": "<20260429181747.160033-1-vulab@iscas.ac.cn>", "date": "2026-04-29T18:17:47", "name": "lib: sbi_domain_context: Flush TLB after SATP mode switch", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "b81714a0651d563a6a6b849684a8ffa9b5141aad", "submitter": { "id": 78109, "url": "http://patchwork.ozlabs.org/api/1.1/people/78109/?format=api", "name": "Zishun Yi", "email": "vulab@iscas.ac.cn" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260429181747.160033-1-vulab@iscas.ac.cn/mbox/", "series": [ { "id": 502127, "url": "http://patchwork.ozlabs.org/api/1.1/series/502127/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=502127", "date": "2026-04-29T18:17:47", "name": "lib: sbi_domain_context: Flush TLB after SATP mode switch", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502127/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2230450/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2230450/checks/", "tags": {}, "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=GEghD9vf;\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 4g5QXb3Wglz1yHX\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 04:18:23 +1000 (AEST)", "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wI9UG-000000043mm-3OvK;\n\tWed, 29 Apr 2026 18:18:16 +0000", "from smtp21.cstnet.cn ([159.226.251.21] helo=cstnet.cn)\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wI9UA-000000043kd-36Xw\n\tfor opensbi@lists.infradead.org;\n\tWed, 29 Apr 2026 18:18:15 +0000", "from yzs (unknown [115.196.69.181])\n\tby APP-01 (Coremail) with SMTP id qwCowADnjGhaS_Jpy0W+Dg--.60596S2;\n\tThu, 30 Apr 2026 02:18:04 +0800 (CST)" ], "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=IwsKoYlF/sVMV61hH3fkJkhPCH2Qae1o2syEMU6pEzQ=; b=GEghD9vfLP3b60\n\tiFdNX5MaSG4AD3OCtaY5pFgYDxGmxqKn0FP5HRzvA/qnAXqkprzv3gDjbsI9QUNqTM/SJ9R3degny\n\t+qPMjdYO5UTQ8TLAsce/JMPS0BPzEaowGlXFygwL4JLNcAYXDUfseIOI72p64ttz9/AnXC4O9+0to\n\tymgkCewJ6jhEOhPS4UsPsfOT5qz4PV/9CWCLJiHYaOqWoJkoglKmSgwGsAVVQ/hBpM6QVO4LBmmOJ\n\tyslQFdlzng9Lx2msM2iepWS1Uwe40kslvzIcMYzX4j0xSarS/3FDGwKSMBQpTjNPKacV3EHg0qNzk\n\t7bA0FeksezleAPtBuwHg==;", "From": "Zishun Yi <vulab@iscas.ac.cn>", "To": "opensbi@lists.infradead.org", "Cc": "Zishun Yi <vulab@iscas.ac.cn>", "Subject": "[PATCH] lib: sbi_domain_context: Flush TLB after SATP mode switch", "Date": "Thu, 30 Apr 2026 02:17:47 +0800", "Message-ID": "<20260429181747.160033-1-vulab@iscas.ac.cn>", "X-Mailer": "git-send-email 2.51.2", "MIME-Version": "1.0", "X-CM-TRANSID": "qwCowADnjGhaS_Jpy0W+Dg--.60596S2", "X-Coremail-Antispam": "1UD129KBjvJXoW7Zr18Zw4Dtw1kAr4fZFWkWFg_yoW8WrW7pF\n\t1DuF9rCr4vqFn7Ka4DCa1Yqr1FkFZ3G3Wjk3s0kwnay34Fvrn8Cr1UZ34jkF17ZFyxXr1Y\n\tyFsF9r4avF4YvFJanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n\t9KBjDU0xBIdaVrnRJUUUyG14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0\n\trVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02\n\t1l84ACjcxK6xIIjxv20xvE14v26r4j6ryUM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j\n\t6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr\n\t1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv\n\t7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r\n\t1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwCF04k20xvY0x0E\n\twIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I0E74\n\t80Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jrv_JF1lIxkGc2Ij64vIr41lIxAIcVC0\n\tI7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04\n\tk26cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7Cj\n\txVAFwI0_Jr0_GrUvcSsGvfC2KfnxnUUI43ZEXa7VUbrMaUUUUUU==", "X-Originating-IP": "[115.196.69.181]", "X-CM-SenderInfo": "pyxotu46lvutnvoduhdfq/1tbiBgwMA2nyHa1hlQAAsa", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260429_111811_155686_D682F6CF ", "X-CRM114-Status": "UNSURE ( 7.56 )", "X-CRM114-Notice": "Please train this message.", "X-Spam-Score": "-4.2 (----)", "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: When switching between domains with different satp.MODE\n values\n (e.g. Sv39 to Sv48),\n the RISC-V ISA permits hardware to use cached translations\n from the old virtual-address width if no SFENCE.VMA inter [...]\n Content analysis details: (-4.2 points, 5.0 required)\n pts rule name description\n ---- ----------------------\n --------------------------------------------------\n -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/,\n medium trust\n [159.226.251.21 listed in list.dnswl.org]\n -0.0 SPF_PASS SPF: sender matches SPF record\n -0.0 SPF_HELO_PASS SPF: HELO matches SPF record\n -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%\n [score: 0.0000]", "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": "When switching between domains with different satp.MODE values (e.g.\nSv39 to Sv48), the RISC-V ISA permits hardware to use cached\ntranslations from the old virtual-address width if no SFENCE.VMA\nintervenes. This constrained-unpredictable behavior is clarified in\nriscv-isa-manual PR #2219.\n\nAdd __sbi_sfence_vma_all() after the csr_swap(CSR_SATP, ...) in\nswitch_to_next_domain_context() to ensure translations from the new\ndomain's address width are used.\n\nLink: https://github.com/riscv/riscv-isa-manual/pull/2219\nSigned-off-by: Zishun Yi <vulab@iscas.ac.cn>\n---\n lib/sbi/sbi_domain_context.c | 2 ++\n 1 file changed, 2 insertions(+)", "diff": "diff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c\nindex 158f4990432e..f47875e48230 100644\n--- a/lib/sbi/sbi_domain_context.c\n+++ b/lib/sbi/sbi_domain_context.c\n@@ -18,6 +18,7 @@\n #include <sbi/sbi_domain_context.h>\n #include <sbi/sbi_platform.h>\n #include <sbi/sbi_trap.h>\n+#include <sbi/sbi_tlb.h>\n \n /** Context representation for a hart within a domain */\n struct hart_context {\n@@ -136,6 +137,7 @@ static int switch_to_next_domain_context(struct hart_context *ctx,\n \tctx->stval\t= csr_swap(CSR_STVAL, dom_ctx->stval);\n \tctx->sip\t= csr_swap(CSR_SIP, dom_ctx->sip);\n \tctx->satp\t= csr_swap(CSR_SATP, dom_ctx->satp);\n+\t__sbi_sfence_vma_all();\n \tif (sbi_hart_priv_version(scratch) >= SBI_HART_PRIV_VER_1_10)\n \t\tctx->scounteren = csr_swap(CSR_SCOUNTEREN, dom_ctx->scounteren);\n \tif (sbi_hart_priv_version(scratch) >= SBI_HART_PRIV_VER_1_12)\n", "prefixes": [] }