From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C45A4A0C47; Tue, 26 Oct 2021 12:59:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9ACC1410D5; Tue, 26 Oct 2021 12:59:14 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id A5087407FF for ; Tue, 26 Oct 2021 12:59:12 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10148"; a="229823778" X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="229823778" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2021 03:59:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,182,1631602800"; d="scan'208";a="465271659" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by orsmga002.jf.intel.com with ESMTP; 26 Oct 2021 03:59:11 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 26 Oct 2021 03:59:11 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 26 Oct 2021 03:59:10 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 26 Oct 2021 03:59:10 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 26 Oct 2021 03:59:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTYdfIZaK33IifGwzawa9JNJUGxXQONh+vCP1zBhaZeupvon9U7NyZffz87MP+5yOlflZ/y4+qJGUBaDMgJC6jKmfDpTIJSnsP60Yh8Lk1MHh+X0ojl+8AewUsIC/aAAMpGWLiiFiXnHfTapjzLPhiStfEytTNU3LQ+78Bb0Mfo4qWdDQoQDgN9eNP9KkQWp0cVe3wrOW0A9kViV76Ga7lp6igBcD9p23NZ46iozAUhSw4ChR4OHHwxbDZxLWjuEvKLyp3tq78+xSOgA6MKVpVI9SBKN/CwO8vbR4GJywl0NkVDmafyrHurI0dHl0LKvK2Z2QmKcyHumMZ0zYNbzNg== 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=FMqCJdUPiCQQNkbmQeIfDWvEjYM4u7qqmVUEL/T5xkw=; b=WKhp+lH7uFQ24uA1KIg2/x6O3yHanIJVZyxutzJRg+XQE+nSfx4boK5wL8bNrO8cFS8tlE/OPVid8ipXvprnEQBE1F7ELnSpVQu8FlgaMv57vSAnoAFAmPf2DeDOJUaoeVTo1AsefVr3Qej3HC3k5Uqsn+f3Xa5b5OaoWYlMlZdyD1RIKN9N1Sf1Q4a3m6t8X/xvSFYyX7rkv/1KAknaZxoEwvvXFbrWDYkpjFIZ+IPRuIVJFPuZvmDHhv8+OTXChGyCRPkRj+o7L+GGnOufDnR1nCa929h6lT2ar3lmiTBtgPCm9/c0h2D3c6p1f8mSTRcYALV0v56lLhh/8xSUUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FMqCJdUPiCQQNkbmQeIfDWvEjYM4u7qqmVUEL/T5xkw=; b=K7QAP91U2Kc6ttdCnjMVHSQ7wklW5hMvPY4e3Q6xxIVZaz2L0W94sYuo8pZz6t7TWRforzJYCwtUrjZTL5Tx8EcPQWdu3tbQPRqrvUTXJgSIORy88dLg3kR9k2L85Ir1TPQ4y733vPZBKah8kdhjZF+JGkoaqmfM2QdoIuW18Ho= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB5045.namprd11.prod.outlook.com (2603:10b6:510:3f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Tue, 26 Oct 2021 10:59:03 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730%3]) with mapi id 15.20.4649.014; Tue, 26 Oct 2021 10:59:03 +0000 To: "Ding, Xuan" , Maxime Coquelin , "dev@dpdk.org" , "david.marchand@redhat.com" , "Xia, Chenbo" CC: "Hu, Jiayu" References: <20211025203353.147346-1-maxime.coquelin@redhat.com> From: "Burakov, Anatoly" Message-ID: <6714a5cf-b0b9-e1a8-60c4-83904ef4b9b9@intel.com> Date: Tue, 26 Oct 2021 11:58:57 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.14.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB7PR05CA0042.eurprd05.prod.outlook.com (2603:10a6:10:2e::19) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DB7PR05CA0042.eurprd05.prod.outlook.com (2603:10a6:10:2e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.22 via Frontend Transport; Tue, 26 Oct 2021 10:59:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a6de1dc-b900-4ce6-afcb-08d9986f9f45 X-MS-TrafficTypeDiagnostic: PH0PR11MB5045: X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ae9ddjogJSnnePVgTKvK6Bu21bBuF0iwWAod3Yp2hO8JVVqnicN0dn/AMpLvw/Q6Kw32TMXUYyP3fyix20d1WS07dSFPLgLhD35bTEqqeChKm0BlquBz9PRJ5L2MEAsQ2baTcgAJpqGfiANET8OwnwZqfnNarEFwRZSAA7Pxus1q1b3EGefd18wOQ+bUQxPlS7ux9r6oatGZoHrArM0G9divpYCbDg1Gr/jykH5sBssnVZmR/uVym2S9UuagiS4mxYssifi6GizwYST8BWeF6AjpEUxQoiC+6X4Z4ACADQssmzebVQShOB6lVfAc3ylPfGWUETxNF3tKh2sgw+DfgMIJWP1mGXf5fD9yil0WXZHt2UoGWLe/ekF2bJQvb36S7++wWCCK0HgVFT9FlGxkVT8gvjAgBl9+57qse5FyVF8qJ26Vyx9q0kV11YcOHa36MMGjFkfK5CYOH+/4qEzlQPmupi20EEbMqnUQeh+jZiI6QcqPk6ex+CKIU7qa15SsT7Rn/9GcNwkJolRx0tHAE27bZAifYC2aeCv9ch6LDRSDrX5Gv0+UD4EvfgHgwVgttf/dQqgL2pQ3d4QBTaOfW1QPhRPNsAQFRik/aru6+e74Gn9+5Wqd3ulCZamJaL1KCgOZUxLG65zThfBYVgsiBTvMRAePGBjZvM9GapPSYUJi/OnlZ2H+3/dZoiEGHQdGP2EeTkiV4sKHaaujkPhliQh4C3fXPpoEeGp4zS08zcg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(107886003)(316002)(53546011)(86362001)(6666004)(66556008)(31696002)(66946007)(110136005)(16576012)(66476007)(36756003)(8936002)(508600001)(31686004)(2616005)(8676002)(83380400001)(26005)(2906002)(6486002)(4326008)(82960400001)(6636002)(956004)(38100700002)(5660300002)(186003)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Um9KUVdSTE1MZXhndC83cmJYdHRURXBNUC9lL2p1L2p1R0xkRTlrdGQwN20x?= =?utf-8?B?V3hsSklCc0FyaU9HMEl0Y3NENWtuckt5VUxhYlNYZVc5YWJZTDYzTEtvVmlj?= =?utf-8?B?Rldqa3Raa2UrdVBZaU5FMGFmUjM2WXpLbU0wN2poWGhVRS85dEEwSmZydkRW?= =?utf-8?B?WDRIWGhkRmZTa3JBQTdiVnRNbFdwL0tUN090eXhoY2twd2t2Q2N4YUxCNmtF?= =?utf-8?B?eXFPN3F6S1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4S1ljRGFVbGlEUjlzS3dl?= =?utf-8?B?TWxseTE5YVFEcTRUQUpVcXlmNStSTHh0cVpBYlFrQ0JUdFVwQXV4em9halp1?= =?utf-8?B?MkxYMVVoNVg0bzVZOE94RllzL1ZHTEp2bFhXZkIrbXVFTzMzU2gvSXhIbStj?= =?utf-8?B?Mkgwc2hveVRJYU16NG1pc3dNWTdnMkhRdHBmUGZQMWpLZnZjU0VhZmdjNHdY?= =?utf-8?B?U0thMXhSR0NqRlIrbm9qVU5zNWR3PT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: 3a6de1dc-b900-4ce6-afcb-08d9986f9f45 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2021 10:59:03.2105 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gBHfOgGGI0Q1W7iRmVadxFp5/x7Rmx+HR0mJJzgvxr1disq2y+jYc2KlJfPfHsOtOYL926Tw4iOeGwwpspVO2bv8VJUY0OSJZqQh8p1MMjA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5045 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] vhost: fix async DMA map X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 26-Oct-21 11:27 AM, Ding, Xuan wrote: > Hi, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Tuesday, October 26, 2021 5:49 PM >> To: Ding, Xuan ; dev@dpdk.org; >> david.marchand@redhat.com; Xia, Chenbo >> Cc: Burakov, Anatoly >> Subject: Re: [PATCH] vhost: fix async DMA map >> >> >> >> On 10/26/21 10:49, Ding, Xuan wrote: >>> Hi Maxime, >>> >>>> -----Original Message----- >>>> From: Maxime Coquelin >>>> Sent: Tuesday, October 26, 2021 2:53 PM >>>> To: Ding, Xuan ; dev@dpdk.org; >>>> david.marchand@redhat.com; Xia, Chenbo >>>> Cc: Burakov, Anatoly >>>> Subject: Re: [PATCH] vhost: fix async DMA map >>>> >>>> >>>> >>>> On 10/26/21 04:07, Ding, Xuan wrote: >>>>> Hi Maxime, >>>>> >>>>>> -----Original Message----- >>>>>> From: Maxime Coquelin >>>>>> Sent: Tuesday, October 26, 2021 4:47 AM >>>>>> To: dev@dpdk.org; david.marchand@redhat.com; Xia, Chenbo >>>>>> ; Ding, Xuan >>>>>> Subject: Re: [PATCH] vhost: fix async DMA map >>>>>> >>>>>> Hi Xuan, >>>>>> >>>>>> On 10/25/21 22:33, Maxime Coquelin wrote: >>>>>>> This patch fixes possible NULL-pointer dereferencing >>>>>>> reported by Coverity and also fixes NUMA reallocation >>>>>>> of the async DMA map. >>>>>>> >>>>>>> Fixes: 7c61fa08b716 ("vhost: enable IOMMU for async vhost") >>>>>>> >>>>>>> Coverity issue: 373655 >>>>>>> >>>>>>> Signed-off-by: Maxime Coquelin >>>>>>> --- >>>>>>> lib/vhost/vhost_user.c | 45 +++++++++++++++++++----------------------- >>>>>>> 1 file changed, 20 insertions(+), 25 deletions(-) >>>>>>> >>>>>> >>>>>> I posted this patch to fix the issue reported by Coverity and also other >>>>>> issue on NUMA realloc that I found at the same time. But I wonder >>>>>> whether all this async_map_status is needed. >>>>> >>>>> Thanks for your fix! I can help to review and test the patch later. >>>>> >>>>> I add the async_map_status in v2 for compatibility. Some DMA device, >>>>> like DSA, may use kernel idxd driver only. If there is no device bound to >>>>> DPDK vfio and kernel vfio module is modprobed to ensure >>>> rte_vfio_is_enabled() is true, >>>>> we will unavoidably do DMA map/unmap and it will fail. >>>>> >>>>> Therefore, the dma_map_status here is used to filter this situation by >>>> preventing >>>>> unnecessary DMA unmap. >>>> >>>> Ok, then I think we can just remove the async DMA map. >>>> >>>>>> >>>>>> Indeed, if the only place where we DMA map is in >>>>>> vhost_user_mmap_region(). If it fails, the error is propagated, the mem >>>>>> table are freed and NACK is replied to the master. IOW, the device will >>>>>> be in an unusable state. >>>>> >>>>> I agree with you, this is the place I consider right to do DMA map >>>>> because we also do SW mapping here, any suggestions? >>>> >>>> No suggestion, I was just explaining that at the only place where >>>> DMA map were done, mapping errors were properly handled and >> propagated. >>> >>> What about just setting async_copy to false, and allow switching to sync >> path. >>> >>>> >>>>>> >>>>>> Removing the async DMA map will simplify a lot the code, do you agree >> to >>>>>> remove it or there is something I missed? >>>>> >>>>> See above. Indeed, it adds a lot of code. But we can't know the driver for >>>>> each device in vhost lib, or we can only restrict the user to bind some >>>> devices >>>>> to DPDK vfio if async logic needed. >>>> >>>> I would think we don't care if DMA unmap fails, we can just do the same >>>> as what you do for DMA map, i.e. just ignore the error. >>> >>> Get your idea, we can do the same as DMA map, and in this way >> dma_map_status flag can be removed. >>> >>>> >>>> Thanks to this discussion, I have now more concerns on how it works. I >>>> think we have a problem here in case of DMA device hotplug, that device >>>> could miss the necessary map entries from Vhost if no VFIO devices were >>>> attached at VHST_USER_SET_MEM_TABLE time. How would you handle >> that >>>> case? >>> >>> DMA device is uncore, so I don't see the hotplug issue here. >> >> I'm not sure what 'uncore' is, I suppose you mean your device cannot be >> physically added/removed to the system. > > Yes, we are at the same understanding. > >> >> I was not clear enough in my question. I meant that for example, the >> application is started and the Vhost port is created. Then, the DMA >> device is bound to VFIO, and probed by the DPDK application. Finally, >> the application register the DMA device as an async channel in Vhost. >> >> I think it will not work as the SET_MEM_TABLE will already have >> happened, so the guest memory won't be mapped in the VFIO container. > > Assuming the DMA device supports hotplug, this situation was not actually took into consideration, and maybe the handling should be added in app, with an event callback. > >> >> Do you have the same understanding? >> >>> I will have another patch containing compatibility with sync path, and >> async_map_status flag will be removed. >>> Hope to get your insights. >> >> What do you mean by compatibility with sync path? > > I mean whatever DMA map succeeds or fails, we return 0 so as not to prevent > SET_EM_TABLE. > >> >> Thanks for taking care of the async map status removal. > > Found a tricky point for removing dma_map_status flag, currently DMA unmap API will directly access the vfio_config, > And if without dma_map_status, we cannot get rte_errno at this moment. This is a bug in VFIO API. We always assume VFIO type is valid, but it is only valid whenever 1) VFIO support is detected at startup, and 2) we assign at least one device to VFIO. If VFIO was detected but no devices were assigned, the VFIO type will not be assigned, and the pointer will be NULL. In this case, we should not attempt any unmaps, because there are no active devices. I'll submit a patch to fix this, thanks for catching this issue! > > BTW, I will consider this Coverity fix in new patch. :) > > Thanks, > Xuan > >> >> Maxime >>> Thanks, >>> Xuan >>> >>>> >>>> Regards, >>>> Maxime >>>> >>>>>> >>>>>> Thanks, >>>>>> Maxime >>>>> >>> > -- Thanks, Anatoly