RE: [PATCH 1/1] scsi: storvsc: Enable scatterlist entry lengths > 4Kbytes

From: Michael Kelley
Date: Wed Feb 24 2021 - 12:05:47 EST


From: Christoph Hellwig <hch@xxxxxxxxxxxxx> Sent: Wednesday, February 24, 2021 7:53 AM
>
> Shouldn't storvsc just use blk_queue_virt_boundary instead of all this
> mess?

The storvsc driver does set the virt boundary to PAGE_SIZE - 1. But
the driver still has to translate the scatterlist into a list of guest
physical frame numbers (each representing 4K bytes) that the
Hyper-V host understands so it can do the I/O.

This patch improves that translation so it can handle a single
scatterlist entry that represents more than PAGE_SIZE bytes of
data. Then the SCSI dma_boundary (which turns into the blk level
segment_boundary) no longer needs to be set to restrict scatterlist
entries to just PAGE_SIZE bytes.

We also have to preserve the ability to run guests on ARM64 with
PAGE_SIZE of 16K or 64K, while Hyper-V still expects each PFN to
represent only 4K bytes.

Michael