Re: [PATCH] virtio-mmio: read[wl]()/write[wl] are already little-endian

From: Laurent Vivier
Date: Thu Mar 11 2021 - 10:56:10 EST


Le 11/03/2021 à 16:44, Michael S. Tsirkin a écrit :
> On Tue, Mar 09, 2021 at 11:43:13PM +0100, Laurent Vivier wrote:
>> read[wl]()/write[wl] already access memory in little-endian mode.
>
> But then they convert it to CPU right? We just convert it back ...

Yes, you're right.

But there's a real problem with a big-endian guest using directly virtio-mmio without using virtio-pci.

It seems there is one too many little-endian conversion somewhere, and this has not been detected
before because there is no big-endian guest that uses virtio-mmio directly, and with little-endian
guests the conversion is a no-op. I'm going to have a closer look to the code path... perhaps the
problem is in QEMU not in the kernel.

Thanks,
Laurent