From patchwork Mon Sep 28 10:17:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1372508 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Txe4HrkF; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=u/jts8dW; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=ICWVCYzX; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C0JPb3PVfz9ryj for ; Mon, 28 Sep 2020 20:18:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Date:Message-ID:Subject:From:To: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ZCrQlVBK+inD0iekLJF+Pd3bP6MIMQ9RX3YT0U4ucE4=; b=Txe4HrkFl+XS29NZdvdTxFtfD8 itxBwWVp/EpzCq0loeBTl7B00KhxdQP0XPghVErGjrU1guaFUI/ERCb+50g/bi5V9GN2VgCj0axJN HIKx729MXFhxNHapA9GSljGDWUZaJudb7ySmFLz4wfMAz5MmrkFtQbCwzedsG9OltHczaAwKbgCZH fRKEVFoHGJawZWVCcqYHscByiRoDMZF/TQK7feuoSFcB6UoouwdPS26xbaLolN86vyfclKkBllZjd NRBAfVVcmFi3kVvA/GlP5A/4wPb3KjA7G5W+/QvXo/OjB/Daszd2cem8Mgm6EaeDKicLrfEq1TvCI gf0mY61Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMqEP-0004oE-RS; Mon, 28 Sep 2020 10:18:05 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMqEO-0004o1-3S for opensbi@merlin.infradead.org; Mon, 28 Sep 2020 10:18:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Cc:Subject:From:To:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=UVtaXCBVJFymkDBCHveKobi5IwwmaJOtZcErV5rNqm0=; b=u/jts8dWLuajn9z/8prPZj8RbK hqwdP08oU4K9W3yKm6e32REkH8lIZb5zWoIDdBQ9cNf/4c40BzLpbBLj9FqQGoNMhftiKvbdzEaC+ 5h5aOJJPSlGPvG24nLHmVG9Nvjq5tjeUR0KGanr9G1kI7Shwpd6CWlP6GLW57oP2Lw+vRc1+DjCmB RVeF1qjO6/VZFaEhr7D+Ew7AuA43EnwfUdojqjgSuxvR2r/qecI6LdLSmYolzhyqWDdDk0j/R12l+ V4xEHYl6JSuknubpBnagVsvaT0fUq22dAupLazfwQ4fVOfKqdAInhD2mWUGw/bH7X2/1naT+vXwb/ M3HaaLjA==; Received: from mout.gmx.net ([212.227.15.15]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMqEK-0004rV-4f for opensbi@lists.infradead.org; Mon, 28 Sep 2020 10:18:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1601288263; bh=sLse5+HpmjBEohpW2i3FZPLUASJ+RuDrvFwNfUqmClA=; h=X-UI-Sender-Class:To:From:Subject:Cc:Date; b=ICWVCYzXHhorW3hyieWPuNEHeeIn3vP2F13Sx83Wq7ovleCDBmx3dNFShNujPap3/ epf8efssdnAotK30XaZn/KoEWJYfZoAhmk91zxzfNJX6lueF3S6ZyMnxZsxkvXOaFJ eRE1wbZ9SnEFr+dLxdMn8xsCLmMSqi1kfxU7Q9IE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.70] ([178.202.41.107]) by mail.gmx.com (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N4z6k-1kWdso3a5s-010rZD; Mon, 28 Sep 2020 12:17:42 +0200 To: Atish Patra From: Heinrich Schuchardt Subject: OpenSBI: Boot HART ISA display Autocrypt: addr=xypron.glpk@gmx.de; prefer-encrypt=mutual; keydata= mQINBE2g3goBEACaikqtClH8OarLlauqv9d9CPndgghjEmi3vvPZJi4jvgrhmIUKwl7q79wG IATxJ1UOXIGgriwoBwoHdooOK33QNy4hkjiNFNrtcaNT7uig+BG0g40AxSwVZ/OLmSFyEioO BmRqz1Zdo+AQ5RzHpu49ULlppgdSUYMYote8VPsRcE4Z8My/LLKmd7lvCn1kvcTGcOS1hyUC 4tMvfuloIehHX3tbcbw5UcQkg4IDh4l8XUc7lt2mdiyJwJoouyqezO3TJpkmkayS3L7o7dB5 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zr qFlNpxVP8xrHiEjZxU965sNtDSD/1/9w82Wn3VkVisNP2MpUhowyHqdeOv2uoG6sUftmkXZ8 RMo+PY/iEIFjNXw1ufHDLRaHihWLkXW3+bS7agEkXo0T3u1qlFTI6xn8maR9Z0eUAjxtO6qV lGF58XeVhfunbQH8Kn+UlWgqcMJwBYgM69c65Dp2RCV7Tql+vMsuk4MT65+Lwm88Adnn6ppQ S2YmNgDtlNem1Sx3JgCvjq1NowW7q3B+28Onyy2fF0Xq6Kyjx7msPj3XtDZQnhknBwA7mqSZ DDw0aNy1mlCv6KmJBRENfOIZBFUqXCtODPvO5TcduJV/5XuxbTR/33Zj7ez2uZkOEuTs/pPN oKMATC28qfg0qM59YjDrrkdXi/+iDe7qCX93XxdIxpA5YM/ZiqgwziJX8ZOKV7UDV+Ph5KwF lTPJMPdQZYXDOt5DjG5l5j0cQWqE05QtYR/V6g8un6V2PqOs9WzaT/RB12YFcaeWlusa8Iqs Eg== Message-ID: <3e977253-0836-e76f-964b-49b7f2541fde@gmx.de> Date: Mon, 28 Sep 2020 12:17:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 Content-Language: en-US X-Provags-ID: V03:K1:jGgk6NgHtjPMQNNSYG16TyBt4TWnST48rn1DufROgHYr67nB4Ok dQ4bob7OM0Ns3iW9+BZ8UiEU3ycOeRV7I3q/tugUMRsVPIx9FUyeYxGdMU6TIci9fOwYbxg Y+EBhO34leN8oO89HI8MLvkW/x9uwDA0FBiG7TuWiuuo0chC6MmoXhk4lt/Z+o+uaqP3KME 9qXt96w5pwLCiG3f00FKA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:fBbYhH7gv1g=:znK+0MN9Y+w6EKhxreDmU5 Fr5QeTPXuFn3bAp+RgWkNl2eez0cQy24aLZGgmfiIU1ELKETpPlgdJrnAsXcTuZhTwdCI0wkV r79XsLkhrXC7mh51HKnO7JXx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q1NzxM7P6Nn9WzyPdX n4BrSJcr6V4uJd7rqjJBtbfZPONbVQFXwNpuKaqxIg5VkAVJw0j2GDu3v2YCKDWzixZjyQ0Gz Vxvadcvs7PBv1+BWZs/spti6/Gvyo4NLFpdLrPg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200928_111800_475671_73ED659A X-CRM114-Status: GOOD ( 11.58 ) X-Spam-Score: -3.1 (---) X-Spam-Report: SpamAssassin version 3.4.4 on casper.infradead.org summary: Content analysis details: (-3.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.5 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [212.227.15.15 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [212.227.15.15 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [xypron.glpk[at]gmx.de] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: OpenSBI Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hello Atish, on the Kendryte 210 MaixDuino the OpenSBI output line Boot HART ISA : rv64cicacsidcacsi looks a bit strange to me (see full output at the end of the mail). Assuming that the characters after rv64 are related to extensions I would expect every letter appearing only once. I tried to add sbi_printf() statements to lib/sbi/riscv_asm.c but they do not print out correctly. After the following change: the output is: Boot HART ISA : rv64imafdcsu I disassembled build/lib/sbi/riscv_asm.o but could not find a problem. Do you have a suggestion how to analyze this further? Best regards Heinrich OpenSBI v0.8-29-g7701ea1 ____ _____ ____ _____ / __ \ / ____| _ \_ _| | | | |_ __ ___ _ __ | (___ | |_) || | | | | | '_ \ / _ \ '_ \ \___ \| _ < | | | |__| | |_) | __/ | | |____) | |_) || |_ \____/| .__/ \___|_| |_|_____/|____/_____| | | |_| Platform Name : Kendryte K210 Platform Features : timer Platform HART Count : 2 Boot HART ID : 0 Boot HART ISA : rv64cicacsidcacsi BOOT HART Features : none BOOT HART PMP Count : 0 BOOT HART MHPM Count: 0 Firmware Base : 0x80000000 Firmware Size : 100 KB Runtime SBI Version : 0.2 MIDELEG : 0x0000000000000222 MEDELEG : 0x0000000000000109 diff --git a/lib/sbi/riscv_asm.c b/lib/sbi/riscv_asm.c index 8c54c11..a0c95a2 100644 --- a/lib/sbi/riscv_asm.c +++ b/lib/sbi/riscv_asm.c @@ -81,7 +81,7 @@ void misa_string(int xlen, char *out, unsigned int out_sz) for (i = 0; i < array_size(valid_isa_order) && (pos < out_sz); i++) { if (misa_extension_imp(valid_isa_order[i])) - out[pos++] = valid_isa_order[i]; + out[pos++] = '0' + i; } if (pos < out_sz) the output becomes Boot HART ISA : rv6403567;<@BCDHI I am clueless why valid_isa_order[i] is not evaluated correctly. When my changes are: diff --git a/lib/sbi/riscv_asm.c b/lib/sbi/riscv_asm.c index 8c54c11..b1bbfc4 100644 --- a/lib/sbi/riscv_asm.c +++ b/lib/sbi/riscv_asm.c @@ -12,6 +12,8 @@ #include #include +static const char valid_isa_order[] = "iemafdqclbjtpvnsuhkorwxyzg"; + /* determine CPU extension, return non-zero support */ int misa_extension_imp(char ext) { @@ -52,7 +54,6 @@ int misa_xlen(void) void misa_string(int xlen, char *out, unsigned int out_sz) { unsigned int i, pos = 0; - const char valid_isa_order[] = "iemafdqclbjtpvnsuhkorwxyzg"; if (!out) return;