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 2D8FFC4167B for ; Wed, 6 Dec 2023 19:07:43 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kMwrw2kMTacBffygYxQ0xGQf60A0CtEsHfLM2VCTlxg=; b=P8jlt1GBJTNTA1 pa4/iuGBhiwW04ivcON+2n30GirKXbngI3hrxXyk119qBIE69VV+XbMZJfUBw3/vPltry1fjiyZVm 3B6KiDPyCl5y6FOBtZSlZINwpS8DQnnS5ZO6adKXS5wwqb0qA/s3AYOrvLOm03UJLEB7qNAmSaqiy 9pydlnNWxAiJUHH3ycF/pYWpo+KRWDbuRG20gRrXifLRApy/9v/uRnQbjLaTSabU3Tm1V/QMWoyBZ sFXuioIZg0ROHnwgSpZXT0QEhgqpS68mB0B4yGtUAwbQlV0fYFe7uuBRmcEe7LsAQsEE38emQQWVg FnJNO8SpYdZ8NJv1t7yw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rAxEm-00B6Xa-39; Wed, 06 Dec 2023 19:07:12 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rAxEh-00B6VO-0M for linux-arm-kernel@lists.infradead.org; Wed, 06 Dec 2023 19:07:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 8D0C2B82358; Wed, 6 Dec 2023 19:07:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A909AC433C9; Wed, 6 Dec 2023 19:07:00 +0000 (UTC) Date: Wed, 6 Dec 2023 19:06:58 +0000 From: Catalin Marinas To: Jason Gunthorpe Cc: Marc Zyngier , ankita@nvidia.com, Shameerali Kolothum Thodi , oliver.upton@linux.dev, suzuki.poulose@arm.com, yuzenghui@huawei.com, will@kernel.org, ardb@kernel.org, akpm@linux-foundation.org, gshan@redhat.com, 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, mochs@nvidia.com, kvmarm@lists.linux.dev, kvm@vger.kernel.org, lpieralisi@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/1] KVM: arm64: allow the VM to select DEVICE_* and NORMAL_NC for IO memory Message-ID: References: <86a5qobkt8.wl-maz@kernel.org> <868r67blwo.wl-maz@kernel.org> <20231206151603.GR2692119@nvidia.com> <20231206172035.GU2692119@nvidia.com> <20231206190356.GD2692119@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231206190356.GD2692119@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231206_110707_290155_A292A3D6 X-CRM114-Status: GOOD ( 15.71 ) 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, Dec 06, 2023 at 03:03:56PM -0400, Jason Gunthorpe wrote: > On Wed, Dec 06, 2023 at 06:58:44PM +0000, Catalin Marinas wrote: > > -------------8<---------------------------- > > diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c > > index 1929103ee59a..b89d2dfcd534 100644 > > --- a/drivers/vfio/pci/vfio_pci_core.c > > +++ b/drivers/vfio/pci/vfio_pci_core.c > > @@ -1863,7 +1863,7 @@ int vfio_pci_core_mmap(struct vfio_device *core_vdev, struct vm_area_struct *vma > > * See remap_pfn_range(), called from vfio_pci_fault() but we can't > > * change vm_flags within the fault handler. Set them now. > > */ > > - vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP); > > + vm_flags_set(vma, VM_VFIO | VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP); > > vma->vm_ops = &vfio_pci_mmap_ops; > > > > return 0; > > diff --git a/include/linux/mm.h b/include/linux/mm.h > > index 418d26608ece..6df46fd7836a 100644 > > --- a/include/linux/mm.h > > +++ b/include/linux/mm.h > > @@ -391,6 +391,13 @@ extern unsigned int kobjsize(const void *objp); > > # define VM_UFFD_MINOR VM_NONE > > #endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */ > > > > +#ifdef CONFIG_64BIT > > +#define VM_VFIO_BIT 39 > > +#define VM_VFIO BIT(VM_VFIO_BIT) > > +#else > > +#define VM_VFIO VM_NONE > > +#endif > > + > > /* Bits set in the VMA until the stack is in its final location */ > > #define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY) > > -------------8<---------------------------- > > > > In KVM, Akita's patch would take this into account, not just rely on > > "device==true". > > Yes, Ankit let's try this please. I would not call it VM_VFIO though > > VM_VFIO_ALLOW_WC ? Yeah. I don't really care about the name. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel