Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by gbr-app-1.alpinelinux.org (Postfix) with ESMTPS id 4E4E2224151 for <~alpine/users@lists.alpinelinux.org>; Fri, 6 Dec 2024 17:48:22 +0000 (UTC) Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-e3990bbe22cso2206167276.1 for <~alpine/users@lists.alpinelinux.org>; Fri, 06 Dec 2024 09:48:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733507301; x=1734112101; darn=lists.alpinelinux.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=TmPdajG0MJWvkvVNXeeOjohJlu53M0iFMS/QMdyPBHk=; b=BU6DGbf3TiQQ3KKOS9aYe4ByKMdJO9nc5snlqKVupSTaQoImcVh6/KSHfr/+Qy9Xse ENy9eg5MJKpCcduafM/8xtexc7f1jkJXS8njfQRurYe+H6ONhLizy8rQ0BlAdlysLPvG EJZQcNcGcTD9P7CoDu+1V0O0f4H3E075Z9dyAPZAufAezVOEtjJxcT2F07cQ5NgChenJ nIubqGveMIa2a//pXBjhdLDwY1KjxjCDFh2uz/+KScEA6ZdrY+gO9/8P3DqZGrf8PWj9 MNUa88waLCcBf6QNKSzIkTqQG8uQFUcJl5QWqR14+Tmfe0gD596yxuXxcXRW0XepXap/ apdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733507301; x=1734112101; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=TmPdajG0MJWvkvVNXeeOjohJlu53M0iFMS/QMdyPBHk=; b=Uqr/l7qPE/vHra2tr3gj5PZYam20yxMd3ZjXgOcDxZShnQcq+rM8Ayg6DM9cVCf7EC 6TBHJ1DnQazoOpq5fz9cfz2cBVnuwT87oLM7FL5NZlexz2iJeO8gG+wOtWDw6Sl469aU hy/TiIR5pL7Cvc5VoBtn5UdAY82BfsWCf8nppNoVQujt4McIGFjX3foIafD89PvZXse2 JnlKRl+D/IxmTwvhsVfufJKxyxwMkcuQXh/v6MroyExZrsUi5cGtV72v/raRoOF3InTa V0mtNMtHFvP+xF1/nUWlutL0ydHSNbg8U/gBJwel5Z9VmfGBLo5h8UQOhIZpFweEmmBm EJGA== X-Gm-Message-State: AOJu0Yyl30x9Vnjbl0/qcoQGgCaHFAGyVkgkYXFf2QJz7QXrS6aMv8vh Tiiwv4c4jzxHOPZmR1n7XOI9WN098Y4CFsCiRjnv7iGSHChEgoEEAF4fE6Wc29fJQcgJXW209Cr 8MO+yaEe1V1X64aSK22wqElpx4XwYnQvK X-Gm-Gg: ASbGnctcMaD6T40bZL2WjG+scI5KANVfdK5lVL6f51VnG2lQKnLYciCLq+8dA4A58RH KpyRKh0wbzNhn4nuP+RmcWkbERplnJ6k= X-Google-Smtp-Source: AGHT+IGW8RJx6BN4+pewFLNwG6F9058nuf02jE9dtPZWq8R1eIBxeeNfjY41TWrPVXLfvDdC94MlUmnFY4Miitjq2u8= X-Received: by 2002:a05:6902:1681:b0:e39:8341:d5b7 with SMTP id 3f1490d57ef6-e3a0b0b7c4cmr3874336276.15.1733507301035; Fri, 06 Dec 2024 09:48:21 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?B?UMOpdGVyIFN6aWzDoWd5aQ==?= Date: Fri, 6 Dec 2024 19:48:10 +0200 Message-ID: Subject: QEMU fails to boot Alpine RISCV64? To: ~alpine/users@lists.alpinelinux.org Content-Type: text/plain; charset="UTF-8" Hello, I've used alpine-make-rootfs to create an initramfs to be able to boot a stateless, ram-only alpine image. It works great on amd64 and arm64, I can start them up in QEMU. On riscv64, it creates all the needed files as before, but I simply cannot convince QEMU to actually start it. It just hangs on bios startup. I've tried other test images and they work fine, only the Alpine one hangs. Was wondering if I'm missing something? The way this tool works is that it's run in a docker container for the required platform (amd64, arm64, riscv64) and installs the `linux-lts` package, which among others contains `vmlinuz-lts`, the kernel needed by QEMU. This file works well for most plafroms, but not for RISCV64. https://pkgs.alpinelinux.org/contents?file=&path=%2Fboot&name=linux-lts&branch=edge&repo=main&arch=x86_64 Now, my guess is that I'm missing something super obvious, because surely Alpine can run on riscv64 and qemu should surely be able to run it... but I've spent an entire day looking at a hung riscv64 bios and I'm just baffled at this point. I'm trying to run it with: qemu-system-riscv64 -M virt -cpu rv64 -m 4G -kernel "images/$image/vmlinuz-lts" -initrd "images/$image/initramfs-lts" -append "console=ttyS0" -nographic And it just prints all the bios stuff (so that works) and then hangs when trying to give control over to Alpine. Hepl? OpenSBI v1.5.1 ____ _____ ____ _____ / __ \ / ____| _ \_ _| | | | |_ __ ___ _ __ | (___ | |_) || | | | | | '_ \ / _ \ '_ \ \___ \| _ < | | | |__| | |_) | __/ | | |____) | |_) || |_ \____/| .__/ \___|_| |_|_____/|____/_____| | | |_| Platform Name : riscv-virtio,qemu Platform Features : medeleg Platform HART Count : 1 Platform IPI Device : aclint-mswi Platform Timer Device : aclint-mtimer @ 10000000Hz Platform Console Device : uart8250 Platform HSM Device : --- Platform PMU Device : --- Platform Reboot Device : syscon-reboot Platform Shutdown Device : syscon-poweroff Platform Suspend Device : --- Platform CPPC Device : --- Firmware Base : 0x80000000 Firmware Size : 327 KB Firmware RW Offset : 0x40000 Firmware RW Size : 71 KB Firmware Heap Offset : 0x49000 Firmware Heap Size : 35 KB (total), 2 KB (reserved), 11 KB (used), 21 KB (free) Firmware Scratch Size : 4096 B (total), 416 B (used), 3680 B (free) Runtime SBI Version : 2.0 Domain0 Name : root Domain0 Boot HART : 0 Domain0 HARTs : 0* Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W) Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W) Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: () Domain0 Region03 : 0x0000000080040000-0x000000008005ffff M: (R,W) S/U: () Domain0 Region04 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: () Domain0 Region05 : 0x000000000c400000-0x000000000c5fffff M: (I,R,W) S/U: (R,W) Domain0 Region06 : 0x000000000c000000-0x000000000c3fffff M: (I,R,W) S/U: (R,W) Domain0 Region07 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X) Domain0 Next Address : 0x0000000080200000 Domain0 Next Arg1 : 0x00000000bfe00000 Domain0 Next Mode : S-mode Domain0 SysReset : yes Domain0 SysSuspend : yes Boot HART ID : 0 Boot HART Domain : root Boot HART Priv Version : v1.12 Boot HART Base ISA : rv64imafdch Boot HART ISA Extensions : sstc,zicntr,zihpm,zicboz,zicbom,sdtrig,svadu Boot HART PMP Count : 16 Boot HART PMP Granularity : 2 bits Boot HART PMP Address Bits: 54 Boot HART MHPM Info : 16 (0x0007fff8) Boot HART Debug Triggers : 2 triggers Boot HART MIDELEG : 0x0000000000001666 Boot HART MEDELEG : 0x0000000000f0b509