From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 23136A034E for ; Thu, 7 Nov 2019 16:35:54 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F7841BF97; Thu, 7 Nov 2019 16:35:54 +0100 (CET) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id 8C6BA1BF97 for ; Thu, 7 Nov 2019 16:35:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573140952; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DL3CBP6tOf4i8zffDvfLPV8Azdj4SuBX4p4ILpgLLSw=; b=amr62fqz3yEpdExvxMxPJCWWRsG1GwNDgvakBbq4i1lIjqy54iWgdMZRN4au6T3/shnuD3 skPrklNM9HHf4g3NtjFDJ9u3fuj82wGfOfefYUknmKEcpmHRG0axfnae23WCS38bbxd04w qXEJTgkJrfkyJb1vgfUtWK53v855BDI= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-3yBx2bqkMOOxgoXmd2CeXg-1; Thu, 07 Nov 2019 10:35:50 -0500 Received: by mail-vk1-f197.google.com with SMTP id n6so1249390vke.22 for ; Thu, 07 Nov 2019 07:35:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B4oEEDb3lqCCKVx390D6loK6YCs2FvL69XcZiUnStOE=; b=leJ8PR9SWSENJY301Kkqr+yjSZweQX9xwGX3uBkkXYBDCoE2QkADjT3epUaojcwAcK UI+8VEStrIwgRBDCIzlm8ipulw4p6wZpkaMOgtQOyAn8TfiJ5zuEXw2eXNX7yoEg4cDp Ex5WAjIbYi/L0F2FOExq7wBERSs2PT0HZiEVjPtfmACc4p1+k9ibaThe9y159ZXeGeI+ DKU2iQ+mktz7ssX97rajlNRmkE8hejrGiEe7Aqa6uthU3rPj/jVCOnaCfCWP5F++d6lQ y5Qv16VWkir0r/bSv48RVklg+Qzhu6L4ZN7DhAep2ONk+syKsmu9pjlW9G5/XvASZkBu O8FQ== X-Gm-Message-State: APjAAAWtZZtwXOJCiTKyUvEotst1V8MxGl9vnLeoR92Vk3mlWxh4eGRS UIVg5T7HZNz7MgenhXYx2K0p8hqFFqx2oRuGzMiuko2MsDt8Cx3tkxgi6nj4B4gP+nbi6P92gAd cl/YLQOZJTogAgvMFxItC1X8= X-Received: by 2002:a67:fa99:: with SMTP id f25mr3340759vsq.141.1573140950059; Thu, 07 Nov 2019 07:35:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzNT3yEvS0yU7SlT1EYj3yxQYVEVE8qN5RR+06XSdMqyHdM6wOfh1phIyV98h7JVy62fTC1CJCdRpI4/4xIXNk= X-Received: by 2002:a67:fa99:: with SMTP id f25mr3340723vsq.141.1573140949713; Thu, 07 Nov 2019 07:35:49 -0800 (PST) MIME-Version: 1.0 References: <5dd669557fc499df5e345a14c9252c095eff6c07.1572966906.git.anatoly.burakov@intel.com> In-Reply-To: <5dd669557fc499df5e345a14c9252c095eff6c07.1572966906.git.anatoly.burakov@intel.com> From: David Marchand Date: Thu, 7 Nov 2019 16:35:38 +0100 Message-ID: To: Anatoly Burakov Cc: dev , Bruce Richardson , Rajesh Ravi , Ajit Khaparde , Jonathan Richardson , Scott Branden , Vikram Mysore Prakash , Srinath Mannam , Thomas Monjalon , dpdk stable X-MC-Unique: 3yBx2bqkMOOxgoXmd2CeXg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-stable] [PATCH 19.11] vfio: fix DMA mapping of externally allocated heaps X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Tue, Nov 5, 2019 at 4:15 PM Anatoly Burakov wrote: > > Currently, externally created heaps are supposed to be automatically > mapped for VFIO DMA by EAL, however they only do so if, at the time of > heap creation, VFIO is initialized and has at least one device > available. If no devices are available at the time of heap creation (or > if devices were available, but were since hot-unplugged, thus dropping > all VFIO container mappings), then VFIO mapping code would have skipped > over externally allocated heaps. > > The fix is two-fold. First, we allow externally allocated memory > segments to be marked as "heap" segments. This allows us to distinguish > between external memory segments that were created via heap API, from > those that were created via rte_extmem_register() API. > > Then, we fix the VFIO code to only skip non-heap external segments. > Also, since external heaps are not guaranteed to have valid IOVA > addresses, we will skip those which have invalid IOVA addresses as well. > > Fixes: 0f526d674f8e ("malloc: separate creating memseg list and malloc he= ap") Cc: stable@dpdk.org > > Signed-off-by: Anatoly Burakov Tested-by: Rajesh Ravi Acked-by: Thomas Monjalon > --- > > Notes: > This cannot be backported to older releases as it breaks the > API and ABI. A separate fix is in the works for stable. > Applied, thanks. -- David Marchand