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 0A380C7619A for ; Wed, 12 Apr 2023 12:29:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Subject:Cc:To:From:Message-ID:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SbZUtfWfkDxEaG42KKUaxMDB+u7NW+a4loRrh0LevfU=; b=as2j07yZlNYwtf 9/5CtzUDbJ3uvI2JI2aYFzHNPEPBx3HIrHY3BPZ+OlWWVms8S73ada3GQUxIz9y0PzD5EoERr7VG+ /mhf/fKwosr8RH157h7NG/q9HiVUCHLmlyD/Nhwn5hwZgLIDGLgIDp7p6QfmjCejV7Ti8HGZE8xxW OOpKF3kBDau61Esr7jf5J0Kd35HnkiQN3KFKd3HAZ+Z2eHsL4hZNk587dElS6IgHsJ+3smcVJuFuY 9hEbKlxxTiuEaAlYsJV0wKs3ItyDofmSZ5u6Z3eQ5hTKIaXcv7rqrJsqEzr12a2SolO6sxvoPke/o 7rgXqC7uBxL+3QpS3XhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pmZaB-0036BK-0i; Wed, 12 Apr 2023 12:28:15 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pmZa8-0036AB-2i for linux-arm-kernel@lists.infradead.org; Wed, 12 Apr 2023 12:28:14 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3A4F662950; Wed, 12 Apr 2023 12:28:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AFD2C4339B; Wed, 12 Apr 2023 12:28:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681302491; bh=6FoH81ZoljOnwwsVDKczs8ze1AD1h4N7YdQq49DUJCI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Z5IteanyktRgqXMBi2ojlqQXm8aO8qY7wuKa+kxHoEdUI1Pv9v2nMdYQmddGty2oP +kzfgwhsEDdamBBntfgPzpUuvQetCM6y5bYI5SBFZRf2EOuvI5y6dOPFm3Q8EbbcPi UoVKdcc08m7tw6v0HicScjoBxoZ8lMFZTyiE5t4o2vNgk4S2SaFRkDji8JZ/Jx75eN rOSw5e+BYDUBg2JSz+lv+Jcb0vFkeICU9BKzr7dOzNrQgRpLyBMNfGrq7FdLYIwamI AOyrFmM9wzyKCo4TKDfpuAi8AtM8tDq7/x48T7k02VPExTTHCbndcSrjI2FnTEQ9Cg aIfjWNIYYuC3Q== 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 1pmZa5-007pOX-7J; Wed, 12 Apr 2023 13:28:09 +0100 Date: Wed, 12 Apr 2023 13:28:08 +0100 Message-ID: <86sfd5l1yf.wl-maz@kernel.org> From: Marc Zyngier To: Cc: , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 0/6] Expose GPU memory as coherently CPU accessible In-Reply-To: <20230405180134.16932-1-ankita@nvidia.com> References: <20230405180134.16932-1-ankita@nvidia.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/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ankita@nvidia.com, jgg@nvidia.com, alex.williamson@redhat.com, naoya.horiguchi@nec.com, oliver.upton@linux.dev, aniketa@nvidia.com, cjia@nvidia.com, kwankhede@nvidia.com, targupta@nvidia.com, vsethi@nvidia.com, acurrid@nvidia.com, apopple@nvidia.com, jhubbard@nvidia.com, danw@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org 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-20230412_052812_954219_70CD21CA X-CRM114-Status: GOOD ( 23.14 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 05 Apr 2023 19:01:28 +0100, wrote: > > From: Ankit Agrawal > > NVIDIA's upcoming Grace Hopper Superchip provides a PCI-like device > for the on-chip GPU that is the logical OS representation of the > internal propritary cache coherent interconnect. > > This representation has a number of limitations compared to a real PCI > device, in particular, it does not model the coherent GPU memory > aperture as a PCI config space BAR, and PCI doesn't know anything > about cacheable memory types. > > Provide a VFIO PCI variant driver that adapts the unique PCI > representation into a more standard PCI representation facing > userspace. The GPU memory aperture is obtained from ACPI, according to > the FW specification, and exported to userspace as the VFIO_REGION > that covers the first PCI BAR. qemu will naturally generate a PCI > device in the VM where the cacheable aperture is reported in BAR1. > > Since this memory region is actually cache coherent with the CPU, the > VFIO variant driver will mmap it into VMA using a cacheable mapping. > > As this is the first time an ARM environment has placed cacheable > non-struct page backed memory (eg from remap_pfn_range) into a KVM > page table, fix a bug in ARM KVM where it does not copy the cacheable > memory attributes from non-struct page backed PTEs to ensure the guest > also gets a cacheable mapping. This is not a bug, but a conscious design decision. As you pointed out above, nothing needed this until now, and a device mapping is the only safe thing to do as we know exactly *nothing* about the memory that gets mapped. M. -- Without deviation from the norm, progress is not possible. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel