Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4856686pxb; Mon, 15 Feb 2021 03:10:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZLj4t6CsfCHivHvPefZGdlQxA3u4JF7pThZm/tx2KSCqS4JCuXAgQsbvUN+jp7zl1iwcb X-Received: by 2002:a17:906:cd02:: with SMTP id oz2mr9098501ejb.116.1613387436003; Mon, 15 Feb 2021 03:10:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613387435; cv=none; d=google.com; s=arc-20160816; b=BB990mBPkocTQZ3g7eOkTTiufqrzqDiLVk7BckencKb1TwDR3kMX7yUqVjtPV6UVKi lw2hHpGnMQddyKRYqciDlOckrppcc3fRFJdpYVH7ngDoQrNVqfiICIOJGE2bp2Xsut0c H1KltIyVusl20ofO0Mi/sm2j3kDO38pTdfcnvyllarFqvM44V9c19xy/GtAj/Hoj8q25 CaDK/dJ94cswpQSrxRocOb+AN/lXXS/e4+QtzRYJNwnvagECNtGpSZH8bJw6fkSeDwvI zbcNXuY/vCGTOllmgqP00s9qWtmyCaOz3VTzs7H3Fai4VEdgE5MEuONNMsMuhx0R6BXK RIOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=1b8OKYqm6plkCFR5I+1HOTic8ptpFn+xfxbEv5GcZW4=; b=Mls2mkRUov9nbDeq7OaeI55FE/QpyByz6VGLtI/xxI3MuC1tYgz/JC1/kYArBA2THa hHsawBxofr0jtlIBATDv7fkP0q0YTpYV4g3oJFRELUZfxIq/c50tRIoKI85MNraLwKWO gS0WCQFcfwg2cU8hVcjbCJh6v0Aw8/9jQmZPvyzIiY5tKLd2Agog6n2C/20Z8zJpgYbF fqDaQ+uljtUiI4FOXh7GWObpXeT/9UDoaZHAWKhalzsdR4kwNx1+RpTx/Nw4vW94Kwgp xTgYXatsVoIidskwBrcml/1dv5LP5qs0e95lIkiUSVrpxTxnMAPWHX0EoWMhYgHyJGdh ih9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hPQwXCQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m7si12296650ejc.466.2021.02.15.03.10.12; Mon, 15 Feb 2021 03:10:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hPQwXCQb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbhBOLHr (ORCPT + 99 others); Mon, 15 Feb 2021 06:07:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49915 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhBOLHq (ORCPT ); Mon, 15 Feb 2021 06:07:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613387180; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1b8OKYqm6plkCFR5I+1HOTic8ptpFn+xfxbEv5GcZW4=; b=hPQwXCQbopvnNTT42WcoImSoZoa3N2Bv/2cc1O1CJoToefVUaionn9jsB6XWVV6KQVefS9 BoZkNM1T6vXhGcnzNV4PAI3zEJqTod+NrN5VrXOI/iYe3b5JIAmTkkHbf9J8uncfTDABRa auOH0N3Oy0hP5Wr0itqt178Tq46pQrs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-525-zImforSLMv2-LxTY4sLiXQ-1; Mon, 15 Feb 2021 06:06:18 -0500 X-MC-Unique: zImforSLMv2-LxTY4sLiXQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FDF9106BAE3; Mon, 15 Feb 2021 11:06:17 +0000 (UTC) Received: from gondolin (ovpn-113-55.ams2.redhat.com [10.36.113.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id B0DC272161; Mon, 15 Feb 2021 11:06:09 +0000 (UTC) Date: Mon, 15 Feb 2021 12:06:07 +0100 From: Cornelia Huck To: Alex Williamson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, pbonzini@redhat.com, jgg@nvidia.com, peterx@redhat.com Subject: Re: [PATCH] vfio/type1: Use follow_pte() Message-ID: <20210215120607.66b2630f.cohuck@redhat.com> In-Reply-To: <161315649533.7249.11715726297751446001.stgit@gimli.home> References: <161315649533.7249.11715726297751446001.stgit@gimli.home> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 12 Feb 2021 12:01:50 -0700 Alex Williamson wrote: > follow_pfn() doesn't make sure that we're using the correct page > protections, get the pte with follow_pte() so that we can test > protections and get the pfn from the pte. > > Fixes: 5cbf3264bc71 ("vfio/type1: Fix VA->PA translation for PFNMAP VMAs in vaddr_get_pfn()") > Signed-off-by: Alex Williamson > --- > drivers/vfio/vfio_iommu_type1.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > With the function signature adapted: Reviewed-by: Cornelia Huck