From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA95616EB72; Mon, 19 Aug 2024 14:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077626; cv=none; b=H7NYuewzZ9NopY6B+TFlyNBhD31n9atST1bj6Oho5q5eDs15Qx2t7172TH8TbmfXW0GmjQKvvWkS9TMwhmpZXPwvbgPPFmPIq6fyoLPLGY4E/lFzBj3i5fOVCx1qrJyqOI7Br8bFwhE1jVrHGtk7KUH2JyilvaCX4cMV+Wmxy1g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724077626; c=relaxed/simple; bh=92vs1z9MJHYLppaZxpLGVPpoeizrEXIXxh58tBbHIPQ=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=W9QxRG5qhNYgpiYUcAnFVfKq7LMcD3cg/no8viBtdOp0YiD9VdcmoZOmCMArjtyyZrGufbD4eUj6iEsweBO87f4WfZwVebVgQq1pjUuFBvXcHuyYAvww1bqhTdl8oUfrxDT6rPUTtRVLGwvCCUYz1I4YbFrSJZ0KwBgpjuezG5c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=U6ez3x1d; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="U6ez3x1d" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9B0FC4AF0E; Mon, 19 Aug 2024 14:27:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724077625; bh=92vs1z9MJHYLppaZxpLGVPpoeizrEXIXxh58tBbHIPQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=U6ez3x1dZDy/p53VrG8ygnkCFr4VSTtndIgIoOHzPp/XpI8ceHnY5yAsWsIiR8Les 1mWcyLnAQspXe5CtrLaUdk8MgBujlHvEJYfUWw7qUP8rd0hcHgEW08w5LfTa6qf7Mo MeDcD2Qp/2QIw4RMvzs/3QRjPV+4A6fYGnhgIURfrDvDlH8S1420RBT8/NT0h98zpB KsoxGTHoOiMZrIWmFm8nbEKEePKLqEvHVxTZOUxlcrhy+fEup/Nyvy/KsWRFi5A/gA RvPXBERCxZVZxyF4sJqtzibSug7PntBKyczzt+grsLptxbJoA0YxLXJ0ghTpF2Ncto VgwOIQtQQQ9Ww== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sg3Lb-004wwP-LU; Mon, 19 Aug 2024 15:27:03 +0100 Date: Mon, 19 Aug 2024 15:27:03 +0100 Message-ID: <86zfp8y4eg.wl-maz@kernel.org> From: Marc Zyngier To: Steven Price Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, Catalin Marinas , Will Deacon , 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 , Gavin Shan , Shanker Donthineni , Alper Gun Subject: Re: [PATCH v5 17/19] irqchip/gic-v3-its: Share ITS tables with a non-trusted hypervisor In-Reply-To: <20240819131924.372366-18-steven.price@arm.com> References: <20240819131924.372366-1-steven.price@arm.com> <20240819131924.372366-18-steven.price@arm.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: steven.price@arm.com, kvm@vger.kernel.org, kvmarm@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, james.morse@arm.com, oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, joey.gouly@arm.com, alexandru.elisei@arm.com, christoffer.dall@arm.com, tabba@google.com, linux-coco@lists.linux.dev, gankulkarni@os.amperecomputing.com, gshan@redhat.com, sdonthineni@nvidia.com, alpergun@google.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Mon, 19 Aug 2024 14:19:22 +0100, Steven Price wrote: > > Within a realm guest the ITS is emulated by the host. This means the > allocations must have been made available to the host by a call to > set_memory_decrypted(). Introduce an allocation function which performs > this extra call. > > For the ITT use a custom genpool-based allocator that calls > set_memory_decrypted() for each page allocated, but then suballocates > the size needed for each ITT. Note that there is no mechanism > implemented to return pages from the genpool, but it is unlikely the > peak number of devices will so much larger than the normal level - so > this isn't expected to be an issue. > > Co-developed-by: Suzuki K Poulose > Signed-off-by: Suzuki K Poulose > Tested-by: Will Deacon > Signed-off-by: Steven Price > --- > Changes since v3: > * Use BIT() macro. > * Use a genpool based allocator in its_create_device() to avoid > allocating a full page. > * Fix subject to drop "realm" and use gic-v3-its. > * Add error handling to ITS alloc/free. > Changes since v2: > * Drop 'shared' from the new its_xxx function names as they are used > for non-realm guests too. > * Don't handle the NUMA_NO_NODE case specially - alloc_pages_node() > should do the right thing. > * Drop a pointless (void *) cast. > --- > drivers/irqchip/irq-gic-v3-its.c | 139 ++++++++++++++++++++++++++----- > 1 file changed, 116 insertions(+), 23 deletions(-) I think this patch and the next are pretty ripe, and shouldn't have to wait much longer. Can you please send them as a separate irqchip series, with the relevant people on Cc (realistically, tglx and me), with a Reviewed-by: Marc Zyngier added to them? Thanks, M. -- Without deviation from the norm, progress is not possible.