From patchwork Thu Sep 5 09:17:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Price X-Patchwork-Id: 13792010 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 3DE9DCD4F5F for ; Thu, 5 Sep 2024 09:22:07 +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=vG8K1mdcVCf5HFO4kb/Ll1IbDwMIjlfAb+j5eUWmUEQ=; b=Fo+4rm69k6u5pxhQYpDhAvkgcl R32EQEEqEpc4pcL+9LU+kEtliQ2QGLpt6um4TbQtDYX5ArdtKKjlfk++I8GTymkiVWwAKthCB20uH IL52EbGJ0+SxW2KEsYM2uFNGHzbsXG9hVJW+3aiLJpiCHN1BBOy9+47zBSNjwFAO233M+H2becf7w xVRbZofqm49OlLEORJzqNkKmcb40oi2CCtztmLZlI+Xx5EHi1zG3axziCk+yhRy6RThCc2XIxV1l8 FHiUPWp19k+EhlJVJ+lQLElaSdu6vSnYOGNZTcWXFCnz7R+501uwMFGtiOavFCZSquPZAazAqS4H4 I7GRhWKg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm8gf-00000007kHY-0P4O; Thu, 05 Sep 2024 09:21:57 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sm8co-00000007jX4-2bdj for linux-arm-kernel@bombadil.infradead.org; Thu, 05 Sep 2024 09:17:58 +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=vG8K1mdcVCf5HFO4kb/Ll1IbDwMIjlfAb+j5eUWmUEQ=; b=Zo739QZTx1gn+RfyR9i8HNueQd mKE2IHCou/MOty1o53yauJ4Q2ct5vBwI8cg0zMJ6xcpJP2kbh1dS1L/POG6/drj57WIRypYmO6abJ si6/AkVXEapR3MIVbs5mx+YvssN30RbskAIB1AZbTqlHL9aKs+BwBUTdCSrFuqNAoSz7sX2Nv9rev v+On/GYSR+zpbccbC5nMSE65R/hFg9cJo9XpubKlr1BXrjNZ918iHU82o0rtSeHmSJIO2AAybM4Gn 3ecGzRb87kEjv81jwoZdDSaOztfL/BIyv4h9it3BqLxtQTDphT6dTNyyxaZJ+T1viWbc1tjKiY4Jb qqRvdJrw==; Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sm8cl-00000000RxC-2xlb for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 09:17:57 +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 9065C1570; Thu, 5 Sep 2024 02:18:21 -0700 (PDT) Received: from e122027.cambridge.arm.com (e122027.cambridge.arm.com [10.1.29.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8EF323F8A4; Thu, 5 Sep 2024 02:17:53 -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 Subject: [PATCH 2/2] irqchip/gic-v3-its: Rely on genpool alignment Date: Thu, 5 Sep 2024 10:17:38 +0100 Message-Id: <20240905091738.28544-3-steven.price@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240905091738.28544-1-steven.price@arm.com> References: <20240905091738.28544-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-20240905_101755_906695_8AE24F4F X-CRM114-Status: GOOD ( 10.95 ) 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 557214c774c3..49aacf96ade2 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c @@ -700,7 +700,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); @@ -3495,7 +3494,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);