[PATCH 0/2] hw/block/nvme: oncs and write uncorrectable support

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen First, add support for toggling optional features through the new `oncs` nvme device parameter. Secondly, add support for the Write Uncorrectable command. Gollu Appalanaidu (2): hw/block/nvme: add oncs device parameter hw/block/nvme: add write uncorrectable command docs

[PATCH 1/2] hw/block/nvme: add oncs device parameter

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Add the 'oncs' nvme device parameter to allow optional features to be enabled/disabled explicitly. Since most of these are optional commands, make the CSE log pages dynamic to account for the value of ONCS. Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen --

[PATCH 2/2] hw/block/nvme: add write uncorrectable command

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Add support for marking blocks invalid with the Write Uncorrectable command. Block status is tracked in a (non-persistent) bitmap that is checked on all reads and written to on all writes. This is potentially expensive, so keep Write Uncorrectable disabled by default. Sig

Re: [PATCH] hw/block/nvme: add broadcast nsid support flush command

2021-02-09 Thread Klaus Jensen
On Feb 10 12:32, Keith Busch wrote: > On Mon, Feb 08, 2021 at 08:08:17PM +0100, Klaus Jensen wrote: > > On Feb 9 03:59, Keith Busch wrote: > > > This whole implementation would be much simpler with the synchronous > > > blk_flush() routine instead of the AIO equivalent. This is not really a > > >

Re: [PATCH] hw/block/nvme: improve invalid zasl value reporting

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 8:39 PM, Dmitry Fomichev wrote: > On Mon, 2021-02-08 at 09:25 +0100, Klaus Jensen wrote: >> From: Klaus Jensen >> >> The Zone Append Size Limit (ZASL) must be at least 4096 bytes, so >> improve the user experience by adding an early parameter check in >> nvme_check_constraints. >> >> Whe

Re: [PATCH] hw/block/nvme: add broadcast nsid support flush command

2021-02-09 Thread Keith Busch
On Mon, Feb 08, 2021 at 08:08:17PM +0100, Klaus Jensen wrote: > On Feb 9 03:59, Keith Busch wrote: > > This whole implementation would be much simpler with the synchronous > > blk_flush() routine instead of the AIO equivalent. This is not really a > > performant feature, so I don't think it's crit

Re: [PATCH v5 0/9] block: Add retry for werror=/rerror= mechanism

2021-02-09 Thread Jiahui Cen
Kindly ping. Any comments and reviews are wellcome :) Thanks, Jiahui On 2021/2/5 18:13, Jiahui Cen wrote: > A VM in the cloud environment may use a virutal disk as the backend storage, > and there are usually filesystems on the virtual block device. When backend > storage is temporarily down, any

Re: [PATCH] hw/block/nvme: improve invalid zasl value reporting

2021-02-09 Thread Dmitry Fomichev
On Mon, 2021-02-08 at 09:25 +0100, Klaus Jensen wrote: > From: Klaus Jensen > > The Zone Append Size Limit (ZASL) must be at least 4096 bytes, so > improve the user experience by adding an early parameter check in > nvme_check_constraints. > > When ZASL is still too small due to the host configu

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
09.02.2021 21:41, Denis V. Lunev wrote: On 2/9/21 9:36 PM, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 19:39, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 17:47, Max Reitz wrote: On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 16:25, Max Reitz wrote: On 29.01.21 17:50,

Re: [PATCH] iotests: Fix unsupported_imgopts for refcount_bits

2021-02-09 Thread Eric Blake
On 2/9/21 12:27 PM, Max Reitz wrote: > Many _unsupported_imgopts lines for refcount_bits values use something > like "refcount_bits=1[^0-9]" to forbid everything but "refcount_bits=1" > (e.g. "refcount_bits=16" is allowed). > > That does not work when $IMGOPTS does not have any entry past the > re

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Denis V. Lunev
On 2/9/21 9:36 PM, Vladimir Sementsov-Ogievskiy wrote: > 09.02.2021 19:39, Vladimir Sementsov-Ogievskiy wrote: >> 09.02.2021 17:47, Max Reitz wrote: >>> On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 16:25, Max Reitz wrote: > On 29.01.21 17:50, Vladimir Sementsov-Ogievsk

Re: [PATCH] iotests/210: Fix reference output

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
09.02.2021 21:19, Max Reitz wrote: Commit 69b55e03f has changed an error message, adjust the reference output to account for it. Fixes: 69b55e03f7e65a36eb954d0b7d4698b258df2708 ("block: refactor bdrv_check_request: add errp") Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Og

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
09.02.2021 19:39, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 17:47, Max Reitz wrote: On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 16:25, Max Reitz wrote: On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend

Re: [PATCH] iotests/210: Fix reference output

2021-02-09 Thread Eric Blake
On 2/9/21 12:19 PM, Max Reitz wrote: > Commit 69b55e03f has changed an error message, adjust the reference > output to account for it. > > Fixes: 69b55e03f7e65a36eb954d0b7d4698b258df2708 >("block: refactor bdrv_check_request: add errp") > Signed-off-by: Max Reitz > --- Reviewed-by: Eric

[PATCH] iotests: Fix unsupported_imgopts for refcount_bits

2021-02-09 Thread Max Reitz
Many _unsupported_imgopts lines for refcount_bits values use something like "refcount_bits=1[^0-9]" to forbid everything but "refcount_bits=1" (e.g. "refcount_bits=16" is allowed). That does not work when $IMGOPTS does not have any entry past the refcount_bits option, which now became apparent wit

[PATCH] iotests/210: Fix reference output

2021-02-09 Thread Max Reitz
Commit 69b55e03f has changed an error message, adjust the reference output to account for it. Fixes: 69b55e03f7e65a36eb954d0b7d4698b258df2708 ("block: refactor bdrv_check_request: add errp") Signed-off-by: Max Reitz --- Fun fact: The branch name "fix-210-v1" was already taken for 8ba9c4d9b

Re: [PATCH v4 0/9] hw/sd: Support block read/write in SPI mode

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 3:32 PM, Bin Meng wrote: > Hi Philippe, > > On Thu, Feb 4, 2021 at 2:02 PM Bin Meng wrote: >> >> On Thu, Jan 28, 2021 at 2:30 PM Bin Meng wrote: >>> >>> From: Bin Meng >>> >>> This includes the previously v3 series [1], and one single patch [2]. >>> >>> Compared to v3, this fixed the

Re: [RFC PATCH] block/null: Use 'read-zeroes' mode by default

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 6:11 PM, Eric Blake wrote: > On 2/9/21 11:01 AM, Philippe Mathieu-Daudé wrote: >> The null-co driver is meant for (performance) testing. >> By default, read operation does nothing, the provided buffer >> is not filled with zero values and its content is unchanged. >> >> This can confuse s

Re: [RFC PATCH] block/null: Use 'read-zeroes' mode by default

2021-02-09 Thread Eric Blake
On 2/9/21 11:01 AM, Philippe Mathieu-Daudé wrote: > The null-co driver is meant for (performance) testing. > By default, read operation does nothing, the provided buffer > is not filled with zero values and its content is unchanged. > > This can confuse security experts. For example, using the def

Re: [RFC PATCH] block/null: Use 'read-zeroes' mode by default

2021-02-09 Thread Max Reitz
On 09.02.21 18:01, Philippe Mathieu-Daudé wrote: The null-co driver is meant for (performance) testing. By default, read operation does nothing, the provided buffer is not filled with zero values and its content is unchanged. This can confuse security experts. For example, using the default null

[RFC PATCH] block/null: Use 'read-zeroes' mode by default

2021-02-09 Thread Philippe Mathieu-Daudé
The null-co driver is meant for (performance) testing. By default, read operation does nothing, the provided buffer is not filled with zero values and its content is unchanged. This can confuse security experts. For example, using the default null-co driver, buf[] is uninitialized, the blk_pread()

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Denis V. Lunev
On 2/9/21 5:47 PM, Max Reitz wrote: > On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: >> 09.02.2021 16:25, Max Reitz wrote: >>> On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend, but I had to switch to a

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
09.02.2021 17:47, Max Reitz wrote: On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 16:25, Max Reitz wrote: On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend, but I had to switch to another task spawned from our

Re: [PULL v3 00/27] Block patches

2021-02-09 Thread Jag Raman
> On Feb 9, 2021, at 1:03 AM, Thomas Huth wrote: > > On 08/02/2021 21.21, Stefan Hajnoczi wrote: >> On Mon, Feb 08, 2021 at 11:02:57AM +0100, Philippe Mathieu-Daudé wrote: >>> On 2/8/21 10:27 AM, Stefan Hajnoczi wrote: On Sat, Feb 06, 2021 at 05:03:20PM +, Peter Maydell wrote: > On

Re: [PATCH v3 1/2] qemu-nbd: Use SOMAXCONN for socket listen() backlog

2021-02-09 Thread Eric Blake
On 2/9/21 10:08 AM, Richard W.M. Jones wrote: > On Tue, Feb 09, 2021 at 09:27:58AM -0600, Eric Blake wrote: >> Our default of a backlog of 1 connection is rather puny; it gets in >> the way when we are explicitly allowing multiple clients (such as >> qemu-nbd -e N [--shared], or nbd-server-start wi

Re: [PATCH v3 1/2] qemu-nbd: Use SOMAXCONN for socket listen() backlog

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 09:27:58AM -0600, Eric Blake wrote: > Our default of a backlog of 1 connection is rather puny; it gets in > the way when we are explicitly allowing multiple clients (such as > qemu-nbd -e N [--shared], or nbd-server-start with its default > "max-connections":0 for unlimited)

Re: [PATCH v3 2/2] qemu-nbd: Permit --shared=0 for unlimited clients

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 09:27:59AM -0600, Eric Blake wrote: > This gives us better feature parity with QMP nbd-server-start, where > max-connections defaults to 0 for unlimited. > > Signed-off-by: Eric Blake > --- > docs/tools/qemu-nbd.rst | 4 ++-- > qemu-nbd.c | 7 +++ > 2 fil

Re: [PATCH v3 1/2] qemu-nbd: Use SOMAXCONN for socket listen() backlog

2021-02-09 Thread Richard W.M. Jones
On Tue, Feb 09, 2021 at 09:27:58AM -0600, Eric Blake wrote: > Our default of a backlog of 1 connection is rather puny; it gets in > the way when we are explicitly allowing multiple clients (such as > qemu-nbd -e N [--shared], or nbd-server-start with its default > "max-connections":0 for unlimited)

[PATCH v3 2/2] qemu-nbd: Permit --shared=0 for unlimited clients

2021-02-09 Thread Eric Blake
This gives us better feature parity with QMP nbd-server-start, where max-connections defaults to 0 for unlimited. Signed-off-by: Eric Blake --- docs/tools/qemu-nbd.rst | 4 ++-- qemu-nbd.c | 7 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/tools/qemu-nb

[PATCH v3 1/2] qemu-nbd: Use SOMAXCONN for socket listen() backlog

2021-02-09 Thread Eric Blake
Our default of a backlog of 1 connection is rather puny; it gets in the way when we are explicitly allowing multiple clients (such as qemu-nbd -e N [--shared], or nbd-server-start with its default "max-connections":0 for unlimited), but is even a problem when we stick to qemu-nbd's default of only

[PATCH v3 0/2] NBD socket backlog

2021-02-09 Thread Eric Blake
in v2: - also adjust backlog of QMP nbd-server-start [Dan] - tweak qemu-nbd backlog to -e when not persistent [Nir] - allow qemu-nbd -e0 for symmetry with QMP [new patch 2] Eric Blake (2): qemu-nbd: Use SOMAXCONN for socket listen() backlog qemu-nbd: Permit --shared=0 for unlimited clients d

Re: [PULL 00/56] emulated nvme patches

2021-02-09 Thread Peter Maydell
On Tue, 9 Feb 2021 at 07:31, Klaus Jensen wrote: > > From: Klaus Jensen > > The following changes since commit 4f799257b323e1238a900fd0c71c2057863e0308: > > Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-02-08' > into staging (2021-02-08 16:12:21 +) > > are available in t

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Max Reitz
On 09.02.21 15:10, Vladimir Sementsov-Ogievskiy wrote: 09.02.2021 16:25, Max Reitz wrote: On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend, but I had to switch to another task spawned from our customer's bug. Original problem: w

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Alexander Bulekov
On 210209 1745, Bin Meng wrote: > Oops, hitting "send" by mistake ... > > On Tue, Feb 9, 2021 at 5:42 PM Bin Meng wrote: > > > > Hi Philippe, > > > > On Tue, Feb 9, 2021 at 5:38 PM Philippe Mathieu-Daudé > > wrote: > > > > > > On 2/9/21 9:28 AM, Bin Meng wrote: > > > > Hi Philippe, > > > > > >

Re: [PATCH 2/2] travis: remove travis configuration and all references to Travis CI

2021-02-09 Thread Thomas Huth
On 09/02/2021 14.50, Daniel P. Berrangé wrote: The Travis CI system QEMU has been using has removed the unlimited free usage model, replacing it with a one-time only grant of CI minutes that is not renewed. The QEMU CI jobs quickly exhaust maintainer's free CI credits, leaving them unable to test

Re: [PATCH v4 0/9] hw/sd: Support block read/write in SPI mode

2021-02-09 Thread Bin Meng
Hi Philippe, On Thu, Feb 4, 2021 at 2:02 PM Bin Meng wrote: > > On Thu, Jan 28, 2021 at 2:30 PM Bin Meng wrote: > > > > From: Bin Meng > > > > This includes the previously v3 series [1], and one single patch [2]. > > > > Compared to v3, this fixed the following issue in patch [v3,6/6]: > > - Ke

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
09.02.2021 16:25, Max Reitz wrote: On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend, but I had to switch to another task spawned from our customer's bug. Original problem: we use O_DIRECT for all vm images in our product, it's th

Re: [PATCH 2/2] travis: remove travis configuration and all references to Travis CI

2021-02-09 Thread Daniel P . Berrangé
On Tue, Feb 09, 2021 at 02:58:46PM +0100, Philippe Mathieu-Daudé wrote: > On 2/9/21 2:50 PM, Daniel P. Berrangé wrote: > > The Travis CI system QEMU has been using has removed the unlimited free > > usage model, replacing it with a one-time only grant of CI minutes that > > is not renewed. The QEMU

Re: [PATCH 2/2] travis: remove travis configuration and all references to Travis CI

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 2:50 PM, Daniel P. Berrangé wrote: > The Travis CI system QEMU has been using has removed the unlimited free > usage model, replacing it with a one-time only grant of CI minutes that > is not renewed. The QEMU CI jobs quickly exhaust maintainer's free CI > credits, leaving them unable to

Re: [PATCH 2/2] travis: remove travis configuration and all references to Travis CI

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 3:03 PM, Daniel P. Berrangé wrote: > On Tue, Feb 09, 2021 at 02:58:46PM +0100, Philippe Mathieu-Daudé wrote: >> On 2/9/21 2:50 PM, Daniel P. Berrangé wrote: >>> The Travis CI system QEMU has been using has removed the unlimited free >>> usage model, replacing it with a one-time only grant

[PATCH 2/2] travis: remove travis configuration and all references to Travis CI

2021-02-09 Thread Daniel P . Berrangé
The Travis CI system QEMU has been using has removed the unlimited free usage model, replacing it with a one-time only grant of CI minutes that is not renewed. The QEMU CI jobs quickly exhaust maintainer's free CI credits, leaving them unable to test with Travis. This is not a sustainable situation

[PATCH 1/2] tests/docker: remove travis container

2021-02-09 Thread Daniel P . Berrangé
The travis container that we have no longer matches what travis currently uses. As all x86 jobs are being moved to GitLab CI too, there is no compelling reason to update the travis container. It is simpler to just remove it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Mosch

[PATCH 0/2] travis: remove all use of Travis CI

2021-02-09 Thread Daniel P . Berrangé
It is not sustainable to keep supporting Travis CI when our maintainer have exhausted their free CI credit allowance and it isn't easily renewable for most While there are still some unique scenarios covered by Travis, this is not useful when maintainers can't run the pipelines. If people see sce

Re: [PATCH 0/7] qcow2: compressed write cache

2021-02-09 Thread Max Reitz
On 29.01.21 17:50, Vladimir Sementsov-Ogievskiy wrote: Hi all! I know, I have several series waiting for a resend, but I had to switch to another task spawned from our customer's bug. Original problem: we use O_DIRECT for all vm images in our product, it's the policy. The only exclusion is back

[PATCH 1/2] hw/nvme: move nvme emulation out of hw/block

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: Klaus Jensen --- meson.build

[PATCH 2/2] hw/nvme: move device-scoped functions

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Move a bunch of functions that are internal to a device out of the shared header. Signed-off-by: Klaus Jensen --- hw/nvme/nvme.h | 110 + hw/nvme/ctrl.c | 90 +++- hw/nvme/ns.c | 7 +++-

Re: [PATCH v2] hw/block/nvme: use locally assigned QEMU IEEE OUI

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 11:45 AM, Klaus Jensen wrote: > From: Gollu Appalanaidu > > Commit 6eb7a071292a ("hw/block/nvme: change controller pci id") changed > the controller to use a Red Hat assigned PCI Device and Vendor ID, but > did not change the IEEE OUI away from the Intel IEEE OUI. > > Fix that and use

[PATCH 0/2] hw/nvme: move nvme emulation out of hw/block

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen With the introduction of the nvme-subsystem device we are really cluttering up the hw/block directory. As suggested by Philippe previously, move the nvme emulation to hw/nvme. Klaus Jensen (2): hw/nvme: move nvme emulation out of hw/block hw/nvme: move device-scoped funct

Re: [PATCH] hw/sd: sdhci: Do not transfer any data when command fails

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 11:54 AM, Bin Meng wrote: > At the end of sdhci_send_command(), it starts a data transfer if > the command register indicates a data is associated. However the > data transfer should only be initiated when the command execution > has succeeded. > > Cc: qemu-sta...@nongnu.org > Fixes: CVE

[PATCH] hw/sd: sdhci: Do not transfer any data when command fails

2021-02-09 Thread Bin Meng
At the end of sdhci_send_command(), it starts a data transfer if the command register indicates a data is associated. However the data transfer should only be initiated when the command execution has succeeded. Cc: qemu-sta...@nongnu.org Fixes: CVE-2020-17380 Fixes: CVE-2020-25085 Reported-by: Ale

[PATCH v2] hw/block/nvme: use locally assigned QEMU IEEE OUI

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Commit 6eb7a071292a ("hw/block/nvme: change controller pci id") changed the controller to use a Red Hat assigned PCI Device and Vendor ID, but did not change the IEEE OUI away from the Intel IEEE OUI. Fix that and use the locally assigned QEMU IEEE OUI instead if the `use

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Bin Meng
Oops, hitting "send" by mistake ... On Tue, Feb 9, 2021 at 5:42 PM Bin Meng wrote: > > Hi Philippe, > > On Tue, Feb 9, 2021 at 5:38 PM Philippe Mathieu-Daudé wrote: > > > > On 2/9/21 9:28 AM, Bin Meng wrote: > > > Hi Philippe, > > > > > > On Tue, Feb 9, 2021 at 3:34 AM Philippe Mathieu-Daudé >

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Bin Meng
Hi Philippe, On Tue, Feb 9, 2021 at 5:38 PM Philippe Mathieu-Daudé wrote: > > On 2/9/21 9:28 AM, Bin Meng wrote: > > Hi Philippe, > > > > On Tue, Feb 9, 2021 at 3:34 AM Philippe Mathieu-Daudé > > wrote: > >> > >> Per the "SD Host Controller Simplified Specification Version 2.00" > >> spec. 'Tab

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Philippe Mathieu-Daudé
On 2/9/21 9:28 AM, Bin Meng wrote: > Hi Philippe, > > On Tue, Feb 9, 2021 at 3:34 AM Philippe Mathieu-Daudé wrote: >> >> Per the "SD Host Controller Simplified Specification Version 2.00" >> spec. 'Table 2-4 : Block Size Register': >> >> Transfer Block Size [...] can be accessed only if no >>

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-02-09 Thread Francisco Iglesias
Hello Edgar, On [2021 Feb 08] Mon 16:30:00, Edgar E. Iglesias wrote: >On Mon, Feb 8, 2021 at 3:42 PM Bin Meng wrote: > > On Thu, Jan 21, 2021 at 10:18 PM Francisco Iglesias > wrote: > > > > Hi Bin, > > > > On [2021 Jan 21] Thu 16:59:51, Bin Meng wrote: > >

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Mauro Matteo Cascella
On Mon, Feb 8, 2021 at 9:26 PM Philippe Mathieu-Daudé wrote: > > On Mon, Feb 8, 2021 at 8:59 PM Mauro Matteo Cascella > wrote: > > On Mon, Feb 8, 2021 at 8:35 PM Philippe Mathieu-Daudé > > wrote: > > > > > > Per the "SD Host Controller Simplified Specification Version 2.00" > > > spec. 'Table 2

Re: [PATCH] hw/sd/sdhci: Do not modify BlockSizeRegister if transaction in progress

2021-02-09 Thread Bin Meng
Hi Philippe, On Tue, Feb 9, 2021 at 3:34 AM Philippe Mathieu-Daudé wrote: > > Per the "SD Host Controller Simplified Specification Version 2.00" > spec. 'Table 2-4 : Block Size Register': > > Transfer Block Size [...] can be accessed only if no > transaction is executing (i.e., after a transa

Re: [RFC PATCH v2 3/4] block: Support multiple reopening with x-blockdev-reopen

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
08.02.2021 21:44, Alberto Garcia wrote: Signed-off-by: Alberto Garcia --- qapi/block-core.json | 2 +- include/block/block.h | 1 + block.c| 16 +-- blockdev.c | 85 +- tests/qemu-iotests/155 | 9

[PULL 52/56] hw/block/nvme: fix set feature save field check

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Currently, no features are saveable, so the current check is not wrong, but add a check against the feature capabilities to make sure this will not regress if saveable features are added later. Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keit

[PULL 56/56] hw/block/nvme: refactor the logic for zone write checks

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Refactor the zone write check logic such that the most "meaningful" error is returned first. That is, first, if the zone is not writable, return an appropriate status code for that. Then, make sure we are actually writing at the write pointer and finally check that we do not cr

[PULL 55/56] hw/block/nvme: fix zone boundary check for append

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen When a zone append is processed the controller checks that validity of the write before assigning the LBA to the append command. This causes the boundary check to be wrong. Fix this by checking the write *after* assigning the LBA. Remove the append special case from the nvme_c

[PULL 51/56] hw/block/nvme: fix set feature for error recovery

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Only enable DULBE if the namespace supports it. Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/block/nvme.c

[PULL 54/56] hw/block/nvme: fix wrong parameter name 'cross_read'

2021-02-09 Thread Klaus Jensen
From: Minwoo Im The actual parameter name is 'cross_read' rather than 'cross_zone_read'. Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 2335739bdb17..e562d7467

[PULL 50/56] hw/block/nvme: error if drive less than a zone size

2021-02-09 Thread Klaus Jensen
From: Minwoo Im If a user assigns a backing device with less capacity than the size of a single zone, the namespace capacity will be reported as zero and the kernel will silently fail to allocate the namespace. This patch errors out in case that the backing device cannot accomodate at least a si

[PULL 49/56] hw/block/nvme: lift cmb restrictions

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen The controller now implements v1.4 and we can lift the restrictions on CMB Data Pointer and Command Independent Locations Support (CDPCILS) and CMB Data Pointer Mixed Locations Support (CDPMLS) since the device really does not care about mixed host/cmb pointers in those cases.

Re: [RFC PATCH v2 1/4] block: Allow changing bs->file on reopen

2021-02-09 Thread Vladimir Sementsov-Ogievskiy
08.02.2021 21:44, Alberto Garcia wrote: When the x-blockdev-reopen was added it allowed reconfiguring the graph by replacing backing files, but changing the 'file' option was forbidden. Because of this restriction some operations are not possible, notably inserting and removing block filters. Th

[PULL 47/56] hw/block/nvme: move cmb logic to v1.4

2021-02-09 Thread Klaus Jensen
From: Padmakar Kalghatgi Implement v1.4 logic for configuring the Controller Memory Buffer. By default, the v1.4 scheme will be used (CMB must be explicitly enabled by the host), so drivers that only support v1.3 will not be able to use the CMB anymore. To retain the v1.3 behavior, set the boole

[PULL 43/56] hw/block/nvme: rename PMR/CMB shift/mask fields

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Use the correct field names. Reviewed-by: Minwoo Im Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- include/block/nvme.h | 18 +- hw/block/nvme.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/block/nvme.h b/

[PULL 40/56] hw/block/nvme: indicate CMB support through controller capabilities register

2021-02-09 Thread Klaus Jensen
From: Andrzej Jakowski This patch sets CMBS bit in controller capabilities register when user configures NVMe driver with CMB support, so capabilites are correctly reported to guest OS. Signed-off-by: Andrzej Jakowski Reviewed-by: Maxim Levitsky Reviewed-by: Minwoo Im Reviewed-by: Keith Busch

[PULL 53/56] hw/block/nvme: align with existing style

2021-02-09 Thread Klaus Jensen
From: Gollu Appalanaidu Change status checks to align with the existing style and remove the explicit check against NVME_SUCCESS. Cc: Dmitry Fomichev Signed-off-by: Gollu Appalanaidu Reviewed-by: Klaus Jensen Reviewed-by: Keith Busch Reviewed-by: Dmitry Fomichev Signed-off-by: Klaus Jensen

[PULL 44/56] hw/block/nvme: remove redundant zeroing of PMR registers

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen The controller registers are initially zero. Remove the redundant zeroing. Reviewed-by: Keith Busch Reviewed-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 34 -- 1 file changed, 34 deletions(-) diff --git a/hw/block/nvme.c

[PULL 37/56] hw/block/nvme: trigger async event during injecting smart warning

2021-02-09 Thread Klaus Jensen
From: zhenwei pi During smart critical warning injection by setting property from QMP command, also try to trigger asynchronous event. Suggested by Keith, if a event has already been raised, there is no need to enqueue the duplicate event any more. Signed-off-by: zhenwei pi [k.jensen: fix typo

[PULL 35/56] nvme: introduce bit 5 for critical warning

2021-02-09 Thread Klaus Jensen
From: zhenwei pi According to NVM Express v1.4, Section 5.14.1.2 ("SMART / Health Information"), introduce bit 5 for "Persistent Memory Region has become read-only or unreliable". Signed-off-by: zhenwei pi [k.jensen: minor brush ups in commit message] Signed-off-by: Klaus Jensen --- include/b

[PULL 46/56] hw/block/nvme: add PMR RDS/WDS support

2021-02-09 Thread Klaus Jensen
From: Naveen Nagar Add support for the PMRMSCL and PMRMSCU MMIO registers. This allows adding RDS/WDS support for PMR as well. Reviewed-by: Keith Busch Signed-off-by: Naveen Nagar Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 6 ++- hw/block/nvme.c | 122 +++

[PULL 41/56] hw/block/nvme: move msix table and pba to BAR 0

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen In the interest of supporting both CMB and PMR to be enabled on the same device, move the MSI-X table and pending bit array out of BAR 4 and into BAR 0. This is a simplified version of the patch contributed by Andrzej Jakowski (see [1]). Leaving the CMB at offset 0 removes the

[PULL 36/56] hw/block/nvme: add smart_critical_warning property

2021-02-09 Thread Klaus Jensen
From: zhenwei pi There is a very low probability that hitting physical NVMe disk hardware critical warning case, it's hard to write & test a monitor agent service. For debugging purposes, add a new 'smart_critical_warning' property to emulate this situation. The orignal version of this change i

[PULL 42/56] hw/block/nvme: allow cmb and pmr to coexist

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen With BAR 4 now free to use, allow PMR and CMB to be enabled simultaneously. Reviewed-by: Minwoo Im Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/hw/block/nvme.c

[PULL 34/56] hw/block/nvme: fix zone write finalize

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen The zone write pointer is unconditionally advanced, even for write faults. Make sure that the zone is always transitioned to Full if the write pointer reaches zone capacity. Cc: Dmitry Fomichev Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 10 +

[PULL 32/56] hw/block/nvme: split setup and register for namespace

2021-02-09 Thread Klaus Jensen
From: Minwoo Im In NVMe, namespace is being attached to process I/O. We register NVMe namespace to a controller via nvme_register_namespace() during nvme_ns_setup(). This is main reason of receiving NvmeCtrl object instance to this function to map the namespace to a controller. To make namespa

[PULL 31/56] hw/block/nvme: remove unused argument in nvme_ns_init_blk

2021-02-09 Thread Klaus Jensen
From: Minwoo Im Removed no longer used aregument NvmeCtrl object in nvme_ns_init_blk(). Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 7a5a7798379

[PULL 38/56] hw/block/nvme: add size to mmio read/write trace events

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Add the size of the mmio read/write to the trace event. Reviewed-by: Minwoo Im Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 4 ++-- hw/block/trace-events | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/n

[PULL 48/56] hw/block/nvme: bump to v1.4

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen With the new CMB logic in place, bump the implemented specification version to v1.4 by default. This requires adding the setting the CNTRLTYPE field and modifying the VWC field since 0x00 is no longer a valid value for bits 2:1. Reviewed-by: Keith Busch Signed-off-by: Klaus

[PULL 33/56] hw/block/nvme: remove unused argument in nvme_ns_setup

2021-02-09 Thread Klaus Jensen
From: Minwoo Im nvme_ns_setup() finally does not have nothing to do with NvmeCtrl instance. Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.h | 2 +- hw/block/nvme-ns.c | 4 ++-- hw/block/nvme.c| 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git

[PULL 29/56] hw/block/nvme: remove unused argument in nvme_ns_init_zoned

2021-02-09 Thread Klaus Jensen
From: Minwoo Im nvme_ns_init_zoned() has no use for given NvmeCtrl object. Signed-off-by: Minwoo Im Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/block/nvme-ns.c b/hw/block/nvme-ns.c index 9be170abb78d..d35c2925ec

[PULL 45/56] hw/block/nvme: disable PMR at boot up

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen The PMR should not be enabled at boot up. Disable the PMR MemoryRegion initially and implement MMIO for PMRCTL, allowing the host to enable the PMR explicitly. Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 14 -- 1 file changed, 12 i

[PULL 30/56] hw/block/nvme: open code for volatile write cache

2021-02-09 Thread Klaus Jensen
From: Minwoo Im Volatile Write Cache(VWC) feature is set in nvme_ns_setup() in the initial time. This feature is related to block device backed, but this feature is controlled in controller level via Set/Get Features command. This patch removed dependency between nvme and nvme-ns to manage the

[PULL 28/56] hw/block/nvme: Correct error status for unaligned ZA

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev TP 4053 says (in section 2.3.1.1) - ... if a Zone Append command specifies a ZSLBA that is not the lowest logical block address in that zone, then the controller shall abort that command with a status code of Invalid Field In Command. In the code, Zone Invalid Write is retu

[PULL 27/56] hw/block/nvme: remove unnecessary check for append

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen nvme_io_cmd already checks if the namespace supports the Zone Append command, so the removed check is dead code. Signed-off-by: Klaus Jensen Tested-by: Dmitry Fomichev Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 4 1 file changed, 4 deletions(-) diff --git a/h

[PULL 23/56] hw/block/nvme: merge implicitly/explicitly opened processing masks

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Implicitly and explicitly opended zones are always bulk processed together, so merge the two processing masks. Signed-off-by: Klaus Jensen Tested-by: Dmitry Fomichev Reviewed-by: Dmitry Fomichev --- hw/block/nvme.c | 27 +++ 1 file changed, 11 inser

[PULL 25/56] hw/block/nvme: zero out zones on reset

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen The zoned command set specification states that "All logical blocks in a zone *shall* be marked as deallocated when [the zone is reset]". Since the device guarantees 0x00 to be read from deallocated blocks we have to issue a pwrite_zeroes since we cannot be sure that a discard

[PULL 39/56] hw/block/nvme: fix 64 bit register hi/lo split writes

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen 64 bit registers like ASQ and ACQ should be writable by both a hi/lo 32 bit write combination as well as a plain 64 bit write. The spec does not define ordering on the hi/lo split, but the code currently assumes that the low order bits are written first. Additionally, the code

[PULL 20/56] hw/block/nvme: fix for non-msix machines

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Commit 1c0c2163aa08 ("hw/block/nvme: verify msix_init_exclusive_bar() return value") had the unintended effect of breaking support on several platforms not supporting MSI-X. Still check for errors, but only report that MSI-X is unsupported instead of bailing out. Fixes: 1c0c2

[PULL 17/56] hw/block/nvme: Introduce max active and open zone limits

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev Add two module properties, "zoned.max_active" and "zoned.max_open" to control the maximum number of zones that can be active or open. Once these variables are set to non-default values, these limits are checked during I/O and Too Many Active or Too Many Open command status i

[PULL 18/56] hw/block/nvme: Support Zone Descriptor Extensions

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev Zone Descriptor Extension is a label that can be assigned to a zone. It can be set to an Empty zone and it stays assigned until the zone is reset. This commit adds a new optional module property, "zoned.descr_ext_size". Its value must be a multiple of 64 bytes. If this valu

[PULL 16/56] hw/block/nvme: Support Zoned Namespace Command Set

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev The emulation code has been changed to advertise NVM Command Set when "zoned" device property is not set (default) and Zoned Namespace Command Set otherwise. Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053) in PCI NVMe contr

[PULL 26/56] hw/block/nvme: add missing string representations for commands

2021-02-09 Thread Klaus Jensen
From: Klaus Jensen Add missing string representations for a couple of new commands. Signed-off-by: Klaus Jensen Tested-by: Dmitry Fomichev Reviewed-by: Dmitry Fomichev --- hw/block/nvme.h | 4 1 file changed, 4 insertions(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index b7fbcca3

[PULL 15/56] nvme: Make ZNS-related definitions

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev Define values and structures that are needed to support Zoned Namespace Command Set (NVMe TP 4053). Signed-off-by: Dmitry Fomichev Acked-by: Stefan Hajnoczi Reviewed-by: Keith Busch Signed-off-by: Klaus Jensen --- include/block/nvme.h | 114

[PULL 13/56] hw/block/nvme: Add support for Namespace Types

2021-02-09 Thread Klaus Jensen
From: Niklas Cassel Define the structures and constants required to implement Namespace Types support. Namespace Types introduce a new command set, "I/O Command Sets", that allows the host to retrieve the command sets associated with a namespace. Introduce support for the command set and enable

[PULL 12/56] hw/block/nvme: Add Commands Supported and Effects log

2021-02-09 Thread Klaus Jensen
From: Dmitry Fomichev This log page becomes necessary to implement to allow checking for Zone Append command support in Zoned Namespace Command Set. This commit adds the code to report this log page for NVM Command Set only. The parts that are specific to zoned operation will be added later in t