Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build/env/linux-riscv-qemu: add new RISC-V builder under qemu #30262

Closed
bradfitz opened this issue Feb 15, 2019 · 9 comments
Closed

x/build/env/linux-riscv-qemu: add new RISC-V builder under qemu #30262

bradfitz opened this issue Feb 15, 2019 · 9 comments
Labels
arch-riscv Issues solely affecting the riscv64 architecture. Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. new-builder
Milestone

Comments

@bradfitz
Copy link
Contributor

@rminnich @josharian et al want to start landing RISC-V code, so we need a builder.

@rminnich says qemu (from the sifive fork) is good now.

We can run a builder similar to what we're going to do for Fuchsia and what we previous did for a bit in https://github.com/golang/build/tree/master/env/linux-arm-qemu (but that was more emulation than we'd probably want here). We'll probably want to only run tests in qemu but do builds natively.

/cc @dmitshur @andybons

@bradfitz bradfitz added NeedsFix The path to resolution is known, but the work has not been done. new-builder arch-riscv Issues solely affecting the riscv64 architecture. labels Feb 15, 2019
@gopherbot gopherbot added this to the Unreleased milestone Feb 15, 2019
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Feb 15, 2019
@gopherbot
Copy link

Change https://golang.org/cl/162959 mentions this issue: dashboard, buildlet: add a disabled builder with nested virt, for testing

gopherbot pushed a commit to golang/build that referenced this issue Feb 15, 2019
…ting

This adds a linux-amd64 COS builder that should be just like our
existing linux-amd64 COS builder except that it's using a forked image
that has the VMX license bit enabled for nested virtualization. (GCE
appears to be using the license mechanism as some sort of opt-in
mechanism for features that aren't yet GA; might go away?)

Once this is in, it won't do any new builds as regular+trybot builders
are disabled. But it means I can then use gomote + debugnewvm to work
on preparing the other four image types.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Ic55f17eea17908dba7f58618d8cd162a2ed9b015
Reviewed-on: https://go-review.googlesource.com/c/162959
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@bradfitz
Copy link
Contributor Author

@rminnich, on golang-dev you wrote:

tip qemu is unlikely to be the right choice.
The riscv qemu has not been all that stable. I use the fork from
sifive. We'll want to use that

Where is that fork?

Searching for [sifive qemu], one of the top hits is from April 2018 with title "RISC-V QEMU Part 2: The RISC-V QEMU port is upstream - SiFive" but I guess https://github.com/sifive/freedom-u-sdk has a risc-qemu submodule that goes to ... https://github.com/riscv/riscv-qemu/tree/ad8989a3b5359eb1afa57d7ffedeea6a3c797d9c .... so, that one? Or which branch thereof?

Thanks.

@carlosedp
Copy link

carlosedp commented Feb 19, 2019

Sorry if this is already known but the Risc-V have been upstreamed into Qemu and version 3.1.0 already works.

Fedora also have a riscv64 image and multiple packages built (including gccgo). I'm running it locally and found no problems so far:

root@fedora-riscv:~ # cat /etc/os-release
NAME=Fedora
VERSION="30 (Rawhide)"
ID=fedora
VERSION_ID=30
PLATFORM_ID="platform:f30"
PRETTY_NAME="Fedora 30 (Rawhide)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:30"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/"
SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=rawhide
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"

root@fedora-riscv:~ # uname -a
Linux fedora-riscv 5.0.0-0.rc2.git0.1.0.riscv64.fc30.riscv64 #1 SMP Tue Jan 15 03:14:34 UTC 2019 riscv64 riscv64 riscv64 GNU/Linux
root@fedora-riscv:~ # lscpu
Architecture:        riscv64
Byte Order:          Little Endian
CPU(s):              6
On-line CPU(s) list: 0-5
Thread(s) per core:  1
Core(s) per socket:  1
Socket(s):           6

root@fedora-riscv:~ # /usr/bin/go version
go version go1.12beta2 gccgo (GCC) 9.0.1 20190209 (Red Hat 9.0.1-0.4) linux/riscv64

root@fedora-riscv:~ # gccgo --version
gccgo (GCC) 9.0.1 20190209 (Red Hat 9.0.1-0.4)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Current qemu version (I'm running on Mac right now installed with homebrew):

qemu-system-riscv64 --version
QEMU emulator version 3.1.0
Copyright (c) 2003-2018 Fabrice Bellard and the QEMU Project developers

The Fedora docs are in https://fedoraproject.org/wiki/Architectures/RISC-V/Installing#Boot_under_QEMU and the image I used is https://dl.fedoraproject.org/pub/alt/risc-v/disk-images/fedora/rawhide/20190126.n.0/Developer/.

qemu-system-riscv64 \
    -nographic \
    -machine virt \
    -smp 6 \
    -m 4G \
    -kernel bbl-5.0.0-0.rc2.git0.1.0.riscv64.fc30.riscv64 \
    -object rng-random,filename=/dev/urandom,id=rng0 \
    -device virtio-rng-device,rng=rng0 \
    -append "console=ttyS0 ro root=/dev/vda" \
    -device virtio-blk-device,drive=hd0 \
    -drive file=Fedora-Developer-Rawhide-20190126.n.0-sda1.raw,format=raw,id=hd0 \
    -device virtio-net-device,netdev=usernet \
    -netdev user,id=usernet,hostfwd=tcp::10000-:22 \
    -initrd initramfs-5.0.0-0.rc2.git0.1.0.riscv64.fc30.riscv64.img

@davidlt
Copy link

davidlt commented Feb 19, 2019

I am leading Fedora/RISCV efforts and happy to answer any questions.

In general RISC-V development went upstream and the last 2-3 QEMU releases support RISC-V. Similar with libvirt.

@gopherbot
Copy link

Change https://golang.org/cl/163057 mentions this issue: buildlet: change image name for COS-with-vmx buildlet

gopherbot pushed a commit to golang/build that referenced this issue Feb 19, 2019
The COS image I'd forked from earlier didn't have CONFIG_KVM or
CONFIG_KVM_INTEL enabled in its kernel, so even though I'd enabled the
VMX license bit for the VM, the kernel was unable to use it.

Now I've instead rebuilt the ChromiumOS "lakitu" board with a modified
kernel config:

   https://cloud.google.com/container-optimized-os/docs/how-to/building-from-open-source

More docs later. Still tinkering. Nothing uses this yet.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Id2839066e67d9ddda939d96c5f4287af3267a769
Reviewed-on: https://go-review.googlesource.com/c/163057
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/163301 mentions this issue: env/linux-x86-vmx: add new Debian host that's like Container-Optimized OS + vmx

gopherbot pushed a commit to golang/build that referenced this issue Feb 21, 2019
…d OS + vmx

This adds scripts to create a new builder host image that acts like
Container-Optimized OS (has docker, runs konlet on startup) but with a
Debian 9 kernel + userspace that permits KVM for nested
virtualization.

Updates golang/go#15581 (solaris)
Updates golang/go#23060 (dragonfly)
Updates golang/go#30262 (riscv)
Updates golang/go#30267 (fuchsia)
Updates golang/go#23824 (android)

Change-Id: Ib1d3a250556703856083c222be2a70c4e8d91884
Reviewed-on: https://go-review.googlesource.com/c/163301
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/206639 mentions this issue: dashboard: add linux-riscv64 builder

@gopherbot
Copy link

Change https://golang.org/cl/206639 mentions this issue: dashboard, cmd/coordinator: add linux-riscv64 builder, fix bug from CL 205608

gopherbot pushed a commit to golang/build that referenced this issue Nov 12, 2019
…L 205608

Updates golang/go#27532
Updates golang/go#30262

Change-Id: If1593ab6e5653a9dce625f25a16bf8a082796592
Reviewed-on: https://go-review.googlesource.com/c/build/+/206639
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
codebien pushed a commit to codebien/build that referenced this issue Nov 13, 2019
…L 205608

Updates golang/go#27532
Updates golang/go#30262

Change-Id: If1593ab6e5653a9dce625f25a16bf8a082796592
Reviewed-on: https://go-review.googlesource.com/c/build/+/206639
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@4a6f656c
Copy link
Contributor

We've had linux/riscv64 builders running on real hardware since November 2019. As such, I doubt we want to bring one up on qemu any more.

@golang golang locked and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-riscv Issues solely affecting the riscv64 architecture. Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done. new-builder
Projects
None yet
Development

No branches or pull requests

5 participants