[PATCH v2] arm/arm64: KVM: MMIO support for BE guest

Marc Zyngier marc.zyngier at arm.com
Wed Oct 30 13:11:28 EDT 2013


On 30/10/13 17:06, Anup Patel wrote:
> On Wed, Oct 30, 2013 at 1:58 PM, Marc Zyngier <marc.zyngier at arm.com> wrote:
>> On 2013-10-30 01:10, Anup Patel wrote:
>>>
>>> On Wed, Oct 30, 2013 at 12:19 AM, Marc Zyngier <marc.zyngier at arm.com>
>>> wrote:
>>>>
>>>> Do the necessary byteswap when host and guest have different
>>>> views of the universe. Actually, the only case we need to take
>>>> care of is when the guest is BE. All the other cases are naturally
>>>> handled.
>>>
>>>
>>> You might want to handle the case where we have LE guest on BE host
>>> because for ARM64 kernel we might have lot of people interested in
>>> running host kernel in BE mode with KVM enabled.
>>
>>
>> What makes you think it is not handled already?
> 
> What I understood here is that you are trying to ensure that MMIO data
> passed to/from user space (i.e. QEMU or KVMTOOL) is host endian
> using vcpu_data_guest_to_host() and vcpu_data_host_to_guest(). This
> makes lot of sense for having all combinations of host and guest endianness.
> 
> If the above is correct then I see an issue in vcpu_data_guest_to_host() and
> vcpu_data_host_to_guest() for LE guest on BE host because this patch does
> endianness conversion for BE VCPUs only in vcpu_data_guest_to_host() and
> vcpu_data_host_to_guest(). If we have LE guest on BE host then these
> functions won't do any endianness conversion.

And no conversion is exactly what we want. MMIO is always LE.

	M.
-- 
Jazz is not dead. It just smells funny...




More information about the linux-arm-kernel mailing list