From patchwork Mon Sep 23 11:56:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=p7CKb3Ku; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=oXbf+5YJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1h56XMGz1xsp for ; Mon, 23 Sep 2024 21:57:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1S4FjjJzwlnf6vuTvqKQdCO/NIDZdf3HjthJ3mCmptc=; b=p7CKb3KunHkFgj +7K9yUqliS+E3HPMghfQsEe3JOXwsr/oS8PlCK49zIeKeic4qcdRKXQcaSxzWIfBas/uDUsPX39do s29/y1Y0w9xhx2xC1tsup/NFJThU5HvbCdGlKynXk0Csh9g68rlNGsHT3qmJIExBb/62fzE5YaktH U5jEJbkcSd3/FXgVRdiPRTGZaNRN/yyN5yeaUrqX5+fC4r5lkE+DNf9eMHIvWodxLJAHiigclXFj4 ruvIeIVofFnPtbveg5S2GFye5/T3muoDuEtDsnHJl1ynBiYD/j557+02I9EIWWtfeWzuaP6hJFPS1 LqwYMQDjZhNRljFKL+Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshgr-0000000H7Es-12mZ; Mon, 23 Sep 2024 11:57:17 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgo-0000000H7Dr-04Gy for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:15 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2da4ea973bdso3376571a91.1 for ; Mon, 23 Sep 2024 04:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092633; x=1727697433; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=21+z7E7l4kKgPQwZPtGGIxKmIxYlkBucugO7kUAbUUM=; b=oXbf+5YJKGTFKhr7rmv6Z3a2pzMHERCBg/6lE340KxwcyxZ+EiGDRHALsrb7Q9nd7F UPjHQd+X0AXgtrg/EIln7iPv/tEyRcdHBy9OtzoTGPRy4ASZgo2+8ClSdvq3VoNplkxH mnN2UZT8qXdKtID+RnkLOMZfHosKp1UEGSj2WoHxwNMiIjo5dsoZ9HCbgxqr7lSqoy1o uApmEhgPXIZWtrdiCPtM+NrEKVD1bgFQRC0RGVRiRGXyZj7566eR1F3nvNojLWv2FEP+ 8Lat78ge1n6gjFR3AATQd4jfcALkcc5iotYVDTn7LqarssoYmFnuAD5PebgMsN0Ziqtm DpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092633; x=1727697433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=21+z7E7l4kKgPQwZPtGGIxKmIxYlkBucugO7kUAbUUM=; b=dSj1sjTRunWED7BpL6zXvPYXMqp1QzLLVT0FaAlJtIlie1E+l5bPtscPtN38ztT7W2 +lj9ntXxiy+PaqLLngqXB/j0hrEVkYwTNKw6oGH90fT5CbkwMad4zVBvmdexi+RGp9CX 2xbHangztVJWTklmk9/p4ZMiE8ORHvHYOLzSRnKNqUa5pXqzAflBAT02lc9ZBA/D7mxo TnIv6S/XXNzmLYwAYRrOAyGhZcgfsANpNoqGTUIqB1QVCxhNzjLZb2Ij1fHnNzW7a9ak f8J7P4vkVdynvkt9WIp0ZfSsDgAc5Tp33ctZVxiihtQuwt1XE4PmWZ8LvrYdBogyyM54 HgYQ== X-Forwarded-Encrypted: i=1; AJvYcCVji92WVw6MBHZwDEY10Mm6+Z+XY8U9CLMYsOl0r9MF9z3UxqFYH5a4JdfK9o4qs6J6DkTRkGPw@lists.infradead.org X-Gm-Message-State: AOJu0YxC+g3iNHb/W3NCV/3CWanHv0OSWKfs4fuDr0ciHNxZTubzCVu7 EsYKx6PjI6Iq7cN9s3fwhrlTXiGcSG8MhvhBMbks6uRbQtL+QdhyJTke+BW+Dsk= X-Google-Smtp-Source: AGHT+IGOQjCQ0ZgUTp54+YX6px+dZq/nGtL5k6fieCXXK+wwffR3bNS0j5TNkVnYqPJD1C0t59onUw== X-Received: by 2002:a17:90b:4c50:b0:2dd:92e5:6fc0 with SMTP id 98e67ed59e1d1-2dd92e57600mr8861672a91.30.1727092632821; Mon, 23 Sep 2024 04:57:12 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:12 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 1/9] lib: utils/ipi: Use sbi_domain_root_add_memrange() for ACLINT mswi Date: Mon, 23 Sep 2024 17:26:52 +0530 Message-ID: <20240923115700.381916-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045714_076745_3DD38F43 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update ACLINT mswi driver to use sbi_domain_root_add_memrange() instead of explicity registering m [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1030 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update ACLINT mswi driver to use sbi_domain_root_add_memrange() instead of explicity registering memregions. Signed-off-by: Anup Patel --- lib/utils/ipi/aclint_mswi.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c index 4ae6bb1c..39edacba 100644 --- a/lib/utils/ipi/aclint_mswi.c +++ b/lib/utils/ipi/aclint_mswi.c @@ -84,8 +84,6 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi) u32 i; int rc; struct sbi_scratch *scratch; - unsigned long pos, region_size; - struct sbi_domain_memregion reg; /* Sanity checks */ if (!mswi || (mswi->addr & (ACLINT_MSWI_ALIGN - 1)) || @@ -114,18 +112,12 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi) } /* Add MSWI regions to the root domain */ - for (pos = 0; pos < mswi->size; pos += ACLINT_MSWI_ALIGN) { - region_size = ((mswi->size - pos) < ACLINT_MSWI_ALIGN) ? - (mswi->size - pos) : ACLINT_MSWI_ALIGN; - sbi_domain_memregion_init(mswi->addr + pos, region_size, - (SBI_DOMAIN_MEMREGION_MMIO | - SBI_DOMAIN_MEMREGION_M_READABLE | - SBI_DOMAIN_MEMREGION_M_WRITABLE), - ®); - rc = sbi_domain_root_add_memregion(®); - if (rc) - return rc; - } + rc = sbi_domain_root_add_memrange(mswi->addr, mswi->size, ACLINT_MSWI_ALIGN, + SBI_DOMAIN_MEMREGION_MMIO | + SBI_DOMAIN_MEMREGION_M_READABLE | + SBI_DOMAIN_MEMREGION_M_WRITABLE); + if (rc) + return rc; sbi_ipi_set_device(&aclint_mswi); From patchwork Mon Sep 23 11:56:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988565 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=nUBvWNUe; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=CbFe8yoT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1h60qg0z1xsr for ; Mon, 23 Sep 2024 21:57:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hSN+t6opfC8GUZfpgmbmGzqQHhyi4Jv4gjJzqslRLJU=; b=nUBvWNUeZFVM6H 3b6mgtnqVeZ7d6Lyqw6tw3PBDg9pAHZtNgwltmMrmWjFpxKA+AaYLZfXNNHOJDFPYQFdjYscymVEG iNASpzCwo7FWptH/BmUq8qDNfaNY1d0iN5ktNOX8k5vGRlhshSITD28fx0EvqW3h9smg60ocf4pAc 5R8Yx52iumYhS7I8OTN3gYKugT2zaYeA67FNkOT5s6BvxniF/4gZNzN8zUxcwqaafZaBMjhqBA9CL VwsLVS06CgciBpgEmdAX8NSXYavk0cHUTM0VSXSA32p6bnyLeH5KUM1fz4rSt4ynDRQnvi1HQYz41 W/2ocSeqBHZzOXWj1rMA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshgt-0000000H7FQ-3KK4; Mon, 23 Sep 2024 11:57:19 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgq-0000000H7EY-31Jl for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:18 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2d87196ec9fso2846295a91.1 for ; Mon, 23 Sep 2024 04:57:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092636; x=1727697436; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=2V8SI8napeAt4zo4n8cDwTvhKpc1oiimJnBN0hknaXc=; b=CbFe8yoTWEg7WU2T4CGecaHl/ZaCFDEa/vV2fC0A1CBy+hVbKXsSp0ZvJ4t2F3Dmxo zoG+0CoAOoYuiLDBuBypaVBjwd/EobAN6oOI4urnettQ50HfhYFGydjwKrst1cy4Cyp6 1/g4lrjAVGqZIbP6kK3plrMdjlP2RMqdP5a5+YlYRnipIGP3i7ap+Z6LSycEXf6wHLJi yE+X1dcGjpUIvEIGmoN4hF7Wv14+HKGoXASVZvbXF2tra0p+bvU2djScrM3LEor98QLW N7sk9d7w6zbH6pNdcBYmsoZIrEU3/gm5Z8Kms+wa6uQIBwkWS2YGpkRoxPWecjn/WjlT f/AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092636; x=1727697436; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2V8SI8napeAt4zo4n8cDwTvhKpc1oiimJnBN0hknaXc=; b=OJ7GQ6UhaljRJM474b0e2C30TkWb/LB5zKVWpMCU0P4USV8fddUYle44J1X/NUja5S yUyZv6LzA7vvXJxk/xMNsDmfoDF40SwhMy9npmWf8plnosYUmZeBXzOz5cZ48dYhJExL SmMXwmA2Pm4Wri47O18Mr1wJlcG5YWvINPoHFn0CaJSvbEY5D+6rAA62TZTHygaHE2M4 +aY/15kJR7WftouTcR78ANdMJGW4RY9yYtBwej0LdBvH+xMAVCTcwHajgchasf48nW/t qeGzVg7wAJJmuwNF5CH9rae+xveFCWIEN+362aAQGORvIUOxLHxMDWahjOyfp3UhWAwR XjmA== X-Forwarded-Encrypted: i=1; AJvYcCUlNAnfzOrGiTIMOhaCdZgZBqq5MzOvadJUGqZiweTXYvP++JrSrvxSsjN3tSVETESJwxD3CKsP@lists.infradead.org X-Gm-Message-State: AOJu0YyqoGdnL6vJNOSeWnZ4m384RvQRXfFjKvxHoVCVDaC6PvNhtyeC y1ErH8ALNpKwCtRYVZgcJVAy+ntnvmaiSxE0zDYKDEWzununxSdt20aebzVEFl8= X-Google-Smtp-Source: AGHT+IEwWp1/7xaVZtt2OmsM5fKdjx5Zs9eiEpd3XeJWQw+vhr8LQkbrZnVrzUPKg0Pb6xlTs3SXTg== X-Received: by 2002:a17:90b:890:b0:2de:ecb9:93cd with SMTP id 98e67ed59e1d1-2deecb9950fmr5718330a91.12.1727092636114; Mon, 23 Sep 2024 04:57:16 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:15 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 2/9] lib: utils/irqchip: Use sbi_domain_root_add_memrange() for IMSIC Date: Mon, 23 Sep 2024 17:26:53 +0530 Message-ID: <20240923115700.381916-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045716_783850_FA1F41CF X-CRM114-Status: GOOD ( 10.27 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update IMSIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregi [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1032 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update IMSIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregions. Signed-off-by: Anup Patel --- lib/utils/irqchip/imsic.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/utils/irqchip/imsic.c b/lib/utils/irqchip/imsic.c index bac72d21..ddb372fb 100644 --- a/lib/utils/irqchip/imsic.c +++ b/lib/utils/irqchip/imsic.c @@ -348,7 +348,6 @@ int imsic_data_check(struct imsic_data *imsic) int imsic_cold_irqchip_init(struct imsic_data *imsic) { int i, rc; - struct sbi_domain_memregion reg; /* Sanity checks */ rc = imsic_data_check(imsic); @@ -378,13 +377,12 @@ int imsic_cold_irqchip_init(struct imsic_data *imsic) /* Add IMSIC regions to the root domain */ for (i = 0; i < IMSIC_MAX_REGS && imsic->regs[i].size; i++) { - sbi_domain_memregion_init(imsic->regs[i].addr, - imsic->regs[i].size, - (SBI_DOMAIN_MEMREGION_MMIO | - SBI_DOMAIN_MEMREGION_M_READABLE | - SBI_DOMAIN_MEMREGION_M_WRITABLE), - ®); - rc = sbi_domain_root_add_memregion(®); + rc = sbi_domain_root_add_memrange(imsic->regs[i].addr, + imsic->regs[i].size, + IMSIC_MMIO_PAGE_SZ, + SBI_DOMAIN_MEMREGION_MMIO | + SBI_DOMAIN_MEMREGION_M_READABLE | + SBI_DOMAIN_MEMREGION_M_WRITABLE); if (rc) return rc; } From patchwork Mon Sep 23 11:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=D0JruwpX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=RpGt5p+r; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1h82YCgz1xss for ; Mon, 23 Sep 2024 21:57:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x2Qbh8looc+7HA6LEpVRpMJ9rBkoLaa8bRkdk3jXZ84=; b=D0JruwpXbeAT3i yY4oYB7OPctEHyOPYxyBzF/UNzXPdYtD3UqNfCiYMIOGT2mIgSlC6iKBZoLpPbRQaCpYz0RQjfOW7 pgh2XmZ0Z0ZnboZVOpzIpj2TgJjyMkmxKaKcA57Y74kHtupIVcd3rcfGnnE6gfJnkcHxhHHinRwTF 1vKVGP6LDjmuMDUB+sUd7UDQ9zi2bxxLzHcocRWu1hCOTrzwDVpiwjuczCj6VPtVppzcY6zWugY1I 0MvfQWhDPd+Q8n2NxB4RbthK62xtISxs31XTmcXSRxy7ErFHSRPy8BOIQI2hF4ACQopVSVca7JGHs ghMxWQW4UDx85cr1Rb3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshgx-0000000H7H9-1bdn; Mon, 23 Sep 2024 11:57:23 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgu-0000000H7Fg-38Pf for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:21 +0000 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2d8a7c50607so2714573a91.1 for ; Mon, 23 Sep 2024 04:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092640; x=1727697440; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m+UJsW+g4v3bS124LGQk6KpmlzfCsFT5SZ1UYewXzdc=; b=RpGt5p+rNfrVC2h2CX0IVzM89c4q86PRL+8ZiL2bBus9SWHpE0I2a3W3jE0gCbsMbd t0mogZuc0yeb9t3xQSxuhvPDFDPV+bdHRbieVk8V0PpzY1jkmHb1Qy/5/exAle3qcvQn ahigSS+crjkLvqLsiExEEXLt27SNowSq9gZ57a7ISgJzHV0cyYMLUJvGdnAlVqzpfI/p cRZWR9H/U/KnB1LlLrE2FjLHfqtV8VzPEjpA4REPurI671xl9yr/1oBjWeveA7Gw66m4 3k67EJ7lbTIikID3r7+ZqjLv7oAhgQ+XNEIR3tdv3takwDJeJiYj55eREhXNKM53jHTc z4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092640; x=1727697440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m+UJsW+g4v3bS124LGQk6KpmlzfCsFT5SZ1UYewXzdc=; b=UmYHzv/TJL1LSmveslboIeFb242tPuuTB4XqyS2FPMBw7zd8sJlwUfCCjUeB9CHwva nGBUrN/1tbhrz1FWEkuPgsm3pgohM8X5S9Kzuj7ul+nYGOQIh8BdaEBBDLiWgno/8HH7 OcnlCM8xu80VDu/p88EykPQ6B4tu0118VJ58MCE59aRzFlyaFDBprt0ot+43HaFII18z cREeVTPE9sRD87/JqC7m+1C8I1iGJ9ooakvwQtxVOhfjjlhWT1hfhuDmffiKNqrXJvHY kkDAtb/zmklx+NhQnjAlRBZF+MooerjOJsfTaUZoPC5wH6IEt9ZriMmwH//qljXApVtV 4I8A== X-Forwarded-Encrypted: i=1; AJvYcCWqGEWPl18eRUtaL7RsQmoRD7fz8ltcuAsD3ActBegXMOuW1SO5fGeC8ZwwvpWeHMEsmOXv/sfF@lists.infradead.org X-Gm-Message-State: AOJu0YxkkUk8h4GrspSvUDQWnZEQToZWUHugRBRUQ7zI2uE5y8i06Ik2 ltVX9ahzdjOROk1X7niuHGVtqnyjbWJE/6yti2V7SCxTR92KuvsOeM2Yy7wQTJkJXxHP9FukSYV mPkI= X-Google-Smtp-Source: AGHT+IFOwo6Em05St6NPWe1sSA3tx+y+v/lgq8iG72b9zSGkfuPgv53I9NtbsW0wb5X6iZcTJyca5Q== X-Received: by 2002:a17:90a:4b04:b0:2cf:c9ab:e740 with SMTP id 98e67ed59e1d1-2dd80c13d1emr13622865a91.11.1727092639610; Mon, 23 Sep 2024 04:57:19 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:19 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 3/9] lib: utils/irqchip: Use sbi_domain_root_add_memrange() for APLIC Date: Mon, 23 Sep 2024 17:26:54 +0530 Message-ID: <20240923115700.381916-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045720_808089_570118CF X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update APLIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregi [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1035 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update APLIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregions. Signed-off-by: Anup Patel --- lib/utils/irqchip/aplic.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/utils/irqchip/aplic.c b/lib/utils/irqchip/aplic.c index 10236e7a..28f2f26d 100644 --- a/lib/utils/irqchip/aplic.c +++ b/lib/utils/irqchip/aplic.c @@ -169,7 +169,6 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic) { int rc; u32 i, j, tmp; - struct sbi_domain_memregion reg; struct aplic_delegate_data *deleg; u32 first_deleg_irq, last_deleg_irq; @@ -268,12 +267,10 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic) ((first_deleg_irq < last_deleg_irq) && (last_deleg_irq == aplic->num_source) && (first_deleg_irq == 1))) { - sbi_domain_memregion_init(aplic->addr, aplic->size, - (SBI_DOMAIN_MEMREGION_MMIO | - SBI_DOMAIN_MEMREGION_M_READABLE | - SBI_DOMAIN_MEMREGION_M_WRITABLE), - ®); - rc = sbi_domain_root_add_memregion(®); + rc = sbi_domain_root_add_memrange(aplic->addr, aplic->size, PAGE_SIZE, + SBI_DOMAIN_MEMREGION_MMIO | + SBI_DOMAIN_MEMREGION_M_READABLE | + SBI_DOMAIN_MEMREGION_M_WRITABLE); if (rc) return rc; } From patchwork Mon Sep 23 11:56:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988567 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=0wxj15MP; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=CZnwSW+H; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hD4fKzz1xsg for ; Mon, 23 Sep 2024 21:57:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=69YZcBeQ4Kk8N1fm4+GnjQmxZQv/k/SdobwU4RPW3Xs=; b=0wxj15MPEHLBnq n0kxvs3kn2SuZ3DtCL9xKxACKGuL6R5UcD6OBxjSRxjAsWu5dQMT9u/benpjzoMjCpIwAVxTgGwPa 6z3kyAwEDXY0ryqsy9+GQhuxW/yGTrXrMVkBAswFHCrDso+u51Nt4+PxwSdNu4dURRoFYKPCMepY1 TDlCnsd8KKFr1hlw2q9DmGVpilCoyFH6+0fz0EkSdGRilqOyq3ktcgwEquy9DLa/MvusmkMpPTLax k4ENCVd2xrhnhuNeIB3Ca3ZalttpJbTq6cJKMeIq2GEpWCULzB6Jb3ftLbrAJM3btvbEc86TRSmHO XbBcUVCkXRpjzVx+uSNg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshh0-0000000H7Iy-3xn3; Mon, 23 Sep 2024 11:57:26 +0000 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgy-0000000H7HD-0FaG for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:25 +0000 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7db12af2f31so3549187a12.1 for ; Mon, 23 Sep 2024 04:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092643; x=1727697443; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FiIOjRfCW4r8Jfu1qKzJo1I7w+qBEjIJquusLfl7jZU=; b=CZnwSW+HejR7A4JFwpxq7/FO040GNsV3KaqAL7XLq7e/nRmC3SXTE5o4ZlTZiTOQNd SviChjPYsOaAFw8Pv/PxpVz8xO4iJ0BXO6kabwjwFOXh8aPIhE/9WTY002Jdbzssnrfg WZcEAeLDi6x7b0bIFzqekxzwwVN0ZH3kYBExR350S9nzpdkO1I/Lg2orM/hZIYFQq70H yH8cvNCrT5TmIiKcKXPsJRxsIkb1r6AmX8IEE0zydnaHR9b9SP2TE6I9B762SDqWXmq/ 3nSm1tCYMp5/VXSkP+YB7LXRhjbSrRJE2sdiW3NUeGHhYKJnpmtxKiGAl0jq9i/AsHLk comw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092643; x=1727697443; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FiIOjRfCW4r8Jfu1qKzJo1I7w+qBEjIJquusLfl7jZU=; b=mqq3mz8ACOtilKF3bLQOjDenKAk7+5Nrl6zwcbmcDAa80EhDWSPmpwGDYxmbcBDY9e jvPM6eEHtk7UKTfqH7Yb4QKkXd7E09wUv/cC2MdU2atZq1+BGvRbR/uevMD9PP4xmCM7 nBXgRz6F2yaqB85+5o+Al0e0LH1vbEuz1K8Qnw4H6VsG1UQn5+zb13X2EqvYLHIpeVd4 r8ewM6JLQbifJfS6/i/d3kEkrzVsYiTR8Ke+aVGjWbSa3hE3eaHKmS4AFN2D8cpkB+tL 72nmoO83yTajkAkuD7/WC/i44ICQpfvMIDAgX/12ODvbEu5CmMN2/pDgqSesfix8mhf4 u7qg== X-Forwarded-Encrypted: i=1; AJvYcCUbQXDsx1DPs/+caFsYcZfe3cCwGB6juKGzXjkW7ct8WfDLNwVUrNMRACe6YF73vjmoNgSKwg7A@lists.infradead.org X-Gm-Message-State: AOJu0Ywswtqe63nuPaWVsNk+ZK/tBdlnP/pb9KDxj0MbXRC6M0tpzwpF iKvTf4msRejysSt/clBqTvsTsw7B9QHf7zdSzEijZG0p/Yz5rQTid+SpQ5xJAh1ffJx00H9pZNv pP0g= X-Google-Smtp-Source: AGHT+IHfjGPb2IrGQkaSISSyOAfyEq+O0Yu8BzlRTXESBrxwr6lsGsxJEMf8KYobZtKjL6N3B9aGow== X-Received: by 2002:a17:90b:80c:b0:2d3:bc5e:8452 with SMTP id 98e67ed59e1d1-2dd7f71b8ebmr14145466a91.32.1727092642984; Mon, 23 Sep 2024 04:57:22 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:22 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 4/9] lib: sbi_domain: Make sbi_domain_root_add_memregion() as local function Date: Mon, 23 Sep 2024 17:26:55 +0530 Message-ID: <20240923115700.381916-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045724_170931_28508B91 X-CRM114-Status: GOOD ( 12.16 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memregion() is only used within sbi_domain implementation so make rename and make it a local function. Signed-off-by: Anup Patel --- include/sbi/sbi_domain.h | 10 lib/sbi/sbi_domain.c | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:536 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memregion() is only used within sbi_domain implementation so make rename and make it a local function. Signed-off-by: Anup Patel --- include/sbi/sbi_domain.h | 10 ---------- lib/sbi/sbi_domain.c | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 313ae156..22aa8e50 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -293,16 +293,6 @@ void sbi_domain_dump_all(const char *suffix); int sbi_domain_register(struct sbi_domain *dom, const struct sbi_hartmask *assign_mask); -/** - * Add a memory region to the root domain - * @param reg pointer to the memory region to be added - * - * @return 0 on success - * @return SBI_EALREADY if memory region conflicts with the existing one - * @return SBI_EINVAL otherwise - */ -int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg); - /** * Add a memory range with its flags to the root domain * @param addr start physical address of memory range diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 7198e27e..04e70d3b 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -590,7 +590,7 @@ int sbi_domain_register(struct sbi_domain *dom, return 0; } -int sbi_domain_root_add_memregion(const struct sbi_domain_memregion *reg) +static int root_add_memregion(const struct sbi_domain_memregion *reg) { int rc; bool reg_merged; @@ -668,7 +668,7 @@ int sbi_domain_root_add_memrange(unsigned long addr, unsigned long size, (end - pos) : align; sbi_domain_memregion_init(pos, rsize, region_flags, ®); - rc = sbi_domain_root_add_memregion(®); + rc = root_add_memregion(®); if (rc) return rc; pos += rsize; From patchwork Mon Sep 23 11:56:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988568 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=PxabaJC3; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=mSZcu/5m; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hH1PHnz1xsg for ; Mon, 23 Sep 2024 21:57:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/EWQlHyCkRg9Mi86kzarUZOwKWV1l2agSbrHqs/U3b0=; b=PxabaJC3aV0iF9 LP3myQ8pwNHtyNjC0wEScTdtpGiZilDnaJMFUdPs0tMQPG5grVd9c+cZfaaXfz7rEpDMZaxZeFazD 7eAF9tPuavFKSk/E8l4ByyVdTrrAcJYplvgTmsRCoi0g7EkobwUaEITMXQEku3oTE8DxQO/x/Ba1l zqxgLKfeGV8gwwS+pb/qt430tnHQ4TOG2YBm6YdLdrJi0N2Z2EBGzm7y0Roj6gGJn4clCQGbmKRou t+aJUytNP8ySv4b/gM/nbFkmCG3Fb5Zcoc3wpPferNOhpeg3RWAjSHJayIWQIpgu+zgsqx/NeRSaT nEvOdOg4CT+DftbSK4nw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshh3-0000000H7Kw-2yX5; Mon, 23 Sep 2024 11:57:29 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshh0-0000000H7Iw-46RG for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:28 +0000 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2da55ea8163so2714959a91.1 for ; Mon, 23 Sep 2024 04:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092646; x=1727697446; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HGT1w+ktMIVsxn+v/cgkZPsKjv/cgZ21E9Mhv0R4pFY=; b=mSZcu/5my2Izw9zFQYb/M++tquWKAOpAdOkH7CTQ57ZLXEKuJd73njuolu5IXiNv0Y u4QQJWX7c3Al5LNw1qA/mLl2Adz3ju+3mgjZagvWH4zfUJtXnvtwvQAhHOg2LbeNnNTp eoT7zHv8rbK3VQxVAPw11cXGDNv16hoIuT8NayCDLgZZceHQawZe0FRbQsLWRMx7MlET uFci97Cibs03DTlU94xNQtN3EGEhlUaNV5E5GBDKNB5F+h8VCTWQtqgk907IKAPYy6Mo sz2qJcFCGG+eUipIKh/liE5KmLgU3gTQb1wgq55IA9ez0zeeOsIaUSJLazU7ukDq+TcZ u+wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092646; x=1727697446; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HGT1w+ktMIVsxn+v/cgkZPsKjv/cgZ21E9Mhv0R4pFY=; b=MuvAcRcL8FETlNigV9Ca2zCG8PgGcHMUkaejVoq3gMZJ+H6KaPAGzsUwlzL5Mnhd78 SzeGi2rg/Ig9YlELkr04aRk+5Aabk4z8aeXlVJUZEjtd/M/VMzbh8ylpEsPJ74s5qCtU xPkZ41F03P5nYMB5ESonc8TyrsVSNzfDqesy7MVMC+HVDuR/RiYE2XJswLVf3L4fULUt 1JhNfC2qvSH/DoNKliKibSJ0yL+T1BrPjL9mB4XSa8G0ddNioaq/qjLgSxi0+rt/SN26 ynxIb3iGKvzHYSGARoEwySYEsAOKJjtfpb4WhSLeZoBbr8UxCJDqppy/PzqLwpqjL4V0 PPtw== X-Forwarded-Encrypted: i=1; AJvYcCVI1DD824gCIsM6rp7utHx752Q/hqQVGD10b/apH3zpqxagHwvgtlvWz08K0EHewj+R/rUUYK6w@lists.infradead.org X-Gm-Message-State: AOJu0Yx4GFKaI8M1KWSO94CCDrxQgtS29MUINjZsaHDNYv7cRZTrA0xg ymqHev0o96AySaXyv7JMFBS1ZKdDlBGYGmJck96D4OfCoUWtH0aQX1uQ3wN5JUo= X-Google-Smtp-Source: AGHT+IFLuOMkUFL9xTeNXjpSahR82cnIxGINknSqPttIOOTKwRPSjBqgLRlE7wfCQqTL8wkWLQp1Ug== X-Received: by 2002:a17:90b:1253:b0:2d6:1981:bbf7 with SMTP id 98e67ed59e1d1-2dd80dd5e52mr13672555a91.32.1727092646255; Mon, 23 Sep 2024 04:57:26 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:25 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 5/9] lib: utils/fdt: Use sbi_domain_memregion_init() when parsing domains Date: Mon, 23 Sep 2024 17:26:56 +0530 Message-ID: <20240923115700.381916-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045727_046055_BA6D16E9 X-CRM114-Status: GOOD ( 11.67 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Use sbi_domain_memregion_init() at the time of parsing domains from FDT so that sbi_domain_memregion_init() is always used for setting up all memregions. Signed-off-by: Anup Patel --- lib/utils/fdt/fdt_domain.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1035 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Use sbi_domain_memregion_init() at the time of parsing domains from FDT so that sbi_domain_memregion_init() is always used for setting up all memregions. Signed-off-by: Anup Patel --- lib/utils/fdt/fdt_domain.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c index 4fde50f5..4bc7ed86 100644 --- a/lib/utils/fdt/fdt_domain.c +++ b/lib/utils/fdt/fdt_domain.c @@ -253,8 +253,8 @@ static int __fdt_parse_region(const void *fdt, int domain_offset, u32 val32; u64 val64; const u32 *val; + unsigned long base, order, flags; struct parse_region_data *preg = opaque; - struct sbi_domain_memregion *region; /* * Non-root domains cannot add a region with only M-mode @@ -271,7 +271,6 @@ static int __fdt_parse_region(const void *fdt, int domain_offset, /* Find next region of the domain */ if (preg->max_regions <= preg->region_count) return SBI_ENOSPC; - region = &preg->dom->regions[preg->region_count]; /* Read "base" DT property */ val = fdt_getprop(fdt, region_offset, "base", &len); @@ -279,7 +278,7 @@ static int __fdt_parse_region(const void *fdt, int domain_offset, return SBI_EINVAL; val64 = fdt32_to_cpu(val[0]); val64 = (val64 << 32) | fdt32_to_cpu(val[1]); - region->base = val64; + base = val64; /* Read "order" DT property */ val = fdt_getprop(fdt, region_offset, "order", &len); @@ -288,12 +287,15 @@ static int __fdt_parse_region(const void *fdt, int domain_offset, val32 = fdt32_to_cpu(*val); if (val32 < 3 || __riscv_xlen < val32) return SBI_EINVAL; - region->order = val32; + order = val32; /* Read "mmio" DT property */ - region->flags = region_access & SBI_DOMAIN_MEMREGION_ACCESS_MASK; + flags = region_access & SBI_DOMAIN_MEMREGION_ACCESS_MASK; if (fdt_get_property(fdt, region_offset, "mmio", NULL)) - region->flags |= SBI_DOMAIN_MEMREGION_MMIO; + flags |= SBI_DOMAIN_MEMREGION_MMIO; + + sbi_domain_memregion_init(base, (order == __riscv_xlen) ? ~0UL : BIT(order), + flags, &preg->dom->regions[preg->region_count]); preg->region_count++; From patchwork Mon Sep 23 11:56:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988569 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=W9QOIoI/; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Z2S4cw22; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hN5qKJz1xsg for ; Mon, 23 Sep 2024 21:57:40 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FlSiEmPZoQt0f0iWGoqMzW79SyQgGhs6wRnRuafZGYk=; b=W9QOIoI/18UrHd R/gX0MKdwjdH+yyInXJpGIxWVqC+/CriEtAWy5VSR+vF9gar1vwMu0JJVSL/q2xEsecDvlZGdNj7n 45oBGmxsbejaoCq/N6RwKKUXfhWgIJdTqqGTy+kxfHkXzOh+z25qFO/yX/0OxIh5Q8AIbX3drPNQq dxeGe+Z6ckVCs96fIbDs9IFXqT5E1xenoGtiar8tPwhY4/yLTRO/V+oj5rZzjpRW0VCeqrxAVTc7E MT9iqomTkM2zA5QHfh5zgfxfZNZLaje9lL/fm3Pf3gj+qz0o5Yvk7MUdTB8VcL9pnYU0x31oG1/zD fGcGedXHbblHnw2UkhiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshh7-0000000H7Nd-2w21; Mon, 23 Sep 2024 11:57:33 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshh5-0000000H7Lc-0OTp for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:32 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2054feabfc3so36943585ad.1 for ; Mon, 23 Sep 2024 04:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092650; x=1727697450; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NaG3pWgu0ZagDplr0T8691C+NQzct8WP4yVue2xDTxo=; b=Z2S4cw2274ParDhVgQqMAAWpJsdld67Lam2h3701dWJsrWDe9cQ75mj9sYf01kb87P YUC9VoJV5qLY33fTce3dks7MS3c7DiNU9hrtpCVIxPjxAehPn+aWXswnMGYq5ILjAyZx 7lWKnuLJJDXiQ3WQ5FPkrFzl/SyOErtKy7imqkHKHI2QR1rxDhz2oTaABtIQ0UnBh6wh Zsh3jydLxHr1e+uPQXdpH6XcpWNp6yCiqKnId8tOAlqWSQMOeWA34ZLxFRnIHDGh4ghb XRPM9Llq42wsoeoXFBCejmN94gHgc1Y4hvuDhl/dXWLVRY8/wZ3k0SnvLsWJMCmu0aHt jjRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092650; x=1727697450; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NaG3pWgu0ZagDplr0T8691C+NQzct8WP4yVue2xDTxo=; b=OevUeH43s0E0CaBqJrfK7qo+VRpt2+d9L1Z6xGoUeCL1Pcp7WilYwzXeMvOaHB5YXf jUCJc1MVTTDqbNJVZ9uK3oY33I3DCwxdnw0mEluZTR9a4nPNKK1jBjNuO7Al9f0Ujizd QGHDQsVCI+/sVwi2gUMrmFSHaSZt0m6Y2JQz492TTBN5bgAwORXOfJRUtjtpNWPB5+q/ UQIwcVZy6KyyR+sB8TWFb+ZRnDapauIrNMyuROjhKdLKdPy/8xPZRovkGRL9+RipQTHH asFJJn7hPIhNSVbJW8kF8AuZRWhhxQvGJ8HoD39d74f9NdEI3xTyvIR5XhUr58JbK1Yk Ct9A== X-Forwarded-Encrypted: i=1; AJvYcCUGHcW+r5PHJ1Bqe9+ZWnOQZbKRL43o9hNq45sN/LOwA0QIxy1FzJg5cTcqkOm9nKfVtfvWx3N9@lists.infradead.org X-Gm-Message-State: AOJu0YyMSXaVphFfNUguuGF5fg2hfgPbVBvnXTZ64BOATtNTubA5YxCp JPIAc9mal4q8EYU3nslf6ovP5C/ExLrKskO6Ho6kCNslA8ThgewpX1imoGV+RRmFWEVaidR+0fE OVfE= X-Google-Smtp-Source: AGHT+IEJc01lF00GYUpvJbj3HLgosV63n47k2O0zuj+Q1HLUrntvtU+i03VBWIPkq4plW0VuyT3gsw== X-Received: by 2002:a17:90a:6fc4:b0:2cb:50fa:b01e with SMTP id 98e67ed59e1d1-2dd80d35f00mr10962758a91.41.1727092649908; Mon, 23 Sep 2024 04:57:29 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:29 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 6/9] include: sbi: Remove cyclic include in sbi_domain_context.h Date: Mon, 23 Sep 2024 17:26:57 +0530 Message-ID: <20240923115700.381916-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045731_203351_04AF1679 X-CRM114-Status: UNSURE ( 9.83 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_context.h includes sbi_domain.h and the sbi_domain.h also includes sbi_domain_context.h. Remove this cyclic include in sbi_domain_context.h. Signed-off-by: Anup Patel --- include/sbi/sbi_domain_context.h | 3 ++- lib/sbi/sbi_domain_context.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:630 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_context.h includes sbi_domain.h and the sbi_domain.h also includes sbi_domain_context.h. Remove this cyclic include in sbi_domain_context.h. Signed-off-by: Anup Patel --- include/sbi/sbi_domain_context.h | 3 ++- lib/sbi/sbi_domain_context.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/sbi/sbi_domain_context.h b/include/sbi/sbi_domain_context.h index 0d25884a..3f43b622 100755 --- a/include/sbi/sbi_domain_context.h +++ b/include/sbi/sbi_domain_context.h @@ -9,7 +9,8 @@ #include #include -#include + +struct sbi_domain; /** Context representation for a hart within a domain */ struct sbi_context { diff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c index 1432e3a8..29e2d280 100755 --- a/lib/sbi/sbi_domain_context.c +++ b/lib/sbi/sbi_domain_context.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include /** * Switches the HART context from the current domain to the target domain. From patchwork Mon Sep 23 11:56:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988570 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=jcfdv8id; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Tsel/4SS; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hR2P7zz1xsg for ; Mon, 23 Sep 2024 21:57:43 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZSNmDOUc4XHg+TpShBwHquz6O1V5fn7232w3xraaAKA=; b=jcfdv8id6+PdLN OwF3Vhi6kPP86c4scTr0P96wP6DTez7IdhzKWbmh8QdCfIVxTC4RxS5JvKaITGXsTZgEfBcNIPEnp DWLbCOFiu3PupCi0dA4vTtNrwfIphs49npEP/atnR0x0GlUIdDlcckmuziR64NLja2+dWWF8Km7y8 krgS2P6troAU52dv/oFozfymz5ZbfHF5Lx4LNG77O+6ExjWhwJiH2C4cWATdhpFkzXU+iMadzvoWZ xTo/iEjB7E44UdRcljzDcDWfLd4Swwh7wkVi7auxBLqQg+hCjiRj0ZmR72rIPpZ45gFYxLaxg4jlF nF2TuKmC1mkmFWSZ/tyw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshhB-0000000H7QN-27ut; Mon, 23 Sep 2024 11:57:37 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshh8-0000000H7Na-0vcn for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:35 +0000 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2da4ea973bdso3376752a91.1 for ; Mon, 23 Sep 2024 04:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092653; x=1727697453; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=41+bb0AJAa5m2e2zH4ksehlYKDsNVaILIDfHcWL8OCU=; b=Tsel/4SS7VGfgqlIRRJlqgtlMKhCyHETW/kvvuesnnuLFNsR3O2YbzCQbYK63ismzN peB0q/T9+hw4Ohke1uYwvtavHYUFSonAe9j0DQmxnGkKSqL0B6OB0H7q3+StjA7RBm3z ZGU4Suplfebl0UgRCGiBc3jzPJyxvpqcSex5iPhwDmOPnys67nqI8eXpK4zV3k+l/AhU AAPrEtTpcHYvF/ckszyFZoBP0rd9qvrorpbfbElulMBj+AMBJePWZFlQtvV8UiYeVqe3 vD1WcVVWdY4itye9UzaDI3GxE+KImuG4M4xM3GqOkcRuj28qRILxSlfrCLe8+qe8exp6 UrVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092653; x=1727697453; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=41+bb0AJAa5m2e2zH4ksehlYKDsNVaILIDfHcWL8OCU=; b=r37BcnMkS6vmPlGrI/DnMavblLdZirWkiuRBGxymcvzfaNz7Sh1/H7ephM3zVQ40nW KevtSWpEjo02BhyTAN2nGYDc8Vd92t59did2GAdZF0NwfWH2svAPXmx/KoJsydm1qcQb qKCLySn49qkfB/XACPDUn3zW5K4J7y1nOjf89ZJudxM2n9RC6QnTTKHPECgvw24+z+iO y/7nZ+atUpXQmF1cxBxeCVFAfEUnRw1DXmcxUsPNCTjatYk+NjAk9rGyqX68R6UCxo9S +3YfOme29lhfPGBfGFClWJaLaBVToVDyS0ssVgERmthOfbm5LsLY5fvI17iMjOFv8R1r vv0w== X-Forwarded-Encrypted: i=1; AJvYcCUlPIBN05tTaBkUHCTmeKm6X3fyOa0Ed2Uj94gJK7+CQU6uLZUr/7SbB21WmR1uQFxHU/O15Pg4@lists.infradead.org X-Gm-Message-State: AOJu0Yw4ZScPkW4VdI77CF1MPoRpSPEIVpr6Kwg02FHyZFHOgFb29E4V vL4pmsVBqzH6f+x+jixy4U8cC5ssoelgtlebRXeXFfUZc8X4yCrQkZeMRu2v5g0= X-Google-Smtp-Source: AGHT+IHv7M9i2CozqUcCQrGFy9uM/l7AEJfk/NVkZdMp8oRd6kmjPOHDTFICGq8E2lZEOMePcmRxCA== X-Received: by 2002:a17:90a:5143:b0:2db:ec3c:8a0e with SMTP id 98e67ed59e1d1-2dd7f758735mr13522515a91.35.1727092652971; Mon, 23 Sep 2024 04:57:32 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:32 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 7/9] lib: sbi: Introduce domain data Date: Mon, 23 Sep 2024 17:26:58 +0530 Message-ID: <20240923115700.381916-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045734_309000_808051EC X-CRM114-Status: GOOD ( 22.26 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Different parts of OpenSBI require their own per-domain data so introduce domain data (or sbi_domain_data) which can be registered by any part of OpenSBI. Using the domain data, the domain framework w [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1031 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Different parts of OpenSBI require their own per-domain data so introduce domain data (or sbi_domain_data) which can be registered by any part of OpenSBI. Using the domain data, the domain framework will create a data pointer for every domain which can be used to maintain some per-domain state. Signed-off-by: Anup Patel Reviewed-by: Yu Chien Peter Lin --- include/sbi/sbi_domain.h | 3 + include/sbi/sbi_domain_data.h | 93 +++++++++++++++++++++++ lib/sbi/objects.mk | 1 + lib/sbi/sbi_domain.c | 11 +++ lib/sbi/sbi_domain_data.c | 138 ++++++++++++++++++++++++++++++++++ 5 files changed, 246 insertions(+) create mode 100755 include/sbi/sbi_domain_data.h create mode 100755 lib/sbi/sbi_domain_data.c diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 22aa8e50..60d7a776 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -15,6 +15,7 @@ #include #include #include +#include struct sbi_scratch; @@ -163,6 +164,8 @@ struct sbi_domain_memregion { struct sbi_domain { /** Node in linked list of domains */ struct sbi_dlist node; + /** Internal state of per-domain data */ + struct sbi_domain_data_priv data_priv; /** Logical index of this domain */ u32 index; /** HARTs assigned to this domain */ diff --git a/include/sbi/sbi_domain_data.h b/include/sbi/sbi_domain_data.h new file mode 100755 index 00000000..7eeafdce --- /dev/null +++ b/include/sbi/sbi_domain_data.h @@ -0,0 +1,93 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Ventana Micro Systems Inc. + */ + +#ifndef __SBI_DOMAIN_DATA_H__ +#define __SBI_DOMAIN_DATA_H__ + +#include +#include + +struct sbi_domain; + +/** Maximum domain data per-domain */ +#define SBI_DOMAIN_MAX_DATA_PTRS 32 + +/** Representation of per-domain data */ +struct sbi_domain_data_priv { + /** Array of domain data pointers indexed by domain data identifier */ + void *idx_to_data_ptr[SBI_DOMAIN_MAX_DATA_PTRS]; +}; + +/** Representation of a domain data */ +struct sbi_domain_data { + /** + * Head is used for maintaining data list + * + * Note: initialized by domain framework + */ + struct sbi_dlist head; + /** + * Identifier which used to locate per-domain data + * + * Note: initialized by domain framework + */ + unsigned long data_idx; + /** Size of per-domain data */ + unsigned long data_size; + /** Optional callback to setup domain data */ + int (*data_setup)(struct sbi_domain *dom, + struct sbi_domain_data *data, void *data_ptr); + /** Optional callback to cleanup domain data */ + void (*data_cleanup)(struct sbi_domain *dom, + struct sbi_domain_data *data, void *data_ptr); +}; + +/** + * Get per-domain data pointer for a given domain + * @param dom pointer to domain + * @param data pointer to domain data + * + * @return per-domain data pointer + */ +void *sbi_domain_data_ptr(struct sbi_domain *dom, struct sbi_domain_data *data); + +/** + * Setup all domain data for a domain + * @param dom pointer to domain + * + * @return 0 on success and negative error code on failure + * + * Note: This function is used internally within domain framework. + */ +int sbi_domain_setup_data(struct sbi_domain *dom); + +/** + * Cleanup all domain data for a domain + * @param dom pointer to domain + * + * Note: This function is used internally within domain framework. + */ +void sbi_domain_cleanup_data(struct sbi_domain *dom); + +/** + * Register a domain data + * @param hndl pointer to domain data + * + * @return 0 on success and negative error code on failure + * + * Note: This function must be used only in cold boot path. + */ +int sbi_domain_register_data(struct sbi_domain_data *data); + +/** + * Unregister a domain data + * @param hndl pointer to domain data + * + * Note: This function must be used only in cold boot path. + */ +void sbi_domain_unregister_data(struct sbi_domain_data *data); + +#endif diff --git a/lib/sbi/objects.mk b/lib/sbi/objects.mk index 535aa709..0b114bbd 100644 --- a/lib/sbi/objects.mk +++ b/lib/sbi/objects.mk @@ -65,6 +65,7 @@ libsbi-objs-y += sbi_bitmap.o libsbi-objs-y += sbi_bitops.o libsbi-objs-y += sbi_console.o libsbi-objs-y += sbi_domain_context.o +libsbi-objs-y += sbi_domain_data.o libsbi-objs-y += sbi_domain.o libsbi-objs-y += sbi_emulate_csr.o libsbi-objs-y += sbi_fifo.o diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 04e70d3b..22c5c752 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -587,6 +587,15 @@ int sbi_domain_register(struct sbi_domain *dom, } } + /* Setup data for the discovered domain */ + rc = sbi_domain_setup_data(dom); + if (rc) { + sbi_printf("%s: domain data setup failed for %s (error %d)\n", + __func__, dom->name, rc); + sbi_list_del(&dom->node); + return rc; + } + return 0; } @@ -753,6 +762,8 @@ int sbi_domain_init(struct sbi_scratch *scratch, u32 cold_hartid) struct sbi_domain_memregion *root_memregs; const struct sbi_platform *plat = sbi_platform_ptr(scratch); + SBI_INIT_LIST_HEAD(&domain_list); + if (scratch->fw_rw_offset == 0 || (scratch->fw_rw_offset & (scratch->fw_rw_offset - 1)) != 0) { sbi_printf("%s: fw_rw_offset is not a power of 2 (0x%lx)\n", diff --git a/lib/sbi/sbi_domain_data.c b/lib/sbi/sbi_domain_data.c new file mode 100755 index 00000000..04f0edf9 --- /dev/null +++ b/lib/sbi/sbi_domain_data.c @@ -0,0 +1,138 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 Ventana Micro Systems Inc. + */ + +#include +#include +#include +#include + +static SBI_LIST_HEAD(data_list); +static DECLARE_BITMAP(data_idx_bmap, SBI_DOMAIN_MAX_DATA_PTRS); + +void *sbi_domain_data_ptr(struct sbi_domain *dom, struct sbi_domain_data *data) +{ + if (dom && data && data->data_idx < SBI_DOMAIN_MAX_DATA_PTRS) + return dom->data_priv.idx_to_data_ptr[data->data_idx]; + + return NULL; +} + +static int domain_setup_data_one(struct sbi_domain *dom, + struct sbi_domain_data *data) +{ + struct sbi_domain_data_priv *priv = &dom->data_priv; + void *data_ptr; + int rc; + + if (priv->idx_to_data_ptr[data->data_idx]) + return SBI_EALREADY; + + data_ptr = sbi_zalloc(data->data_size); + if (!data_ptr) { + sbi_domain_cleanup_data(dom); + return SBI_ENOMEM; + } + + if (data->data_setup) { + rc = data->data_setup(dom, data, data_ptr); + if (rc) { + sbi_free(data_ptr); + return rc; + } + } + + priv->idx_to_data_ptr[data->data_idx] = data_ptr; + return 0; +} + +static void domain_cleanup_data_one(struct sbi_domain *dom, + struct sbi_domain_data *data) +{ + struct sbi_domain_data_priv *priv = &dom->data_priv; + void *data_ptr; + + data_ptr = priv->idx_to_data_ptr[data->data_idx]; + if (!data_ptr) + return; + + if (data->data_cleanup) + data->data_cleanup(dom, data, data_ptr); + + sbi_free(data_ptr); + priv->idx_to_data_ptr[data->data_idx] = NULL; +} + +int sbi_domain_setup_data(struct sbi_domain *dom) +{ + struct sbi_domain_data *data; + int rc; + + if (!dom) + return SBI_EINVAL; + + sbi_list_for_each_entry(data, &data_list, head) { + rc = domain_setup_data_one(dom, data); + if (rc) { + sbi_domain_cleanup_data(dom); + return rc; + } + } + + return 0; +} + +void sbi_domain_cleanup_data(struct sbi_domain *dom) +{ + struct sbi_domain_data *data; + + if (!dom) + return; + + sbi_list_for_each_entry(data, &data_list, head) + domain_cleanup_data_one(dom, data); +} + +int sbi_domain_register_data(struct sbi_domain_data *data) +{ + struct sbi_domain *dom; + u32 data_idx; + int rc; + + if (!data || !data->data_size) + return SBI_EINVAL; + + for (data_idx = 0; data_idx < SBI_DOMAIN_MAX_DATA_PTRS; data_idx++) { + if (!bitmap_test(data_idx_bmap, data_idx)) + break; + } + if (SBI_DOMAIN_MAX_DATA_PTRS <= data_idx) + return SBI_ENOSPC; + bitmap_set(data_idx_bmap, data_idx, 1); + + data->data_idx = data_idx; + sbi_list_add_tail(&data->head, &data_list); + + sbi_domain_for_each(dom) { + rc = domain_setup_data_one(dom, data); + if (rc) { + sbi_domain_unregister_data(data); + return rc; + } + } + + return 0; +} + +void sbi_domain_unregister_data(struct sbi_domain_data *data) +{ + struct sbi_domain *dom; + + sbi_domain_for_each(dom) + domain_cleanup_data_one(dom, data); + + sbi_list_del(&data->head); + bitmap_clear(data_idx_bmap, data->data_idx, 1); +} From patchwork Mon Sep 23 11:56:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988571 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=kcWrYbld; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Pf/3XiD8; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hV2hw6z1xsg for ; Mon, 23 Sep 2024 21:57:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LP5KZxr5a6L6K6K0PlmZyZKwIfS6d93Oa3NTSblz1n8=; b=kcWrYbldR/ArSk uqwmLxNRalSB2J9VPaAEj0nbdEve5ZjnvZsk7WAtnSZuSUuSnIX1xZMktQ+HBfBN3sL583X55r0Ul DScD0UsAWrmb12B3Vxnj8NE5uqFIcgbZub5KdR/iep5GZ0/JV+KGOTq7g4CHmGG7uzFPmoq1m+55j Qg+GihKTuK07FC9+17J7AT93PlhpHWP/D4Wu94+JiPbnnx35XVG9PUcJ91vsodxucDagVjgvKzDcU ZlOXtdjZab535C0mtEu4Fpj8q/032zkTPzAl/en89zcWH6l8ZfyAkkt2oFXWmDldJZM0sebT3+n7p ueP3oPtUgP7hBFQmmURA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshhE-0000000H7SR-253v; Mon, 23 Sep 2024 11:57:40 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshhB-0000000H7QD-1YiW for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:38 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-7db53a20d1fso2587148a12.0 for ; Mon, 23 Sep 2024 04:57:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092656; x=1727697456; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DaX8/+gNJg8JJ9IqKSfP5fcJjj4yGYID6IkyiNiz03Q=; b=Pf/3XiD8qIioOFFGhdlq1X1QCvJgi981jMf2GgcxgcBUowX+5klyiLekN1KLu+ipdl o5zXCua4KufSs0zeqPIy8OKYDL0u3Sgxwgk7RVDNhdZ6PMc2+Xe+9CfNdYiRo01rD08n Ia38jL9Us0p3Ot7yE/EQ/4cb3KLpWOFDuq464jXYT3yg+L60Y0yd7oIo7izsqqW3Ht2z 52bFYGwe9JlKaaImwAiCTOCyXkAhw8o5GPVp81i7bjm2HLiHdHIipKULJjeDJeeuvs5x NMJ2Q0EfhWTAH1ZzoIlY9EDQbh9G9Ko7jOVstGbmDR18zidTKJK3n6c1SFgX+KbZpcfB ws0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092656; x=1727697456; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DaX8/+gNJg8JJ9IqKSfP5fcJjj4yGYID6IkyiNiz03Q=; b=RNb9yVGDWtHe8A0qRjSYjjCKhwCoqMGVwtdfWjEHae3WmNJrQAiG9D2DIyt689BQ+H EFWbgoLdjBEg4kAtjxOJ3FJUcKA4Cn1JVFU6Mmtv7syFMf0nX5gm13UvF2aG8Q4PZXtl QjeZ/Vdbl+/TljFcxYGYrDNnP6j8M0XrD/p3WG/bgPLB8k5ffoja5buglsh0O8a12S2B sfrZiGR0/mciqi1bOIcGQT1yV2dsvYzAHIoY1EfCUmHsBsMQTnt9IVzNznga/cpg4vaD ygy/KPhQH3fUZgib677WDgXow9NyBw9+sG7iIav6Llmjz0APGPM97j1rbv0aUXEwW/Z+ 43Tg== X-Forwarded-Encrypted: i=1; AJvYcCWZ0kZWE0OdZuIRpuBJyqZYgqRcSUbj3Q3XerANde3JxzsORyfj2cgbrjOmycvIhqaIITO8Tptf@lists.infradead.org X-Gm-Message-State: AOJu0YxuS5TYLHY3xcTxqcCWPktN5SF9RMHGPV3NzemJyPVAGqmUSd85 K2/uffkCTZKnmuVAmGnPA9iwAlocdgOECiEJUPygy4s/BEBoe2cykWlPGdhm+Fw= X-Google-Smtp-Source: AGHT+IH11wevUC27IO/SIlm5vodX+WnMIkIRw4n2m5ajQU3m9bEiNzXGf+8ttWJ5wDsl4oKaltfB2Q== X-Received: by 2002:a17:90b:5248:b0:2cf:c972:7c22 with SMTP id 98e67ed59e1d1-2dd80c64627mr14369986a91.10.1727092656303; Mon, 23 Sep 2024 04:57:36 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:35 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 8/9] lib: sbi_domain: Use domain data support for per-domain hart context Date: Mon, 23 Sep 2024 17:26:59 +0530 Message-ID: <20240923115700.381916-9-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045737_529804_264D275F X-CRM114-Status: GOOD ( 21.03 ) X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The per-domain hartindex_to_context_table[] is yet another per-domain data required for implementing hart entry into (or exit from) domain. Use the recently added domain data support for per-domain hart context so that a dedicated hartindex_to_context_table[] in struct sbi_domain is not needed. Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:529 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The per-domain hartindex_to_context_table[] is yet another per-domain data required for implementing hart entry into (or exit from) domain. Use the recently added domain data support for per-domain hart context so that a dedicated hartindex_to_context_table[] in struct sbi_domain is not needed. Signed-off-by: Anup Patel Reviewed-by: Yu Chien Peter Lin --- include/sbi/sbi_domain.h | 2 - include/sbi/sbi_domain_context.h | 57 +++-------------- lib/sbi/sbi_domain.c | 9 ++- lib/sbi/sbi_domain_context.c | 104 +++++++++++++++++++++++++++---- 4 files changed, 110 insertions(+), 62 deletions(-) diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index 60d7a776..1ecf3116 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -176,8 +176,6 @@ struct sbi_domain { char name[64]; /** Possible HARTs in this domain */ const struct sbi_hartmask *possible_harts; - /** Contexts for possible HARTs indexed by hartindex */ - struct sbi_context *hartindex_to_context_table[SBI_HARTMASK_MAX_BITS]; /** Array of memory regions terminated by a region with order zero */ struct sbi_domain_memregion *regions; /** HART id of the HART booting this domain */ diff --git a/include/sbi/sbi_domain_context.h b/include/sbi/sbi_domain_context.h index 3f43b622..31a3a7f8 100755 --- a/include/sbi/sbi_domain_context.h +++ b/include/sbi/sbi_domain_context.h @@ -8,56 +8,9 @@ #define __SBI_DOMAIN_CONTEXT_H__ #include -#include struct sbi_domain; -/** Context representation for a hart within a domain */ -struct sbi_context { - /** Trap-related states such as GPRs, mepc, and mstatus */ - struct sbi_trap_context trap_ctx; - - /** Supervisor status register */ - unsigned long sstatus; - /** Supervisor interrupt enable register */ - unsigned long sie; - /** Supervisor trap vector base address register */ - unsigned long stvec; - /** Supervisor scratch register for temporary storage */ - unsigned long sscratch; - /** Supervisor exception program counter register */ - unsigned long sepc; - /** Supervisor cause register */ - unsigned long scause; - /** Supervisor trap value register */ - unsigned long stval; - /** Supervisor interrupt pending register */ - unsigned long sip; - /** Supervisor address translation and protection register */ - unsigned long satp; - /** Counter-enable register */ - unsigned long scounteren; - /** Supervisor environment configuration register */ - unsigned long senvcfg; - - /** Reference to the owning domain */ - struct sbi_domain *dom; - /** Previous context (caller) to jump to during context exits */ - struct sbi_context *prev_ctx; - /** Is context initialized and runnable */ - bool initialized; -}; - -/** Get the context pointer for a given hart index and domain */ -#define sbi_hartindex_to_domain_context(__hartindex, __d) \ - (__d)->hartindex_to_context_table[__hartindex] - -/** Macro to obtain the current hart's context pointer */ -#define sbi_domain_context_thishart_ptr() \ - sbi_hartindex_to_domain_context( \ - sbi_hartid_to_hartindex(current_hartid()), \ - sbi_domain_thishart_ptr()) - /** * Enter a specific domain context synchronously * @param dom pointer to domain @@ -75,4 +28,14 @@ int sbi_domain_context_enter(struct sbi_domain *dom); */ int sbi_domain_context_exit(void); +/** + * Initialize domain context support + * + * @return 0 on success and negative error code on failure + */ +int sbi_domain_context_init(void); + +/* Deinitialize domain context support */ +void sbi_domain_context_deinit(void); + #endif // __SBI_DOMAIN_CONTEXT_H__ diff --git a/lib/sbi/sbi_domain.c b/lib/sbi/sbi_domain.c index 22c5c752..ee6e2569 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -781,11 +781,16 @@ int sbi_domain_init(struct sbi_scratch *scratch, u32 cold_hartid) if (!domain_hart_ptr_offset) return SBI_ENOMEM; + /* Initialize domain context support */ + rc = sbi_domain_context_init(); + if (rc) + goto fail_free_domain_hart_ptr_offset; + root_memregs = sbi_calloc(sizeof(*root_memregs), ROOT_REGION_MAX + 1); if (!root_memregs) { sbi_printf("%s: no memory for root regions\n", __func__); rc = SBI_ENOMEM; - goto fail_free_domain_hart_ptr_offset; + goto fail_deinit_context; } root.regions = root_memregs; @@ -850,6 +855,8 @@ fail_free_root_hmask: sbi_free(root_hmask); fail_free_root_memregs: sbi_free(root_memregs); +fail_deinit_context: + sbi_domain_context_deinit(); fail_free_domain_hart_ptr_offset: sbi_scratch_free_offset(domain_hart_ptr_offset); return rc; diff --git a/lib/sbi/sbi_domain_context.c b/lib/sbi/sbi_domain_context.c index 29e2d280..b70db41e 100755 --- a/lib/sbi/sbi_domain_context.c +++ b/lib/sbi/sbi_domain_context.c @@ -14,6 +14,76 @@ #include #include #include +#include + +/** Context representation for a hart within a domain */ +struct hart_context { + /** Trap-related states such as GPRs, mepc, and mstatus */ + struct sbi_trap_context trap_ctx; + + /** Supervisor status register */ + unsigned long sstatus; + /** Supervisor interrupt enable register */ + unsigned long sie; + /** Supervisor trap vector base address register */ + unsigned long stvec; + /** Supervisor scratch register for temporary storage */ + unsigned long sscratch; + /** Supervisor exception program counter register */ + unsigned long sepc; + /** Supervisor cause register */ + unsigned long scause; + /** Supervisor trap value register */ + unsigned long stval; + /** Supervisor interrupt pending register */ + unsigned long sip; + /** Supervisor address translation and protection register */ + unsigned long satp; + /** Counter-enable register */ + unsigned long scounteren; + /** Supervisor environment configuration register */ + unsigned long senvcfg; + + /** Reference to the owning domain */ + struct sbi_domain *dom; + /** Previous context (caller) to jump to during context exits */ + struct hart_context *prev_ctx; + /** Is context initialized and runnable */ + bool initialized; +}; + +struct domain_context_priv { + /** Contexts for possible HARTs indexed by hartindex */ + struct hart_context *hartindex_to_context_table[SBI_HARTMASK_MAX_BITS]; +}; + +static struct sbi_domain_data dcpriv = { + .data_size = sizeof(struct domain_context_priv), +}; + +static inline struct hart_context *hart_context_get(struct sbi_domain *dom, + u32 hartindex) +{ + struct domain_context_priv *dcp = sbi_domain_data_ptr(dom, &dcpriv); + + return (dcp && hartindex < SBI_HARTMASK_MAX_BITS) ? + dcp->hartindex_to_context_table[hartindex] : NULL; +} + +static void hart_context_set(struct sbi_domain *dom, u32 hartindex, + struct hart_context *hc) +{ + struct domain_context_priv *dcp = sbi_domain_data_ptr(dom, &dcpriv); + + if (dcp && hartindex < SBI_HARTMASK_MAX_BITS) { + dcp->hartindex_to_context_table[hartindex] = hc; + } +} + +/** Macro to obtain the current hart's context pointer */ +#define hart_context_thishart_get() \ + hart_context_get(sbi_domain_thishart_ptr(), \ + sbi_hartid_to_hartindex(current_hartid())) /** * Switches the HART context from the current domain to the target domain. @@ -23,8 +93,8 @@ * @param ctx pointer to the current HART context * @param dom_ctx pointer to the target domain context */ -static void switch_to_next_domain_context(struct sbi_context *ctx, - struct sbi_context *dom_ctx) +static void switch_to_next_domain_context(struct hart_context *ctx, + struct hart_context *dom_ctx) { u32 hartindex = sbi_hartid_to_hartindex(current_hartid()); struct sbi_trap_context *trap_ctx; @@ -89,9 +159,9 @@ static void switch_to_next_domain_context(struct sbi_context *ctx, int sbi_domain_context_enter(struct sbi_domain *dom) { - struct sbi_context *ctx = sbi_domain_context_thishart_ptr(); - struct sbi_context *dom_ctx = sbi_hartindex_to_domain_context( - sbi_hartid_to_hartindex(current_hartid()), dom); + struct hart_context *ctx = hart_context_thishart_get(); + struct hart_context *dom_ctx = hart_context_get(dom, + sbi_hartid_to_hartindex(current_hartid())); /* Validate the domain context existence */ if (!dom_ctx) @@ -109,8 +179,8 @@ int sbi_domain_context_exit(void) { u32 hartindex = sbi_hartid_to_hartindex(current_hartid()); struct sbi_domain *dom; - struct sbi_context *ctx = sbi_domain_context_thishart_ptr(); - struct sbi_context *dom_ctx, *tmp; + struct hart_context *ctx = hart_context_thishart_get(); + struct hart_context *dom_ctx, *tmp; /* * If it's first time to call `exit` on the current hart, no @@ -123,16 +193,16 @@ int sbi_domain_context_exit(void) dom->possible_harts)) continue; - dom_ctx = sbi_zalloc(sizeof(struct sbi_context)); + dom_ctx = sbi_zalloc(sizeof(struct hart_context)); if (!dom_ctx) return SBI_ENOMEM; /* Bind context and domain */ dom_ctx->dom = dom; - dom->hartindex_to_context_table[hartindex] = dom_ctx; + hart_context_set(dom, hartindex, dom_ctx); } - ctx = sbi_domain_context_thishart_ptr(); + ctx = hart_context_thishart_get(); } dom_ctx = ctx->prev_ctx; @@ -144,7 +214,7 @@ int sbi_domain_context_exit(void) if (dom == &root || dom == sbi_domain_thishart_ptr()) continue; - tmp = sbi_hartindex_to_domain_context(hartindex, dom); + tmp = hart_context_get(dom, hartindex); if (tmp && !tmp->initialized) { dom_ctx = tmp; break; @@ -154,9 +224,19 @@ int sbi_domain_context_exit(void) /* Take the root domain context if fail to find */ if (!dom_ctx) - dom_ctx = sbi_hartindex_to_domain_context(hartindex, &root); + dom_ctx = hart_context_get(&root, hartindex); switch_to_next_domain_context(ctx, dom_ctx); return 0; } + +int sbi_domain_context_init(void) +{ + return sbi_domain_register_data(&dcpriv); +} + +void sbi_domain_context_deinit(void) +{ + sbi_domain_unregister_data(&dcpriv); +} From patchwork Mon Sep 23 11:57:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988572 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=a4aP9VR+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=W0sJYafz; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1hb3Jk5z1xsg for ; Mon, 23 Sep 2024 21:57:51 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VoTktwHW7KxUb5KFIaYTUU+RYM9Eon8lT7NvjSIHDks=; b=a4aP9VR+7Em6ZJ NsKAFDq3qEovEHk7jdWhgu81Zi8xZGyWs5ug1w8LeT/vqegpc6GniLc7vX9l/B88AdUe29PU/dOMa EJUGKLp581iQ/FcjM5OSCD90x7ripL7ipWxy1NwOVc9x5JGIMdmKZNb1zqBtCQcMwfxIEjBq+WwuY 4Vpdr2tBQRZGhm44ghhJIHMbymksbNAh7LAOq7n7S2GhHgPcvFlKaC5/nyKnnkWdXkloZZdh5+Y9L I179nVxd+XWALbrsu4r3Gcq/mOnKrz4tOW0f5RLY3Rk6OAWnFubmDTbdtmarb3AsPGuTYc67Y19iW EZtaRzg5aQolro60oTBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshhI-0000000H7Vm-0UU3; Mon, 23 Sep 2024 11:57:44 +0000 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshhE-0000000H7SO-37OE for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:42 +0000 Received: by mail-pj1-x102c.google.com with SMTP id 98e67ed59e1d1-2da55ea8163so2715107a91.1 for ; Mon, 23 Sep 2024 04:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092660; x=1727697460; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zscsCpo3poJiOk2cnFqGtti/UbYkGbwiyQWg7yEsqMs=; b=W0sJYafzp3vWjADq3O7ZQmQMzU8bNYdSdAfBzebNggPohlGB9sGrKE67m7i0GnL0T7 PfBJKzo7N9A1Js/gcKkaUXNrK4qxQ5C7yADYiYKHYjzQ6azbSj6PThqWS2zogscxIxLI 0TaSxyGoHOD0qLuRUKhkhslxAEsHkG37C/WGVOwdtuaheriZls4Q7SEgIW2one8MJQpp yt06RTlz7uEOXYlu46oWlaHbS/UvFKUGn95kJjiVx9rukCdstDfIGUnCGYrmhmlvsqop NxmGhyNfPcCNKlosxbXlLKQfZ/c9Zxmmy0ZE7osK88gLCNQg61ahpF+FF4iuOjRHQaiG 1sSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092660; x=1727697460; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zscsCpo3poJiOk2cnFqGtti/UbYkGbwiyQWg7yEsqMs=; b=S/9a/pOYHcmZT7gVAcqWjMU87pzy3E2YhD6EbiT+ZsOeBgtJO3xJ8LlBw9KKKZL1ch jpr6rS7NuCa2r3FZ05ozw7Qr9LEnR5BR7p6jenUHkpp24+oHxpAf/poVjdn96WLaXzC8 L3BZJcWAgpOnyn8VHvmtTQ94yrDYwKwKOycUY6qMx8UlBiu9NYlzFWy8QIVQs9nLElvN CUlrUy5TUHAkz97wpfrEFR8a6Hr9ddMBJ4br+EsaCE+1fGT6WqWgZJClSA9nU916PYYF SodFSSoBZ3YLNFinyI+B2QEUY/DTsxckK08qwNy4WHJJW+bfrbPWt/WwkvkPCXHUeFdw AG6w== X-Forwarded-Encrypted: i=1; AJvYcCW2JgTIimELdfvJHpCMkq+nKl3nLGKGa4aitjpYVqrHpiojiGO9GxZGYXql1yCb5YN+jBRN4gvB@lists.infradead.org X-Gm-Message-State: AOJu0Yz144MbjSlokTxInSeol+widWGd3i3b34ST2DAgi70jv6vZ2oHW vPYhPRFodFJyjp3CsixcSvIyAY8JoTyJA7SMGEoX+LZn+RuOQO4AOUlredtsh2U= X-Google-Smtp-Source: AGHT+IEIZv3GMu4gWxe5EcZPpRIkF8gjMV4WPJiAjsxMQaTb8lNGfjboMtza/Xzka0SyABZlMJ7Beg== X-Received: by 2002:a17:90b:4d0a:b0:2d3:b357:7857 with SMTP id 98e67ed59e1d1-2dd80c682f2mr14017182a91.16.1727092659739; Mon, 23 Sep 2024 04:57:39 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:39 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 9/9] docs: Remove hartindex_to_context_table from domain_support.md Date: Mon, 23 Sep 2024 17:27:00 +0530 Message-ID: <20240923115700.381916-10-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045740_874820_281E0ED7 X-CRM114-Status: UNSURE ( 8.44 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The hartindex_to_context_table field is no longer part of sbi_domain so remove related documentation from domain_support.md. Signed-off-by: Anup Patel --- docs/domain_support.md | 2 -- 1 file changed, 2 deletions(-) Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102c listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The hartindex_to_context_table field is no longer part of sbi_domain so remove related documentation from domain_support.md. Signed-off-by: Anup Patel --- docs/domain_support.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/domain_support.md b/docs/domain_support.md index 1a400685..93186c4a 100644 --- a/docs/domain_support.md +++ b/docs/domain_support.md @@ -41,7 +41,6 @@ has following details: * **name** - Name of this domain * **assigned_harts** - HARTs assigned to this domain * **possible_harts** - HARTs possible in this domain -* **hartindex_to_context_table** - Contexts corresponding to possible HARTs * **regions** - Array of memory regions terminated by a memory region with order zero * **boot_hartid** - HART id of the HART booting this domain. The domain @@ -81,7 +80,6 @@ following manner: platform support * **possible_harts** - All valid HARTs of a RISC-V platform are possible HARTs of the ROOT domain -* **hartindex_to_context_table** - Contexts corresponding to ROOT domain's possible HARTs * **regions** - Two memory regions available to the ROOT domain: **A)** A memory region to protect OpenSBI firmware from S-mode and U-mode **B)** A memory region of **order=__riscv_xlen** allowing S-mode and