Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4613171rwb; Tue, 8 Aug 2023 10:59:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGDdZ1PS3eNhHNuRcPJ+XxITO+X8gsRY2TMZ+dpk+66NtQjqLyMCed2cLChIYAPH1fg788P X-Received: by 2002:a9d:6388:0:b0:6b9:f26a:3c51 with SMTP id w8-20020a9d6388000000b006b9f26a3c51mr366260otk.7.1691517556077; Tue, 08 Aug 2023 10:59:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691517556; cv=pass; d=google.com; s=arc-20160816; b=tlmxWM1pAsp0zow0T1eY9gJf1ze0CPYtL9j+byznK4u1K6q+AElxm6iTYjEl4R7dG0 PtAIDARvLlsPTsPHPAOoD+kbdT0o4eIgM0FTIhuiL5YPsKE2TI+WGdVuUc9zs00bZuz+ t02Zdb/knIPLO+/UfrxubdrOmxzfhtX7DglrUQ5BURBkBeKqwqPAFmLXWaiamDGrDqUA u+tAPMcfK6dZFbiOeecA6zHFVwWL0ZYAXnO7LReNlUxI+dy8giAbNfugr51OeCOF7UjM CwHWS/dW8kEcK6D+4cnboFLoEoPYkYmNosrGEM7rpa684VX2LFYlak5btA0lWW+CvFl3 CiJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=6Jte0OUclu2bH09D2hN2EOkZLRWbNyPg0/DjTwPt+N4=; fh=V9Eb+aOr99CzpmIF/K6ba4Ij6tyBfWHmrRXkBNoNeo0=; b=MxkCR4dhzKDjLQWcEc+76aeg1BOK4MjZ5dYnVpQxrq5lZogSK7a4Q2oFR6CGyMskSN TFnwmX3yPQ6im/bWexjzr/lWLmw2B5iLw+n4ql9mtGAH/xALUzR7uRIYNRS4bzUOSMk7 09eSzHb0XMrj2QwozK69u2ZMQEehqHfRv7fV3RVtnqdLaeuJ/ZcqGnP4haQPTEzugGQL BjjWVFahNbx1ifKw+SasodUkR9HjXttQICZjNzSuKRVcZgSBiisfFLvjLll9I0HbApI6 1BxTgEmH/9m4xu3oMSRHv+17olThZszRw3ngfcQm/1C4DMG0EW1yizy8v2OvT9iscKLz 8L3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=RzuObS8M; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv193-20020a632eca000000b0055bc21d797esi7483080pgb.231.2023.08.08.10.58.59; Tue, 08 Aug 2023 10:59:16 -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=@amd.com header.s=selector1 header.b=RzuObS8M; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232630AbjHHQ1X (ORCPT + 99 others); Tue, 8 Aug 2023 12:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232561AbjHHQZr (ORCPT ); Tue, 8 Aug 2023 12:25:47 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2C368920 for ; Tue, 8 Aug 2023 08:50:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fGSNHFRMgwlkMNS74BhQgo/dFhjQTdBzf51Cy7LCNC7P0LiGpjpiuVbssdwNDMlmTxckSvGrDYN9uG8iLzAKLpcHRXN7lzKUPmAMw28tJwguqv8jdg514Ul+5TKhnJR7f6vAr71GgC/71tOi2BizbuLwRq9xgDRd3kfLID9/Qa+HAFEtNPtboSytBMgw8EVEWshyZT/rXOCckWauv1F4OyI32N4gHQzjXtKC42uIwqizYCnoWEtZZR4a6bn+4z9EAk9/KUCBVNxuAGEo7UfP1XxQBfAhw9EQnOPq78tgn/BRW4a7lW4GNthaJ0MiybP7c/jVKlIYxOTeWn0rJNLysw== 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=6Jte0OUclu2bH09D2hN2EOkZLRWbNyPg0/DjTwPt+N4=; b=IDlMQr60JCHbDs+O2f3u9RkeFVJPWsirDftlNZHbtscw5TGv9HmMYcaa8Tij6BDfAKsotIo5+stBkgJlyjucpalT2xvk5ZsgYmmNfydFuwUw+meyQA5I/HcSUuDpMppOoL/4hbj1ffPEhHCQzl7Am/tsC9Sg17YD5Jvfb/1QfYE+3WiEHQ4wyhjWhfjgWUe9PWXnuoMS494CMMygtRBQqYX+KXLtgpCZa4yrsbTL2vZZpxZ9oOjTftEXDefJhfia55I1n+2NNzlkwDh7FoGUpJuPY40rK/mLHpfpD9D+5RMgT3SpAMqo2kILfMDzX6YYyTqYzYBosl96f5Dy6CSsiQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Jte0OUclu2bH09D2hN2EOkZLRWbNyPg0/DjTwPt+N4=; b=RzuObS8M9TFbmnwhHvzJilZWWrXRRpnSRk5sUxdA3l9hq9VnGKPsFiisesu6suuwI4J+q4U29u5mtxg9YU5oixAnsFRlsX5n8vtaSa3f2vCyemO3Zt40iLN9T4FJ0X8MJxOfuqI8DDC0fd4WJnrpCSS0B1kC8eWSbkuv7g/4wA0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH3PR12MB8308.namprd12.prod.outlook.com (2603:10b6:610:131::8) by CH3PR12MB9169.namprd12.prod.outlook.com (2603:10b6:610:1a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.27; Tue, 8 Aug 2023 10:49:25 +0000 Received: from CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::7eed:c168:1b20:c628]) by CH3PR12MB8308.namprd12.prod.outlook.com ([fe80::7eed:c168:1b20:c628%4]) with mapi id 15.20.6652.026; Tue, 8 Aug 2023 10:49:25 +0000 Message-ID: <3921846a-5560-44fd-c4ce-329acad454c0@amd.com> Date: Tue, 8 Aug 2023 16:19:10 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH v5 3/3] vfio-cdx: add bus mastering device feature support Content-Language: en-US To: Alex Williamson Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, git@amd.com, pieter.jansen-van-vuuren@amd.com, nikhil.agarwal@amd.com, michal.simek@amd.com, abhijit.gangurde@amd.com, Shubham Rohila References: <20230803143253.7817-1-nipun.gupta@amd.com> <20230803143253.7817-3-nipun.gupta@amd.com> <20230803161736.52dd2d33.alex.williamson@redhat.com> From: "Gupta, Nipun" In-Reply-To: <20230803161736.52dd2d33.alex.williamson@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0126.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::16) To CH3PR12MB8308.namprd12.prod.outlook.com (2603:10b6:610:131::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8308:EE_|CH3PR12MB9169:EE_ X-MS-Office365-Filtering-Correlation-Id: 5e8b9516-8aa1-43a4-29d1-08db97fd2196 X-LD-Processed: 3dd8961f-e488-4e60-8e11-a82d994e183d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NUwZ4OLQioYJoX8ctpq0C7OhC+HzLWOY1xfSou12aKZE9hk4GyoVYcZYU8hNMk1pi03m/+cRf9BEQ+MQiTmHKjg/sSppUIArT3e+9e2XJ3QN77iQMXF1iICG3vNqppepBbE9nnZgf6YuSh1Gf3Z6VU3cGimrCaR6AYq62FMQw2RadRU7dcjS/m4VVHF20HyNsOucNxhPOuI2GmKKusxIhlI5wqonAwrN2Ogkphn8a3H7iJXDaKUxpQbDBeJPG09Zd3GbksXWXm9ZWB3W5yhfmgLk0P3Ha9lEum1i0hzRs9DtlvIn92xJ8sCiLnMurjCQNNz7emqafj02psMCOQaQjYcTlPrPIYAAxNPHh4Gees4UuYPOFTnaHWq3fgM9YXlkTXlwDN/pX6olNamNo0SpA6js6TMeAneFtz102+TrKFzo8r69Iji9ig8X935fk3ENsOZTearbwa5b/SaPgQbGzzfE9uMce59cYb0F4bym2nWW96C9JIjQaA7NdrXcx0BYOz8TOdhE+BkxBE1mltvqlwTYRLqFghadnS5/DTpN1BRxnWXUoRcLQ+jolJwrkXid/3Km86pLNiPA+gJJFEyjl3lFC+A5LeTBdRnjVya6xZWlyJcln+353HPX288SUJjWBDsz+XE3ayXsRJychXIG+w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8308.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(396003)(39860400002)(366004)(376002)(346002)(136003)(451199021)(186006)(1800799003)(8936002)(8676002)(5660300002)(6916009)(4326008)(41300700001)(316002)(86362001)(83380400001)(31696002)(2906002)(6486002)(6512007)(6666004)(2616005)(26005)(6506007)(53546011)(36756003)(66476007)(66556008)(66946007)(478600001)(31686004)(38100700002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RlFNMG55elhnRWo1c25hTDFXek80emFJcHFjSDFEdXZEWk1INWxVSVFQekNm?= =?utf-8?B?OXFOWkJqK3RjdU9sdTVJZVhRNG1WbDRoRU94QU5ydGFrbG9KZTNURnphUWhU?= =?utf-8?B?WlkxWkRqdkhHNFVYWWg2SUhleTZLQnY2NFZrQXJOUTdjZkZPLzJVSnUwYUFE?= =?utf-8?B?a2JzQlh0N284YnRmU09KRUw0K3NMUzhGNDQ2ZUVGWnFwOGRva3JvNEtBQTJP?= =?utf-8?B?bHJQOFVMOFhWSFkzdEMrV0Vic3dIMExVVkFtU3JqMjdXeEduQSszTlhEei9n?= =?utf-8?B?ZTR3bGRJWXloRzl6ZFhoTW5YNVdGZ0JSMDdFZ0lWZ1RKbUdpRzhscXZJd253?= =?utf-8?B?NWtCZ0hlbS8rd1M3YlAvS0QwQVBHWlRkSFpKQWJueDZIOUx4aTlZSit5dmNS?= =?utf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Tenant-AuthSource: CH3PR12MB8308.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2023 10:49:25.2986 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U8FrCDhwOEX/inymzdzFFL9XgGTOidBDgKQXr+ojRNHvTw+4WE339jUtoTVqmp5q X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9169 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_NONE,URIBL_BLOCKED autolearn=ham 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 8/4/2023 3:47 AM, Alex Williamson wrote: > On Thu, 3 Aug 2023 20:02:53 +0530 > Nipun Gupta wrote: > >> Support Bus master enable and disable on VFIO-CDX devices using >> VFIO_DEVICE_FEATURE_BUS_MASTER flag over VFIO_DEVICE_FEATURE IOCTL. >> >> Co-developed-by: Shubham Rohila >> Signed-off-by: Shubham Rohila >> Signed-off-by: Nipun Gupta >> --- >> >> Changes v4->v5: >> - Use device feature IOCTL instead of adding a new VFIO IOCTL >> for bus master feature. >> >> Changes in v4: >> - This patch is newly added which uses cdx_set_master() and >> cdx_clear_master() APIs. >> >> drivers/vfio/cdx/main.c | 40 ++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 40 insertions(+) >> >> diff --git a/drivers/vfio/cdx/main.c b/drivers/vfio/cdx/main.c >> index c376a69d2db2..6420cf6eb2f9 100644 >> --- a/drivers/vfio/cdx/main.c >> +++ b/drivers/vfio/cdx/main.c >> @@ -52,6 +52,45 @@ static void vfio_cdx_close_device(struct vfio_device *core_vdev) >> cdx_dev_reset(core_vdev->dev); >> } >> >> +static int vfio_cdx_bm_ctrl(struct vfio_device *core_vdev, u32 flags, >> + void __user *arg, size_t argsz) >> +{ >> + size_t minsz = >> + offsetofend(struct vfio_device_feature_bus_master, op); >> + struct cdx_device *cdx_dev = to_cdx_device(core_vdev->dev); >> + struct vfio_device_feature_bus_master ops; >> + int ret; >> + >> + ret = vfio_check_feature(flags, argsz, VFIO_DEVICE_FEATURE_SET, >> + sizeof(ops)); >> + if (ret != 1) >> + return ret; >> + >> + if (copy_from_user(&ops, arg, minsz)) >> + return -EFAULT; >> + >> + switch (ops.op) { >> + case VFIO_DEVICE_FEATURE_CLEAR_MASTER: >> + cdx_clear_master(cdx_dev); >> + return 0; >> + case VFIO_DEVICE_FEATURE_SET_MASTER: >> + return cdx_set_master(cdx_dev); > > It's curious that the implementation of set and clear in CDX call > through to functions with non-void returns, but we simply ignore the > return in cdx_clear_master(). Does something prevent clear from > failing? Would update cdx_clear_master() with non-void return. > > I also note internally that true is used for enabling and false for > disabling, which is effectively opposite of the proposed uAPI in the > previous patch. Yes, will fix in the uAPI. > > If the idea here is that the user should assume bus master is disabled > when opening the device, what happens if the user closes the device > with bus master enabled? What would cleanup that state for the next > user? cdx_dev_reset() clears the bus mastering and user would enable bus mastering once ready for DMA. Probably we also need to add reset in device open. So user should assume that bus master is disabled when opening the device, and close would also clear the bus mastering (by calling reset). > > Is there a use case for the GET operation in userspace? There is no use-case for get operation in CDX as of now. Thanks, Nipun > Thanks, > > Alex > >> + default: >> + return -EINVAL; >> + } >> +} >> + >> +static int vfio_cdx_ioctl_feature(struct vfio_device *device, u32 flags, >> + void __user *arg, size_t argsz) >> +{ >> + switch (flags & VFIO_DEVICE_FEATURE_MASK) { >> + case VFIO_DEVICE_FEATURE_BUS_MASTER: >> + return vfio_cdx_bm_ctrl(device, flags, arg, argsz); >> + default: >> + return -ENOTTY; >> + } >> +} >> + >> static int vfio_cdx_ioctl_get_info(struct vfio_cdx_device *vdev, >> struct vfio_device_info __user *arg) >> { >> @@ -169,6 +208,7 @@ static const struct vfio_device_ops vfio_cdx_ops = { >> .open_device = vfio_cdx_open_device, >> .close_device = vfio_cdx_close_device, >> .ioctl = vfio_cdx_ioctl, >> + .device_feature = vfio_cdx_ioctl_feature, >> .mmap = vfio_cdx_mmap, >> .bind_iommufd = vfio_iommufd_physical_bind, >> .unbind_iommufd = vfio_iommufd_physical_unbind, >