get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2175504,
    "url": "http://patchwork.ozlabs.org/api/1.0/patches/2175504/?format=api",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/1.0/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": "<20251218104243.562667-3-ganboing@gmail.com>",
    "date": "2025-12-18T10:42:38",
    "name": "[v6,2/7] lib: sbi_domain: add sbi_domain_get_oldpmp_flags",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "99d5f497656e11c7e16c1e4ab06de75645360e6c",
    "submitter": {
        "id": 86401,
        "url": "http://patchwork.ozlabs.org/api/1.0/people/86401/?format=api",
        "name": "Bo Gan",
        "email": "ganboing@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20251218104243.562667-3-ganboing@gmail.com/mbox/",
    "series": [
        {
            "id": 485819,
            "url": "http://patchwork.ozlabs.org/api/1.0/series/485819/?format=api",
            "date": "2025-12-18T10:42:37",
            "name": "Initial ESWIN/EIC7700 and Hifive P550 support",
            "version": 6,
            "mbox": "http://patchwork.ozlabs.org/series/485819/mbox/"
        }
    ],
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2175504/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=sIcFp3Av;\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=20230601 header.b=F2Scu2UG;\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 4dX6kJ6WFQz1y2f\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 18 Dec 2025 21:44:56 +1100 (AEDT)",
            "from localhost ([::1] helo=bombadil.infradead.org)\n\tby bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vWBV0-00000008Fha-3TIN;\n\tThu, 18 Dec 2025 10:44:46 +0000",
            "from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vWBUx-00000008Ffe-3ULW\n\tfor opensbi@lists.infradead.org;\n\tThu, 18 Dec 2025 10:44:45 +0000",
            "by mail-pf1-x436.google.com with SMTP id\n d2e1a72fcca58-7f0da2dfeaeso551545b3a.1\n        for <opensbi@lists.infradead.org>;\n Thu, 18 Dec 2025 02:44:43 -0800 (PST)",
            "from m91p.airy.home ([172.92.174.155])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-7fe11d3e004sm2264795b3a.15.2025.12.18.02.44.41\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Thu, 18 Dec 2025 02:44:41 -0800 (PST)"
        ],
        "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=ZzUDw+bMDT59Fug23avqMGOTXFowKyqxK/vy02WZF/Y=; b=sIcFp3AvxR0wvP\n\tRvtTnTMVFZR71o/0iD48GZAmDFNkHL69ZJ/8bC7fXpLpFa2eebq67iTrNHYF5Wdr7hWKxQjJ0gWpC\n\tfElfDVqCg13y5hS1lntsrX+PLNuH7Yl8nnqRvhZU9UxIsP1R4E3zfU/hpPR6vSZQSV7qa49SFOQVl\n\tiD37qbKwWFSNq1z5eKHVZ8YAkQw5IyJWRw2KNhyAn6ZowWWq8Uvgg+SfWuItrFIdhyI2Lt43r+EZz\n\ts4r5AVd8/ecRh4KbVKvqORpjisJV9nEyfL8oriKTMkSndcjS6ptqTFCE8d46b7QKR+EBv1/6oGEjZ\n\tQ+w4aOvGmTD0bdMJOCRg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20230601; t=1766054682; x=1766659482;\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=jLqiYGeyjnoGN73zOcEqpTcaaxyhihIkzIsJb/2ZsyA=;\n        b=F2Scu2UGLYNEWuklpETmfwYdj1y98lzG57AfGMvVYwOuOpRpbUluOPEdj/FFwAz7Kq\n         BX5V2PrbiWsYGTrGBRRdgNI8xPyzlzhRkVRezSDQdVq1m2z7jT/BklyDjpnLH7mSEyP2\n         R3gYimyaHh8LyTMf7aVjGXqFw4iIBvlfgx5zH4MI9gbOweUWBcdUkJ7rDL1l+CFNU9FX\n         h+qvhk+KOb30rvGXSfAM44sx2kHf16PZk4VczuNssRBQlUKT80BOgey6FAfQxcY61mTX\n         ebHYy21Hxae+0SsohQ/nBVESt/gyXwPX7LhT8+NwMYO2NX8HNsBXfL3DwNgznZ+/K8+D\n         Bj9Q=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20230601; t=1766054682; x=1766659482;\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=jLqiYGeyjnoGN73zOcEqpTcaaxyhihIkzIsJb/2ZsyA=;\n        b=b95BmSwI4MWTYaqpWAddRcVU6aqIhSRzqI/dxyoYC/RjuIIWouFpaX9a9l1IHxbgFt\n         JNJ4wUwRZnDSjI0ZiG0yc3hku+zPVtiG+KBS0jJqEqovXwBfMVORC8b5V8RE76SEUSy8\n         P2+u/hptga8TYQl90jpJ1wjv8VwbdYexvivakZh6YVSZOUjvHOezg5DOBQvKEbVfbD5/\n         GeCH8dtO9jwD4YX7XQ9sMKWm+rFvkROxrjdkciBM1IJkbuRSx4ygsm67HhDh/hxeBRZp\n         wysBuAS2NW9X9LapgaZUqwEo60020JKpAvNpm0kL5/XL1hTgcM2d1PEUdp/NnsrsOfih\n         5b6g==",
        "X-Gm-Message-State": "AOJu0Yxt91Vg4ierbJU0riwdJvoX7/U9S+TIzl2PsN2s+xfc3wCimj46\n\tSFgMJdbRd9lKRYJU/kv2C16wKvz102JnFMokfpAPuO0uevmB1FqFd7wY6G1K0Q==",
        "X-Gm-Gg": "AY/fxX61KWQZ1gzTKDZf5bd/iNPHJ3OOEaVRAybfrEG4uNPL3FmidF5yI7qKHVzAHnm\n\tC6UQ1UIJgqN2O4rR71JMBMFcWhL8FQXKQQJpYjDQEl5IjY8YP/CaB7LKQYuHJjnANGcKC7aSBaL\n\t7RmIX65HuYV4zUniDF32S7jLHdUwsFErkUoX+VPFhmI/ENkP4sz8P/Bym6ti57sIsHSzFhh5Se3\n\tXGSK3+go/t7OF84lp1LAPyQAMIsopYiBuYaQmSc6I99ZX+uw9OW4TqF/FT4FL4oBtVYiY5J3Exo\n\t3GMSy8sjDq6K6lZwmxERO7LF3KVsJIyUI/jHghO2H9WwSRO4Az3cFkC0HDn8HrBCoIXHuepcmQv\n\ttMb6qh0ceeyyu1pD48aw/I4LW+LGRDe55UPBob9CyExHe5hhPFSBzZl9cyZg33SZza0mylpF+Z6\n\tVCxcBWq1DTFHkS",
        "X-Google-Smtp-Source": "\n AGHT+IETBVtLYIa8pbqtYKWq7FXq1NXF56NIRRV9SgU2tOdoNi7JBeeVo0ICXAfyUKKfaYqE9pQF3A==",
        "X-Received": "by 2002:a05:6a00:340b:b0:7f1:4:66b with SMTP id\n d2e1a72fcca58-7f6692aae7cmr19097512b3a.44.1766054682321;\n        Thu, 18 Dec 2025 02:44:42 -0800 (PST)",
        "From": "Bo Gan <ganboing@gmail.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "linmin@eswincomputing.com,\n\tpinkesh.vaghela@einfochips.com,\n\tgaohan@iscas.ac.cn,\n\tsamuel@sholland.org,\n\twangxiang@iscas.ac.cn",
        "Subject": "[PATCH v6 2/7] lib: sbi_domain: add sbi_domain_get_oldpmp_flags",
        "Date": "Thu, 18 Dec 2025 02:42:38 -0800",
        "Message-Id": "<20251218104243.562667-3-ganboing@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20251218104243.562667-1-ganboing@gmail.com>",
        "References": "<20251218104243.562667-1-ganboing@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20251218_024443_874834_C6FB5C26 ",
        "X-CRM114-Status": "GOOD (  12.14  )",
        "X-Spam-Score": "-2.1 (--)",
        "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:  Factor out logic in `sbi_hart_oldpmp_configure` into\n function\n    `sbi_domain_get_oldpmp_flags`, analogous to `sbi_domain_get_smepmp_flags`.\n    Platform specific hart-protection implementation can now levera [...]\n Content analysis details:   (-2.1 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                             [2607:f8b0:4864:20:0:0:0:436 listed in]\n                             [list.dnswl.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 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\n -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from\n author's\n                             domain\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n  0.1 DKIM_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]\n  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail\n provider\n                             [ganboing(at)gmail.com]",
        "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": "Factor out logic in `sbi_hart_oldpmp_configure` into function\n`sbi_domain_get_oldpmp_flags`, analogous to `sbi_domain_get_smepmp_flags`.\nPlatform specific hart-protection implementation can now leverage it.\n\nSigned-off-by: Bo Gan <ganboing@gmail.com>\n---\n include/sbi/sbi_domain.h |  7 +++++++\n lib/sbi/sbi_domain.c     | 22 ++++++++++++++++++++++\n lib/sbi/sbi_hart_pmp.c   | 17 +----------------\n 3 files changed, 30 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h\nindex 1196d609..3360e090 100644\n--- a/include/sbi/sbi_domain.h\n+++ b/include/sbi/sbi_domain.h\n@@ -253,6 +253,13 @@ void sbi_domain_memregion_init(unsigned long addr,\n \t\t\t\tunsigned long flags,\n \t\t\t\tstruct sbi_domain_memregion *reg);\n \n+/**\n+ * Return the oldpmp pmpcfg LRWX encoding for the flags in @reg.\n+ *\n+ * @param reg pointer to memory region; its flags field encodes permissions.\n+ */\n+unsigned int sbi_domain_get_oldpmp_flags(struct sbi_domain_memregion *reg);\n+\n /**\n  * Return the Smepmp pmpcfg LRWX encoding for the flags in @reg.\n  *\ndiff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c\nindex 96d10c76..74cc1e3f 100644\n--- a/lib/sbi/sbi_domain.c\n+++ b/lib/sbi/sbi_domain.c\n@@ -121,6 +121,28 @@ void sbi_domain_memregion_init(unsigned long addr,\n \t}\n }\n \n+unsigned int sbi_domain_get_oldpmp_flags(struct sbi_domain_memregion *reg)\n+{\n+\n+\tunsigned int pmp_flags = 0;\n+\n+\t/*\n+\t * If permissions are to be enforced for all modes on\n+\t * this region, the lock bit should be set.\n+\t */\n+\tif (reg->flags & SBI_DOMAIN_MEMREGION_ENF_PERMISSIONS)\n+\t\tpmp_flags |= PMP_L;\n+\n+\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_READABLE)\n+\t\tpmp_flags |= PMP_R;\n+\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_WRITABLE)\n+\t\tpmp_flags |= PMP_W;\n+\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_EXECUTABLE)\n+\t\tpmp_flags |= PMP_X;\n+\n+\treturn pmp_flags;\n+}\n+\n unsigned int sbi_domain_get_smepmp_flags(struct sbi_domain_memregion *reg)\n {\n \tunsigned int pmp_flags = 0;\ndiff --git a/lib/sbi/sbi_hart_pmp.c b/lib/sbi/sbi_hart_pmp.c\nindex 7f970ca3..be459129 100644\n--- a/lib/sbi/sbi_hart_pmp.c\n+++ b/lib/sbi/sbi_hart_pmp.c\n@@ -272,22 +272,7 @@ static int sbi_hart_oldpmp_configure(struct sbi_scratch *scratch)\n \t\tif (!is_valid_pmp_idx(pmp_count, pmp_idx))\n \t\t\treturn SBI_EFAIL;\n \n-\t\tpmp_flags = 0;\n-\n-\t\t/*\n-\t\t * If permissions are to be enforced for all modes on\n-\t\t * this region, the lock bit should be set.\n-\t\t */\n-\t\tif (reg->flags & SBI_DOMAIN_MEMREGION_ENF_PERMISSIONS)\n-\t\t\tpmp_flags |= PMP_L;\n-\n-\t\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_READABLE)\n-\t\t\tpmp_flags |= PMP_R;\n-\t\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_WRITABLE)\n-\t\t\tpmp_flags |= PMP_W;\n-\t\tif (reg->flags & SBI_DOMAIN_MEMREGION_SU_EXECUTABLE)\n-\t\t\tpmp_flags |= PMP_X;\n-\n+\t\tpmp_flags = sbi_domain_get_oldpmp_flags(reg);\n \t\tpmp_addr = reg->base >> PMP_SHIFT;\n \t\tif (pmp_log2gran <= reg->order && pmp_addr < pmp_addr_max) {\n \t\t\tsbi_platform_pmp_set(sbi_platform_ptr(scratch),\n",
    "prefixes": [
        "v6",
        "2/7"
    ]
}