Messages in this thread | | | From | Arnd Bergmann <> | Date | Sun, 16 Jan 2022 17:19:43 +0100 | Subject | Re: [PATCH v8 3/4] clocksource/drivers: Add a goldfish-timer clocksource |
| |
On Sun, Jan 16, 2022 at 12:54 PM Laurent Vivier <laurent@vivier.eu> wrote: > > Virtio has exactly the same problem in the past (prio to v1.0), and it uses __LITTLE_ENDIAN in > virtio_legacy_is_little_endian() to know the endianness of the device.
Right, that was my point, let's not duplicate the bug from pre-standard virtio.
> So the code can become: > > #ifdef __LITTLE_ENDIAN > #define goldfish_ioread32 ioread32 > #define goldfish_iowrite32 iowrite32 > #else > #define goldfish_ioread32 ioread32be > #define goldfish_iowrite32 iowrite32be > #endif
This is exactly the same as what you had before, it continues to break when host and guest disagree on the endianess.
> What do you prefer: CONFIG_M68K or __LITTLE_ENDIAN?
Checking for CONFIG_M68K at least has a chance of working, provided that all existing qemu implementations agree on the semantics here.
Arnd
| |