All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Alexander Graf <agraf@suse.de>,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
	David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [Qemu-devel] [PATCH] spapr-pci: change endianness for io ports space
Date: Tue, 16 Jul 2013 10:39:23 +1000	[thread overview]
Message-ID: <51E4963B.3020201@ozlabs.ru> (raw)
In-Reply-To: <871u6ztkjr.fsf@codemonkey.ws>

On 07/16/2013 10:28 AM, Anthony Liguori wrote:
> Alexey Kardashevskiy <aik@ozlabs.ru> writes:
> 
>> On 07/16/2013 01:02 AM, Anthony Liguori wrote:
>>> Alexey Kardashevskiy <aik@ozlabs.ru> writes:
>>>
>>>> On 07/13/2013 06:03 PM, David Gibson wrote:
>>>>> On Fri, Jul 12, 2013 at 05:37:19PM +1000, Alexey Kardashevskiy wrote:
>>>>>> sPAPR PHB emulates IO ports on PCI via a special memory region which
>>>>>> routes all reads/writes further via cpu_in*/cpu_out* which are eventually
>>>>>> processed by MemoryRegionOps implemented by devices.
>>>>
>>>>> Hrm.  That double dispatch was a workaround for bugs in the plain
>>>>> memory region dispatching which meant we couldn't directly map regions
>>>>> in memory space to IO areas.
>>>>>
>>>>> It would be worth checking if that workaround is still necessary.
>>>>
>>>> Hm. Good point, thanks! It seems memory_region_init_io is not necessary any
>>>> more. Will make a patch for it.
>>>
>>> You should try the latest qemu.git commit.  There shouldn't be a problem
>>> anymore.
>>
>>
>> Does this mean sPAPR still needs an additional IO memory region? It looks
>> redundand and everything (almost) works without it...
> 
> There's more brokenness...
> 
> Some ISA devices mark themselves as "little endian" whereas others mark
> themselves as "native endian".
> 
> "little endian" really means "do byte lane swapping during dispatch" if
> host endian != target endian.
> 
> So on sPAPR, what you're getting is the redundant IO memory region
> causing a byte lane swap which is then negated by the ISA devices that
> mark themselves as little endian (such as VGA).
> 
> The right solution is to drop the additional IO region on sPAPR and
> remove the ISA devices marking themselves as "little endian".


No, this is not endianness, this is something different caused by a
difference in IO port registration (subpage? section? memoryregion? I am
going to draw a graph and try realize what is what here :) ).

Even very first IO port access does not reach VGA, fails somehow in
address_space_translate_internal() but devices other than VGA (well, at
least network devices) work perfectly.


> But that requires careful testing and fixing the other platforms that
> also are relying on the doube byte lane swapping.


-- 
Alexey

  reply	other threads:[~2013-07-16  0:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12  7:37 [Qemu-devel] [PATCH] spapr-pci: change endianness for io ports space Alexey Kardashevskiy
2013-07-12  8:59 ` [Qemu-devel] BUG report " Alexey Kardashevskiy
2013-07-12 11:25   ` Alexander Graf
2013-07-13  8:03 ` [Qemu-devel] " David Gibson
2013-07-14 13:22   ` Alexey Kardashevskiy
2013-07-15 15:02     ` Anthony Liguori
2013-07-15 23:06       ` Alexey Kardashevskiy
2013-07-16  0:28         ` Anthony Liguori
2013-07-16  0:39           ` Alexey Kardashevskiy [this message]
2013-07-16  2:05             ` Anthony Liguori
2013-07-16  2:17               ` Alexey Kardashevskiy

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=51E4963B.3020201@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=anthony@codemonkey.ws \
    --cc=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /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.