Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2223379/?format=api
{ "id": 2223379, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223379/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260415075216.2757427-1-xujiakai2025@iscas.ac.cn/", "project": { "id": 70, "url": "http://patchwork.ozlabs.org/api/1.1/projects/70/?format=api", "name": "Linux KVM RISC-V", "link_name": "kvm-riscv", "list_id": "kvm-riscv.lists.infradead.org", "list_email": "kvm-riscv@lists.infradead.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260415075216.2757427-1-xujiakai2025@iscas.ac.cn>", "date": "2026-04-15T07:52:16", "name": "RISC-V: KVM: Fix invalid HVA warning in steal-time recording", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "327922d8c7822d116be9ddfec21126eb07b65ab7", "submitter": { "id": 92543, "url": "http://patchwork.ozlabs.org/api/1.1/people/92543/?format=api", "name": "Jiakai Xu", "email": "xujiakai2025@iscas.ac.cn" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260415075216.2757427-1-xujiakai2025@iscas.ac.cn/mbox/", "series": [ { "id": 499938, "url": "http://patchwork.ozlabs.org/api/1.1/series/499938/?format=api", "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=499938", "date": "2026-04-15T07:52:16", "name": "RISC-V: KVM: Fix invalid HVA warning in steal-time recording", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/499938/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2223379/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2223379/checks/", "tags": {}, "headers": { "Return-Path": "\n <kvm-riscv-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=MreByO8r;\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=kvm-riscv-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 4fwYKJ1VsLz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 17:52:47 +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 1wCv38-00000000kzd-2qXU;\n\tWed, 15 Apr 2026 07:52:38 +0000", "from smtp25.cstnet.cn ([159.226.251.25] helo=cstnet.cn)\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wCv34-00000000kz3-1j6N;\n\tWed, 15 Apr 2026 07:52:36 +0000", "from fric.. (unknown [36.110.52.2])\n\tby APP-05 (Coremail) with SMTP id zQCowABH1QiyQ99pSIKTDQ--.36677S2;\n\tWed, 15 Apr 2026 15:52:18 +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=iFAkcRQAenBuRSbmJlSUBlyWrVrjaavpvIwzveImE+o=; b=MreByO8rcJ3A0I\n\tk4UQtq/Fqj9m05kWc8y0b9OXcneQJkvvxHwpLaUW8zQpi+q1alsyAfGnnmbDzWirslDUcYWwWhZTu\n\t5Fr9XxSsEsVwBg3iGL8A1D6aJADhbeLdFa+OCB90p8rbfuB037IIAJUH9LFbJqeR5E6m5S++pJakA\n\tDrxTbzv9K7wMdhR6DJIxCZYqpgc7nkXI6Y+Kel4zp2iHmppEJHR6ZoEyqXkbyujxQDRZnNeCSm2IC\n\tnQxAJUvHEZLfVDegA42VDUxxo99chH0pPHPfnhcOggRfLFDuJx0Gfj+m2k5opLEMBdVKpHDdhB23n\n\tw3uyLo8A5vxeTrsKEWxA==;", "From": "Jiakai Xu <xujiakai2025@iscas.ac.cn>", "To": "kvm-riscv@lists.infradead.org,\n\tkvm@vger.kernel.org,\n\tlinux-kernel@vger.kernel.org,\n\tlinux-riscv@lists.infradead.org", "Cc": "Albert Ou <aou@eecs.berkeley.edu>,\n\tAlexandre Ghiti <alex@ghiti.fr>,\n\tAndrew Jones <ajones@ventanamicro.com>,\n\tAnup Patel <anup@brainfault.org>,\n\tAtish Patra <atish.patra@linux.dev>,\n\tPalmer Dabbelt <palmer@dabbelt.com>,\n\tPaul Walmsley <pjw@kernel.org>,\n\tJiakai Xu <xujiakai2025@iscas.ac.cn>,\n\tJiakai Xu <jiakaiPeanut@gmail.com>", "Subject": "[PATCH] RISC-V: KVM: Fix invalid HVA warning in steal-time recording", "Date": "Wed, 15 Apr 2026 07:52:16 +0000", "Message-Id": "<20260415075216.2757427-1-xujiakai2025@iscas.ac.cn>", "X-Mailer": "git-send-email 2.34.1", "MIME-Version": "1.0", "X-CM-TRANSID": "zQCowABH1QiyQ99pSIKTDQ--.36677S2", "X-Coremail-Antispam": "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AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUbQVy7UUUUU==", "X-Originating-IP": "[36.110.52.2]", "X-CM-SenderInfo": "50xmxthndljiysv6x2xfdvhtffof0/1tbiBg0SCWnfJvJ8DgAAsA", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260415_005234_822018_7F9859D8 ", "X-CRM114-Status": "GOOD ( 14.05 )", "X-Spam-Score": "-1.9 (-)", "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: kvm_riscv_vcpu_record_steal_time() assumes that the\n steal-time\n shared memory GPA (vcpu->arch.sta.shmem) is always backed by a valid guest\n memory slot. However, this assumption is not guaranteed by the [...]\n Content analysis details: (-1.9 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 [159.226.251.25 listed in list.dnswl.org]\n 0.0 RCVD_IN_VALIDITY_SAFE_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [159.226.251.25 listed in sa-accredit.habeas.com]\n 0.0 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED RBL: ADMINISTRATOR NOTICE: The\n query to Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [159.226.251.25 listed in\n sa-trusted.bondedsender.org]\n 0.0 RCVD_IN_VALIDITY_RPBL_BLOCKED RBL: ADMINISTRATOR NOTICE: The query to\n Validity was blocked. See\n https://knowledge.validity.com/hc/en-us/articles/20961730681243\n for more information.\n [159.226.251.25 listed in\n bl.score.senderscore.com]\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": "kvm-riscv@lists.infradead.org", "X-Mailman-Version": "2.1.34", "Precedence": "list", "List-Id": "<kvm-riscv.lists.infradead.org>", "List-Unsubscribe": "<http://lists.infradead.org/mailman/options/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=unsubscribe>", "List-Archive": "<http://lists.infradead.org/pipermail/kvm-riscv/>", "List-Post": "<mailto:kvm-riscv@lists.infradead.org>", "List-Help": "<mailto:kvm-riscv-request@lists.infradead.org?subject=help>", "List-Subscribe": "<http://lists.infradead.org/mailman/listinfo/kvm-riscv>,\n <mailto:kvm-riscv-request@lists.infradead.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Sender": "\"kvm-riscv\" <kvm-riscv-bounces@lists.infradead.org>", "Errors-To": "kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org" }, "content": "kvm_riscv_vcpu_record_steal_time() assumes that the steal-time shared\nmemory GPA (vcpu->arch.sta.shmem) is always backed by a valid guest\nmemory slot. However, this assumption is not guaranteed by the KVM\nuserspace ABI.\n\nA malicious or buggy userspace can set the STA shared memory GPA via\nKVM_SET_ONE_REG without establishing a corresponding memory region via\nKVM_SET_USER_MEMORY_REGION. In such cases, the GPA cannot be translated\nto a valid HVA and kvm_vcpu_gfn_to_hva() returns an error address.\n\nThe current implementation incorrectly treats this as a kernel warning\nusing WARN_ON(), which may escalate to a kernel panic when panic_on_warn\nis enabled.\n\nThis is not a kernel bug condition but a normal invalid configuration\nfrom userspace, and should be handled gracefully.\n\nFix it by removing WARN_ON() and treating invalid HVA as a normal\nfailure case, resetting the STA shared memory state.\n\nFixes: e9f12b5fff8ad0 (\"RISC-V: KVM: Implement SBI STA extension\")\nSigned-off-by: Jiakai Xu <xujiakai2025@iscas.ac.cn>\nSigned-off-by: Jiakai Xu <jiakaiPeanut@gmail.com>\nAssisted-by: OpenClaw:DeepSeek-V3.2\n---\n arch/riscv/kvm/vcpu_sbi_sta.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/arch/riscv/kvm/vcpu_sbi_sta.c b/arch/riscv/kvm/vcpu_sbi_sta.c\nindex 3b834709b429f..60e50296a0085 100644\n--- a/arch/riscv/kvm/vcpu_sbi_sta.c\n+++ b/arch/riscv/kvm/vcpu_sbi_sta.c\n@@ -46,7 +46,7 @@ void kvm_riscv_vcpu_record_steal_time(struct kvm_vcpu *vcpu)\n \tgfn = shmem >> PAGE_SHIFT;\n \thva = kvm_vcpu_gfn_to_hva(vcpu, gfn);\n \n-\tif (WARN_ON(kvm_is_error_hva(hva))) {\n+\tif (kvm_is_error_hva(hva)) {\n \t\tvcpu->arch.sta.shmem = INVALID_GPA;\n \t\treturn;\n \t}\n", "prefixes": [] }