On 2/7/24 18:04, Philippe Mathieu-Daudé wrote:
On 1/7/24 10:01, Luc Michel wrote:
On 09:00 Fri 28 Jun     , Philippe Mathieu-Daudé wrote:
Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


"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é <phi...@linaro.org>
Tested-by: Cédric Le Goater <c...@redhat.com>
---
RFC: Is it safe to reuse VMSTATE_UNUSED_V() (which happens
to be the same size)?

Cc: Peter Xu <pet...@redhat.com>
Cc: Fabiano Rosas <faro...@suse.de>

I'm not sure about this migration question.

But IMHO you can simplify your implementation to avoid having to store
and migrate this vendor_data array. After some research on this command,
I came to the conclusion that it's used by manufacturers to return
device health related vendor-specific data. (E.g.,
https://images-na.ssl-images-amazon.com/images/I/91tTtUMDM3L.pdf Section
1.6.1). So I guess you can simply discard writes and return 0s on reads
(or "QEMU" in ASCII or... :)).

Thanks, very interesting datasheet! Note the argument filter:

   To query the Health Status register, CMD56 with
   argument of [00 00 00 01] is used.

Since we can program this array, I'll simply add it as R/W (KISS).

(What really matters here is that we don't overwrite the generic
 data[] array used to access the blocks)


Reply via email to