Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-22 Thread Michael S. Tsirkin
On Tue, Sep 20, 2022 at 02:10:37PM -0400, Stefan Hajnoczi wrote: > On Sun, Sep 18, 2022 at 07:07:34PM +0300, Alvaro Karsz wrote: > > > sounds good. Add a code comment? > > > > I will. > > > > > yes but I now see two places that seem to include this logic. > > > > > > Yes, this is because the s

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-22 Thread Michael S. Tsirkin
On Tue, Sep 20, 2022 at 02:11:40PM -0400, Stefan Hajnoczi wrote: > On Mon, Sep 19, 2022 at 09:09:05PM +0300, Alvaro Karsz wrote: > > Thanks for the reply. > > > > > This can be simplified with min_not_zero(). > > > > Ok, I will do it in the next version. > > > > > It's worth including a comment

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-20 Thread Alvaro Karsz
> Okay, I have replied in the max_secure_erase_seg sub-thread. I think > probing the device should fail if the value is 0. There are no existing > non-compliant devices that we need to be compatible with - let's > encourage device implementors to report usable max_secure_erase_seg > values. Ok, I

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-20 Thread Stefan Hajnoczi
On Mon, Sep 19, 2022 at 09:09:05PM +0300, Alvaro Karsz wrote: > Thanks for the reply. > > > This can be simplified with min_not_zero(). > > Ok, I will do it in the next version. > > > It's worth including a comment here that the discard and secure erase > > limits are combined because the Linux

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-20 Thread Stefan Hajnoczi
On Sun, Sep 18, 2022 at 07:07:34PM +0300, Alvaro Karsz wrote: > > sounds good. Add a code comment? > > I will. > > > yes but I now see two places that seem to include this logic. > > > Yes, this is because the same logic is applied on 2 different pairs. > > * secure_erase_sector_alignment and

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-19 Thread Alvaro Karsz
Thanks for the reply. > This can be simplified with min_not_zero(). Ok, I will do it in the next version. > It's worth including a comment here that the discard and secure erase > limits are combined because the Linux block layer only has one limit > value. If the block layer supported independe

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-19 Thread Stefan Hajnoczi
On Mon, Aug 29, 2022 at 11:23:13AM +0300, Alvaro Karsz wrote: > @@ -1075,6 +1068,57 @@ static int virtblk_probe(struct virtio_device *vdev) > blk_queue_max_write_zeroes_sectors(q, v ? v : UINT_MAX); > } > > + if (virtio_has_feature(vdev, VIRTIO_BLK_F_SECURE_ERASE)) { > +

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-18 Thread Alvaro Karsz
> sounds good. Add a code comment? I will. > yes but I now see two places that seem to include this logic. Yes, this is because the same logic is applied on 2 different pairs. * secure_erase_sector_alignment and discard_sector_alignment are used to calculate q->limits.discard_granularity. *

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-18 Thread Michael S. Tsirkin
On Sun, Sep 18, 2022 at 05:01:53PM +0300, Alvaro Karsz wrote: > Thanks for the reply. > > > why minimum? > > > why is that? > > This was discussed in the previous version > (https://www.spinics.net/lists/linux-virtualization/msg58232.html). > As far as I know, the Linux kernel uses the same "ma

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-18 Thread Alvaro Karsz
Thanks for the reply. > why minimum? > why is that? This was discussed in the previous version (https://www.spinics.net/lists/linux-virtualization/msg58232.html). As far as I know, the Linux kernel uses the same "max segments" value for a discard and a secure erase command. In the first version

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-18 Thread Michael S. Tsirkin
On Mon, Aug 29, 2022 at 11:23:13AM +0300, Alvaro Karsz wrote: > 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 confi

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-09 Thread Alvaro Karsz
Hi, Anyone have any comments on the patch? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v2] virtio_blk: add SECURE ERASE command support

2022-09-01 Thread Alvaro Karsz
Is that what you meant Stefan? ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

[PATCH v2] virtio_blk: add SECURE ERASE command support

2022-08-29 Thread Alvaro Karsz
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_