Hi,

> 2026年7月9日 22:41,Philippe Mathieu-Daudé <[email protected]> 写道:
> 
> On 9/7/26 08:39, Michael Tokarev wrote:
>> On 05.06.2026 16:27, Miao Wang via B4 Relay wrote:
>>> From: Miao Wang <[email protected]>
>>> 
>>> This patch improves the implementation of the pvscsi device by
>>> translating the endianness of the data sent or received from the guest.
>>> This ensures pvscsi can work on big-endian hosts with little-endian
>>> guests.
>> Hi!
>> Can we pick this one up for 11.1 please?
>> I know right to nothing about s390x internals so can't really review
>> the change.  But the fix seems to work, and it should be picked up for
>> the stable qemu series too, it loks like.
> 
> I tagged this for review and forgot. Basically we shouldn't using
> tswap*() anywhere in system emulation except semihosting. Here it
> seems reasonable to use cpu_to_le*()/le*_to_cpu().

I have no idea why tswap* should not be used. Here the problem in
pvscsi is that the driver on the guest side is using the native
endianness of the guest CPU while for handling the values on the
host size, we need to convert it to host endianness. As a result,
what should be done is to convert from the target endianness to
the host endianness and vice versa, instead of converting from
a specific endianness to to host endianness.

Cheers,

Miao Wang


Reply via email to