From patchwork Mon Sep 23 11:56:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=p7CKb3Ku; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=oXbf+5YJ; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1h56XMGz1xsp for ; Mon, 23 Sep 2024 21:57:25 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1S4FjjJzwlnf6vuTvqKQdCO/NIDZdf3HjthJ3mCmptc=; b=p7CKb3KunHkFgj +7K9yUqliS+E3HPMghfQsEe3JOXwsr/oS8PlCK49zIeKeic4qcdRKXQcaSxzWIfBas/uDUsPX39do s29/y1Y0w9xhx2xC1tsup/NFJThU5HvbCdGlKynXk0Csh9g68rlNGsHT3qmJIExBb/62fzE5YaktH U5jEJbkcSd3/FXgVRdiPRTGZaNRN/yyN5yeaUrqX5+fC4r5lkE+DNf9eMHIvWodxLJAHiigclXFj4 ruvIeIVofFnPtbveg5S2GFye5/T3muoDuEtDsnHJl1ynBiYD/j557+02I9EIWWtfeWzuaP6hJFPS1 LqwYMQDjZhNRljFKL+Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshgr-0000000H7Es-12mZ; Mon, 23 Sep 2024 11:57:17 +0000 Received: from mail-pj1-x1030.google.com ([2607:f8b0:4864:20::1030]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgo-0000000H7Dr-04Gy for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:15 +0000 Received: by mail-pj1-x1030.google.com with SMTP id 98e67ed59e1d1-2da4ea973bdso3376571a91.1 for ; Mon, 23 Sep 2024 04:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092633; x=1727697433; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=21+z7E7l4kKgPQwZPtGGIxKmIxYlkBucugO7kUAbUUM=; b=oXbf+5YJKGTFKhr7rmv6Z3a2pzMHERCBg/6lE340KxwcyxZ+EiGDRHALsrb7Q9nd7F UPjHQd+X0AXgtrg/EIln7iPv/tEyRcdHBy9OtzoTGPRy4ASZgo2+8ClSdvq3VoNplkxH mnN2UZT8qXdKtID+RnkLOMZfHosKp1UEGSj2WoHxwNMiIjo5dsoZ9HCbgxqr7lSqoy1o uApmEhgPXIZWtrdiCPtM+NrEKVD1bgFQRC0RGVRiRGXyZj7566eR1F3nvNojLWv2FEP+ 8Lat78ge1n6gjFR3AATQd4jfcALkcc5iotYVDTn7LqarssoYmFnuAD5PebgMsN0Ziqtm DpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092633; x=1727697433; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=21+z7E7l4kKgPQwZPtGGIxKmIxYlkBucugO7kUAbUUM=; b=dSj1sjTRunWED7BpL6zXvPYXMqp1QzLLVT0FaAlJtIlie1E+l5bPtscPtN38ztT7W2 +lj9ntXxiy+PaqLLngqXB/j0hrEVkYwTNKw6oGH90fT5CbkwMad4zVBvmdexi+RGp9CX 2xbHangztVJWTklmk9/p4ZMiE8ORHvHYOLzSRnKNqUa5pXqzAflBAT02lc9ZBA/D7mxo TnIv6S/XXNzmLYwAYRrOAyGhZcgfsANpNoqGTUIqB1QVCxhNzjLZb2Ij1fHnNzW7a9ak f8J7P4vkVdynvkt9WIp0ZfSsDgAc5Tp33ctZVxiihtQuwt1XE4PmWZ8LvrYdBogyyM54 HgYQ== X-Forwarded-Encrypted: i=1; AJvYcCVji92WVw6MBHZwDEY10Mm6+Z+XY8U9CLMYsOl0r9MF9z3UxqFYH5a4JdfK9o4qs6J6DkTRkGPw@lists.infradead.org X-Gm-Message-State: AOJu0YxC+g3iNHb/W3NCV/3CWanHv0OSWKfs4fuDr0ciHNxZTubzCVu7 EsYKx6PjI6Iq7cN9s3fwhrlTXiGcSG8MhvhBMbks6uRbQtL+QdhyJTke+BW+Dsk= X-Google-Smtp-Source: AGHT+IGOQjCQ0ZgUTp54+YX6px+dZq/nGtL5k6fieCXXK+wwffR3bNS0j5TNkVnYqPJD1C0t59onUw== X-Received: by 2002:a17:90b:4c50:b0:2dd:92e5:6fc0 with SMTP id 98e67ed59e1d1-2dd92e57600mr8861672a91.30.1727092632821; Mon, 23 Sep 2024 04:57:12 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:12 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 1/9] lib: utils/ipi: Use sbi_domain_root_add_memrange() for ACLINT mswi Date: Mon, 23 Sep 2024 17:26:52 +0530 Message-ID: <20240923115700.381916-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045714_076745_3DD38F43 X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update ACLINT mswi driver to use sbi_domain_root_add_memrange() instead of explicity registering m [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1030 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update ACLINT mswi driver to use sbi_domain_root_add_memrange() instead of explicity registering memregions. Signed-off-by: Anup Patel --- lib/utils/ipi/aclint_mswi.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/lib/utils/ipi/aclint_mswi.c b/lib/utils/ipi/aclint_mswi.c index 4ae6bb1c..39edacba 100644 --- a/lib/utils/ipi/aclint_mswi.c +++ b/lib/utils/ipi/aclint_mswi.c @@ -84,8 +84,6 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi) u32 i; int rc; struct sbi_scratch *scratch; - unsigned long pos, region_size; - struct sbi_domain_memregion reg; /* Sanity checks */ if (!mswi || (mswi->addr & (ACLINT_MSWI_ALIGN - 1)) || @@ -114,18 +112,12 @@ int aclint_mswi_cold_init(struct aclint_mswi_data *mswi) } /* Add MSWI regions to the root domain */ - for (pos = 0; pos < mswi->size; pos += ACLINT_MSWI_ALIGN) { - region_size = ((mswi->size - pos) < ACLINT_MSWI_ALIGN) ? - (mswi->size - pos) : ACLINT_MSWI_ALIGN; - sbi_domain_memregion_init(mswi->addr + pos, region_size, - (SBI_DOMAIN_MEMREGION_MMIO | - SBI_DOMAIN_MEMREGION_M_READABLE | - SBI_DOMAIN_MEMREGION_M_WRITABLE), - ®); - rc = sbi_domain_root_add_memregion(®); - if (rc) - return rc; - } + rc = sbi_domain_root_add_memrange(mswi->addr, mswi->size, ACLINT_MSWI_ALIGN, + SBI_DOMAIN_MEMREGION_MMIO | + SBI_DOMAIN_MEMREGION_M_READABLE | + SBI_DOMAIN_MEMREGION_M_WRITABLE); + if (rc) + return rc; sbi_ipi_set_device(&aclint_mswi);