Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp8026692rwl; Thu, 23 Mar 2023 11:33:31 -0700 (PDT) X-Google-Smtp-Source: AK7set8zax2mh+WnwAU6gkAW4qZpKq0MrttQXs+tc6LSrPkr11hDtparo3uiUd1vf6jWxqlsxlK9 X-Received: by 2002:a17:906:82d6:b0:92f:e40d:1489 with SMTP id a22-20020a17090682d600b0092fe40d1489mr12126443ejy.61.1679596411384; Thu, 23 Mar 2023 11:33:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679596411; cv=pass; d=google.com; s=arc-20160816; b=M3/Xx3XhPj0AIbTcDFKQvnIz63xWL30nxiRggQHCGlDGmli5xyEZ0qJ1waRA+8DJ06 tc4G3aWmrIVRjYR3GrOpRy0WZw0DEe13QFPC4kF2DEe6KgGWd5wFwNa5Rdxp8meVn7cu gwBv0sshMq2M3/0ZetbZLaUQMUtOnZ8ZZwfF5fnDV6RYgMDvBhKGavecTuWTNav6Amjc 3Gj46XZ8udXmy1oGZb321Iuu2Pb0v1WAHEnaFHqNx+/KJqITaTkHJBzcVX+kBm4xRVrr 2F80+7CTBZpf5JrTFNGgsGxvsc4mkPfcSite1UnkQLcyqhtvlzHMwxY7HV/N1wcH2RrB +yNg== 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=bGmnri4yK3W6YpANDYT5wcbKwjm6uXhuem60jmPQwzc=; b=v6PmdGXsw6f+13B679ptlRkxsuYaAsFfzqybQC7um/zoGpLPBqOOrHF3hG4Z9/gFzx pQVtxC3tKm55e4pYUDVzjkGsWK62FK1VGh7BMulY9xtkxENJzntvHmnPEDUA22MRELcU gviJTm2Y5nxaT97il3UkBX2nZox1q5rumKntIkXoFWDhhXKwWxz1wKiIbImMGMlpZQNp yyJ4gP6TX1+e2ZUUpjxLKYxboma+cDtGWiowJKojX8MQOrVA1xHKl09ClQPKtarvPtyz /iZMuAIO5aF17uVfQrqbpphdJtjKcKj9UCJq7cQkx1RXhrR+KEeh6BWLfBdqIXJqugHg hzBQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=B566O5YU; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e7-20020a17090658c700b0093208bdc05fsi13592204ejs.68.2023.03.23.11.33.07; Thu, 23 Mar 2023 11:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=B566O5YU; 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 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230486AbjCWS16 (ORCPT + 99 others); Thu, 23 Mar 2023 14:27:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229741AbjCWS15 (ORCPT ); Thu, 23 Mar 2023 14:27:57 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2088.outbound.protection.outlook.com [40.107.102.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFABE24BCC for ; Thu, 23 Mar 2023 11:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SG0zOWLp9nEeyw1+5w/gexIMLIG2PSgAaue728Ff5hwJKgjGrASwjOzjC8QJ3cL80Mb8av/iql33m+sKbLSUmfAajBYUBWD/r4VOwodnwug4I9v1YvuyFM8LIiCXxc/xaCj7TY1DaBpKqBw+17t9zNe8qq2UQUimNkRhtSZOY0+vb907UYUq0T/dUUn+Vpgv9GNoosqMApdwLp1Pz5u0UOWyWe+WETsvKj905PhmNBosoOhNHts3Qw5+vib9HIo26vOmH29N4OLP5CVmKFCc1Z/QOaOHvR4eSfJrN5vTGNmu1au9tTg5Ho+7jxfJSsClbC7lxTkMf/paSR7I7G0yUg== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=bGmnri4yK3W6YpANDYT5wcbKwjm6uXhuem60jmPQwzc=; b=Y1x/KcWW0tUR9YPfyEh9fBfbGGQ0u5tjb9XGll7Ioxf/LVR2sSJ/h6Z1UsL7ldgGybgZRDLeR8J1ySQwyVgZ3Rr7AKsV5azUq1llSlMfgDHqDZcbeBYaEOlsKX0oNkz7t+C9FZ9akcqLQ3NHYIHGhmMgH7elYdA4bn2sRwy44FYdz9FXl2BwxvzrpLaU/najZbgA0YVlAysSgqQ97cmob2AU9npdss4CeKLeDRg2w4Vy0IQ5p2GtoE5x94hMfNnBEn8BYMVyd5pxYffUajbcN1TLNFpIphGmrT3JDQr6OLmYykuQN43ddIC+UtTF26v9iFKvfig07MlLMGX/juuKKg== 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=bGmnri4yK3W6YpANDYT5wcbKwjm6uXhuem60jmPQwzc=; b=B566O5YU7ZAPQfW1kqSKGVzMvpoAcnLa9vKbHOsqTMQsoLQxPazuMQqHhf96tGhC83KpAjwnLH3Wdstmncq45ODF1O8M0JFhZ+J0SGLH/Ny4Xa3No+LFCgBAJY1azbr7gXfmVoOrgFtMYAj3v7Mk2xGKSIvntQ7tCHPUp0v0ucjw0jhFay1WL5n8PZYwzTviYFzojf9c1EW5g6AHgxF2hqWJfDuIo72q7ONK3URKP85W+4T9pGFK23xVv0V9vX16r0OEbE0+vkID0rDDmff3oa5/vW5kbq6hAeEsQZ9hLTi6bK97OW/ns1sa1VQHN43R4TNV4RdUS7xqbLLRgzgxog== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by BL3PR12MB6594.namprd12.prod.outlook.com (2603:10b6:208:38d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.38; Thu, 23 Mar 2023 18:27:52 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::ef6d:fdf6:352f:efd1]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::ef6d:fdf6:352f:efd1%3]) with mapi id 15.20.6178.037; Thu, 23 Mar 2023 18:27:52 +0000 Date: Thu, 23 Mar 2023 15:27:49 -0300 From: Jason Gunthorpe To: Nicolin Chen Cc: "Tian, Kevin" , Robin Murphy , "will@kernel.org" , "eric.auger@redhat.com" , "baolu.lu@linux.intel.com" , "joro@8bytes.org" , "shameerali.kolothum.thodi@huawei.com" , "jean-philippe@linaro.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux.dev" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1 14/14] iommu/arm-smmu-v3: Add arm_smmu_cache_invalidate_user Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BY5PR03CA0029.namprd03.prod.outlook.com (2603:10b6:a03:1e0::39) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|BL3PR12MB6594:EE_ X-MS-Office365-Filtering-Correlation-Id: f9c53e46-7703-4f45-1d31-08db2bcc504f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PL9j3GYz2ClJwoXY+FFpaJg3NsID9SDhrHNj1ZTIWWKWbsEVtwnnlBuIZCliIqXZ92qUf0IP0fWJYXZdmSz5o7mciIFPTHJmSC5iCpWPELHJWYJaeoYMwux30u5oD7y63y7+ppz9x92Q4A+HbOtpag7EoqmKY8jCWeSs/ZVgMqkiH37CEtGOEBXPVN0Y7U/PKIJ/nR+DNYYwMbHIwxlvqSxDCxSfTpsJr6fNpPZeXPk3qrfXPRkFRAnvWpzgpjtiOS0sMGST18BtIeagugiuDzf8lBFFuKVxxxT5KLoJLAm6cwYV1gFLBBYSyDHyR/btfsQTQtgEqzIKM9b/7GkBul8x4g57U85uv0S/QYtmZZm+NxP7e/89k3vfIJWl5RMcvJvb0WeZzTVFnPXM2H2q3tGPlopgQCMtW4q/ztvYBeIpARdKoCWUABOxxjRd6HJbE3SLhGFpM0aDGk5G2xGd/dEA5L4WzPqK0NUbRTSn9UX8OJ/bi5ZfYn1j4u1S7pmpoAy6s8n/jLxbkcnBymyYhb5NT/DZeCZRS7PKEvLsbjZ1p/xFJRV9wexF7aS6Ci8ac2mz8EzzMNMuNt9W1HzSdITRUuNtfWjcpy/+Dx9rg2k1YXZs24u5hUDd+6YDPzUqTlmo8/IRGIyzPcNaNaGqNg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(39860400002)(366004)(136003)(376002)(346002)(396003)(451199018)(41300700001)(66946007)(8676002)(66476007)(66556008)(4326008)(5660300002)(8936002)(7416002)(6862004)(2906002)(38100700002)(36756003)(86362001)(6512007)(6486002)(186003)(316002)(6636002)(6506007)(6666004)(26005)(54906003)(37006003)(478600001)(83380400001)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GaH3C19uqQj5Sbtih9Q/chUMy84ngkhpyO6qk8Q+RAev1tF1PbkzirR9pPGR?= =?us-ascii?Q?G+9hHhTKtvr/gz5WgYACZjnYJZ8bobJ7TCTUdOWrqQxyPfaxLJaTh7W+dF67?= =?us-ascii?Q?I6OSrf/bdqp8/zPTuqbl99/IxpQl4vJqr6IumNxn2hQild5UxvQZIQhA0IVc?= =?us-ascii?Q?Fb6u/omEevM8d0YBuiSUSGpDNsjFKY7r1JGs+CoFbShfmuKGvRCt3ug2PFXT?= =?us-ascii?Q?WM1/p+1OMupb/GfVjMnoHMVzJJdbARZb/svtWr7ZPlsIIU5cUKd02VBWm67C?= =?us-ascii?Q?9R3hyWsOi4qr+oldySY1+UgFAy5DQMFSBgLehRM8VE133wALrB+LJ7dblOzN?= =?us-ascii?Q?uWkigeSnWeZz3zAedzw3gRmFPu0U06eB9hnouibHYY9G4U3AUhYij60qVcZe?= =?us-ascii?Q?tioWRQPgiEzmdQ1nsZB1OlHpM4JGcDYcQECTvWBwRVT+qsgmUqR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aJpQlUkGao0YJUfk9Cc2YDZ5SIyMUueJCli4MfsAi7Q4YBO?= =?us-ascii?Q?jWOLtMwGEBEHJmumjsVAhOyTLIbJKZYPX8BnB0XlnJx1n+n3XWeNT4GKIZS/?= =?us-ascii?Q?7xX72bgRuKqBq2BrAdIeRRVKBD7Yv8ifjX4E0wlCH7wtNpSmmspuB3yckXGL?= =?us-ascii?Q?adxXo9aQL9E62q8fEOmPiEKYb0xiq9N1uM7Vv+KR3CCk+E9hSa2D9G6AL7z9?= =?us-ascii?Q?YykyPOO1ExjhSRoZxr7oLrglmwkhg9l2+LeF9yqK?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9c53e46-7703-4f45-1d31-08db2bcc504f X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2023 18:27:52.5304 (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: lC7b5y6T3W/JlivyBxQook6MCfovGlgJ3IxQPIyDFGEwdxiKKgiAVkp8TCBEim55 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR12MB6594 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 11:13:48AM -0700, Nicolin Chen wrote: > Oh. So that the s2_cfg data structures can have a shared S2 > IOPT while having different VMIDs. This would be a big rework. > It changes the two-domain design for nesting. Should we do > this at a later stage when supporting multi-SMMU instance or > now? And I am not sure Intel would need this... If we do nothing right now then the S2 unmanaged iommu_domain will carry the vm_id and it will be locked to a single SMMU instance. To support multi-instance HW qemu would have to duplicate the entire S2 unmanaged domain to get different vm_ids. This is basically status-quo today because SMMU already doesn't support sharing the unmanaged iommu_domain between instances. If we chart a path to using a dedicated S2 domain then qemu side would have to change to make a normal HWPT to back the S2 and then create a real S2 as a child. This implies that the request for S2 has to be in the driver data today so that the driver knows if it should enable the unamanged domain for S2 operation and lock it do an instance. So long as that is OK we are probably OK to be incremental.. > > And a way to request the correctly bound vCMDQ from the guest as well. > > Sounds really messsy, I'd think multi-smmu is the much cleaner choice > > Yes. I agree, we would need the entire QEMU community to give > consent to change that though. I suppose it wasn't consent, it was someone needs to do the difficult work. Jason