From owner-freebsd-riscv@freebsd.org Sun Sep 29 19:17:42 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6857D128027 for ; Sun, 29 Sep 2019 19:17:42 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hFfY2LYKz3Mq4; Sun, 29 Sep 2019 19:17:41 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f178.google.com with SMTP id 206so3177049ybc.8; Sun, 29 Sep 2019 12:17:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=3wwQsEgsfem2Cnvm7xInhLEgZVc+dmjZGbbeNKOInXs=; b=XoVYVHSfQAOtE7ftbS9RwHJNlSr3QvuAfi5Qc6QgcMypo51H5iSmL2FI6ucnfWqhsk 6h8rpW3McYkDDsjwMp0dDivWbRKJblYjw4GRMpasvlD/t/DT3RVK7+gep/gLojX2Z7KJ 9+7p1jZu9fWlW4RETBJIEjDnSF2df+VgBu9VjU/u9MH1fQezPh6ex0EBkVmtPsMxy2OM 2DAivgS6Htrxrz2510y1Z+UgdjoQXG33NgQNQ8ev6Ie21E5OTwiEcPypYUa5GkmY9m3r 6U/4pZAywC/2xO1RZCuo0m60ZuXbLrCrcDeACogxL0hC8LIGR747Hf8QFt93ozOzhNA0 PFHQ== X-Gm-Message-State: APjAAAUsBiswrDnPupLPVf/Hd0gQzXR+cS9148K3pAjk7ELG6FvKxjm+ YxC5OhDa56TcF17uA7Aa31T2DdzeDgmPUMQbuMS1UGP57M4= X-Google-Smtp-Source: APXvYqxbtTgUSc1wyTyP7kZx/YgSlBBy6amAPZO7wMW544V94ZcTd+voUxrEfKmP2UfxxRAJ5XmJ6/cRaLcsk39xJ/4= X-Received: by 2002:a25:4055:: with SMTP id n82mr11844858yba.127.1569784659457; Sun, 29 Sep 2019 12:17:39 -0700 (PDT) MIME-Version: 1.0 From: Li-Wen Hsu Date: Sun, 29 Sep 2019 21:17:26 +0200 Message-ID: Subject: QEMU 4.1 and RISC-V To: freebsd-riscv Cc: Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46hFfY2LYKz3Mq4 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.178 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-5.02 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-3.02)[ip: (-9.57), ipnet: 209.85.128.0/17(-3.28), asn: 15169(-2.17), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[178.219.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[178.219.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 19:17:42 -0000 I found that RISC-V test started failing recently: https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ After some checking, I found the issue is our bbl image cannot boot with this command: qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU version used in that job to 4.0, but I think it would be best if we can find the root cause is in FreeBSD or QEMU. Can anyone also help on this? Thanks, Li-Wen From owner-freebsd-riscv@freebsd.org Sun Sep 29 20:48:20 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2FD5712A00F for ; Sun, 29 Sep 2019 20:48:20 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hHg80Spkz3xZH; Sun, 29 Sep 2019 20:48:20 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id D087B16CCA; Sun, 29 Sep 2019 20:48:19 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-ot1-f49.google.com with SMTP id c10so6598338otd.9; Sun, 29 Sep 2019 13:48:19 -0700 (PDT) X-Gm-Message-State: APjAAAVRl7ZfjxFF0+H2Doax/QG1vejbl72mWRAwgq0n81OjL92Hadva gRI+h7F8WMDE8BkrpO3hk/xljnA8oVL/gqI0xQA= X-Google-Smtp-Source: APXvYqzaUq69yyAcliPzSJD110UaENE53Jpb918i9g9D4+mSDcoWeTChuEX/vQFzjSHjLJlkzRVqU8jRX1BQs8Ajj7Q= X-Received: by 2002:a9d:614d:: with SMTP id c13mr12034404otk.281.1569790098924; Sun, 29 Sep 2019 13:48:18 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mitchell Horne Date: Sun, 29 Sep 2019 16:48:07 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Li-Wen Hsu Cc: freebsd-riscv@freebsd.org, Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 20:48:20 -0000 On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: > I found that RISC-V test started failing recently: > https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ > > After some checking, I found the issue is our bbl image cannot boot > with this command: > > qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > > in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU > version used in that job to 4.0, but I think it would be best if we > can find the root cause is in FreeBSD or QEMU. > > Can anyone also help on this? > Hi Li-Wen, I can take a look in the coming week if you're okay with the workaround for the time being. Locally I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the CI script is doing. I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile than building bbl currently is. Best, Mitchell > Thanks, > Li-Wen > _______________________________________________ > freebsd-riscv@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-riscv > To unsubscribe, send any mail to "freebsd-riscv-unsubscribe@freebsd.org" > From owner-freebsd-riscv@freebsd.org Sun Sep 29 20:55:59 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98EEC12A27F for ; Sun, 29 Sep 2019 20:55:59 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hHqz3VXMz3xs6; Sun, 29 Sep 2019 20:55:59 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f195.google.com with SMTP id z7so3773104ybg.0; Sun, 29 Sep 2019 13:55:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S+m2OXVb3GEib2sDB5r1wxCfEhTIsuacYTVnYQFGCTQ=; b=tBQ5hKrYdPtUD5MIIrlBlaBfeChhFMGLocEQOjkSFFLqnB2bByypbKjeBpVTwY4SAE 66rajSlNwzMGZcn23sLpAfzScYmVaREt0SzLKMlewprdCrXUjobahxAsPXX08I0IyIbu cbAE+1lbwBKDkCupI+8YqdJstM/0wb4sSVK6BBTFYf8bUgjRU/gbqWKv37o2wavs3JK0 kkQEJ90/TemS17s6YmWQFxhdfmhpyQGD9aTMRxz/nLiy8my5WBLyBeVjgs6U9PBN9TZ8 gKRKjox069r9tpoAHntd+IBrDrIjNh5hGokH57jqPunuZmrSCSWXWDncvPsftzn6Dg8x mFaw== X-Gm-Message-State: APjAAAUwLp9KDY94ve3paTOEkkYM90AsWjTv2/CjqD5RxUIuVGR/A0Cx bTEr1p2dP4GPbYyRnYGchQ7jFBHDi6bn+FSLVXsLheLiypY= X-Google-Smtp-Source: APXvYqwLQ5SNZN0d6ZiF11ulEcPWF7dt2wzUOxHWNjDMHLpe9ZiL9S/mEwgARWDVGkbbFZRdkCi+Dgp9KtN39OQ69z8= X-Received: by 2002:a25:7089:: with SMTP id l131mr12981775ybc.110.1569790558076; Sun, 29 Sep 2019 13:55:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Li-Wen Hsu Date: Sun, 29 Sep 2019 22:55:43 +0200 Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Mitchell Horne Cc: freebsd-riscv , Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46hHqz3VXMz3xs6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Sep 2019 20:55:59 -0000 On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: > > > On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: >> >> I found that RISC-V test started failing recently: >> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ >> >> After some checking, I found the issue is our bbl image cannot boot >> with this command: >> >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl >> >> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU >> version used in that job to 4.0, but I think it would be best if we >> can find the root cause is in FreeBSD or QEMU. >> >> Can anyone also help on this? > > > Hi Li-Wen, > > I can take a look in the coming week if you're okay with the workaround for the time being. Locally > I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the > CI script is doing. > > I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. > I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to > create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile > than building bbl currently is. Thanks very much, Mitchell, Let's narrow down the scope, are you using the qemu-devel pkg from official repository or building by yourself? And can you try this bbl image? https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz Best, Li-Wen From owner-freebsd-riscv@freebsd.org Mon Sep 30 02:12:56 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8875FF811B for ; Mon, 30 Sep 2019 02:12:56 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hQsh2wQFz4Cjh; Mon, 30 Sep 2019 02:12:56 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 358B51924E; Mon, 30 Sep 2019 02:12:56 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-oi1-f176.google.com with SMTP id e18so9793902oii.0; Sun, 29 Sep 2019 19:12:56 -0700 (PDT) X-Gm-Message-State: APjAAAUtuTrc9416ebuGub8tW4vCbVdDGtAnuXXHYNpsEogO6hIlqg9v rZG2UATzHTcQEhwIlbK6ocsfhxj0W5aLaJLhd/I= X-Google-Smtp-Source: APXvYqxdEsLy2tSUAxqtmk1B7nsETu3nFUmqE98QDLsqsuwViSKdjPcCntK7ZXm6ig78Cp76IGJe+jYEqOAZK53/qkQ= X-Received: by 2002:aca:c4d3:: with SMTP id u202mr15360110oif.139.1569809575213; Sun, 29 Sep 2019 19:12:55 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mitchell Horne Date: Sun, 29 Sep 2019 22:12:43 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Li-Wen Hsu Cc: freebsd-riscv , Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 02:12:56 -0000 On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu wrote: > > On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: > > > > > > On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: > >> > >> I found that RISC-V test started failing recently: > >> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ > >> > >> After some checking, I found the issue is our bbl image cannot boot > >> with this command: > >> > >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > >> > >> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU > >> version used in that job to 4.0, but I think it would be best if we > >> can find the root cause is in FreeBSD or QEMU. > >> > >> Can anyone also help on this? > > > > > > Hi Li-Wen, > > > > I can take a look in the coming week if you're okay with the workaround for the time being. Locally > > I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the > > CI script is doing. > > > > I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. > > I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to > > create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile > > than building bbl currently is. > > Thanks very much, Mitchell, > > Let's narrow down the scope, are you using the qemu-devel pkg from > official repository or building by yourself? > This was using qemu that I had built myself, but the executable from qemu-devel works for me as well. > > And can you try this bbl image? > https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz I had no issue booting this image with my self-built qemu or the one from pkg. The only observable difference from qemu 3.1 is that a warning is printed to stderr, but considering the CI script is timing out I don't think that is the issue. > Best, > Li-Wen From owner-freebsd-riscv@freebsd.org Mon Sep 30 02:28:32 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71A09F84FD for ; Mon, 30 Sep 2019 02:28:32 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f195.google.com (mail-yb1-f195.google.com [209.85.219.195]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hRCh2Lpzz4D4r; Mon, 30 Sep 2019 02:28:31 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f195.google.com with SMTP id p11so3930089ybc.1; Sun, 29 Sep 2019 19:28:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=o2QXg9JBUxcgYDLINkZO0FWZNq1e4vgmaf5TI2XRr60=; b=VG7uHnicKGNaNmQJuJnfEBcoiKjYhkQCGS2cJtZsXYXheZHwovV/xXRo2d9ODUz43F NmxQi/NflNCErVhmQlnADwdts2po3gbnV0aFe7XUov9c6mZjdm1O3gfiedD188HoANOJ QntyUya95EtGAp8r9J1EbNaBHikD1vbv8cVE2rL0r7+MbyW0V1Z9qwJ4rklcb0xbDKW9 Gq3oMzi/i+xkFhgauO023AldV7BInyf+DvoIQfYAr3Qm19ysUqg3gljx1d9+RL5gzAaF j8DP9vwWNLO0z3rCk7HpvVP7HY3x+9NpC8o/cL0g6083m8Agxjm44KywWNGlyAizAdrc qC2g== X-Gm-Message-State: APjAAAXv4jxD0FmnXxR1ARt6tHV/9wkuMqaRI4HmoSczyeJkajfnogCV 1K1ZfO9gGxQtk04dXrnfYm4fbHqJCHII+m5m4MK6u8RWX30= X-Google-Smtp-Source: APXvYqwJj/LlPo50Oo64jzdrE63L6QEnwd+b00TkSlm/U56UllyDJMv+KwobcvMfheB1WA7OlArLLi1R9pHaZt058d0= X-Received: by 2002:a25:af09:: with SMTP id a9mr14205799ybh.405.1569810510290; Sun, 29 Sep 2019 19:28:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Li-Wen Hsu Date: Mon, 30 Sep 2019 04:28:17 +0200 Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Mitchell Horne Cc: freebsd-riscv , Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46hRCh2Lpzz4D4r X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 02:28:32 -0000 On Mon, Sep 30, 2019 at 4:12 AM Mitchell Horne wrote: > > On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu wrote: > > > > On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: > > > > > > > > > On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: > > >> > > >> I found that RISC-V test started failing recently: > > >> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ > > >> > > >> After some checking, I found the issue is our bbl image cannot boot > > >> with this command: > > >> > > >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > > >> > > >> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU > > >> version used in that job to 4.0, but I think it would be best if we > > >> can find the root cause is in FreeBSD or QEMU. > > >> > > >> Can anyone also help on this? > > > > > > > > > Hi Li-Wen, > > > > > > I can take a look in the coming week if you're okay with the workaround for the time being. Locally > > > I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the > > > CI script is doing. > > > > > > I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. > > > I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to > > > create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile > > > than building bbl currently is. > > > > Thanks very much, Mitchell, > > > > Let's narrow down the scope, are you using the qemu-devel pkg from > > official repository or building by yourself? > > > > This was using qemu that I had built myself, but the executable from qemu-devel > works for me as well. > > > And can you try this bbl image? > > https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz > > I had no issue booting this image with my self-built qemu or the one from > pkg. The only observable difference from qemu 3.1 is that a warning is > printed to stderr, but considering the CI script is timing out I don't think > that is the issue. What's your command line to launch qemu? The CI (and I) uses this: qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl I also tried to build qemu locally, and result is the same. I also did a git bisect: 0ac24d56c5e7d32423ea78ac58a06b444d1df04d is the first bad commit commit 0ac24d56c5e7d32423ea78ac58a06b444d1df04d Author: Alistair Francis Date: Mon Jun 24 15:11:49 2019 -0700 hw/riscv: Split out the boot functions Split the common RISC-V boot functions into a seperate file. This allows us to share the common code. Signed-off-by: Alistair Francis Reviewed-by: Bin Meng Tested-by: Bin Meng Signed-off-by: Palmer Dabbelt hw/riscv/Makefile.objs | 1 + hw/riscv/boot.c | 69 +++++++++++++++++++++++++++++++++++++++++++++++++ hw/riscv/sifive_e.c | 17 ++---------- hw/riscv/sifive_u.c | 17 ++---------- hw/riscv/spike.c | 21 +++------------ hw/riscv/virt.c | 51 ++++-------------------------------- include/hw/riscv/boot.h | 27 +++++++++++++++++++ 7 files changed, 110 insertions(+), 93 deletions(-) create mode 100644 hw/riscv/boot.c create mode 100644 include/hw/riscv/boot.h From owner-freebsd-riscv@freebsd.org Mon Sep 30 02:54:44 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0134F90B0 for ; Mon, 30 Sep 2019 02:54:44 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f194.google.com (mail-yb1-f194.google.com [209.85.219.194]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hRnw0w8Lz4FYJ; Mon, 30 Sep 2019 02:54:43 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f194.google.com with SMTP id f1so3786531ybq.11; Sun, 29 Sep 2019 19:54:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pfesyDFVTF2pC/Hfte+Cf8hT6G1DEGvceW5KcruM3b0=; b=tsG5UAGO5DEfEmj8iZv8o928Z8mNdQFME8I/zebaodCieFaGC0+dhFwqSFWVS86xxc LvpxuZiFF0gSFucZl4a6Xub7C2iJZJXAWwDGepvpen+jFzyTOat0hQntlrzswwG/XnIF qcfPxcnrWZ/NQegpuw5r9aB418bcMIS0huNCRugkZ6DOosgK/nEOhyCzmvAIszqPDcKA heg/VmB6VL4dKn8Wc/sjNlrYfHD0OdVhrUytBiCo+fm/Vmr1U9DvxXpuqJ/bwrOX3d1Z N04Isog8OHzcezMNQ8diwPUh6owgerLJOxT2nSAW3N2jtGSk7NTs7AzghUVTx+SGl8ge zuXA== X-Gm-Message-State: APjAAAXgp3k/1I3/JJm4dot5echfQ9m94SBDm9mtl5VlfgYlZq42N3Rw p4YiPIzDeoP2fpBwgLGz3VMV6lOLu9/naHgRKUcm0W460uc= X-Google-Smtp-Source: APXvYqyZp7v8alIhOYtNbHgD3qnPwqZ7r9HQ7O1YnkBAuWOYILGchcG53Ot5qQGERIvZ7uOQSmi85X1j5JmaQN57sTk= X-Received: by 2002:a25:7089:: with SMTP id l131mr13608214ybc.110.1569812082319; Sun, 29 Sep 2019 19:54:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Li-Wen Hsu Date: Mon, 30 Sep 2019 04:54:30 +0200 Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Mitchell Horne Cc: freebsd-riscv , Muhammad Moinur Rahman Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 46hRnw0w8Lz4FYJ X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.194 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-3.10 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-1.10)[ipnet: 209.85.128.0/17(-3.28), asn: 15169(-2.17), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[194.219.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[194.219.85.209.rep.mailspike.net : 127.0.0.17]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 02:54:45 -0000 On Mon, Sep 30, 2019 at 4:28 AM Li-Wen Hsu wrote: > > On Mon, Sep 30, 2019 at 4:12 AM Mitchell Horne wrote: > > > > On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu wrote: > > > > > > On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: > > > > > > > > > > > > On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: > > > >> > > > >> I found that RISC-V test started failing recently: > > > >> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ > > > >> > > > >> After some checking, I found the issue is our bbl image cannot boot > > > >> with this command: > > > >> > > > >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > > > >> > > > >> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU > > > >> version used in that job to 4.0, but I think it would be best if we > > > >> can find the root cause is in FreeBSD or QEMU. > > > >> > > > >> Can anyone also help on this? > > > > > > > > > > > > Hi Li-Wen, > > > > > > > > I can take a look in the coming week if you're okay with the workaround for the time being. Locally > > > > I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the > > > > CI script is doing. > > > > > > > > I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. > > > > I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to > > > > create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile > > > > than building bbl currently is. > > > > > > Thanks very much, Mitchell, > > > > > > Let's narrow down the scope, are you using the qemu-devel pkg from > > > official repository or building by yourself? > > > > > > > This was using qemu that I had built myself, but the executable from qemu-devel > > works for me as well. > > > > > And can you try this bbl image? > > > https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz > > > > I had no issue booting this image with my self-built qemu or the one from > > pkg. The only observable difference from qemu 3.1 is that a warning is > > printed to stderr, but considering the CI script is timing out I don't think > > that is the issue. > > What's your command line to launch qemu? The CI (and I) uses this: > > qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > > I also tried to build qemu locally, and result is the same. I also did > a git bisect: > > 0ac24d56c5e7d32423ea78ac58a06b444d1df04d is the first bad commit Hmm, after checking with wiki.freebsd.org/riscv, I found that we need to specify `-machine virt` now. QEMU 4.1 default machine for riscv64 is "spike" not "spike_v1.10" anymore, and need other more arguments. From owner-freebsd-riscv@freebsd.org Mon Sep 30 03:07:16 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1A1FF95D0 for ; Mon, 30 Sep 2019 03:07:16 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from atl4mhob23.registeredsite.com (atl4mhob23.registeredsite.com [209.17.115.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.registeredsite.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hS4M57Nyz4GGy for ; Mon, 30 Sep 2019 03:07:15 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from mailpod.hostingplatform.com (atl4qobmail01pod2.registeredsite.com [10.30.77.35]) by atl4mhob23.registeredsite.com (8.14.4/8.14.4) with ESMTP id x8U37BJW106109 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 29 Sep 2019 23:07:11 -0400 Received: (qmail 28463 invoked by uid 0); 30 Sep 2019 03:07:11 -0000 X-TCPREMOTEIP: 99.253.177.25 X-Authenticated-UID: dclarke@blastwave.org Received: from unknown (HELO ?172.16.35.3?) (dclarke@blastwave.org@99.253.177.25) by 0 with ESMTPA; 30 Sep 2019 03:07:11 -0000 Subject: Re: QEMU 4.1 and RISC-V To: freebsd-riscv@freebsd.org References: From: Dennis Clarke Message-ID: <1bc10ee3-b717-61a9-2e5d-7fb8538234f2@blastwave.org> Date: Sun, 29 Sep 2019 23:07:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46hS4M57Nyz4GGy X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dclarke@blastwave.org has no SPF policy when checking 209.17.115.117) smtp.mailfrom=dclarke@blastwave.org X-Spamd-Result: default: False [4.39 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[117.115.17.209.rep.mailspike.net : 127.0.0.17]; FROM_HAS_DN(0.00)[]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.1.134.160]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_MEDIUM(0.92)[0.923,0]; NEURAL_SPAM_LONG(0.99)[0.992,0]; RCVD_IN_DNSWL_NONE(0.00)[117.115.17.209.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; DMARC_NA(0.00)[blastwave.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:19871, ipnet:209.17.112.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.58)[ip: (4.21), ipnet: 209.17.112.0/21(2.07), asn: 19871(1.66), country: US(-0.05)]; SH_EMAIL_ZRD(0.00)[0.1.134.160] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 03:07:17 -0000 On 9/29/19 10:54 PM, Li-Wen Hsu wrote: > On Mon, Sep 30, 2019 at 4:28 AM Li-Wen Hsu wrote: >> >> On Mon, Sep 30, 2019 at 4:12 AM Mitchell Horne wrote: >>> >>> On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu wrote: >>>> >>>> On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: >>>>> >>>>> >>>>> On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: >>>>>> >>>>>> I found that RISC-V test started failing recently: >>>>>> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ >>>>>> >>>>>> After some checking, I found the issue is our bbl image cannot boot >>>>>> with this command: >>>>>> >>>>>> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl >>>>>> >>>>>> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU >>>>>> version used in that job to 4.0, but I think it would be best if we >>>>>> can find the root cause is in FreeBSD or QEMU. >>>>>> >>>>>> Can anyone also help on this? >>>>> >>>>> >>>>> Hi Li-Wen, >>>>> >>>>> I can take a look in the coming week if you're okay with the workaround for the time being. Locally >>>>> I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the >>>>> CI script is doing. >>>>> >>>>> I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. >>>>> I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to >>>>> create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile >>>>> than building bbl currently is. >>>> >>>> Thanks very much, Mitchell, >>>> >>>> Let's narrow down the scope, are you using the qemu-devel pkg from >>>> official repository or building by yourself? >>>> >>> >>> This was using qemu that I had built myself, but the executable from qemu-devel >>> works for me as well. >>> >>>> And can you try this bbl image? >>>> https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz >>> >>> I had no issue booting this image with my self-built qemu or the one from >>> pkg. The only observable difference from qemu 3.1 is that a warning is >>> printed to stderr, but considering the CI script is timing out I don't think >>> that is the issue. >> >> What's your command line to launch qemu? The CI (and I) uses this: >> >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl >> >> I also tried to build qemu locally, and result is the same. I also did >> a git bisect: >> >> 0ac24d56c5e7d32423ea78ac58a06b444d1df04d is the first bad commit > > Hmm, after checking with wiki.freebsd.org/riscv, I found that we need > to specify `-machine virt` now. > > QEMU 4.1 default machine for riscv64 is "spike" not "spike_v1.10" > anymore, and need other more arguments. This works for me but I would switch over to "spike" if that is the forward looking plan : styx$ styx$ ls -l bbl rv64imafdc_disk0.img -rw-r--r-- 1 riscv riscv 10660264 Aug 28 00:31 bbl -rw-r--r-- 1 riscv riscv 34359738368 Sep 11 06:54 rv64imafdc_disk0.img styx$ qemu-system-riscv64 -nographic -machine virt \ > -smp 2 -m 4G \ > -kernel /home/riscv/qemu/bbl \ > -object rng-random,filename=/dev/urandom,id=rng0 \ > -device virtio-rng-device,rng=rng0 \ > -drive file=/home/riscv/qemu/rv64imafdc_disk0.img,format=raw,index=0,media=disk,id=hd0 \ > -device virtio-blk-device,drive=hd0 \ > -device virtio-net-device,netdev=usernet \ > -netdev user,id=usernet,hostfwd=tcp::10000-:22 bbl loader ---<>--- KDB: debugger backends: ddb KDB: current backend: ddb Found 2 CPUs in the device tree Copyright (c) 1992-2019 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 13.0-CURRENT r350568 QEMU riscv gcc version 8.1.0 (FreeBSD Ports Collection for riscv64) WARNING: WITNESS option enabled, expect reduced performance. Preloaded elf64 kernel "kernel" at 0xffffffc0007e1cc0. CPU(0): Unknown Implementer Unknown Processor real memory = 4293918720 (4095 MB) Physical memory chunk(s): 0x0000000080a42000 - 0x0000000080bfffff, 1826816 bytes (446 pages) 0x0000000080d00000 - 0x00000001797c5fff, 4172046336 bytes (1018566 pages) avail memory = 4156452864 (3963 MB) Starting CPU 1 (hart 0) FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled. VIMAGE (virtualized network stack) enabled ULE: setup cpu 0 ULE: setup cpu 1 random: entropy device external interface nfslock: pseudo-device crypto: null: mem: openfirm: ofwbus0: simplebus0: on ofwbus0 plic0: mem 0xc000000-0xfffffff irq 9,10,11,12 on simplebus0 timer0: Timecounter "RISC-V Timecounter" frequency 10000000 Hz quality 1000 Event timer "RISC-V Eventtimer" frequency 10000000 Hz quality 1000 rcons0: ofwbus0: no default resources for rid = 0, type = 4 ofwbus0: no default resources for rid = 0, type = 4 ofwbus0: no default resources for rid = 0, type = 4 uart0: <16550 or compatible> mem 0x10000000-0x100000ff irq 0 on ofwbus0 uart0: console (76800,n,8,1) uart0: fast interrupt uart0: PPS capture mode: DCD ofwbus0: mem 0x100000-0x100fff compat sifive,test0 (no driver attached) virtio_mmio0: mem 0x10008000-0x10008fff irq 1 on ofwbus0 virtio_mmio1: mem 0x10007000-0x10007fff irq 2 on ofwbus0 vtblk0: on virtio_mmio1 virtio_mmio1: host features: 0x31000ed4 virtio_mmio1: negotiated features: 0x10000e54 vtblk0: 32768MB (67108864 512 byte sectors) virtio_mmio2: mem 0x10006000-0x10006fff irq 3 on ofwbus0 vtnet0: on virtio_mmio2 virtio_mmio2: host features: 0x39bf8064 virtio_mmio2: negotiated features: 0x308f8060 vtnet0: bpf attached vtnet0: Ethernet address: 52:54:00:12:34:56 virtio_mmio3: mem 0x10005000-0x10005fff irq 4 on ofwbus0 virtio_mmio4: mem 0x10004000-0x10004fff irq 5 on ofwbus0 virtio_mmio5: mem 0x10003000-0x10003fff irq 6 on ofwbus0 virtio_mmio6: mem 0x10002000-0x10002fff irq 7 on ofwbus0 virtio_mmio7: mem 0x10001000-0x10001fff irq 8 on ofwbus0 cpulist0: on ofwbus0 cpu0: on cpulist0 cpu0: Nominal frequency 1000Mhz riscv64_cpu0: register <0> cpu1: on cpulist0 cpu1: Nominal frequency 1000Mhz riscv64_cpu1: register <1> cryptosoft0: crypto: assign cryptosoft0 driver id 0, flags 0x6000000 crypto: cryptosoft0 registers alg 1 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 2 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 3 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 4 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 5 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 16 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 6 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 7 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 32 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 18 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 19 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 20 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 8 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 15 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 9 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 10 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 13 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 14 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 34 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 35 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 36 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 37 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 11 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 22 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 23 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 25 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 24 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 26 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 27 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 28 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 21 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 17 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 29 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 30 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 31 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 40 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 39 flags 0 maxoplen 0 crypto: cryptosoft0 registers alg 38 flags 0 maxoplen 0 Device configuration finished. procfs registered Timecounters tick every 10.000 msec vlan: initialized, using hash tables with chaining lo0: bpf attached tcp_init: net.inet.tcp.tcbhashsize auto tuned to 32768 IPsec: Initialized Security Association Processing. GEOM: new disk vtbd0 Trying to mount root from ufs:/dev/vtbd0 []... Release APs CPU(1): Unknown Implementer Unknown Processor WARNING: WITNESS option enabled, expect reduced performance. Warning: no time-of-day clock registered, system time will not be set accurately start_init: trying /sbin/init . . . -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional From owner-freebsd-riscv@freebsd.org Mon Sep 30 10:58:49 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2CC17123FD2 for ; Mon, 30 Sep 2019 10:58:49 +0000 (UTC) (envelope-from bofh@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hfXT0JYWz3DGM; Mon, 30 Sep 2019 10:58:49 +0000 (UTC) (envelope-from bofh@FreeBSD.org) Received: from mail.dzcrd.net (mail.dzcrd.net [IPv6:2001:19f0:5001:37ef:5400:2ff:fe21:cb88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bofh/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id B377B1D32D; Mon, 30 Sep 2019 10:58:48 +0000 (UTC) (envelope-from bofh@FreeBSD.org) Received: from [192.168.1.231] (unknown [103.86.201.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: moin@bofh.im) by mail.dzcrd.net (Postfix) with ESMTPSA id 02EF911253C; Mon, 30 Sep 2019 10:58:44 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: QEMU 4.1 and RISC-V From: Muhammad Moinur Rahman In-Reply-To: Date: Mon, 30 Sep 2019 16:58:41 +0600 Cc: Mitchell Horne , freebsd-riscv X-Mao-Original-Outgoing-Id: 591533921.000921-55762e9b637374d0bc48f0de62dd5278 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Li-Wen Hsu X-Mailer: Apple Mail (2.3445.104.11) X-Spamd-Bar: / X-Spam-Status: No, score=0.40 X-Rspamd-Server: mail.dzcrd.net X-Spam-Score: 0.40 X-Rspamd-Queue-Id: 02EF911253C X-Spamd-Result: default: False [0.40 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; TO_DN_ALL(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:136416, ipnet:103.86.201.0/24, country:BD]; MID_RHS_MATCH_FROM(0.00)[] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 10:58:49 -0000 Hi Li-Wen, Should we add this to pkg-message for 4.1.X? Kind Regards, @bofh > On 30 Sep, 2019, at 08:54, Li-Wen Hsu wrote: >=20 > On Mon, Sep 30, 2019 at 4:28 AM Li-Wen Hsu wrote: >>=20 >> On Mon, Sep 30, 2019 at 4:12 AM Mitchell Horne = wrote: >>>=20 >>> On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu = wrote: >>>>=20 >>>> On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne = wrote: >>>>>=20 >>>>>=20 >>>>> On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: >>>>>>=20 >>>>>> I found that RISC-V test started failing recently: >>>>>> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ >>>>>>=20 >>>>>> After some checking, I found the issue is our bbl image cannot = boot >>>>>> with this command: >>>>>>=20 >>>>>> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl >>>>>>=20 >>>>>> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU >>>>>> version used in that job to 4.0, but I think it would be best if = we >>>>>> can find the root cause is in FreeBSD or QEMU. >>>>>>=20 >>>>>> Can anyone also help on this? >>>>>=20 >>>>>=20 >>>>> Hi Li-Wen, >>>>>=20 >>>>> I can take a look in the coming week if you're okay with the = workaround for the time being. Locally >>>>> I've had no issue running bbl with qemu 4.1 but perhaps there's = something more specific that the >>>>> CI script is doing. >>>>>=20 >>>>> I'm hoping we will soon be able to replace bbl with the more = actively maintained OpenSBI firmware. >>>>> I have some pending changes that will allow us to boot FreeBSD = with it, and after that I'd like to >>>>> create ports for both bootloaders, which I hope will make the CI = setup a little simpler and less fragile >>>>> than building bbl currently is. >>>>=20 >>>> Thanks very much, Mitchell, >>>>=20 >>>> Let's narrow down the scope, are you using the qemu-devel pkg from >>>> official repository or building by yourself? >>>>=20 >>>=20 >>> This was using qemu that I had built myself, but the executable from = qemu-devel >>> works for me as well. >>>=20 >>>> And can you try this bbl image? >>>> = https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz= >>>=20 >>> I had no issue booting this image with my self-built qemu or the one = from >>> pkg. The only observable difference from qemu 3.1 is that a warning = is >>> printed to stderr, but considering the CI script is timing out I = don't think >>> that is the issue. >>=20 >> What's your command line to launch qemu? The CI (and I) uses this: >>=20 >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl >>=20 >> I also tried to build qemu locally, and result is the same. I also = did >> a git bisect: >>=20 >> 0ac24d56c5e7d32423ea78ac58a06b444d1df04d is the first bad commit >=20 > Hmm, after checking with wiki.freebsd.org/riscv, I found that we need > to specify `-machine virt` now. >=20 > QEMU 4.1 default machine for riscv64 is "spike" not "spike_v1.10" > anymore, and need other more arguments. From owner-freebsd-riscv@freebsd.org Mon Sep 30 22:08:43 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D49A51337C3 for ; Mon, 30 Sep 2019 22:08:43 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46hxPR5D7Bz4VhT; Mon, 30 Sep 2019 22:08:43 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: mhorne) by smtp.freebsd.org (Postfix) with ESMTPSA id 7F2762A086; Mon, 30 Sep 2019 22:08:43 +0000 (UTC) (envelope-from mhorne@freebsd.org) Received: by mail-ot1-f49.google.com with SMTP id g103so2462527otg.0; Mon, 30 Sep 2019 15:08:43 -0700 (PDT) X-Gm-Message-State: APjAAAU8nOF0lfwhcchl6UszYJnRJ/yNcAT2m85RlzJjzx3xTmibEMjL seilpxpUiyZEMy6Etzd9xYGmF1EyDHiS+skqCKU= X-Google-Smtp-Source: APXvYqwOK0O5H3pE/zJr9jSKK4pp+wSHmOegTssenE6SCI7BtflnHLQU8r9+1em4nhl5aJbzu327rQBajyUOYlZ9ZLM= X-Received: by 2002:a9d:518b:: with SMTP id y11mr14859246otg.344.1569881322635; Mon, 30 Sep 2019 15:08:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Mitchell Horne Date: Mon, 30 Sep 2019 18:08:21 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: QEMU 4.1 and RISC-V To: Muhammad Moinur Rahman Cc: Li-Wen Hsu , freebsd-riscv Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Sep 2019 22:08:43 -0000 On Mon, Sep 30, 2019 at 6:58 AM Muhammad Moinur Rahman wrote: > > Hi Li-Wen, > Should we add this to pkg-message for 4.1.X? > Kind Regards, > @bofh I don't think it's necessary. There are only a small number of FreeBSD/RISC-V users, and it is likely that they will avoid this issue altogether if they are following our wiki page. Mitchell > > > On 30 Sep, 2019, at 08:54, Li-Wen Hsu wrote: > > > > On Mon, Sep 30, 2019 at 4:28 AM Li-Wen Hsu wrote: > >> > >> On Mon, Sep 30, 2019 at 4:12 AM Mitchell Horne wrote: > >>> > >>> On Sun, Sep 29, 2019 at 4:56 PM Li-Wen Hsu wrote: > >>>> > >>>> On Sun, Sep 29, 2019 at 10:48 PM Mitchell Horne wrote: > >>>>> > >>>>> > >>>>> On Sun, Sep 29, 2019, 15:17 Li-Wen Hsu wrote: > >>>>>> > >>>>>> I found that RISC-V test started failing recently: > >>>>>> https://ci.freebsd.org/job/FreeBSD-head-riscv64-test/ > >>>>>> > >>>>>> After some checking, I found the issue is our bbl image cannot boot > >>>>>> with this command: > >>>>>> > >>>>>> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > >>>>>> > >>>>>> in QEMU 4.1, while 3.1 and 4.0 are fine. I've switched the QEMU > >>>>>> version used in that job to 4.0, but I think it would be best if we > >>>>>> can find the root cause is in FreeBSD or QEMU. > >>>>>> > >>>>>> Can anyone also help on this? > >>>>> > >>>>> > >>>>> Hi Li-Wen, > >>>>> > >>>>> I can take a look in the coming week if you're okay with the workaround for the time being. Locally > >>>>> I've had no issue running bbl with qemu 4.1 but perhaps there's something more specific that the > >>>>> CI script is doing. > >>>>> > >>>>> I'm hoping we will soon be able to replace bbl with the more actively maintained OpenSBI firmware. > >>>>> I have some pending changes that will allow us to boot FreeBSD with it, and after that I'd like to > >>>>> create ports for both bootloaders, which I hope will make the CI setup a little simpler and less fragile > >>>>> than building bbl currently is. > >>>> > >>>> Thanks very much, Mitchell, > >>>> > >>>> Let's narrow down the scope, are you using the qemu-devel pkg from > >>>> official repository or building by yourself? > >>>> > >>> > >>> This was using qemu that I had built myself, but the executable from qemu-devel > >>> works for me as well. > >>> > >>>> And can you try this bbl image? > >>>> https://artifact.ci.freebsd.org/snapshot/head/r352870/riscv/riscv64/bbl.xz > >>> > >>> I had no issue booting this image with my self-built qemu or the one from > >>> pkg. The only observable difference from qemu 3.1 is that a warning is > >>> printed to stderr, but considering the CI script is timing out I don't think > >>> that is the issue. > >> > >> What's your command line to launch qemu? The CI (and I) uses this: > >> > >> qemu-system-riscv64 -nographic -m 2048M -kernel ./bbl > >> > >> I also tried to build qemu locally, and result is the same. I also did > >> a git bisect: > >> > >> 0ac24d56c5e7d32423ea78ac58a06b444d1df04d is the first bad commit > > > > Hmm, after checking with wiki.freebsd.org/riscv, I found that we need > > to specify `-machine virt` now. > > > > QEMU 4.1 default machine for riscv64 is "spike" not "spike_v1.10" > > anymore, and need other more arguments. > From owner-freebsd-riscv@freebsd.org Tue Oct 1 21:07:09 2019 Return-Path: Delivered-To: freebsd-riscv@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 85E80F8909 for ; Tue, 1 Oct 2019 21:07:09 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from atl4mhob22.registeredsite.com (atl4mhob22.registeredsite.com [209.17.115.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.registeredsite.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46jWzw4DCbz4Q0H for ; Tue, 1 Oct 2019 21:07:08 +0000 (UTC) (envelope-from dclarke@blastwave.org) Received: from mailpod.hostingplatform.com (atl4qobmail02pod2.registeredsite.com [10.30.77.36]) by atl4mhob22.registeredsite.com (8.14.4/8.14.4) with ESMTP id x91L76Bf160021 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Tue, 1 Oct 2019 17:07:06 -0400 Received: (qmail 10703 invoked by uid 0); 1 Oct 2019 21:07:06 -0000 X-TCPREMOTEIP: 99.253.177.25 X-Authenticated-UID: dclarke@blastwave.org Received: from unknown (HELO ?172.16.35.3?) (dclarke@blastwave.org@99.253.177.25) by 0 with ESMTPA; 1 Oct 2019 21:07:06 -0000 Subject: Re: QEMU 4.1 and RISC-V To: freebsd-riscv@freebsd.org References: From: Dennis Clarke Message-ID: <22daa923-158d-f06a-0807-48dd32a813ec@blastwave.org> Date: Tue, 1 Oct 2019 17:07:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:70.0) Gecko/20100101 Thunderbird/70.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46jWzw4DCbz4Q0H X-Spamd-Bar: ++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of dclarke@blastwave.org has no SPF policy when checking 209.17.115.116) smtp.mailfrom=dclarke@blastwave.org X-Spamd-Result: default: False [4.56 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-riscv@freebsd.org]; TO_DN_NONE(0.00)[]; AUTH_NA(1.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_THREE(0.00)[3]; RCVD_TLS_LAST(0.00)[]; NEURAL_SPAM_MEDIUM(0.97)[0.970,0]; NEURAL_SPAM_LONG(0.98)[0.982,0]; RCVD_IN_DNSWL_NONE(0.00)[116.115.17.209.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; DMARC_NA(0.00)[blastwave.org]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:19871, ipnet:209.17.112.0/21, country:US]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(1.71)[ip: (4.88), ipnet: 209.17.112.0/21(2.07), asn: 19871(1.66), country: US(-0.05)]; RWL_MAILSPIKE_POSSIBLE(0.00)[116.115.17.209.rep.mailspike.net : 127.0.0.17] X-BeenThere: freebsd-riscv@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD on the RISC-V instruction set architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2019 21:07:09 -0000 On 9/30/19 6:08 PM, Mitchell Horne wrote: > On Mon, Sep 30, 2019 at 6:58 AM Muhammad Moinur Rahman wrote: >> >> Hi Li-Wen, >> Should we add this to pkg-message for 4.1.X? >> Kind Regards, >> @bofh > > I don't think it's necessary. There are only a small number of > FreeBSD/RISC-V users, and Don't be that guy. Don't. There may be a small number of users today but RISC-V is hardly a small edge case project. So a line of text somewhere is harmless and even helpful. -- Dennis Clarke RISC-V/SPARC/PPC/ARM/CISC UNIX and Linux spoken GreyBeard and suspenders optional