Go to file
Will Deacon f8f86b5eec swiotlb: Fix alignment checks when both allocation and DMA masks are present
[ Upstream commit 51b30ecb73 ]

Nicolin reports that swiotlb buffer allocations fail for an NVME device
behind an IOMMU using 64KiB pages. This is because we end up with a
minimum allocation alignment of 64KiB (for the IOMMU to map the buffer
safely) but a minimum DMA alignment mask corresponding to a 4KiB NVME
page (i.e. preserving the 4KiB page offset from the original allocation).
If the original address is not 4KiB-aligned, the allocation will fail
because swiotlb_search_pool_area() erroneously compares these unmasked
bits with the 64KiB-aligned candidate allocation.

Tweak swiotlb_search_pool_area() so that the DMA alignment mask is
reduced based on the required alignment of the allocation.

Fixes: 82612d66d5 ("iommu: Allow the dma-iommu api to use bounce buffers")
Link: https://lore.kernel.org/r/cover.1707851466.git.nicolinc@nvidia.com
Reported-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Michael Kelley <mhklinux@outlook.com>
Tested-by: Nicolin Chen <nicolinc@nvidia.com>
Tested-by: Michael Kelley <mhklinux@outlook.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:32:33 +02:00
Documentation x86/Kconfig: Remove CONFIG_AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT 2024-04-03 15:32:32 +02:00
LICENSES
arch ARM: 9359/1: flush: check if the folio is reserved for no-mapping addresses 2024-04-03 15:32:33 +02:00
block Revert "block/mq-deadline: use correct way to throttling write requests" 2024-04-03 15:32:22 +02:00
certs
crypto Revert "crypto: pkcs7 - remove sha1 support" 2024-04-03 15:32:31 +02:00
drivers clocksource/drivers/arm_global_timer: Fix maximum prescaler value 2024-04-03 15:32:32 +02:00
fs btrfs: qgroup: validate btrfs_qgroup_inherit parameter 2024-04-03 15:32:30 +02:00
include Revert "crypto: pkcs7 - remove sha1 support" 2024-04-03 15:32:31 +02:00
init modules: wait do_free_init correctly 2024-03-26 18:17:17 -04:00
io_uring io_uring/waitid: always remove waitid entry for cancel all 2024-04-03 15:32:24 +02:00
ipc
kernel swiotlb: Fix alignment checks when both allocation and DMA masks are present 2024-04-03 15:32:33 +02:00
lib pci_iounmap(): Fix MMIO mapping leak 2024-04-03 15:32:02 +02:00
mm memtest: use {READ,WRITE}_ONCE in memory scanning 2024-04-03 15:32:22 +02:00
net netfilter: nf_tables: reject constant set with timeout 2024-04-03 15:32:31 +02:00
rust
samples work around gcc bugs with 'asm goto' with outputs 2024-02-09 15:57:48 -08:00
scripts kbuild: Move -Wenum-{compare-conditional,enum-conversion} into W=1 2024-04-03 15:32:18 +02:00
security lsm: handle the NULL buffer case in lsm_fill_user_ctx() 2024-04-03 15:32:22 +02:00
sound ASoC: amd: yc: Revert "add new YC platform variant (0x63) support" 2024-04-03 15:32:32 +02:00
tools wireguard: selftests: set RISCV_ISA_FALLBACK on riscv{32,64} 2024-04-03 15:32:26 +02:00
usr
virt KVM: Always flush async #PF workqueue when vCPU is being destroyed 2024-04-03 15:32:03 +02:00
.clang-format
.cocciconfig
.editorconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap drm fixes for 6.8 final 2024-03-08 12:44:56 -08:00
.rustfmt.toml
COPYING
CREDITS MAINTAINERS: supplement of zswap maintainers update 2024-01-25 23:52:21 -08:00
Kbuild
Kconfig
MAINTAINERS drm fixes for 6.8 final 2024-03-08 12:44:56 -08:00
Makefile Linux 6.8.2 2024-03-26 18:23:34 -04:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.