Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp1092229imi; Fri, 22 Jul 2022 17:21:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tkA/X3i5MOSttMhSemX+WUJra7geGZudNriGys/Gx91oDXaFkWdVCpd6bci7oK7O8TaX/K X-Received: by 2002:a17:907:2702:b0:72b:307b:98e6 with SMTP id w2-20020a170907270200b0072b307b98e6mr1783598ejk.658.1658535671049; Fri, 22 Jul 2022 17:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658535671; cv=none; d=google.com; s=arc-20160816; b=duoBVBV4Nai9R3ek2TEpuzyAA3UzrZ5f0babwMiwUDk/P3UjUyIlML9l25C97lAlK4 hBa0HFHInQX40toq+ZaQLf2prmdhCoBLdl7uAdCgvIGvvVj5zpe8wLVmoxzSfedVdsJC mciIDeXHdkYYHLd4xTDX6YSg4gnpENYrseC9S7HCwjbtnqxLbNaK79QCC5CYHlwHubeQ J/rHHFJFiLaeoctS9P08EHqmI6vfz6LSBfoBn7JNvfy3+UuAUtXgToZiiG78/RMVrddZ OLzRsxITNmdpHscG/kJ7wHKBAc6O5El/xcWTlWYuuZa9SHRqcwZ4jqApQ6oQBcs5fBFC ZjMg== 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=iEphr6ZIYFwSwZ4pYciMnV/Wf4dcsbYqo+HwMi5Di7E=; b=xts5WJY1UXJGqQOPi8LSqoSc21OK9MMlgIMpuVVx+46zssGSN04B3SQcGxXTgLccGr i5usXsvPAwPHvo0SwLxRbC7O45tH5MmPuq1xDrqbEfEMsejYHg7/Px2yIrZ+Y/ajpkmv aDrZrbMKjNrk01GYQoN2CTgGzHGzWjJrW3ZTaUR1Opv0jKG+tXzJEG6GDgqE+kPbdVxq Tuzuo/0zh8nN/7Jfqww4wVH2ze1xIz3nBvZz4crsAC+VZ3QkWRozXHkJUNbwVIf//IUV f+kVAgJnyy52+bxbLVgzlLkBWoQ/V55fyscfVfXnxgwH32+YT1lQ6iEAumuqf1zOUqw6 ClXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BMkb+Mow; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu8-20020a170907a08800b00722e95c36efsi1520376ejc.408.2022.07.22.17.20.46; Fri, 22 Jul 2022 17:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BMkb+Mow; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230502AbiGWASL (ORCPT + 99 others); Fri, 22 Jul 2022 20:18:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231304AbiGWASJ (ORCPT ); Fri, 22 Jul 2022 20:18:09 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D43AE78DF4 for ; Fri, 22 Jul 2022 17:18:06 -0700 (PDT) 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-562-wybnlZgSPG2IGbighHS1wQ-1; Fri, 22 Jul 2022 20:18:04 -0400 X-MC-Unique: wybnlZgSPG2IGbighHS1wQ-1 Received: by mail-il1-f198.google.com with SMTP id f2-20020a056e020b4200b002dca33f6243so3532142ilu.15 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=DIi+5rhkqM1jSg9QWzF1U2NhN+M6NheTtPdSdgwEC74bnGDjhErJyxubiwKxeUObWp jMmOxTRs1li9NOBQcGT84A5UFKMTQJcBk7U/8RLo+bibEy7c4PSJL7N2Rq2KDNi2jY9f qdPKTxH7aerWFGSaLBW6GmV+J6ATlbLa8ow6oaUsr7bqJg8nkmGgPuyAhSjVNGeJqLNz eBfgsaTyuc228VWhAzwlOFPSGVCaJpFndLNAE8MJ1y+GCDAszCQ3MWZhMrZg7GwPxf9i hn6KK+/6oBkfY+kCWnZhLV2xQ1eReyZFWohPK7zR98Bv7eHdkbRMaFzP9p7gD9E/yKfB xqoQ== X-Gm-Message-State: AJIora/ihB9WUVLSk/rJASYZIoqhaSMHhL3qDmf0oZ/3mow/q6aLsK6G iLpqEJzNh1A0PvmM3jILO2yQb9Vg7NcnFiLKrdpb+xExMhatx7aod9wovK3VB+GVBgdQEYb3zKr uIGcTVikT95YbRfhe3JOTxSTU X-Received: by 2002:a05:6638:160c:b0:33f:54c7:ee69 with SMTP id x12-20020a056638160c00b0033f54c7ee69mr1050260jas.65.1658535483696; Fri, 22 Jul 2022 17:18:03 -0700 (PDT) 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 Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , 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 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >