From patchwork Thu Oct 10 09:00:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1995354 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=I617i/Da; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=desiato.20200630 header.b=jKQl+a0y; 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=KXrOjR0w; 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 4XPNz76wGpz1xsv for ; Thu, 10 Oct 2024 20:01:23 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=udUi9/HZfrQw2jd8MSU5QSl6+xk0XBhkBabHkB5ISSU=; b=I617i/DaoUqrP8 Z7wDpX/3IHyn/LNNVc9eP+CHPcrw9EAqWBfWl+qex2UsP7DQ3g2AuXnTPBzaIEq8ye4tbjaqXVjO4 1kkqpCAdBERltJsVQnRiUbfkxa9yyyTrX+ljFMJ0QP3rOTvA5s2CtCY/K3Jd6qGiNbTtC2HGTjP+B K3Y8WW5MsVBa4deO3QgL4jdwpt3UOVs4Kzkyi+5tumfDrsZrcKcWuwUfoQEJbZJbYY66ONREfPFjo U8f18wbBpb+hQcmz8M6oss2/Fbqm9Wi92cOSXTP3m5xvpoxq3ezkyCWcKmXZsATTIAbNf4HvlqC/m PDUOSlvhFw4CAbh3AqJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp2p-0000000C8rI-3xf2; Thu, 10 Oct 2024 09:01:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2o-0000000C8q4-2sVD for opensbi@bombadil.infradead.org; Thu, 10 Oct 2024 09:01:14 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=cmCQbfU3bhyfyxjOs3Iu24cS6h7ykXu7FXJOkn8kOT0=; b=jKQl+a0yLAYBxiN/gAobIcaF0p mtAHz4GFn0aAn2QOrb0PkkwA+GQ6uHtI9RtqobkEt9Put0NSc2IO8beVn60YCfP63ZBNDjjGxoHLd hlGRPmNyPWVaIVLi3R9+30nS+f1mFqQ2Kx8zkB0ZyT8J82iDuRWvRku7Gj1FqHX9vCB0exRtGL6+2 n6cYiESMQaLZdfsRBBMtYaeT57/DnRcdMnYfLdj4uFsx51puYbTogKychK/+djWmAzg4i1gCwNFRN FGDMYgzVb5sKv9FrdTAd4hPXVH8GvYETal63ZwvMf8muzbBSrmsOit91cF5vcBCZcr/5JqqGkKDgN unfdMgYw==; Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2l-00000005IeN-0pJ3 for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:13 +0000 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-71df2b0a2f7so642806b3a.3 for ; Thu, 10 Oct 2024 02:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550868; x=1729155668; 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=cmCQbfU3bhyfyxjOs3Iu24cS6h7ykXu7FXJOkn8kOT0=; b=KXrOjR0wVeWOxivwRTp/JlY370iGYH3c5PHf6exPguPxCG7pMMO8NfP5gKIRSYFCJ/ SSJ72BtPziGppeq33cMuSp1l8Qk6JgoTb44pGiEUjQZDn1KqxBUdAR9Js/NIp22FAUph /ozTb0yhbMFsJy9i7jOH+Y5TvgDoGO7rSUjdojj9D/AJOANejJuw6Qha4p/O8FQc4KKa DV5qGkeIf0yWhfPz1dy83EAo0dDUreH5ax6wHsIhp4UyhxFiVCSx4xcyuIrz3DrkNGHK cyOwo88uOjB8HIUB3/Dw6PXKLSM7QGeE13lmJPtYdrXxQG3ZUZcHzLO3ICRw+D6JNQJL MJ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550868; x=1729155668; 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=cmCQbfU3bhyfyxjOs3Iu24cS6h7ykXu7FXJOkn8kOT0=; b=DB3SAwtBu5dZvZx18coNcDOPBlDiJoPIX2ZVVsHge9taURwS3T6NoTjirjnkIFJwhM 3gBFf54QIX3vYAqIst8AqXLbbxr5KblgIv0iAr12Z3mLEIHSnTleFIFL7XatlQTYy/Tw IpTMA3330yN5pOm8IxvNquvXTCRwngwLo135flERx5EE0t4ZqGyU5BrT4S2BxyAKimCV 08lOhX8G8Co+qjckuxUHfkuwxYsA3f4gknlF+DJHpA2nTW1ENlsPVbBjQ4t5SOcOXvrw HiOcn6n1OIlZrU7pGEIFmw9sF6XH/b0dR5hhElhTe8Col7hq10GXKdDDoxGD55TGQBBv LMuA== X-Forwarded-Encrypted: i=1; AJvYcCUMeQSuY1jl6jMnn0YrT2lYLlKDoXXGYvYV320lrPEp8QhCKf/nWH9aBHVjWPKPEBpM8DhnCNaJ@lists.infradead.org X-Gm-Message-State: AOJu0YwoeN0ij6v8x5XxoC9dw+p/s7VZcWSycvv7110y9Lq8UvbbNhIp T40USI0CLMnifKjC5ruD75HOD8zm0b2IBbQpWi7Lwlqa6S4PAV3qX3AB3cfAQgs= X-Google-Smtp-Source: AGHT+IE90F4tXc22Wv+DUflIrZYrE0DGXFzkpjx2S1g29NTajS8ESVAaEuC3lviLTX9yUf6kvnuUDA== X-Received: by 2002:a05:6a20:43a3:b0:1c4:f0e0:9ec with SMTP id adf61e73a8af0-1d8a3bf0719mr7433553637.20.1728550867810; Thu, 10 Oct 2024 02:01:07 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:07 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 1/9] lib: utils/ipi: Use sbi_domain_root_add_memrange() for ACLINT mswi Date: Thu, 10 Oct 2024 14:30:50 +0530 Message-ID: <20241010090058.179381-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_100111_346250_76F48380 X-CRM114-Status: UNSURE ( 9.16 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "desiato.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 explicitly registering [...] Content analysis details: (-0.2 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:435 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_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -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 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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 explicitly registering memregions. Signed-off-by: Anup Patel Reviewed-by: Samuel Holland --- 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 c8ebb7ac..0ef3d003 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 Thu Oct 10 09:00:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1995399 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=iTQhW4CO; 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=W8WEpzRn; 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 4XPR5Q6qtGz1xvW for ; Thu, 10 Oct 2024 21:36:58 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=whfSubaeZMSyluf8OgX/gIYMSuYD3/YJL7YnCzcry+s=; b=iTQhW4COwK4Pro 8D/IpFdB3OUKH+mPTodb0P+YC/tcaM04peBXn4a+Gjbifh9JV2qIgjRysrtc4wGxN7fWT/R5hFLr2 eFHDvDj5YP9fU7lZaBl5EXPO2CF+MekNSG/dtYBk4bsndoskjqFhsgYK55wwFRMw6TbMLli7wbWzJ Sb2g5RRxzbZPjKKXQAar9/WYvYOyvywnMol/RAVIp1f4pW0ikb9rwkLsL1KUMJowIDstoumG8bOM0 jaoSoW9vNZoUxr3mFMD8nFPzk2fn+MhO2UoHBVgjx5jeTiCY8pgC2CW7Y+ks5fhROYRuFORtz0MG9 iIELwDYxCEmOqonkGx9g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syqXK-0000000CPHw-1FoZ; Thu, 10 Oct 2024 10:36:50 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2m-0000000C8oW-08mB for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:13 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7db1f13b14aso582823a12.1 for ; Thu, 10 Oct 2024 02:01:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550870; x=1729155670; 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=F5fpcwE14ylnaDq+0jM0iMcY6SxfmWeaBe4Qb6lwyTA=; b=W8WEpzRnRGYVZBc1F0S3BeVXDBRv2moHsyDKBWnMnxsudDsgxTJ/t1l3aFoLyQTJqp ce0qgsgaGMFYjGoDVrpxNf7fNJSwlPWKbD4RWgqyASwsw9q7b9z3EOjgWaZZ1I8/tbUc eOhGobyZk+uMy2zWkaxnEN+UKIilpUgbJf4rrJAysHMt1WVDcxuCS4RsmMFwXqjduGb9 JORMDUSrJVCyYzc0hw+5rm6MOFGuY0U68BWf7ulasOfbQ6lKRpPof6eZGKVd6/I+YbKl ReYZ9nDrwwPcMVC0NG8UuJy4jgq14e1RV2K0hio3kRM+/aXQ9Tx1ZA3EGzE8FPHjokui PTrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550870; x=1729155670; 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=F5fpcwE14ylnaDq+0jM0iMcY6SxfmWeaBe4Qb6lwyTA=; b=Yjp0gxvm8C5JY0jujzPjNFjxPfIXKsos2SpW4HmXZukmQEK6il6ZOMgoWow2DnwWGu xr41dGK95y6PqCYI+BzfFTJIO1I5P6ECU3i/uMB7awmiToNr7483kkcqRxyJd4d9pvQK Fkaa3CH0YyZYN0GFHKEtsog+E+/Um2iXohmrdBwGANJCbTM7+2YVZ/4c1xditSk3rvPT ZjoalvpRuVqBX897apIdlAuVzI/e/iVgxLRLiuvep+8HOOntxwjp9orCGWEnjP9Navxb ten9zNRv4hQhn9b1MG1OkrXRRStRgh8uJtSPoBIGE/m+8BUa8GQs8ENxxcnYRFukyMF8 dJxw== X-Forwarded-Encrypted: i=1; AJvYcCWKUkAjfm7hAwjxov7GXthcuHkhwjH/hAlVpGBHRz1bcic2JGWYUG14hHHzf/yY5fmYiXYOMhej@lists.infradead.org X-Gm-Message-State: AOJu0Yx8SiHPX0MfDVh8TS7YbwNebJufnLW6rWnaxE7ZOVhqK2WfCnJb OezBnIIxxZoOhV222y/qbBtOrYT2yz14r/LKDx75GBkqX1uOVEYMdyU1cEWAEDSG8Is3o/pnKf4 nXJA= X-Google-Smtp-Source: AGHT+IGe92nA8+X4RlcN0yN3rkWWn16wiasZRsri+gvQcld1KoEm/R9sND34IsDG3/pmII3NLUxGCQ== X-Received: by 2002:a05:6a21:3482:b0:1d8:a1dc:b43 with SMTP id adf61e73a8af0-1d8a3c1e436mr9014935637.24.1728550870416; Thu, 10 Oct 2024 02:01:10 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:09 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 2/9] lib: utils/irqchip: Use sbi_domain_root_add_memrange() for IMSIC Date: Thu, 10 Oct 2024 14:30:51 +0530 Message-ID: <20241010090058.179381-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020112_104148_2DF01666 X-CRM114-Status: GOOD ( 10.30 ) 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 explicitly registering memreg [...] 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:52f 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 explicitly registering memregions. Signed-off-by: Anup Patel Reviewed-by: Samuel Holland --- 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 ee532bb4..ae8b31e0 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 Thu Oct 10 09:00: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: 1995356 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=tSsCm8lx; 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=jsSeEarE; 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 4XPNz905KVz1xvY for ; Thu, 10 Oct 2024 20:01:24 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qK/3wH4o8F89p+7UEpj/KP7p8EVvpZiTJ50zER4tThM=; b=tSsCm8lxdsnPiW 1ZjJe6JuRQUrXn3mLUcOh3sF6NOnAcJ1MW7K8spMximoarY6mC87D8LXxRjKNH3/WZvbRZSxSHS3D E8ldwZsp8QOBXAzb0VCPYmVgr7dL14wm81yihu7868n1uccB7MTc5zzDS5ru81BGMgkzigLSIHr3p H1ryhg1L4LpPtb/48OsYetrr6ZfqQyzndtSSO2M1e7EIes0oWR0s3sOXrpKWDSqTlgO6RbC/g+qf4 J4H905oNZ/tAy+rbCX20gIfrqKCFAL1xj9svwVwKblTZKEWSCvUwudidDS3EcQ3EtYeLiNZpusO8H y3ujC2dC0tBdyaGIFQww==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp2q-0000000C8ru-3Nub; Thu, 10 Oct 2024 09:01:16 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2o-0000000C8pq-0LWy for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:15 +0000 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-7e9f98f2147so376939a12.1 for ; Thu, 10 Oct 2024 02:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550873; x=1729155673; 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=MCSC9zq5d6DY/pCW5Om18l4Km0w0XzgA+CaUVuGuwYA=; b=jsSeEarEZYDqawLRAGkTkZQ01aRwcSs8elCABy8FG/Qdt2FQWZDVM5J9Rf/PRLAciI +Eqd1GVxOysQb5sk2iQP6ZEDUzrGOCSJSZbQ0MwvmhY3eX8gsYbmZIgzWHfoorvYLnCn HFnEy8zZQ2i8ZWp1Z9reJ86URWyp5WXd8w5hSgBD3azRHyw/fFNv6jpXt3ss830kqliE 3Mf0WL7zv9aAuFtFlPHFyHMF+Dt4ti/D0JrrUZHlsuF70XNTYW79AyyWg+mvRnOzyx3z 74JEWlQanPTVM4KKgPnnUbcUzuTGj+2oWVlzD7rsdmhsk2gJw8DXdBmhmHGCq88L2sHC +unQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550873; x=1729155673; 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=MCSC9zq5d6DY/pCW5Om18l4Km0w0XzgA+CaUVuGuwYA=; b=AvezjXg/b2wds1OFi5BsWUmVju3AIaJEtT0IAylev0UQ4x1hwQ7ZFAtnUMY8ZINbSC dVIALRf3g4keWSN9akLtE8OgiqdcA1luAG3GKssaqLtkzjBGsom712khRP6kS3J8Gwc/ 9u11/+CnEbRyB6+GR95mvd5+8l80b1IRGxrnxNBxeBcHX0S6EcfyW3oPJF8JOpeWVpYi ac+Hs0cVppO53CvH+oPdbrvT7Xf+A43GghP38RCmV59M1eje1aTKCVfcCWI6l4q4BfWB jSlojyGDvxPpSonEIB0QKHdka963wr0hNXCQNXIpPsirOuYDma51+BmEdjmsxf3QRspe LcIQ== X-Forwarded-Encrypted: i=1; AJvYcCUrI58LmOUStLqEtXsXT3wwEeM2OXcP61+sNntFHIRlSlcd7gOS5p+vntPkd7j1Lcakw5vdVF26@lists.infradead.org X-Gm-Message-State: AOJu0YwmMGfEqc00D1YjTFfbLR8xK2NTSJ18qw91pgKB6KLMZAWmkhnT o6h9LLaYbCpxCpTM/VhAe/juNkFE07Fz1J28+Nou60M859gRrT6WgWmclZ2RURo= X-Google-Smtp-Source: AGHT+IFd6wFvePxNduZr+L5UuEtnvZ9DCLUN1kBzwesMlvXh3bRIFMTZVSNmZCA91b9KjH2zIAp89g== X-Received: by 2002:a05:6a20:2e15:b0:1d8:ac0b:2f63 with SMTP id adf61e73a8af0-1d8ac0b3003mr3915485637.47.1728550872995; Thu, 10 Oct 2024 02:01:12 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:12 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 3/9] lib: utils/irqchip: Use sbi_domain_root_add_memrange() for APLIC Date: Thu, 10 Oct 2024 14:30:52 +0530 Message-ID: <20241010090058.179381-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020114_147296_874388AE X-CRM114-Status: UNSURE ( 9.39 ) 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 explicitly registering memreg [...] 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:52d 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 explicitly registering memregions. Signed-off-by: Anup Patel Reviewed-by: Samuel Holland --- 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 Thu Oct 10 09:00: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: 1995357 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=DZm7mZ6n; 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=Grpha9Ij; 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 4XPNzC1Tq0z1xsc for ; Thu, 10 Oct 2024 20:01:27 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2IuMfsjg0O9bEDZKIzXimHKfVYN+rdpvPM+kxJOhzzo=; b=DZm7mZ6nSn0AzD BeYyoOjhp7W4ExVSlMzdktRhxMZB2JQvhazC9nRhAnCr74jaendItQlGwlh+ogdsWQcOZeOODkcC/ wp1cQJp854vH3Ks+D9czbuXskhi6a1fmQEaBbhOIm7e//rRypM6Fzb1bIMmJYKNs502KVJthmfhVc 1jeSk2unC8jytcEZyLVHVgQD641EDkbK/GKdHNPztCterbbt8LuF4TjNkqnsUlLc9Qc0nkBokCBQn cV+j4f5O3f2yaRXYlRjwnPyMZ6EmUN8h6FMh57AKoGdJmH2dOXUyjlM6WVpSEKO30029LC4oqYPxL wBFxNl9Oc1kPoDEusU/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp2t-0000000C8uL-1lTe; Thu, 10 Oct 2024 09:01:19 +0000 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2q-0000000C8rW-1B06 for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:18 +0000 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7e9ff6fb4c6so854032a12.3 for ; Thu, 10 Oct 2024 02:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550876; x=1729155676; 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=MjGHtt6euRuMpUsXtaBLxbFFpvm6XEE82b7NQ0cml+s=; b=Grpha9IjIHEarRASmsooVPeLwG1rno2lTUaLGCkvuebFJpIZ7O3hsZk07S1v8fn9rg WSX7X8mNjQ4GUdd4sDzRCH6aWnFJ2JebgL95eilkrYOauUFNbdk+wbLZ6j6ZJW6+l1Kf 3gspY+zqDRkQARN+IxHJMlupZFm+7AOHgv0u/EZwrrLpaYRTfNwyzrYVWlPC03ZlPec9 hCy1w34bb7f6/SM4iA7xetaSHVXLaY1O4xEbjbDbgTDiFnb6DuuDvw4C/tYSOiSnctMe jtiNTGxHmapKIP1IpGV82anCJU4erfynnu3NVzonwAUNTxhDUFjy6nPYAZgpdG3kV1d0 WQsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550876; x=1729155676; 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=MjGHtt6euRuMpUsXtaBLxbFFpvm6XEE82b7NQ0cml+s=; b=qNK98HoNAQpuJvoHQ/HXNSPSzANFeqYUJgAEnzhuZ60L71Focy/d+w4e9TMRZVIniN LrkrF2Iui86ysVJ6dKm82irHA5NTInAEm6MqsuWQ/p3yCrmFa2PxuLPC2E49b9LT37OB 1yOEHzEhJ+ia06NarKfrJDY/iO5GDEuAoPWwpzJI05jIx56K/BJVzzVegASR7VAjPzSa Bhfy0W6JQrUE1RSvHzERABwcFUeWiYat2gqT9NZx8IcBy+0AH357hmqIAKFEl+PGjBuo PJ23E5k/2mRvlw3LmRANe3IEVtvMv6M2YQjlBzJU71cdblpSZVeUweYciGFTFXA43HJM sZDg== X-Forwarded-Encrypted: i=1; AJvYcCWGZoI1AnS82hgLhSXxeCm+dL3jxqQ+xshTfxO6cgk8UEHgZ5Ace9BK/5TGhYFaro1ufQgeLuMU@lists.infradead.org X-Gm-Message-State: AOJu0YyVVQFw3cLecMgMp1xe1mFSd7dGuzz75RImGkc7BFmtJiRu3j/F W04bUfGKjbedfCOf8Eked6Uzass0yzeoCEiNJlEdSGk0hRbUIxJy1T4biiwSYWo= X-Google-Smtp-Source: AGHT+IHX1Yhvq7kah0DO10HP4Hl6LmMs5Lczh9ni94LcUPITobgsElSHpTn6O9JLSE/F5JfxnT7Pdw== X-Received: by 2002:a05:6a20:3551:b0:1d7:3d:6003 with SMTP id adf61e73a8af0-1d8a3cd92ecmr7081964637.42.1728550875598; Thu, 10 Oct 2024 02:01:15 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:15 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 4/9] lib: sbi_domain: Make sbi_domain_root_add_memregion() as local function Date: Thu, 10 Oct 2024 14:30:53 +0530 Message-ID: <20241010090058.179381-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020116_413035_7C7A58F2 X-CRM114-Status: GOOD ( 12.20 ) 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 rename and make it a local function. Signed-off-by: Anup Patel Reviewed-by: Samuel Holland --- include/sbi/sbi_domain.h | 10 lib/sbi/sbi_domain.c | 4 ++-- 2 files changed, [...] 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:52f 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 rename and make it a local function. Signed-off-by: Anup Patel Reviewed-by: Samuel Holland --- 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 d92f309a..fc349820 100644 --- a/include/sbi/sbi_domain.h +++ b/include/sbi/sbi_domain.h @@ -292,16 +292,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 feb23921..a1db1310 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -589,7 +589,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; @@ -667,7 +667,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 Thu Oct 10 09:00: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: 1995358 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=dakHNG6S; 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=IcXQdvQP; 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 4XPNzG4FxPz1xsc for ; Thu, 10 Oct 2024 20:01:30 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xKYTeN6adOwk2ByVn9ftzqMk0GsNSw/Bdgie9bP6jUM=; b=dakHNG6SSqKtEC D78k5XVKpEdd/8nhrOh/7xQXG2xlrxpn23DE2LLjCf/d7pDSpXUF282TSb0fyrCHQcp+JZuRAEo2V QN24Dkr7hwH3eRnTQkDZ4z2QTXH56AgZLF8O/tt/DNcMuurG94aoDTZcs/Of3JHM2R7NpbhKx3HzY cf39X2mv+QvC1zPVij3bY9zYH5QatwI8gFSBl532qgl3bQr7R2ux3K3o0SjsP0Fcvksgka0FFOueN GmMuhM6mCS/iUUwqcT4I5cIJr1nGZHzu4i99pZG5yGtRpX2Fii2MqnR64/+qZsUv2UnDxeINb+8CJ DBrQuSf6RLo6RQDUdKSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp2x-0000000C8yJ-3krc; Thu, 10 Oct 2024 09:01:23 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2t-0000000C8tv-2cEn for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:21 +0000 Received: by mail-pg1-x533.google.com with SMTP id 41be03b00d2f7-7e9f998e1e4so556300a12.1 for ; Thu, 10 Oct 2024 02:01:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550878; x=1729155678; 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=RB8SVVPvkeAIjfDHk/kDxQ0hBSylXkXC6jYjolcZ0l0=; b=IcXQdvQPcepnhAk0zxoBwzRxKkNydFvomj5SIukiZGBDBvmzOocadCnA0roRzoXAD9 zmTbYQahvZUSB8ixPZ9fxwRhFqX1t21CZ+huht7iky630VgbOf8SU69JIdVXIir6SFm8 xxdpXqUMRNv7dXuV6DGrOaBTUSZB5RMgCrnlfuzKUMyz8ZDviewspic9B2xmdw6Pj11z CQDrIATuT9KnMeYSJJmPmReiS+cNLnkrjCVzWEvxE+0yX4+ONagyESsL+jDxEzB1JVVl g3bHIcUyZwuiJur2xJcxhqf3kQx4YJehN2zXHBhx2KW2ZtvhYACNohzuTeJyaowNAMPC soRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550878; x=1729155678; 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=RB8SVVPvkeAIjfDHk/kDxQ0hBSylXkXC6jYjolcZ0l0=; b=QD5CwgAwS2VJDbpqyS3iPVCVtQePgaShfML9AaYHlv/HJjVi+xjIlu3EWm5+PZnIQ3 fOIrFu6W6m41rm3zJZ8eLU7Uic0vRO9jw6+oJoL2+5ag4Je67wPlDsJ0VAkBmUZzi/gF aIa6PXzOTjB0hunbonPulD9QceSpbsT/zihLA5vSoC9Ucd7+Dcy8L244u/QlqVchvSOZ MmGxRC0yHiKCOpbuwFU+3lpGTohvrTrusA61DEUH1qFxjv8yoQhtRLoDeHepWr9GFqlU RjiexD0DBBe9jr/OhMDN/CdjYrXifPsVZOWWmVDKtiQXNESOUWG8mBFAIQ8/Oyxkdhqj 3dqA== X-Forwarded-Encrypted: i=1; AJvYcCWowygR9tCs5k5CCxP375ry/pEJkscGueaBNm3L+uLqc0k63w8RZbkWmLPGzUlm1cv1zrHdHvXu@lists.infradead.org X-Gm-Message-State: AOJu0YyF+h6NC3wGiXctR8T6eRiOExVxs/PLxXL3pP1EUBO7M6h15ns3 dHgSHvhbo1QyHo0z45zYThJDQGUWuQDP8BjxAa5zTHZzrmXNufmDYa3vhBrzfQE= X-Google-Smtp-Source: AGHT+IH1T087pjuIXBA/c+ImLork4wOU+PcP+IggzM7TpmtABrmCyjO8cEYxHFRVKUzqNWrz5zd9wg== X-Received: by 2002:a05:6a20:9c97:b0:1d3:e4e:b2bf with SMTP id adf61e73a8af0-1d8a3bf2d0bmr8019793637.16.1728550878308; Thu, 10 Oct 2024 02:01:18 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:17 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 5/9] lib: utils/fdt: Use sbi_domain_memregion_init() when parsing domains Date: Thu, 10 Oct 2024 14:30:54 +0530 Message-ID: <20241010090058.179381-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020119_927536_91A66320 X-CRM114-Status: GOOD ( 11.34 ) 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 Reviewed-by: Samuel Holland --- lib/utils/fdt/fdt_domain.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deleti [...] 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:533 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 Reviewed-by: Samuel Holland --- 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 Thu Oct 10 09:00: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: 1995359 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=q/w7WFUn; 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=TL/U3+xT; 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 4XPNzJ48jLz1xsc for ; Thu, 10 Oct 2024 20:01:32 +1100 (AEDT) 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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+zWNvpydyAbTFREV1zzNfQrKhWjP9iFFIDG/lpRnOaA=; b=q/w7WFUnpkY0lk JXYLxbQxIdfzr1lF537kCCWPEPEAyrUcr7HIe8n9i/rEFWJjsNIweNh29w8J0eHiRQTXp0qgSlqmM mTmdOZdEWo6fB8aSt6Sn6iRoB7+evaHeRMY7AxBARVAuVvUzpLtJZdNCOzRR9+NxuiofS68SDAvM6 XvShpZ+oPaMbSDNHQIN/KG8acG0PjywCgjGhNB84PFPBHbK053u8My4uHQHuaRyHJAy9081Dqtiq8 JHCvizv3vI7lvNJcAhaB2m4VcTLbqet4tKRco3snCI04vANDJWM+9wYRm+YL9oFhCilSbunMkFbsv 7Z9o9+qrElngKHZxRUcw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp30-0000000C90L-02Bv; Thu, 10 Oct 2024 09:01:26 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2w-0000000C8wc-132O for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:24 +0000 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-71df4620966so664982b3a.0 for ; Thu, 10 Oct 2024 02:01:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550881; x=1729155681; 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=TxRvMxGIH4veUkBD4bQQwqRJIF6059qnHAxReSQcXD4=; b=TL/U3+xTLR7CwTJXIvBDN2zsZMkfi0xsTLtCfCpkBIlcjTCHAhp7krUrBAqd4nUtgJ CquvvWd7/UHEB5wv9rWXfdjotGVlOnpAF2fTDd8y1BO8jhKgU6AtH1B5wIH247Rxrgxz PDGYIYDwhBhLofTQFrhW54CyDWcUrcp2qfGDCFw95O7FjmiXvdSY7lp0o71NnifOsATc RBZ/abKGCyPsE87aT2IK4jD4qZJSqCwrGEfrWz6x8yK65q+Q1dr3iHABU0nmfZzLi3vp nZxAtXFrbqcTE0LiVmEpKDMHEh7QWAmWtmaC95/24n0S+PrmrIoguYvIFXmEcL4x0IHG WE3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550881; x=1729155681; 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=TxRvMxGIH4veUkBD4bQQwqRJIF6059qnHAxReSQcXD4=; b=bPsBBnvWjCBRKaTfYyJzWxhMFYoA5JaEHyDKCivMoDCgjOfkhW28NJmCdYmHWugYZh Pg9Gq444y7kyMmOSgz1B61+ecq3sad4VzseNxSZvsdXsAkF09ToiHfB9dc7TA2vmEsB3 TcT7mujkqxWuk+WQ1qy1jNoT46saCi1/etxuRC5Ta7tunPVYNaKwRSkVrIrWZvzQOfow mz5bgLrMtUcLjldx+Jbz8+P5GDNG6c4jyOvBaw6RJT60h7T5vF5SedCqbYBtiVyYguWJ n/3RenxXQqg3DR0uqgu0oBFd1aAZE8mD/e5Ne7u3yvLQdUgysIKBQQIGti9SyfGQLvYe R51Q== X-Forwarded-Encrypted: i=1; AJvYcCXaR9EyyrNN9fZeny17DNaS/GvSY1tk2j26NWwvI4UgEUnZMuXXgK9xI/svMJgs+fMI6IHAnd5M@lists.infradead.org X-Gm-Message-State: AOJu0YznImUaKhrCmTcLUiH3Kz0nO+Yg8S2JQQ2+Ou8wFRr3vqnF0FDv eZqvL92J2354PXV1BiJXWfJSuqAI8S9Dzb8nb/eiXs1qXWVfGrjWawltbSTDjcw= X-Google-Smtp-Source: AGHT+IFQu2a8Rxc2wkGzRYJm7nHbfFXx9e2GWapZQnkszV8X4ho6ZrRErfNoQMDc29wY70zBh2NbRg== X-Received: by 2002:a05:6a00:1904:b0:71e:cb:e7b2 with SMTP id d2e1a72fcca58-71e1dbbce78mr8694458b3a.21.1728550880944; Thu, 10 Oct 2024 02:01:20 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:20 -0700 (PDT) From: Anup Patel To: Atish Patra Subject: [PATCH v2 6/9] include: sbi: Remove cyclic include in sbi_domain_context.h Date: Thu, 10 Oct 2024 14:30:55 +0530 Message-ID: <20241010090058.179381-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020122_313796_A10FCF30 X-CRM114-Status: UNSURE ( 9.12 ) 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 Reviewed-by: Samuel Holland --- include/sbi/sbi_domain_context.h | 3 ++- lib/sbi/sbi_domain_context.c | 1 + 2 files chan [...] 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:42c 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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: , Cc: Anup Patel , Anup Patel , opensbi@lists.infradead.org, Andrew Jones 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 Reviewed-by: Samuel Holland --- include/sbi/sbi_domain_context.h | 3 ++- lib/sbi/sbi_domain_context.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/sbi/sbi_domain_context.h b/include/sbi/sbi_domain_context.h index a92f338b..1f5a4f56 100644 --- 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 bafb6c3e..7cad4656 100644 --- a/lib/sbi/sbi_domain_context.c +++ b/lib/sbi/sbi_domain_context.c @@ -13,6 +13,7 @@ #include #include #include +#include #include /** From patchwork Thu Oct 10 09:00: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: 1995360 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=Xbv4AFzY; 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=oz1eB8z9; 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 4XPNzM65qNz1xsc for ; Thu, 10 Oct 2024 20:01:35 +1100 (AEDT) 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=QC4qBa1Mf7SjVlQnBpLsiSLtPtPb9xaqssv8Yh4pNl8=; b=Xbv4AFzYQd0zC+ TVVcUD5oFbRn1Mhcq5lJdFPAqAXntxwD+JAUjd4xfMKpgDaaak6rzXP4cnDxqTvenGyXigfKiBCbg pebT8jkzwcCLtVr9b0LnBEHgIf3ydOlO7jSDmWCrF6hVAXV3EC0yfcB8pOqi9N9anPVcT6YU3Ur8t Q/80G9hGu8dXEWNr8sujtb542nlv8zL2R292VOj88D8cwobiPZBVCopmslAkS42OtHJd9Uhbcwtmt MmFoET7nfqDmUvE+4rAC2hEvdsXFeA3+fb2OgtgfUzfITgT4+cfxDw1IUU4dubgpnSUqDBOdBCiRW h605CFPZVnt2V1Rj0LjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syp32-0000000C92b-27Jn; Thu, 10 Oct 2024 09:01:28 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp2y-0000000C8yi-40UI for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:27 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-71e15fe56c9so572684b3a.3 for ; Thu, 10 Oct 2024 02:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550884; x=1729155684; 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=UA4JcAqoT3yj4bgtpfr2xssXWHGa3YDlGoCz9cYe7ig=; b=oz1eB8z9QSDKXGzmHaEDuM7CL18F8M8ANuALCroT6DL2k7QybvN1kTOOxI+HV20iYe O3nsd5g9af0KQHngkJb/WBXpLJVO3JYaM1o+9NB0bCvesIoKCI0kOGOTdTmloUv015yZ JKdyLo2aPlzAumYzjJsVkY2G8SDpW6wx7t8sY5LTwGdyVBzerdsQEPzTRJyVtJae0Y7E VrxfyTZEYI1m8Kbi9Ou3rhWqyWHKX2WYQdTULvqP6A8vxNem3aDm5uxJ8fYbFiHER31T xmTvkl7wbZfND2XP2YWoR18vSGQFkV0YMcs4A2hh/WvVzfRMR10tU0l7UtgXQ1H2WBCN m3UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550884; x=1729155684; 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=UA4JcAqoT3yj4bgtpfr2xssXWHGa3YDlGoCz9cYe7ig=; b=LA8WuuU8ciVLeh9qE7WJk31rV1fAueidZzBATlkOeRr4CbToFFU+ZCXLbJKxuRiFpq eaRc0zuxAkOha8aHP8gLdSsgcGfpQMVt/VkFMgtqKh5mY0NXwvF93FJNLHwtahS46mfZ A/RmqVwVD0/HOYvd/gTJF7dx7nEPj+QraF7WZvnDxqNBH16Gf3gTKY6FMhL7iPXxy1Or XByKceLeCtenvf8nzRbdmqeW5RSbVZk2AzcwXyNCt2vO6k+Ms+rTbjJuVyIfaONT+Xl+ vjv8zWco+TF519aDfl+x3S0gYD+vhtxhhzYMhsOoThh7MvSoz2cErbYo9XxF6EN4V5J0 KUMg== X-Forwarded-Encrypted: i=1; AJvYcCWdTa5istuDzoWPzyd6VJL62cEZ+bJN8XvWlrU4gjWopXX2OkmXYbk4cSFNQMVIUWcUoweji5QU@lists.infradead.org X-Gm-Message-State: AOJu0YyNYH5KvmaU0qOT3JhIKzt/mpLsZjFFCpp5jo50/S25hVTIBA/f taSfOUvEEjaapTu2E9N9kCfbDGX489zIrWePG9uKg5hC+A1uMKYVoS9n5CkPHqs= X-Google-Smtp-Source: AGHT+IFY9OvLnsiqWRe5AgTi6CWFKR5mAS7nR5K+TiFw8zJXqMAizxq9LO4+pCRyomoBM08tx/nzYg== X-Received: by 2002:a05:6a00:3c88:b0:71e:1784:4cbe with SMTP id d2e1a72fcca58-71e267b0d35mr3569998b3a.15.1728550883580; Thu, 10 Oct 2024 02:01:23 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:23 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel , Yu Chien Peter Lin Subject: [PATCH v2 7/9] lib: sbi: Introduce domain data Date: Thu, 10 Oct 2024 14:30:56 +0530 Message-ID: <20241010090058.179381-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020125_065340_646CB8AD X-CRM114-Status: GOOD ( 23.41 ) 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:433 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 100644 include/sbi/sbi_domain_data.h create mode 100644 lib/sbi/sbi_domain_data.c diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index fc349820..cf09344f 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 100644 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 a1db1310..30eb88fc 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -586,6 +586,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; } @@ -752,6 +761,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 100644 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 Thu Oct 10 09:00: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: 1995400 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=vgAda5xg; 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=lcV0qhgt; 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 4XPR5R5SScz1xtp for ; Thu, 10 Oct 2024 21:36:59 +1100 (AEDT) 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=TFA6GSdkibgwu5VhP2kHjgcAG6nCJ+HIt0TuRDw4ANc=; b=vgAda5xgObe7J9 aSaQOKs3thZ0+/NGPbGMywsZ2W751QFJd9ZiG8G+hPG0/Kw0xwH8pfHUYOycvMjEQkYHxRWPPNrn9 VszrOiqXnyGX+2LSV7b8DGsfr5wn7kDok+llLJcEHlUBP/lSWJdLtZkRAGlx6FmQAm0NZzXLMySE7 iMBVbsHDJi37Rjiw2fCg78vu7SkrWX6Fe7dJ+Fpxtl3cSGlmrnQZhO/fPuJb8KPAwj+CAPpBtfItp yXLMR9O/3fV8aS0ykOasFMw2U2CKw314iXn+mEIrjMhAl66QhDLaS2Xkj16e0DQYZjCUg9v6REU8M iNkOPMHq78zVh9hdW57Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syqXK-0000000CPI6-3Y6H; Thu, 10 Oct 2024 10:36:50 +0000 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp31-0000000C915-2U3Y for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:31 +0000 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-71e30e56ce5so68616b3a.1 for ; Thu, 10 Oct 2024 02:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550886; x=1729155686; 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=iRngolOEVGXFxI115SSeWnxNbakumNMtM/8+6zkvSUE=; b=lcV0qhgt2lBRoeGQIlNL0TBpyuf97ilBpjr4sm90vecYrKq4OBsLBjrbIspC65xGgI nHKX5sPqJN8wQsmRRhzSR9cg5XqIlPuPwSVxlEBlvbr+iGpAXQ7aOY76RrD9UpFwfliU 2pYAMbMS2rM8R0M0MBkPF32aF5tTa0upBFMldRiutInrkTFqA5yQCDhbFefvYZ1JvOLg DL2QpSIZb/7qRcJRP7VjdGGOF2GBDUXUuaWQa4s3XivsXRO2cDsI8dLxNwKf1Gf9wFJ9 /iMJaTsimQ6z3OqWVz5tm1MXScxrGBJEHdbqrwnr8N9qz6lRCpiChEBZ0I8xdfyZHcWa T0Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550886; x=1729155686; 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=iRngolOEVGXFxI115SSeWnxNbakumNMtM/8+6zkvSUE=; b=bAu7m81p2go3Ko/BSaMwe99y2OIaq+3AULkJ4CZa85oMGURdB74UkJmmeHxUB16N1O KgWnshz5Lw3+ZW4wyatTzEaZz9GNbaVb6Sg9tZbXMdJT2cSU/kuc5I11tth6YTJAZPEC DqyapLO3bLC6dyKzftQWqo3O7qcseOSR1Gs7w+nn9ZSv/4f9VZy+vMiuaBzIjpwas6ue 22qZEmxOolGt8nwLx5EVVRGIv/EE7gMM0WnzyN+gj+kFkYjCcQYVvkMYDOIf5Ht1ocaA yOVzaFtmKmEzuCoPKy3gKgvOxVYWM0WenIdaxMM6VaKRYt4CYWGfvoQSZnji/mtPw5/a Rf2A== X-Forwarded-Encrypted: i=1; AJvYcCVdkG9QM4EMlD2AlwUXq4Nv9A1+LceiBy1ZrvwBErYy7I9zWopmIU04Tx9SFbEbAcrXU2b6WKHd@lists.infradead.org X-Gm-Message-State: AOJu0YydNy9vgECw0uXjaDZovtNLStIzw/MD8YjzGn+ffp6AhEzYRLJF IzeDdkSZ+r78bNp0KKxNJB+E1yTBDSY6G54dsF6g9FJYfxHdg7SO+g+ARwAwT6wnZqm9xWAoj0G WFfM= X-Google-Smtp-Source: AGHT+IFl5jfJ7jOiVmSDxb9owqgLy8A3C8378y9z4/+hDjn5tooLAfK4v7InQY+LBHmH8ufKFaMZAQ== X-Received: by 2002:a05:6a20:c78d:b0:1cc:e7a2:2bef with SMTP id adf61e73a8af0-1d8a3c2d88fmr9354896637.30.1728550886242; Thu, 10 Oct 2024 02:01:26 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:25 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel , Yu Chien Peter Lin Subject: [PATCH v2 8/9] lib: sbi_domain: Use domain data support for per-domain hart context Date: Thu, 10 Oct 2024 14:30:57 +0530 Message-ID: <20241010090058.179381-9-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020127_742549_BCAA4C0D X-CRM114-Status: GOOD ( 20.81 ) 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:42e 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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 | 56 +++-------------- lib/sbi/sbi_domain.c | 9 ++- lib/sbi/sbi_domain_context.c | 104 +++++++++++++++++++++++++++---- 4 files changed, 109 insertions(+), 62 deletions(-) diff --git a/include/sbi/sbi_domain.h b/include/sbi/sbi_domain.h index cf09344f..8a2b123d 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 1f5a4f56..31a3a7f8 100644 --- a/include/sbi/sbi_domain_context.h +++ b/include/sbi/sbi_domain_context.h @@ -8,55 +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(current_hartindex(), \ - sbi_domain_thishart_ptr()) - /** * Enter a specific domain context synchronously * @param dom pointer to domain @@ -74,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 30eb88fc..7fdcf9d3 100644 --- a/lib/sbi/sbi_domain.c +++ b/lib/sbi/sbi_domain.c @@ -780,11 +780,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; @@ -849,6 +854,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 7cad4656..407c0d5c 100644 --- a/lib/sbi/sbi_domain_context.c +++ b/lib/sbi/sbi_domain_context.c @@ -15,6 +15,75 @@ #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(), \ + current_hartindex()) /** * Switches the HART context from the current domain to the target domain. @@ -24,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 = current_hartindex(); struct sbi_trap_context *trap_ctx; @@ -90,9 +159,8 @@ 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( - current_hartindex(), dom); + struct hart_context *ctx = hart_context_thishart_get(); + struct hart_context *dom_ctx = hart_context_get(dom, current_hartindex()); /* Validate the domain context existence */ if (!dom_ctx) @@ -110,8 +178,8 @@ int sbi_domain_context_exit(void) { u32 hartindex = current_hartindex(); 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 @@ -124,16 +192,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; + dom_ctx->dom = dom; + hart_context_set(dom, hartindex, dom_ctx); } - ctx = sbi_domain_context_thishart_ptr(); + ctx = hart_context_thishart_get(); } dom_ctx = ctx->prev_ctx; @@ -145,7 +213,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; @@ -155,9 +223,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 Thu Oct 10 09:00: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: 1995398 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=uNZqSMoi; 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=Cx/JQ3ZC; 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 4XPR5P6l8Wz1xtp for ; Thu, 10 Oct 2024 21:36:57 +1100 (AEDT) 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=uNZqSMoiUfyDff /dWC7tFnG36i1u/vpWCJNQNPrur1B3/S0IyXyj6mUxnbvK80N51Ip0Zb5yuCjBHE4f2ThC2TPcKIW urmRqEWneJ4yLZKCZN+GaY3lJrzPTPRgiR/VJZtH32UoBJJ9ov8HuD93CDlZdmk+L+nya2L/l+VFm NOZ1Dm87yzccEyomE458c+jB3hKn6tCTTpm9Ou2AUrLJXaUglSIoHbn0DVAz0bXIKpMt7l0SRH4CY GmhhJ90uzuRIPunYQnRE7m8TEIygsqXLQbh6tgB38LGhXkBX9GhmsKqs5LJBgpTm8iLMbc69/n2VU LpOtL3PFHReVG9fW0X1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1syqXL-0000000CPIG-1J3Y; Thu, 10 Oct 2024 10:36:51 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1syp33-0000000C93N-2stK for opensbi@lists.infradead.org; Thu, 10 Oct 2024 09:01:33 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-71df8585a42so491685b3a.3 for ; Thu, 10 Oct 2024 02:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728550889; x=1729155689; 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=Cx/JQ3ZCoDpsZ+sXasTosuUHXILT1W3uiBLOmWyUDGf8Y89AguZkYr7aPjfkotGxST d7KEAUa5v3IZszSluNw/MMd4yiPLFVkD3W2muuB/l/E4a5Fmx4fUi6wbFYNhs2gKCr6N 2G4PS8pOijCJQIZ2WxTdzTd64/iOyVXyU+VMtz7g0bRJbUu/DaBihU/O19gaklUhD+Um N2meezu2o+xYvNWFf3gad7Y9Y2002aqg7z5RnexVdK6zevc+UwNMqcn12gnZCj1nB3E6 v/5Aj7WeX2aIdF6UbL8+4gnvFJ6KIVBpztlCd4iOPVMqOE2pck8bRCPc4HATPSwPIjIG VwWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728550889; x=1729155689; 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=mY5NK1+JTDSpDvQBQTG0hpgsbBBPOeNLvj901ori4qeXyYotEHVjgd/i7Uw9ce/qp4 5dpSzqv1I4sEsVAeoNFZOIMAfdePsy5VLgp3KH439W9AxbPA8aqsbvymiVnSBxmjVduy HMUp6o8ZEP/kz4DCqIwP6RoTaSreQcuMyRXGI+BkHQsK2MZ6+aa1zJThGC0slI9bYwJg 2IDhd0zG4yCUp8wYWylECvU0OSsjRFmz/RJb1f5+GabM9rYU0eEIGn2X5x8MLLo19h4K 6o5AhgUQuuNPJ9MP6QYQ/z8kVsr27VqJbdag5L870GuQmmGEaH9PFessrv1yhUK6y3x1 +NIw== X-Forwarded-Encrypted: i=1; AJvYcCXrolIEm7jKYbnnuLBmpwXgg1FHo2ATQy5/M4c0+f+CfEiV2UVD1JUt5CBk8iwbuXP+VJq3q4eD@lists.infradead.org X-Gm-Message-State: AOJu0YwS4nBAmDnzWWnb2WTfszgw03GyI2Be7/hB2b8mrIU2wmaXFOXR 4fg1WnVM84ly3P7AunQYfdh3VwFkUonmfJDGxpN1XxYZAGhuKl2J5FWOXZEtCqw= X-Google-Smtp-Source: AGHT+IHaNoktdlpJ3KC7MN5CRMM7URIVLh+fAB4nFPcC7WySg4Qn+GjHGG1pbtlyqC0YyGnaLJt3uw== X-Received: by 2002:a05:6a00:98c:b0:71e:1066:1f86 with SMTP id d2e1a72fcca58-71e1db7538fmr9105695b3a.9.1728550888576; Thu, 10 Oct 2024 02:01:28 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.134.55]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71e2a9e9835sm654127b3a.13.2024.10.10.02.01.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2024 02:01:28 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH v2 9/9] docs: Remove hartindex_to_context_table from domain_support.md Date: Thu, 10 Oct 2024 14:30:58 +0530 Message-ID: <20241010090058.179381-10-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241010090058.179381-1-apatel@ventanamicro.com> References: <20241010090058.179381-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241010_020129_990585_73DDAEE7 X-CRM114-Status: UNSURE ( 8.23 ) 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:432 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 Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -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