Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-15 Thread Eric Blake
On 12/14/2017 03:06 AM, Kevin Wolf wrote:
> Am 14.12.2017 um 00:20 hat Philippe Mathieu-Daudé geschrieben:
>> Use Base64 to serialize the binary blobs in JSON.
>> So far at most 512 bytes will be transfered, which result

s/transfered/transferred/

>> in a 684 bytes payload.
>> Since this command is intented for qtesting, this is acceptable.

s/intented/intended/

>>
>> Signed-off-by: Philippe Mathieu-Daudé 
> 
> Doing this kind of thing over QMP doesn't look right to me. qtests
> should access hardware the same way as real guests access the hardware
> (i.e. MMIO and I/O ports).
> 
> But if for some reason the QMP maintainers were to think that this is
> acceptable in QMP, I'd argue it should at least get an x-debug- prefix
> to avoid making it a stable API that management tools may rely on.

I'm not convinced the command is needed, but agree that if we want it,
it should have an 'x-debug-' prefix.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.   +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-15 Thread Paolo Bonzini
On 14/12/2017 14:25, Philippe Mathieu-Daudé wrote:
> Yes, a SDHCI qtest is added in a later series (in C) using MMIO access:
> http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02391.html
> 
> But to be sure the SDHCI is correct I needed a SD slave to behave
> correctly ;) Hence this "bus test".

You could also use the SPI interface for a lower-level test.

Paolo



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-14 Thread Philippe Mathieu-Daudé
Hi Paolo,

On 12/14/2017 06:34 AM, Paolo Bonzini wrote:
> On 14/12/2017 10:06, Kevin Wolf wrote:
[...]
>> Doing this kind of thing over QMP doesn't look right to me. qtests
>> should access hardware the same way as real guests access the hardware
>> (i.e. MMIO and I/O ports).
[...]
> 
> Yeah, what we usually do is not test the device (e.g. SCSI) directly,
> but only through the HBA (e.g. virtio-scsi or AHCI, it would be SDHCI in
> this case).

Yes, a SDHCI qtest is added in a later series (in C) using MMIO access:
http://lists.nongnu.org/archive/html/qemu-devel/2017-12/msg02391.html

But to be sure the SDHCI is correct I needed a SD slave to behave
correctly ;) Hence this "bus test".

Regards,

Phil.



signature.asc
Description: OpenPGP digital signature


Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-14 Thread Philippe Mathieu-Daudé
Hi Kevin,

On 12/14/2017 06:06 AM, Kevin Wolf wrote:
> Am 14.12.2017 um 00:20 hat Philippe Mathieu-Daudé geschrieben:
>> Use Base64 to serialize the binary blobs in JSON.
>> So far at most 512 bytes will be transfered, which result
>> in a 684 bytes payload.
>> Since this command is intented for qtesting, this is acceptable.
>>
>> Signed-off-by: Philippe Mathieu-Daudé 
> 
> Doing this kind of thing over QMP doesn't look right to me. qtests
> should access hardware the same way as real guests access the hardware
> (i.e. MMIO and I/O ports).

Yes, I agree with you, however this command does not implement a guest
access behavior (MMIO and I/O ports) but a _bus_ access.

Guests access buses via MMIO/IOP hardware frontend (bus master), bus
slave devices might be considered as backend, like the BlockBackend.

As the current iotests are meant for backend testing, this command is
meant for SDBus backend testing.

Actually with SDHCI I started to qtest the hardware frontend then
realized the backend was incorrect, so I had to go this way to fix it.
Later series do test the HCI using C qtests.

This approach should works for any buses, and start to be quite
interesting with:
- hot-plug buses to unplug/plug slaves
- multi-master buses like I2C to inject noise on the bus and see if the
host can recover/continue
- testing slave failures like a bricked SPI slave keeping some bus lines
held and checking if the HCI expose this failure to the guest (or the
guest checking the HCI for failures)

> But if for some reason the QMP maintainers were to think that this is
> acceptable in QMP, I'd argue it should at least get an x-debug- prefix
> to avoid making it a stable API that management tools may rely on.

I'd rather have the qtests using this command always run (if they take
too long they might be tagged as 'slow' tests), so I'd keep this stable.

Maybe we can prefix the qtests related QMP commands as "x-qtest-"? Else
your suggestion is fine.

Regards,

Phil.



Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-14 Thread Paolo Bonzini
On 14/12/2017 10:06, Kevin Wolf wrote:
> Am 14.12.2017 um 00:20 hat Philippe Mathieu-Daudé geschrieben:
>> Use Base64 to serialize the binary blobs in JSON.
>> So far at most 512 bytes will be transfered, which result
>> in a 684 bytes payload.
>> Since this command is intented for qtesting, this is acceptable.
>>
>> Signed-off-by: Philippe Mathieu-Daudé 
> 
> Doing this kind of thing over QMP doesn't look right to me. qtests
> should access hardware the same way as real guests access the hardware
> (i.e. MMIO and I/O ports).
> 
> But if for some reason the QMP maintainers were to think that this is
> acceptable in QMP, I'd argue it should at least get an x-debug- prefix
> to avoid making it a stable API that management tools may rely on.

Yeah, what we usually do is not test the device (e.g. SCSI) directly,
but only through the HBA (e.g. virtio-scsi or AHCI, it would be SDHCI in
this case).

Thanks,

Paolo



Re: [Qemu-devel] [PATCH 01/26] sdbus: add a QMP command to access a SDBus

2017-12-14 Thread Kevin Wolf
Am 14.12.2017 um 00:20 hat Philippe Mathieu-Daudé geschrieben:
> Use Base64 to serialize the binary blobs in JSON.
> So far at most 512 bytes will be transfered, which result
> in a 684 bytes payload.
> Since this command is intented for qtesting, this is acceptable.
> 
> Signed-off-by: Philippe Mathieu-Daudé 

Doing this kind of thing over QMP doesn't look right to me. qtests
should access hardware the same way as real guests access the hardware
(i.e. MMIO and I/O ports).

But if for some reason the QMP maintainers were to think that this is
acceptable in QMP, I'd argue it should at least get an x-debug- prefix
to avoid making it a stable API that management tools may rely on.

Kevin