[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v42 06/98] hw/sd/sdcard: Do not store vendor data on block dr
From: |
Daniel P . Berrangé |
Subject: |
Re: [PATCH v42 06/98] hw/sd/sdcard: Do not store vendor data on block drive (CMD56) |
Date: |
Mon, 1 Jul 2024 09:26:33 +0100 |
User-agent: |
Mutt/2.2.12 (2023-09-09) |
On Fri, Jun 28, 2024 at 09:00:42AM +0200, Philippe Mathieu-Daudé wrote:
> "General command" (GEN_CMD, CMD56) is described as:
>
> GEN_CMD is the same as the single block read or write
> commands (CMD24 or CMD17). The difference is that [...]
> the data block is not a memory payload data but has a
> vendor specific format and meaning.
>
> Thus this block must not be stored overwriting data block
> on underlying storage drive. Keep it in a dedicated
> 'vendor_data[]' array.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Tested-by: Cédric Le Goater <clg@redhat.com>
> ---
> RFC: Is it safe to reuse VMSTATE_UNUSED_V() (which happens
> to be the same size)?
This field became unused with:
commit 12c125cba9c548929ccf4da2515e5b795c94afd9
Author: Eric Blake <eblake@redhat.com>
Date: Fri May 6 10:26:39 2016 -0600
sd: Switch to byte-based block access
which was in 2.6.1 / 2.7.0
Thus if someone is using a machine type that is 2.6 or
older, I don't think it is safe to unconditionally
reuse that field.
My pending series deprecates everything upto 2.12, but
we won't remove those machine types until 2 further
release are past.
You could gamble that SD card usage is niche enough
that its highly unlikely someone will be using SD
card at the same time as these ancient machine types.
The safe thing would be a new field.
> Cc: Peter Xu <peterx@redhat.com>
> Cc: Fabiano Rosas <farosas@suse.de>
> ---
> hw/sd/sd.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|