Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp599663pxb; Wed, 29 Sep 2021 06:02:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwH7aoAn+l6i4rgyD2QDVhCgFhsdscJKTpcEPE18mj8TPxJh76NoTHZ+Pd9xNh56FqvUMHN X-Received: by 2002:a63:380e:: with SMTP id f14mr9490695pga.267.1632920549958; Wed, 29 Sep 2021 06:02:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632920549; cv=pass; d=google.com; s=arc-20160816; b=USe8Mbx9c9Rt3/i/1FQ02VrMieKCS1Jxg0GspJNUZFZLAIMGdTuwbK/6vwEwxnW1Ga TWS0TR7pKj3p7GOpNXW/uwjux6EgB5sbqn2dsOd/9P8VtqrTiFNB/NWfLVna6l9aPFqW J/aoGcxw2TyUy7L4dFFzEfi3VwPMUt8mvXFZ5t+2aLY4Q9xH3rejuNDeLPl4Eo/EVy1Z HHkIpbIcrD5h9N32RV6FxK2cWgU9DdX6fJOlpbxFgYyacCzXqoOBKneo+AldFiOXmUFg JSj85/OzmskvReQDqdXzlaZxaVLAldxTqz+DqdWwJ87rhzM8vOhuuTAlBrYJ89L58Vk3 CZZA== 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=17GPk4aExclJovP+BL0vbpe5G41X3YBpJVf89q9ID4w=; b=bsmexzKmeOkG0ZzXSC67e2zpeeICi8BtGwoBA5l8obYA6HZOkSKrGcTv3UAH3zH1W9 m/X3Q2WJOBc22jvVxu5OarFV6zy7q8PhNny1zZGef9cOJgwMEJ8K7d7QlQwgA/2QYaNl EOv0w26zXIqiK6YCPZKBmxDY0m3NPEsGU44hROQjLjCyaAT117c7wcK2+nUWmDyCZ44E d2geJbNafjl3encR7/ecuShjY4kWDGMxFK1shQ5M4v1AMtmy2+JR2op3FIobXUC6w8/5 f0TuSMz1GQPGSxoVyWriJucKOY/GPdTd63N1bpX+1KLjXJGqcHFO1RazBoxsKSWI2U+O G7iQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=irVvhnhH; 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=QUARANTINE 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 a20si2927449pgj.132.2021.09.29.06.02.14; Wed, 29 Sep 2021 06:02:29 -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=irVvhnhH; 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=QUARANTINE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343966AbhI2NAr (ORCPT + 99 others); Wed, 29 Sep 2021 09:00:47 -0400 Received: from mail-bn7nam10on2049.outbound.protection.outlook.com ([40.107.92.49]:15904 "EHLO NAM10-BN7-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343889AbhI2NAq (ORCPT ); Wed, 29 Sep 2021 09:00:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TT391XmTUdr9kQybHSW4K/wOdjjmfQgnMO+XQTfBJjZxY66ta+NozqiWK/C1dM6snHyWPRhHGXt6nJIZU5DINQw3agNMlMtBTib/lmAWzzIBuj9ouvdsv8Xp5wIq9Bn4VcXEahfSu5ge0oJA1rdM/YX2N47QJKYBXCJeB08hU1E3/OVhy9NqnRBYobWtW1JJusENvgHtQ7dS/K8mVS/55PseR2+C+3Kvv7jTVMc3VKLBVVDVnLAcUzMJ6oSRchlfRHBFi8a+PiQkp1G3tGYIUGjStgky3URrx4AzugWqkUY4gJhkFp/GT5Id+Bgx8WTTCpn1g5szBvuLR44ntHRtPA== 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; bh=17GPk4aExclJovP+BL0vbpe5G41X3YBpJVf89q9ID4w=; b=PSCKDR4RmN+nLM9z9F19YmaMU8ncrrgf6Btj9kszN0ag51XjfMcuPk1rP2L9HqDWAmrS6ey7DdORrJazC5pmuJHsGtFXtiL59ZyOX/2HE9qMq4Y5aml3tGxS5B1uqV14nwH+lddSknNRhPgoRLjDr+z2g6JIn7MaZNqTi0jMTPrltXHpJAtejf3GybYFBEg6B8tMohVQo3jVSdMAA3n/ISXEThAztI6h9tqMNhg7/Ki0dI4PD28TICKF/xVQ/pOMz3Vd8bXRr3r+Se/M5LYUJl5qE0Yfwp1+4UjrisGqPLTHVj2n35+Naac1asM6Uu9SW3GW5xifFjcuNQ6EsQ451A== 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=17GPk4aExclJovP+BL0vbpe5G41X3YBpJVf89q9ID4w=; b=irVvhnhHpDuZzU6MNkybTH9flLE9oLsYrciUaaSmht99IglLk8dgO+JKv7V1wZwbx7aKGDJQSO4+2TPhz9tJCufbeQH0OY4k3O3F8KNnc30oRCMf3yN+IYNHXdOjbLKvlN+a5gZjdnJsEqGKxb0ZWprYYw9lVjyT69tV7UgnKvwMDH7rt4GR3m2mIDibhtOYviAQ3qJ1E3heZsxFGRDil6J9nBKBiIENekU8GmZNx/aNJ7zMzla9Cg1Rp3PZ7F+ojyoygau3r27vZ6GrCnxumrfQKOMaTpTYjELrG9IvyKEfuMBD14tEMaSwZu/iU6Wgea0t2jbp1Vl03w/3xk9dag== Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5253.namprd12.prod.outlook.com (2603:10b6:208:30b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.14; Wed, 29 Sep 2021 12:59:04 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::e8af:232:915e:2f95%8]) with mapi id 15.20.4566.015; Wed, 29 Sep 2021 12:59:04 +0000 Date: Wed, 29 Sep 2021 09:59:02 -0300 From: Jason Gunthorpe To: "Tian, Kevin" Cc: Lu Baolu , "Liu, Yi L" , "alex.williamson@redhat.com" , "hch@lst.de" , "jasowang@redhat.com" , "joro@8bytes.org" , "jean-philippe@linaro.org" , "parav@mellanox.com" , "lkml@metux.net" , "pbonzini@redhat.com" , "lushenming@huawei.com" , "eric.auger@redhat.com" , "corbet@lwn.net" , "Raj, Ashok" , "yi.l.liu@linux.intel.com" , "Tian, Jun J" , "Wu, Hao" , "Jiang, Dave" , "jacob.jun.pan@linux.intel.com" , "kwankhede@nvidia.com" , "robin.murphy@arm.com" , "kvm@vger.kernel.org" , "iommu@lists.linux-foundation.org" , "dwmw2@infradead.org" , "linux-kernel@vger.kernel.org" , "david@gibson.dropbear.id.au" , "nicolinc@nvidia.com" Subject: Re: [RFC 06/20] iommu: Add iommu_device_init[exit]_user_dma interfaces Message-ID: <20210929125902.GU964074@nvidia.com> References: <20210921170943.GS327412@nvidia.com> <20210922123931.GI327412@nvidia.com> <20210927150928.GA1517957@nvidia.com> <20210928115751.GK964074@nvidia.com> <9a314095-3db9-30fc-2ed9-4e46d385036d@linux.intel.com> <20210928140712.GL964074@nvidia.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BL0PR0102CA0022.prod.exchangelabs.com (2603:10b6:207:18::35) To BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) MIME-Version: 1.0 Received: from mlx.ziepe.ca (142.162.113.129) by BL0PR0102CA0022.prod.exchangelabs.com (2603:10b6:207:18::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Wed, 29 Sep 2021 12:59:03 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mVZAs-007ZEz-SB; Wed, 29 Sep 2021 09:59:02 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: acbdf931-b317-4e2b-dc8d-08d98348ea01 X-MS-TrafficTypeDiagnostic: BL1PR12MB5253: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qj38hbwySUeBlZ8iQold2bIds/ovhZyUd5ImE+Opg8wzOHqXN0Zx/52XMLREKn/nwhNN7DSu361Uxr4sLt6vE/YQONmj3SOJq4+IHZhq+rkLxdwbox/he+i/vKPGsHFYR9m7noldOG7JCImGdficmD/n+ofzZW3fjcMUQaRDJXJ1zQwmkpthLcDbb+pbUPwsvM4ziUnOx1AYFB+fAi8aJIYzui5sPrIvIRjcqMS4w0L7UOnVvjkhdwgcVlaSFOIusNTiYUEiWfkYVFo5NnrlX61mLtfekU99sulOe2JrQCg+T0JoaL1YJQUDMcmgwp/j09tkr5z0sEaEgR0gp+SlbxBD4wjn9RgaPq5t8sMo/vLo9LuluT48GuuJYk2LIIk0MF9tPy2ElifrxibgSQ+g4BVpjAPzZyb5mm8ufaRURukIxzgW5TsSBxc0dACn6vdiT29X1sivCwFki4fiDU1aV6Zr+lbXu5jp/Fg9u8YwdJXB8jpJgwHXtsy4Puw9gxYbuwDwXtCY3ahLENiLp0TpC2eEu5ZHVsiqbFHRhpq/fOx9+KOLy3ZPPBFXAxCmI6wIEKOVH8h0Eco6thK5ByOv+4hEkKrIa0ZqyWuuWpDWjJ/xk0MBehNm1H0TLzu4FM2SJUr0OckJyaK05NysahZhjOShPSeDWUCpKtQSgFZdzmj23h21pgNuNYP9372CVGy50Xrw4fT0seIDQe1DkRKCjg== 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)(366004)(4326008)(36756003)(1076003)(426003)(7416002)(66476007)(66556008)(4744005)(9746002)(9786002)(66946007)(2616005)(26005)(86362001)(2906002)(8676002)(5660300002)(33656002)(107886003)(8936002)(508600001)(6916009)(316002)(54906003)(186003)(38100700002)(27376004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?5raLo0W1Pd7fZRL4loGsBZq034LNiB/MKI9QQf+JnhonTiUodoHJC7za/8C2?= =?us-ascii?Q?aT/o9NQa4r5qdlMmiTH7N7dOBNJX8W3JALSFi2makB5GZqkwjND5gAyu+I0Q?= =?us-ascii?Q?ZOsMDs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911fsBu35sY?= =?us-ascii?Q?/G2x2uUJAjFZb9tqu3Zogb3EnAPkI6CEtvgxVS3w47G0eoGh7B7woPLSLN9+?= =?us-ascii?Q?Kkh1ac3F0JAyACaEjB1TKa2TinnEYSFiumj2Y7BA6+viPogxgVEgZDkkDX2O?= =?us-ascii?Q?bydKAPvj+FSKc0lvvLCJgfXD+6nCkICosEuMf8Osgt6rBl1zzOC1YVhy1ibF?= =?us-ascii?Q?iN7gDlCMT2N6Zb3qF2vbUFTmmhTOn3OZe1Xobd/xU8XaHQg4pVV4yhaG+jDW?= =?us-ascii?Q?157Yc7wt1aiItM6iWKlIrdFvtNJtcObpt6BZoIXQt8X5mZU0zHgZjrDEXhYg?= =?us-ascii?Q?JxWvkElsNm1tyPzLVTeoFfbi?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: acbdf931-b317-4e2b-dc8d-08d98348ea01 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 12:59:04.0413 (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: gNKYRU2S6iMdGYfvdF5RdjcprGiZKUeUgh3Otv+2entbqLqdlo1soOLY5fJBZ88D X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5253 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 12:38:35AM +0000, Tian, Kevin wrote: > /* If set the driver must call iommu_XX as the first action in probe() or > * before it attempts to do DMA > */ > bool suppress_dma_owner:1; It is not "attempts to do DMA" but more "operates the physical device in any away" Not having ownership means another entity could be using user space DMA to manipulate the device state and attack the integrity of the kernel's programming of the device. Jason