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 014CEC48260 for ; Thu, 8 Feb 2024 13:27:14 +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=HH4Y6Zuk0pHOe7ruCtihUEZRCUlZFc9YzzfcVr8eOKs=; b=w3GRJxMPaH6jPm h/0BbnNGar+7OUFFXMD688eVbDQGkHLavLNso5f7B0IqPp/KNDOF3TmWRSIdEK2kHqn6o7kJcoUTM 4GZx49LzJwAknc61aLkem4IRdiDOSImtnVTNb4Ed43CrhFqhqQV7RpO7nT0oisVTF4LTzbzhxyh+q mc814DAx4LE4FjGFPAtwOh/+7KzrIJc2EYcRHuZ21eAZBG3i2q05Pvj1AHBIji3Zw6Hc1LtJ+HZYx QiSAmPflTKtpO5UM/dkcKYBr1pE62mJiq9HqznwHmvts3FnBB0JIzMi4CVlYjUKuJ4EhmgZjGQpnX zlOmuvx9w/e4C3Z/+rjg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY4Qg-0000000DtrD-486A; Thu, 08 Feb 2024 13:27:02 +0000 Received: from out-178.mta1.migadu.com ([95.215.58.178]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rY4Qc-0000000DtqH-3Hqe for linux-arm-kernel@lists.infradead.org; Thu, 08 Feb 2024 13:27:00 +0000 Date: Thu, 8 Feb 2024 13:26:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1707398815; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ms5mFNmc1YMSRaq/hZ06PJ/xdlihfdaV0iwPXV9EUh0=; b=VBGy007K7zBFgwgCxeFZ4SXk6PdZiZTc0tqb3bI2yQMJ7Z2A+kGk90xpqHkE9gimClA3RS X/7EJvUS9J4SRcNS+Bx+l/1gh/zZBcvKHb6xnQ5dItLai7Ke9fS5K/4LrgY6EDqAD5tMVm U6G4BKNaFadn1bI1zuZfy9erbnfSf28= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: ankita@nvidia.com Cc: jgg@nvidia.com, maz@kernel.org, james.morse@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, reinette.chatre@intel.com, surenb@google.com, stefanha@redhat.com, brauner@kernel.org, catalin.marinas@arm.com, 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240207204652.22954-4-ankita@nvidia.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240208_052659_770956_FED9AF91 X-CRM114-Status: GOOD ( 13.56 ) 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 Thu, Feb 08, 2024 at 02:16:51AM +0530, ankita@nvidia.com wrote: > @@ -1557,10 +1559,18 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa, > if (exec_fault) > prot |= KVM_PGTABLE_PROT_X; > > - if (device) > - prot |= KVM_PGTABLE_PROT_DEVICE; > - else if (cpus_have_final_cap(ARM64_HAS_CACHE_DIC)) > + if (device) { > + /* > + * To provide VM with the ability to get device IO memory > + * with NormalNC property, map device MMIO as NormalNC in S2. > + */ nit: the comment doesn't provide anything of value, the logic is rather straightforward here. > + if (vfio_allow_wc) > + prot |= KVM_PGTABLE_PROT_NORMAL_NC; > + else > + prot |= KVM_PGTABLE_PROT_DEVICE; > + } else if (cpus_have_final_cap(ARM64_HAS_CACHE_DIC)) { > prot |= KVM_PGTABLE_PROT_X; > + } > > /* > * Under the premise of getting a FSC_PERM fault, we just need to relax > -- > 2.34.1 > -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel