From patchwork Wed Oct 2 14:16:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 13819865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C627FCF6D2C for ; Wed, 2 Oct 2024 14:21:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FjduBe+ie0qFg331IlppHOa3JM3pSwn1j0k7ac10zDQ=; b=RGD9ROnyeb6zeasPDZIrXw3rG3 vu0YBlPhQGW3FWyoXkyxvUdYgsGb50iYu/iICIldn6Nm9BjaACGz7XXIk9UJcJmOO7nsfytMv0UPU AlGDQfbQoH4vwhjfttuRurjBHUOCftA6k68gReFNYtzp0dqYWDBaHuB3k3yMcdBYV0NqQPlnTODYD pbm5o+Fk/x9JX60jYfrHNs++6oee7eyHqr/qsa/6zqV2ihZBiAAzFgy9Z3qsPBHmT1Lze5FqrZULP QHHfrqW0C2OYy5F4m/9aKqwsvlmgcz42c4T7nX3jgFyBA/5I4+VjL4aWU3kBWzQ41X8BzKlq/rJj3 okG1J2KQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw0E5-00000006MFN-2bUG; Wed, 02 Oct 2024 14:21:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw0AT-00000006LLq-0uNH for linux-arm-kernel@lists.infradead.org; Wed, 02 Oct 2024 14:17:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2B60A497; Wed, 2 Oct 2024 07:17:58 -0700 (PDT) Received: from e122027.arm.com (unknown [10.57.64.205]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 96CA23F58B; Wed, 2 Oct 2024 07:17:26 -0700 (PDT) From: Steven Price To: Marc Zyngier , Thomas Gleixner Cc: Steven Price , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Will Deacon , Suzuki K Poulose , Michael Kelley Subject: [PATCH v2 2/2] irqchip/gic-v3-its: Rely on genpool alignment Date: Wed, 2 Oct 2024 15:16:30 +0100 Message-Id: <20241002141630.433502-3-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241002141630.433502-1-steven.price@arm.com> References: <20241002141630.433502-1-steven.price@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_071729_317259_1B34F74E X-CRM114-Status: GOOD ( 11.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org its_create_device() over-allocated by ITS_ITT_ALIGN - 1 bytes to ensure that an aligned area was available within the allocation. The new genpool allocator has its min_alloc_order set to get_order(ITS_ITT_ALIGN) so all allocations from it should be appropriately aligned. Remove the over-allocation from its_create_device() and alignment from its_build_mapd_cmd(). Tested-by: Will Deacon Reviewed-by: Marc Zyngier Signed-off-by: Steven Price Reviewed-by: Catalin Marinas --- drivers/irqchip/irq-gic-v3-its.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 7a62fd3a8673..1d2a952e342d 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -712,7 +712,6 @@ static struct its_collection *its_build_mapd_cmd(struct its_node *its, u8 size = ilog2(desc->its_mapd_cmd.dev->nr_ites); itt_addr = virt_to_phys(desc->its_mapd_cmd.dev->itt); - itt_addr = ALIGN(itt_addr, ITS_ITT_ALIGN); its_encode_cmd(cmd, GITS_CMD_MAPD); its_encode_devid(cmd, desc->its_mapd_cmd.dev->device_id); @@ -3501,7 +3500,7 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, */ nr_ites = max(2, nvecs); sz = nr_ites * (FIELD_GET(GITS_TYPER_ITT_ENTRY_SIZE, its->typer) + 1); - sz = max(sz, ITS_ITT_ALIGN) + ITS_ITT_ALIGN - 1; + sz = max(sz, ITS_ITT_ALIGN); itt = itt_alloc_pool(its->numa_node, sz);