Red Hat / SiFive RHEL 10 on RISC-V developer release

Some colleagues of mine have been working hard on this for a really long time:

Red Hat partners with SiFive for a RISC-V developer preview of Red Hat Enterprise Linux 10

Leave a comment

Filed under Uncategorized

Graphical differences between two disk images

I was investigating possible disk corruption when copying a disk image between servers, but needed a way to visualise what might be happening. The disk image is tens of gigabytes, so looking at it in hexdump wasn’t a lot of fun. A little Python to the rescue instead:

#!/usr/bin/python3

from PIL import Image, ImageColor

import nbd
h1 = nbd.NBD()
h2 = nbd.NBD()

original = "original.qcow2";
copied = "copied.qcow2";

blksize = 4096
zero_block = bytearray(blksize)

width = 4096
output = "output.png"
red = ImageColor.getrgb("red")
green = ImageColor.getrgb("green")
blue = ImageColor.getrgb("blue")
white = ImageColor.getrgb("white")
black = ImageColor.getrgb("black")

# Open original disk image.
h1.connect_systemd_socket_activation(["qemu-nbd", "-f", "qcow2", original])

# Open copied disk image.
h2.connect_systemd_socket_activation(["qemu-nbd", "-f", "qcow2", copied])

assert(h1.get_size() <= h2.get_size())

# Open the output visualisation.
height = int(h1.get_size() / blksize / width) + 1
image = Image.new("RGB", (width, height), white)

# Iterate over the blocks of each.
x = 0
y = 0
for i in range(0, h1.get_size(), blksize):
    b1 = h1.pread(blksize, i)
    b2 = h2.pread(blksize, i)
    if b1 == b2:
        # Same
        image.putpixel((x, y), green)
    elif b1 != zero_block and b2 == zero_block:
        # Zeroed
        image.putpixel((x, y), black)
    else:
        # Different but not zeroed
        image.putpixel((x, y), red)
    x = x+1
    if x == width:
        x = 0
        y = y+1
        print("%d/%d\r" % (y, height), end='')

print()
image.save(output)
print("Saved to %s" % output)

h1.close()
h2.close()

The resulting image showed that stretches of the disk were getting zeroed out during the copy (which was definitely not supposed to happen).

5 Comments

Filed under Uncategorized

Benchmarking RISC-V SpaceMIT X60 and others

The RISC-V open instruction set architecture is becoming popular, but getting development boards into programmers’ hands so people can use it has been difficult and expensive so far, and the ones available have been slow. Things are changing, slowly, but this year many more are available. Which ones are any good?

I recently received 4 Milk-V Jupiter development boards, and one Banana Pi F3 through RISC-V International. All of these boards have the same (or very similar) SpaceMIT X60 SoC which is a fairly capable 8 core RISC-V processor.

model name      : Spacemit(R) X60
isa             : rv64imafdcv_zicbom_zicboz_zicntr_zicond_zicsr_zifencei_zihintpause_zihpm_zfh_zfhmin_zca_zcd_zba_zbb_zbc_zbs_zkt_zve32f_zve32x_zve64d_zve64f_zve64x_zvfh_zvfhmin_zvkt_sscofpmf_sstc_svinval_svnapot_svpbmt

Since we’ll be using all of these boards for Fedora package building I ran some simple benchmarks of how well they perform. The benchmark is to recompile this grub2 package to RPMs:

# dnf builddep grub2-2.12-11.0.riscv64.fc41.src.rpm
$ time rpmbuild --recompile grub2-2.12-11.0.riscv64.fc41.src.rpm

(I did a few builds in a row until the times settled down, so these are all “hot cache” builds on an otherwise unloaded board.)

Milk-V JupiterRISC-V SpaceMIT X60
8 cores
16GB RAM
748s
Banana PiRISC-V SpaceMIT X60
8 cores
16GB RAM
962s
VisionFive 2JH7110
4 cores
8GB RAM
923s
Raspberry Pi 4ARM Cortex A72
4 cores
8 GB RAM
753s
AMD gaming PCAMD Ryzen 9 7950X
16 cores
64 GB RAM
104s
HiFive Premier P550 with SSD
(update 2024/12/10)
RISC-V ESWIN EIC7700X P550
4 cores
16 GB RAM
SATA SSD
598s
HiFive Premier P550 with NVMe
(update 2024/12/12)
RISC-V ESWIN EIC7700X P550
4 cores
16 GB RAM
NVMe in adapter in PCIe slot
464s
HiFive Premier P550 virtualized
NVMe, KVM guest
(update 2024/12/15)
Host: RISC-V ESWIN EIC7700X P550 as in row above
Guest: KVM guest
678s

We should be getting a SiFive P550 development board soon which is the first widely available out-of-order RISC-V core.

(Thanks Andrea Bolognani for benchmarking the VF2 and P550 with NVMe and KVM guest)

8 Comments

Filed under Uncategorized

Virt-v2v take-out hiring

Red Hat is hiring two software engineering positions, to work on virt-v2v and the wider MTV project. Virt-v2v is the software we use for “VMware take-out”, ie. converting existing virtual machines from VMware to run on KVM (Openshift, Openstack, or just plain qemu). This is a huge opportunity right now owing to Broadcom deciding to set fire to piles of money.

As is usual with these things there was a lot of miscommunication between what we asked for an what the job description says, but for the virt-v2v position we’re looking especially for C programmers with a good understanding of virtualization, who are motivated self-starters. The roles nominally are on-site in Brno, Czech Republic, and the US (Ireland is mentioned weirdly, but I think that’s a tax thing). This isn’t a real requirement and remote work is fine, although for junior developers we’d probably ask you to attend the office for the first month or so.

Workday links (sorry, not my choice): Senior Software Engineer role, Principal Software Engineer role. If you’re interested in applying please follow the instructions there rather than commenting here.

Leave a comment

Filed under Uncategorized

Exploit qemu to display nyancat

I discovered this exploit in qemu’s network block driver:

To reproduce it you’ll need nbdkit >= 1.40.1:

$ wget http://oirase.annexia.org/nyan.c
$ nbdkit --log=null cc nyan.c
$ qemu-img info nbd://localhost

What’s happening here (discussion upstream) is just that qemu prints the error message from the server without sanitisation, so we can send terminal codes and more. This affects any user-controlled qcow2 file, since you can set NBD as a backing source.

Leave a comment

Filed under Uncategorized

Virt-v2v | Devconf.cz lightning talk

I did a talk about the Broadcom acquisition of VMware and using virt-v2v to liberate your VMs. Check it out below. It’s only 5 minutes long!

(Note this is a link to the livestream, it should start at 7h 4m 9s)

1 Comment

Filed under Uncategorized

Fedora on RISC-V | Devconf.cz talk

David Abdurachmanov and myself did a talk about Fedora on RISC-V. Check it out below.

(Note this is a link to the live stream, and it should start playing at 4h 45m 14s)

Leave a comment

Filed under Uncategorized

I was interviewed on NPR Planet Money

I was interviewed on NPR Planet Money about my small role in the Jia Tan / xz / ssh backdoor.

NPR journalist Jeff Guo interviewed me for a whole 2 hours, and I was on the program (very edited) for about 4 minutes! Quite an interesting experience though.

2 Comments

Filed under Uncategorized

Red Hat Research article on RISC-V extensions

Finally been published …

https://research.redhat.com/blog/article/risc-v-extensions-whats-available-and-how-to-find-it/

Leave a comment

Filed under Uncategorized

nbdkit binaries for Windows

Much requested, I’m now building nbdkit binaries for Windows. You can get them from the Fedora Koji build system by following this link. Choose the latest build by me (not one of the automatic builds), then under the noarch heading look for a package called mingw64-nbdkit-version. Download this and use your favourite tool that can unpack RPM files.

Some notes: This contains a 64 bit Windows binary of nbdkit and a selection of plugins and filters. There is a mingw32-nbdkit package too if you really want a 32 bit binary but I wouldn’t recommend it. For more information about running nbdkit on Windows, see the instructions here. Source is available for the binaries from either Koji or the upstream git repository. The binary is cross-compiled and not tested, so if it is broken please let us know on the mailing list.

Leave a comment

Filed under Uncategorized