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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 F2363C433EF for ; Sat, 23 Jul 2022 00:18:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D0E712AEA2; Sat, 23 Jul 2022 00:18:08 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89B9711BCA8 for ; Sat, 23 Jul 2022 00:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658535485; 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=iEphr6ZIYFwSwZ4pYciMnV/Wf4dcsbYqo+HwMi5Di7E=; b=BMkb+MowpcA9AWBflrm3MortzhGqbtxIi9MmHxXMSCiP4Bks5nBKs8E/UY31xj0kemj3na fCwXABq4qIEWmPx12R1YyhqJJTlfioEit+ehzB9vgZ9nu+jbeoT7zPlXB+pHVSg32m/BeL LswSvtbZs2QTAWY0LOoGm2AOnIBmcYQ= Received: from mail-il1-f198.google.com (mail-il1-f198.google.com [209.85.166.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-226-HgGowMMyP3mQ7Dxczpxugg-1; Fri, 22 Jul 2022 20:18:04 -0400 X-MC-Unique: HgGowMMyP3mQ7Dxczpxugg-1 Received: by mail-il1-f198.google.com with SMTP id u9-20020a056e021a4900b002dc685a1c13so3489256ilv.19 for ; Fri, 22 Jul 2022 17:18:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=iEphr6ZIYFwSwZ4pYciMnV/Wf4dcsbYqo+HwMi5Di7E=; b=rjYpOfkPrmvU0NGSXprc1hEbN0/HRBRvB4MOPboQz2EONrS/waY2eNygobNrji7hFh J4YkMWnQz8nIZLtj1Qy3p6G7C8xQN03BWi9UKVsHoLT5Bz5Aw1DDKYirqJs8G5jw6PFW v4zgK/i0ijwi8BeV4aaMy224anaDm2eSltJwZaEaevYZPpg8Zrzn8A/tQXcWF5LKgF6x tsyfZMI1JZd4vFU62Enhlb8klzjXXs5mEu26jz8KFT5Yg8oXIRFCoZSdpiQzX/L8hxoN 4mUIWSMbc2jIFQpj5r8obVgqkdVK4FCUew40Pk3XfSnnfQNuyOhDyUq7fYgrj7MRDX17 92eA== X-Gm-Message-State: AJIora8T2iLYRYT7UNrYUoVS6FfV7+VdHjzgLTciDLR8EKNK2s+aI749 Jv3qd219+dRjRPEeU3JXsX+CGFcVfFZ+AMHLciwLekRZDkHXykINi6Q3MR8EthK8Hfu4+qQaB9F SCAIZCgf5LE28QL6i0IE5moi3zItC X-Received: by 2002:a05:6638:160c:b0:33f:54c7:ee69 with SMTP id x12-20020a056638160c00b0033f54c7ee69mr1050257jas.65.1658535483696; Fri, 22 Jul 2022 17:18:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vh5y3jozCZ7iRDuGEDUiaJjAA10VNoYNXKY4pR3tY8wyP5ioYAHZdpqHyeNFeMGRhrxZbgZA== X-Received: by 2002:a05:6638:160c:b0:33f:54c7:ee69 with SMTP id x12-20020a056638160c00b0033f54c7ee69mr1050243jas.65.1658535483492; Fri, 22 Jul 2022 17:18:03 -0700 (PDT) Received: from redhat.com ([38.15.36.239]) by smtp.gmail.com with ESMTPSA id n4-20020a056602340400b00674f9fb1531sm2752495ioz.30.2022.07.22.17.18.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Jul 2022 17:18:03 -0700 (PDT) Date: Fri, 22 Jul 2022 18:18:00 -0600 From: Alex Williamson To: Nicolin Chen Subject: Re: [PATCH v3 00/10] Update vfio_pin/unpin_pages API Message-ID: <20220722181800.56093444.alex.williamson@redhat.com> In-Reply-To: References: <20220708224427.1245-1-nicolinc@nvidia.com> <20220722161129.21059262.alex.williamson@redhat.com> Organization: Red Hat MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=alex.williamson@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mjrosato@linux.ibm.com, linux-doc@vger.kernel.org, airlied@linux.ie, kevin.tian@intel.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kwankhede@nvidia.com, vneethv@linux.ibm.com, agordeev@linux.ibm.com, hch@infradead.org, kvm@vger.kernel.org, corbet@lwn.net, pasic@linux.ibm.com, jgg@nvidia.com, borntraeger@linux.ibm.com, intel-gfx@lists.freedesktop.org, zhi.a.wang@intel.com, jjherne@linux.ibm.com, farman@linux.ibm.com, jchrist@linux.ibm.com, gor@linux.ibm.com, linux-s390@vger.kernel.org, hca@linux.ibm.com, freude@linux.ibm.com, rodrigo.vivi@intel.com, intel-gvt-dev@lists.freedesktop.org, akrowiak@linux.ibm.com, tvrtko.ursulin@linux.intel.com, cohuck@redhat.com, oberpar@linux.ibm.com, svens@linux.ibm.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, 22 Jul 2022 16:12:19 -0700 Nicolin Chen wrote: > On Fri, Jul 22, 2022 at 04:11:29PM -0600, Alex Williamson wrote: > > > GVT-g explodes for me with this series on my Broadwell test system, > > continuously spewing the following: > > Thank you for running additional tests. > > > [ 47.348778] WARNING: CPU: 3 PID: 501 at drivers/vfio/vfio_iommu_type1.c:978 vfio_iommu_type1_unpin_pages+0x7b/0x100 [vfio_iommu_type1] > > > Line 978 is the WARN_ON(i != npage) line. For the cases where we don't > > find a matching vfio_dma, I'm seeing addresses that look maybe like > > we're shifting a value that's already an iova by PAGE_SHIFT somewhere. > > Hmm..I don't understand the PAGE_SHIFT part. Do you mind clarifying? The iova was a very large address for a 4GB VM with a lot of zeros on the low order bits, ex. 0x162459000000. Thanks, Alex > And GVT code initiated an unpin request from gvt_unpin_guest_pag() > that is currently unpinning one page at a time on a contiguous IOVA > range, prior to this series. After this series, it leaves the per- > page routine to the internal loop of vfio_iommu_type1_unpin_pages(), > which is supposed to do the same. > > So, either resulted from the npage input being wrong or some other > factor weighed in that invoked a vfio_remove_dma on those iovas? > > Thanks > Nic >