Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp315231rdb; Thu, 8 Feb 2024 06:52:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVie/4V85/IUjuZp7EEPNTw34+E0cVdklwskf8XhZq6RAjS9LsTFPdRfsTbUzCc/pzY7j7DxFp31D9noMYz4+fCdTXt28PnTFFDxQj7dw== X-Google-Smtp-Source: AGHT+IHIGf22OkJEmSI/cOC1xw2AeQUhj6sW+/yrd019FZuJkok9Cj7sRNR9yeAgyzKct6CWqNFY X-Received: by 2002:aa7:d050:0:b0:560:5e86:d0e1 with SMTP id n16-20020aa7d050000000b005605e86d0e1mr5531171edo.41.1707403930077; Thu, 08 Feb 2024 06:52:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707403930; cv=pass; d=google.com; s=arc-20160816; b=A2K46mr8yILXEG8GFxKtjUQeSwo9uDXxipbCTJjWoBA5D+t/yHe0KAtWwP+sP2hxgw +ZFLGVlpDMABiueZKDeeXzbtGxrpElXCMhPNrTmCv71Hepx9wa596h9g/z38S0M0v5L+ zs6PFEJgSVkBl8Ny05tyBE8+FiDUeAmqQyGjGx78+jWJDjadILyHSihNC5wlwUUZJVKS ahlcd+T7zhGoHgIdVJqYab5SCDsGmirG+kYKxAtfcDWOmPrV1gBu0yoAPr/vYsLb3IJl 2pAcZqwSnyxVPsDzRuZZihPuP4NJX2ySt25aJD6Louj8RJsAhO+6Pdfi8x3oHHpVSf3a gfqw== 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=rjxVTd/lhtVUyQkE9wilBb6WoxZG/kxpethkmNsq7ZE=; fh=bLCPdHxGd7kBrIsGxIVDZI+sBazdhSZnWB07Cf6vD+0=; b=f5VJ/1hS5iihniQbqwN7dB/8TFLzkcuIu/rUEA5U1A9b6uwCxNRazRCuzeGb9A9bBD geDsmYMP42BwO4rJa0JnCDpQQTNCpmOW3jwkZWnVcWXFYw0oSOI6UNnOSPthaPMZ2Qt3 eUixnROLtgMKlNh7CK/0lfKxBC6773F6PnhRuPL0DZpknspexHbwDtG/uZ4vfs19XHR5 zpcdKBnDTP2xnPDp0MQinmpOgpAkDf758yxWYXVmXxohBm1UveoA9aFlGecKOIvnpwph RN0uBTRJDutC+S+dGUylJbbkhz4/JaRiMbP1zOGuFQE0+BRdGYoaoo8wglKrdphaskom WSZQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-58249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58249-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCV4Vd3tErSc3OnHi6rH0ZXj17CZFcp4ANAP4fQ2Pi0s+czzCLuSFdXQhrf3qOJ4W0i93FOmGARq+xbrE1pcPNeHVxGUCtRyTxS50SmvBw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o13-20020a056402038d00b0055fdba526d7si1002032edv.276.2024.02.08.06.52.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 06:52:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-58249-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58249-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 1DA3A1F24CB8 for ; Thu, 8 Feb 2024 14:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C71D79DD5; Thu, 8 Feb 2024 14:51:41 +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 BD696149DFF; Thu, 8 Feb 2024 14:51:40 +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=1707403900; cv=none; b=HBDH1OB17GGCRlFfHXifwdiUGFSVINOQoGxoBv2/IR7UJV5hmmGCFA63Zb97UR17iDqyBWHmqYwqf8B5fLbCn9X3LScwJ2/XU99rdxKxptQkHQOIsVkgCS+FCEV9C4UncY+9IoVwTzohw3IlZEkaZl1UiaeCCFVdYlOozZ052gc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707403900; c=relaxed/simple; bh=H3JliNSIVGW2a5U9VupsVIrX9pf2EG9gcj0iEeG/xlU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SMTo+QLVZfaIMLzppQPhZSq4gFnxffY93siaRQ3LIuQHodQWIcV9LdqahrMB9unE7VeXohLKuKOkBL4gdUZuVwu5Gn4zoyWqCzzi7zlUyj/pFcB7/1oqqpZeWNmhrOawQbTnhRPzl2U4hdztRtMVLy54NEOj32wT+VHm3ZCwq8I= 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 BA3BEC433F1; Thu, 8 Feb 2024 14:51:32 +0000 (UTC) Date: Thu, 8 Feb 2024 14:51:30 +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 Subject: Re: [PATCH v6 3/4] kvm: arm64: set io memory s2 pte as normalnc for vfio pci device Message-ID: References: <20240207204652.22954-1-ankita@nvidia.com> <20240207204652.22954-4-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: <20240207204652.22954-4-ankita@nvidia.com> On Thu, Feb 08, 2024 at 02:16:51AM +0530, ankita@nvidia.com wrote: > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index d14504821b79..e1e6847a793b 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -1381,7 +1381,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, > int ret = 0; > bool write_fault, writable, force_pte = false; > bool exec_fault, mte_allowed; > - bool device = false; > + bool device = false, vfio_allow_wc = false; > unsigned long mmu_seq; > struct kvm *kvm = vcpu->kvm; > struct kvm_mmu_memory_cache *memcache = &vcpu->arch.mmu_page_cache; > @@ -1472,6 +1472,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, > gfn = fault_ipa >> PAGE_SHIFT; > mte_allowed = kvm_vma_mte_allowed(vma); > > + vfio_allow_wc = (vma->vm_flags & VM_VFIO_ALLOW_WC); Nitpick: no need for brackets, '=' has a pretty low precedence. Reviewed-by: Catalin Marinas