Displaying 16 results from an estimated 16 matches for "dma_addressing_limited".
2019 Jul 22
4
[PATCH v2] dma-mapping: Use dma_get_mask in dma_addressing_limited
We currently have cases where the dma_addressing_limited() gets
called with dma_mask unset. This causes a NULL pointer dereference.
Use dma_get_mask() accessor to prevent the crash.
Fixes: b866455423e0 ("dma-mapping: add a dma_addressing_limited helper")
Signed-off-by: Eric Auger <eric.auger at redhat.com>
---
v1 -> v2:
- was [PATC...
2019 Jul 22
4
[PATCH v2] dma-mapping: Use dma_get_mask in dma_addressing_limited
We currently have cases where the dma_addressing_limited() gets
called with dma_mask unset. This causes a NULL pointer dereference.
Use dma_get_mask() accessor to prevent the crash.
Fixes: b866455423e0 ("dma-mapping: add a dma_addressing_limited helper")
Signed-off-by: Eric Auger <eric.auger at redhat.com>
---
v1 -> v2:
- was [PATC...
2019 Jul 22
0
[PATCH v2] dma-mapping: Use dma_get_mask in dma_addressing_limited
Hi Christoph,
On 7/22/19 6:51 PM, Eric Auger wrote:
> We currently have cases where the dma_addressing_limited() gets
> called with dma_mask unset. This causes a NULL pointer dereference.
>
> Use dma_get_mask() accessor to prevent the crash.
>
> Fixes: b866455423e0 ("dma-mapping: add a dma_addressing_limited helper")
> Signed-off-by: Eric Auger <eric.auger at redhat.com>...
2019 Jul 22
0
[PATCH 1/2] dma-mapping: Protect dma_addressing_limited against NULL dma_mask
dma_addressing_limited() should not be called on a device with
a NULL dma_mask. If this occurs let's WARN_ON_ONCE and immediately
return. Existing call sites are updated separately.
Fixes: b866455423e0 ("dma-mapping: add a dma_addressing_limited helper")
Signed-off-by: Eric Auger <eric.auger at redhat.c...
2019 Jul 22
1
[PATCH 1/2] dma-mapping: Protect dma_addressing_limited against NULL dma_mask
> static inline bool dma_addressing_limited(struct device *dev)
> {
> - return min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> - dma_get_required_mask(dev);
> + return WARN_ON_ONCE(!dev->dma_mask) ? false :
> + min_not_zero(*dev->dma_mask, dev->bus_dma_mask) <
> + dma_get_required_mask(dev);
T...
2019 Jul 22
6
[PATCH 0/2] Fix NULL pointer dereference with virtio-blk-pci and virtual IOMMU
When running a guest featuring a virtio-blk-pci protected with a virtual
IOMMU we hit a NULL pointer dereference.
This series removes the dma_max_mapping_size() call in
virtio_max_dma_size when the device does not have any dma_mask set.
A check is also added to early return in dma_addressing_limited()
if the dma_mask is NULL.
Eric Auger (2):
dma-mapping: Protect dma_addressing_limited against NULL dma_mask
virtio/virtio_ring: Fix the dma_max_mapping_size call
drivers/virtio/virtio_ring.c | 2 +-
include/linux/dma-mapping.h | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
--...
2024 Oct 04
1
[PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools
...amdgpu_bo_driver,
> > > adev->dev,
> > > ?? ?????? adev_to_drm(adev)->anon_inode-
> > > > i_mapping,
> > > ?? ?????? adev_to_drm(adev)-
> > > > vma_offset_manager,
> > > - ?????? adev->need_swiotlb,
> > > - ?????? dma_addressing_limited(adev-
> > > >dev));
> > > + ?????? (struct ttm_device_init_flags){
> > > + ?????? .use_dma_alloc = adev-
> > > > need_swiotlb,
> > > + ?????? .use_dma32 =
> > > dma_addressing_limited(adev->dev)
> > > + ?????? });
>...
2024 Oct 05
1
[PATCH v2 1/2] drm/ttm: Change ttm_device_init to use a struct instead of multiple bools
...t; adev->dev,
> > > > ?? ?????? adev_to_drm(adev)->anon_inode-
> > > > > i_mapping,
> > > > ?? ?????? adev_to_drm(adev)-
> > > > > vma_offset_manager,
> > > > - ?????? adev->need_swiotlb,
> > > > - ?????? dma_addressing_limited(adev-
> > > > >dev));
> > > > + ?????? (struct ttm_device_init_flags){
> > > > + ?????? .use_dma_alloc = adev-
> > > > > need_swiotlb,
> > > > + ?????? .use_dma32 =
> > > > dma_addressing_limited(adev->dev)
>...
2024 Oct 02
2
[PATCH v2 0/2] drm/ttm: Add an option to report graphics memory OOM
Some graphics APIs differentiate between out-of-graphics-memory and
out-of-host-memory (system memory). Add a device init flag to
have -ENOSPC propagated from the resource managers instead of being
converted to -ENOMEM, to aid driver stacks in determining what
error code to return or whether corrective action can be taken at
the driver level.
The first patch deals with a ttm_device_init()
2019 Oct 14
3
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
...the Protected Execution Facility, with the help of an Ultravisor
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index f7d1eea..6df5664 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -693,6 +693,26 @@ static inline bool dma_addressing_limited(struct device *dev)
> dma_get_required_mask(dev);
> }
>
> +#ifndef CONFIG_ARCH_HAS_DMA_ADDR_IS_PHYS_ADDR
> +/**
> + * dma_addr_is_phys_addr - check whether a device DMA address is a physical
> + * address
> + * @dev: device to check
> + *
> + * Returns %tru...
2019 Oct 14
3
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
...the Protected Execution Facility, with the help of an Ultravisor
> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
> index f7d1eea..6df5664 100644
> --- a/include/linux/dma-mapping.h
> +++ b/include/linux/dma-mapping.h
> @@ -693,6 +693,26 @@ static inline bool dma_addressing_limited(struct device *dev)
> dma_get_required_mask(dev);
> }
>
> +#ifndef CONFIG_ARCH_HAS_DMA_ADDR_IS_PHYS_ADDR
> +/**
> + * dma_addr_is_phys_addr - check whether a device DMA address is a physical
> + * address
> + * @dev: device to check
> + *
> + * Returns %tru...
2019 Oct 12
0
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
...rt secure guests using
the Protected Execution Facility, with the help of an Ultravisor
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index f7d1eea..6df5664 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -693,6 +693,26 @@ static inline bool dma_addressing_limited(struct device *dev)
dma_get_required_mask(dev);
}
+#ifndef CONFIG_ARCH_HAS_DMA_ADDR_IS_PHYS_ADDR
+/**
+ * dma_addr_is_phys_addr - check whether a device DMA address is a physical
+ * address
+ * @dev: device to check
+ *
+ * Returns %true if any DMA address for this device happens to al...
2019 Oct 14
0
[PATCH 1/2] dma-mapping: Add dma_addr_is_phys_addr()
...tion Facility, with the help of an Ultravisor
>> diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
>> index f7d1eea..6df5664 100644
>> --- a/include/linux/dma-mapping.h
>> +++ b/include/linux/dma-mapping.h
>> @@ -693,6 +693,26 @@ static inline bool dma_addressing_limited(struct device *dev)
>> dma_get_required_mask(dev);
>> }
>>
>> +#ifndef CONFIG_ARCH_HAS_DMA_ADDR_IS_PHYS_ADDR
>> +/**
>> + * dma_addr_is_phys_addr - check whether a device DMA address is a physical
>> + * address
>> + * @dev: device to c...
2019 Jul 22
4
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
On 22/07/2019 15:55, Eric Auger wrote:
> Do not call dma_max_mapping_size for devices that have no DMA
> mask set, otherwise we can hit a NULL pointer dereference.
>
> This occurs when a virtio-blk-pci device is protected with
> a virtual IOMMU.
>
> Fixes: e6d6dd6c875e ("virtio: Introduce virtio_max_dma_size()")
> Signed-off-by: Eric Auger <eric.auger at
2019 Jul 22
4
[PATCH 2/2] virtio/virtio_ring: Fix the dma_max_mapping_size call
On 22/07/2019 15:55, Eric Auger wrote:
> Do not call dma_max_mapping_size for devices that have no DMA
> mask set, otherwise we can hit a NULL pointer dereference.
>
> This occurs when a virtio-blk-pci device is protected with
> a virtual IOMMU.
>
> Fixes: e6d6dd6c875e ("virtio: Introduce virtio_max_dma_size()")
> Signed-off-by: Eric Auger <eric.auger at
2019 Oct 12
4
[PATCH 0/2] virtio: Support encrypted memory on powerpc secure guests
**We would like the patches to be merged through the virtio tree. Please
review, and ack merging the DMA mapping change through that tree. Thanks!**
The memory of powerpc secure guests can't be accessed by the hypervisor /
virtio device except for a few memory regions designated as 'shared'.
At the moment, Linux uses bounce-buffering to communicate with the
hypervisor, with a