From patchwork Wed Nov 25 21:36:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 11932259 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EDF6C56202 for ; Wed, 25 Nov 2020 21:39:10 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DFB602075A for ; Wed, 25 Nov 2020 21:39:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=keithp.com header.i=@keithp.com header.b="nWkQYM97"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=keithp.com header.i=@keithp.com header.b="nWkQYM97" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFB602075A Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=nongnu.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ki2VI-0004Vi-SA for qemu-devel@archiver.kernel.org; Wed, 25 Nov 2020 16:39:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ki2Sr-0002GF-Pa; Wed, 25 Nov 2020 16:36:37 -0500 Received: from home.keithp.com ([63.227.221.253]:36926 helo=elaine.keithp.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ki2Sp-0001AK-DD; Wed, 25 Nov 2020 16:36:37 -0500 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 8C88B3F2E288; Wed, 25 Nov 2020 13:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1606340187; bh=tGkOZyd/9GYTCytL2ts1t7fw0WSivX7vnC0R1Ld40Ic=; h=From:To:Cc:Subject:Date:From; b=nWkQYM97UV7iwR0u/pS6MXBkIaAgEa/0fqiwa0YRkG9DNyeLBGnQ+OJ6qLQzgG0/6 xw3iF2DKV1m/6faCVfHpFXSfmcD8dvzDgnFAXdlfH9/+psdvE8Bh6HkdJ9gp3lmo+o E+5uZhtcUHDUKqwU1AZp0e6tSoVyPlf2TikAehb/mvgo8pk9B8gsHws2vDOn20ibAb ZNsiUOLeW9n24HH6uKX5IFrBUcQ0DtelDVf1UMLfY/CmxY9bNUXYwWMxkQtlN2fJOR TesXDe7An3OE7nvVFGeJpRxsOiDW5VNhY/abZx/yMYz+eq4DXTBRDC0kXTiNR3NqMh fCg2C8Pt8yP+g== X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16__NwTy8MBl; Wed, 25 Nov 2020 13:36:27 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 2BC2A3F2E287; Wed, 25 Nov 2020 13:36:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=keithp.com; s=mail; t=1606340187; bh=tGkOZyd/9GYTCytL2ts1t7fw0WSivX7vnC0R1Ld40Ic=; h=From:To:Cc:Subject:Date:From; b=nWkQYM97UV7iwR0u/pS6MXBkIaAgEa/0fqiwa0YRkG9DNyeLBGnQ+OJ6qLQzgG0/6 xw3iF2DKV1m/6faCVfHpFXSfmcD8dvzDgnFAXdlfH9/+psdvE8Bh6HkdJ9gp3lmo+o E+5uZhtcUHDUKqwU1AZp0e6tSoVyPlf2TikAehb/mvgo8pk9B8gsHws2vDOn20ibAb ZNsiUOLeW9n24HH6uKX5IFrBUcQ0DtelDVf1UMLfY/CmxY9bNUXYwWMxkQtlN2fJOR TesXDe7An3OE7nvVFGeJpRxsOiDW5VNhY/abZx/yMYz+eq4DXTBRDC0kXTiNR3NqMh fCg2C8Pt8yP+g== Received: by keithp.com (Postfix, from userid 1000) id CF96D15821B9; Wed, 25 Nov 2020 13:36:26 -0800 (PST) To: qemu-devel@nongnu.org Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , Alistair Francis , Bastian Koppelmann , Laurent Vivier , Palmer Dabbelt , Peter Maydell , qemu-arm@nongnu.org, qemu-riscv@nongnu.org, Sagar Karandikar , Keith Packard Subject: [PATCH 0/8] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Date: Wed, 25 Nov 2020 13:36:09 -0800 Message-Id: <20201125213617.2496935-1-keithp@keithp.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Received-SPF: pass client-ip=63.227.221.253; envelope-from=keithp@keithp.com; helo=elaine.keithp.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Reply-to: Keith Packard X-Patchwork-Original-From: Keith Packard via From: Keith Packard This series adds support for RISC-V Semihosting, version 0.2 as specified here: https://github.com/riscv/riscv-semihosting-spec/releases/tag/0.2 This specification references the ARM semihosting release 2.0 as specified here: https://static.docs.arm.com/100863/0200/semihosting.pdf That specification includes several semihosting calls which were not previously implemented. This series includes implementations for the remaining calls so that both RISC-V and ARM versions are now complete. Tests for release 2.0 can be found in picolibc on the semihost-2.0-all branch: https://github.com/picolibc/picolibc/tree/semihost-2.0-all These tests uncovered a bug in the SYS_HEAPINFO implementation for ARM, which has been fixed in this series as well. The series is structured as follows: 1. Move shared semihosting files 2. Change public common semihosting APIs 3. Change internal semihosting interfaces 4. Fix SYS_HEAPINFO crash on ARM 5. Add RISC-V semihosting implementation 6-8. Add missing semihosting operations from release 2.0 Signed-off-by: Keith Packard