Skip to content
HUBrisOrigami project journal
Color Schemes
Color Scheme Browser
Desktop SchemesBase · gamma 1.7
Monitor gamma
Chrome type · pointer

/usr/lib/X11/schemes · x_eoe_6530m

IRIS InSight: HUBris Library

HUBris Library / Engineering Notes / Two Silences on the Origin 300: One Waiting, One Stuckpage 55 of 97

NavigatorHUBris Library
Engineering Notespage 55 of 97

Engineering Notes Origin 300

Two Silences on the Origin 300: One Waiting, One Stuck

Two stock-firmware silences on the Origin 300: one a wait for a keystroke, the other a real hang in the model from a late presence publication.

The stock Origin 300 firmware went quiet twice in the same week, and both times the quiet looked like a hang. The first was not one: the firmware was waiting for a keystroke. The second was a real hang in our model, a processor running off the end of a half-written copy of the firmware. In neither case was the thing we were staring at the thing that was wrong, and in the second we were wrong three times.

Everything here is a run of the stock PROM, version 6.210, on our emulated Origin 300. It shows what the firmware did on our machine and says nothing about the real board.

The menu that was waiting for Return

With the diagnostics passing, the firmware prints its maintenance menu. Typing 1 starts the system. Here is the menu in a later, working capture of the boot:

1) Start System
2) Install System Software
3) Run Diagnostics
4) Recover System
5) Enter Command Monitor

Option? 1

                           Starting up the system...

Before the fix, nothing followed Option? 1, not even after fourteen minutes. Two passes at it had found a processor spinning in firmware code, claiming a bit in a shared lock word, and had read that as a handshake that never completed. The spinning was real, but pressing Return released the run without touching that loop. The disk was the other suspect, and a trace of every SCSI command and bridge DMA translation showed none during the silence, so the wait was upstream of the disk.

What the firmware was waiting for was Return. The menu reads a whole line, and Option? 1 was the half of that line the operator could not see, because the echo of the typed character never reached the console.

On the serial link between the firmware and the system controller, console output travels as small framed packets. The echo of 1 is one:

7e 44 31 4b 0e 7e

A flag byte, a header byte (0x44, console output), the character itself (0x31), two check bytes and a closing flag. The firmware echoes every keystroke this way, and pads and breaks lines the same way, one character per frame. The check is a CRC-16 with initial value 0xffff and polynomial 0x8408; run over the header, the character and the check bytes, it comes out at the residue 0xf0b8 that a correct frame gives, here and for a carriage-return frame from the same trace. The frames were valid.

Our controller model discarded them. Its frame parser refused any body shorter than five bytes and threw the frame away before it even computed the check, with no log line. That limit suits a request, which carries a destination, and is wrong for console output, which does not. So every echo, line break and padding space the firmware sent was lost. Our controller datasheet’s receive-tolerance table has the real reader delivering any frame of three bytes or more whose check passes.

Sending Return to a stalled run after 25 minutes, and to another after 32, started the system within seconds; the login prompt followed about a minute and a half after Return. We lowered the minimum to three bytes, a header and its check, while a request shorter than a header and destination is still refused where requests are handled. The register-contract test sends a one-character console frame and expects it to arrive; it fails on the old parser the way the guest did.

The console up to the menu grew from 1,834 bytes to 3,443. The extra lines were the Ethernet PHY register warnings, the SCSI bus walk that finds the disk, and a long tail of lone newlines. The firmware had been telling us about the machine the whole time.

What we took from it is narrow. A silent stall does not mean the machine stopped. It can mean the machine is waiting for an input that only a working output path would have asked for.

The copy that never finished

The second silence is at a different step. The firmware prints Copying PROM code to memory ..............., and sometimes never prints DONE. The processors are alive and spinning. It happens on two- and four-processor Origin 300 boots, roughly one in five on a loaded host.

First explanation: a register. The location the processor kept polling was the obvious suspect. Checked against the register’s contract, it is a plain storage word in the memory controller that the firmware uses as lock bits, and our model stores it faithfully.

Second explanation: the host scheduler, at the lock. On 17 September 2026 we put the stall down to a scheduling race on that lock word. Each processor runs on its own host thread, and a busy host can leave one thread unscheduled while the other loops on claim, check and release. A lock bit stays set and the boot stops. That is coherent, and we added a bounded fairness hold at those two registers. The stalls continued.

Third explanation: the first barrier. A week later we ran ten-boot campaigns on two QEMU revisions, at two and four processors, on a host at one-minute load 83 to 139. Current trunk stalled 1 of 10 at four processors and 2 of 10 at two; a branch 199 commits older stalled 3 of 10 and 4 of 10. Every stall had the same first exception, in the run’s interrupt log: a processor fetching an instruction at 0xc00000001fe00000, the end of the firmware’s 2 MiB mapped window, with its exception program counter still zero. Boots that passed took no exception at all. The lock word everyone was waiting on was orphaned by that fault. It was an effect.

The processor was running zeros. The firmware copies itself from flash into RAM, then switches each processor’s address translation to the RAM copy. A processor that switches before the boot master has finished copying executes empty memory until it runs off the end of the window. The faulting processors were switching one barrier early, and had been since the first barrier. The reason is a bitmask. Right after reset, the lowest processor on each of the node’s two processor interfaces writes the interface’s fitted processors, as bits in a shared scratch register. Every barrier and pair-master decision afterwards reads those bits and skips the wait for any processor whose bit is clear. On hardware the publisher presumably stores them long before any peer reads, because all of them run continuously from the same reset edge. [inference] In the emulator the publisher’s host thread can be unscheduled across that window. Its peers read the bits as clear, believe it absent and sail through their first barrier without it.

The firmware’s four-phase handshake carries no barrier number, so nothing notices. The two interfaces pair off their barriers one apart, harmlessly, for the whole boot, until the one barrier where timing matters: the one the master enters after copying the firmware to RAM. The peers, a barrier ahead, leave it while the copy is half made. A per-processor timeline of a stalled boot shows the second interface’s pair completing 37 barriers to the other pair’s 36 at the moment it switched, with the skew present from barrier one. A clean boot shows 37 and 37.

The host scheduler was in the second explanation too. What differed was where: our hold sat at the symptom, a lock the stalled processors happened to be waiting on at the end, while the cause was a thread that was late at the very first barrier.

Our fix joins the processors on that publication. A publisher that has published is parked at its next hub-lock release until the other interface has published too, bounded by a two-second timeout, and the model never changes a value the guest reads. The register test runs four processors with the second interface’s publisher half a second late and requires every processor’s first read of the scratch register to show all four bits. With the join disabled it fails. After a campaign of 60 boots to the maintenance menu at two host loads, with no copy-phase stall, we removed the earlier fairness holds as having no stall left of their own.

What this does not establish

The join is an approximation, and we have recorded it as one. It stands in for what a shared reset line gives real processors for free, and nothing here measures real reset-edge timing. The campaign numbers are small samples taken on a heavily loaded host, so the rates mean “common” and “much rarer” and not much more. Our first version of the join parked the wrong processors and cost a processor in the firmware’s early liveness check, which is how its final shape was found. We later added bounded parks of the same kind for the interfaces’ partner processors and for the pair liveness handshake, and a residual stall remains an open known issue. The join itself is a same-edge reset approximation: it makes the processors start together in a way real hardware gets from a shared reset line. The firmware ahead of all this, and the earlier reset-edge hold, are in What the Origin 300 Firmware Insisted On.