From owner-freebsd-stable@FreeBSD.ORG Thu Feb 21 23:29:31 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 703E2FF9 for ; Thu, 21 Feb 2013 23:29:31 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta11.emeryville.ca.mail.comcast.net (qmta11.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:44:76:96:27:211]) by mx1.freebsd.org (Postfix) with ESMTP id 4F02066C for ; Thu, 21 Feb 2013 23:29:31 +0000 (UTC) Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta11.emeryville.ca.mail.comcast.net with comcast id 35FF1l0090x6nqcABBVWA5; Thu, 21 Feb 2013 23:29:30 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta12.emeryville.ca.mail.comcast.net with comcast id 3BVV1l00d1t3BNj8YBVVEV; Thu, 21 Feb 2013 23:29:30 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 7E9DD73A1C; Thu, 21 Feb 2013 15:29:29 -0800 (PST) Date: Thu, 21 Feb 2013 15:29:29 -0800 From: Jeremy Chadwick To: Konstantin Belousov Subject: Re: IPMI serial console Message-ID: <20130221232929.GA91708@icarus.home.lan> References: <00CC60B5-A6EB-4A3C-B8AC-1D60014DE442@gsoft.com.au> <201302211049.13863.jhb@freebsd.org> <51269ABD.2040308@gmail.com> <2AF6F8E4-A45E-4D4C-9232-FF09AD4A3641@gsoft.com.au> <5126A3A1.1030208@gmail.com> <64293C7A-038A-4EA1-B394-9E80CFCBC14F@gsoft.com.au> <20130221230001.GF2598@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130221230001.GF2598@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1361489370; bh=yA34rbeDDHLIUUDWmBY3eirrhCmR3ZzxbLY/2mpPr1k=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=ftQZ26CXF3Bw7Qd1jWgLG9PZQSnup8KFFmBoMcDAe8hmAZhWqvEQX1SvRLcJz0e09 AlWBmRZyhq4KO/81Ey5AhOUhudOKvE8XChook+TUDAm1XoDOyA14J07N8WrF8lo5AA EtKZt14YXoCOcfdIk+UeJ7WzRzJnfYg5HthVLvw6eCoqtapWhl4sLdqkzhL3C5HlA3 6eUN1sRYB/izFgIyqht2E4zoJYhf1dMnTo11p1VYwGmc8//O30kaHk6GFVCQaBofGJ KOBs1hht6dSYa6qCQ8/zk0shi33UTGfGIF6T6PFDRpbiwzLBMn3etXJli8F4jE6f+z HPUVgwGsFJ2XA== Cc: freebsd-stable@freebsd.org, Navdeep Parhar , John Baldwin X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Feb 2013 23:29:31 -0000 On Fri, Feb 22, 2013 at 01:00:01AM +0200, Konstantin Belousov wrote: > On Fri, Feb 22, 2013 at 09:18:51AM +1030, Daniel O'Connor wrote: > > > > On 22/02/2013, at 9:15, Navdeep Parhar wrote: > > >> uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 on acpi0 > > >> uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0 > > >> uart2: <16550 or compatible> port 0x3e8-0x3ef irq 5 flags 0x30 on acpi0 > > >> > > >> The loader talks on the serial console fine, it's the kernel that doesn't use it which is the problem. > > It might be not the serial port, to which the loader talks. The supermicro > boards I dealt with, have a feature of VGA text mode redirection to the > serial port. This is how bios redirection usually works. As I understand it, the way this works is that the BIOS itself has code that sets the INT 0x10 (BIOS) vector to point to some of its own code, which then draws to the classic VGA framebuffer (segment 0xA000 if I remember right) as well as output characters to the serial port whenever something uses INT 0x10 ah=0x13 or ah=0x0e (or something along these lines -- pardon me if I have the function numbers wrong, it's been quite some time). Messing with those vectors, and/or touching some other things (such as initialising serial port bits in a certain way) can cause this functionality to stop working right then and there -- the assumption is that whatever just touched it did so Correctly(tm) and has set up its own code/vectors to handle the serial + VGA output. The FreeBSD bootstraps have had some changes made to them in the past 5-6 years (I can try to dig up the commits if you want, there were many) that "tweak" some of this initialisation, in attempt to minimise the amount of adjustments being made to certain bits/things (specifically to keep BIOS-level VGA-to-serial redirection from getting stomped on). I believe both boot0 and boot2/loader have been tweaked in this regard. The kernel, on the other hand, may not be doing the Right Thing(tm) once control is handed off to it. The kernel does have some knowledge of the hand-offs between boot2/loader and itself, as you know, but it sounds to me like the kernel may be tweaking something that upsets a working IPMI serial redirection. IPMI makes this situation even weirder, since it introduces its own separate serial port and other nonsense. This is one of many reasons I always avoided IPMI -- it's one of those "sounds great" inventions, but in practise is a fucking nightmare. When it works (reliably) it's great, otherwise prepare to pull your hair out. For example, the folks I knew at Yahoo in Sunnyvale who had to deal with IPMI serial console across hundreds of systems had to actually bring Supermicro engineers *to their campus* to show them the issues + get fixes (in the IPMI firmware itself). I'm not picking on Supermicro BTW, just to be clear. > You could look at some bios knob which controls the point where the > said redirection is stopped. It should be like 'after the OS takes > the control', and not 'forever'. For BIOS, the loader is OS. That would be BIOS-level stuff, not IPMI-level stuff. There's definitely a difference. What Daniel is effectively wanting is for the FreeBSD bootstraps to use serial port I/O address 0x3e8, IRQ 5, and initialise a serial port speed of 115200 -- and the kernel to use that too. He says that the bootstraps show text output from boot0 (assuming he's using -Dh -S115200 in /boot.config), and from boot2/loader too. It's once the kernel starts that he sees no output. Not until getty(8) is loaded via ttys(5) does he get output (he gets a login: prompt). It's as if the kernel is pretending there's no serial console. The reason I've advocated use of -Sxxx in /boot.config for years is because it gets around whatever idiocy there is in the FreeBSD kernel pertaining to serial port speed limitation. Possibly those boot2 changes I mentioned above have since dealt with this, but the situation used to be that without -Sxxx in /boot.config, you had to set BOOT_COMCONSOLE_SPEED=115200 in /etc/make.conf (or during buildworld and buildkernel) to achieve a serial port speed >9600bps -- otherwise FreeBSD would limit/cap the serial speed to 9600bps and you wouldn't see any output (even once getty(8) started -- yet switching the serial connection to 9600bps instantly made things work). Like I said, possibly this has been dealt with. Sorry for my rambling Email, but there's a lot of history and crap contained here (almost 10 years worth) that's hard to cover tersely. For Daniel: have you tried a verbose boot, to see if you get *anything* prior to the initial "Copyright" line? (Keep a raw I/O dump too, to see if ANY characters are received, not just printable ones -- that can sometimes help determine if some code is initialising something wrong) -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |