KX-7000 on AOS-MMZX700D

I was interested in buying the latest Zhaoxin KX-7000 CPU for quite some time, which I see as a modified variation of the last unreleased Centaur CNS CPU. It is not exactly the same, but both were definitely designed in some kind of collaborative fashion. It will likely be the last one, since the Centaur team has now been disbanded.

There were a few options in the past, mainly desktop-oriented motherboards, but their prices were too high for me to consider (and a desktop motherboard is not what I was looking for). Luckily, more options appeared recently, and I got lucky enough to buy Aiostar AOS-MMZX700D (AOS-MMZX7000D on the motherboard sticker) in the Mini-ITX form-factor for a pretty decent price. My variant is very slightly customized compared to the default configuration, having one VGA connector and one HDMI connector instead of two HDMI ports.

Performance-wise, the KX-7000 CPU is not very impressive compared to the competition, and even the motherboard manufacturer admits this in the product description, but it is much more capable than anything before it and pretty capable overall (based on the resources available online). The motherboard is positioned more toward embedded/industrial usage (for example, it doesn’t have an actual PCIe slot, uses a DC-IN power adapter, and provides a SIM slot). However, I personally am less interested in its positioning and performance. The strongest reason was to continue improving Centaur support in NetBSD itself, and probably utilize the motherboard for internal purposes, such as upgrading my NAS server, or having a decent and compact AMD64 testing platform if successful.

And indeed, this platform has provided quite a number of various things to fix and improve; some easy, some still unresolved. I will go through some of them in this article!

Desired number of cache colors is not even

The first issue surfaced on the first boot of the NetBSD operating system. I hit a relatively early panic in the boot process that was saying, “desired number of cache colors 21 is > 1, but not even!” The error message was pointing to this line.

Page coloring is how the kernel groups physical pages by which cache sets they map to, so pages with the same “color” compete for the same cache lines. The kernel calculates the number of colors as cache size / (page size × associativity). So something was off in this calculation.

Fortunately, this mystery was relatively easy to crack and revealed two problems in the VIA/Zhaoxin CPU cache identification. The first one is a fairly longstanding issue, and in theory it affected all VIA CPUs starting with Nehemiah. The other one is more recent and is related to the way cache parameters should be decoded in general.

The uneven number was caused by the first issue. Historically, L2 cache parameters are decoded using the 0x80000006 CPUID function. Certain bits encode the cache size, line size, and associativity. This matches the AMD way of doing the same thing for the L2 cache.

However, the NetBSD implementation had a subtle difference between AMD and Centaur when decoding cache associativity. AMD was using a lookup to resolve the value extracted from the bits, while Centaur was using the raw value directly. This difference was likely backed up by VIA datasheets, which never mentioned any lookup table and described the bits as containing the actual value.

In practice, it turned out that they also store the same value as AMD, meaning that a lookup table is required to obtain the actual value!

This issue had never been noticed because the number of colors happened to still be a power of 2, even if it was calculated incorrectly for certain models. It is the KX-7000, which has 8-way L2 associativity, that finally exposed the issue, since 6 is the raw value and the calculation therefore failed to pass the power-of-2 check.

The second issue affected newer VIA (CNQ+) and most, if not all, Zhaoxin CPUs. It appeared that, at some point, it was decided to switch to Intel’s way of encoding cache parameters through CPUID leaf 4 instead. The parameters mostly match between the two methods (though there were cases where they disagreed), but it became the preferred way of obtaining this information. Additionally, the L3 cache is encoded only this way in the KX-7000 CPU, so CPUID leaf 4 needs to be used to obtain its L3 cache parameters.

The fix can be described in two steps:

  1. Use the same cache-associativity lookup table as AMD.
    The raw associativity value reported by the CPU needs to be translated using the lookup table instead of being treated as the final value.
  2. Parse cache information from CPUID leaf 4 when available.
    Newer VIA and Zhaoxin CPUs use the Intel-style CPUID leaf 4 to report cache parameters, including the L3 cache on the KX-7000. The code therefore uses leaf 4 to obtain the cache information when it is available.

Same changes were applied to cpuctl(8) utility as well.

SMAP and PMAP

KX-7000 supports SMAP feature designed to set user-space mapping to prevent supervisor access to those mapping would cause a trap. Once I fixed the issue above, the boot process still failed and hit page fault trap in pmap_enter_ma() somewhere before login screen was supposed to appear. Quite quickly I identified that SMAP feature is causing this, thus I committed a workaround to disable it for the Zhaoxin CPUs (it is currently supported at least by KX-7000 and KX-6000G, and maybe KX-6900). I was hoping to quickly identify the root cause, however I haven’t reached this stage yet. Later I identified that it affects only newly installed pmap pages and PTE entries. I found that invlpg instruction (invalidating TLB caches) in couple places allows the system boot properly, but those places can affect performance, and not necessarily correct, thus I couldn’t apply them. There are few more things which affect the outcome, but none solve the problem. So far, this issue is not fully resolved, but disabling SMAP helps and this is currently applied. For whatever reason i386 is not affected in the same way and boots successfully (either SMAP is not used or recursive mapping is more shallow than the one in amd64). OpenBSD seems to be affected by this problem too. FreeBSD boots successfully though.

WARNING: no TOD clock present

After disabling SMAP, the system finally booted fully! However, I immediately noticed a warning at the end of the boot process: “WARNING: no TOD clock present”, followed by a couple more related warnings. After some investigation, it turned out to be related to a quite recent change for virtualized environments, specifically QEMU microvm boot, which needed a check that the RTC (real-time clock) is enabled, as otherwise the boot would hang. However, that check was not valid for real hardware. It used the MC146818 Register D bits to see whether bits 0-6 were zero, but real hardware may use those bits for the date alarm, so they are not necessarily zero. This is not specific to the KX-7000: any machine with non-zero values there could have its RTC mistakenly not attached. The KX-7000 system just happened to be one such case. The fix restricts the check to VM guest environments.

Legacy boot issue

The motherboard has an option to use either EFI boot or legacy BIOS boot. Oddly, it doesn’t allow both: one must be chosen in the BIOS setup (other motherboards can typically support both without a specific switch). Nevertheless, I tried to boot NetBSD using BIOS boot (specifically the i386 and amd64 BIOS-only images). Both failed to load the kernel, ending in “read section: input/output error” or “inappropriate file type or format” errors, or even an abrupt reboot. Experience from the VIA C7 boot issue investigation helped me get into bootloader debugging fairly quickly. After several sessions I found that forcing the INT13 extensions resolves the problem (#define FORCE_INT13EXT can be used to build a bootloader that enforces this). The INT13 extensions provide LBA-based disk access, while NetBSD uses CHS (Cylinder, Head, Sector) addressing for reads up to a certain sector and only switches to LBA beyond what CHS can address. For some reason, the CHS approach doesn’t work properly on the KX-7000. I proposed a fix to always use the INT13 extensions if the BIOS reports supporting them, but the developers rejected it, because some other legacy systems may have the opposite problem (support is reported but doesn’t work, or a SCSI ROM doesn’t support it at all). I plan to continue with a different approach, probably reading a certain sector and checking whether LBA can be used, but it is not ready yet. For now, the only option is to enforce the extensions, which requires rebuilding the bootloader. OpenBSD and FreeBSD don’t have this issue, since they don’t do CHS reads if INT13 extensions are supported.

HDMI output issue on BIOS boot

The motherboard has both VGA and HDMI outputs, and I typically use VGA for testing. However, once I managed to boot into the system using BIOS boot, I tried switching to HDMI output instead, and in that case the boot hangs in a not fully deterministic way, meaning not always on the same line. I tried disabling various devices and disabling vesa, which lets the boot move further, but it never completes. OpenBSD is potentially affected too: its kernel boots fully, but it hangs while starting userland services (which doesn’t happen with VGA output). It looks like a memory, framebuffer, or timeout issue, but I have little idea how to investigate it. EFI boot is not affected in the same way and boots without problems even when HDMI output is used.

Other smaller improvements

Besides the improvements above, I also committed a couple more changes related to VIA/Zhaoxin CPUs. Specifically, I added the Centaur vendor ID and family 7 to the invariant TSC check (needed for the KX-7000), which is performed through the CPUID 0x80000007 function. Additionally, I added a check for using lfence to serialize rdtsc on all CPUs from VIA Nano onwards, including all Zhaoxin CPUs. I also updated the pcidevs and hdaudiodevs files to include the PCI IDs and HD audio device IDs from the KX-7000 (and other VIA/Zhaoxin) CPUs. Finally, I added an extended model check for family 7 CPUs, which are used only by Zhaoxin. This allows more accurate model reporting in cpuctl(8) and in kernel checks.

One more issue with BIOS boot is that consdev com0 / consdev com1 does not redirect the console to the serial port. I haven’t investigated this yet.

I will continue working on the platform improvements, but the pace will likely slow down now. The initial support is in place, and the workarounds needed to boot the system have been identified or fixed, which makes for a stable and usable system as is. I am requesting, or planning to request, pull-ups of most of these changes to at least NetBSD 11, and some of them have already been applied.

GSoC 2026 reports

The NetBSD Foundation participated in Google Summer of Code 2026. Five projects were announced, and now three of those have presented their reports:

  1. Testing Compat Linux: Syscall testing – Henrique Brito:
    Google Summer of Code 2026 Reports: Testing Compat Linux: Syscall testing
    Google Summer of Code 2026 Reports: Testing Compat Linux: Syscall testing, part 2
  2. Port the Enlightenment desktop environment to NetBSD – Dimitris Gounaridis:
    Google Summer of Code 2026 Reports: Port the Enlightenment desktop environment to NetBSD
    Google Summer of Code 2026 Reports: Port the Enlightenment desktop environment to NetBSD, part 2
  3. Improving RAIDframe – Emmanuel Nyarko:
    Google Summer of Code 2026 Reports: Improving RAIDframe
  4. Improving and Stabilizing the racoon2 IKE:
    Google Summer of Code 2026 Reports: Improving and Stabilizing the racoon2 IKE Daemon in NetBSD

NetBSD 10.2 released

Following the final NetBSD 9.5 release, the 10 branch gets its second maintenance and feature release. Unlike the NetBSD 9.5 release, this is not the final update yet, it will be supported until NetBSD 12.0 is released.

The release announcement is available on this page. A complete list of changes can be found in the CHANGES-10.2 file.

The 10.2 release accumulates changes for almost two years as well (10.1 was released in December 2014). It also includes my improvements to VIA IDE/SATA controllers support (viaide(4)), a boot fix for newer revisions of Intel Apollo Lake CPUs, and my recent discovery on detecting VIA/Zhaoxin CPU cache parameters, which I haven’t posted about yet (I was already too late to include it in the NetBSD 9 release).

Release highlights have lots of improvements and fixes on hardware support and userspace applications: multiple improvements to Nintendo Wii/Wii U support, PVH boot capability on amd64 (using QEMU kernel options), VMware PV SCSI controller support, and various ARM, HP PA-RISC, VAX, and MIPS improvements. Among other hardware improvements, rge(4) added support for Realtek RTL8126 5Gbps Ethernet and one more RTL8125D revision, axen(4) added support for ASIX AX88179A USB Ethernet and finally urtwn(4) added support for the Asus USB-N10 Nano B1 Wi-Fi adapter.

There’s also a long list of security and reliability fixes, including upstream security fixes for the Xorg(1), openssl(1), sshd(8) and unbound(8). tzdata was updated to tzdata2026b, and xkbcomp to 1.5.0, the same as in NetBSD 9.5.

Download links are available in the release announcement above or on the usual mirrors.

NetBSD 9.5 released

The final release in the netbsd-9 branch is out. NetBSD 9.5 includes various stability and security fixes, driver improvements and new versions of several userspace applications. It marks the end of support for the 9.x branch, no more updates or security fixes will be applied to it. Thus, it is recommended to upgrade to the newer releases, preferably the latest NetBSD 11.0 release.

The release announcement is available on this page. A complete list of changes can be found in the CHANGES-9.5 file.

The last release was over two years ago, so list of changes is quite long.

It includes a few improvements I have been working on and posting about, including improvements to VIA IDE/SATA controllers support (viaide(4)), a fix for the ALTINST issue when probing VIA CPUs (which makes temperature sensor work for C7 CPUs again), fixes boot issue on HP 2133 Mini-Note laptop, Biostar Viotech 3100+, and potentially a few other HP and AMD systems, a boot fix for newer revisions of Intel Apollo Lake CPUs.

The release highlights include support for additional hardware in the urtwn(4) Wi-Fi and uftdi(4) USB to Serial adapters, fixes for the MSI/MSI-X configuration on certain machines, aarch64 thread-local storage support, display brightness control fixes for certain acpiout(4) devices, and restoration of full set of hardware-supported encodings from netbsd-7 in the eap(4) AudioPCI audio device driver.

There is a long list of security fixes and reliability fixes, including upstream security fixes for the Xorg(1), openssl(1), sshd(8) and unbound(8). tzdata was updated to tzdata2026b, and xkbcomp to 1.5.0.

Please upgrade if NetBSD 9 is still required in your environment. Otherwise, please move to a newer release.

Download links are available in the release announcement above or on the usual mirrors.

A Few Recent NetBSD Issues and How I Solved Them

Firefox issue

I recently had to reinstall my main PC’s NetBSD system after an unexpected NVMe SSD failure. I didn’t have a full backup of the system, just some configuration and home folder files that made it easier to restore the system, so it was essentially a fresh install of the recent NetBSD 11 release.

I’m using Xfce as my main desktop environment and Firefox as my primary browser. My current graphics card, a Radeon 5700 XT, doesn’t support graphics acceleration reliably. More precisely, it is buggy and causes frequent system crashes, so I started X.org with acceleration disabled.

Interestingly, this caused Firefox to crash and, after the second attempt, drop me into rescue mode. Since it was a pretty fresh installation, I didn’t think it was a plugin issue. Initially, I kept using rescue mode, but since it disables all plugins, that quickly became unfeasible.

After some fiddling around, I found that both the “Use recommended performance settings” and “Use hardware acceleration when available” options had to be disabled. I don’t remember this happening in the past. Typically, these options wouldn’t cause Firefox to crash, but would instead just make it slower. It is likely that newer versions of Firefox behave differently when hardware acceleration is unavailable or disabled.

Disabling the aforementioned options made the browser work normally again. An additional improvement in stability was achieved by rebuilding the packages from the current pkgsrc tree.

wmux issue

As soon as I switched to the NetBSD 11 branch, I started experiencing a very annoying issue with mouse handling. The symptoms would start appearing after a few applications, or a few windows of the same application, had been opened. Switching windows, for example with Alt+Tab, would not actually switch the focus to the new window. The previous application would continue to react as if it still had focus. Additionally, application menus would stop working, even when using keyboard shortcuts.

Using the desktop environment in this state was quite complicated. I suffered from this issue for quite a long time, which forced me either to avoid rebooting for as long as possible when the mouse was working correctly, or to rely mainly on keyboard shortcuts.

Fortunately, I noticed at one point that the mouse would suddenly start working correctly after I removed my wireless gamepad receiver. It turned out that the receiver was attached as a second wsmouse(4) device to wsmux(4), causing the symptoms described above.

The solution I decided to use was to remove wsmouse0 (which was the receiver) from wsmux using the following cron line:

@reboot /usr/sbin/wsmuxctl -f 0 -r wsmouse0

There is a risk that wsmouse0 could be the actual mouse if the receiver is disconnected, or if the device enumeration changes for some other reason. However, this worked quite reliably for me and made my system usable again.

ssh gnome-daemon-keyring

Another small issue I always face is getting gnome-keyring-daemon to start its SSH agent service so that xfce4-terminal asks for the SSH passphrase only once, using a graphical prompt, and then works across all terminal windows during the session.

This can be solved quite easily by enabling the “SSH Key Agent (GNOME Keyring: SSH Agent)” checkbox in the Xfce4 “Session and Startup” settings, under the “Application Autostart” tab. However, this is not enough, because it starts the session but does not propagate the SSH_AUTH_SOCK environment variable to the rest of the environment.

For that, the “Launch GNOME services on startup” checkbox also needs to be enabled in the “Advanced” tab of the same “Session and Startup” settings. I also add the following line to .profile:

export SSH_AUTH_SOCK=0

With these settings, the GNOME Keyring SSH agent works properly across the Xfce session, and xfce4-terminal can reuse the same SSH credentials across terminal windows.

NetBSD 11.0 released!

I missed posting about the 7th release candidate, which turned out to be the final one, and now NetBSD 11.0 has finally been released!

The release announcement can be found here.

In comparison to RC6, the final release includes updates to xorg-server 21.1.24, libXfont2 2.0.8, and tzdata 2026cgtz. It also contains numerous bug and security fixes across networking, the kernel, architecture support, the runtime linker, locale handling, curses, and installation tools.

The changes since RC6 are listed in the CHANGES-11.0 file, starting from the “Welcome to 11.0_RC6!” section through the end of the file.

This release also includes dedications to former core members Alan P. Barrett and Berndt Josef Wulf, in recognition of their contributions to the NetBSD project.

The release can be downloaded from the CDN service or any of the other project mirrors. Please don’t hesitate to try it and report bugs! As usual, upgrading is strongly recommended for users of earlier NetBSD releases.

Enjoy the new major release, and thank you to all developers, testers, and contributors who made NetBSD 11.0 possible. Happy upgrading!

NetBSD 11.0 RC6

The sixth 11.0 release candidate is ready for testing. The release announcement can be found on the updated release page.

RC6 includes multiple fixes and improvements for the sysinst(8), the main NetBSD installation and update program; imports BIND 9.20.24/MPL, expat 2.8.2, pkg_add(1) 20260227, and libdrm 2.4.134; and contains numerous bugfixes to the kernel, drivers and utilities.

A full list of changes can be found in CHANGES-11.0 file, between “Welcome to 11.0_RC5!” and “Welcome to 11.0_RC6!” sections.

Download links are available in the release announcement above or on the usual mirrors. Please test it and report any bugs!

NetBSD 11.0 RC5

The fifth release candidate is ready for the upcoming NetBSD 11.0 release. The release announcement is available on the updated release page, as usual.

RC5 imports OpenSSL 3.5.7, unbound 1.25.1, expat 2.8.1, tmux 3.6b, libdrm 2.4.134, and X.Org Server 21.1.23. Beyond that, it contains minor fixes for various userland applications, NFS, build fixes, and hardware support improvements.

A full list of changes can be found in CHANGES-11.0 file, between “Welcome to 11.0_RC4!” and “Welcome to 11.0_RC5!” sections.

Download links are available in the release announcement above or on the usual mirrors. Please test it and report any bugs!

NetBSD 11.0 RC4

The NetBSD project has released the fourth release candidate for the upcoming NetBSD 11.0. The release announcement is available on the updated release page.

RC4 imports xorg-server 21.1.22, which contains multiple security fixes; BIND 9.20.22/MP; xz 5.8.3; OpenSSH 10.3; OpenSSL 3.5.6; Postfix 3.11.2; and tzdata 2026b. It also includes bozohttpd fixes, userland support for the IBM Espresso SMP used in the Nintendo Wii U, a rewrite of ctwm_app_menu in awk for an approximately 20-100x speedup, the drm atomic interface for Allwinner DE2, libXpm upstream fixes for CVE-2026-4367, and multiple other fixes.

A full list of changes can be found in CHANGES-11.0 file, between “Welcome to 11.0_RC3!” and “Welcome to 11.0_RC4!” sections.

Download links are available in the release announcement above or on the usual mirrors. Please test it and report any bugs!

NetBSD 11.0 RC3

A month after RC2, the NetBSD project has announced the third release candidate for the upcoming 11.0 release. The release announcement is available on the same updated page.

RC3 imports the new tzdata 2026a version, fixes multiple bugs, adds improvements for RISC-V and ARM hardware support, and addresses various ZFS filesystem issues, among the other changes. A full list of changes can be found in CHANGES-11.0 file, between “Welcome to 11.0_RC2!” and “Welcome to 11.0_RC3!” sections.

Download links are available in the release announcement above or on the usual mirrors. Please test it and report any bugs!

Personal NetBSD blog