On 06/10/2016 17:44, Cédric Le Goater wrote: > On 10/06/2016 05:36 PM, Paolo Bonzini wrote: >> >> >> On 06/10/2016 16:11, Greg Kurz wrote: >>> FWIW, Cedric had another proposal which apparently went unnoticed: >>> >>> <fc24ad74-da26-a713-9312-a2c2d07fb...@kaod.org> >>> >>> The idea is to add an optional endianness argument to the read*/write* >>> commands in the qtest protocol: >>> - libqtest then provides explicit _le and _be APIs >>> - no extra byteswap is performed on the test program side: qtest >>> actually handles that and does exactly 1 or 0 byteswap. >>> - it does not use memread/memwrite >>> - the current 'guest native' API where qtest tswaps is preserved >>> >> >> No, this is a worse idea, because the right place to do the swap is in >> the "program" (libqtest) not in the "CPU" (QEMU). > > So the current patch, minus the typos, seems to be a "better" solution.
Yes, at least I don't think it's a problem that it uses "memread" and "memwrite". It's just address_space_rw under the hood, and we know that it does the right thing with MMIO addresses. Paolo