get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2223821/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2223821,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223821/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260416091805.56250-1-cuitao@kylinos.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": "<20260416091805.56250-1-cuitao@kylinos.cn>",
    "date": "2026-04-16T09:18:05",
    "name": "riscv: kvm: mmu: fix unlocked gstage unmap in kvm_unmap_gfn_range",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "58b12e14dfe696228bfcba20630b0aed8f422472",
    "submitter": {
        "id": 93168,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/93168/?format=api",
        "name": "cuitao",
        "email": "cuitao@kylinos.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260416091805.56250-1-cuitao@kylinos.cn/mbox/",
    "series": [
        {
            "id": 500120,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500120/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=500120",
            "date": "2026-04-16T09:18:05",
            "name": "riscv: kvm: mmu: fix unlocked gstage unmap in kvm_unmap_gfn_range",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500120/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223821/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223821/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=bL4DV+6p;\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 4fxCB71xB4z1yHV\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 19:18:55 +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 1wDIs8-00000002EZQ-3avE;\n\tThu, 16 Apr 2026 09:18:52 +0000",
            "from mailgw.kylinos.cn ([124.126.103.232])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wDIs4-00000002EWY-3OSO;\n\tThu, 16 Apr 2026 09:18:50 +0000",
            "from ctao-book.. [(183.242.174.23)] by mailgw.kylinos.cn\n\t(envelope-from <cuitao@kylinos.cn>)\n\t(Generic MTA with TLSv1.3 TLS_AES_256_GCM_SHA384 256/256)\n\twith ESMTP id 435106074; Thu, 16 Apr 2026 17:18:32 +0800"
        ],
        "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=aRhQizrwgOu0OzrUU6/u+XyWeRvX7ZCL8qaS9b9C7d0=; b=bL4DV+6pMpFBZY\n\to3IuH+72Uoaih0Pq442xlQTMmgHhmcy2kkeQ0tpdRYzXtenSUDR4D71+UEprn5VIS1KuOQUyolOHC\n\t4qCEbuGYsA9RiArHbifGxLrW5ZhF/Q7un4E1fhzVZ6fU1ij7pjME4xoeOv2UFzuEYIyVs5N+xnbMe\n\tI+sT/wGBS0IrrONAlrVp2BsiKsnw5ERIkyb9BnXpBgF43icsxAHHjiTu9OhWpocUxxYtfqpkIV+TY\n\tQG6l9nN6mirq1NuBLsLGeVLk7rAVhLw7T8ZnACk585CPQKugHj10ovn2nHpUUMrZVHa+1DxPn9FKx\n\tV4FC/0WOkBsNc161RK6g==;",
        "X-UUID": [
            "3d3a1d1a397511f1aa26b74ffac11d73-20260416",
            "3d3a1d1a397511f1aa26b74ffac11d73-20260416"
        ],
        "X-CTIC-Tags": "HR_CC_COUNT, HR_CC_DOMAIN_COUNT, HR_CC_NAME, HR_CC_NO_NAME,\n HR_CTE_8B\n\tHR_CTT_MISS, HR_DATE_H, HR_DATE_WKD, HR_DATE_ZONE, HR_FROM_NAME\n\tHR_SJ_LANG, HR_SJ_LEN, HR_SJ_LETTER, HR_SJ_NOR_SYM, HR_SJ_PHRASE\n\tHR_SJ_PHRASE_LEN, HR_SJ_WS, HR_TO_COUNT, HR_TO_DOMAIN_COUNT, HR_TO_NO_NAME\n\tIP_TRUSTED, SRC_TRUSTED, DN_TRUSTED, SA_EXISTED, SN_EXISTED\n\tSPF_NOPASS, DKIM_NOPASS, DMARC_NOPASS, CIE_BAD, CIE_GOOD\n\tCIE_GOOD_SPF, GTI_FG_BS, GTI_RG_INFO, GTI_C_BU, AMN_GOOD\n\tABX_MISS_RDNS",
        "X-CID-P-RULE": "Release_Ham",
        "X-CID-O-INFO": "VERSION:1.3.12,REQID:28fbb244-5c42-43ef-8ff7-31e3d6d77442,IP:10,\n\tURL:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTI\n\tON:release,TS:30",
        "X-CID-INFO": "VERSION:1.3.12,REQID:28fbb244-5c42-43ef-8ff7-31e3d6d77442,IP:10,UR\n\tL:0,TC:0,Content:0,EDM:25,RT:0,SF:-5,FILE:0,BULK:0,RULE:Release_Ham,ACTION\n\t:release,TS:30",
        "X-CID-META": "VersionHash:e7bac3a,CLOUDID:33e1e315511771ac15c8c4c410b73900,BulkI\n\tD:260416171834DVS3OQ4F,BulkQuantity:0,Recheck:0,SF:17|19|38|66|78|102|127|\n\t898,TC:nil,Content:0|15|50,EDM:5,IP:-2,URL:0,File:nil,RT:nil,Bulk:nil,QS:n\n\til,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC\n\t:0",
        "X-CID-BVR": "2,SSN|SDN",
        "X-CID-BAS": "2,SSN|SDN,0,_",
        "X-CID-FACTOR": "TF_CID_SPAM_FSD,TF_CID_SPAM_SNR,TF_CID_SPAM_FAS",
        "X-CID-RHF": "D41D8CD98F00B204E9800998ECF8427E",
        "X-User": "cuitao@kylinos.cn",
        "From": "cuitao <cuitao@kylinos.cn>",
        "To": "anup@brainfault.org,\n\tatish.patra@linux.dev,\n\tpjw@kernel.org,\n\tpalmer@dabbelt.com,\n\taou@eecs.berkeley.edu,\n\tkvm-riscv@lists.infradead.org",
        "Cc": "alex@ghiti.fr,\n\tlinux-riscv@lists.infradead.org,\n\tcuitao <cuitao@kylinos.cn>",
        "Subject": "[PATCH] riscv: kvm: mmu: fix unlocked gstage unmap in\n kvm_unmap_gfn_range",
        "Date": "Thu, 16 Apr 2026 17:18:05 +0800",
        "Message-ID": "<20260416091805.56250-1-cuitao@kylinos.cn>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260416_021849_158345_C379DA33 ",
        "X-CRM114-Status": "UNSURE (   7.75  )",
        "X-CRM114-Notice": "Please train this message.",
        "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:  When spin_trylock fails in kvm_unmap_gfn_range(), the code\n    still proceeds to call kvm_riscv_gstage_unmap_range() without holding\n kvm->mmu_lock,\n    which races with concurrent page table modifications. Skip the unmap and\n   return false on trylock failure so the MMU notifier will flush and retry,\n   matching the pattern used by other architectures.\n Content analysis details:   (-1.9 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\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                        [124.126.103.232 listed in\n sa-trusted.bondedsender.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                             [124.126.103.232 listed in\n sa-accredit.habeas.com]\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                           [124.126.103.232 listed in\n bl.score.senderscore.com]\n -0.0 SPF_PASS               SPF: sender matches SPF record\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 UNPARSEABLE_RELAY      Informational: message has unparseable relay\n lines",
        "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": "When spin_trylock fails in kvm_unmap_gfn_range(), the code still\nproceeds to call kvm_riscv_gstage_unmap_range() without holding\nkvm->mmu_lock, which races with concurrent page table modifications.\n\nSkip the unmap and return false on trylock failure so the MMU notifier\nwill flush and retry, matching the pattern used by other architectures.\n\nSigned-off-by: cuitao <cuitao@kylinos.cn>\n---\n arch/riscv/kvm/mmu.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c\nindex 088d33ba90ed..d37cc717fdaf 100644\n--- a/arch/riscv/kvm/mmu.c\n+++ b/arch/riscv/kvm/mmu.c\n@@ -245,7 +245,6 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,\n bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)\n {\n \tstruct kvm_gstage gstage;\n-\tbool mmu_locked;\n \n \tif (!kvm->arch.pgd)\n \t\treturn false;\n@@ -254,12 +253,13 @@ bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)\n \tgstage.flags = 0;\n \tgstage.vmid = READ_ONCE(kvm->arch.vmid.vmid);\n \tgstage.pgd = kvm->arch.pgd;\n-\tmmu_locked = spin_trylock(&kvm->mmu_lock);\n+\tif (!spin_trylock(&kvm->mmu_lock))\n+\t\treturn false;\n+\n \tkvm_riscv_gstage_unmap_range(&gstage, range->start << PAGE_SHIFT,\n \t\t\t\t     (range->end - range->start) << PAGE_SHIFT,\n \t\t\t\t     range->may_block);\n-\tif (mmu_locked)\n-\t\tspin_unlock(&kvm->mmu_lock);\n+\tspin_unlock(&kvm->mmu_lock);\n \treturn false;\n }\n \n",
    "prefixes": []
}