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

Bug#866511: kernel BUG at nvme/host/pci.c



Control: reassign -1 src:linux 4.9.30-2+deb9u2
Control: tag -1 upstream patch moreinfo

On Thu, 2017-06-29 at 19:30 +0200, Andreas Pflug wrote:
> Package: linux-image-4.9.0-3-amd64
> 
> Version: 4.9.30-2+deb9u2
> 
> When starting an ancient Windows Server 2003 virtual machine on a fully
> updated stretch host, the host will crash repeatably about 10 seconds
> after start. Kernel logging was implemented over netconsole, so I could
> capture the kernel output stating
> 
> kernel BUG at /build/linux-9uDFZV/linux-4.9.30/drivers/nvme/host/pci.c:495!

A single log line is rarely enough to be useful...

> Hardware is dual E5-2620v4 on Supermicro 10DRI-T with two SAMSUNG
> MZQLW960HMJP-00003 NVME disks (mdadm RAID-1).
> 
> drivers/nvme/host/pci.c wasn't changed up to 4.11.8, the crashing
> function nvme_setup_prps still the same in 4.12rc7, so I guess the bug
> is still there.

...but I happened to see a fix that mentioned this function.

This should make its way into a stable update eventually, but perhaps
you could confirm that the attached patch fixes your problem by
following these instructions:
https://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official

Ben.

-- 
Ben Hutchings
Anthony's Law of Force: Don't force it, get a larger hammer.
From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Date: Wed, 11 Jan 2017 21:56:31 +0300
Subject: swiotlb: ensure that page-sized mappings are page-aligned
Origin: https://git.kernel.org/linus/602d9858f07c72eab64f5f00e2fae55f9902cfbe
Bug-Debian: https://bugs.debian.org/866511

Some drivers do depend on page mappings to be page aligned.

Swiotlb already enforces such alignment for mappings greater than page,
extend that to page-sized mappings as well.

Without this fix, nvme hits BUG() in nvme_setup_prps(), because that routine
assumes page-aligned mappings.

Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
---
 lib/swiotlb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/swiotlb.c b/lib/swiotlb.c
index 975b8fc4f1e1..a8d74a733a38 100644
--- a/lib/swiotlb.c
+++ b/lib/swiotlb.c
@@ -483,11 +483,11 @@ phys_addr_t swiotlb_tbl_map_single(struct device *hwdev,
 		    : 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
 
 	/*
-	 * For mappings greater than a page, we limit the stride (and
-	 * hence alignment) to a page size.
+	 * For mappings greater than or equal to a page, we limit the stride
+	 * (and hence alignment) to a page size.
 	 */
 	nslots = ALIGN(size, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
-	if (size > PAGE_SIZE)
+	if (size >= PAGE_SIZE)
 		stride = (1 << (PAGE_SHIFT - IO_TLB_SHIFT));
 	else
 		stride = 1;

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: