get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2230816,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2230816/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260430045528.420437-7-npiggin@gmail.com/",
    "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": "<20260430045528.420437-7-npiggin@gmail.com>",
    "date": "2026-04-30T04:55:23",
    "name": "[5/7] lib: sbi: Add pmp_is_enabled() helper",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "521749b561b287e4e871f12c28cdca3e3a8d1b64",
    "submitter": {
        "id": 69518,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/69518/?format=api",
        "name": "Nicholas Piggin",
        "email": "npiggin@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260430045528.420437-7-npiggin@gmail.com/mbox/",
    "series": [
        {
            "id": 502193,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/502193/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=502193",
            "date": "2026-04-30T04:55:18",
            "name": "Make PMP encoding usable for non-hart PMPs",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/502193/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2230816/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2230816/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=FLYHX7Io;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256\n header.s=desiato.20200630 header.b=FnycCKWj;\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=20251104 header.b=rmrFiksi;\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 4g5hhl3xHBz1yGq\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 30 Apr 2026 14:56: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 1wIJRh-00000004gGf-204K;\n\tThu, 30 Apr 2026 04:56:17 +0000",
            "from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIJRg-00000004gFg-1xsD\n\tfor opensbi@bombadil.infradead.org;\n\tThu, 30 Apr 2026 04:56:16 +0000",
            "from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433])\n\tby desiato.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIJRY-00000006ddL-1V5v\n\tfor opensbi@lists.infradead.org;\n\tThu, 30 Apr 2026 04:56:12 +0000",
            "by mail-pf1-x433.google.com with SMTP id\n d2e1a72fcca58-8296d553142so309725b3a.3\n        for <opensbi@lists.infradead.org>;\n Wed, 29 Apr 2026 21:56:07 -0700 (PDT)",
            "from localhost ([124.158.97.178])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-834ed80dfbfsm3780665b3a.53.2026.04.29.21.56.03\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 29 Apr 2026 21:56:04 -0700 (PDT)"
        ],
        "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:References:In-Reply-To:\n\tMessage-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:\n\tResent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:\n\tList-Owner; bh=Z/iRiLKDN+I/hfCcnTfr0hOmad53lMc604Kn3zkLCPo=; b=FLYHX7IowjiH7G\n\tqQ5zFsYTd0UYbIr5ZdYC4cbg40JqxjUUAUxTv0TiJA5G/X9/Zgh8UJVmbQlABWtf2/Au8Yn4NIfIE\n\tnzLqdyea926LS2ZJH52N21XKgKVhLylb1oKLNgrBmfPTN61OWJGlpLgMie5w9HI9xFnJjOcXGsiYI\n\tJZzi1IV3aTGIRz8hxWTuNA2f7vTNMSnwL1HMfEpXBZU9CMajWqjYERfBHPgZl1ynW9vT4pRlyeStk\n\tqT0dHtBsfsyYlLCSJAVevTwTgZHqXHfkmi5X13gTW3FUIk+MLNs7L4H6XVafiFzrmd+gInSDk+5Sx\n\tfSpxODEm9xCuYvuA3Nxg==;",
            "v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;\n\td=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version\n\t:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:\n\tContent-Type:Content-ID:Content-Description;\n\tbh=hZxnkrx+q3r3GUhvWqZ8MCXy5Ku/x8WkE9Au9n1POVg=; b=FnycCKWj8pqYEYNJEccYhvjrtt\n\tw5MeQYjZ9rwDPeNWXHJNZzE38tQXoLeu76FVy6w/aoL+8V0nFe1QcTBKu1GIzaK9vcK9cfU3KS9cf\n\tRyM5G5ElYipySlSs+LXiKdjKaO5vGbQUHbh7TBmvI0wS9SUe0W4mDCtoGsnu9JIuT+FLxu0cYZO9H\n\txlGXDLnOgUVXXDzlMkobwVeoN0yb2gX9Hub6QFQ0z+xRZP+inpZW00SDHEvipYy9Jx4pH9O+Tx9T7\n\t5ZpFDoC5OaUft2HwlLYSYKqhgS2pQQtA3d7phyXJOjVk4mbY8KDiRmp6nQK3o15IdYBshABnmiUg3\n\tVhhxA1GQ==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777524965; x=1778129765;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=hZxnkrx+q3r3GUhvWqZ8MCXy5Ku/x8WkE9Au9n1POVg=;\n        b=rmrFiksiW2eaQ9XXZMpGLdfPt7FOTDDd+SBxooRW3xtHJ4xFp7flgf+4JsQjcfSti8\n         AfcVX5/Cqf8Qr15wXBiNTETs66JGg/m75miuZuwUAk6FM9mK8T9g/7umkbP7Z8lfS/gQ\n         lIMH3KlN/5E/6Nvm2NBmsJ6+DDir43o24BcwX1lPucXJppfyxrtO+VBQopPToX3h3ALR\n         hD/B4wrFjAr7Y8m22hipeXVOlpcZPf22E7oOmD0AeuliT3v7/iuN7rIZv49yMhI2gJ6r\n         Z2jod/s8He7tZL3gIKALOtHreDA0VU7VWg7ZKSx0Xbg1LwODpsHAM+k6hJSeI3M/xF2r\n         FQmg=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777524965; x=1778129765;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=hZxnkrx+q3r3GUhvWqZ8MCXy5Ku/x8WkE9Au9n1POVg=;\n        b=XXjBuya5l6Ybwg+uTaX8u55KzrXwtzj28TvquVt13gn/rdfhEd6yE1tWZ4we91LJC8\n         q+Odwqy7IqgdSiKqCxaGW0tJOv50zVc+gzLtORPUPaXYoRx+kF8C9n6sHuxr4NM19k/J\n         jWToKTBb6qQTxr+c/5+pTtRjxXPxF1U5bv3wSDT/8l3slxTGwmEB8QSFicFnnuc1ZBC3\n         Dpu/o1qRQ/AkPKHGz8WPwLdjfy5WOG0Jj5XaNQetVy5RuyzijhqEoMw1p5eUP8NpGSYj\n         J4qIIHyQmyuUZT/3k5ThWmbK2BpAzAQvTQbuFgmQuAC385EnVt6H5QSxkAPNf4Kae09G\n         +FnA==",
        "X-Gm-Message-State": "AOJu0YzktZR3IL37mIoZZLD6MzHuZ61OLf8cGJN7us7OeX62LyH71MFI\n\tgT6Qpj2NKr+T4qvJtrAeBNc+CxSFklUely88U71dwJUE8yZ+0rBeRPkgBBkQow==",
        "X-Gm-Gg": "AeBDietu5dGCL+s6jGZwodzv+X342FCiA3aQLUePWDCcdYIHYQMFKaInYR+44P1pU37\n\t7EN5mf1qL8VwaR6izNYjGsWlT6pEWbI6D9MdgygkUx08+Q34Xk2fAatgboRvVTgkZPnuaJRKNoJ\n\tBxx/U6DMdAWtHkhwY98osFEc+WO87+gQV+xc/wHBpqr7pYYp5K47rPoAzgQ71m3dj6CEQeuqwEL\n\t7lZPdsrPdgVG4IKq5EyRYJY1JMwBg1KO4M+A4eY/LcenaghUQE9TjCyKWRxH17MtkWBWYpNdsXx\n\tgTklDYyRpSNeeGA76qXc6gj9ltYoRp3iwWZT3Vs+6KSO1E6DxDvi/hHVSufPYlBqk/FWLzX2VkW\n\tuiONE3R8sb7k9jpbzAD0Gkvf3Oyj47YFbMo1aCQ72YVRclNgrHXkNSD/0aEKPWBdV362rxY6KKG\n\tAoTju+oBHnqdwx5ey0ym/62e0+E1QCGT3+J9efyEwRiMs=",
        "X-Received": "by 2002:a05:6a00:2293:b0:82a:7dfd:9757 with SMTP id\n d2e1a72fcca58-834fdb55e67mr1743400b3a.4.1777524964816;\n        Wed, 29 Apr 2026 21:56:04 -0700 (PDT)",
        "From": "Nicholas Piggin <npiggin@gmail.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "Nicholas Piggin <npiggin@gmail.com>",
        "Subject": "[PATCH 5/7] lib: sbi: Add pmp_is_enabled() helper",
        "Date": "Thu, 30 Apr 2026 14:55:23 +1000",
        "Message-ID": "<20260430045528.420437-7-npiggin@gmail.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260430045528.420437-1-npiggin@gmail.com>",
        "References": "<20260430045528.420437-1-npiggin@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260430_055609_253649_395BCB00 ",
        "X-CRM114-Status": "GOOD (  11.54  )",
        "X-Spam-Score": "-0.2 (/)",
        "X-Spam-Report": "Spam detection software,\n running on the system \"desiato.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:  Signed-off-by: Nicholas Piggin --- include/sbi/sbi_pmp.h |\n    1 + lib/sbi/riscv_asm.c | 6 +----- lib/sbi/sbi_pmp.c | 9 +++++++++ 3 files\n    changed, 11 insertions(+),\n 5 deletions(-) diff --git a/include/sbi/sbi_pmp.h\n    b/include/sbi/sbi_pmp.h index 66a5cc75..bce62d22 100644 ---\n a/include/sbi/sbi_pmp.h\n    +++ b/include/sbi/sbi_pmp.h @@ -14,6 +14,7 @@ struct pmp { };\n typedef struct\n    pmp [...]\n Content analysis details:   (-0.2 points, 5.0 required)\n  pts rule name              description\n ---- ----------------------\n --------------------------------------------------\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 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\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 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [npiggin(at)gmail.com]\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:433 listed in]\n                             [list.dnswl.org]",
        "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": "Signed-off-by: Nicholas Piggin <npiggin@gmail.com>\n---\n include/sbi/sbi_pmp.h | 1 +\n lib/sbi/riscv_asm.c   | 6 +-----\n lib/sbi/sbi_pmp.c     | 9 +++++++++\n 3 files changed, 11 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/include/sbi/sbi_pmp.h b/include/sbi/sbi_pmp.h\nindex 66a5cc75..bce62d22 100644\n--- a/include/sbi/sbi_pmp.h\n+++ b/include/sbi/sbi_pmp.h\n@@ -14,6 +14,7 @@ struct pmp {\n };\n typedef struct pmp pmp_t;\n \n+bool pmp_is_enabled(pmp_t *pmp);\n int pmp_encode(pmp_t *pmp, unsigned long prot, unsigned long addr,\n \t       unsigned long log2len);\n int pmp_decode(pmp_t *pmp, unsigned long *prot, unsigned long *addr,\ndiff --git a/lib/sbi/riscv_asm.c b/lib/sbi/riscv_asm.c\nindex 2fb0f585..c0ad4dbe 100644\n--- a/lib/sbi/riscv_asm.c\n+++ b/lib/sbi/riscv_asm.c\n@@ -353,11 +353,7 @@ int is_pmp_entry_mapped(unsigned long entry)\n \tif (hart_pmp_read(&pmp, entry) != SBI_OK)\n \t\treturn false;\n \n-\t/* If address matching bits are non-zero, the entry is enable */\n-\tif (pmp.cfg & PMP_A)\n-\t\treturn true;\n-\n-\treturn false;\n+\treturn pmp_is_enabled(&pmp);\n }\n \n int pmp_set(unsigned int n, unsigned long prot, unsigned long addr,\ndiff --git a/lib/sbi/sbi_pmp.c b/lib/sbi/sbi_pmp.c\nindex 91eab87f..75b18764 100644\n--- a/lib/sbi/sbi_pmp.c\n+++ b/lib/sbi/sbi_pmp.c\n@@ -28,6 +28,15 @@ static unsigned long ctz(unsigned long x)\n \treturn ret;\n }\n \n+bool pmp_is_enabled(pmp_t *pmp)\n+{\n+\t/* If address matching bits are non-zero, the entry is enable */\n+\tif (pmp->cfg & PMP_A)\n+\t\treturn true;\n+\n+\treturn false;\n+}\n+\n int pmp_encode(pmp_t *pmp, unsigned long prot, unsigned long addr,\n \t       unsigned long log2len)\n {\n",
    "prefixes": [
        "5/7"
    ]
}