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 49115C3DA4A for ; Mon, 19 Aug 2024 14:28:03 +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-Type:MIME-Version: References:In-Reply-To:Subject:Cc:To:From:Message-ID: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=g5egXTAlVGfhPYntqVtgZDvIhMiTwr0ZKyX9rqTGosI=; b=sUbk3iDiSOHu2ghsFbSkRGLRAc BiqvLHBQJKxJIlAB+9h15u2K23V10YCxSP9xuk5CFPRXwUSuJWO7potLGCzBL4VmUUQgI8kdkvuW0 QcbYxZeH8A6wWJNxZvglhSuTF4bniIzBMx15VGSpPJNkT63tpgKe7l5F6zsMShUuJY+FaWQ6v+aMW DOdDdZFSFUozV09buzzXeyQYIqpeZxvJq+dnV1k2OQDqZW+w3bIbV5KttbalZ/NOvTu2TGRUKeu5G BjNwRfnrpmunCPxtOXS1Kaac8a7nzrsodfBQ18cJZLIarKxEzLntjr0MCKdxEbpx+ze4moUOYWt9e gT87ltWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg3ML-00000001kRi-2gtk; Mon, 19 Aug 2024 14:27:49 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sg3Lf-00000001kKO-11B6 for linux-arm-kernel@lists.infradead.org; Mon, 19 Aug 2024 14:27:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 2573560C4A; Mon, 19 Aug 2024 14:27:06 +0000 (UTC) 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) 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240819_072707_447811_B86657C8 X-CRM114-Status: GOOD ( 23.63 ) 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, 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.