Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2232542/?format=api
{ "id": 2232542, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2232542/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/patch/20260504173948.1663823-2-raymondmaoca@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": "<20260504173948.1663823-2-raymondmaoca@gmail.com>", "date": "2026-05-04T17:39:48", "name": "[2/2] sbi: route domain lifecycle transitions through hwiso hooks", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "fe1e1ecc85e8f22d4b2b46df3231b984023e737b", "submitter": { "id": 91989, "url": "http://patchwork.ozlabs.org/api/1.1/people/91989/?format=api", "name": "Raymond Mao", "email": "raymondmaoca@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/opensbi/patch/20260504173948.1663823-2-raymondmaoca@gmail.com/mbox/", "series": [ { "id": 502704, "url": "http://patchwork.ozlabs.org/api/1.1/series/502704/?format=api", "web_url": "http://patchwork.ozlabs.org/project/opensbi/list/?series=502704", "date": "2026-05-04T17:39:47", "name": "[1/2] sbi: add hardware isolation abstraction framework", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/502704/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2232542/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2232542/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=oBrvld5r;\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=WNGTHHp3;\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 4g8TS60tmJz1yJ9\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 03:40:06 +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 1wJxH2-0000000DsOx-3x2D;\n\tMon, 04 May 2026 17:40:04 +0000", "from mail-qv1-xf2d.google.com ([2607:f8b0:4864:20::f2d])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wJxH0-0000000DsNi-36eT\n\tfor opensbi@lists.infradead.org;\n\tMon, 04 May 2026 17:40:03 +0000", "by mail-qv1-xf2d.google.com with SMTP id\n 6a1803df08f44-8b4000e51fdso41791746d6.1\n for <opensbi@lists.infradead.org>;\n Mon, 04 May 2026 10:40:02 -0700 (PDT)", "from ubuntu.localdomain (172-97-209-197.cpe.distributel.net.\n [172.97.209.197])\n by smtp.gmail.com with ESMTPSA id\n 6a1803df08f44-8b5395c5b4csm128087586d6.16.2026.05.04.10.39.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 04 May 2026 10:40:00 -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=6rNnbSjVyfEa/MRt5sgvnf+3qcs32wbMPzpCC1Q+9ZI=; b=oBrvld5rqX7VuH\n\twdXul5jTZYJJxTUsGzKJ6v8apOd9EaV+eOfWiLWyWsnK0i8Op2XCTPs7HmfXJqGJXM5BYoGFNqZCF\n\tNVcupthmtXT7XGWYr5qu+OUSOcjawEPdxZMNkRW7kcf4uUFRG2z0XSCbUIAuOWM77BmJI5KqKq5x6\n\tVeCwRUCDkJR6ZOA1ZAq5uHUl9gHuhZMScT6CknTZuo9XUuhjEr7wPiKNa/hT3lorRbyESOgYjEtYN\n\tuJhx9maoR8lYBsg1SOE30/6uiMTCf+Tw4BJfOsmKDP/gtKQZU/Lu08Q7757qBi4gUe/Htp0371DhB\n\tSNEx3E62efBzIGiZfZ2A==;", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777916401; x=1778521201;\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=4YQPDoHpiJeQxU3obhCG31jLnUD3j5n+F9vM0AJlLYc=;\n b=WNGTHHp3/l/oPICLkC9bnhwyM/C8zkWzPCuJIKvr3mGy6VUFpcxnkrVr/Sheg8vqxB\n g1ToKPE2Y9Tol1a++KsHKikbO8d24kQdvNUcMphQaiJLCswk+9ks9+35Obf1B3yz6j8a\n nIPm0ZhZ4Iz9zLZabOwoxCoAhP8sAnEjhzUiLeJaFQzs2DCuqzSiwwSOeSF0HaxxYJoE\n w3Ud+mVGjJdIyyNetOpWLbRG1OW73KAVylzsByomNetmVDfEiqxtQINuLM3NqQ+TY+D9\n goI1F+s6rq2dae4UgroB+fCn4dM6hBZ/JCCuaioksNkquwdAFZTvm33hSbzx/9Mypwlg\n i+2A==" ], "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777916401; x=1778521201;\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=4YQPDoHpiJeQxU3obhCG31jLnUD3j5n+F9vM0AJlLYc=;\n b=omYQmJcHjqspvDxbPgZCacatzA4GdxS9/uNttY3UZJxrL6FisfvjLmNZnVq3Br8GKU\n nJvtW1Zjk0gNeWTPzMYqhW+Dheu3zQJZMhxhGOd8g+dOxHt/RTmEhHzvMzhwxb+QvIOY\n pQD+95kHyh6kIxSclWAygMkrsddIHh/K76cfx51euHO5ljoeOe8aciLHQFynXCvIvhk5\n UhB2I3ei9rLv2ru1oe+eZEn1KvHkl6ZrqrlrPLoCvxT/dQWo058dYa+kcftF0tld4VM9\n NCKXws3A/zlD8tyl2gXTiD+Hzr9XO5nckCWz9oJTwHAKXPXxF6XpkxBlovH4KFqksYbt\n 4LAA==", "X-Gm-Message-State": "AOJu0YysrtXDfCYaIe278X0UP4X1fiCdYNy+Z7ibpPGrY3BJtBWvO4m0\n\tfqFWx496OMsVLmVWaL0R2e58ub8l0WjNmnegMjUrLRZVdcT0TscJ4stneAvBdhryxj4=", "X-Gm-Gg": "AeBDiesvLIp+1Bvq76nvVtt8tFGrT8Ll2TpAkZX/9hWNpiz6/kAzAfvBGKehU471QyA\n\tqZciZi0LX5Zc0lkIYNo+XwyUh3SzN4znmAyhSOLt9+hepMdAc09fKeu6+BOU+YXcnfI47lqw7yQ\n\tONFZXgwR2yw9u8I++SPleeii14AMQcbEPgW+nE4oU3x9YMpA69RPhtl5Q5u18r95FivAqdCUeig\n\tX38dOAZPkgi+Kg6VdW5utBi9GmLGZMAM5I2Oz8dvjD4MyHK5PB+XQ5hopyMt83lDfZ0w0cx+aX4\n\tgnV5rjfrC/FAZMC/UFQ4HrP1l1yqbtvfMpnBoKTYJuaoRQRFhqXndJk6qC5pC3aazXzhAg34l9J\n\tZwxNFUCL1nTzwLKkU905toUz03ABRWljIWAznWGy5k+9/ZwMqI/1EH5Z7bbXmNNyaHoEQTk/fwB\n\tj9pl+FQoTjPhXNoYvkcGp5IZOp7iaXo1nzbOQx2gKLsYeCHonyBBFBO4zCpI1iuax0y2pQ5WlAT\n\t3FR2y0kKOGBlq2HYmxOg3WVtnlTg5K0", "X-Received": "by 2002:a05:6214:c2e:b0:8b1:f2b7:cfba with SMTP id\n 6a1803df08f44-8b665ffee1amr173260846d6.1.1777916400374;\n Mon, 04 May 2026 10:40:00 -0700 (PDT)", "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\tanup@brainfault.org,\n\tdhaval@rivosinc.com,\n\tpeter.lin@sifive.com", "Subject": "[PATCH 2/2] sbi: route domain lifecycle transitions through hwiso\n hooks", "Date": "Mon, 4 May 2026 13:39:48 -0400", "Message-Id": "<20260504173948.1663823-2-raymondmaoca@gmail.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20260504173948.1663823-1-raymondmaoca@gmail.com>", "References": "<20260504173948.1663823-1-raymondmaoca@gmail.com>", "MIME-Version": "1.0", "X-CRM114-Version": "20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ", "X-CRM114-CacheID": "sfid-20260504_104002_795928_6F229EA8 ", "X-CRM114-Status": "GOOD ( 14.70 )", "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 Invoke HWISO boot/domain initialization\n during domain finalization and FDT domain population,\n and call mechanism exit/enter\n hooks around domain context switches and secondary hart bring-up.\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:f2d 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_SIGNED Message has a DKIM or DK signature,\n not necessarily valid\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_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\nInvoke HWISO boot/domain initialization during domain finalization\nand FDT domain population, and call mechanism exit/enter hooks\naround domain context switches and secondary hart bring-up.\n\nThis makes hardware-isolation state follow the same lifecycle as PMP\nand domain assignment.\n\nSigned-off-by: Raymond Mao <raymond.mao@riscstar.com>\n---\n lib/sbi/sbi_domain.c | 19 +++++++++++++++++++\n lib/sbi/sbi_domain_context.c | 10 ++++++++++\n lib/sbi/sbi_hsm.c | 5 +++++\n lib/utils/fdt/fdt_domain.c | 7 +++++++\n 4 files changed, 41 insertions(+)", "diff": "diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c\nindex 374ac36b..ef308925 100644\n--- a/lib/sbi/sbi_domain.c\n+++ b/lib/sbi/sbi_domain.c\n@@ -17,6 +17,8 @@\n #include <sbi/sbi_platform.h>\n #include <sbi/sbi_scratch.h>\n #include <sbi/sbi_string.h>\n+#include <sbi/sbi_hwiso.h>\n+#include <sbi_utils/fdt/fdt_helper.h>\n \n /*\n * We allocate an extra element because sbi_domain_for_each() expects\n@@ -695,6 +697,15 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid)\n \tu32 i, dhart;\n \tstruct sbi_domain *dom;\n \tconst struct sbi_platform *plat = sbi_platform_ptr(scratch);\n+\tvoid *fdt = fdt_get_address();\n+\n+\t/* Configure system-level hardware isolation mechanisms at boot */\n+\trc = sbi_hwiso_init(fdt);\n+\tif (rc) {\n+\t\tsbi_printf(\"%s: hw isolation init failed (error %d)\\n\",\n+\t\t\t __func__, rc);\n+\t\treturn rc;\n+\t}\n \n \t/* Initialize and populate domains for the platform */\n \trc = sbi_platform_domains_init(plat);\n@@ -704,6 +715,14 @@ int sbi_domain_finalize(struct sbi_scratch *scratch, u32 cold_hartid)\n \t\treturn rc;\n \t}\n \n+\t/* Prepare root domain hwiso contexts even without DT parsing */\n+\trc = sbi_hwiso_domain_init(fdt, -1, &root);\n+\tif (rc) {\n+\t\tsbi_printf(\"%s: root hw isolation init failed (error %d)\\n\",\n+\t\t\t __func__, rc);\n+\t\treturn rc;\n+\t}\n+\n \t/* Startup boot HART of domains */\n \tsbi_domain_for_each(i, dom) {\n \t\t/* Domain boot HART index */\ndiff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c\nindex a3d3988d..aa7eb01b 100755\n--- a/lib/sbi/sbi_domain_context.c\n+++ b/lib/sbi/sbi_domain_context.c\n@@ -11,6 +11,7 @@\n #include <sbi/sbi_hsm.h>\n #include <sbi/sbi_hart.h>\n #include <sbi/sbi_heap.h>\n+#include <sbi/sbi_hwiso.h>\n #include <sbi/sbi_scratch.h>\n #include <sbi/sbi_string.h>\n #include <sbi/sbi_domain_context.h>\n@@ -33,6 +34,9 @@ static void switch_to_next_domain_context(struct sbi_context *ctx,\n \tstruct sbi_scratch *scratch = sbi_scratch_thishart_ptr();\n \tunsigned int pmp_count = sbi_hart_pmp_count(scratch);\n \n+\t/* Exit first so mechanisms can tear down current domain state. */\n+\tsbi_hwiso_domain_exit(current_dom, target_dom);\n+\n \t/* Assign current hart to target domain */\n \tspin_lock(¤t_dom->assigned_harts_lock);\n \tsbi_hartmask_clear_hartindex(hartindex, ¤t_dom->assigned_harts);\n@@ -50,6 +54,12 @@ static void switch_to_next_domain_context(struct sbi_context *ctx,\n \t}\n \tsbi_hart_pmp_configure(scratch);\n \n+\t/*\n+\t * Enter after PMP reconfiguration so mechanisms can rely on the\n+\t * target domain's base isolation being in effect.\n+\t */\n+\tsbi_hwiso_domain_enter(target_dom, current_dom);\n+\n \t/* Save current CSR context and restore target domain's CSR context */\n \tctx->sstatus\t= csr_swap(CSR_SSTATUS, dom_ctx->sstatus);\n \tctx->sie\t= csr_swap(CSR_SIE, dom_ctx->sie);\ndiff --git a/lib/sbi/sbi_hsm.c b/lib/sbi/sbi_hsm.c\nindex 35c84de2..69d70304 100644\n--- a/lib/sbi/sbi_hsm.c\n+++ b/lib/sbi/sbi_hsm.c\n@@ -19,6 +19,7 @@\n #include <sbi/sbi_hart.h>\n #include <sbi/sbi_hartmask.h>\n #include <sbi/sbi_hsm.h>\n+#include <sbi/sbi_hwiso.h>\n #include <sbi/sbi_init.h>\n #include <sbi/sbi_ipi.h>\n #include <sbi/sbi_platform.h>\n@@ -145,6 +146,7 @@ void __noreturn sbi_hsm_hart_start_finish(struct sbi_scratch *scratch,\n \tunsigned long next_arg1;\n \tunsigned long next_addr;\n \tunsigned long next_mode;\n+\tstruct sbi_domain *dom = sbi_domain_thishart_ptr();\n \tstruct sbi_hsm_data *hdata = sbi_scratch_offset_ptr(scratch,\n \t\t\t\t\t\t\t hart_data_offset);\n \n@@ -157,6 +159,9 @@ void __noreturn sbi_hsm_hart_start_finish(struct sbi_scratch *scratch,\n \tnext_mode = scratch->next_mode;\n \thsm_start_ticket_release(hdata);\n \n+\tif (dom)\n+\t\tsbi_hwiso_domain_enter(dom, NULL);\n+\n \tsbi_hart_switch_mode(hartid, next_arg1, next_addr, next_mode, false);\n }\n \ndiff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c\nindex fa1c3575..ac0074ed 100644\n--- a/lib/utils/fdt/fdt_domain.c\n+++ b/lib/utils/fdt/fdt_domain.c\n@@ -14,6 +14,7 @@\n #include <sbi/sbi_error.h>\n #include <sbi/sbi_hartmask.h>\n #include <sbi/sbi_heap.h>\n+#include <sbi/sbi_hwiso.h>\n #include <sbi/sbi_scratch.h>\n #include <sbi_utils/fdt/fdt_domain.h>\n #include <sbi_utils/fdt/fdt_helper.h>\n@@ -439,6 +440,11 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)\n \telse\n \t\tdom->system_suspend_allowed = false;\n \n+\t/* Parse per-domain hardware isolation configuration */\n+\terr = sbi_hwiso_domain_init(fdt, domain_offset, dom);\n+\tif (err)\n+\t\tgoto fail_free_all;\n+\n \t/* Find /cpus DT node */\n \tcpus_offset = fdt_path_offset(fdt, \"/cpus\");\n \tif (cpus_offset < 0) {\n@@ -483,6 +489,7 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque)\n \treturn 0;\n \n fail_free_all:\n+\tsbi_hwiso_domain_cleanup(dom);\n \tsbi_free(mask);\n fail_free_regions:\n \tsbi_free(dom->regions);\n", "prefixes": [ "2/2" ] }