Re: [Xen-devel] ThunderX support in Xen

2018-03-06 Thread Stefano Stabellini
On Tue, 6 Mar 2018, Stefano Stabellini wrote:
> On Wed, 31 Jan 2018, Julien Grall wrote:
> > When working on getting Xen booting on rochester{0,1} (Thunder-X in 
> > Osstest),
> > I blacklist them with this small patch. I will clean-up it and send it on 
> > the ML:
> > 
> > diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> > index 155c952349..8b7fb0e12a 100644
> > --- a/xen/arch/arm/domain_build.c
> > +++ b/xen/arch/arm/domain_build.c
> > @@ -1182,6 +1182,7 @@ static int handle_node(struct domain *d, struct 
> > kernel_info *kinfo,
> >  DT_MATCH_TYPE("memory"),
> >  /* The memory mapped timer is not supported by Xen. */
> >  DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),
> > +DT_MATCH_COMPATIBLE("cavium,smmu-v2"),
> >  { /* sentinel */ },
> >  };
> >  static const struct dt_device_match timer_matches[] __initconst =
> > 
> > The only other issues I found was when booting using Grub. I needed to bump 
> > the
> > number of banks.
> 
> Hi Julien,
> 
> thanks to your ThunderX patch series, I could go forward in the boot
> sequence, however the initrd still cannot mount the rootfs. The device
> doesn't come up, there is this warning:
> 
> [   11.451711] WARNING: CPU: 32 PID: 802 at 
> /build/linux-hwe-z0PmXZ/linux-hwe-4.10.0/drivers/ata/libata-core.c:6468 
> ata_host_activate+0x140/0x158
> [   11.451712] Modules linked in: drm(+) ahci(+) libahci thunder_bgx(+) 
> thunder_xcv mdio_thunder(+) mdio_cavium
> [   11.451725] 
> [   11.451730] CPU: 32 PID: 802 Comm: systemd-udevd Tainted: GW   
> 4.10.0-38-generic #42~16.04.1-Ubuntu
> [   11.451732] Hardware name: cavium,thunder-88xx (DT)
> [   11.451734] task: 8000efa4ab80 task.stack: 8000efa7c000
> [   11.451739] PC is at ata_host_activate+0x140/0x158
> [   11.451744] LR is at ata_host_activate+0x68/0x158
> 
> See the appended full logs. I am wondering if you have seen this issue,
> I thought I would ask before attempting to debug it. Also, is vanilla
> Linux expected to work on ThunderX?

Silly me, everything works as expected once I enabled CONFIG_HAS_ITS.

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Re: [Xen-devel] ThunderX support in Xen

2018-01-31 Thread Julien Grall
Hi Stefano,

On 31/01/18 00:01, Stefano Stabellini wrote:
> I am testing Xen support in ThunderX, but I am having some issues
> booting Dom0 using Xen staging and the Ubuntu Xenial kernel (it has
> CONFIG_XEN enabled). The trace is appened to this email. I am using the
> device tree converted from /proc/device-tree on the running system
> without Xen.

Why do you need to convert the DT from /proc/device-tree? You should just
rely on the one provided by the firmware directly.

> [3.273098] Unable to handle kernel NULL pointer dereference at virtual 
> address 0080
> [3.281254] pgd = 0946d000
> [3.284721] [0080] *pgd=bfffe003, *pud=bfffd003, 
> *pmd=
> [3.293059] Internal error: Oops: 9604 [#1] SMP
> [3.298001] Modules linked in:
> [3.301127] CPU: 81 PID: 1 Comm: swapper/0 Not tainted 4.10.0-38-generic 
> #42~16.04.1-Ubuntu
> [3.309564] Hardware name: cavium,thunder-88xx (DT)
> [3.314492] task: 80007c573a00 task.stack: 80007c578000
> [3.320485] PC is at arm_smmu_device_cfg_probe+0x300/0x770
> [3.326039] LR is at arm_smmu_device_cfg_probe+0x25c/0x770

SMMU should not be assigned to the hardware domain. Cavium has a specific
compatible for their SMMUs which is not in Xen yet.

There was an attempt to add the compatible in Xen (see [1] which I didn't
ack because the SMMU changes for Cavium were not added.

Until the SMMU driver properly support Cavium's SMMU, we should blacklist
them.

When working on getting Xen booting on rochester{0,1} (Thunder-X in Osstest),
I blacklist them with this small patch. I will clean-up it and send it on the 
ML:

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 155c952349..8b7fb0e12a 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1182,6 +1182,7 @@ static int handle_node(struct domain *d, struct 
kernel_info *kinfo,
 DT_MATCH_TYPE("memory"),
 /* The memory mapped timer is not supported by Xen. */
 DT_MATCH_COMPATIBLE("arm,armv7-timer-mem"),
+DT_MATCH_COMPATIBLE("cavium,smmu-v2"),
 { /* sentinel */ },
 };
 static const struct dt_device_match timer_matches[] __initconst =

The only other issues I found was when booting using Grub. I needed to bump the
number of banks.

By the way, if you haven't done it. I would highly recommend to upgrade to the 
latest
firmware.

Cheers,

[1] https://lists.xen.org/archives/html/xen-devel/2017-06/msg02293.html

-- 
Julien Grall

___
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel