[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D17263229@AcuExch.aculab.com>
Date: Tue, 24 Jun 2014 14:40:07 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Alexey Kardashevskiy' <aik@...abs.ru>,
Alex Williamson <alex.williamson@...hat.com>,
Alexander Graf <agraf@...e.de>
CC: Nikunj A Dadhania <nikunj@...ux.vnet.ibm.com>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>
Subject: RE: [PATCH] vfio: Fix endianness handling for emulated BARs
From: Alexey Kardashevskiy
...
> >> So IMHO we should either create new, generic iowrite helpers that don't
> >> do any endian swapping at all or do iowrite32(cpu_to_le32(val)) calls.
> >
> > I'm one of those people for whom iowrite32(le32_to_cpu(val)) makes sense
>
>
> I do not understand why @val is considered LE here and need to be converted
> to CPU. Really. I truly believe it should be cpu_to_le32().
Think about it carefully...
Apparently iowrite32() is writing a 'cpu' value out 'le'.
So if you have a 'le' value you need to convert it to 'cpu' first.
I really won't ask how 'be' ppc managed to get 'le' on-chip peripherals.
David
Powered by blists - more mailing lists