intel-iommu: Is this a bug?

2018-03-26 Thread Tushar Dave
Hi, I am analyzing network performance with intel-iommu enabled. And found that running with iommu=pt, for every dma map/unmap it executes this code: /* * At boot time, we don't yet know if devices will be 64-bit capable. * Assume that they will — if they turn out not to be,

Re: [PATCH] selftests/bpf: Add bpf_probe_read_str to bpf_helpers.h

2018-02-28 Thread Tushar Dave
On 02/28/2018 08:57 AM, Daniel Borkmann wrote: Hi Tushar, On 02/28/2018 01:33 AM, Tushar Dave wrote: Using bpf_probe_read_str() from samples/bpf causes compiler warning. e.g. warning: implicit declaration of function 'bpf_probe_read_str' is invalid in C99 [-Wimplici

[PATCH] selftests/bpf: Add bpf_probe_read_str to bpf_helpers.h

2018-02-27 Thread Tushar Dave
nerated. Add bpf_probe_read_str() to bpf_helpers.h so it can be used by samples/bpf programs. Signed-off-by: Tushar Dave --- tools/testing/selftests/bpf/bpf_helpers.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/

Re: [e1000_shutdown] e1000 0000:00:03.0: disabling already-disabled device

2017-12-05 Thread Tushar Dave
On 12/04/2017 05:03 PM, Fengguang Wu wrote: Hi Tushar, On Tue, Nov 28, 2017 at 01:01:23AM +0530, Tushar Dave wrote: On 11/23/2017 04:43 AM, Fengguang Wu wrote: On Wed, Nov 22, 2017 at 03:40:52AM +0530, Tushar Dave wrote: On 11/21/2017 06:11 PM, Fengguang Wu wrote: Hello, FYI this

Re: [e1000_shutdown] e1000 0000:00:03.0: disabling already-disabled device

2017-11-27 Thread Tushar Dave
On 11/23/2017 04:43 AM, Fengguang Wu wrote: On Wed, Nov 22, 2017 at 03:40:52AM +0530, Tushar Dave wrote: On 11/21/2017 06:11 PM, Fengguang Wu wrote: Hello, FYI this happens in mainline kernel 4.14.0-01330-g3c07399. It happens since 4.13 . It occurs in 3 out of 162 boots. [   44.637743

Re: [e1000_shutdown] e1000 0000:00:03.0: disabling already-disabled device

2017-11-21 Thread Tushar Dave
On 11/21/2017 06:11 PM, Fengguang Wu wrote: Hello, FYI this happens in mainline kernel 4.14.0-01330-g3c07399. It happens since 4.13 . It occurs in 3 out of 162 boots. [ 44.637743] advantechwdt: Unexpected close, not stopping watchdog! [ 44.997548] input: ImExPS/2 Generic Explorer Mouse

Re: [RFC PATCH] bpf: Add helpers to read useful task_struct members

2017-11-06 Thread Tushar Dave
On 11/02/2017 11:58 PM, Sandipan Das wrote: For added security, the layout of some structures can be randomized by enabling CONFIG_GCC_PLUGIN_RANDSTRUCT. One such structure is task_struct. To build BPF programs, we use Clang which does not support this feature. So, if we attempt to read a field

Re: sun4v+DMA related boot crash on 4.13-git

2017-07-11 Thread Tushar Dave
On 07/11/2017 09:02 PM, David Miller wrote: From: Tushar Dave Date: Tue, 11 Jul 2017 20:43:39 -0700 Yes, indeed the bug is in Linus's tree. However, 'sparc' tree doesn't have DMA API change (e.g. commit b02c2b0bfd7ae) yet that introduced the panic. You can simply make

Re: sun4v+DMA related boot crash on 4.13-git

2017-07-11 Thread Tushar Dave
On 07/11/2017 05:34 PM, David Miller wrote: From: Tushar Dave Date: Tue, 11 Jul 2017 15:38:21 -0700 On 07/11/2017 02:48 PM, Meelis Roos wrote: I tested yesterdayd 4.12+git on sparc64 to see if the sparc merge works fine, and on all of my sun4v machines (T1000, T2000, T5120) it crashed on

Re: sun4v+DMA related boot crash on 4.13-git

2017-07-11 Thread Tushar Dave
On 07/11/2017 02:48 PM, Meelis Roos wrote: I tested yesterdayd 4.12+git on sparc64 to see if the sparc merge works fine, and on all of my sun4v machines (T1000, T2000, T5120) it crashed on boot with DMA-related stacktrace (below). Allt he machines are sun4v physical machines, not VM-s. Older su

Re: sun4v+DMA related boot crash on 4.13-git

2017-07-11 Thread Tushar Dave
On 07/10/2017 10:05 PM, Meelis Roos wrote: I tested yesterdayd 4.12+git on sparc64 to see if the sparc merge works fine, and on all of my sun4v machines (T1000, T2000, T5120) it crashed on boot with DMA-related stacktrace (below). Allt he machines are sun4v physical machines, not VM-s. Older su

[sparc-next] SPARC64: Fix sun4v DMA panic

2017-07-11 Thread Tushar Dave
. This results into panic. Fix it. Reported-by: Meelis Roos Signed-off-by: Tushar Dave --- arch/sparc/kernel/pci_sun4v.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/arch/sparc/kernel/pci_sun4v.c b/arch/sparc/kernel/pci_sun4v.c index 24f21c7..f10e2f7 10064

[PATCH v3 0/6] sparc: Enable sun4v hypervisor PCI IOMMU v2 APIs and ATU

2016-10-28 Thread Tushar Dave
NEORDER and default to 13 Tushar Dave (5): sparc64: Add ATU (new IOMMU) support sparc64: Initialize iommu_map_table and iommu_pool sparc64: Bind PCIe devices to use IOMMU v2 service sparc64: Enable sun4v dma ops to use IOMMU v2 APIs sparc64: Enable 64-bit DMA arch/sparc/Kconfig

[PATCH v3 4/6] sparc64: Bind PCIe devices to use IOMMU v2 service

2016-10-28 Thread Tushar Dave
In order to use Hypervisor (HV) IOMMU v2 API for map/demap, each PCIe device has to be bound to IOTSB using HV API pci_iotsb_bind(). Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/kernel/pci_sun4v.c | 43

[PATCH v3 2/6] sparc64: Add ATU (new IOMMU) support

2016-10-28 Thread Tushar Dave
ff-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 337 arch/sparc/include/asm/iommu_64.h | 26 +++ arch/sparc/kernel/hvapi.c | 1 + arch/sparc/kernel/pci_sun4v.c

[PATCH v3 5/6] sparc64: Enable sun4v dma ops to use IOMMU v2 APIs

2016-10-28 Thread Tushar Dave
Add Hypervisor IOMMU v2 APIs pci_iotsb_map(), pci_iotsb_demap() and enable sun4v dma ops to use IOMMU v2 API for all PCIe devices with 64bit DMA mask. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 6 + arch/sparc

[PATCH v3 1/6] sparc64: Add FORCE_MAX_ZONEORDER and default to 13

2016-10-28 Thread Tushar Dave
From: Dave Kleikamp This change allows ATU (new IOMMU) in SPARC systems to request large (32M) contiguous memory during boot for creating IOTSB backing store. Signed-off-by: Dave Kleikamp Signed-off-by: Tushar Dave --- arch/sparc/Kconfig | 18 ++ 1 file changed, 18 insertions

[PATCH v3 3/6] sparc64: Initialize iommu_map_table and iommu_pool

2016-10-28 Thread Tushar Dave
Like legacy IOMMU, use common iommu_map_table and iommu_pool for ATU. This change initializes iommu_map_table and iommu_pool for ATU. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Reviewed-by: Sowmini Varadhan --- arch/sparc/include/asm/iommu_64.h | 2 ++ arch/sparc/kernel/pci_sun4v.c

[PATCH v3 6/6] sparc64: Enable 64-bit DMA

2016-10-28 Thread Tushar Dave
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities to use ATU for 64bit DMA. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/Kconfig| 4 arch/sparc/kernel/iommu.c | 8 ++-- 2 files changed, 10 insertions(+), 2

[PATCH v2 2/6] sparc64: Add ATU (new IOMMU) support

2016-10-27 Thread Tushar Dave
ff-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 337 arch/sparc/include/asm/iommu_64.h | 26 +++ arch/sparc/kernel/hvapi.c | 1 + arch/sparc/kernel/pci_sun4v.c

[PATCH v2 4/6] sparc64: Bind PCIe devices to use IOMMU v2 service

2016-10-27 Thread Tushar Dave
In order to use Hypervisor (HV) IOMMU v2 API for map/demap, each PCIe device has to be bound to IOTSB using HV API pci_iotsb_bind(). Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/kernel/pci_sun4v.c | 43

[PATCH v2 1/6] sparc64: Add FORCE_MAX_ZONEORDER and default to 13

2016-10-27 Thread Tushar Dave
From: Dave Kleikamp This change allows ATU (new IOMMU) in SPARC systems to request large (32M) contiguous memory during boot for creating IOTSB backing store. Signed-off-by: Dave Kleikamp Signed-off-by: Tushar Dave --- arch/sparc/Kconfig | 18 ++ 1 file changed, 18 insertions

[PATCH v2 5/6] sparc64: Enable sun4v dma ops to use IOMMU v2 APIs

2016-10-27 Thread Tushar Dave
Add Hypervisor IOMMU v2 APIs pci_iotsb_map(), pci_iotsb_demap() and enable sun4v dma ops to use IOMMU v2 API for all PCIe devices with 64bit DMA mask. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 6 + arch/sparc

[PATCH v2 3/6] sparc64: Initialize iommu_map_table and iommu_pool

2016-10-27 Thread Tushar Dave
Like legacy IOMMU, use common iommu_map_table and iommu_pool for ATU. This change initializes iommu_map_table and iommu_pool for ATU. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Reviewed-by: Sowmini Varadhan --- arch/sparc/include/asm/iommu_64.h | 2 ++ arch/sparc/kernel/pci_sun4v.c

[PATCH v2 6/6] sparc64: Enable 64-bit DMA

2016-10-27 Thread Tushar Dave
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities to use ATU for 64bit DMA. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/Kconfig| 4 arch/sparc/kernel/iommu.c | 8 ++-- 2 files changed, 10 insertions(+), 2

[PATCH v2 0/6] sparc: Enable sun4v hypervisor PCI IOMMU v2 APIs and ATU

2016-10-27 Thread Tushar Dave
1->v2: - Patch #2 addresses comments by Dave M. -- use page allocator to allocate IOTSB. -- use true/false with boolean variables. Dave Kleikamp (1): sparc64: Add FORCE_MAX_ZONEORDER and default to 13 Tushar Dave (5): sparc64: Add ATU (new IOMMU) support sparc64: Initialize iommu_map_t

[PATCH 1/2] sunqe: Fix compiler warnings

2016-10-17 Thread Tushar Dave
rgument is of type ‘__u32 *’ This patch resolves above compiler warnings. Signed-off-by: Tushar Dave Reviewed-by: chris hyser --- drivers/net/ethernet/sun/sunqe.c | 11 ++- drivers/net/ethernet/sun/sunqe.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH 2/2] sunbmac: Fix compiler warning

2016-10-17 Thread Tushar Dave
le pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ This patch resolves above compiler warning. Signed-off-by: Tushar Dave Reviewed-by: chris hyser --- drivers/net/ethernet/sun/sunbmac.c | 5 +++-- drivers/net/ethernet/sun/s

[PATCH 0/2] sparc/net: Fix compiler warnings

2016-10-17 Thread Tushar Dave
Recently, ATU (iommu) changes are submitted to sparclinux that enables 64bit DMA on SPARC. However, this change also makes 'incompatible pointer type' compiler warnings inevitable on sunqe and sunbmac driver. The two patches in series fix compiler warnings. Tushar Dave (2): sunqe: Fi

[PATCH 2/2] sunbmac: Fix compiler warning

2016-10-14 Thread Tushar Dave
le pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ This patch resolves above compiler warning. Signed-off-by: Tushar Dave Reviewed-by: chris hyser --- drivers/net/ethernet/sun/sunbmac.c | 5 +++-- drivers/net/ethernet/sun/s

[PATCH 1/2] sunqe: Fix compiler warnings

2016-10-14 Thread Tushar Dave
rgument is of type ‘__u32 *’ This patch resolves above compiler warnings. Signed-off-by: Tushar Dave Reviewed-by: chris hyser --- drivers/net/ethernet/sun/sunqe.c | 11 ++- drivers/net/ethernet/sun/sunqe.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers

[PATCH 0/2] net: Fix compiler warnings

2016-10-14 Thread Tushar Dave
Recently, ATU (iommu) changes are submitted to linux-sparc that enables 64bit DMA on SPARC. However, this change also makes 'incompatible pointer type' compiler warnings inevitable on sunqe and sunbmac driver. The two patches in series fix compiler warnings. Tushar Dave (2):

[PATCH 6/6] sparc64: Enable 64-bit DMA

2016-10-10 Thread Tushar Dave
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities to use ATU for 64bit DMA. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/Kconfig| 4 arch/sparc/kernel/iommu.c | 8 ++-- 2 files changed, 10 insertions(+), 2

[PATCH 0/6] sparc: Enable sun4v hypervisor PCI IOMMU v2 APIs and ATU

2016-10-10 Thread Tushar Dave
to 2G space provided by legacy IOMMU. ATU allows PCIe devices to use 64bit DMA addressing. Devices which choose to use 32bit DMA mask will continue to work with the existing legacy IOMMU. The patch set is tested on sun4v (T1000, T2000, T3, T4, T5, T7, S7) and sun4u SPARC. Thanks. -Tushar

[PATCH 4/6] sparc64: Bind PCIe devices to use IOMMU v2 service

2016-10-10 Thread Tushar Dave
In order to use Hypervisor (HV) IOMMU v2 API for map/demap, each PCIe device has to be bound to IOTSB using HV API pci_iotsb_bind(). Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/kernel/pci_sun4v.c | 43

[PATCH 1/6] sparc64: Add FORCE_MAX_ZONEORDER and default to 13

2016-10-10 Thread Tushar Dave
From: Dave Kleikamp This change allows ATU (new IOMMU) in SPARC systems to request large (32M) contiguous memory during boot for creating IOTSB backing store. Signed-off-by: Dave Kleikamp Signed-off-by: Tushar Dave --- arch/sparc/Kconfig | 18 ++ 1 file changed, 18 insertions

[PATCH 2/6] sparc64: Add ATU (new IOMMU) support

2016-10-10 Thread Tushar Dave
ff-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 337 arch/sparc/include/asm/iommu_64.h | 26 +++ arch/sparc/kernel/hvapi.c | 1 + arch/sparc/kernel/pci_sun4v.c

[PATCH 5/6] sparc64: Enable sun4v dma ops to use IOMMU v2 APIs

2016-10-10 Thread Tushar Dave
Add Hypervisor IOMMU v2 APIs pci_iotsb_map(), pci_iotsb_demap() and enable sun4v dma ops to use IOMMU v2 API for all PCIe devices with 64bit DMA mask. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 6 + arch/sparc

[PATCH 3/6] sparc64: Initialize iommu_map_table and iommu_pool

2016-10-10 Thread Tushar Dave
Like legacy IOMMU, use common iommu_map_table and iommu_pool for ATU. This change initializes iommu_map_table and iommu_pool for ATU. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Reviewed-by: Sowmini Varadhan --- arch/sparc/include/asm/iommu_64.h | 2 ++ arch/sparc/kernel/pci_sun4v.c

[RFC PATCH 5/6] sparc64: Enable sun4v dma ops to use IOMMU v2 APIs

2016-10-06 Thread Tushar Dave
Add Hypervisor IOMMU v2 APIs pci_iotsb_map(), pci_iotsb_demap() and enable sun4v dma ops to use IOMMU v2 API for all PCIe devices with 64bit DMA mask. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 6 + arch/sparc

[RFC PATCH 0/6] sparc: Enable sun4v hypervisor PCI IOMMU v2 APIs and ATU

2016-10-06 Thread Tushar Dave
to 2G space provided by legacy IOMMU. ATU allows PCIe devices to use 64bit DMA addressing. Devices which choose to use 32bit DMA mask will continue to work with the existing legacy IOMMU. The patch set is tested on sun4v (T1000, T2000, T3, T4, T5, T7, S7) and sun4u SPARC. Thanks. -Tushar

[RFC PATCH 2/6] sparc64: Add ATU (new IOMMU) support

2016-10-06 Thread Tushar Dave
ff-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/include/asm/hypervisor.h | 337 arch/sparc/include/asm/iommu_64.h | 26 +++ arch/sparc/kernel/hvapi.c | 1 + arch/sparc/kernel/pci_sun4v.c

[RFC PATCH 3/6] sparc64: Initialize iommu_map_table and iommu_pool

2016-10-06 Thread Tushar Dave
Like legacy IOMMU, use common iommu_map_table and iommu_pool for ATU. This change initializes iommu_map_table and iommu_pool for ATU. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Reviewed-by: Sowmini Varadhan --- arch/sparc/include/asm/iommu_64.h | 2 ++ arch/sparc/kernel/pci_sun4v.c

[RFC PATCH 6/6] sparc64: Enable 64-bit DMA

2016-10-06 Thread Tushar Dave
ATU 64bit addressing allows PCIe devices with 64bit DMA capabilities to use ATU for 64bit DMA. Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/Kconfig| 4 arch/sparc/kernel/iommu.c | 8 ++-- 2 files changed, 10 insertions(+), 2

[RFC PATCH 4/6] sparc64: Bind PCIe devices to use IOMMU v2 service

2016-10-06 Thread Tushar Dave
In order to use Hypervisor (HV) IOMMU v2 API for map/demap, each PCIe device has to be bound to IOTSB using HV API pci_iotsb_bind(). Signed-off-by: Tushar Dave Reviewed-by: chris hyser Acked-by: Sowmini Varadhan --- arch/sparc/kernel/pci_sun4v.c | 43

[RFC PATCH 1/6] sparc64: Add FORCE_MAX_ZONEORDER and default to 13

2016-10-06 Thread Tushar Dave
From: Dave Kleikamp This change allows ATU (new IOMMU) in SPARC systems to request large (32M) contiguous memory during boot for creating IOTSB backing store. Signed-off-by: Dave Kleikamp Signed-off-by: Tushar Dave --- arch/sparc/Kconfig | 18 ++ 1 file changed, 18 insertions