All of lore.kernel.org
 help / color / mirror / Atom feed
From: CodeWiz2280 <codewiz2280@gmail.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel <xen-devel@lists.xenproject.org>, nd <nd@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>
Subject: Re: Keystone Issue
Date: Thu, 4 Jun 2020 08:07:12 -0400	[thread overview]
Message-ID: <CALYbLDjNptWfVMGjw801y6f0zu40b2pzBnLS+w2Zx5eVStCUYQ@mail.gmail.com> (raw)
In-Reply-To: <c2466674-a56e-08a4-7f3f-2438d5565953@xen.org>

On Thu, Jun 4, 2020 at 6:16 AM Julien Grall <julien@xen.org> wrote:
>
> Hi,
>
> On 04/06/2020 10:08, Bertrand Marquis wrote:
> > I would have thought that linux would have need some memory, even small in the 32bit space in order to boot.
>
> Yes it needs some, but then they are switching to use the high memory
> alias after the MMU has been switch on.
>
>  From my understanding, the only difference is the page-tables will
> point to the high memory alias address rather than the low memory one.
> Linux will still be located at the same place but now accessed from the
> high memory alias rather than the low one.
>
> Note that AFAICT the secondary CPUs will still be brought-up using the
> low memory alias.
>
> > I could understand that some memory in the low address space needs to be reserved by Linux as DMA area for peripherals not supporting 36-bit addresses, but the whole low memory sounds like a big restriction.
> Many platforms have devices only supporting 32-bit DMA, but none of them
> require such aliasing. So this doesn't look to be the issue here.
>
> TBH, this code is only used by Keystone and switching address space is
> expensive (you have to turn off the MMU, updates page-tables, flush the
> cache...). I find hard to believe a developper would have come up with
> this complexity if it were possible to always use the low memory address
> range. It is even harder to believe Linux community would have accepted it.
>
> >
> > Would it be possible to have a bit more information on the “problem with peripherals” here ?
>
> I am curious as well, so I looked in more depth :). Going through the
> Linux history, one of the commit message [1] suggests they are switching
> to a coherent address space. The datasheet [2] (page 75) also confirm
> that the low region is not IO coherent.
>
> So I think you would not be able to do DMA without flush the cache which
> can be pretty expensive. For a PoC, it might be possible to force Linux
> flushing the area before and after each DMA request. This should be
> possible by marking the devices as not coherent.
>
> Although, I am not entirely sure if there is any fallout.
>
> @Dave, do you think it is possible for you to have a try? I can provide
> the patch for Linux to disable DMA coherency if possible.
I attempted to do that, where I removed the "dma-coherent" flags from
the device tree.  There are likely other issues, but the most glaring
problem that I ran into is that the ethernet does not work.  Eth0
shows up in ifconfig but there is no activity on it after a small
handful of message exchanges, whereas booting without Xen it seems to
work fine even if left in 32-bit mode (with the dma-coherent
disabled).  I don't know what implications behind the scenes there are
trying to stay in the lower 0x8000_0000 alias range either though.  I
would rather run it as intended by switching to the upper
0x8_0000_0000 alias region.

>
> For a proper solution, I think we need to implement something similar to
> what I wrote earlier.
>
> Cheers,
>
> [1] 5eb3da7246a5b2dfac9f38a7be62b1a0295584c7
> [2] https://www.ti.com/lit/ds/symlink/tci6638k2k.pdf?ts=1591183242813
>
>
> --
> Julien Grall


  reply	other threads:[~2020-06-04 12:07 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 12:38 Keystone Issue CodeWiz2280
2020-06-01 13:29 ` Julien Grall
2020-06-01 15:21   ` CodeWiz2280
2020-06-01 17:38     ` CodeWiz2280
2020-06-03 11:32       ` Julien Grall
2020-06-03 17:13         ` CodeWiz2280
2020-06-03 18:09           ` Julien Grall
2020-06-03 18:37             ` CodeWiz2280
2020-06-04  8:02             ` Bertrand Marquis
2020-06-04  8:59               ` Julien Grall
2020-06-04  9:08                 ` Bertrand Marquis
2020-06-04 10:15                   ` Julien Grall
2020-06-04 12:07                     ` CodeWiz2280 [this message]
2020-06-04 18:24                       ` Julien Grall
2020-06-05  2:29                         ` CodeWiz2280
2020-06-05  7:36                           ` Bertrand Marquis
2020-06-05 12:25                             ` CodeWiz2280
2020-06-05 12:30                               ` Julien Grall
2020-06-05 12:42                                 ` CodeWiz2280
2020-06-05 12:47                                   ` Bertrand Marquis
2020-06-05 15:05                                     ` CodeWiz2280
2020-06-05 19:12                                       ` CodeWiz2280
2020-06-08  8:40                                         ` Bertrand Marquis
2020-06-08 12:33                                           ` CodeWiz2280
2020-06-08 16:13                                             ` Stefano Stabellini
2020-06-09 14:33                                               ` CodeWiz2280
2020-06-09 15:28                                                 ` Bertrand Marquis
2020-06-09 15:47                                                   ` Julien Grall
2020-06-09 15:58                                                     ` CodeWiz2280
2020-06-09 17:05                                                       ` Bertrand Marquis
2020-06-09 17:03                                                     ` Bertrand Marquis
2020-06-09 17:32                                                       ` Julien Grall
2020-06-09 17:45                                                         ` Marc Zyngier
2020-06-09 20:07                                                           ` CodeWiz2280
2020-06-10  8:13                                                             ` Bertrand Marquis
2020-06-10  8:06                                                           ` Bertrand Marquis
2020-06-10  8:20                                                             ` Marc Zyngier
2020-06-10  8:39                                                               ` Bertrand Marquis
2020-06-10 12:39                                                                 ` CodeWiz2280
2020-06-10 12:53                                                                   ` Marc Zyngier
2020-06-10 12:58                                                                   ` Julien Grall
2020-06-10 21:46                                                           ` Julien Grall
2020-06-15 19:14                                                             ` CodeWiz2280
2020-06-15 21:32                                                               ` Stefano Stabellini
2020-06-16  7:56                                                                 ` Bertrand Marquis
2020-06-16  8:11                                                               ` Marc Zyngier
2020-06-16 18:13                                                                 ` CodeWiz2280
2020-06-16 18:23                                                                   ` Marc Zyngier
2020-06-17 14:45                                                                     ` CodeWiz2280
2020-06-17 15:25                                                                       ` Marc Zyngier
2020-06-17 18:46                                                                       ` Stefano Stabellini
2020-06-17 23:52                                                                         ` CodeWiz2280
2020-06-23 20:50                                                                           ` CodeWiz2280
2020-06-24  7:50                                                                             ` Bertrand Marquis
2020-06-24 17:28                                                                               ` Stefano Stabellini

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=CALYbLDjNptWfVMGjw801y6f0zu40b2pzBnLS+w2Zx5eVStCUYQ@mail.gmail.com \
    --to=codewiz2280@gmail.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.