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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 409D5C433FE for ; Tue, 1 Nov 2022 04:21:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbiKAEVa (ORCPT ); Tue, 1 Nov 2022 00:21:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiKAEV1 (ORCPT ); Tue, 1 Nov 2022 00:21:27 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2051.outbound.protection.outlook.com [40.107.92.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D204B14D3D; Mon, 31 Oct 2022 21:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BLHh/JGx+RLtaCKG50AvLq2JFy7iSIK61diOkJm2V382O06RxK1ioU/zM0UWasZDJZHNH4p5wc9J7pajbO01K35SQu2mRXup0RBw5ocHG3xF9kUyOJLI/w/uiH0+lPIH2fgA2TkfmD4wvYHMh8nj6LoAb33rS0+9kmT5GX3xcltgg0KaRY1DIRDG2Nli6daBGp8pVpC2t53hAwnXtEPCnWVeex6uGFbxCCX7DVPQjIOcRbLSW7j18wO9o/bCpcRDGzxdWPMl2nxQBPNh7bwulzrduUHuLU2+P6pu0dqmjfu+XwvvHJe9derw6k80xf5HrGHHDQJYJWOWZDO2k9DHEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yh2mFQ+0Cpb5uIGt58jitZB5flsuF1WBGKMrMp7OPsk=; b=YdXFblUtCn3N4OPDq+7FzWGjID8plxI1icuaTr7YiN3MfVHugASEoiDnNef/eYiWabM4lt3flDQSfB+JvL5aTgfnrM8iAOpHDEW2ZYHKkBe+A+nnMF9BkMOt5NZbjPmyLAE0338R2eKeKi3GBcttckpahOspcL09YDJHGH5OZs4dU6HGtBJA9OxXiVRbBYQkduNwDKpwsKJagqHvHU3Paw2F/ptffQF9rykoovcdbZuKrFxLLzGxDjed+a2bZq6FpZw2M7sdBapCoWaGQ7a1wsVTuYICFtsr5Pmy3IHa38frzrYJKgowWis/oatWUaIh30jBxNnBJKW160zVHoWuNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yh2mFQ+0Cpb5uIGt58jitZB5flsuF1WBGKMrMp7OPsk=; b=m2ryeP5dnAiz2or1B+kuWRl1FZ4EuYazKOwagWjRFbR38Z68kH3VH7V3AgNpffI++VaI/GVrXXPnnOI2i5qWIuYvSIM00H8ujggwGgYvc3Qv2z7xKfsiTMdzFiBKyxzw7ut4XGkff7D6pOF8jiQNHom7VADVG/nWxNiMB3bGtv7Sl4yfBoDKiACq5vGWDZwcu6rQAH9D0LM3X9pEJWmN9qO0Of5IjlIQ0yjYKFGRTqxGlWhgAwPR9Rj9q2Jcs1+vgkxbrM740dLQNKOQHA9YBWKpDPjJqw3RomJyLKbMuZN6I1hIbTfQsTuFkk6/kIl/YKxAT3o+Yt91n3pwhTLJFg== Received: from MW4P223CA0003.NAMP223.PROD.OUTLOOK.COM (2603:10b6:303:80::8) by SA1PR12MB6945.namprd12.prod.outlook.com (2603:10b6:806:24c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.19; Tue, 1 Nov 2022 04:21:24 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:303:80:cafe::ee) by MW4P223CA0003.outlook.office365.com (2603:10b6:303:80::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.16 via Frontend Transport; Tue, 1 Nov 2022 04:21:24 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.14 via Frontend Transport; Tue, 1 Nov 2022 04:21:24 +0000 Received: from rnnvmail202.nvidia.com (10.129.68.7) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Mon, 31 Oct 2022 21:21:13 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail202.nvidia.com (10.129.68.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Mon, 31 Oct 2022 21:21:12 -0700 Received: from Asurada-Nvidia (10.127.8.14) by mail.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29 via Frontend Transport; Mon, 31 Oct 2022 21:21:10 -0700 Date: Mon, 31 Oct 2022 21:21:08 -0700 From: Nicolin Chen To: Yi Liu , Jason Gunthorpe CC: Alexander Gordeev , David Airlie , Tony Krowiak , Alex Williamson , Christian Borntraeger , Cornelia Huck , Daniel Vetter , Diana Craciun , , Eric Auger , "Eric Farman" , Harald Freudenberger , Vasily Gorbik , Heiko Carstens , , , , Jani Nikula , "Jason Herne" , Joonas Lahtinen , Joerg Roedel , Kevin Tian , , , Longfang Liu , Matthew Rosato , Peter Oberparleiter , "Halil Pasic" , Robin Murphy , "Rodrigo Vivi" , Shameer Kolothum , Sven Schnelle , Tvrtko Ursulin , Vineeth Vijayan , Will Deacon , Yishai Hadas , Zhenyu Wang , Zhi Wang , Lu Baolu Subject: Re: [PATCH 00/10] Connect VFIO to IOMMUFD Message-ID: References: <0-v1-4991695894d8+211-vfio_iommufd_jgg@nvidia.com> <39eb11ed-dbf2-822a-dc79-5b70a49c430b@intel.com> <1ba21eb6-5050-d9ba-d988-a939bf6c821b@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1ba21eb6-5050-d9ba-d988-a939bf6c821b@intel.com> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT017:EE_|SA1PR12MB6945:EE_ X-MS-Office365-Filtering-Correlation-Id: ddc92288-8ce6-418e-d395-08dabbc0899a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: akU3VYuHU7cF9OpLKVqZiXZxayYNvJJ7drCffCXEuWSE9r+vbXbKoW9MSGPQDDf0l2jyDVLSOPVQHiLy5QhDUNJ9HwlRgbftt7N2OHN0xUivRV2Fad/j9bA85gRUdJ76Kbewh/QQ/gjyIvD6+XN9dN5FqOQ5UCXcz8rAUzzMHWzsFCeTMmghkOiKo+hrt5OIbqAyeNkImGeX9uOycUmw028xiOZTMO4H5C5t1WnKIeL0Ag085xChlF0+mS2bYnB2/7qr+bcjiKLDldGq8hyBNL2pKb2d6N/RvE5PWBbuGUtZiT5l2ZLPYX7v/tRlNeXfDEhj6pnb0tDEjmhIqygc7cr2qbucq9QzsxMcLkqnSCu0jJuytpitJghjHifjSzb2zAIbRwEPFa4aRa5tWo8kWuEcTzaohwj81D3UPtkbMYlNXvZDv7m6/hBLExileujL/LSmG7Y8Phaz4RJc0vB5LL1ttQ2iI8WmvviETHbWso3b8bPt9FDygyxlunyct7edfrFhiucGBso5oYt7QIHRgKGhzl7sT7GCiCHyqnilmM0b67NJP0s2gGtRJTgWIjlDyMj3gxkVdsCfvDYKDtLQSR3aWjVIDVmzdW4gfcpuINXsKsKrcpe/hvbaRh+Nmpec/M63vMEnXWI+ji5RSCWf2XiCwlN4mBTMOcSkpIHqhJfvKlGRm6e1CNHnz/Kjw7IrfdQOVRiCYeUZOWP8TdWyPdwEkV8NEvZOVq56jC0DhStPDYKK7+h0sJLoOCiT1qUG8D04PF9KEiYv4/I9Od1iCw== X-Forefront-Antispam-Report: CIP:216.228.117.160;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc6edge1.nvidia.com;CAT:NONE;SFS:(13230022)(4636009)(396003)(39860400002)(346002)(136003)(376002)(451199015)(36840700001)(46966006)(40470700004)(40460700003)(2906002)(5660300002)(7406005)(7636003)(82740400003)(7416002)(426003)(83380400001)(47076005)(336012)(86362001)(356005)(110136005)(186003)(6636002)(36860700001)(478600001)(54906003)(55016003)(40480700001)(8676002)(316002)(70586007)(8936002)(4326008)(9686003)(26005)(53546011)(33716001)(70206006)(41300700001)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2022 04:21:24.2149 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddc92288-8ce6-418e-d395-08dabbc0899a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.117.160];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6945 Precedence: bulk List-ID: X-Mailing-List: linux-s390@vger.kernel.org On Tue, Nov 01, 2022 at 11:04:38AM +0800, Yi Liu wrote: > On 2022/11/1 07:24, Jason Gunthorpe wrote: > > On Mon, Oct 31, 2022 at 08:25:39PM +0800, Yi Liu wrote: > > > > There is something wrong with the test suite that it isn't covering > > > > the above, I'm going to look into that today. > > > > > > sounds to be the cause. I didn't see any significant change in vfio_main.c > > > that may fail gvt. So should the iommufd changes. Then we will re-run the > > > test after your update.:-) > > > > I updated the github with all the changes made so far, it is worth > > trying again! > > gvt is still failing with below call trace in host side. vfio_unpin_pages() > is still in problem. Any idea on it? > [ 206.464318] WARNING: CPU: 9 PID: 3362 at > drivers/iommu/iommufd/device.c:591 iommufd_access_pin_pages+0x337/0x360 Judging from this WARNING, and since gvt (mdev) needs pin_pages(), I assume this might be a fix, though Jason's latest change for the iova_alignment seems to be added for CONFIG_IOMMUFD_TEST only. ------ diff --git a/drivers/vfio/iommufd.c b/drivers/vfio/iommufd.c index 72a289c5f8c9..185075528d5e 100644 --- a/drivers/vfio/iommufd.c +++ b/drivers/vfio/iommufd.c @@ -120,6 +120,7 @@ static void vfio_emulated_unmap(void *data, unsigned long iova, } static const struct iommufd_access_ops vfio_user_ops = { + .needs_pin_pages = 1, .unmap = vfio_emulated_unmap, }; ------ Perhaps you can try it first to see if we can test the rest part of the routine for now, till Jason acks tomorrow. Thanks Nic