Current-Users archive

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

Re: booting xen [was Re: serial console puzzle]



I've copied this reply to port-xen as it's entirely Xen related.

At Fri, 30 Apr 2021 20:50:10 +0200, Manuel Bouyer <bouyer%antioche.eu.org@localhost> wrote:
Subject: Re: booting xen [was Re: serial console puzzle]
> 
> On Fri, Apr 30, 2021 at 07:28:57PM +0100, Patrick Welche wrote:
> > 
> > boot.cfg contains:
> > 
> > menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load /netbsd-XEN3_
> > DOM0 console=com1 com1=57600,8n1,0x3f8;multiboot /xen-debug.gz dom0_mem=1024M
> 
> should probably be:
> menu=Boot Xen:rndseed /var/db/entropy-file;consdev com0,57600;load /netbsd-XEN3_ DOM0 console=com0;multiboot /xen-debug.gz dom0_mem=1024M console=com1 com1=57600,8n1,0x3f8
> 
> (should really be console=com0 for NetBSD, it doens't access the hardware and
> use the I/O services from the hypervisor)

On serial console machines I've been using NetBSD "console=xencons" for
ages.

This is the documented (by Xen, i.e. preferred Xen way), for serial
consoles:

	menu=Boot Xen:load /netbsd-XEN3_DOM0 -v bootdev=dk0 console=xencons;multiboot /xen bootscrub=false dom0_mem=4G console=com1,vga console_timestamps=datems dom0_max_vcpus=4 dom0_vcpus_pin=true pv-l1tf=off,domu=off vpmu=on cpuid=rdrand spec-ctrl=no-xen,l1d-flush=off guest_loglvl=all

From my Xen notes:

      - N.B.:  The Xen kernel handles serial input (and can pass it to
        the dom0 kernel) but not keyboards, thus for serial console use
        the NetBSD console should be "xencons", but when using the VGA
        console the NetBSD console _must_ be "pc".

      - Xen counts serial ports from '1', but of course NetBSD counts
        them from zero, so instead of "console=com0" as would be used
        for /netbsd alone, it must be "console=com1,vga" for /xen.  Note
        that Xen can print use multiple consoles simultaneously!  Note
        also we could tell Xen to set the port up with something like
        "com1=115200,8n1", but for now I think the BIOS does this OK on
        the Dell PE machines.

These notes are based on direct examination of the code and are
confirmed by practice on multiple machines.

I believe the main advantage of keeping Xen in firm and sole control of
the serial console is that you can still talk to Xen directly with it
for debugging, as noted by Xen as it boots:

(XEN) [2021-04-21 20:54:44.504] *** Serial input to DOM0 (type 'CTRL-a' three times to switch input)

I've not really made use of this feature though -- just tested it a
couple of times.  I don't know if Xen still peeks at serial I/O if you
let the dom0 kernel take control of the UART, but it may.  I just don't
see the point of letting the dom0 use anything but xencons, if it can.
Similarly I don't see any point to trying to set or reset the UART
parameters if the BIOS already has them set and working -- keep it
simple and keep as much of the config in the first place it's needed and
nowhere else!


For systems with VGA console only though I finally figured out it has to
be "console=pc" explicitly else I didn't see any NetBSD boot messages
(this I have not diagnosed yet -- it is on a remote machine I've never
seen physically, though I do have Dell iDRAC access to it):

	menu=Xen:load /netbsd -v bootdev=dk0 console=pc;multiboot /xen dom0_mem=2G dom0_max_vcpus=1 dom0_vcpus_pin

Of course VGA consoles suck for servers and for debugging, but sometimes
that's all you've got.


You'll note in the first example and the nodes, Xen can use two
different consoles simultaneously, so if I do go out into my machine
room (i.e. garage) I can see the Xen message on the screen too.  I
really wish NetBSD could do that.

-- 
					Greg A. Woods <gwoods%acm.org@localhost>

Kelowna, BC     +1 250 762-7675           RoboHack <woods%robohack.ca@localhost>
Planix, Inc. <woods%planix.com@localhost>     Avoncote Farms <woods%avoncote.ca@localhost>

Attachment: pgpFoD4bu_sHH.pgp
Description: OpenPGP Digital Signature



Home | Main Index | Thread Index | Old Index