[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Having a DOM-U guest with 1:1 mapping in the second stage MMU.


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Andrei Cherechesu <andrei.cherechesu@xxxxxxx>
  • Date: Wed, 1 Apr 2020 10:14:14 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SmoWeB1fzXKECWW1aepoOQ9+RXJTKTh1gm2beSo16o8=; b=RjvVVzjmRWkgubTJgTk8+Il9lvx1R+1+fbPRg18r77gy3EyHGFbkk7kHnSrjKktsll0aJctLvIDqntnIPUlab42ARpFMAd3knFQhZHH6fRA0CjFG/A23UbBNLbjADUD4BNt1SO0lQ+YC82oXF646VeRjXcwXsD6oeebXbESRRw34/pChuE9UFAgkw9cFvpF7Wm8TRbVw3cV2oElsu9kPlDHN19oXFqIMy7410sHI0fA1loobNNgzb6b5k+MGLLeglZrCtfk48r+GeURF6Axn1bnfq3Jox6GNQH+Cw0YBn0B4e9orr0oy3jpHP3e0ADAlHCA3RX7aHmeeMOnHE6W75A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UbJGWT0qwPSmnsvSdUE8H4EPX6R5FEPnxljgFWinDLM6wPchAb8siFEHSydkNoro9S73ttBrje5zqh2ibEDLKC7NmG8WBzHgGC0vkT8HV56yE0z+AVB0wIx0AX8znSwWytZPKogYiuCAHemtgb0CwA66gRTImrNVNMtF3OE0vGwkH+aktLD+SF8W7Of3r/7Tgiz2DIpenhg8kFTtpSpjppZV0PZSWooXNCqZAvxB938oQ8RE5l+TrBBipY0GBe05krZbRsfX2mjhVeCFpkLw/faKADXHsDga1Eso7Ci5yqnac3CbIHdgchTemC9KXGQa3v1Edp/S8qrfXuxm5zjGfg==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=andrei.cherechesu@xxxxxxx;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Wed, 01 Apr 2020 10:14:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AdYIDkP0tQYlxDAYTOaajGQHdLFSyw==
  • Thread-topic: [Xen-devel] Having a DOM-U guest with 1:1 mapping in the second stage MMU.

Hi,

And thanks for your help.

> Great to hear!
> 
> 
> > However, I am encountering another problem now: in Dom0 and in 
> > dom0less-booted DomUs, I cannot use /dev/hvc0.
> 
> For dom0less-booted DomUs it is normal because they don't get a PV console,
> they get an emulated PL011 UART instead.  Make sure to have a "vpl011" tag in
> device tree to enable it (ImageBuilder generates it by default.) The device
> name is usually ttyAMA0.

Ok, understood. I had my vpl011 tag in the dom0less DomUs nodes in the DT,
so that's not the problem. I am able to see DomUs boot prompt when booting
dom0less. The problem is after DomU boots, that I am not able to switch to
its console from Dom0, in order to be able to log in.

> > Even though I'm specifying "console=hvc0" in dom0-bootargs, when dom0 
> > finishes booting, it looks like I cannot use the getty spawned on /dev/hvc0.
> >
> > This is the end of the boot log:
> > [    2.947845] random: rngd: uninitialized urandom read (4 bytes read)
> > [    2.958415] random: rngd: uninitialized urandom read (4 bytes read)
> > [    2.965452] random: rngd: uninitialized urandom read (2500 bytes read)
> > .
> > [    2.972410] random: crng init done
> > Starting OpenBSD Secure Shell server: sshd done.
> > Starting /usr/sbin/xenstored...
> > Setting domain 0 name, domid and JSON config...
> > Done setting up Dom0
> > Starting xenconsoled...
> > Starting QEMU as disk backend for dom0 Starting domain watchdog 
> > daemon: xenwatchdogd startup
> >
> > [done]
> >
> > Auto Linux BSP 1.0 s32g274aevb /dev/hvc0
> >
> > s32g274aevb login:
> > Auto Linux BSP 1.0 s32g274aevb /dev/ttyLF0
> >
> > s32g274aevb login:
> >
> > ----- END -----
> >
> > It seems that the getty spawned on /dev/ttyLF0 overwrites the one 
> > spawned on /dev/hvc0. Which I do not understand, since Dom0 should not 
> > have access (?) directly to ttyLF0 (the serial console device on our 
> > boards). If I remove the line which spawns the getty on ttyLF0 from 
> > /etc/inittab, the system hangs when waiting for the username, and it does 
> > not let me type in any characters. For the record, hvc0 is added to 
> > /etc/securetty.
> >
> > In a system where I boot DomU via xl from Dom0, I can switch to its 
> > console with xl console, and hvc0 works there.
> >
> > The problem that comes with this is that I can not use the CTRL-AAA 
> > command to switch between Dom0 console and DomU console in a dom0less 
> > case, and I cannot therefore test that the passthrough works. But at least 
> > Dom0 does not have an entry for it under /dev, anymore, and DomU boot 
> > prompt tells that the driver has been registered.
> 
> It looks like there is some kind of interference between the dom0 ttyLF0 
> driver and the Xen serial driver.
> 
> Is your Xen UART driver marking the device as "used by Xen"? See for instance 
> the pl011 driver, at the end of
> xen/drivers/char/pl011.c:pl011_dt_uart_init:
> 
>     dt_device_set_used_by(dev, DOMID_XEN);
> 
> Devices that are marked as "used by Xen" are not exposed to dom0, so you 
> shouldn't see the ttyLF0 device come up in Linux at all.

I've checked my Xen UART Driver and that call is there. So ttyLF0 should be
marked for Xen to use.

I don't have any ideas why this happens.

I've attached the driver [0], if you want to take a look.

[0] https://pastebin.com/PuXi50H0

Thanks,
Andrei Cherechesu,
NXP Semiconductors




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.