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 E64D5C4828F for ; Thu, 8 Feb 2024 14:54:13 +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=+khb+8rHVeX/g5NcCGmQfvL2uvPZgQ9wvGoz7/j9Lio=; b=2oDF/2mLCeYiH/ BGL4u/bjjmYMSX/AMqruhbQ72NMhFsHNfartMZLgpWBaMGczHA0hYdMVhKKD4aAJwS9tD5Bk5k73A vjhxGziW/cOfpRvgtSBYnSazpsJ/9iYAgWjqPfA2wp5HYo6oAbNYe80X7ZsF+HH55Nk57ufI7gSNl FIw1S/a4s9HAFD2KO4w7efP/J6M2BK9emkIIrlWFckiwL+uACTkY5hkwKuUBxjIL44cdEz1wPOh2Q FvqITMjKO6XgY0RG6cxhOElPm7HgLZM/Yu6hYpeJaZWyfISHHi0MAWbxJJvDJotY3eeN3K4X3BPH3 uCqGETQ1FV7t4z/58Fkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY5mt-0000000E60o-0Va3; Thu, 08 Feb 2024 14:54:03 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY5mq-0000000E5ys-1hK4 for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 14:54:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id DAC56CE1D3A; Thu, 8 Feb 2024 14:53:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95689C433F1; Thu, 8 Feb 2024 14:53:47 +0000 (UTC) Date: Thu, 8 Feb 2024 14:53:45 +0000 From: Catalin Marinas To: ankita@nvidia.com Cc: jgg@nvidia.com, maz@kernel.org, oliver.upton@linux.dev, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, reinette.chatre@intel.com, surenb@google.com, stefanha@redhat.com, brauner@kernel.org, will@kernel.org, mark.rutland@arm.com, alex.williamson@redhat.com, kevin.tian@intel.com, yi.l.liu@intel.com, ardb@kernel.org, akpm@linux-foundation.org, andreyknvl@gmail.com, wangjinchao@xfusion.com, gshan@redhat.com, ricarkol@google.com, linux-mm@kvack.org, lpieralisi@kernel.org, rananta@google.com, ryan.roberts@arm.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, kvmarm@lists.linux.dev, mochs@nvidia.com, zhiw@nvidia.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, David Hildenbrand Subject: Re: [PATCH v6 4/4] vfio: convey kvm that the vfio-pci device is wc safe Message-ID: References: <20240207204652.22954-1-ankita@nvidia.com> <20240207204652.22954-5-ankita@nvidia.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240207204652.22954-5-ankita@nvidia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_065400_637515_B77113B3 X-CRM114-Status: GOOD ( 18.32 ) 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 + David H On Thu, Feb 08, 2024 at 02:16:52AM +0530, ankita@nvidia.com wrote: > From: Ankit Agrawal > > The code to map the MMIO in S2 as NormalNC is enabled when conveyed > that the device is WC safe using a new flag VM_VFIO_ALLOW_WC. > > Make vfio-pci set the VM_VFIO_ALLOW_WC flag. > > This could be extended to other devices in the future once that > is deemed safe. > > Signed-off-by: Ankit Agrawal > Suggested-by: Catalin Marinas > Acked-by: Jason Gunthorpe > --- > drivers/vfio/pci/vfio_pci_core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c > index 1cbc990d42e0..c3f95ec7fc3a 100644 > --- a/drivers/vfio/pci/vfio_pci_core.c > +++ b/drivers/vfio/pci/vfio_pci_core.c > @@ -1863,7 +1863,8 @@ 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_ALLOW_WC | VM_IO | VM_PFNMAP | > + VM_DONTEXPAND | VM_DONTDUMP); > vma->vm_ops = &vfio_pci_mmap_ops; > > return 0; Acked-by: Catalin Marinas _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel