get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2220434,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2220434/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260407171338173YQ_-quPfgvXzr9BX4WY-q@zte.com.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": "<20260407171338173YQ_-quPfgvXzr9BX4WY-q@zte.com.cn>",
    "date": "2026-04-07T09:13:38",
    "name": "[1/3] RISC-V: KVM: Refactor kvm_arch_commit_memory_region()",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "bca3f06e77ccfe19e22781fd76c3899d0415c0a3",
    "submitter": {
        "id": 91800,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/91800/?format=api",
        "name": "",
        "email": "wang.yechao255@zte.com.cn"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/kvm-riscv/patch/20260407171338173YQ_-quPfgvXzr9BX4WY-q@zte.com.cn/mbox/",
    "series": [
        {
            "id": 498947,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/498947/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/kvm-riscv/list/?series=498947",
            "date": "2026-04-07T09:10:52",
            "name": "RISC-V: KVM: Huge page recovery during disable-dirty-log",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498947/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2220434/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220434/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=2fheS7Cu;\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 4fqgVc5trZz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 07 Apr 2026 19:14:00 +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 1wA2VS-00000006Cln-3Ajt;\n\tTue, 07 Apr 2026 09:13:58 +0000",
            "from mxhk.zte.com.cn ([160.30.148.35])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wA2VP-00000006Ckk-2hUg;\n\tTue, 07 Apr 2026 09:13:57 +0000",
            "from mse-fl1.zte.com.cn (unknown [10.5.228.132])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n\t(No client certificate requested)\n\tby mxhk.zte.com.cn (FangMail) with ESMTPS id 4fqgVN3l4Wz8Xs70;\n\tTue, 07 Apr 2026 17:13:48 +0800 (CST)",
            "from szxl2zmapp05.zte.com.cn ([10.1.32.37])\n\tby mse-fl1.zte.com.cn with SMTP id 6379DZhh068225;\n\tTue, 7 Apr 2026 17:13:35 +0800 (+08)\n\t(envelope-from wang.yechao255@zte.com.cn)",
            "from mapi (szxlzmapp03[null])\n\tby mapi (Zmail) with MAPI id mid12;\n\tTue, 7 Apr 2026 17:13:38 +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:Subject:Cc:To:From:Mime-Version:Date:\n\tReferences:In-Reply-To:Message-ID:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=i6f42VDX4/o/D3iAKbOzckV+bUj3WjEcyP1jCYqk8VQ=; b=2fheS7Cuj69mwt\n\tUm7Wn4g0hek2xM6OmEOzcyTGEuK2WvHIY/3ccvLps6YbZhGB7E2rW3NmO7scCkQ03VHzzX7bwQR3D\n\tiRMTkF0HDBRbPGdtlKYnw8ys7C78hZ6Cjcs/Xgwgkai2PXk1KA7mU0zADQDTgu7qzCzETrAutyucP\n\tzvlzWW27guK0VvbwKsSMSm/mLxpl8Wl8L8NXMRXXV3yZY277hTjPZiWWshaC07pfiPD54hIm4WQT/\n\t592p8KH8h0kzMkBzqbxV19aglYBxqNp8rKIxoKQsLabb1drRVQqfobQwTD9ZGdqp+C8ffviYuDIkR\n\tsCYWli5I+qmh5KW4hUMQ==;",
        "X-Zmail-TransId": "2b0569d4cac2d33-9076c",
        "X-Mailer": "Zmail v1.0",
        "Message-ID": "<20260407171338173YQ_-quPfgvXzr9BX4WY-q@zte.com.cn>",
        "In-Reply-To": "<20260407171052241tmZDFGusMP_wlEsBVVtJo@zte.com.cn>",
        "References": "20260407171052241tmZDFGusMP_wlEsBVVtJo@zte.com.cn",
        "Date": "Tue, 7 Apr 2026 17:13:38 +0800 (CST)",
        "Mime-Version": "1.0",
        "From": "<wang.yechao255@zte.com.cn>",
        "To": "<anup@brainfault.org>, <atish.patra@linux.dev>, <pjw@kernel.org>,\n        <palmer@dabbelt.com>, <aou@eecs.berkeley.edu>, <alex@ghiti.fr>",
        "Cc": "<kvm@vger.kernel.org>, <kvm-riscv@lists.infradead.org>,\n        <linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>",
        "Subject": "=?utf-8?q?=5BPATCH_1/3=5D_RISC-V=3A_KVM=3A_Refactor_kvm=5Farch=5Fco?=\n\t=?utf-8?q?mmit=5Fmemory=5Fregion=28=29?=",
        "X-MAIL": "mse-fl1.zte.com.cn 6379DZhh068225",
        "X-TLS": "YES",
        "X-SPF-DOMAIN": "zte.com.cn",
        "X-ENVELOPE-SENDER": "wang.yechao255@zte.com.cn",
        "X-SPF": "None",
        "X-SOURCE-IP": "10.5.228.132 unknown Tue, 07 Apr 2026 17:13:48 +0800",
        "X-Fangmail-Anti-Spam-Filtered": "true",
        "X-Fangmail-MID-QID": "69D4CACC.003/4fqgVN3l4Wz8Xs70",
        "X-Bad-Reply": "References and In-Reply-To but no 'Re:' in Subject.",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260407_021356_727470_D56A9E86 ",
        "X-CRM114-Status": "GOOD (  10.43  )",
        "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:  From: Wang Yechao <wang.yechao255@zte.com.cn> Refactor\n kvm_arch_commit_memory_region()\n    as a preparation for a future commit to look cleaner and more\n understandable.\n    Also, it looks more like its arm64 and x86 counterparts.\n Content analysis details:   (-1.9 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\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                             [160.30.148.35 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                          [160.30.148.35 listed in\n sa-trusted.bondedsender.org]\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\n  0.0 RCVD_IN_MSPIKE_H5      RBL: Excellent reputation (+5)\n                             [160.30.148.35 listed in wl.mailspike.net]\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                             [160.30.148.35 listed in\n bl.score.senderscore.com]\n  0.0 RCVD_IN_MSPIKE_WL      Mailspike good senders",
        "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": "From: Wang Yechao <wang.yechao255@zte.com.cn>\n\nRefactor kvm_arch_commit_memory_region() as a preparation for a future\ncommit to look cleaner and more understandable. Also, it looks more\nlike its arm64 and x86 counterparts.\n\nSigned-off-by: Wang Yechao <wang.yechao255@zte.com.cn>\n---\n arch/riscv/kvm/mmu.c | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/arch/riscv/kvm/mmu.c b/arch/riscv/kvm/mmu.c\nindex c3539f660142..d2116c09c589 100644\n--- a/arch/riscv/kvm/mmu.c\n+++ b/arch/riscv/kvm/mmu.c\n@@ -156,12 +156,22 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,\n \t\t\t\tconst struct kvm_memory_slot *new,\n \t\t\t\tenum kvm_mr_change change)\n {\n+\tbool log_dirty_pages = new && new->flags & KVM_MEM_LOG_DIRTY_PAGES;\n+\tbool read_only = new && new->flags & KVM_MEM_READONLY;\n+\n+\t/*\n+\t * Nothing more to do for RO slots (which can't be dirtied and can't be\n+\t * made writable) or CREATE/MOVE/DELETE of a slot.\n+\t */\n+\tif ((change != KVM_MR_FLAGS_ONLY) || read_only)\n+\t\treturn;\n+\n \t/*\n \t * At this point memslot has been committed and there is an\n \t * allocated dirty_bitmap[], dirty pages will be tracked while\n \t * the memory slot is write protected.\n \t */\n-\tif (change != KVM_MR_DELETE && new->flags & KVM_MEM_LOG_DIRTY_PAGES) {\n+\tif (log_dirty_pages) {\n \t\tif (kvm_dirty_log_manual_protect_and_init_set(kvm))\n \t\t\treturn;\n \t\tmmu_wp_memory_region(kvm, new->id);\n",
    "prefixes": [
        "1/3"
    ]
}