From: Steven Price <steven.price@arm.com>
To: kvm@vger.kernel.org, kvmarm@lists.linux.dev
Cc: Steven Price <steven.price@arm.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Marc Zyngier <maz@kernel.org>, Will Deacon <will@kernel.org>,
James Morse <james.morse@arm.com>,
Oliver Upton <oliver.upton@linux.dev>,
Suzuki K Poulose <suzuki.poulose@arm.com>,
Zenghui Yu <yuzenghui@huawei.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, Joey Gouly <joey.gouly@arm.com>,
Alexandru Elisei <alexandru.elisei@arm.com>,
Christoffer Dall <christoffer.dall@arm.com>,
Fuad Tabba <tabba@google.com>,
linux-coco@lists.linux.dev,
Ganapatrao Kulkarni <gankulkarni@os.amperecomputing.com>
Subject: [PATCH v4 13/15] irqchip/gic-v3-its: Rely on genpool alignment
Date: Mon, 1 Jul 2024 10:55:03 +0100 [thread overview]
Message-ID: <20240701095505.165383-14-steven.price@arm.com> (raw)
In-Reply-To: <20240701095505.165383-1-steven.price@arm.com>
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 <steven.price@arm.com>
---
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);
--
2.34.1
next prev parent reply other threads:[~2024-07-01 9:57 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 9:54 [PATCH v4 00/15] arm64: Support for running as a guest in Arm CCA Steven Price
2024-07-01 9:54 ` [PATCH v4 01/15] arm64: rsi: Add RSI definitions Steven Price
2024-07-09 5:19 ` Gavin Shan
2024-07-10 15:34 ` Steven Price
2024-07-23 5:35 ` Gavin Shan
2024-07-23 6:22 ` Gavin Shan
2024-08-16 15:56 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 02/15] firmware/psci: Add psci_early_test_conduit() Steven Price
2024-07-09 10:48 ` Will Deacon
2024-07-10 15:34 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 03/15] arm64: Detect if in a realm and set RIPAS RAM Steven Price
2024-07-29 23:37 ` Gavin Shan
2024-07-30 13:51 ` Suzuki K Poulose
2024-07-31 7:03 ` Gavin Shan
2024-07-31 9:05 ` Suzuki K Poulose
2024-07-01 9:54 ` [PATCH v4 04/15] arm64: realm: Query IPA size from the RMM Steven Price
2024-07-09 10:53 ` Will Deacon
2024-07-10 15:34 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 05/15] arm64: Mark all I/O as non-secure shared Steven Price
2024-07-09 11:39 ` Will Deacon
2024-07-09 12:54 ` Suzuki K Poulose
2024-07-10 15:34 ` Steven Price
2024-07-30 1:36 ` Gavin Shan
2024-07-30 10:36 ` Suzuki K Poulose
2024-07-31 6:36 ` Gavin Shan
2024-07-31 9:03 ` Suzuki K Poulose
2024-07-01 9:54 ` [PATCH v4 06/15] arm64: Make the PHYS_MASK_SHIFT dynamic Steven Price
2024-07-09 11:43 ` Will Deacon
2024-07-09 12:55 ` Suzuki K Poulose
2024-07-10 15:34 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 07/15] arm64: Enforce bounce buffers for realm DMA Steven Price
2024-07-09 11:56 ` Will Deacon
2024-07-10 15:43 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 08/15] arm64: mm: Avoid TLBI when marking pages as valid Steven Price
2024-07-09 11:57 ` Will Deacon
2024-07-10 16:04 ` Steven Price
2024-07-01 9:54 ` [PATCH v4 09/15] arm64: Enable memory encrypt for Realms Steven Price
2024-07-01 9:55 ` [PATCH v4 10/15] arm64: Force device mappings to be non-secure shared Steven Price
2024-07-01 9:55 ` [PATCH v4 11/15] efi: arm64: Map Device with Prot Shared Steven Price
2024-07-01 9:55 ` [PATCH v4 12/15] irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor Steven Price
2024-07-10 13:17 ` Will Deacon
2024-07-01 9:55 ` Steven Price [this message]
2024-07-10 13:17 ` [PATCH v4 13/15] irqchip/gic-v3-its: Rely on genpool alignment Will Deacon
2024-07-01 9:55 ` [PATCH v4 14/15] arm64: rsi: Interfaces to query attestation token Steven Price
2024-07-01 9:55 ` [PATCH v4 15/15] virt: arm-cca-guest: TSM_REPORT support for realms Steven Price
2024-07-09 12:04 ` [PATCH v4 00/15] arm64: Support for running as a guest in Arm CCA Will Deacon
2024-07-12 8:54 ` Matias Ezequiel Vara Larsen
2024-08-15 22:16 ` Shanker Donthineni
2024-08-16 16:06 ` Steven Price
2024-08-16 21:13 ` Shanker Donthineni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240701095505.165383-14-steven.price@arm.com \
--to=steven.price@arm.com \
--cc=alexandru.elisei@arm.com \
--cc=catalin.marinas@arm.com \
--cc=christoffer.dall@arm.com \
--cc=gankulkarni@os.amperecomputing.com \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-coco@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oliver.upton@linux.dev \
--cc=suzuki.poulose@arm.com \
--cc=tabba@google.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).