From mboxrd@z Thu Jan 1 00:00:00 1970 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 B8F49C3DA41 for ; Wed, 10 Jul 2024 13:18:44 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P7ff+wmZUTvF/esqHirLgmGhZAPd5wOtPgaZFdIAqho=; b=BHFnuyq7JYS9rtWHYhwkWOB/W1 nZCYageHRtaN6zTtvW7c9caIcW++vWJA3o6gmFNThEu82855W5TPCwrOP0FshWmmwYGvYe5HqgwxD JG7vgf+8Ji8r8WtjExdo/acgRlZ71pGsP+I1Gh2KixeDVyVdB7Tjkn1wsgTIQq1m1JWKlrd1jKBy0 cs9tM+AItD3N8RvYb5eJqYXwP8DcpqfaZ9L5/yucWrGAiCH/dQsMdO8sU4oykhRuolKIV4e4acc+v 2GGrhQJkJMVoG4P6odlPE6SnEb2eAQtxyuit5/ioH0e1wRgTwUww5iZ0Nyc04W7Y1/ww93AzJiZob mDWwgjAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRXDH-0000000AcbO-1QgJ; Wed, 10 Jul 2024 13:18:27 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sRXCq-0000000AcSN-2quH for linux-arm-kernel@lists.infradead.org; Wed, 10 Jul 2024 13:18:02 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0C11261A55; Wed, 10 Jul 2024 13:18:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CC2C5C32782; Wed, 10 Jul 2024 13:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720617479; bh=FmLG9ussU5FRxdr7oifUla5ahQxpdvQPzA+Zr6jz3LQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rxR7FxJ4+AfkpLq1LVVuoYWlhWG4o7wcc2UQJnuNUo5vwhv0h/K3Jn6F2Fy7eYxS2 vXxSDi+qYjizmB1AXmGqNnuzjoAEmuOaGmagE1d6vcEjlEamQVCKTsPHjJaO6y3zyd DMNSXyAUaYnfYIvoCMS1YJ3MGjYA2GtT3c4DZr+CeW7haLWFQe3y5XfKPyFmOXD3zT gOSs38ytTD+K5hODyj2QOwREYLZWHmGL0lGs7YHEB/nyGKhZY5sknBVu4nag/wGnSb TKJ2WGrFoakqcVV+5mmSCVO92d3Kv6tf5Cd6UQTV/wLqGdiEd72sr5dxnMNXeAi8W8 G5VMdvNM1QnZA== Date: Wed, 10 Jul 2024 14:17:53 +0100 From: Will Deacon To: Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Marc Zyngier , James Morse , Oliver Upton , Suzuki K Poulose , Zenghui Yu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Joey Gouly , Alexandru Elisei , Christoffer Dall , Fuad Tabba , linux-coco@lists.linux.dev, Ganapatrao Kulkarni Subject: Re: [PATCH v4 13/15] irqchip/gic-v3-its: Rely on genpool alignment Message-ID: <20240710131753.GB14582@willie-the-truck> References: <20240701095505.165383-1-steven.price@arm.com> <20240701095505.165383-14-steven.price@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240701095505.165383-14-steven.price@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240710_061800_803409_2C879E6B X-CRM114-Status: GOOD ( 16.32 ) 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 On Mon, Jul 01, 2024 at 10:55:03AM +0100, Steven Price wrote: > 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(). > > Signed-off-by: Steven Price > --- > 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 7d12556bc498..ab697e4004b9 100644 > --- a/drivers/irqchip/irq-gic-v3-its.c > +++ b/drivers/irqchip/irq-gic-v3-its.c > @@ -699,7 +699,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); > @@ -3520,7 +3519,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); Tested-by: Will Deacon Will