Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp659135pxb; Wed, 29 Sep 2021 07:10:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztv8SWc/AR2B22a3v7/lUGvfXYTacpWrVoKxP/8Z/MYlabpt4qL99BTWHziyTjXgffH3k3 X-Received: by 2002:a63:f5c:: with SMTP id 28mr144937pgp.243.1632924620038; Wed, 29 Sep 2021 07:10:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1632924620; cv=pass; d=google.com; s=arc-20160816; b=GmRs8+8GwbE4npKE5FCvedIO3rFvOTYMsxPZlpQhLUO2I2g1RJlhQvmtRyVP5M9ZmK HXvDnZqM3P6tATuVuJsy2G50W55STjuwAoBG8ugA7+SXmYCTw57h89QyA2GlctTjGh8A ePScSzJX3+uHJr5rZPPlOPI8hQgOID0ubc9CAE8tu7qIhJxMWafKM/Y0dgQ1/YGsUJ0e CdbxsKoC6eBtw1bXGWOzvwJN023tP+O0nS2DT8Cfc/pK8qXNUeFw36VzujrUzMgSod3x zILDk7qNqd0YHTU9JL+JY7uaK4ysPuPSBnCvMbz9HhK22Karlu/tdG8PYJDiFIJadlgA Gqpg== 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=yJdC3kvDR4LVeVqs8inz+w4UUzH8FxZdZ9+fCMTaCaQ=; b=xzX4ME7LEDI+u3lFr7GaDm1Yk5842i8t4cR/D9zH5IvbHXxi6cJLDQUMtHjW5vWxVJ gVPREqHB4jfLZeomiuNwgzMaeb/ppGIlXHnd5kYGS3Wa/wMloX5mQ7yhiqf5Wp0Z3hef jWWZX0E1Si2ciAoNzoOySng3IKOLkFcR/IT2cGKlFfi4iM8JQcy1MPNsEyv3CnsvF6xo V4xEuROWTEJjiG3v3NNm5//phoqlN2kpI86EExkHZFx3W1NoXTZ5xCTCq2HjVgaFIe1a tMBQRLlRNDC6Foty/P1YcOu6xlc3vQ8IdKqFiYq8/Hyb+/YbwKUohluFnuW6jU98tWVu 1x5A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=dqNA7Z36; 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 h34si3236762pgh.340.2021.09.29.07.10.03; Wed, 29 Sep 2021 07:10:20 -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=dqNA7Z36; 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 S1343797AbhI2MdC (ORCPT + 99 others); Wed, 29 Sep 2021 08:33:02 -0400 Received: from mail-dm6nam08on2058.outbound.protection.outlook.com ([40.107.102.58]:39681 "EHLO NAM04-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1343628AbhI2MdC (ORCPT ); Wed, 29 Sep 2021 08:33:02 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZgWpw2tFxOEqvcJiRoQOl7Svoult/1dvR62/DMr/4u/ZSMyJHyZ6oKsQfU5b4A62gxdcnyySKhLElRP/k8ZZRBfcKgiYM/Q6+buOIOc5t5RTQqQmaDZBkoX5hExyqh8f2KBS75tQRJecJBw+TfsEQZ0EQ6y0eRNt/KMkhm/3psAsVjefR00f4rvxqYyG4XiyIFWBmuoi4/gSmJI9o5551Em2Wr6KSm4xS7uLerZzJHQ1atWFqBY9+Hp1udsHyEwWU9TkFcFkVkWy7y+iayQMvMHOkGbJageg7S6MvS1e/UysYV/I3VLMbqxi+/3uWPraO91Xnlfm7uLmFr83wUQTQw== 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=yJdC3kvDR4LVeVqs8inz+w4UUzH8FxZdZ9+fCMTaCaQ=; b=jJfuHa9CQ9kqcPXPgVuVTq+pnU4cHiwKthkVq559fzu3BFQUT1LCmL6iv6tqBaM5WvLWdIHQwbKza5HCJtfAHkpnV2KeskV6nbPLMaQOiR1KfsE73/k+rMveak7Efsu6mk9VktrQyEg7Hcc/LFPd1DwD6DkQHhXLO96iY6uPO9s7KjjlTHIyvUFFdukWJF+YCcFWlg3KMn87WXq5Y9pwuvbTDEb9oHndJiUq8qJnoSG6AT8SA0oTp4ufPxawDjBkUlI7JWvbBQnctrolW6Kd1tIy11ovWlcomKhDmp9ZFz0n+8n8HyIBf4KwyEmfekSMrPNk0mDWAUgZI27tH1OWEA== 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=yJdC3kvDR4LVeVqs8inz+w4UUzH8FxZdZ9+fCMTaCaQ=; b=dqNA7Z36qnUelY/lBi8U/F/+6CZ/eF15RkjjvmUhJTAVLATIuK3B7LkV1ipjGBnMkeon3Ysy5Qy8ldNZphCDJDo5dIlPDkRIpF3EzIg9oJfRpnZprWOwTVQX8DMYgtXJ8Tl42J+ALNyiNJF3x6Zv74RT5mIfqn4ZoQshoByCyBaLTtp2N7iYXwzWGO0d1+j1b4SCqvSVSEsySFTWWQovsGTIRZfRwb4B4+HBH3HUvwspngQxfKEaBiHpOeXxod9P+0amziWl8drjdGB0h8/fLX80EbGm9nf9pC/gIQUyd0R9WaMbRU/5Lw7yAKvY8IFXTAGVmH5Otv+g2K0VQHQhLw== Authentication-Results: linaro.org; dkim=none (message not signed) header.d=none;linaro.org; dmarc=none action=none header.from=nvidia.com; Received: from BL0PR12MB5506.namprd12.prod.outlook.com (2603:10b6:208:1cb::22) by BL1PR12MB5377.namprd12.prod.outlook.com (2603:10b6:208:31f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18; Wed, 29 Sep 2021 12:31:19 +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:31:19 +0000 Date: Wed, 29 Sep 2021 09:31:18 -0300 From: Jason Gunthorpe To: Jean-Philippe Brucker Cc: "Liu, Yi L" , "alex.williamson@redhat.com" , "hch@lst.de" , "jasowang@redhat.com" , "joro@8bytes.org" , "Tian, Kevin" , "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" , "baolu.lu@linux.intel.com" , "david@gibson.dropbear.id.au" , "nicolinc@nvidia.com" Subject: Re: [RFC 17/20] iommu/iommufd: Report iova range to userspace Message-ID: <20210929123118.GR964074@nvidia.com> References: <20210919063848.1476776-1-yi.l.liu@intel.com> <20210919063848.1476776-18-yi.l.liu@intel.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BL0PR03CA0031.namprd03.prod.outlook.com (2603:10b6:208:2d::44) 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 BL0PR03CA0031.namprd03.prod.outlook.com (2603:10b6:208:2d::44) 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:31:19 +0000 Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mVYk2-007Ykt-FM; Wed, 29 Sep 2021 09:31:18 -0300 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 253fd489-8e72-410c-cbac-08d983450a03 X-MS-TrafficTypeDiagnostic: BL1PR12MB5377: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 42eloFLqDSJBidcWd3U7NjgQNsj+E0ZAaM9MhcTNvLa4k6tauVh4Wyp4sViZwBG6rFR3jY8WZhwVtZkznT7qvVx9RtQoD8kVz8oLtwC2Z5iK7q/xizgJPNv0RgNYsQPzUnt2NNbCgBkVTShly/kD1h1x3+U7sULlIZNYdxrrh4VnKSyUA2hfptpatMim85/Nnvlj6TUl8RAMVsVXHT7cia14YI8Dj4vsYAvOgz5phwnDEviUSuhNP1pQArazU2zaw5GiE9MtMLzbJHU5buxQMj1dicm++uRCT7p2C2s+3AVSOjCrhc62dxPGPob7Bbg3rfoJylMA2x66uKYYGICOSXaJFAzeOGqEYftdXWkKhfTYM8IQuBMv11UstwMntAkox2R2+8nS0ymibpkS6xcNGU6mppV8yR4vzpws4VwYG/sRrxqZj/ZyVarf5VOI7+v191/3ncucejZjLQ81RHn3Qowx8zUiGQZZYW57FX2Pwc0YoeI+urB+MVnyeWOFP6N622VLC5DXFd4oq5X+wXfGtaiKidxNOLzwR43xmjf4ZCbyh1rCZl6+O86pMXeWZoQvXYhw9qqA7mbQrY0t0sguKt9nS1RhuDH8znF6/bpBkz11yLPA1TsungwB0/A141ab6DQ6fRhoeXOnpunbriJ7BeN1+kK9XtABniiAcN9Kqmlta2R76WVR38HIGqL0xWz9w+97OYmo5sBagqlny7W+8Q== 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)(7416002)(38100700002)(54906003)(1076003)(6916009)(8936002)(508600001)(66556008)(426003)(36756003)(5660300002)(4326008)(2906002)(4744005)(8676002)(107886003)(66946007)(33656002)(66476007)(9746002)(86362001)(186003)(2616005)(26005)(316002)(9786002)(27376004);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?duv435sLnUY6rosf3QqF3X3GsMj7f5i1ybrpPWyEpsnPhbmwaG8PJGt3mNJq?= =?us-ascii?Q?kjiGV60jRjk1W+eo1qMPhSdfukwTWs29AV17Q6lG5y8E3vXiGfzE0dmPi+eL?= =?us-ascii?Q?HRdh2j7UmDeR1WjqMdlsv5cfLV5a6nntOMr3n7Lkxk/btDt8XSuZc7DGEqbq?= =?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fLeC/0ruJemvEONqS/ssG49?= =?us-ascii?Q?jHluoLF0nYgETRzOjiopKTafA1qmDNvzl13XhDv4TCFmTP8YAbQ39Yco9+44?= =?us-ascii?Q?bBtAI3dC5jGJ5sQUsfamEuIGOFJNbQkZah6jjXhHR6VTJAFJ2TwNLRYDdAQP?= =?us-ascii?Q?tvOwZAiXHx0qaDcCIJj89qs5MeYx7NInuCmFdvHAjAddJ0FOXmjy75GEJV/z?= =?us-ascii?Q?lUXIdYHitCLiXTytAQTuGqxyKTfGNU9fB1Pkppie3TH8ow/taeWeJr+McYvM?= =?us-ascii?Q?vq6sdI9z5t4Y/0Qm2v+XT7WK?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 253fd489-8e72-410c-cbac-08d983450a03 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:31:19.5789 (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: UhQOR/jKrdkFpp8HyCi2zGnF5B/KZXfuzyZBoFNZLseiSo4sODpDZ8VKgcmlu8O1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5377 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2021 at 01:07:56PM +0100, Jean-Philippe Brucker wrote: > Yes, so the guest knows the size of GPA it can write into the page table. > For Arm SMMU the GPA size is determined by both the SMMU implementation > and the host kernel configuration. But maybe that could also be > vendor-specific, if other architectures don't need to communicate it. I think there should be a dedicated query to return HW specific parmaters for a user page table format. Somehow I think there will be a lot of these. So 'user page table format arm smmu v1' can be queried to return its own unique struct that has everything needed to operate that format of page table. Userspace already needs to know how to form that specific HW PTEs, so processing a HW specific query is not a problem. Jason