<!--
.. title: I Blamed the Firmware: FreeBSD and NetBSD Boot Under KVM on the SpacemiT K3
.. slug: i-blamed-the-firmware-freebsd-under-kvm-spacemit-k3
.. date: 2026-11-30 00:00:00 UTC-06:00
.. tags: spacemit, k3, pico-itx, spacemit x100, risc v, riscv64, rva23, kvm, virtualization, hypervisor extension, qemu, freebsd, netbsd, openbsd, bsd, linux kernel, debugging, colocation, hosting, business
.. category: Hardware
.. description: In September I wrote that the SpacemiT K3's firmware had switched off a processor feature the BSDs need, and that no BSD could boot on the board, virtualized or not, because that was one line of configuration nobody outside SpacemiT could change. That was wrong. The measurement was right and the blame was not: both real faults were in Linux itself. FreeBSD now reaches a login prompt on this board in 32 seconds and NetBSD in 12. Here is how two crash dumps found it, why my first fix was never running, and what it does to the rental arithmetic I built on the wrong premise.
.. type: text
-->

<div class="audio-widget">
<div class="audio-widget-header">
<span class="audio-widget-icon">🎧</span>
<span class="audio-widget-label">Listen to this article</span>
</div>
<audio controls preload="metadata">
<source src="/i-blamed-the-firmware-freebsd-under-kvm-spacemit-k3_tts.mp3" type="audio/mpeg">
</audio>
<div class="audio-widget-footer">51 min · AI-generated narration</div>
</div>

In [September's follow-up on this board](/posts/spacemit-k3-ubuntu-kvm-follow-up.html) I wrote that the SpacemiT K3's firmware had switched off two of the processor's three counters, that nothing running above the firmware could get them back, and that FreeBSD, NetBSD and OpenBSD therefore could not boot on this board at all. In [October's piece on renting these boards](/posts/the-1175-dollar-option-risc-v-colo-revisited.html) I turned that into a business claim: one line of firmware configuration, and nobody outside SpacemiT can change it.

FreeBSD now boots on this board as a virtual machine. It reaches a login prompt in 32 seconds and nothing dies on the way. So does NetBSD, in 12 seconds, on a stock build I had wrongly recorded as impossible to test. I did not flash any firmware, and SpacemiT did not ship anything.

I am not going back to edit those posts. They are a snapshot of what I believed with the evidence I had, and quietly rewriting them would hide the useful part, which is how a correct measurement got blamed on the wrong thing and then went on to price a product.

The short version: there were two faults, both of them in Linux rather than in the board, and they were in different places for different reasons. A third problem had nothing to do with counters at all and was quietly corrupting disk reads, which is what hid OpenBSD's real behavior. None of the three was visible from where I was standing in September.

## Three registers, not one

A short piece of background, because the entire correction turns on it and the September piece got it muddled.

RISC-V processors keep three counters that software can read: one that ticks with real time, one that counts clock cycles, and one that counts instructions executed. They are useful and they are also a little dangerous, so the architecture lets each layer of software decide how much of them the layer below it may see. Each layer has its own permission register, and each register controls only the layer directly beneath it.

| Permission register | Written by | Controls what this can read |
|---|---|---|
| `mcounteren` | the board's firmware | the operating system kernel |
| `scounteren` | the operating system kernel | ordinary programs |
| `hcounteren` | the hypervisor | a guest operating system |

Three registers, three different owners. The firmware owns one of them. Linux owns the other two.

That is the whole mistake in one table. In September I ran a test as an ordinary program, found two of the three counters unreadable, and blamed the firmware's register. But an ordinary program sits at the bottom of that chain. When it is refused, the only thing it has learned is that the *last* permission in the chain is closed. It has learned nothing about who closed it.

## The measurement was right. The blame was wrong.

Here is the September test, re-run today on the same board. A small program tries to read each of the three counters, catches the failures, and times the successes.

| Counter | Ordinary program on the K3 | Cost |
|---|---|---|
| real time | works | 7.8 billionths of a second per read |
| cycles | illegal instruction | — |
| instructions | illegal instruction | — |

Exactly what I published in September, and still true today. The table was never the problem.

Two things should have stopped me writing "firmware" underneath it.

The first is that 7.8 nanoseconds. That is the speed of a real hardware counter being read directly. When firmware has to step in and fake a counter for you, the read costs a thousand times that. So at least one counter was genuinely present, genuinely wired up, and genuinely permitted, which is a strange thing to find on a chip whose firmware is supposedly withholding counters.

The second is that I never checked the layer in between. If the firmware really had switched the cycle counter off, then Linux could not count cycles either, because the firmware's register is the one standing over Linux. Linux counts cycles perfectly well:

```console
$ sudo perf stat -e cycles,instructions -x, true
17544574,,cycles,8048626,100.00,,
9038553,,instructions,8048626,100.00,,
```

Seventeen million cycles, nine million instructions, both real. Linux has the counters. Whatever is refusing my little test program is therefore above the firmware, which means it is Linux, which means it was never SpacemiT's to fix. Their published firmware source agrees with the measurement, and hands all three counters to the operating system.

So why does Linux say no? Because that is just how Linux behaves on this architecture, everywhere, not something peculiar to this board. Linux keeps the cycle and instruction counters closed to ordinary programs and opens them only for a program that has asked the kernel for performance measurements first. On this board that door never opens at all. The relevant setting is already switched on:

```console
$ cat /proc/sys/kernel/perf_user_access
1
```

and it changes nothing. I wrote a second test that asks the kernel for a cycle-counter measurement in the proper way and then immediately retries the direct read, in the same program, on the same core:

```
before asking the kernel for a cycle counter : refused
after  asking the kernel for a cycle counter : refused
```

Still shut, and for a mundane reason: this kernel reads the performance counters by calling down into firmware rather than by reading them directly, so there is nothing for it to hand to a program in the first place. That is a decision made in the Linux configuration, several layers above anything SpacemiT ships.

Which also retires the comparison I leaned on hardest in September. I put the K3 next to a Pine64 Star64 on the same bench, found the Star64 would let an ordinary program read the cycle counter and the K3 would not, and called that "the whole difference, and it is a decision made in M-mode firmware." Two boards differing in what they let ordinary programs read tells you their *kernels* are configured differently. It says nothing about their firmware. I have not retested the Star64 for this piece, so I am not going to swap one confident story for another about a board I have not measured. The honest position is that the conclusion I drew from that comparison does not follow from it.

## What the crash dumps said

Being wrong in September had one useful consequence: the fix I wrote back then was necessary but not sufficient, which is a good place to start.

When Linux runs a virtual machine it sets the hypervisor's permission register, and it sets it to allow the clock and nothing else. A guest operating system that wants to read the cycle counter is refused. Opening that up took FreeBSD from a crash about one second into boot to mounting its disk and running its startup scripts. That is the guest's *kernel* satisfied.

Then the guest got all the way to a login prompt and started losing programs instead. About twenty of them per boot, each killed for executing an illegal instruction. The pattern was the interesting part. These died:

`dd`, `find`, `ps`, `date`, `logger`, `sshd`, `devd`, `newsyslog`, `utx`, `cron`

and these ran normally:

`sh`, `mount`, `ifconfig`, `sysctl`, `hostname`, `ldconfig`

I spent far too long guessing what the first list had in common. Did they use the vector instructions? The cache-management instructions? Was the virtual machine being told the chip had features it did not really have? Was the processor's instruction cache going stale when the guest moved between cores? I tested several of those ideas and every one of them was wrong, and I will come back to how they were wrong, because that turned out to matter more than the fact that they were.

What actually settled it was reading the bodies. FreeBSD had written a crash dump for each dead program onto its own disk, and Linux can mount a FreeBSD disk read-only, which is all forensics needs. So I attached the virtual machine's disk to the host, mounted it read-only, and pulled the dumps out.

A crash dump records two things I needed. The first is the exact address the processor was executing at the instant the program died. The second is a map of which file each region of memory had been loaded from. A short script reads the first, looks it up in the second, and reports which file the program died inside and how far into it.

Two unrelated victims, `dd` and `ps`:

| Dump | Died at address | Which is |
|---|---|---|
| `dd` | `0x3283fc268` | `libsys.so.7`, 82,536 bytes in |
| `ps` | `0x11164c3268` | `libsys.so.7`, 82,536 bytes in |

The absolute addresses differ because the system loads libraries at a different random address every time, as a security measure. Strip that away and both programs died at the identical spot in the identical library. Looking at the instruction there:

```asm
rdtime  a2        <-- died here
```

`rdtime` means "read the clock". The surrounding code is FreeBSD's shortcut for finding out what time it is without the expense of a full call into the kernel, and `libsys.so.7` is a core library that every program on the system uses.

So the first list is not programs that use exotic instructions. It is programs that ask what time it is. `date` obviously. `ps` for how long each process has been running, `dd` for its transfer-rate summary, and `cron`, `newsyslog`, `sshd` and `logger` for timestamps and timeouts. The shell running the startup scripts mostly does not need the time, which is why the boot got as far as it did. One instruction, one library, every caller.

For a program inside a virtual machine to read the clock, two permissions have to be open: the hypervisor's, and the guest kernel's own. I had already opened the hypervisor's. So the question was what the guest kernel had in its own permission register, and the answer is that FreeBSD never writes to it at all. I searched the entire FreeBSD kernel for any reference to that register and found none, while the neighboring registers it does use appear throughout. FreeBSD simply inherits whatever it was handed on the assumption that firmware left something sensible there.

On real hardware, something sensible is exactly what firmware leaves.

## What a guest actually inherits

At this point I had a theory with a hole in it. I had already written a patch to set that permission for the guest, and it had changed nothing at all. Setting it to allow the clock, setting it to allow everything, setting it to allow nothing: twenty-odd dead programs every time, identical. A theory that survives its own fix is usually a theory about the wrong thing, so I stopped reasoning and went and measured.

The instrument is 536 bytes of hand-written assembly. It is not an operating system and does not pretend to be one. The virtual machine loads it as though it were the guest kernel, it runs before any bootloader or operating system exists, it reads the permission register, prints the value, and stops. Nothing can have modified anything before it looks, which is the entire point of it.

| How the guest is run | Permission the guest inherits |
|---|---|
| Software emulation, with firmware inside the guest | clock allowed |
| Hardware virtualization, my setting = clock | nothing allowed |
| Hardware virtualization, my setting = everything | nothing allowed |
| Hardware virtualization, my setting = nothing | nothing allowed |

The first row is the control, and it is the configuration in which FreeBSD has always worked. QEMU can run a guest two ways: on the real processor, or by simulating a processor entirely in software. The software simulation simulates the firmware too, so a complete firmware runs inside the guest and leaves the clock permission open, exactly as it would on a real machine. That one permission is why emulated BSD guests could tell the time and hardware-accelerated ones could not.

It also explains, in hindsight, something I recorded in September without understanding. The BSDs booted under software emulation, so I concluded the disk images were fine and the board was broken. The images were fine. The board was fine too. The difference was that one of those two configurations had firmware in it and the other did not.

Hardware virtualization has no firmware inside the guest, by design: the host's firmware owns that privilege level and will not share it. So nothing initialises the register, and the hypervisor hands the guest a blank one.

The other three rows are the hole in my theory. My setting had no effect whatsoever, which means it was never reaching the guest.

## The fix that was never running

The reason is worth writing down, because it has nothing to do with RISC-V and will catch anyone patching a hypervisor.

I had set the value in the function that builds a virtual CPU's initial state, which is the obvious place. But after that function runs, and before the guest executes a single instruction, QEMU copies its own idea of every register into the virtual CPU. It has just created a fresh virtual processor, so its idea of that permission register is zero, and it overwrites mine every time.

My fix was dead code that looked exactly like a working fix. The setting it was attached to responded to being changed by doing nothing, which is the most expensive kind of wrong, because the obvious interpretation is that the theory is wrong rather than the plumbing.

The repair is to apply the value later: not when the virtual CPU is built, but the first time it is actually started, after QEMU has finished setting up and before the guest runs. I also only apply it if nothing else has set it, so a deliberate choice still wins.

Re-running the assembly probe with that in place:

| My setting | Permission the guest inherits |
|---|---|
| clock | clock |
| everything | everything |
| nothing | nothing |

It does what it says now, and set to "clock" a hardware-accelerated guest inherits exactly what an emulated one does.

## The disk bug that hid OpenBSD

One more thing was wrong, and it had been wrong the whole time, with no connection to counters at all.

In September I noted that BSD guests needed the older style of virtual disk rather than the PCI one, because NetBSD would not attach the PCI version. That part is still true, and I come back to it below. But for FreeBSD under hardware virtualization, the older style corrupts reads on this board. The symptoms send you looking at filesystems: FreeBSD announcing that its partition table was damaged, then refusing to run the first program on the disk, which I wrote up in September as a separate unexplained fault. Switching to the PCI disk makes both vanish.

It also explains OpenBSD, which I had recorded as dying silently the moment the kernel started. OpenBSD's bootloader reads the kernel off the disk itself, so with reads coming back corrupted it never had a working kernel to start. On a PCI disk its bootloader now runs to completion.

## Which fix did what

Both changes are load-bearing and neither substitutes for the other. FreeBSD on a PCI disk, four minutes allowed, counting programs killed for illegal instructions:

| Guest kernel may read | Guest programs may read | Result |
|---|---|---|
| everything | clock | login prompt, nothing died, 32 s |
| everything | everything | login prompt, nothing died, 32 s |
| everything | nothing | boots, then 27 programs killed |
| clock only | clock | kernel crash 13 s in |

The bottom two rows are the two faults in isolation. One permission carries the guest kernel's cycle counter; the other carries the clock for ordinary programs inside the guest. Two registers, two layers, two symptoms that look nothing like each other, and in September I had a single explanation for both of them and it named a third register belonging to somebody else.

## NetBSD, which I said I could not test

I wrote that paragraph about NetBSD and then went looking for an image, so I could say it with a straight face. There was one on the board the whole time. 1.8 gigabytes of it, in a directory I made in September, beside two launch scripts I wrote myself. One of those scripts carries a comment, in my own handwriting, explaining that NetBSD trips over the cycle counter because the board's firmware does not permit it. The wrong explanation, left at the scene, by me.

So here is the test I had recorded as impossible.

It boots. NetBSD reaches a login prompt under hardware virtualization on this board in a little under 13 seconds, four runs out of four, and carries on into a complete multi-user system: remote login, mail, clock sync and the scheduler all start on their own. I logged in as root and got a shell, and the first thing I asked it was what it was:

```
riscv64# uname -a
NetBSD riscv64 11.99.8 NetBSD 11.99.8 (GENERIC64) #0: Sat Sep 12 12:47:59 UTC 2026
  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/riscv/compile/GENERIC64 riscv
```

That answer matters more than the fact that it answered at all. `mkrepro.NetBSD.org` is the NetBSD project's own build machine and `GENERIC64` is the standard configuration file, so this is not a kernel I compiled, patched or configured. It is the build anybody downloads, booting unmodified. Nothing of mine is inside that guest. Everything of mine is underneath it.

And it is a working machine rather than a prompt on a corpse: it mounts its disk read-write, reports its load average, lists its running processes, and compiles and runs C, which is how the probe further down this section got built.

It is also a better witness than FreeBSD, because it fails earlier and says more on the way down. With the hypervisor's permission left at the value Linux ships, NetBSD's kernel dies before it even prints its own copyright banner, immediately after bringing up its second processor:

```
[   1.0000000] mpstart
[   1.0000000] Trapframe @ 0xffffffc000a02d00 (cause=2 (illegal instruction), status=0x100, pc=0xffffffc0002faf3c, va=0xc0002773):
[   1.0000000] panic: cpu_trap: fatal kernel trap
```

The useful part is `va=0xc0002773`. On this processor that field carries the instruction that caused the fault, and it can be read straight off. The bottom seven bits mark it as a system instruction. Three bits in the middle say it is a register read. The source register is the one that is permanently zero, so nothing is being written. And the top twelve bits name the register being read: `0xc00`, the cycle counter. It is a request for the cycle count, refused, with the refusal printed in hexadecimal. Open the hypervisor's permission and the same kernel boots.

The second fix turns out not to matter to NetBSD at all. With the permission for ordinary programs left at zero, the setting that costs FreeBSD about twenty programs per boot, NetBSD still reaches a login prompt and runs ninety seconds without a kernel panic. Its ordinary programs do not go to the processor for the time the way FreeBSD's do. One run at that setting did panic nineteen seconds in, complaining that a processor had stopped responding, and then rebooted itself and came up normally. It has not happened again in two further attempts, so I am recording it rather than explaining it.

The permission does still arrive correctly, and for the first time I could check that from inside a guest rather than inferring it from the outside. I compiled a short probe in there that asks for all three counters and catches each refusal:

| What an ordinary program inside NetBSD asked for | Result |
|---|---|
| the clock | worked |
| the cycle counter | illegal instruction |
| the instruction counter | illegal instruction |

That is exactly the permission I had set on the host: the clock yes, the other two no. A value written on the hypervisor, read back by a program two levels above it, and the two agree. That is the whole mechanism of this post, visible in one table, from the far end.

Two corrections fall out of it.

The first is the disk. NetBSD still refuses the PCI disk, exactly as I reported in September. It lists the controller as unconfigured and comes up with no root filesystem at all. So this was never a story about the old style of disk being broken and the new one being right. NetBSD runs on the old style under hardware virtualization and reads it perfectly well: its startup filesystem check walked 30,402 files and pronounced the disk clean. Whatever corrupts FreeBSD's reads on the old transport, it does not do it to every guest, and one guest was never enough to say otherwise.

The second is that the general claim near the end of this piece gets firmer rather than weaker. Two operating systems, from different families, neither of which sets this permission for itself, both broken by the same empty register, and both fixed by the same two lines. That is not a FreeBSD quirk.

One practical note for anyone repeating this: give the guest a source of randomness, or it will sit at `Waiting for entropy...` indefinitely. That is not a counter problem and has nothing to do with this board, but it looks exactly like a hang and it cost me a run to work out.

## What I got wrong on the way, and how

Four ideas died during this, and how they died is the useful part.

I ruled out the vector and cache-management instructions by telling the virtual machine to stop advertising them to the guest, one at a time, and watching the deaths continue. That is a real result. But I also ran one configuration with all of them switched off together, saw zero deaths, and briefly thought I had it. That zero was worthless: the guest never reached the point of running any programs in that run, it was still in the bootloader when the clock ran out, and no programs died because no programs started. A clean number from an incomplete run is the most dangerous kind of evidence there is.

I ruled out the stale-instruction-cache theory by varying how many cores the guest had and which physical cores it was allowed to use. The death toll stayed between 17 and 28 across every combination and the same programs died every time. What I nearly reported instead was that restricting the guest to one core helped, because some of those runs reached a login prompt and others did not. They differed because my own long-running load test had restarted itself when the board rebooted and was quietly running twelve other virtual machines against the same eight cores throughout. That was congestion, not architecture, and I only caught it because the load test turned out to be holding the component I was trying to reload.

And I tested the clock theory against a Linux guest first, found Linux guests read the clock without complaint, and crossed the theory off. That was the worst of the three, because Linux writes that permission register itself, on startup, as a matter of course. A Linux guest physically cannot show you a bad inherited value: it overwrites the evidence before you can look at it. Out of everything on the bench I had reached for the one instrument incapable of detecting what I was hunting. The 536 bytes of assembly worked precisely because they are not an operating system and have no opinions.

The common thread is that every measurement was sound. The failures were all in what I concluded from them, and each one came from asking a question of something that was not able to answer it.

## What is still broken

OpenBSD does not boot. Its bootloader now gets all the way through loading the kernel, about 10.8 megabytes of it, and then the kernel produces no output whatsoever and the machine sits there. It sits there identically at four minutes and at ten, so it is stuck rather than slow. I have not diagnosed it and I am not going to speculate about it here, having just spent several thousand words on what speculating cost me last time. It is not a counter problem, because the counters are now demonstrably correct for a guest that uses them.

The two changes are mine, they are not part of Linux, and nobody has reviewed them but me.

## What this changes about renting these boards

October's piece listed five things to re-measure before buying more hardware. One of them read:

| Gate | Today | How it gets checked |
|---|---|---|
| BSDs boot, `mcounteren.CY` set | broken in M-mode firmware | the QEMU run scripts |

Every cell in that row is wrong. It names the wrong register, it blames the wrong layer, and FreeBSD boots. The honest replacement:

| Gate | Today | How it gets checked |
|---|---|---|
| FreeBSD boots as a virtual machine | yes, with two unofficial patches to the host | the QEMU run scripts |
| OpenBSD boots as a virtual machine | no, stalls after its bootloader, undiagnosed | the QEMU run scripts |
| Those patches survive a reboot | no, the bootloader still picks an older kernel | check the running kernel after a power cycle |

The passage that needs the most repair is this one, from the section on who the customer actually is:

> A firmware developer cannot use a virtual machine at all, and this is the thing I would have got wrong without owning the board. KVM requires the host's OpenSBI to own machine mode; guests run in hypervisor supervisor mode and below. That is exactly why the BSDs cannot boot under KVM here. A tenant inside a virtual machine cannot inspect, fix or experiment with the `mcounteren` bit that causes the problem, because that bit lives in a privilege level the hypervisor reserves for itself. Firmware work needs bare metal.

The first two sentences are right, and the last one is still my view: genuine firmware work cannot be done from inside a virtual machine, and that remains the argument for selling bare metal. But the example in the middle was wrong, and it was wrong in the direction that happened to flatter the conclusion. The thing causing the problem was not sitting in a privilege level the hypervisor keeps to itself. It was sitting in the hypervisor's own source code, on my side of the fence, which made it my problem to fix. So I fixed it.

That inverts what it means for the product. In October, "BSD guests" was a vendor blocker: a permanent hole in what the cheap tier could sell, which no amount of effort on my part could close. It is now a feature I can offer, which is a different kind of thing entirely. It is also a different kind of cost.

## Re-costing the virtual machine tier

October's arithmetic still works, so I will use it as published. Two-node pilot, \$133.56 a month all in. Ten-node chassis, \$1,117.82. Hardware spread over three years, colocation as quoted, setup fee spread over the same term.

What changes is which tier a customer lands in, and that is the whole of the effect, because the difference in density between the tiers is enormous. A bare-metal customer gets the entire board. A virtual-machine customer shares it with six other people.

One correction to that table while I am here. Its customer rows are labeled "Tenants at five per node", but the numbers used are 14 and 70, which is seven per node across two and ten boards. The break-even figures follow from 14 and 70, and \$133.56 divided by 14 is \$9.54, so the arithmetic is right and the label is wrong. Seven per board is the basis below.

| | Two-node pilot | Ten-node chassis |
|---|---|---|
| Monthly total | \$133.56 | \$1,117.82 |
| Break even, virtual machines, 7 per board | \$9.54 | \$15.97 |
| Break even, bare metal, 1 per board | \$66.78 | \$111.78 |

Under October's premise, somebody working on a BSD kernel had to rent a whole board. They can now use a virtual machine instead. On the pilot that drops the floor under that customer from \$66.78 to \$9.54, and on the big chassis from \$111.78 to \$15.97. Both are a factor of seven, and the seven is not interesting in itself: it is just how many customers fit on a board. What is interesting is that a whole category of customer I had written off as bare-metal-only can now use the cheap tier, which is the tier that earns seven times as much per board.

Then the cost side, which is where I expect to disappoint myself.

Making this work means the host has to run a modified copy of Linux. In [the sixteen-core piece](/posts/spacemit-k3-custom-kernel-a100.html) I took a clear position on that, and I still agree with it:

> I would not run this kernel under paying VM tenants. The port touches signal frames, ptrace register access and KVM's CPU hooks, which are the paths where a mistake becomes a guest-isolation bug rather than a crash. [...] A hypervisor host for strangers should run a kernel that somebody else also maintains, and Ubuntu's does that for free.

These two changes are far smaller than that one. They set two permission values and add a switch to turn them off. But smaller is not the same as safe, and one of them deserves saying out loud rather than leaving buried. Letting a guest read the cycle counter hands every customer on the board a very precise stopwatch. On a machine shared between strangers, a very precise stopwatch is the basic ingredient of a timing attack, and customers sharing a board is exactly the situation where that matters. The clock on its own, which is all that ordinary programs inside the guest actually needed, is harmless and was always available to everyone. The cycle counter is the one FreeBSD's kernel wants, and it is the one I would think hardest about before switching on underneath paying strangers.

So the costs of making BSD guests sellable are:

- A modified host kernel, rebuilt and re-tested on every security update, with all seven to fourteen customers on that board going offline for each host reboot. October's arithmetic had no line in it for my own labor, and a one-person business sells its own hours before it sells anything else.
- A security decision about the cycle counter, not a free capability.
- A persistence problem I am living with as I write this. The board still starts an older kernel by default, because that is the one I have tested most and the safe thing to come back to unattended. The practical result is that BSD guests do not currently survive a power cut: the board returns on a kernel that hands guests a blank permission register, and every FreeBSD guest starts losing programs again. That is a mundane operational detail, and it is precisely the shape of problem that running a modified kernel generates forever.

It is worth being clear that none of this is peculiar to this board. Every RISC-V machine running virtual machines hands its guests that same blank register, and any guest operating system that expects firmware to have filled it in, as FreeBSD and NetBSD both quite reasonably do, will break the same way on any hardware. The hardware here is incidental. What I have is a local fix for a general problem, and a local fix for a general problem is the most expensive kind to own, because the cost comes back every update and the benefit accumulates nowhere but my own rack.

The cost side has no exit, then. If this behavior were ever changed in Linux itself the labor disappears and BSD guests become a property of the platform rather than a thing I maintain, but I am not counting on that and I am not planning a business around it. What I should plan around is carrying these changes indefinitely, re-testing them every time the host kernel updates, and either pricing that time into the virtual machine tier or declining to sell the capability at all.

Where that leaves the gate: it moves from "impossible, and not mine to fix" to "working, and entirely mine to maintain, forever." The break-even arithmetic does not move at all. The range of customers the cheap tier can serve gets wider by a category I had excluded on a false premise, and the cost of serving them is an ongoing obligation rather than a one-off piece of work. Whether that trade is worth making is a question about how I want to spend my own evenings, not a question about hardware.

The part of October's conclusion I would keep unchanged is the one about bare metal, for a reason the last two months have strengthened rather than weakened. The defensible product was never the virtual machines. It was the unglamorous plumbing: a serial console on every board, remote power switching, and a way to recover a machine a customer has wedged. Every single finding in this piece came out of that plumbing. The board locked up while still drawing 18.7 watts and had to be power-cycled through a smart plug to come back. The evidence that finally settled the question came off a serial console. I did not build any of that in order to sell it. I built it because I could not work on this board without it, which is roughly the strongest signal a product can give you.

## Caveats

One board, one afternoon. FreeBSD reached a login prompt, which is not an endurance test and not a workload; I have not run anything inside a FreeBSD guest beyond its own startup. The 32-second boot is a single measurement taken with my load test stopped, and that load test was running during several of the earlier experiments, which is itself one of the mistakes described above. The comparison table is one run per configuration with a four-minute limit, not repeated trials.

The two changes are unofficial, unreviewed by anyone but me, and not part of Linux. Letting guests read the cycle counter has security consequences on a shared machine that I have described but not properly analyzed, and nothing here should be read as clearing it for that use. OpenBSD's stall is undiagnosed. The NetBSD result is one image in one configuration: I logged in and compiled a small probe, but I have not run any real workload inside it. The Star64 was not retested; I have withdrawn the conclusion I drew from it in September without putting another one in its place.

The claim that SpacemiT's firmware hands over all three counters comes from reading their published source and is corroborated by Linux counting cycles on the running machine, not from inspecting the register directly. The crash-dump analysis rests on two dumps, `dd` and `ps`, which both pointed at the same place; I did not examine the other six.

The money figures are October's, re-divided. The only new numbers are the bare-metal rows, which are that month's totals divided by one customer per board. Nothing was re-measured for cost, no power or bandwidth figure changed, and nobody has paid me anything yet.
