+ dma-remap-align-the-size-in-dma_common__remap.patch added to -mm tree

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

 



The patch titled
     Subject: kernel/dma/remap.c: align the size in dma_common_*_remap()
has been added to the -mm tree.  Its filename is
     dma-remap-align-the-size-in-dma_common__remap.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/dma-remap-align-the-size-in-dma_common__remap.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/dma-remap-align-the-size-in-dma_common__remap.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Eric Auger <eric.auger@xxxxxxxxxx>
Subject: kernel/dma/remap.c: align the size in dma_common_*_remap()

Running a guest with a virtio-iommu protecting virtio devices is broken
since commit 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing
it").  Before the conversion, the size was page aligned in
__get_vm_area_node().  Doing so fixes the regression.

Link: http://lkml.kernel.org/r/20200622202320.1331-1-eric.auger@xxxxxxxxxx
Fixes: 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it")
Signed-off-by: Eric Auger <eric.auger@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Cc: Marek Szyprowski <m.szyprowski@xxxxxxxxxxx>
Cc: Robin Murphy <robin.murphy@xxxxxxx>
Cc: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
Cc: Bharat Bhushan <bbhushan2@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 kernel/dma/remap.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/kernel/dma/remap.c~dma-remap-align-the-size-in-dma_common__remap
+++ a/kernel/dma/remap.c
@@ -24,7 +24,7 @@ void *dma_common_pages_remap(struct page
 {
 	void *vaddr;
 
-	vaddr = vmap(pages, size >> PAGE_SHIFT, VM_DMA_COHERENT, prot);
+	vaddr = vmap(pages, PAGE_ALIGN(size) >> PAGE_SHIFT, VM_DMA_COHERENT, prot);
 	if (vaddr)
 		find_vm_area(vaddr)->pages = pages;
 	return vaddr;
@@ -37,7 +37,7 @@ void *dma_common_pages_remap(struct page
 void *dma_common_contiguous_remap(struct page *page, size_t size,
 			pgprot_t prot, const void *caller)
 {
-	int count = size >> PAGE_SHIFT;
+	int count = PAGE_ALIGN(size) >> PAGE_SHIFT;
 	struct page **pages;
 	void *vaddr;
 	int i;
_

Patches currently in -mm which might be from eric.auger@xxxxxxxxxx are

dma-remap-align-the-size-in-dma_common__remap.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux