virtio_blk: add SECURE ERASE command support
authorAlvaro Karsz <alvaro.karsz@solid-run.com>
Wed, 21 Sep 2022 08:27:29 +0000 (11:27 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 7 Oct 2022 13:32:41 +0000 (09:32 -0400)
commite60d64074214db7207fc13c25ee39d8d47cb4a34
tree3e81886cd2f96bbf3828d8515aa1db09032ca3aa
parentc1ca352d371f724f7fb40f016abdb563aa85fe55
virtio_blk: add SECURE ERASE command support

Support for the VIRTIO_BLK_F_SECURE_ERASE VirtIO feature.

A device that offers this feature can receive VIRTIO_BLK_T_SECURE_ERASE
commands.

A device which supports this feature has the following fields in the
virtio config:

- max_secure_erase_sectors
- max_secure_erase_seg
- secure_erase_sector_alignment

max_secure_erase_sectors and secure_erase_sector_alignment are expressed
in 512-byte units.

Every secure erase command has the following fields:

- sectors: The starting offset in 512-byte units.
- num_sectors: The number of sectors.

Signed-off-by: Alvaro Karsz <alvaro.karsz@solid-run.com>
Message-Id: <20220921082729.2516779-1-alvaro.karsz@solid-run.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
drivers/block/virtio_blk.c
include/uapi/linux/virtio_blk.h