Skip to content

mgras: answer byte and halfword reads of the GIO ID word - #838

Draft
jamesbraid wants to merge 1 commit into
techomancer:mainfrom
jamesbraid:pr/mgras-gio-id-narrow-reads
Draft

jamesbraid wants to merge 1 commit into
techomancer:mainfrom
jamesbraid:pr/mgras-gio-id-narrow-reads

Conversation

@jamesbraid

Copy link
Copy Markdown
Collaborator

OpenBSD 6.9's sgi kernel ran silent on a High IMPACT: the ARCS loader printed "Found SGI-IP28, setting up." and the screen never changed. The guest wasn't hung. It never attached its Impact console.

OpenBSD's gio_id() reads the slot's ID word, then a halfword at +2 and a byte at +3, and trusts the word as a 32-bit ID only if those match its low bytes. The board answered the word (0x00050190) but returned 0 for the narrow reads, so the probe rejected it. IRIX reads the ID as a word, so nothing else noticed.

Byte and halfword reads of the first word now return the ID's big-endian lanes. Whether a real board answers them that way or with a bus error is unchecked. The driver accepts either; only zero breaks it.

Tested:

  • A new unit test fails without the change (a 16-bit read at 0 gave 0x190 instead of 5).
  • install69.iso on indigo2_ip28 (256 MB, High IMPACT) now prints impact0 at gio0 addr 0x1f000000: High Impact/TRAM option card and reaches the installer prompt. The GR2 board still does.
  • IRIX 6.5.22 boots to its serial login on a High IMPACT IP28 and loads its HQ3 microcode.

Not checked: IRIX graphics on High IMPACT, and the Solid and Maximum IMPACT boards, which share the same ID.

Fixes #833

OpenBSD 6.9's sgi kernel found no console on a High IMPACT and ran
silent: the ARCS loader printed "Found SGI-IP28, setting up." and the
screen never changed (techomancer#833). The guest was not hung. It sat in the idle
loop, and the kernel's Impact console softc was still zero.

OpenBSD's gio_id() reads the slot's ID word, then a halfword at +2 and a
byte at +3, and trusts the word as a 32-bit ID only if those equal its
low bytes. The board answered the word (0x00050190) but returned 0 for
the narrow reads, so the probe went on to the REX3 and GR2 tests and
rejected the board. An MGRAS trace of the boot shows rd gio_id =
0x00050190, rd [2] = 0, rd [3] = 0, then no more board access. IRIX
reads the ID as a word, which is why nothing else noticed.

Return the ID's bytes at their big-endian lanes for byte and halfword
reads in the first word. Whether a real board answers these with the
lanes or a bus error is unchecked. The driver accepts either, and zero is
the one answer it cannot.

Tested: the same install69.iso on indigo2_ip28 (256 MB, highimpact) now
prints "impact0 at gio0 addr 0x1f000000: High Impact/TRAM option card"
and reaches the installer prompt. The GR2 board still does. IRIX 6.5.22
boots to its serial login on a highimpact IP28 and loads its HQ3
microcode. Not checked: IRIX graphics on a High IMPACT, and the Solid and
Maximum IMPACT boards, which share the same ID.

Fixes: 0b1ea38 ("mgras: an IMPACT board model in place of the ID stub")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenBSD 6.9 fails to boot early on IP28/Impact

1 participant