[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness |
Date: |
Tue, 4 Oct 2016 16:04:06 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 |
On 04/10/2016 14:36, Peter Maydell wrote:
> On 4 October 2016 at 13:17, Cédric Le Goater <address@hidden> wrote:
>> Some test scenarios require to access memory regions using a specific
>> endianness, such as a device region, but the current qtest memory
>> accessors are done in native endian, which means that the values are
>> byteswapped in qtest if the endianness of the guest and the host are
>> different.
>>
>> To maintain the endianness of a value, we need a new set of memory
>> accessor. This can be done in two ways:
>>
>> - first, convert the value to the required endianness in libqtest and
>> then use the memread/write routines so that qtest accesses the guest
>> memory without doing any supplementary byteswapping
>>
>> - an alternative method would be to handle the byte swapping on the
>> qtest side. For that, we would need to extend the read/write
>> protocol with an ending word : "native|le|be" and modify the tswap
>> calls accordingly under the qtest_process_command() routine.
>>
>> The result is the same and the first method is simpler.
>
> The difficulty with this patch is that it's hard to tell whether
> it's really required, or if this is just adding an extra layer
> of byteswapping that should really be done in some other location
> in the stack. What's the actual test case here?
>
We need that to implement PCI qtest with SPAPR, as PCI is always
little-endian and SPAPR is big-endian by default, see my patch
http://patchwork.ozlabs.org/patch/676591/
I'm going to resend my series based on Cédric's patch.
Thanks,
Laurent
- [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/04
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Peter Maydell, 2016/10/04
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness,
Laurent Vivier <=
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/04
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Paolo Bonzini, 2016/10/04
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, David Gibson, 2016/10/04
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Peter Maydell, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Peter Maydell, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Peter Maydell, 2016/10/05
- Re: [Qemu-devel] [PATCH] qtest: add read/write accessors with a specific endianness, Cédric Le Goater, 2016/10/05