get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2195789,
    "url": "http://patchwork.ozlabs.org/api/patches/2195789/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260211222025.2463312-4-raymondmaoca@gmail.com/",
    "project": {
        "id": 67,
        "url": "http://patchwork.ozlabs.org/api/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": "<20260211222025.2463312-4-raymondmaoca@gmail.com>",
    "list_archive_url": null,
    "date": "2026-02-11T22:20:25",
    "name": "[3/3,NOT-FOR-UPSTREAM] lib: utils: irqchip: add QEMU virt test for APLIC wired IRQs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0190eddef18ad911b6cb80932ac1593a62886ccb",
    "submitter": {
        "id": 91989,
        "url": "http://patchwork.ozlabs.org/api/people/91989/?format=api",
        "name": "Raymond Mao",
        "email": "raymondmaoca@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260211222025.2463312-4-raymondmaoca@gmail.com/mbox/",
    "series": [
        {
            "id": 491914,
            "url": "http://patchwork.ozlabs.org/api/series/491914/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=491914",
            "date": "2026-02-11T22:20:24",
            "name": "APLIC hwirq implementation for irqchip",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/491914/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2195789/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2195789/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=Brx2AcUh;\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=eayG/RVG;\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 4fBCZ04Zh3z1xxF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 12 Feb 2026 09:20:55 +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 1vqIZk-000000017z3-2wHj;\n\tWed, 11 Feb 2026 22:20:48 +0000",
            "from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1vqIZh-000000017xS-2spn\n\tfor opensbi@lists.infradead.org;\n\tWed, 11 Feb 2026 22:20:46 +0000",
            "by mail-qt1-x82a.google.com with SMTP id\n d75a77b69052e-502b0aa36feso13098981cf.1\n        for <opensbi@lists.infradead.org>;\n Wed, 11 Feb 2026 14:20:45 -0800 (PST)",
            "from ubuntu.localdomain (174-138-202-16.cpe.distributel.net.\n [174.138.202.16])\n        by smtp.gmail.com with ESMTPSA id\n d75a77b69052e-50684b6b576sm22824291cf.21.2026.02.11.14.20.43\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Wed, 11 Feb 2026 14:20:44 -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=Ny5JE7PMlfOxlIbx2ZHeN8LYMA8Hvad+eDc63pUL4Lg=; b=Brx2AcUhc/qRGM\n\tyWEmveCqCPutJ1/6Uw+m35D6DFb/h7Xs4FQnfCrPm6W9LsDMUZ5nhac8FOUfYWCOUv/yDjRwFj3im\n\tTVy8EESAxETgaqZRBp2ac9CesY5++9nA2u5/AggN6vZROfOidFTqFejP83DQ5SgV4ELVafd5ppV5z\n\tSKIsTDjjZ2BDVnIZUkzhUB7tFhsiX95xhXnzpNR7+AQfs5W9kcktPpIbUZbY1eXxywoNMp9gfTnWR\n\tBvJTTwXDB5rs2OU4dMG0TI1ZATyQuA5Q08NT/Mgv6I82LFqtDNSxW/ik5oprpCYRJai8YLs9kaZNb\n\tcCOTekJWZQZACUyq4MMw==;",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20230601; t=1770848444; x=1771453244;\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=tO+nLo11wYgJTO3maeIxIIiwI1yITzUy0ZU2IpQfYLw=;\n        b=eayG/RVGpc1q+NRCf8bpDy3a33ykAMHrGZtqr9aljbrwalpzSbBipPdZytVToYXaW0\n         8PDgwBdzhpHATAi122ZHm9Ztsb2cf/AuMXBlx4GMLW2vbfiQBf9l74eqZ/7Li4jKbGrM\n         G1B6FtVyFvtRG5AbmKvexxzq0EAhYV2OV7Y91iKsstfL0rJDrHOH/9QdwL49M0ceC3jd\n         uEL9PgwbDR0yxn0PERelqDs6bEBWWsXof4Iw8B0EydaOhnKzHKRXjKjb21QtprGhcJUu\n         am/Jx9CYauENV62+wT7dxMOvvXnH8Qqg4uXa2P2f26MVzOCvxr+RmrMwpMajZQFyGr5Q\n         5qNw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20230601; t=1770848444; x=1771453244;\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=tO+nLo11wYgJTO3maeIxIIiwI1yITzUy0ZU2IpQfYLw=;\n        b=eRgYxN/LjHkAkKcYpwq4/hPR5L5Qqe4UxJgCLJwZFB4pn25/KOmo0obsZSj1qrRgsW\n         TLBO7AYbkTakrKGhZLSgowPCQm8oW2EGsBip6QAp7+KVIYFA89P4GNZUBmrofZgy7G+V\n         09ybQtrtKdAaEy2Zr6VpUzsBgCBoPdhHY0zX08F9jlLZCeks91rFHS35/Su4E0GD+col\n         4BowhjhBtSMr+cRypv+aVSuk2iKYkH2iO/DWfh/EYBQtzaDpIdGvIXfacaECmA2nakGT\n         Rt0s3Jahmp41ChHkkYJUmNLrxT+cHtMuLkHoogzsVKQ0+MzmnWi+duujbpaQp9ZBnYK3\n         THKA==",
        "X-Gm-Message-State": "AOJu0YxLdwvq9l1vYqeQsm9Uj7WfGd8r+GQABKvlgRKASB+/aPkTd9M0\n\tjITQEG+rLMl9KE1aq1WfKP5IMRoAxPoA7K9hmTejiBBE5EuCogzN7hgCSiStQA==",
        "X-Gm-Gg": "AZuq6aL3uxjgHzMU3NAV9Aq2CJQPylVgEW17b5cl/VgHDXGvJ3etnfVZGf8P1DnwwV4\n\tKvl4ThOyvSnZ9ZwlC3956Jqog32+hmDqTdIrsvIxQduKMYV+bkBtLsGmNQDLQEOEx4kwaPlhDy6\n\trUIVBuQdgVyiSvOIe9WFDVaKMNZc3Gk/bhlINpjtodATyucpMYFmNDKXhVYyNtfohgRgKnz8bnQ\n\tP4v2aKQPTf3CSlFbgRe2UYpgmgXpnn1/oMK9djq3Cd8ZuaK4An5n8To6O3hPoTqvRkkjZfVIk7D\n\tcKga9k8abTsA0cH1D4xMs0ikTDbVCXuy2KQpntPiKelC0o5ypZtaesjL6kR7KSEoOD42+W6sAT2\n\t+d+5LxPGaUMagGxdPQEiUhPzgue+3BtdrwGefguZ44ew0GEwvpTb/n04qRY6McRQbTX5FJucWQa\n\tAGeInzilKvD+soJdGRCSwJlSxU0ZTrBUu/RHxyGaMa49gMLQckuChx4qVMNXyowAYjXz8l3OGJ+\n\t+3ITPOo6bQ4BTurQkyYZA==",
        "X-Received": "by 2002:a05:622a:654:b0:502:ec9e:ded6 with SMTP id\n d75a77b69052e-506934f4a5cmr7404331cf.38.1770848444276;\n        Wed, 11 Feb 2026 14:20:44 -0800 (PST)",
        "From": "Raymond Mao <raymondmaoca@gmail.com>",
        "To": "opensbi@lists.infradead.org",
        "Cc": "scott@riscstar.com,\n\tdave.patel@riscstar.com,\n\traymond.mao@riscstar.com,\n\trobin.randhawa@sifive.com,\n\tsamuel.holland@sifive.com,\n\tanup.patel@qti.qualcomm.com,\n\tanuppate@qti.qualcomm.com,\n\tdhaval@rivosinc.com,\n\tpeter.lin@sifive.com",
        "Subject": "[PATCH 3/3][NOT-FOR-UPSTREAM] lib: utils: irqchip: add QEMU virt test\n for APLIC wired IRQs",
        "Date": "Wed, 11 Feb 2026 17:20:25 -0500",
        "Message-Id": "<20260211222025.2463312-4-raymondmaoca@gmail.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20260211222025.2463312-1-raymondmaoca@gmail.com>",
        "References": "<20260211222025.2463312-1-raymondmaoca@gmail.com>",
        "MIME-Version": "1.0",
        "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ",
        "X-CRM114-CacheID": "sfid-20260211_142045_737730_69076FC2 ",
        "X-CRM114-Status": "GOOD (  13.78  )",
        "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:  From: Raymond Mao Add a QEMU virt specific test for APLIC\n   wired external interrupt handling. When APLIC_QEMU_WIRED_TEST is enabled,\n   this adds a small test hook as a bring-up aid for validating the wired\n interrupt\n    path.\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:82a listed in]\n                             [list.dnswl.org]\n  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record\n -0.0 SPF_PASS               SPF: sender matches 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_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 -0.1 DKIM_VALID_EF          Message has a valid DKIM or DK signature from\n                             envelope-from domain\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                             [raymondmaoca(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": "From: Raymond Mao <raymond.mao@riscstar.com>\n\nAdd a QEMU virt specific test for APLIC wired external interrupt\nhandling.\nWhen APLIC_QEMU_WIRED_TEST is enabled, this adds a small test hook as\na bring-up aid for validating the wired interrupt path.\n\nSigned-off-by: Raymond Mao <raymond.mao@riscstar.com>\n---\n Makefile                  |  3 +++\n lib/utils/irqchip/aplic.c | 44 +++++++++++++++++++++++++++++++++++++++\n 2 files changed, 47 insertions(+)",
    "diff": "diff --git a/Makefile b/Makefile\nindex 46541063..418ee1aa 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -399,6 +399,9 @@ CFLAGS\t\t+=\t$(GENFLAGS)\n CFLAGS\t\t+=\t$(platform-cflags-y)\n CFLAGS\t\t+=\t-fPIE -pie\n CFLAGS\t\t+=\t$(firmware-cflags-y)\n+ifeq ($(APLIC_QEMU_WIRED_TEST),y)\n+CFLAGS\t\t+=\t-DAPLIC_QEMU_WIRED_TEST\n+endif\n \n CPPFLAGS\t+=\t$(GENFLAGS)\n CPPFLAGS\t+=\t$(platform-cppflags-y)\ndiff --git a/lib/utils/irqchip/aplic.c b/lib/utils/irqchip/aplic.c\nindex f0ecef42..63697e14 100644\n--- a/lib/utils/irqchip/aplic.c\n+++ b/lib/utils/irqchip/aplic.c\n@@ -119,6 +119,41 @@ static SBI_LIST_HEAD(aplic_list);\n static void aplic_writel_msicfg(struct aplic_msicfg_data *msicfg,\n \t\t\t\tvoid *msicfgaddr, void *msicfgaddrH);\n \n+#ifdef APLIC_QEMU_WIRED_TEST\n+\n+#define UART_QEMU_MMIO 0x10000000UL\n+\n+static void aplic_test_uart_handler(void)\n+{\n+\tvolatile u8 *uart = (volatile u8 *)UART_QEMU_MMIO;\n+\n+\t/* Drain RX FIFO to clear the interrupt source */\n+\twhile (uart[0x05] & 0x01) {        /* LSR.DR */\n+\t\tu8 ch = uart[0x00];            /* RBR */\n+\n+\t\tsbi_printf(\"[APLIC TEST] UART got '%c'(0x%02x)\\n\",\n+\t\t\t   (ch >= 32 && ch < 127) ? ch : '.', ch);\n+\t}\n+\n+\t/* (Optional) read IIR to acknowledge on some models */\n+\t(void)uart[0x02]; /* IIR is at offset 2 when DLAB=0; */\n+}\n+\n+static void aplic_hwirq_test_run(unsigned long aplic_addr)\n+{\n+\tvolatile u8 *uart = (volatile u8 *)UART_QEMU_MMIO;\n+\n+\t/* UART: enable RX interrupt */\n+\tuart[0x02] = 0x07;          /* FCR enable+clear */\n+\tuart[0x04] |= (1 << 3);     /* MCR.OUT2 */\n+\tuart[0x01] |= 0x01;         /* IER.ERBFI */\n+\twhile (uart[0x05] & 0x01)   /* drain */\n+\t\t(void)uart[0x00];\n+\n+\tsbi_printf(\"[APLIC TEST] Setup done. Type keys now.\\n\");\n+}\n+#endif\n+\n static void aplic_init(struct aplic_data *aplic)\n {\n \tstruct aplic_delegate_data *deleg;\n@@ -245,6 +280,7 @@ static int aplic_check_msicfg(struct aplic_msicfg_data *msicfg)\n \treturn 0;\n }\n \n+#ifdef APLIC_QEMU_WIRED_TEST\n static int aplic_hwirq_handler(u32 hwirq, void *opaque)\n {\n \t(void)opaque;\n@@ -252,8 +288,12 @@ static int aplic_hwirq_handler(u32 hwirq, void *opaque)\n \tsbi_printf(\"[APLIC] Enter registered hwirq %u raw handler callback\\n\",\n \t\t   hwirq);\n \n+\tif (hwirq == 10)\n+\t\taplic_test_uart_handler();\n+\n \treturn SBI_OK;\n }\n+#endif\n \n static inline void *aplic_idc_base(unsigned long aplic_addr, u32 idc_index)\n {\n@@ -501,10 +541,14 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic)\n \n \t/* Attach to the aplic list */\n \tsbi_list_add_tail(&aplic->node, &aplic_list);\n+#ifdef APLIC_QEMU_WIRED_TEST\n \trc = sbi_irqchip_register_handler(&aplic->irqchip, 1, aplic->num_source,\n \t\t\t\t\t  aplic_hwirq_handler, NULL);\n \tif (rc)\n \t\treturn rc;\n \n+\t/* Enable test in M-mode before jumping to any payload */\n+\taplic_hwirq_test_run(aplic->addr);\n+#endif\n \treturn 0;\n }\n",
    "prefixes": [
        "3/3",
        "NOT-FOR-UPSTREAM"
    ]
}