Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1746278pxj; Fri, 18 Jun 2021 14:26:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/xLRGSz3JwtKebLgzPi3wE/o/DC9vYGOSmmXUiwxqguL5jGbGdniSrAA7kYE7DQ2ss4OQ X-Received: by 2002:aa7:d7d3:: with SMTP id e19mr7416097eds.46.1624051607977; Fri, 18 Jun 2021 14:26:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1624051607; cv=pass; d=google.com; s=arc-20160816; b=ima/7/zni0gH5L3QMxxjOoQYxOWtJi+rjiTau13eEjIIq/xcN1Nda5M1wx8IXQEqMi nbI42/q7Rd/5H0YO89SXZ+CZQPM+d+rSBhuYUNmjieMo8aEEO4+FLhdbfKDQjEkEBPu3 UtdvuBlaixiuQMj0upop2eY9mbnq4McRjwQZdKe7QpK6Y6UIslHTOkw7BjlX2LDAe9FE DptLL54cIb1jEhBrJERHvCG28ltKgSdZJmENzaYRnPT6UByLYdA6GDe5GAPjcQtePrWN JLf53zRVqtRs3l+nRO9tAYhVnV/AVX2tYGOV//B3uBBcgaXGpitm8Ph3chr2zrpIMiHR CUrQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2NbhCEGP8yxQ69xMq5e8yTlPlW5SzuA8RDyyCg/KWVY=; b=FA4m/ARp5SuPT0zl3VaUmH64YyDTPRSokj5muT8RqXfGNMNsl2e9Pl6rYiTvS5++iR SgA2k/hqmzLkQhAYro5dCZ+F/JTqIOcM0mCeiz227ANlRvHxQsOCHCFe6BG26cHE+2PJ 4B3sGk1zM35gthVzZ8+HaJLn2RhJ3+rwe8u/3It1VDgqTEm+t2lEwi2fhmKkg/mybOpe 7ZgM1J6+5BUWGXaCv4ikJHT1/xlu6uEZLd+67ClyIck5eE5me9Bw4VawPhnCJWe1E4Q8 36ZPByUJ/QQGGbsqRK0TPYJvhXTsSpVj2yf0JLhJ519J6nLvnaRMwezqnzJ2na0Qgb4g bo/Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=au4ieZn0; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si9779130edx.174.2021.06.18.14.26.23; Fri, 18 Jun 2021 14:26:47 -0700 (PDT) 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=@Nvidia.com header.s=selector2 header.b=au4ieZn0; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234860AbhFRPRU (ORCPT + 99 others); Fri, 18 Jun 2021 11:17:20 -0400 Received: from mail-bn1nam07on2070.outbound.protection.outlook.com ([40.107.212.70]:23627 "EHLO NAM02-BN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231461AbhFRPRT (ORCPT ); Fri, 18 Jun 2021 11:17:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sbx9R5FWs3scrMdV7UR/uO/WO3abvOM4HYKYK/r62korNq9jx70HI0VhEc3ySmMPN3vCNn6r+uuBPPGVs4I4kywkuKgJMt0C/tulrbVdr4wKD+hAz7cbweLD39aVeD9/K5fmFTLEIAwW4bFIXfraJsnI14WN96fP74Khnft36N/VFoHWTOZ4AL1R2QDIY+y8/UR5UlpOfDQMvqaXIA+4Tx+0K0Pdb+ac6G2MwZ1l14gSnAUjNb4Azxb5mIYAYrGeeCvB0ZO0GCAii6DvXKRr50dghXWchclgqZ8f8Z0+sNIHfSnjl5DRMvFKjk3Z69L9C7Go+/KqwcK5VtI2tlTGLQ== 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-SenderADCheck; bh=2NbhCEGP8yxQ69xMq5e8yTlPlW5SzuA8RDyyCg/KWVY=; b=C0FVjIXJFqJKI2xyl0v2TOvr55HvY74Qd0EnbxuXNoot1RP6j2ai1fdZG8qrX0OvnlDIc5oOCsiNWt5eantdnXHFtKBQGNQeaOegIPnVFoevJ0DwKlRFv4GXTWR/vu7UUTY64ds2xvEje1MB3BFlRK6kDXkT4VPmMvDGiCmaS65A53nPw6ZSKiyiTt8TKB41yYLDytc4H+RrprgO9tYIc9nivo/DA++jxELT/W2F/LwboxiZ/VYI7QFTIPmHthlXn1q9pUFL9jF9G4jNe0mAU8nCT9hDP9kTaqfNjDZjKEWSMjOXt0oSQsfAx2tmReqFkxgnmjFHqY8bhvT797h5iw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; 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=2NbhCEGP8yxQ69xMq5e8yTlPlW5SzuA8RDyyCg/KWVY=; b=au4ieZn0gV3VVogWfkqgFXLoOqPyyjJ3JRJcp2WpvwKnIYzf7b9PrDz2Srf2IJtPH8JKDVkib+5lHhMtQMsPx1sEiA+uhmBIXIJ76urdR61/kNRxIgW/SuDGles5sTdSKDbaUf2xJDPJYQmM14tK1WOrr9Xvc6G15A/cchTeidRQUq26gzE4f4XT2m5o43OMkD7JdDg9oF6mzMW4UKhrxhCc1b0rh4ai/3ah4NyN1uXq4oaUE1bvpuIPqtlBG8UkoDSyIgOuVpl7hdr02zK6ByWr4yPPLv4kb0tgrkj6rhxPY2OnqJjyEtBni8x6JxYB1IP2gVtGUIcCpt/8cpyTyA== Authentication-Results: 8bytes.org; dkim=none (message not signed) header.d=none;8bytes.org; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5159.namprd12.prod.outlook.com (2603:10b6:208:318::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.19; Fri, 18 Jun 2021 15:15:08 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%8]) with mapi id 15.20.4242.021; Fri, 18 Jun 2021 15:15:08 +0000 Date: Fri, 18 Jun 2021 12:15:06 -0300 From: Jason Gunthorpe To: Joerg Roedel Cc: "Tian, Kevin" , Alex Williamson , Jean-Philippe Brucker , David Gibson , Jason Wang , "parav@mellanox.com" , "Enrico Weigelt, metux IT consult" , Paolo Bonzini , Shenming Lu , Eric Auger , Jonathan Corbet , "Raj, Ashok" , "Liu, Yi L" , "Wu, Hao" , "Jiang, Dave" , Jacob Pan , Kirti Wankhede , Robin Murphy , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , David Woodhouse , LKML , Lu Baolu Subject: Re: Plan for /dev/ioasid RFC v2 Message-ID: <20210618151506.GG1002214@nvidia.com> References: <20210612012846.GC1002214@nvidia.com> <20210612105711.7ac68c83.alex.williamson@redhat.com> <20210614140711.GI1002214@nvidia.com> <20210614102814.43ada8df.alex.williamson@redhat.com> <20210615101215.4ba67c86.alex.williamson@redhat.com> <20210616133937.59050e1a.alex.williamson@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: BL0PR02CA0087.namprd02.prod.outlook.com (2603:10b6:208:51::28) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from mlx.ziepe.ca (47.55.113.94) by BL0PR02CA0087.namprd02.prod.outlook.com (2603:10b6:208:51::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 18 Jun 2021 15:15:07 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1luGD4-008Yx3-Rg; Fri, 18 Jun 2021 12:15:06 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b7926c17-48ae-4305-13d8-08d9326bdb96 X-MS-TrafficTypeDiagnostic: BL1PR12MB5159: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xrMf6lsFRMqmCdSyKEM4iA0H/przTPmXn4oIYSqp0E8tNUcyPbxXR5srITREBjLliQRSBv6hVrhw00YyalTqd2vUZeAfl2qtXfRJb2YwSEr5+2y3WmRfK0Uq6Hgh7CXujHPTFkyC4fPcshYZcsMmSYVnVMMH1A387/zbEBIADBcQT7ICfYVfm1pLm5umSm1wrV7sj7WKqSYO7OMv3f8IuG0Zk1bToZaewH2DBvWdcn8POThLCGCDEhLQVaT1iDobxFm7El0nVOIC8uEnLMCxvDX0Kojwz1L9abO0zGp6n/VgnRQ3d3WMmACFAP357Fl//1QgPdYTAP4UVIc1lJL6U+knRB+Nrrc+rxMOWvxtau/Jj5IhmuqTcL3djC2YKvfwcCOfUVEQxVcjIwHcm+a6/d9BGgDH0r2PTWUVip6UpnIbBvmyLbNmBBhFqchBlurqgqDYqndSucz+G+Ze+29/T1/HwobvdaLqAdyhbmH5PbWC+F3Vp1WVm228NcJ5Ilo8SI2n1B3jAemP/Ge2zQfAdhOA8M96pwsfjKQEBviDNxQWPgARvKrb50ZTvBPpWGDJs2dyuoWRSIvPEi1A4/6x0YDDjU8Mtus6VMdiwU6GNkc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL0PR12MB5506.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(376002)(366004)(346002)(39860400002)(396003)(478600001)(83380400001)(36756003)(6916009)(2906002)(8936002)(8676002)(9746002)(26005)(66946007)(4326008)(186003)(2616005)(86362001)(33656002)(54906003)(426003)(7416002)(1076003)(5660300002)(316002)(38100700002)(66556008)(66476007)(9786002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MHPEVTsMe8iXifQqvM4ODoFdc2NzcS5zgzeJZ7GV3AktPajS+gjb8RfT7afZ?= =?us-ascii?Q?UWYur0sNlZu54J7UPDmitvGY6zHVyWOX6H+WlRqHAOgO+ydBO+aYti6ianEQ?= =?us-ascii?Q?guBBjPu+tdtv9IlLqaP1bktY6ZV+lvcPnbZVYA8VvRbJvfAZLxiyLQARlARD?= =?us-ascii?Q?Ok4s3Pm7Cm+HTBmmM/E50KPbfma0UnKlHHy3sG36leFohdst3PRRg0S84OD/?= =?us-ascii?Q?ZWyl/+rOXE8swZfCJap2IqeYK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2A?= =?us-ascii?Q?2Dqvn/hwsRW5990IaOKvsXR6d5b4dFMDeaulA+3gWhEmUNs2EaIIonL/psGr?= =?us-ascii?Q?EZhSYGLNmyOTco9/843UeERM//yEavecx7qJ/ujSiWAj4LUSB1IW/TbnX4EQ?= =?us-ascii?Q?d09rqmre26Wh58exKg2ha7MS8HJ6VjlWkvHVshYGOWtVM3+Qcbl+mz+IrUDj?= =?us-ascii?Q?gobCvSjyqdsDzXdkbHLxN4b1?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b7926c17-48ae-4305-13d8-08d9326bdb96 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2021 15:15:08.0473 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: znsTRUs8LM6dvU6dxOAq6JtM/vfvtSMdbFx3C1dLkwU1yqfsW9bRncDTT7LkgOkh X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5159 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 18, 2021 at 03:47:51PM +0200, Joerg Roedel wrote: > Hi Kevin, > > On Thu, Jun 17, 2021 at 07:31:03AM +0000, Tian, Kevin wrote: > > Now let's talk about the new IOMMU behavior: > > > > - A device is blocked from doing DMA to any resource outside of > > its group when it's probed by the IOMMU driver. This could be a > > special state w/o attaching to any domain, or a new special domain > > type which differentiates it from existing domain types (identity, > > dma, or unmanged). Actually existing code already includes a > > IOMMU_DOMAIN_BLOCKED type but nobody uses it. > > There is a reason for the default domain to exist: Devices which require > RMRR mappings to be present. You can't just block all DMA from devices > until a driver takes over, we put much effort into making sure there is > not even a small window in time where RMRR regions (unity mapped regions > on AMD) are not mapped. Yes, I think the DMA blocking can only start around/after a VFIO type driver has probed() and bound to a device in the group, not much different from today. Jason