lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <eafb0c10-3393-4372-bf2c-7cc7d2a7b11a@oracle.com>
Date: Sun, 6 Apr 2025 16:41:35 -0500
From: Mike Christie <michael.christie@...cle.com>
To: Dongli Zhang <dongli.zhang@...cle.com>, virtualization@...ts.linux.dev,
        kvm@...r.kernel.org, netdev@...r.kernel.org
Cc: mst@...hat.com, jasowang@...hat.com, pbonzini@...hat.com,
        stefanha@...hat.com, eperezma@...hat.com, joao.m.martins@...cle.com,
        joe.jin@...cle.com, si-wei.liu@...cle.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/9] vhost-scsi: log I/O queue write descriptors

On 4/3/25 1:29 AM, Dongli Zhang wrote:
> Log write descriptors for the I/O queue, leveraging vhost_scsi_get_desc()
> and vhost_get_vq_desc() to retrieve the array of write descriptors to
> obtain the log buffer.
> 
> In addition, introduce a vhost-scsi specific function to log vring
> descriptors. In this function, the 'partial' argument is set to false, and
> the 'len' argument is set to 0, because vhost-scsi always logs all pages
> shared by a vring descriptor. Add WARN_ON_ONCE() since vhost-scsi doesn't
> support VIRTIO_F_ACCESS_PLATFORM.
> 
> The per-cmd log buffer is allocated on demand in the submission path after
> VHOST_F_LOG_ALL is set. Return -ENOMEM on allocation failure, in order to
> send SAM_STAT_TASK_SET_FULL to the guest.
> 
> It isn't reclaimed in the completion path. Instead, it is reclaimed when
> VHOST_F_LOG_ALL is removed, or during VHOST_SCSI_SET_ENDPOINT when all
> commands are destroyed.
> 
> Store the log buffer during the submission path and log it in the
> completion path. Logging is also required in the error handling path of the
> submission process.
> 
> Suggested-by: Joao Martins <joao.m.martins@...cle.com>
> Signed-off-by: Dongli Zhang <dongli.zhang@...cle.com>
> ---
> Changed since v1:
>   - Don't allocate log buffer during initialization. Allocate during
>   - VHOST_SET_FEATURES or VHOST_SCSI_SET_ENDPOINT.
>   - Re-order if staments in vhost_scsi_log_write().
>   - Log after vhost_scsi_send_status() as well.
> Changed since v2:
>   - Merge PATCH 6 and PATCH 7 from v2 as one patch.
>   - Don't pre-allocate log buffer in
>     VHOST_SET_FEATURES/VHOST_SCSI_SET_ENDPOINT. Allocate for only once in
>     submission path in runtime. Reclaim int
>     VHOST_SET_FEATURES/VHOST_SCSI_SET_ENDPOINT.
>   - Encapsulate the one-time on-demand per-cmd log buffer alloc/copy in a
>     helper, as suggested by Mike.
Reviewed-by: Mike Christie <michael.christie@...cle.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ