From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +OOIO87PCWbh3gAAe85BDQ:P1 (envelope-from ) for ; Sun, 31 Mar 2024 23:04:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id +OOIO87PCWbh3gAAe85BDQ (envelope-from ) for ; Sun, 31 Mar 2024 23:04:15 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=j627qe+c; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1711919054; a=rsa-sha256; cv=none; b=o1EfaZXw/oj3pozn/ULTeB/Rz3ZKmzrkWEu10bRtYkdaNUz6/H5QogiZ6GxkwDRCUF7G2D OSJzoM9s64tB73wov6/94ReBAYNEyEQU8hwrJSSMs/4hY68m1eWihm+lOu7OOJeuAjgNe+ 3va/ol1A7rHYfCPVbQi1qupB/smoX9y0A5/xFOHik7U3WXagTvllpfcXPlTlZDMKSdbNcZ 6wxw1xsQQZW0hhZEM32iqQwSiBofYqYfIwf3HJaVDQL0LX3ceJ85eZ/rkk55KubmMTqicp +FwZn1BgB/pN3FJF9b+jRXhlMf+Z8tFCB7JGznj6w8c14rLrVnPrGWzixHV7pg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=j627qe+c; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1711919054; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=/CYaAXR0EMJdYlZoawXK3WUjkLyRucjOsXIdlNiaM5Y=; b=rNN6ijpeiT7olsAKpGaGnLZdtoqBx55WKG0b90I2FelPbsEmD6yixFLNHpwg1HPfSFaLzK XVNtQyZgMrFQZxZKkQWcGXNV5m4RjRG9Kz5fZjBdhgBhUFBX5ek9IFj5EjZqzucPtrxsiG 8IfnQOidaj4WE4hDD8lzj8Ogpb+noi+LiViF4ZPF2flezVqYiY4/ouwkk8qNRb5wGiUI6B ejEaR8vdwV1eQLd+/lR9pwarWSJajKcgaRRfg2rzJLF8Xdo+Qm1Y2SPnQxP8eJjW6LhRVw NRNi9Ug0yxQi6fibUJiv8RCL8owfAYJyiIz1NG5eMqvZW1Y97AzaL1ZfaHOQmQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A809D235A7 for ; Sun, 31 Mar 2024 23:04:14 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rr2LS-0005OJ-8a; Sun, 31 Mar 2024 17:04:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rr2LP-0005NK-MR for guix-patches@gnu.org; Sun, 31 Mar 2024 17:03:59 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rr2LP-0001Df-De for guix-patches@gnu.org; Sun, 31 Mar 2024 17:03:59 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rr2LR-0004I3-UH for guix-patches@gnu.org; Sun, 31 Mar 2024 17:04:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#69899] [PATCH 0/7] support to use `guix system vm' with riscv64. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 31 Mar 2024 21:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69899 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Zheng Junjie Cc: 69899@debbugs.gnu.org, Leo Famulari Received: via spool by 69899-submit@debbugs.gnu.org id=B69899.171191899316317 (code B ref 69899); Sun, 31 Mar 2024 21:04:01 +0000 Received: (at 69899) by debbugs.gnu.org; 31 Mar 2024 21:03:13 +0000 Received: from localhost ([127.0.0.1]:48669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr2Ke-0004F6-RY for submit@debbugs.gnu.org; Sun, 31 Mar 2024 17:03:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59050) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rr2Kc-0004Er-Cx for 69899@debbugs.gnu.org; Sun, 31 Mar 2024 17:03:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rr2KQ-0000Ze-GY; Sun, 31 Mar 2024 17:02:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=/CYaAXR0EMJdYlZoawXK3WUjkLyRucjOsXIdlNiaM5Y=; b=j627qe+cosXLIwxKXxtR lAeRc4ux3Ive75Aw41m4cyWnbbEiHyIB+CTAUgtjyMrAFlnIDAIAot0MrvXEPLgon0t6hzTOx4fzF qo6IH2eC0ofGpGTTUbYNvhLBZgcvhrveOY7f6qSIpie1teQaCZN51qlxnZzIA/1CewRssLIgfhW9j fE4U5bUQAZmIciGbaXUJCddVsMBh+F962ZfDBVeba4fCc/MxZEzxt0yDMuY+8Wn+r5jV4ZIAjkgt8 CBgF2iLZd6wrnKVggG5OBNE5YuaoZluGHGAr1jEc2/KWpDzR6Ag+VjAuxsQwTnw+PxlbtWgy6Yjmy yu0a50T3K9XP8Q==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <87ttksgheo.fsf@iscas.ac.cn> (Zheng Junjie's message of "Wed, 27 Mar 2024 17:15:26 +0800") References: <87ttksgheo.fsf@iscas.ac.cn> Date: Sun, 31 Mar 2024 23:02:54 +0200 Message-ID: <877chidsht.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: -6.96 X-Migadu-Queue-Id: A809D235A7 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.96 X-TUID: xe8di1E8/dQR --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Zheng Junjie skribis: > Leo Famulari writes: > >> Hi, thanks for these patches! >> >> On Tue, Mar 19, 2024 at 11:15:53PM +0800, Zheng Junjie wrote: >>> hello!. this patchset make `guix system vm --target=3Driscv64-linux-gnu= ' work. >>> and `guix system vm --system=3Driscv64-linux` also work, But there is a= problem >>> that the qemu running with --system=3Driscv64-linux is also riscv archi= tecture, >>> now you have to manually modify to use native qemu or the guix of qemu-= system >>> on qemu-user is too slow. and must enable qemu-binfmt. >> >> So, what should we do about the problem? What's the ideal solution for >> Guix? I don't have any experience with this subject matter. > > I've come up with two ideas: > > 1. Force the current system's qemu to be used, on x86_64 and -s > riscv64-linux, use x86_64's qemu. > 2. add an environment variable, GUIX_QEMU, to allow the internal qemu > execution to be replaced > > There may be other solutions, but I can't think of them yet. Thing is, =E2=80=98--system=3DX=E2=80=99 is supposed to be giving the exact= same result as if you were building natively on X. Thus, it=E2=80=99s not surprising that =E2=80=98guix system vm --system=3DX=E2=80=99 gives on a QEMU binary built = for X. Now, it=E2=80=99s admittedly not very useful in this case. I believe the attached patch implements #1 (I wasn=E2=80=99t able to test it yet because = too many things had to be built). How does it sound? --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/system/vm.scm b/gnu/system/vm.scm index 7d9d07ebb7..a2743453e7 100644 --- a/gnu/system/vm.scm +++ b/gnu/system/vm.scm @@ -287,8 +287,11 @@ (define* (system-qemu-image/shared-store-script os #~(format #f "/tmp/guix-image-~a" (basename #$base-image))) (define qemu-exec - #~(list #+(file-append qemu "/bin/" - (qemu-command (or target system))) + #~(list #+(with-parameters ((%current-system %system) + (%current-target-system #f)) + ;; Override %CURRENT-SYSTEM to always use a native emulator. + (file-append qemu "/bin/" + (qemu-command (or target system)))) ;; Tells qemu to use the terminal it was started in for IO. #$@(if graphic? '() #~("-nographic")) #$@(if full-boot? --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 DQpUaGFua3MsDQpMdWRv4oCZLg0K --=-=-=--