{"id":2232541,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2232541/?format=json","web_url":"http://patchwork.ozlabs.org/project/opensbi/patch/20260504173948.1663823-1-raymondmaoca@gmail.com/","project":{"id":67,"url":"http://patchwork.ozlabs.org/api/1.1/projects/67/?format=json","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-1-raymondmaoca@gmail.com>","date":"2026-05-04T17:39:47","name":"[1/2] sbi: add hardware isolation abstraction framework","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7c02d9328446ac8dcb5531a283132b7ddbea8742","submitter":{"id":91989,"url":"http://patchwork.ozlabs.org/api/1.1/people/91989/?format=json","name":"Raymond Mao","email":"raymondmaoca@gmail.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/opensbi/patch/20260504173948.1663823-1-raymondmaoca@gmail.com/mbox/","series":[{"id":502704,"url":"http://patchwork.ozlabs.org/api/1.1/series/502704/?format=json","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/2232541/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2232541/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=MMYYcY+u;\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=DkLH12lj;\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 4g8TS13WWpz1yJV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 05 May 2026 03:40:01 +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 1wJxGy-0000000DsMw-0QA8;\n\tMon, 04 May 2026 17:40:00 +0000","from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e])\n\tby bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux))\n\tid 1wJxGv-0000000DsMP-2YCY\n\tfor opensbi@lists.infradead.org;\n\tMon, 04 May 2026 17:39:58 +0000","by mail-qk1-x72e.google.com with SMTP id\n af79cd13be357-8ea8563c693so492794785a.2\n        for <opensbi@lists.infradead.org>;\n Mon, 04 May 2026 10:39:57 -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.55\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 04 May 2026 10:39:55 -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:Message-Id:Date:Subject:Cc\n\t:To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:\n\tResent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:\n\tList-Owner; bh=0X9mFozXvoCWujgiu6aPiLnqlja9dInq5sfk+qTUlUI=; b=MMYYcY+upGlbHZ\n\t+eqMoov+xn39lF9dFLrygfQrCzlhbjWDsEjzPnWU/4G6k32+VAhWyzcWwZu3R0w2/vTyBdRyrGto4\n\t/DhywaBNY348PlFXkk6XpIPtV3vLtUZ3KP99vQmsYcAgxp8CjqyNwNI5eO9izSzsOlOmMKM02I3F/\n\tPAU7vioZG0rbVVr7/w5oCoHpm3cZ/umMqsYajIHk2l7fSrip95sb4ONRQ9U9HOCu6jO3BxquigT+v\n\twii8VJs4PChkMCrWuFQRNfEbY/IE4dinfRrch8htGDvPSr3kzvb01iGycCXaypyyZpeBFXCpBX++n\n\tAgewA2V22rC8eJpVfBZg==;","v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1777916396; x=1778521196;\n darn=lists.infradead.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=n+sczns6rT7k7ZTW/Xsza1s+PRjeYUk9UDOHXCSrsbc=;\n        b=DkLH12ljEammTnVG1nukNHi9fWeGYUYh8/TF+91mqNibGQKhdDdQUCuLK2RbDJc9ll\n         6E05lDFzE9dwTJ1dZxRtyUBQt1gGgxhVleHTl+KSWi0lu35/yOaCJIY+UCAZXoSymbbR\n         49tAL+fRzKi/hc+8iVg7rZXtqCRVnQM9wVysYscpxHpnMSoum4EFzK1L3P093ZZFte9z\n         QsibTo89F5ed+z1v56fl7LbwtcNrx4+eKomlkx9FsAElK/z4ciCzkr3g9Eucmt3tNYy2\n         ywSaYVItD39u6X/ty9JcI2QNvYRuLiZ5fYi5/tibklLylTIS/Pigi2dNMYGwL+CvIYsD\n         XnEg=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1777916396; x=1778521196;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=n+sczns6rT7k7ZTW/Xsza1s+PRjeYUk9UDOHXCSrsbc=;\n        b=NB0T2cECZL2czmA/bPDdWAhg1Sg0kl99plCHtusdyrTmzsyJhkTpqBCGoV3taOuULG\n         pH56RL0ZgFvDMdAmic1nVtLzJQxsQEyNSU8QbZOPn/qINEUv6zL2CXGylxVoR5JeB8gA\n         mCs8zCyCRIzkhrtNefJBd5Nbcis+wxpRCAtXnquleOysNWzJ8S8twFjWPbsytEg3UDoy\n         yxRACLQgKu589Q0qnEeJ5CKiQ2DFk/r20Bxq4hbR9F3Vnibxpym2RrrBeD5TMclNIRmq\n         iIfB0BjyJXLUt3U6AQNL5XoWaI0bqLAAN3zKFLMfy1OtJOdf43pCl5ew0E/qRtxniCEP\n         X/EQ==","X-Gm-Message-State":"AOJu0YwwSPiKLGH1uPZ0HL+LCTuimekFolIjgZOurYjGXSvLsHdS9wDu\n\tg/vSpOVGGofL6E/fnEKUhWp/OHB4/t7uphY1AlszDHa0rYajcpVKvza7oCPw/FBxA88=","X-Gm-Gg":"AeBDievsSjQOH4nICSrFo6uPwwMVlf6/L3W+1UcNgQxei/ZToo7SniTenKCBlHbyq1q\n\tS9mZL747zCPUYoQMWY5TwmXjpYBXzRbgpfX9q4JR9QOg13mfWtUMf+URKWQe9ooPGn85DsyKbN7\n\tfP9AJN3ui2PzWl69K4aUemy1Jz9X7amDW+n5VCTMCbwMLy8cUSPU8qk9hs0X1LzR/zPBs6bsZqo\n\tJuUn7EmTRToVIdsTTJIpzBUvQ3jywiLlpL+wNU5cuJHusaArewR0vrx/x+MLoYDC9usLXSeQhco\n\tYZHBetYQpmCYP2H902U2DKmZSse7RHNItAh7N7yUwYQY+e7nUAV7gYsjP/W6aainUxnkzAQfCgV\n\tteLGVNyLfVELTz0dBOeLs+7FY6JJiYYFLpRrqjeAD9syutTvKoYAV+lUmFTX0jkO0u1xRVY96Ez\n\tBl2tvpT8noNHmfyhMpr+UKvSsEKtNrFzvxW2dOVU/pMB3MzbHJn4BKMzyG/ZYyouKPt5WDBeLN4\n\tj7tVc9DNMpvxS+cMCDVow==","X-Received":"by 2002:a05:6214:45a1:b0:89c:d7e3:7f01 with SMTP id\n 6a1803df08f44-8b669ac57b9mr174953506d6.48.1777916395974;\n        Mon, 04 May 2026 10:39:55 -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 1/2] sbi: add hardware isolation abstraction framework","Date":"Mon,  4 May 2026 13:39:47 -0400","Message-Id":"<20260504173948.1663823-1-raymondmaoca@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","X-CRM114-Version":"20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 ","X-CRM114-CacheID":"sfid-20260504_103957_671252_999C4272 ","X-CRM114-Status":"GOOD (  19.98  )","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 Introduce a generic hardware-isolation\n registration\n    and dispatch framework for OpenSBI domains. Add boot-time init, per-domain\n    init, domain exit, domain enter and cleanup callbacks,\n and store per-domain\n    mechanism contexts in struct sbi_domain.\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:72e 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\nIntroduce a generic hardware-isolation registration and dispatch\nframework for OpenSBI domains.\n\nAdd boot-time init, per-domain init, domain exit, domain enter and\ncleanup callbacks, and store per-domain mechanism contexts in struct\nsbi_domain.\n\nThis establishes an abstraction that allows multiple hardware\nisolation mechanisms to be composed while keeping core domain model\nand data structures independent from any single platform\nimplementation.\n\nSigned-off-by: Raymond Mao <raymond.mao@riscstar.com>\n---\n include/sbi/sbi_domain.h |   4 +\n include/sbi/sbi_hwiso.h  |  56 +++++++++++++\n lib/sbi/objects.mk       |   1 +\n lib/sbi/sbi_hwiso.c      | 175 +++++++++++++++++++++++++++++++++++++++\n 4 files changed, 236 insertions(+)\n create mode 100644 include/sbi/sbi_hwiso.h\n create mode 100644 lib/sbi/sbi_hwiso.c","diff":"diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h\nindex 02765777..fc7330a6 100644\n--- a/include/sbi/sbi_domain.h\n+++ b/include/sbi/sbi_domain.h\n@@ -14,6 +14,7 @@\n #include <sbi/sbi_types.h>\n #include <sbi/sbi_hartmask.h>\n #include <sbi/sbi_domain_context.h>\n+#include <sbi/sbi_hwiso.h>\n #include <sbi/sbi_rpxy.h>\n \n struct sbi_scratch;\n@@ -199,6 +200,9 @@ struct sbi_domain {\n \tbool system_reset_allowed;\n \t/** Is domain allowed to suspend the system */\n \tbool system_suspend_allowed;\n+\t/** Hardware isolation contexts for registered mechanisms */\n+\tstruct sbi_hwiso_domain_ctx *hwiso_ctxs;\n+\tu32 hwiso_ctx_count;\n \t/** Identifies whether to include the firmware region */\n \tbool fw_region_inited;\n };\ndiff --git a/include/sbi/sbi_hwiso.h b/include/sbi/sbi_hwiso.h\nnew file mode 100644\nindex 00000000..1efdb8c1\n--- /dev/null\n+++ b/include/sbi/sbi_hwiso.h\n@@ -0,0 +1,56 @@\n+/*\n+ * SPDX-License-Identifier: BSD-2-Clause\n+ *\n+ * System-level hardware isolation framework\n+ *\n+ * Copyright (c) 2026 RISCstar Solutions Corporation.\n+ *\n+ * Author: Raymond Mao <raymond.mao@riscstar.com>\n+ */\n+\n+#ifndef __SBI_HWISO_H__\n+#define __SBI_HWISO_H__\n+\n+#include <sbi/sbi_types.h>\n+#include <sbi/sbi_domain.h>\n+\n+struct sbi_hwiso_ops {\n+\tconst char *name;\n+\n+\t/* Boot-time init */\n+\tint (*init)(void *fdt);\n+\n+\t/* Per-domain init (domain_offset refers to domain instance node) */\n+\tint (*domain_init)(void *fdt, int domain_offset,\n+\t\t\t   struct sbi_domain *dom, void **ctx);\n+\n+\t/* Before switching away from a domain */\n+\tvoid (*domain_exit)(const struct sbi_domain *src,\n+\t\t\t    const struct sbi_domain *dst, void *ctx);\n+\n+\t/* After switching into a domain */\n+\tvoid (*domain_enter)(const struct sbi_domain *dst,\n+\t\t\t     const struct sbi_domain *src, void *ctx);\n+\n+\t/* Optional cleanup */\n+\tvoid (*domain_cleanup)(struct sbi_domain *dom, void *ctx);\n+};\n+\n+struct sbi_hwiso_domain_ctx {\n+\tconst struct sbi_hwiso_ops *ops;\n+\tvoid *ctx;\n+};\n+\n+int sbi_hwiso_register(const struct sbi_hwiso_ops *ops);\n+\n+int sbi_hwiso_init(void *fdt);\n+int sbi_hwiso_domain_init(void *fdt, int domain_offset,\n+\t\t\t  struct sbi_domain *dom);\n+\n+void sbi_hwiso_domain_exit(const struct sbi_domain *src,\n+\t\t\t   const struct sbi_domain *dst);\n+void sbi_hwiso_domain_enter(const struct sbi_domain *dst,\n+\t\t\t    const struct sbi_domain *src);\n+void sbi_hwiso_domain_cleanup(struct sbi_domain *dom);\n+\n+#endif /* __SBI_HWISO_H__ */\ndiff --git a/lib/sbi/objects.mk b/lib/sbi/objects.mk\nindex ca312ee2..6091499a 100644\n--- a/lib/sbi/objects.mk\n+++ b/lib/sbi/objects.mk\n@@ -72,6 +72,7 @@ libsbi-objs-y += sbi_domain.o\n libsbi-objs-y += sbi_emulate_csr.o\n libsbi-objs-y += sbi_fifo.o\n libsbi-objs-y += sbi_hart.o\n+libsbi-objs-y += sbi_hwiso.o\n libsbi-objs-y += sbi_heap.o\n libsbi-objs-y += sbi_math.o\n libsbi-objs-y += sbi_hfence.o\ndiff --git a/lib/sbi/sbi_hwiso.c b/lib/sbi/sbi_hwiso.c\nnew file mode 100644\nindex 00000000..6c96dc3e\n--- /dev/null\n+++ b/lib/sbi/sbi_hwiso.c\n@@ -0,0 +1,175 @@\n+/*\n+ * SPDX-License-Identifier: BSD-2-Clause\n+ *\n+ * System-level hardware isolation framework\n+ *\n+ * Copyright (c) 2026 RISCstar Solutions Corporation.\n+ *\n+ * Author: Raymond Mao <raymond.mao@riscstar.com>\n+ */\n+\n+#include <libfdt.h>\n+#include <sbi/sbi_error.h>\n+#include <sbi/sbi_heap.h>\n+#include <sbi/sbi_hwiso.h>\n+#include <sbi/sbi_list.h>\n+\n+struct sbi_hwiso_node {\n+\tconst struct sbi_hwiso_ops *ops;\n+\tstruct sbi_dlist node;\n+};\n+\n+static SBI_LIST_HEAD(hwiso_ops_list);\n+static u32 hwiso_ops_count;\n+\n+static bool hwiso_ops_registered(const struct sbi_hwiso_ops *ops)\n+{\n+\tstruct sbi_hwiso_node *entry;\n+\n+\tsbi_list_for_each_entry(entry, &hwiso_ops_list, node) {\n+\t\tif (entry->ops == ops)\n+\t\t\treturn true;\n+\t}\n+\n+\treturn false;\n+}\n+\n+int sbi_hwiso_register(const struct sbi_hwiso_ops *ops)\n+{\n+\tstruct sbi_hwiso_node *node;\n+\n+\tif (!ops || !ops->name)\n+\t\treturn SBI_EINVAL;\n+\n+\tif (hwiso_ops_registered(ops))\n+\t\treturn SBI_EALREADY;\n+\n+\tnode = sbi_zalloc(sizeof(*node));\n+\tif (!node)\n+\t\treturn SBI_ENOMEM;\n+\n+\tnode->ops = ops;\n+\tSBI_INIT_LIST_HEAD(&node->node);\n+\tsbi_list_add_tail(&node->node, &hwiso_ops_list);\n+\thwiso_ops_count++;\n+\n+\treturn 0;\n+}\n+\n+int sbi_hwiso_init(void *fdt)\n+{\n+\tstruct sbi_hwiso_node *entry;\n+\tint rc;\n+\n+\tsbi_list_for_each_entry(entry, &hwiso_ops_list, node) {\n+\t\tif (!entry->ops->init)\n+\t\t\tcontinue;\n+\n+\t\trc = entry->ops->init(fdt);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int sbi_hwiso_domain_init(void *fdt, int domain_offset,\n+\t\t\t  struct sbi_domain *dom)\n+{\n+\tstruct sbi_hwiso_node *entry;\n+\tstruct sbi_hwiso_domain_ctx *ctxs;\n+\tvoid *ctx;\n+\tu32 idx = 0;\n+\tint rc;\n+\n+\tif (!dom)\n+\t\treturn 0;\n+\n+\tif (!hwiso_ops_count)\n+\t\treturn 0;\n+\n+\tctxs = sbi_calloc(sizeof(*ctxs), hwiso_ops_count);\n+\tif (!ctxs)\n+\t\treturn SBI_ENOMEM;\n+\n+\tdom->hwiso_ctxs = ctxs;\n+\tdom->hwiso_ctx_count = hwiso_ops_count;\n+\n+\tsbi_list_for_each_entry(entry, &hwiso_ops_list, node) {\n+\t\tctxs[idx].ops = entry->ops;\n+\t\tctxs[idx].ctx = NULL;\n+\t\tctx = NULL;\n+\n+\t\tif (entry->ops->domain_init) {\n+\t\t\trc = entry->ops->domain_init(fdt, domain_offset,\n+\t\t\t\t\t\t     dom, &ctx);\n+\t\t\tctxs[idx].ctx = ctx;\n+\t\t\tif (rc) {\n+\t\t\t\tsbi_hwiso_domain_cleanup(dom);\n+\t\t\t\treturn rc;\n+\t\t\t}\n+\t\t}\n+\n+\t\tctxs[idx].ctx = ctx;\n+\t\tidx++;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void sbi_hwiso_domain_exit(const struct sbi_domain *src,\n+\t\t\t   const struct sbi_domain *dst)\n+{\n+\tu32 i;\n+\n+\tif (!src || !src->hwiso_ctxs)\n+\t\treturn;\n+\n+\tfor (i = 0; i < src->hwiso_ctx_count; i++) {\n+\t\tif (!src->hwiso_ctxs[i].ops ||\n+\t\t    !src->hwiso_ctxs[i].ops->domain_exit)\n+\t\t\tcontinue;\n+\n+\t\tsrc->hwiso_ctxs[i].ops->domain_exit(\n+\t\t\t\t\tsrc, dst, src->hwiso_ctxs[i].ctx);\n+\t}\n+}\n+\n+void sbi_hwiso_domain_enter(const struct sbi_domain *dst,\n+\t\t\t    const struct sbi_domain *src)\n+{\n+\tu32 i;\n+\n+\tif (!dst || !dst->hwiso_ctxs)\n+\t\treturn;\n+\n+\tfor (i = 0; i < dst->hwiso_ctx_count; i++) {\n+\t\tif (!dst->hwiso_ctxs[i].ops ||\n+\t\t    !dst->hwiso_ctxs[i].ops->domain_enter)\n+\t\t\tcontinue;\n+\n+\t\tdst->hwiso_ctxs[i].ops->domain_enter(\n+\t\t\t\t\tdst, src, dst->hwiso_ctxs[i].ctx);\n+\t}\n+}\n+\n+void sbi_hwiso_domain_cleanup(struct sbi_domain *dom)\n+{\n+\tu32 i;\n+\n+\tif (!dom || !dom->hwiso_ctxs)\n+\t\treturn;\n+\n+\tfor (i = 0; i < dom->hwiso_ctx_count; i++) {\n+\t\tif (!dom->hwiso_ctxs[i].ops ||\n+\t\t    !dom->hwiso_ctxs[i].ops->domain_cleanup)\n+\t\t\tcontinue;\n+\n+\t\tdom->hwiso_ctxs[i].ops->domain_cleanup(\n+\t\t\t\t\tdom, dom->hwiso_ctxs[i].ctx);\n+\t}\n+\n+\tsbi_free(dom->hwiso_ctxs);\n+\tdom->hwiso_ctxs = NULL;\n+\tdom->hwiso_ctx_count = 0;\n+}\n","prefixes":["1/2"]}