|
|
343f6f |
From 6f43d909b39607af7200a735cb0f959853d5fef6 Mon Sep 17 00:00:00 2001
|
|
|
343f6f |
From: Alejandro Lucero <alejandro.lucero@netronome.com>
|
|
|
343f6f |
Date: Fri, 31 Aug 2018 15:53:52 +0100
|
|
|
343f6f |
Subject: [PATCH] mem: fix max DMA maskbit size
|
|
|
343f6f |
|
|
|
343f6f |
The sanity check inside rte_eal_check_dma_mask is using 47 bits as
|
|
|
343f6f |
the maximum size. It turns out there are some IOMMU hardware reporting
|
|
|
343f6f |
48 bits precluding the IOVA VA mode to be enabled.
|
|
|
343f6f |
|
|
|
343f6f |
It is harmless to raise the maximum mask size to 63 bits.
|
|
|
343f6f |
|
|
|
343f6f |
This patch also removes any reference to unused X86_VA_WIDTH.
|
|
|
343f6f |
|
|
|
343f6f |
Fixes: 3a80bc50c949 ("mem: add function for checking memsegs IOVAs addresses")
|
|
|
343f6f |
|
|
|
343f6f |
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
|
|
|
343f6f |
---
|
|
|
343f6f |
drivers/bus/pci/linux/pci.c | 1 -
|
|
|
343f6f |
lib/librte_eal/common/eal_common_memory.c | 5 -----
|
|
|
343f6f |
2 files changed, 6 deletions(-)
|
|
|
343f6f |
|
|
|
343f6f |
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
|
|
|
343f6f |
index c81ed5025..44440f223 100644
|
|
|
343f6f |
--- a/drivers/bus/pci/linux/pci.c
|
|
|
343f6f |
+++ b/drivers/bus/pci/linux/pci.c
|
|
|
343f6f |
@@ -583,7 +583,6 @@ pci_one_device_iommu_support_va(struct rte_pci_device *dev)
|
|
|
343f6f |
{
|
|
|
343f6f |
#define VTD_CAP_MGAW_SHIFT 16
|
|
|
343f6f |
#define VTD_CAP_MGAW_MASK (0x3fULL << VTD_CAP_MGAW_SHIFT)
|
|
|
343f6f |
-#define X86_VA_WIDTH 47 /* From Documentation/x86/x86_64/mm.txt */
|
|
|
343f6f |
struct rte_pci_addr *addr = &dev->addr;
|
|
|
343f6f |
char filename[PATH_MAX];
|
|
|
343f6f |
FILE *fp;
|
|
|
343f6f |
diff --git a/lib/librte_eal/common/eal_common_memory.c b/lib/librte_eal/common/eal_common_memory.c
|
|
|
343f6f |
index 00ab3935c..a0922f18b 100644
|
|
|
343f6f |
--- a/lib/librte_eal/common/eal_common_memory.c
|
|
|
343f6f |
+++ b/lib/librte_eal/common/eal_common_memory.c
|
|
|
343f6f |
@@ -109,13 +109,8 @@ rte_dump_physmem_layout(FILE *f)
|
|
|
343f6f |
}
|
|
|
343f6f |
}
|
|
|
343f6f |
|
|
|
343f6f |
-#if defined(RTE_ARCH_X86)
|
|
|
343f6f |
-#define X86_VA_WIDTH 47 /* From Documentation/x86/x86_64/mm.txt */
|
|
|
343f6f |
-#define MAX_DMA_MASK_BITS X86_VA_WIDTH
|
|
|
343f6f |
-#else
|
|
|
343f6f |
/* 63 bits is good enough for a sanity check */
|
|
|
343f6f |
#define MAX_DMA_MASK_BITS 63
|
|
|
343f6f |
-#endif
|
|
|
343f6f |
|
|
|
343f6f |
/* check memseg iovas are within the required range based on dma mask */
|
|
|
343f6f |
int
|
|
|
343f6f |
--
|
|
|
343f6f |
2.17.1
|
|
|
343f6f |
|