From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS,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 F1723C04AB4 for ; Tue, 14 May 2019 15:54:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AA8FA2085A for ; Tue, 14 May 2019 15:54:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YrMJMAzS" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AA8FA2085A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:50164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQZlZ-00061T-SQ for qemu-devel@archiver.kernel.org; Tue, 14 May 2019 11:54:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQZjl-0004i2-TH for qemu-devel@nongnu.org; Tue, 14 May 2019 11:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQZjk-00065J-NH for qemu-devel@nongnu.org; Tue, 14 May 2019 11:53:05 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:33285) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQZjk-00060m-EM for qemu-devel@nongnu.org; Tue, 14 May 2019 11:53:04 -0400 Received: by mail-wr1-x433.google.com with SMTP id d9so11451769wrx.0 for ; Tue, 14 May 2019 08:53:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iEoVVZAVHss4n35p8GLl31rn2j4t7jeWxJ/prn1yZz4=; b=YrMJMAzSQyNuY2voaeiYbXp5BW7M/F+vMWeEzL5+s3BFnv0awlsN0Rn3+kt5S/wAra pLT3J3ljZwZCuBl2M0KolB5HZ7hRXALkWECKcUn+y9NmkQpZ6s6w2vfUTpOP15G7NYqG VVPZsRvoWvtPlgMx5iJqMLcqkbWc7zWS9dQI++E2FYe/+rBdmREMLKrgh+wpnk2/x7h7 IJJSQHImdd5VRrtKUAtvZmAb2MSIB/6YNkeGzIMPeLl4jyn03uS3pgdjYsyiHBgl7Ccf EO49OOsJBJwrcMGxVpM+6lGyS59uh+BnSpSk7OnHJ/zhLOIflH3V4JRHjWRqikUtoBAl KCuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iEoVVZAVHss4n35p8GLl31rn2j4t7jeWxJ/prn1yZz4=; b=EZHOuoiF4UGr40xVczeH6cNsrzLCtecxSZtOVsmV6Ldy0D26g2UrYe6DQesuFKIcEU UMIGtz5cM/2F2jDT0MzrUYyca37dFO8WcU6s9x6mLWlYYqsoxKG3da1au3EOthSPc0dF T3t/Q/Ca180cr/9Bcp4Os9mrCzHc0Oh4pxqQtsljIMVhpGjo5+slN1+azL3eLRbxZmrp 0K4rgYyBGPDARkkApamgvlpAfZayHXjNasC0WhV4EG8o225IsLV+NaDQrWxwihd31BGJ HYepYk5oltSLXuJwqXivQ+GdyAWJGUkuoAYLuPwbdg0rFdqKNi9vLA7jjNBy+vH7ikYs 0QIg== X-Gm-Message-State: APjAAAWCwnnOYd2Et/PFo/jZ2BRUT37Gcm7hrCLLfQ1bef7CkXSSJyl0 iOgL7bMDv5XmE5UEZvUWgoJxrg== X-Google-Smtp-Source: APXvYqzYSTIIcI34QJSOmjxBi6vAsqHS3PPB4yNy9jT2bzWHlMZwdBzvR+WSZp6W960sAkyJVlUeDA== X-Received: by 2002:adf:e2c3:: with SMTP id d3mr22402623wrj.189.1557849182851; Tue, 14 May 2019 08:53:02 -0700 (PDT) Received: from zen.linaroharston ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e8sm38762850wrc.34.2019.05.14.08.53.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 08:53:02 -0700 (PDT) Received: from zen.linaroharston. (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D48841FF87; Tue, 14 May 2019 16:53:01 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 14 May 2019 16:52:50 +0100 Message-Id: <20190514155301.16123-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::433 Subject: [Qemu-devel] [RFC PATCH 00/11] semihosting cleanup and re-factor X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi, This collects together some fixes from last weeks RFC clean-up patch as well as a generalised version of the chardev console tweak I made last week for testing/next. As it happens it only really made sense for ARM and MIPs logging semihost calls but there is certainly scope for handling all the semihost syscalls in a more common way. I didn't make the changes to xtensa as that already has a bi-directional console-via-chardev setup and that would be quite a bit of extra work to support. I've added myself to the MAINTAINERS section for the common code but my focus at the moment is really just to improve the use of semihosting in our expanding system tests. Hopefully this is enough to ensure future enhancements (common open/read/write/close?) can be done and easily enabled for all semihost targets. Please review. Alex Bennée (11): semihosting: move semihosting configuration into its own directory semihosting: introduce CONFIG_SEMIHOSTING semihosting: implement a semihosting console semihosting: enable chardev backed output for console target/arm: fixup some of the commentary for arm-semi target/arm: use the common interface for WRITE0/WRITEC in arm-semi target/arm: add LOG_UNIMP messages to arm-semi target/arm: correct return values for WRITE/READ in arm-semi target/mips: only build mips-semi for softmmu target/mips: convert UHI_plog to use common semihosting code MAINTAINERS: update for semihostings new home MAINTAINERS | 7 + default-configs/arm-softmmu.mak | 1 + default-configs/lm32-softmmu.mak | 2 + default-configs/m68k-softmmu.mak | 2 + default-configs/mips-softmmu-common.mak | 1 + default-configs/nios2-softmmu.mak | 2 + default-configs/xtensa-softmmu.mak | 2 + gdbstub.c | 7 +- hw/Kconfig | 1 + hw/Makefile.objs | 1 + hw/mips/mips_malta.c | 2 +- hw/semihosting/Kconfig | 3 + hw/semihosting/Makefile.objs | 2 + hw/semihosting/config.c | 186 ++++++++++++++++++++ hw/semihosting/console.c | 77 ++++++++ include/exec/gdbstub.h | 11 ++ include/hw/semihosting/console.h | 38 ++++ include/{exec => hw/semihosting}/semihost.h | 17 +- include/sysemu/sysemu.h | 1 + linux-user/Makefile.objs | 2 + linux-user/arm/semihost.c | 24 +++ qemu-options.hx | 6 +- stubs/Makefile.objs | 1 + stubs/semihost.c | 70 ++++++++ target/arm/arm-semi.c | 98 ++++++----- target/arm/helper.c | 2 +- target/arm/translate-a64.c | 2 +- target/arm/translate.c | 2 +- target/lm32/helper.c | 2 +- target/m68k/op_helper.c | 2 +- target/mips/Makefile.objs | 3 +- target/mips/helper.h | 2 + target/mips/mips-semi.c | 14 +- target/mips/translate.c | 10 +- target/nios2/helper.c | 2 +- target/xtensa/translate.c | 2 +- target/xtensa/xtensa-semi.c | 2 +- vl.c | 128 +------------- 38 files changed, 545 insertions(+), 192 deletions(-) create mode 100644 hw/semihosting/Kconfig create mode 100644 hw/semihosting/Makefile.objs create mode 100644 hw/semihosting/config.c create mode 100644 hw/semihosting/console.c create mode 100644 include/hw/semihosting/console.h rename include/{exec => hw/semihosting}/semihost.h (78%) create mode 100644 linux-user/arm/semihost.c create mode 100644 stubs/semihost.c -- 2.20.1