From nobody Thu Oct 27 15:13:04 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Myq1c1Fkyz4gHGs for ; Thu, 27 Oct 2022 15:13:08 +0000 (UTC) (envelope-from agh@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mx1.riseup.net", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Myq1b2CKgz3cjt; Thu, 27 Oct 2022 15:13:07 +0000 (UTC) (envelope-from agh@riseup.net) Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4Myq1Y0PS7zDrCg; Thu, 27 Oct 2022 15:13:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1666883585; bh=TmXbVl3e06waUvza25l9l6bkuJ06QqK1XQtigpsqgT0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kkLoGMIL4q1YXvXB+r1NkLiV1EluX9tWFDCapjMTlyrRkmi1gWOLncB59q/jrgUEB oiBmJoUg/qg3HWNw9Y7/AwxLKNK7qL2YvUi/E/FXQWJNR4jBdHEbPhacHMVyKPiBeQ eGC0jxByMLz3DR20frJiN9U/Vqv9O7UZSC2i3z0k= X-Riseup-User-ID: D7D3EA2E3BE4905ED36A1D1DED9511C5C9F8BD4FD61299BBFB3BE690B95A2F07 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4Myq1X68FVz1yPb; Thu, 27 Oct 2022 15:13:04 +0000 (UTC) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 Date: Thu, 27 Oct 2022 15:13:04 +0000 From: Alastair Hogge To: Matteo Riondato Cc: freebsd-current@freebsd.org Subject: Re: ns8250: UART FCR is broken In-Reply-To: <20221027125758.nexluqtw6n2tgklq@ubertino.local> References: <20221027125758.nexluqtw6n2tgklq@ubertino.local> Message-ID: <9e39e3a2d2488815736c482de3f8b411@riseup.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4Myq1b2CKgz3cjt X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=riseup.net header.s=squak header.b=kkLoGMIL; dmarc=pass (policy=none) header.from=riseup.net; spf=pass (mx1.freebsd.org: domain of agh@riseup.net designates 198.252.153.129 as permitted sender) smtp.mailfrom=agh@riseup.net X-Spamd-Result: default: False [-4.20 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-0.999]; DMARC_POLICY_ALLOW(-0.50)[riseup.net,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[riseup.net:s=squak]; MIME_GOOD(-0.10)[text/plain]; RCVD_IN_DNSWL_LOW(-0.10)[198.252.153.129:from]; RWL_MAILSPIKE_GOOD(-0.10)[198.252.153.129:from]; DWL_DNSWL_NONE(0.00)[riseup.net:dkim]; FROM_EQ_ENVFROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-current@freebsd.org]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; ASN(0.00)[asn:16652, ipnet:198.252.153.0/24, country:US]; TO_MATCH_ENVRCPT_ALL(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[riseup.net:+]; RCVD_COUNT_THREE(0.00)[3]; RCVD_VIA_SMTP_AUTH(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On 2022-10-27 20:57, Matteo Riondato wrote: > On 2022-10-26 at 17:15 EDT, Colin Percival wrote: > >>On 10/26/22 13:48, Ed Maste wrote: >>>On Mon, 24 Oct 2022 at 22:11, void wrote: >>>>this started appearing in dmesg >>>> >>>>ns8250: UART FCR is broken >>>>ns8250: UART FCR is broken >>> >>>This message was added as part of Colin's work to support FreeBSD in the Firecracker VMM https://cgit.freebsd.org/src/commit/?id=c4b68e7e53bb352be3fa16995b99764c03097e66 >>> >>>In this case it indicates that bhyve has the same bug/missing functionality as Firecracker -- it doesn't implement the FCR_XMT_RST or FCR_RCV_RST bits. You can safely ignore the message, and it will disappear once someone adds the required support to bhyve. We should probably also have the kernel emit the message only once. I've CC'd Colin for comment. >> >>Indeed, looking at usr.sbin/bhyve/uart_emul.c it looks like FCR_XMT_RST is not emulated. This is different from Firecracker, which doesn't emulate either anything from the FCR and where I was seeing the receive side not being flushed, but I'm glad my warning was able to flag a bug. :-) >> >>If "void" is comfortable with kernel hacking, it would be great to confirm >that the warning is indeed coming from the transmit side not being flushed; a printf("drain = %d\n", drain); would be sufficient. >> >>And yes, only emitting this warning once per device (or once per boot?) would probably be good. > > I got the same message on real hardware, no virtualization involved as > either host or guest. Is that expected at all? > > Relevant lines from /var/run/dmesg.boot: > > ns8250: UART FCR is broken > ns8250: UART FCR is broken > uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 > uart0: console (115200,n,8,1) > ns8250: UART FCR is broken > ns8250: UART FCR is broken > uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0 > ns8250: UART FCR is broken On 3 × bare metal 14-CURRENT hosts at 017367c1146a69baca6a1a0bea10b0cb02c72d85: $ dmesg -a | egrep '(ns8250|uart)' ns8250: UART FCR is broken ns8250: UART FCR is broken uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 ns8250: UART FCR is broken