All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: kvm@vger.kernel.org,
	Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	linux-kernel@vger.kernel.org,
	Alex Williamson <alex.williamson@redhat.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] vfio: Fix endianness handling for emulated BARs
Date: Wed, 25 Jun 2014 12:43:17 +1000	[thread overview]
Message-ID: <53AA3745.7070108@ozlabs.ru> (raw)
In-Reply-To: <1403646877.4587.184.camel@pasglop>

On 06/25/2014 07:54 AM, Benjamin Herrenschmidt wrote:
> On Wed, 2014-06-25 at 00:33 +1000, Alexey Kardashevskiy wrote:
>>
>> 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().
> 
> No. Both are slightly wrong semantically but le32_to_cpu() is less
> wrong :-)
>
> iowrite32 supposedly takes a "cpu" value as argument and writes an "le"
> value. So if anything, you need something that converts to a "cpu" value
> before you call iowrite32.
> 
> Now it's still slightly wrong because the "input" to le32_to_cpu() is
> supposed to be an "LE" value but of course here it's not, it's a "cpu"
> value too :-)
> 
> But yes, I agree with aw here, either do nothing or stick a set of
> iowriteXX_native or something equivalent in the generic iomap header,
> define them in term of iowrite32be/iowrite32 based on the compile time
> endian of the arch.


Ok. I'll do nothing.


> Hitting asm-generic/iomap.h I think will cover all archs except ARM.
> For ARM, just hack arch/arm/asm/io.h


-- 
Alexey

WARNING: multiple messages have this Message-ID (diff)
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Alex Williamson <alex.williamson@redhat.com>,
	Alexander Graf <agraf@suse.de>,
	linuxppc-dev@lists.ozlabs.org, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Subject: Re: [PATCH] vfio: Fix endianness handling for emulated BARs
Date: Wed, 25 Jun 2014 12:43:17 +1000	[thread overview]
Message-ID: <53AA3745.7070108@ozlabs.ru> (raw)
In-Reply-To: <1403646877.4587.184.camel@pasglop>

On 06/25/2014 07:54 AM, Benjamin Herrenschmidt wrote:
> On Wed, 2014-06-25 at 00:33 +1000, Alexey Kardashevskiy wrote:
>>
>> 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().
> 
> No. Both are slightly wrong semantically but le32_to_cpu() is less
> wrong :-)
>
> iowrite32 supposedly takes a "cpu" value as argument and writes an "le"
> value. So if anything, you need something that converts to a "cpu" value
> before you call iowrite32.
> 
> Now it's still slightly wrong because the "input" to le32_to_cpu() is
> supposed to be an "LE" value but of course here it's not, it's a "cpu"
> value too :-)
> 
> But yes, I agree with aw here, either do nothing or stick a set of
> iowriteXX_native or something equivalent in the generic iomap header,
> define them in term of iowrite32be/iowrite32 based on the compile time
> endian of the arch.


Ok. I'll do nothing.


> Hitting asm-generic/iomap.h I think will cover all archs except ARM.
> For ARM, just hack arch/arm/asm/io.h


-- 
Alexey

  reply	other threads:[~2014-06-25  2:43 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-18 11:36 [PATCH] vfio: Fix endianness handling for emulated BARs Alexey Kardashevskiy
2014-06-18 11:36 ` Alexey Kardashevskiy
2014-06-18 18:35 ` Alex Williamson
2014-06-18 18:35   ` Alex Williamson
2014-06-19  0:50   ` Alexey Kardashevskiy
2014-06-19  0:50     ` Alexey Kardashevskiy
2014-06-19  1:50     ` Alexey Kardashevskiy
2014-06-19  1:50       ` Alexey Kardashevskiy
2014-06-19  1:50     ` Alexey Kardashevskiy
2014-06-19  1:50       ` Alexey Kardashevskiy
2014-06-19  3:48       ` Alexey Kardashevskiy
2014-06-19  3:48         ` Alexey Kardashevskiy
2014-06-19  5:30         ` Bharat.Bhushan
2014-06-19  5:30           ` Bharat.Bhushan
2014-06-19  5:30           ` Bharat.Bhushan
2014-06-19  6:17           ` Alexey Kardashevskiy
2014-06-19  6:17             ` Alexey Kardashevskiy
2014-06-20  3:21         ` Alex Williamson
2014-06-20  3:21           ` Alex Williamson
2014-06-20  3:21           ` Alex Williamson
2014-06-20 14:14           ` Alexey Kardashevskiy
2014-06-20 14:14             ` Alexey Kardashevskiy
2014-06-20 23:16             ` Benjamin Herrenschmidt
2014-06-20 23:16               ` Benjamin Herrenschmidt
2014-06-20 23:16               ` Benjamin Herrenschmidt
2014-06-20 23:12           ` Benjamin Herrenschmidt
2014-06-20 23:12             ` Benjamin Herrenschmidt
2014-06-20 23:12             ` Benjamin Herrenschmidt
2014-06-24 10:11             ` Alexey Kardashevskiy
2014-06-24 10:11               ` Alexey Kardashevskiy
2014-06-24 10:41               ` Alexander Graf
2014-06-24 10:41                 ` Alexander Graf
2014-06-24 12:50                 ` Alexey Kardashevskiy
2014-06-24 12:50                   ` Alexey Kardashevskiy
2014-06-24 12:52                   ` Alexander Graf
2014-06-24 12:52                     ` Alexander Graf
2014-06-24 13:01                     ` Alexey Kardashevskiy
2014-06-24 13:01                       ` Alexey Kardashevskiy
2014-06-24 13:22                       ` Alexander Graf
2014-06-24 13:22                         ` Alexander Graf
2014-06-24 14:21                         ` Alex Williamson
2014-06-24 14:21                           ` Alex Williamson
2014-06-24 14:33                           ` Alexey Kardashevskiy
2014-06-24 14:33                             ` Alexey Kardashevskiy
2014-06-24 14:40                             ` David Laight
2014-06-24 14:40                               ` David Laight
2014-06-24 14:40                               ` David Laight
2014-06-24 14:43                             ` Alex Williamson
2014-06-24 14:43                               ` Alex Williamson
2014-06-24 16:26                               ` Alexey Kardashevskiy
2014-06-24 16:26                                 ` Alexey Kardashevskiy
2014-06-24 21:54                             ` Benjamin Herrenschmidt
2014-06-24 21:54                               ` Benjamin Herrenschmidt
2014-06-25  2:43                               ` Alexey Kardashevskiy [this message]
2014-06-25  2:43                                 ` Alexey Kardashevskiy
2014-06-24 21:46                 ` Benjamin Herrenschmidt
2014-06-24 21:46                   ` Benjamin Herrenschmidt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53AA3745.7070108@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=benh@kernel.crashing.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=nikunj@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.