get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2231983,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2231983/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260501211627.3293126-6-evvoevod@tenstorrent.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/1.2/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": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": "https://github.com/riscv/opensbi/commit/{}"
    },
    "msgid": "<20260501211627.3293126-6-evvoevod@tenstorrent.com>",
    "list_archive_url": null,
    "date": "2026-05-01T21:16:27",
    "name": "[v2,5/5] lib: sbi: hart: Detect and enable Smrnmi before trap-based feature detection",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e67260aa054096e953accf70488bd1f630e078ad",
    "submitter": {
        "id": 92832,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/92832/?format=api",
        "name": "Evgeny Voevodin",
        "email": "evvoevod@tenstorrent.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260501211627.3293126-6-evvoevod@tenstorrent.com/mbox/",
    "series": [
        {
            "id": 502498,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/502498/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=502498",
            "date": "2026-05-01T21:16:26",
            "name": "Add RISC-V Smrnmi extension support",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/502498/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2231983/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2231983/checks/",
    "tags": {},
    "related": [],
    "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=Ee5hOI4k;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n unprotected) header.d=tenstorrent.com header.i=@tenstorrent.com\n header.a=rsa-sha256 header.s=google header.b=XPZLSLGJ;\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 4g6kPg1LvSz1yKR\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 02 May 2026 07:16: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 1wIvE8-00000007grh-3w1w;\n\tFri, 01 May 2026 21:16:48 +0000",
            "from mail-dy1-x1329.google.com ([2607:f8b0:4864:20::1329])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wIvE6-00000007gpb-2wIX\n\tfor opensbi@lists.infradead.org;\n\tFri, 01 May 2026 21:16:47 +0000",
            "by mail-dy1-x1329.google.com with SMTP id\n 5a478bee46e88-2ef397ad64dso47416eec.3\n        for <opensbi@lists.infradead.org>;\n Fri, 01 May 2026 14:16:46 -0700 (PDT)",
            "from ausc-rvsw-c-02.tenstorrent.com ([38.104.49.66])\n        by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2ee3b29b2casm5879308eec.14.2026.05.01.14.16.44\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Fri, 01 May 2026 14:16:45 -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=WpG9DKpNa4OHIsDcIWgQsHvT/kMlnL2ZUM9O9umQAtg=; b=Ee5hOI4kdY5jK/\n\thJ/CKzQNorUJMZrk2bLw75JEX7naodzgMNakLV5hGsrz3q6eYXoTveMOFmqoRDjvzMK+P/1QPLzQD\n\tzSEjjQm2No1nlHJq98GDnHiTn8iuO6I+hH52sQ8Q33lD3lJjxfUWDKIfwMSMP5vURsXp1+At5G5EH\n\tvJAkBkP0AqSF1NABbGYzCbYeUkgdHOxQDIIWyhnUpK3nqgBlgnNqflHVjIzQTovg+ofqumMEwxxze\n\tiu0ff34bIo3AQ1KdmFQUOHSMPHlR8eEClyRbnzKwltvbe72d76iNKNmDv7Dm5ZfzEYPMCeYh010fg\n\thujTiFZyfXSfDY+jLLhg==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=tenstorrent.com; s=google; t=1777670206; x=1778275006;\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=kP9CaZKoRUJBGrl5/DpJge0EPlNAd2uMj/yO07evThE=;\n        b=XPZLSLGJ5MgTVwDv+zLwrToNyaHp3qPQswqZYkQu+tBTeZc/834HIEByc+Z0OMZ8YQ\n         CcyOa4Gb2ZAYBHzYwg1KUQcWmeac11oMm0B64IQ3E2v+o+NEILjCxtED/5dDsdy536Xa\n         Gyozd64JWJSmDt0wzCIwTVfngUiEJd6kgDN5JY42EjNx9RgBpe2tRsdaDh6JzOxcEXnW\n         0whismjuZHfAPEPCc/E4cTtHwHAWqGddF0oFXr90KkQ0qtL+bHwQdcPEzBSq2ZmWjz5q\n         gkTbHWazECAJMjACYriOJsi2TTyvNqc4ctI8LFId3wwuWZk8/b6l7WKHQ3NDkom6EkhY\n         L3mA=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777670206; x=1778275006;\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=kP9CaZKoRUJBGrl5/DpJge0EPlNAd2uMj/yO07evThE=;\n        b=p8AAGEkIcsSpehNu9VK1a7f+wof3f11+VP10u6uaPTi9pCnLI/U8S/JwbrPN7bb7NT\n         9ugPT5CPbhSlgFVELOf6RopSx71PdcVNkKQYL5IK/+bR8zsO9ZF1h+ZKyF51SwBiBeCD\n         QMPsx5SRoY+/04lZs6R6l5aaTPf4Seayar3Wo/h1+83X/D6NKle5iZX3TRIeRJrQ3z3V\n         s0Q3dASukvvHJU/ywlWRN/jvTz07nRyoBK0mCfYlka31PHJthvHesKt8I5Cqr0CLAB+m\n         YlGlGn1Otob9jtiUSuLX4NwFl2iMdIqcgDs78u7jAizp7IaRasbRDMs7fTRb68a/wx78\n         IucA==",
        "X-Gm-Message-State": "AOJu0YygCeKuPpplOrbu8HTuvKcuS0p+ik/HJH/Ub6UyOfQJQnbd3yya\n\tNjAqmY4bq3+ELSEQ7na6wGc3bbDv1JGcubD1NXonsiMiu3SCLYr1VYqUJIb0aU2MuNnVEG4a/0A\n\tiBWwD",
        "X-Gm-Gg": "AeBDiet5AgJa1kEkizX12dnAbMZA332T6Q44IohnaG6DQdzu/HEHDNPjlIarh3IudTp\n\tJbJBbQjEygUcZ57LDFfMBWZ2YSWyeLmBP/v1yniDmPb7iFCga3RDt1MlD6tgDRD80nltMGFmyC6\n\tdPaGTcTmS1yrvVP9Ivdc0shtGUEK7MOTkiwRGscbx4Fwlf1aG3koadgiORW2Nneb8IAFDEgzTp4\n\t/XMPsFcYcU5CY6sO/ps9ly/cKyAyy0oimeWX3RY35lsznZdByzvHiMwkOFniD/Wgz0x1LNCoEZ4\n\tKRu1bauCFmJ0bAhBlxVSvfQdypy52eHszCFlB3iot/nmyZkubb7nECZHiv2NfxRDgZ/nVoJuv/a\n\taMxQMYaMp1Dy4KdFIQ2OhM+2nANm8C90cAvjYSw57y4grTAT2/TvLaohsmsH/pU8MSLBUqdL7IU\n\tgcNQwcSPB8ucisd66ra1BAnEI+yXj/dQrmst/wUGLx25XsV2DUpPw5On2myudi",
        "X-Received": "by 2002:a05:7300:7fa2:b0:2dc:e799:934f with SMTP id\n 5a478bee46e88-2efb9c896dcmr218384eec.3.1777670205550;\n        Fri, 01 May 2026 14:16:45 -0700 (PDT)",
        "From": "Evgeny Voevodin <evvoevod@tenstorrent.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "Anup Patel <anup@brainfault.org>,\n\tNylon Chen <nylon.chen@sifive.com>,\n\tevvoevod@tenstorrent.com",
        "Subject": "[PATCH v2 5/5] lib: sbi: hart: Detect and enable Smrnmi before\n trap-based feature detection",
        "Date": "Fri,  1 May 2026 21:16:27 +0000",
        "Message-ID": "<20260501211627.3293126-6-evvoevod@tenstorrent.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20260501211627.3293126-1-evvoevod@tenstorrent.com>",
        "References": "<20260501211627.3293126-1-evvoevod@tenstorrent.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260501_141646_744992_0B5284CA ",
        "X-CRM114-Status": "GOOD (  13.31  )",
        "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:  The location of the RNMI/E trap vectors in the Smrnmi\n extension\n    is implementation-defined,\n so platforms with vendor-specific NMI vector mechanisms\n    must install the firmware's NMI entry points themselv [...]\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:1329 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_SIGNED            Message has a DKIM or DK signature,\n not necessarily valid\n -0.1 DKIM_VALID             Message has at least one valid DKIM or DK\n signature\n -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%\n                             [score: 0.0000]",
        "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": "The location of the RNMI/E trap vectors in the Smrnmi extension is\nimplementation-defined, so platforms with vendor-specific NMI vector\nmechanisms must install the firmware's NMI entry points themselves.\n\nAdd an smrnmi_handlers_init() callback to sbi_platform_operations that\nreceives the firmware entry points and lets platform code install them\nat the hardware-specific vector locations. Two pointers are passed:\n\n  - _trap_rnmi_handler: the dedicated RNMI entry point that saves\n    context using the Smrnmi MN* CSRs and returns via mnret.\n  - _trap_handler: the regular M-mode trap entry since RNME is taken\n    as a regular M-mode trap with NMIE=0.\n\nWhen Smrnmi is present, install the platform's NMI vectors via the new\ncallback, initialize MNSCRATCH with the per-hart scratch pointer, and\nset MNSTATUS.NMIE.\n\nSmrnmi-enabled platforms must register smrnmi_handlers_init; if the\nextension is detected but no callback is registered, sbi_panic() is\ncalled since enabling NMIs without handlers in place would route\nsubsequent traps into nowhere.\n\nSigned-off-by: Evgeny Voevodin <evvoevod@tenstorrent.com>\n---\n include/sbi/sbi_platform.h |  4 ++++\n lib/sbi/sbi_hart.c         | 20 ++++++++++++++++++++\n 2 files changed, 24 insertions(+)",
    "diff": "diff --git a/include/sbi/sbi_platform.h b/include/sbi/sbi_platform.h\nindex 715df499..fe382b56 100644\n--- a/include/sbi/sbi_platform.h\n+++ b/include/sbi/sbi_platform.h\n@@ -150,6 +150,10 @@ struct sbi_platform_operations {\n \t/** platform specific pmp disable on current HART */\n \tvoid (*pmp_disable)(unsigned int n);\n \n+\t/** platform specific Smrnmi handlers init on current HART */\n+\tvoid (*smrnmi_handlers_init)(void (*rnmi_handler)(void),\n+\t\t\tvoid (*rnme_handler)(void));\n+\n \t/** platform specific Smrnmi NMI handler.\n \t *  Returns SBI_SUCCESS on success, error code if NMI cannot be handled. */\n \tint (*rnmi_handler)(struct sbi_trap_context *tcntx);\ndiff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c\nindex 781161e5..92c602aa 100644\n--- a/lib/sbi/sbi_hart.c\n+++ b/lib/sbi/sbi_hart.c\n@@ -532,6 +532,26 @@ static int hart_detect_features(struct sbi_scratch *scratch)\n \tif (rc)\n \t\treturn rc;\n \n+\tif (sbi_hart_has_extension(scratch, SBI_HART_EXT_SMRNMI)) {\n+\t\tconst struct sbi_platform *plat = sbi_platform_thishart_ptr();\n+\t\tconst struct sbi_platform_operations *ops = sbi_platform_ops(plat);\n+\t\textern void _trap_rnmi_handler(void);\n+\t\textern void _trap_handler(void);\n+\n+\t\tif (!ops || !ops->smrnmi_handlers_init)\n+\t\t\tsbi_panic(\"Smrnmi detected, but platform lacks smrnmi_handlers_init callback\\n\");\n+\n+\t\t/* Reuse _trap_handler for the RNME slot since RNME is taken\n+\t\t * as a regular M-mode trap with NMIE=0. */\n+\t\tops->smrnmi_handlers_init(_trap_rnmi_handler, _trap_handler);\n+\n+\t\t/* Initialize MNSCRATCH for the RNMI handler */\n+\t\tcsr_write(CSR_MNSCRATCH, scratch);\n+\n+\t\t/* Enable NMIs */\n+\t\tcsr_set(CSR_MNSTATUS, MNSTATUS_NMIE);\n+\t}\n+\n #define __check_hpm_csr(__csr, __mask) \t\t\t\t\t  \\\n \toldval = csr_read_allowed(__csr, &trap);\t\t\t  \\\n \tif (!trap.cause) {\t\t\t\t\t\t  \\\n",
    "prefixes": [
        "v2",
        "5/5"
    ]
}