From patchwork Mon Sep 23 11:56:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1988563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=D0JruwpX; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=RpGt5p+r; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XC1h82YCgz1xss for ; Mon, 23 Sep 2024 21:57:28 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=x2Qbh8looc+7HA6LEpVRpMJ9rBkoLaa8bRkdk3jXZ84=; b=D0JruwpXbeAT3i yY4oYB7OPctEHyOPYxyBzF/UNzXPdYtD3UqNfCiYMIOGT2mIgSlC6iKBZoLpPbRQaCpYz0RQjfOW7 pgh2XmZ0Z0ZnboZVOpzIpj2TgJjyMkmxKaKcA57Y74kHtupIVcd3rcfGnnE6gfJnkcHxhHHinRwTF 1vKVGP6LDjmuMDUB+sUd7UDQ9zi2bxxLzHcocRWu1hCOTrzwDVpiwjuczCj6VPtVppzcY6zWugY1I 0MvfQWhDPd+Q8n2NxB4RbthK62xtISxs31XTmcXSRxy7ErFHSRPy8BOIQI2hF4ACQopVSVca7JGHs ghMxWQW4UDx85cr1Rb3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sshgx-0000000H7H9-1bdn; Mon, 23 Sep 2024 11:57:23 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sshgu-0000000H7Fg-38Pf for opensbi@lists.infradead.org; Mon, 23 Sep 2024 11:57:21 +0000 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-2d8a7c50607so2714573a91.1 for ; Mon, 23 Sep 2024 04:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1727092640; x=1727697440; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m+UJsW+g4v3bS124LGQk6KpmlzfCsFT5SZ1UYewXzdc=; b=RpGt5p+rNfrVC2h2CX0IVzM89c4q86PRL+8ZiL2bBus9SWHpE0I2a3W3jE0gCbsMbd t0mogZuc0yeb9t3xQSxuhvPDFDPV+bdHRbieVk8V0PpzY1jkmHb1Qy/5/exAle3qcvQn ahigSS+crjkLvqLsiExEEXLt27SNowSq9gZ57a7ISgJzHV0cyYMLUJvGdnAlVqzpfI/p cRZWR9H/U/KnB1LlLrE2FjLHfqtV8VzPEjpA4REPurI671xl9yr/1oBjWeveA7Gw66m4 3k67EJ7lbTIikID3r7+ZqjLv7oAhgQ+XNEIR3tdv3takwDJeJiYj55eREhXNKM53jHTc z4TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727092640; x=1727697440; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m+UJsW+g4v3bS124LGQk6KpmlzfCsFT5SZ1UYewXzdc=; b=UmYHzv/TJL1LSmveslboIeFb242tPuuTB4XqyS2FPMBw7zd8sJlwUfCCjUeB9CHwva nGBUrN/1tbhrz1FWEkuPgsm3pgohM8X5S9Kzuj7ul+nYGOQIh8BdaEBBDLiWgno/8HH7 OcnlCM8xu80VDu/p88EykPQ6B4tu0118VJ58MCE59aRzFlyaFDBprt0ot+43HaFII18z cREeVTPE9sRD87/JqC7m+1C8I1iGJ9ooakvwQtxVOhfjjlhWT1hfhuDmffiKNqrXJvHY kkDAtb/zmklx+NhQnjAlRBZF+MooerjOJsfTaUZoPC5wH6IEt9ZriMmwH//qljXApVtV 4I8A== X-Forwarded-Encrypted: i=1; AJvYcCWqGEWPl18eRUtaL7RsQmoRD7fz8ltcuAsD3ActBegXMOuW1SO5fGeC8ZwwvpWeHMEsmOXv/sfF@lists.infradead.org X-Gm-Message-State: AOJu0YxkkUk8h4GrspSvUDQWnZEQToZWUHugRBRUQ7zI2uE5y8i06Ik2 ltVX9ahzdjOROk1X7niuHGVtqnyjbWJE/6yti2V7SCxTR92KuvsOeM2Yy7wQTJkJXxHP9FukSYV mPkI= X-Google-Smtp-Source: AGHT+IFOwo6Em05St6NPWe1sSA3tx+y+v/lgq8iG72b9zSGkfuPgv53I9NtbsW0wb5X6iZcTJyca5Q== X-Received: by 2002:a17:90a:4b04:b0:2cf:c9ab:e740 with SMTP id 98e67ed59e1d1-2dd80c13d1emr13622865a91.11.1727092639610; Mon, 23 Sep 2024 04:57:19 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2dd6ef361b0sm9252106a91.44.2024.09.23.04.57.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2024 04:57:19 -0700 (PDT) From: Anup Patel To: Atish Patra Cc: Andrew Jones , Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 3/9] lib: utils/irqchip: Use sbi_domain_root_add_memrange() for APLIC Date: Mon, 23 Sep 2024 17:26:54 +0530 Message-ID: <20240923115700.381916-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923115700.381916-1-apatel@ventanamicro.com> References: <20240923115700.381916-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240923_045720_808089_570118CF X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.1 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update APLIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregi [...] Content analysis details: (-2.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:1035 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org The sbi_domain_root_add_memrange() should be preferred for creating multiple memregions over a range. Update APLIC driver to use sbi_domain_root_add_memrange() instead of explicity registering memregions. Signed-off-by: Anup Patel --- lib/utils/irqchip/aplic.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/utils/irqchip/aplic.c b/lib/utils/irqchip/aplic.c index 10236e7a..28f2f26d 100644 --- a/lib/utils/irqchip/aplic.c +++ b/lib/utils/irqchip/aplic.c @@ -169,7 +169,6 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic) { int rc; u32 i, j, tmp; - struct sbi_domain_memregion reg; struct aplic_delegate_data *deleg; u32 first_deleg_irq, last_deleg_irq; @@ -268,12 +267,10 @@ int aplic_cold_irqchip_init(struct aplic_data *aplic) ((first_deleg_irq < last_deleg_irq) && (last_deleg_irq == aplic->num_source) && (first_deleg_irq == 1))) { - sbi_domain_memregion_init(aplic->addr, aplic->size, - (SBI_DOMAIN_MEMREGION_MMIO | - SBI_DOMAIN_MEMREGION_M_READABLE | - SBI_DOMAIN_MEMREGION_M_WRITABLE), - ®); - rc = sbi_domain_root_add_memregion(®); + rc = sbi_domain_root_add_memrange(aplic->addr, aplic->size, PAGE_SIZE, + SBI_DOMAIN_MEMREGION_MMIO | + SBI_DOMAIN_MEMREGION_M_READABLE | + SBI_DOMAIN_MEMREGION_M_WRITABLE); if (rc) return rc; }