All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: minyard@acm.org
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Roman Shaposhnik <roman@zededa.com>,
	jeff.kubascik@dornerworks.com,
	Julien Grall <julien.grall@arm.com>,
	xen-devel@lists.xenproject.org,
	Stefano Stabellini <stefano.stabellini@xilinx.com>
Subject: Re: Troubles running Xen on Raspberry Pi 4 with 5.6.1 DomU
Date: Wed, 6 May 2020 14:56:17 +0100	[thread overview]
Message-ID: <b7ef47a7-4e47-d26b-d4aa-e13ecb9c8ca2@xen.org> (raw)
In-Reply-To: <20200506134838.GM9902@minyard.net>

Hi,

On 06/05/2020 14:48, Corey Minyard wrote:
> On Sat, May 02, 2020 at 12:46:14PM +0100, Julien Grall wrote:
>> Hi,
>>
>> On 02/05/2020 03:16, Corey Minyard wrote:
>>> On Fri, May 01, 2020 at 06:06:11PM -0700, Roman Shaposhnik wrote:
>>>> On Fri, May 1, 2020 at 4:42 AM Corey Minyard <minyard@acm.org> wrote:
>>>>>
>>>>> On Thu, Apr 30, 2020 at 07:20:05PM -0700, Roman Shaposhnik wrote:
>>>>>> Hi!
>>>>>>
>>>>>> I'm trying to run Xen on Raspberry Pi 4 with 5.6.1 stock,
>>>>>> upstream kernel. The kernel itself works perfectly well
>>>>>> on the board. When I try booting it as Dom0 under Xen,
>>>>>> it goes into a stacktrace (attached).
>>>>>
>>>>> Getting Xen working on the Pi4 requires a lot of moving parts, and they
>>>>> all have to be right.
>>>>
>>>> Tell me about it! It is a pretty frustrating journey to align
>>>> everything just right.
>>>> On the other hand -- it seems worth to enable RPi as an ARM development
>>>> platform for Xen given how ubiquitous it is.
>>>>
>>>> Hence me trying to combine pristine upstream kernel (5.6.1) with
>>>> pristine upstream
>>>> Xen to enable 100% upstream developer workflow on RPi.
>>>>
>>>>>> Looking at what nice folks over at Dornerworks have previously
>>>>>> done to make RPi kernels boot as Dom0 I've come across these
>>>>>> 3 patches:
>>>>>>       https://github.com/dornerworks/xen-rpi4-builder/tree/master/patches/linux
>>>>>>
>>>>>> The first patch seems irrelevant (unless I'm missing something
>>>>>> really basic here).
>>>>>
>>>>> It might be irrelevant for your configuration, assuming that Xen gets
>>>>> the right information from EFI.  I haven't tried EFI booting.
>>>>
>>>> I'd doing a bit of belt-and-suspenders strategy really -- I'm actually
>>>> using UEFI u-boot implementation that pre-populates device trees
>>>> and then I'm also forcing an extra copy of it to be load explicitly
>>>> via the GRUB devicetree command (GRUB runs as a UEFI payload).
>>>>
>>>> I also have access to the semi-official TianoCore RPi4 port that seems
>>>> to be working pretty well: https://github.com/pftf/RPi4/releases/tag/v1.5
>>>> for booting all sort of UEFI payloads on RPi4.
>>>>
>>>>>> The 2nd patch applied with no issue (but
>>>>>> I don't think it is related) but the 3d patch failed to apply on
>>>>>> account of 5.6.1 kernel no longer having:
>>>>>>       dev->archdata.dev_dma_ops
>>>>>> E.g.
>>>>>>       https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/mm/dma-mapping.c?h=v5.6.1#n55
>>>>>>
>>>>>> I've tried to emulate the effect of the patch by simply introducing
>>>>>> a static variable that would signal that we already initialized
>>>>>> dev->dma_ops -- but that didn't help at all.
>>>>>>
>>>>>> I'm CCing Jeff Kubascik to see if the original authors of that Corey Minyard
>>>>>> to see if may be they have any suggestions on how this may be dealt
>>>>>> with.
>>>>>>
>>>>>> Any advice would be greatly appreciated!
>>>>>
>>>>> What's your Pi4 config.txt file look like? The GIC is not being handled
>>>>> correctly, and I'm guessing that configuration is wrong.  You can't use
>>>>> the stock config.txt file with Xen, you have to modify the configuration a
>>>>> bit.
>>>>
>>>> Understood. I'm actually using a custom one:
>>>>       https://github.com/lf-edge/eve/blob/master/pkg/u-boot/rpi/config.txt
>>>>
>>>> I could swear that I had a GIC setting in it -- but apparently no -- so
>>>> I added the following at the top of what you could see at the URL above:
>>>>
>>>> total_mem=4096
>>>> enable_gic=1
>>>>
>>>>> I think just adding:
>>>>>
>>>>> enable_gic=1
>>>>> total_mem=1024
>>>>
>>>> Right -- but my board has 4G memory -- so I think what I did above should work.
>>>
>>> Nope.  If you say 4096M of RAM, your issue is almost certainly DMA, but
>>> it's not (just) the Linux code.  On the Raspberry Pi 4, several devices
>>> cannot DMA to above 1024M of RAM, but Xen does not handle this.  The
>>> 1024M of RAM is a limitation you will have to live with until Xen has a
>>> fix.
>>
>> IIUC, dom0 would need to have some memory below 1GB for this to work, am I
>> correct?
> 
> FYI, this also seems to fix the issue with HDMI not working.

Thank you for the testing! I will have a look how I can properly 
upstream this fix (I think we want to keep 4GB limit for other platforms).

Cheers,

-- 
Julien Grall


  reply	other threads:[~2020-05-06 13:56 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01  2:20 Troubles running Xen on Raspberry Pi 4 with 5.6.1 DomU Roman Shaposhnik
2020-05-01 11:42 ` Corey Minyard
2020-05-02  1:06   ` Roman Shaposhnik
2020-05-02  2:16     ` Corey Minyard
2020-05-02 11:46       ` Julien Grall
2020-05-02 17:35         ` Corey Minyard
2020-05-02 17:48           ` Julien Grall
2020-05-04 12:44             ` Corey Minyard
2020-05-04 20:54               ` Roman Shaposhnik
2020-05-05  3:52                 ` Stefano Stabellini
2020-05-05  5:36                   ` Roman Shaposhnik
2020-05-05 22:34                     ` Stefano Stabellini
2020-05-06  1:25                       ` Boris Ostrovsky
2020-05-06  4:19                       ` Roman Shaposhnik
2020-05-06  5:41                       ` Jürgen Groß
2020-05-06  8:54                         ` Peng Fan
2020-05-06 13:08                           ` Nataliya Korovkina
2020-05-06 13:42                             ` Boris Ostrovsky
2020-05-06 16:14                               ` Nataliya Korovkina
2020-05-06 17:34                                 ` Stefano Stabellini
2020-05-06 21:12                                   ` Roman Shaposhnik
2020-05-13  0:33                                     ` Stefano Stabellini
2020-05-13 10:11                                       ` Julien Grall
2020-05-13 15:11                                         ` Stefano Stabellini
2020-05-13 18:19                                           ` Julien Grall
2020-05-13 18:26                                             ` Julien Grall
2020-05-13 19:51                                               ` Stefano Stabellini
2020-06-02 18:34                                                 ` Corey Minyard
2020-06-02 19:24                                                   ` Stefano Stabellini
2020-06-03 15:29                                                     ` Corey Minyard
2020-06-03 15:37                                                       ` Stefano Stabellini
2020-06-03 19:49                                                         ` Corey Minyard
2020-06-03 19:55                                                         ` Roman Shaposhnik
2020-05-13 19:13                                             ` Roman Shaposhnik
2020-05-13 19:49                                             ` Stefano Stabellini
2020-05-06 17:35                                 ` Boris Ostrovsky
2020-05-06 21:10                                   ` Roman Shaposhnik
2020-05-06 17:16                           ` Stefano Stabellini
2020-05-06 17:32                         ` Stefano Stabellini
2020-05-02 18:48           ` Elliott Mitchell
2020-05-02 19:43             ` Julien Grall
2020-05-06 13:48         ` Corey Minyard
2020-05-06 13:56           ` Julien Grall [this message]
2020-05-02  0:05 ` Stefano Stabellini
2020-05-02  1:12   ` Roman Shaposhnik

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=b7ef47a7-4e47-d26b-d4aa-e13ecb9c8ca2@xen.org \
    --to=julien@xen.org \
    --cc=jeff.kubascik@dornerworks.com \
    --cc=julien.grall@arm.com \
    --cc=minyard@acm.org \
    --cc=roman@zededa.com \
    --cc=sstabellini@kernel.org \
    --cc=stefano.stabellini@xilinx.com \
    --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.