Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1047985pxj; Fri, 4 Jun 2021 04:59:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7s/YuV7TpfylePpJMqr6c3z3ijhpqUcTo7UNvbOuKf0KQsMDsd72L8WSxCjzIAoFO7bjY X-Received: by 2002:a05:6402:2714:: with SMTP id y20mr4259256edd.348.1622807968881; Fri, 04 Jun 2021 04:59:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1622807968; cv=pass; d=google.com; s=arc-20160816; b=IRv7eOr80AwffuMgfCeCaY83kA9P2uITiweJFfE5Ddp9iqdSDuTikQI0TMeQIie6Lm 6gnNdm6h9iVu46MpHoK8jEBVEG8hTaNAvYVbsw7BISj2cuspdYWI/WsXfbeiX4sK+/jA n4EEwjIhDsaWqshrVRGP0jhsbkjbHs7hwnWucVaNIM1cpBbzSmHZr+o+3ct2bYa/qd7P pLEGG9ZXMLYuFoMh3jscupTejaeGGRULU9ZmhAtfmePRGdII9kTiMZ47oQtB6MSvA3Nm dr6w3JqgkF0IvNGLE876+r2JWSs4mJ+feMmbkXvml3XptcEUjoM9VlCCCGtbk6SHwgJq JAtA== 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=x3Xg+/AnYOUviJzaYaH7QgXrYZzx30O8/kSb7B18maY=; b=TtVLW0iaQEiLvs25NqfHcbmPGlvFX1uEDc42IzoSAyFfv7tMBMIfTU8QVwQsdPpLKr pHLFdzTUlJt4RAeg3tEqukLCbl7imiOJzDzB3SyWfOMLt9z8QxVNlC1KZ4pBsSX9Y4nT LY3vZHucGkh8ooUiYSnC1FcQsLgtyHpkfCqi525b+RvXxeWE4exswJ7T0uMnKmzUGZrr yQAWnY0zITJY07skHt+O/Bp9M/9YSzYgeft3lbZZ8NrFx5X5oloGzZi0ehS/lXyrvh+/ Hq1CusA2LTCziociiG2+z8pGstX1XBcV3Es/nzqWYXi0maue+2bgWlUAIIkKMrW/htS3 04eg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=UkEpYHqQ; 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 d12si4271443edo.215.2021.06.04.04.59.05; Fri, 04 Jun 2021 04:59:28 -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=UkEpYHqQ; 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 S230072AbhFDL7z (ORCPT + 99 others); Fri, 4 Jun 2021 07:59:55 -0400 Received: from mail-mw2nam10on2068.outbound.protection.outlook.com ([40.107.94.68]:18144 "EHLO NAM10-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229740AbhFDL7y (ORCPT ); Fri, 4 Jun 2021 07:59:54 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TeAVc7/0HN0peOJlxpsjk2qjBbAXsi7guScLdJyKr4XilOs4TBA/husus/8To6zrkC67zIW/xi7wqvI/AvlR2Gq8HnAgJk4ei1IeVtG2+3kNSicvy3tUzI7PoVrC58IJD4pgcXDMRJfsqm8pIxwqpVdB6bWEvcj5JL+1olp0EDOazMCeBpDx+puuqDR/NKaPHQ68CFna9OhGPTLMjpenL2XXhqcsJI5wHJK1Y+gzimbBYmx1HF4SEpc5dS0Jg5CVgmqjMRyUBYhmrfNfTO6CHTjkfHqOlmaLd54A7zaR5Xb9ZQ4m5FtZ3bDUBddxyapJXSR15w9qypV5NrNDN3Xb8Q== 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=x3Xg+/AnYOUviJzaYaH7QgXrYZzx30O8/kSb7B18maY=; b=GvZuRhGm/5G54qmYqjN/Mf5xgPXZ8GWwPIfVdJmgWJNK9CMMvOJtuBTah7o235sJbUQlcd7Fx3oI73GuYWumHLUf7TMUceL3/9E1wfvxvdX7UGjRV/VBcv6c+yqlc84R/5pNB7JPYG4JYc/efBExWCKWbsWmMraKkNoGju62aKDTE0dYiPZsuo6lerSGL5afLhjqfuiIP4Fh7uJq7q3rysxNin6ZnR0+1IuF3JNcWn6Ka2Mz85aZAUeR2dWQi+LQhSb8nfI7ELTUSlnDdIX9t2K5Ukw1TuHzcpyXmLi9DE7L+sS0BrmNDv2AAD/p0s9/LtpkFiy7r1/QLUK0aSW2gQ== 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=x3Xg+/AnYOUviJzaYaH7QgXrYZzx30O8/kSb7B18maY=; b=UkEpYHqQHMYWzimnQpz9fMjIuBdiak1NtzkZ6+E+tnEndF1XZ2D8as1TrxaeeKsX0MqM6EqkCy+YhA/apjDCMXTa/cBjX9NSle5WBDyt/EhEqUimyxG1h7PGC8yoN3kyObkzhFialrcZHeaEAoNlXC+Ktof0komNkCSFSXIRNJrxf4/Yq2NJcraXdScgpdpl5Y5i0onW7dgEHeKobER/z/Jt1dsd2Br3z9nZgfHhevUjZ7wRe7MKULIxkJznViivY7yDWtMYsa+sVvjkxH+Z1fNjWixo/H+LsI//ZO3Ix+YYm1f/LRPoVqdWKqVm3grO3xd7utKum2EereJBYoPuZg== Authentication-Results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5317.namprd12.prod.outlook.com (2603:10b6:208:31f::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22; Fri, 4 Jun 2021 11:58:07 +0000 Received: from BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e]) by BL0PR12MB5506.namprd12.prod.outlook.com ([fe80::3d51:a3b9:8611:684e%6]) with mapi id 15.20.4195.024; Fri, 4 Jun 2021 11:58:07 +0000 Date: Fri, 4 Jun 2021 08:58:05 -0300 From: Jason Gunthorpe To: Jason Wang Cc: Alex Williamson , "Tian, Kevin" , Jean-Philippe Brucker , "Jiang, Dave" , "Raj, Ashok" , "kvm@vger.kernel.org" , Jonathan Corbet , Robin Murphy , LKML , "iommu@lists.linux-foundation.org" , David Gibson , Kirti Wankhede , David Woodhouse Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210604115805.GG1002214@nvidia.com> References: <20210602111117.026d4a26.alex.williamson@redhat.com> <20210602173510.GE1002214@nvidia.com> <20210602120111.5e5bcf93.alex.williamson@redhat.com> <20210602180925.GH1002214@nvidia.com> <20210602130053.615db578.alex.williamson@redhat.com> <20210602195404.GI1002214@nvidia.com> <20210602143734.72fb4fa4.alex.williamson@redhat.com> <6a9426d7-ed55-e006-9c4c-6b7c78142e39@redhat.com> <20210603130927.GZ1002214@nvidia.com> <65614634-1db4-7119-1a90-64ba5c6e9042@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65614634-1db4-7119-1a90-64ba5c6e9042@redhat.com> X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: BL1PR13CA0421.namprd13.prod.outlook.com (2603:10b6:208:2c3::6) 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 BL1PR13CA0421.namprd13.prod.outlook.com (2603:10b6:208:2c3::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.12 via Frontend Transport; Fri, 4 Jun 2021 11:58:06 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lp8Sk-001d1T-0A; Fri, 04 Jun 2021 08:58:06 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5a499b51-c25d-413b-52c2-08d927500401 X-MS-TrafficTypeDiagnostic: BL1PR12MB5317: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2FGEa9ZcNBh1kkuJ2BNoZsdlqe8YcKJaj19kzTbLtfbx1ENdhQizQBqdPEclzXxqaiPDx5sD1OZ84Kw5HmjPFz6+gW/CuOovpiAaSlHcQRJAl8d1qVfcOK6RaJ/uJ/aKLxF0D7YHZwhaENimoKSO9XhxvB/UbkwTl4/Wxrk40lnffOOxoUbrk2LS8stBdC3guptfxkReD0GH2iYwgpbG1EeDLUeycU/TppO+XeNJB+YuthePSQM/2QX8JEZChAzSCqz4cKp0uw9tidLP2DSXX2BKGhAkXAmxe0ptZZcX4JW+GotjJspl1eAAZBME7v6AKhq2iTVCCKJZW+b+PXKP6RXWtxiG3Bw23pBUssFsajvrDzLrxpGOWgAEIoUbMX08QDyi8aNXFZ6A8Ea/FxwUpBjVSuvr3wCyVl3T0adYxjGQxSVoPAGx2qHx8o+cjGctCHytAHeGKLzCRz3uZEtF5+rx3vMVAk5cO1/NYH7tp+H01weXU01wyqgczoQkI6cwQCQELJbFlVZN9bfGEyERfd91f8HpBpM8mq2auVr8wEdSpG7Krjhyvgw60Ez7drhDz2E5Yh/cBRB2b4r7CAJ4SYbGSNP8XeofcPlZjEHemig= 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)(376002)(39860400002)(396003)(136003)(346002)(366004)(83380400001)(7416002)(33656002)(9786002)(9746002)(8676002)(8936002)(2616005)(2906002)(426003)(38100700002)(316002)(66946007)(66556008)(66476007)(5660300002)(186003)(54906003)(1076003)(4744005)(4326008)(478600001)(36756003)(6916009)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?aK1rr0XiDdCDSAJC8t1h3H1htQlX+6EiojOC7hD+d3XZvMygpMsPszZ+VIJk?= =?us-ascii?Q?JTOiXAlbNN+I+HsTA35yqQb+G2KYFdOcxyOF+oFH3uPsHw7JXp8Mi1uoPyAu?= =?us-ascii?Q?EunLjlBZnt0rl7SbAavwgxtehiom/mFfpiXndYaNfxmY1kXEKOT/lSFGnUWb?= =?us-ascii?Q?M7tMKY5qv4UCdn8NnLCylMfXHRBk6XRqLUoJspNIBvTc5FHRAIzjy7ZoAOB+?= =?us-ascii?Q?EecHGslHafwx1BGteb4CCgE8kq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HlNvD1PwMUhqVqkhAE6ClBJSxB9rGBm1sRDcfOev4OJfeJTVugvHJPx?= =?us-ascii?Q?SsnrJCKKmT1mY+spe9i+0pf4CjhVaLY2CSmKrSgAZsuFtXL2nkVh6v6zVlJ6?= =?us-ascii?Q?JXyKOGRLifkEci3Elr/mxzhoNzjBxSiL23nGaRXZyyK6G8g7T3YIBH9F5EwY?= =?us-ascii?Q?6a+UqzplYqATx5nmVY8cJfDv?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5a499b51-c25d-413b-52c2-08d927500401 X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2021 11:58:06.9460 (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: 7wC2qmIpa+nXfQbiQyEWed2MVbPRnqZD0ghaZQiASUVdb++x2GNSQ8ygxb9RnQ2L X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5317 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 09:11:03AM +0800, Jason Wang wrote: > > nor do any virtio drivers implement the required platform specific > > cache flushing to make no-snoop TLPs work. > > I don't get why virtio drivers needs to do that. I think DMA API should hide > those arch/platform specific stuffs from us. It is not arch/platform stuff. If the device uses no-snoop then a very platform specific recovery is required in the device driver. It is not part of the normal DMA API, it is side APIs like flush_agp_cache() or wbinvd() that are used by GPU drivers only. If drivers/virtio doesn't explicitly call these things it doesn't support no-snoop - hence no VDPA device can ever use no-snoop. Since VIRTIO_F_ACCESS_PLATFORM doesn't trigger wbinvd on x86 it has nothing to do with no-snoop. Jason