Bug 203319 - Invalid setting of comconsole_pcidev in loader.conf can lead to loader BTX halted
Summary: Invalid setting of comconsole_pcidev in loader.conf can lead to loader BTX ha...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Sean Bruno
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-24 20:16 UTC by Sean Bruno
Modified: 2019-01-08 19:06 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Bruno freebsd_committer 2015-09-24 20:16:58 UTC
Found through experimentation.  If one sets the following in a loader.conf in a net boot nfs environment:

console="comconsole"
comconsole_speed="115200"
comconsole_pcidev="0:22:3"

If the loader is unable to find the pcidev (like you're booting multiple devices from the same nfs boot environment), loader will panic and a BTX halted message will be displayed on the video console.

The serial port will emit one error message of "Invalid port" on a COM0 if the system has it.  This seems to indicate that comc_pcidev_handle() calling into comc_port_set() isn't gracefully handling the error.
Comment 1 Sean Bruno freebsd_committer 2017-01-03 17:43:30 UTC
John:

Do you have any thoughts here?  Or should I just close this issue out.
Comment 2 John Baldwin freebsd_committer freebsd_triage 2017-01-03 18:32:33 UTC
We probably shouldn't panic but should unwind if possible, but I haven't looked to see how hard/easy that is.
Comment 3 Sean Bruno freebsd_committer 2018-01-05 19:23:54 UTC
https://reviews.freebsd.org/D13776

Ignore misconfiguration instead of panic'ing.
Comment 4 commit-hook freebsd_committer 2018-01-05 23:51:52 UTC
A commit references this bug:

Author: sbruno
Date: Fri Jan  5 23:50:50 UTC 2018
New revision: 327606
URL: https://svnweb.freebsd.org/changeset/base/327606

Log:
  Handle misconfigured/nonexistent pcidev for comconsole instead of BTX panic.

  PR:		203319
  Reviewed by:	imp jhb
  MFC after:	2 weeks
  Sponsored by:	Limelight Networks
  Differential Revision:	https://reviews.freebsd.org/D13776

Changes:
  head/stand/i386/libi386/comconsole.c
Comment 5 commit-hook freebsd_committer 2018-02-09 17:26:35 UTC
A commit references this bug:

Author: kevans
Date: Fri Feb  9 17:25:35 UTC 2018
New revision: 329070
URL: https://svnweb.freebsd.org/changeset/base/329070

Log:
  MFC r327606: Handle misconfigured/nonexistent pcidev for comconsole instead
  of BTX panic.

  [This is effectively a direct commit to stable/11 due to path restructuring
  in head. Diffs have simply been applied to previous location]

  PR:		203319

Changes:
_U  stable/11/
  stable/11/sys/boot/i386/libi386/comconsole.c
Comment 6 Warner Losh freebsd_committer 2019-01-08 19:06:40 UTC
bug fixed in repo