Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1638680rdb; Tue, 20 Feb 2024 02:20:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVpo5h1GVNPdMhS3/Vwvs2BaQACfbvfy2Qb40a6XL9bJLpziYu9DSrn56gXtRrKDfQIaOvyGloD2GY63LU9N+FZYMOlXTcfJ2SAGvDMjw== X-Google-Smtp-Source: AGHT+IG2qSoO7A3hrqAe7D1SAM1KNVBhW7ZQV1GB7jAeVazaeNBckybDLvDTpsmpqwq+FxOh0klr X-Received: by 2002:a17:90a:e60e:b0:299:8337:8874 with SMTP id j14-20020a17090ae60e00b0029983378874mr5054939pjy.38.1708424451776; Tue, 20 Feb 2024 02:20:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708424451; cv=pass; d=google.com; s=arc-20160816; b=pG3z+USod7ylsmlc2T848/ZyWPsvzJimGcKCnw7/r74VBZT8XVPwkzIoY6SjrSHd4h sfrgPZsXztuGXi459MiMEQ6peWhF3/d5Wn2fW1D33WZNOSoE8w2+Q5K50Qy8LXNKbZYC SLmOFvhy6eS6zhpDKGc3JA3gHuth1R5yD/LNJHzEVaJNu+JUaLRyJO1uXcTGJq1X4GbB oGcALIoLLKbHrkm+MIEfJgz3AIGhD0Lywpa/z5FmLYvyW2Y2TQ4XHbhpxOkj38YgJFIG 2FHr6SAOiaHOY87LgQ/Mpecez1p32Y45v2YkSMpmgPijLLiTExLoJcu9dgq4/f+sbfMS 9GmA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=T+wLnJwnhE6J0r9dnKQyydgfCYyhjDTncQF8zwPvie4=; fh=w4yDooaHJx8MUP5SBhi7pxMqaR0xCJ6NJx9ktdz8AMw=; b=EfpZ2GnZihbQt3QpNlAQ/K+Ozpf1g6Hgyabb/Ls4QdwPaySeG879YLtObgGTga8Pgh IRgYBmzdN89ACLKEhvI5xZv+IoDd1jCShZjMA8agAYvlxLXE1ZvQDZZnbxmr5CeDspw2 mE5K4e/tGLntIHlU7TEliuhbS8DTdJbEI5Dfx+S7d4Sy8FKCNFPu4uAB92UqmBPLqyFM JQHxeNsCAoJ/r3dIUxpU7FrlAZXmsePEqueNAEyMtRsOLja5zziw5nj9p/zX6SCU1P9X XXAgVkFHwvzNE2EAs9FUWJuuPZaIgot4Jep3lMeEukF7ZcHfWoEj4bBaUuxzNQDSsBMI uGbA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-72754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mw7-20020a17090b4d0700b002996e7f8d58si4826018pjb.13.2024.02.20.02.20.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 02:20:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-72754-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72754-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DF5ACB20A07 for ; Tue, 20 Feb 2024 09:56:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 63F9A60BBD; Tue, 20 Feb 2024 09:56:11 +0000 (UTC) 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 D53F260244; Tue, 20 Feb 2024 09:56:10 +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=1708422970; cv=none; b=USu5Pj4+lDUwa6j5cQdkDnAq/ZCwBfu/JVJXsxKPRbhKJRDBjY9BqULAkx2dZHUOWHvEjQha5OoivUxHEalg+pOAOIOes6UVm6EZd5KMMZjn+HNC7uDvIlNpuyV8clYi9fgb0tnLv6sJpdwtQeMYpG1FtjgMkbzk2PE7vZsTLrA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708422970; c=relaxed/simple; bh=neaD1FxsjzQ5jsLnH0UcC4xovILhlo04Z/jp6nHSC7k=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uZXHdACqpX/sAp12eBWSMhd46APuS90zyStuXHbi23gxqQ/0CN+GJ65GNUIwJkbPLJQvmi8HAXg76C13rDDLBry//9eHnxtS/Nud9fQtO3hwdnFzeUW/ug+mAwPAcOWnClbr8cyrXiSeBsOCm1P8IY5E+wExf3fh4s1y2c3Erno= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDD13C433C7; Tue, 20 Feb 2024 09:56:02 +0000 (UTC) Date: Tue, 20 Feb 2024 09:56:00 +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, shahuang@redhat.com, ricarkol@google.com, linux-mm@kvack.org, lpieralisi@kernel.org, rananta@google.com, ryan.roberts@arm.com, david@redhat.com, linus.walleij@linaro.org, bhe@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, 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 Subject: Re: [PATCH v8 4/4] vfio: convey kvm that the vfio-pci device is wc safe Message-ID: References: <20240220072926.6466-1-ankita@nvidia.com> <20240220072926.6466-5-ankita@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240220072926.6466-5-ankita@nvidia.com> On Tue, Feb 20, 2024 at 12:59:26PM +0530, ankita@nvidia.com wrote: > diff --git a/drivers/vfio/pci/vfio_pci_core.c b/drivers/vfio/pci/vfio_pci_core.c > index 1cbc990d42e0..c93bea18fc4b 100644 > --- a/drivers/vfio/pci/vfio_pci_core.c > +++ b/drivers/vfio/pci/vfio_pci_core.c > @@ -1862,8 +1862,24 @@ 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_ALLOW_ANY_UNCACHED: The VMA flag is implemented for ARM64, > + * allowing KVM stage 2 device mapping attributes to use Normal-NC > + * rather than DEVICE_nGnRE, which allows guest mappings > + * supporting combining attributes (WC). ARM does not Nitpick: "supporting write-combining" (if you plan to respin). -- Catalin