Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3456774pxj; Mon, 7 Jun 2021 11:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGbGmN9ooPd+VSqFjAK0/TAjkwguSodTbxcCJgXu5q7KQKxf7C3BEVpKc08X1xZJsZdffp X-Received: by 2002:aa7:c3d0:: with SMTP id l16mr21472251edr.65.1623089019371; Mon, 07 Jun 2021 11:03:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1623089019; cv=pass; d=google.com; s=arc-20160816; b=rIE6HsyQkm6Du4lrG+pfW3yBf4Ta6yxJFeVMG4fpfRWwrowFsguze8frE+dPhA6bUR c4JROXGC4k96Di8HaJd5nAmgAN5RfOToE+y9Jj29W4PMEMBFXFpqlJy5m4w4vvm8JaqU AbTLyZCDXek4C+lvw68BOCCZLgffb8jU11GLHwRwR8MdUaHNOgw9e28JPGRepCmyzhLq 4JeDRuBdYtqQYYOIfbDmVS2pUuL03YkGxPn8iN0Vvhx0JIXcSXxF1uwtkaEp9sHe8xfA 89AS9kpGWY7sTURjVc8ql4sbEpdWdWV9b/1VES3zOhGQwJfYZOFgvXed5MyjpRI0lp7G iFuw== 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=Nl9rC8EcFKacYV3yYUQc2grGv1xVZfV/Z7L1afImyks=; b=HXdgyW0TxgOLLatdXw4biLiO3p0JITWHao2Mk9Is3zXpwbIKJdbv2Md75Ry6edAqQ2 K1h/XTDlbUDm5kad2xv0wj5ahM5GVlW2rRz7CxIcSYg5UDfgjnJnEfPqqpl4OZwOmvM7 9TE6DM3Er/sPKNhadljCH3lnrJi/RzFrnhvB8+0VwyNOfyrTicGNYxBuOnMrX6nbduCn /MvHUcBiTXc4mCFozYK466Zs96pNMfLsu9sKCJpY8sqX6lnmO94Qop2G2YxsLzitbbC6 k2YUnhR+gaL17sWwKv+jwStxx70Zd+2tUNTjRShKufhFTV8js0lRSqIXZiQopdCFCVvo Ofbg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=PEt3xhAx; 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 l18si12562432edc.264.2021.06.07.11.03.15; Mon, 07 Jun 2021 11:03:39 -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=PEt3xhAx; 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 S231342AbhFGSC7 (ORCPT + 99 others); Mon, 7 Jun 2021 14:02:59 -0400 Received: from mail-dm6nam12on2064.outbound.protection.outlook.com ([40.107.243.64]:52705 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231196AbhFGSC6 (ORCPT ); Mon, 7 Jun 2021 14:02:58 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ht0w1GgnBJalgJ26SvaY27McxtNeZdscH74gveDhLwA1YrdvPNnGeP3VIzPiCh8MlKNpdvBhw6FnjPcmIeDis2+XnJxKFO5OkTk7leIuWP58m55jk/emLYs5285WElMX7gKFgz8mI0DzyYtxH1ZDSdAfosM8OObgY2AZObo/ylxYVw2qWRQ5WQSYNru728EgbqMmRZALRzFXnrXFDr1aStZ7b+hlrrQEbLs7Y+LugkJpSySXy8kMg27httFKRTKUezQrBV1ovUoEoY/8Mh2HW/9xv323jgmPkupFEjsBOwxXspwIngo4NqoAZsmT5CPo6JVIzZMYuu7kcWRUmAtq4g== 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=Nl9rC8EcFKacYV3yYUQc2grGv1xVZfV/Z7L1afImyks=; b=bY/sJPyIEz456z5Y2uEGU4/46EK1StFujOOMGUcNyxMbAHkB6iTN73AcMp5lmrs76xPyh8YcH5YsntMMbPdjooUvX94XvsV5tG9KIHCERgnlPy5aZs/yCrnwusFNi7LFF9tXgykyMqJeYsRFHOqs9Tn6igqkYzZuiR3SL9DPtVcf4WVMDuP7x6QJnWsK4YVZyTuVw66NpiGbPXLFZezh0rYRb+xB3xaxRmWtdo/bOkh/DFrWl/4PE6fa49v8kb8X9+KZMO8ySADmfQpmFkDA7cX5Ysr4jiS2QiL9Xd6+v3hQfNKJy4F5BlrGIr9vFb2+kiec+HeRB4qmvqsmltkVJw== 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=Nl9rC8EcFKacYV3yYUQc2grGv1xVZfV/Z7L1afImyks=; b=PEt3xhAxfP3lc4N14VC0t0gBE+qm7Yls8gJnaH5A4zdpBP/AH+LqJ+PiuYzAXFUkHx94zCXdRetLvSe7uFO4QM/k0WMnYDEzyCEr6JFv5a1TaJ9OZjusronMrMBxdYXy6IbH1Ox0boC0YFhLSTvA/62P2TRhyaFSs+6YLz4U6BOQTlDXpR4/DZ9MlEQ3l1mTUwulE5Kqp+8VLCMpmicDQkkdhWQNkqjhCt1hMcaI+WfV4ivhDo9RJ2ODF/rUwozMaQprq3xuKmbH63ysJme4La/sSC4fMaQrGhMlrIkTWNTOUjMk+xLdMLpsjYKQX1VQWYTlCZw+oWlpBWXjj1CPvw== 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 BL1PR12MB5109.namprd12.prod.outlook.com (2603:10b6:208:309::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22; Mon, 7 Jun 2021 18:01:05 +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.030; Mon, 7 Jun 2021 18:01:05 +0000 Date: Mon, 7 Jun 2021 15:01:04 -0300 From: Jason Gunthorpe To: Paolo Bonzini Cc: "Tian, Kevin" , Alex Williamson , 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 , Jason Wang Subject: Re: [RFC] /dev/ioasid uAPI proposal Message-ID: <20210607180104.GK1002214@nvidia.com> References: <20210604092620.16aaf5db.alex.williamson@redhat.com> <815fd392-0870-f410-cbac-859070df1b83@redhat.com> <20210604155016.GR1002214@nvidia.com> <30e5c597-b31c-56de-c75e-950c91947d8f@redhat.com> <20210604160336.GA414156@nvidia.com> <2c62b5c7-582a-c710-0436-4ac5e8fd8b39@redhat.com> <20210604172207.GT1002214@nvidia.com> <20210604152918.57d0d369.alex.williamson@redhat.com> <9dc6c573-94df-a7c1-b4df-7f60fc3cf336@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9dc6c573-94df-a7c1-b4df-7f60fc3cf336@redhat.com> X-Originating-IP: [47.55.113.94] X-ClientProxiedBy: MN2PR15CA0048.namprd15.prod.outlook.com (2603:10b6:208:237::17) 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 MN2PR15CA0048.namprd15.prod.outlook.com (2603:10b6:208:237::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.22 via Frontend Transport; Mon, 7 Jun 2021 18:01:05 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1lqJYe-003OmY-EH; Mon, 07 Jun 2021 15:01:04 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70b2a4b0-fca9-4632-a266-08d929de383b X-MS-TrafficTypeDiagnostic: BL1PR12MB5109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RGwJcEIOykWgKfBtTnBXcf+oM89qXU7y1jICLgRV4/D4za0bx7EDr9sSzcENoIlYHvUCpPsPwoii7vD+BIsYZjamh7xTaQ51e0QDDKxdAC1MsEr2sdiylyp1mzAddL8sBuhfG5UzH6CgR4f9drG8fXjzxmyHTDkC1CEUteexnWoCwVOHufmBBnuptSYflhHaUhgzXDV4rrNbVQsujFUZI4tagTcwbAbAKloBhEQA7aX85stFENHS/UzaXGLqroEsYEOtZCkz1xJO6R7k3ct5QQfEWLgYcXT/llMW3wG0DXXmwbmrbuiVcpCNrwd/fupoK76R8wkSkW6axM7nEQ5mnZqFkluxHHUqRRtPBRlosno6COx9UOGzsLsOa+qnxhXqC0dz23AFfJhoyM1dWIY4YBh9Nb4lXtl6PbRt5yCEyhEqs/omJnfYTIdS7umgI0E4FVtrN32sP9vIj6v7j/T/2MFoym82QbzBR6XNO+9ml/sB+Ga+JZRxwfbw7GyD3PJ87lFsHw6N99saZEOOJE1JalaF4ZS3CslpHasrfJYkstJdpHgK7+oV/1lSnRBlkPYbztzTAw6skKi/VaIhCanWofEjuHYm5HDnEa4rpKy9x1o= 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)(346002)(39860400002)(366004)(396003)(376002)(2616005)(478600001)(36756003)(426003)(26005)(9746002)(4326008)(7416002)(9786002)(5660300002)(4744005)(53546011)(33656002)(86362001)(54906003)(316002)(66476007)(66946007)(66556008)(8936002)(83380400001)(8676002)(186003)(2906002)(1076003)(6916009)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?RadfBjwtyZae319OhjidlCOStUG6jUovfX5jFljZbJyJ/sYLoCIs0TCPpy/H?= =?us-ascii?Q?6xPk9bifdW7QknWpN1MGmRC+bcUKeT4gNj1RZnhVmQDlD0GCsO0QL38nDEpI?= =?us-ascii?Q?naQBKLSBu173VQVSLehYKZhYwaodJO32rfLVofjWfAgagQ+Ufh0TCrOPIdV/?= =?us-ascii?Q?j0U69qykKKRTnzGCseSC3qlATS57Y6m6spsBgQbap8z1CJAwBo8Fj7cVodBc?= =?us-ascii?Q?XfqkzMrNvmEB5CViwsk7R9dsPNskBYcG8PmIkD9VIVCw1pim6CrSJZe/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iCfBqpnzWtuQxTHSQUORB52K9yHsK?= =?us-ascii?Q?KZFUa+XG6YpKP9vPXMS5ZgC1SpihdCKfFsQN8IvVIUVUmFC3Ikz7oz6oHu28?= =?us-ascii?Q?2VbyRI8s0iuK4NGzHsDx6YZQL68PX39NhJ8cPF1zKUU7ie7nb0btxb8mdkFk?= =?us-ascii?Q?L+HOcSuOBoGBEbAYMdXMGBLQ?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b2a4b0-fca9-4632-a266-08d929de383b X-MS-Exchange-CrossTenant-AuthSource: BL0PR12MB5506.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2021 18:01:05.4079 (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: 5zOaepWAscbeqRZ7fXxESPUQDztZUqwTFUY8bdCcRxiEoowGjYaDgeytmmopDZd9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5109 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 08:51:42AM +0200, Paolo Bonzini wrote: > On 07/06/21 05:25, Tian, Kevin wrote: > > Per Intel SDM wbinvd is a privileged instruction. A process on the > > host has no privilege to execute it. > > (Half of) the point of the kernel is to do privileged tasks on the > processes' behalf. There are good reasons why a process that uses VFIO > (without KVM) could want to use wbinvd, so VFIO lets them do it with a ioctl > and adequate checks around the operation. Yes, exactly. You cannot write a correct VFIO application for hardware that uses the no-snoop bit without access to wbinvd. KVM or not does not matter. Jason