[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 4/9] xen: introduce an arch helper for default dma zone status


  • To: Wei Chen <wei.chen@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 18 May 2022 15:09:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=2ESkNfCumVruGG3vYp53gMsi4FlHTGLWtoN/cGHQtHg=; b=XDnEYW+BhoDdVfXcewOAuD+tA0dPOfMyS0rq3F9FeAHtfh72ADN7w6KkatiVdtlgHoHS84aCShLS0vxznnWW9Bti2FeGzkKLYWjGw3GifFfh1WxUGLWRgPXjDDg3xZVS5FF0ptvvhXuGSPi2eoEIYOXtiD6nc5AN8QTziJrbjeYzzk2kBalzYftkwyHJWvIhJRHq7r8HjkkhSkFheR9BmwizXAQHdUhns/tV9+rzOqVzEQpwBkFsd8DjI/reDrjGK+2/tMcTtkV6BpAqkqh0V2aJtr2wf9NE96eF18eRz5M4+i3pXj7dz8K/OuFh5CiUK3JriVS7etMTXmEuJtA3Hg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Du4Qch7mN8mDlGFHqnGmbkDiuzSldTh/Ok3Vukyle55tXIxYnLja8GPn6AF3HJYZ0z0dEde/DYqFNygglEOUu2t6SMBqDJEryIk1ZRov+dy01/WqNGdBVOJWQaDsO6IC6cP4tFz+Br7zhCSnxZ4NzDsFRd8Rory3dZEXKFDKhY9EvF7XrnrYMc3y5ccj4HssLf56UZ4JXcYb9XqBIEpQE6sMSa5VKDBvmm7+DNhJ0W03bKFlYJ6c1dyNlLlC5gtQVX4kt0/V+KyEzv10VoiOonD0Rj6Y9843vSC849C1Me4tFUrUpZMGD31GdxnobMetwakFg+QiGfxiemTKo/ivyA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: nd@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Jiamei Xie <jiamei.xie@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 18 May 2022 13:09:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.05.2022 03:46, Wei Chen wrote:
> In current code, when Xen is running in a multiple nodes
> NUMA system, it will set dma_bitsize in end_boot_allocator
> to reserve some low address memory as DMA zone.
> 
> There are some x86 implications in the implementation.
> Because on x86, memory starts from 0. On a multiple-nodes
> NUMA system, if a single node contains the majority or all
> of the DMA memory, x86 prefers to give out memory from
> non-local allocations rather than exhausting the DMA memory
> ranges. Hence x86 uses dma_bitsize to set aside some largely
> arbitrary amount of memory for DMA zone. The allocations
> from DMA zone would happen only after exhausting all other
> nodes' memory.
> 
> But the implications are not shared across all architectures.
> For example, Arm cannot guarantee the availability of memory
> below a certain boundary for DMA limited-capability devices
> either. But currently, Arm doesn't need a reserved DMA zone
> in Xen. Because there is no DMA device in Xen. And for guests,
> Xen Arm only allows Dom0 to have DMA operations without IOMMU.
> Xen will try to allocate memory under 4GB or memory range that
> is limited by dma_bitsize for Dom0 in boot time. For DomU, even
> Xen can passthrough devices to DomU without IOMMU, but Xen Arm
> doesn't guarantee their DMA operations. So, Xen Arm doesn't
> need a reserved DMA zone to provide DMA memory for guests.
> 
> In this patch, we introduce an arch_want_default_dmazone helper
> for different architectures to determine whether they need to
> set dma_bitsize for DMA zone reservation or not.
> 
> At the same time, when x86 Xen is built with CONFIG_PV=n could
> probably leverage this new helper to actually not trigger DMA
> zone reservation.
> 
> Signed-off-by: Wei Chen <wei.chen@xxxxxxx>
> Tested-by: Jiamei Xie <jiamei.xie@xxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.