From nobody Sat Apr 20 07:45:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673633504; cv=none; d=zohomail.com; s=zohoarc; b=RYfoVUZkUyuECCHwJCSVyht34Ad31kg5CdqTfe5nD+t/7jEQzaPaarjngMFxymV370iaW+fwfg7Q+g8lIuBSP1h/rNdXDsJY9qcCYGcYNvo4760u3pj74LLkcwtDZi81R1coWKkMSk6rTIvAY9253mOdRjBK/FIW9LF81V4Wxsw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673633504; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YX3naq5ZNqjOTiMOy0rg53RIUBd9djjd4qY57KHB7I4=; b=MFAPMTeKhPhdlsTLS0ppKa5hwKigTjU+7TEhXFCfvrDMeMi8i9UHp+ldjlxxLaCz2zreTpEuwKRPDY93kWDKj5/trJ6wgE4++8E5Wh+QlGxBBlACH+SZCkNMYqEM/T/xZQM1xOZT3ZcbgrnA3O7nAy5/71/GfGw/xpIuBxlCpu8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673633504041346.75923891963225; Fri, 13 Jan 2023 10:11:44 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKHL-0007q0-Pg; Fri, 13 Jan 2023 08:39:31 -0500 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 1pGKHK-0007pU-CZ for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKHI-00053H-LH for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: by mail-wm1-x32b.google.com with SMTP id ay40so15301380wmb.2 for ; Fri, 13 Jan 2023 05:39:28 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id bi6-20020a05600c3d8600b003d9df9e59c4sm22299090wmb.37.2023.01.13.05.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 05:39:25 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7DB921FFB8; Fri, 13 Jan 2023 13:39:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YX3naq5ZNqjOTiMOy0rg53RIUBd9djjd4qY57KHB7I4=; b=WjTtB4O9lF85m9xCCcQb5fvIhTZH14VKjxXb6Q3SUt9Gr2AsMTaUlITFig7dsa7nV9 Yt2Gku65ibAgT34l+1YnuepjlSN4zLCZ2/PDwFyIUdF2lYdzZLqP6k4gfhBWooaRRuyZ r5/19bx7PKg0+EKAf1GFbMKHUs5jsP2bTkPZajruEnq5knoiYDlafU4UVDejfz22Q3hA ac/EkfRtfD9UrwowtKTzRG6APonn50JhCd5IbdQFHmw8gJ0EiDI23rcA9p65U7PLl76T 7xWvOiiWvm4KTiWkef43n4k7nU3HSSqtJRSxgkrOzMfyP9ukDkT442vga5+OduVf96P4 bMdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YX3naq5ZNqjOTiMOy0rg53RIUBd9djjd4qY57KHB7I4=; b=H3X3J7UeclYj7Ig7HodAdbJDjBC7IQKix+tXlcKukZgBa+EbU4Who1FrVt+y85np99 GrgYlxzz1hqZtkc6gCh50lz0Cyuxloee1sCmwc9pdlw2l6bggnspnMiJMH2HCh0MRjyC etmY+nNZUw1bmDXgiOi6bsjc/020t/JgUthx6vbJPrqusr1D5ycBEUgygsC2MZtJGyax 8IjSNJhrsS//rSluCzcVeRJfUdBv0/xzQ0AgCnAuCx87DRR936eS8TdnZ99SCuEwRQ9d lkej0PyJ//aQlVbBXxZO+eln1nwJfTQydtkVJQvXFV+sdSUS/wnKq7KKXEuK/no7xLZ2 f22w== X-Gm-Message-State: AFqh2kpUKAsp9xLk7lO1PHI+q0h5Nb+6Bx8Px2q6hA8XBdG6J8fPvWhs 5fRETMO2r9CAL6yi47NNHEIbTQ== X-Google-Smtp-Source: AMrXdXuhSVul3bEemh9977cOh1gJC8l15WRyDBktCMDP3532N0vhe7/Bb3/gl5CBUjV0xfE3qKIYyw== X-Received: by 2002:a05:600c:a0f:b0:3cf:7704:50ce with SMTP id z15-20020a05600c0a0f00b003cf770450cemr59571404wmp.38.1673617167180; Fri, 13 Jan 2023 05:39:27 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , John G Johnson , Elena Ufimtseva , Paolo Bonzini , Jagannathan Raman Subject: [PATCH 1/4] docs: add hotlinks to about preface text Date: Fri, 13 Jan 2023 13:39:20 +0000 Message-Id: <20230113133923.1642627-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113133923.1642627-1-alex.bennee@linaro.org> References: <20230113133923.1642627-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673633504955100001 Make it easier to navigate the documentation. Signed-off-by: Alex Benn=C3=A9e Acked-by: Richard Henderson Reviewed-by: Peter Maydell --- docs/about/index.rst | 16 ++++++++-------- docs/system/index.rst | 2 ++ docs/tools/index.rst | 2 ++ docs/user/index.rst | 2 ++ 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/docs/about/index.rst b/docs/about/index.rst index 5bea653c07..bae1309cc6 100644 --- a/docs/about/index.rst +++ b/docs/about/index.rst @@ -5,19 +5,19 @@ About QEMU QEMU is a generic and open source machine emulator and virtualizer. =20 QEMU can be used in several different ways. The most common is for -"system emulation", where it provides a virtual model of an +:ref:`System Emulation`, where it provides a virtual model of an entire machine (CPU, memory and emulated devices) to run a guest OS. -In this mode the CPU may be fully emulated, or it may work with -a hypervisor such as KVM, Xen, Hax or Hypervisor.Framework to -allow the guest to run directly on the host CPU. +In this mode the CPU may be fully emulated, or it may work with a +hypervisor such as KVM, Xen, Hax or Hypervisor.Framework to allow the +guest to run directly on the host CPU. =20 -The second supported way to use QEMU is "user mode emulation", +The second supported way to use QEMU is :ref:`User Mode Emulation`, where QEMU can launch processes compiled for one CPU on another CPU. In this mode the CPU is always emulated. =20 -QEMU also provides a number of standalone commandline utilities, -such as the ``qemu-img`` disk image utility that allows you to create, -convert and modify disk images. +QEMU also provides a number of standalone :ref:`command line +utilities`, such as the ``qemu-img`` disk image utility that +allows you to create, convert and modify disk images. =20 .. toctree:: :maxdepth: 2 diff --git a/docs/system/index.rst b/docs/system/index.rst index e3695649c5..282b6ffb56 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -1,3 +1,5 @@ +.. _System Emulation: + ---------------- System Emulation ---------------- diff --git a/docs/tools/index.rst b/docs/tools/index.rst index 1edd5a8054..2151adcf78 100644 --- a/docs/tools/index.rst +++ b/docs/tools/index.rst @@ -1,3 +1,5 @@ +.. _Tools: + ----- Tools ----- diff --git a/docs/user/index.rst b/docs/user/index.rst index 2c4e29f3db..782d27cda2 100644 --- a/docs/user/index.rst +++ b/docs/user/index.rst @@ -1,3 +1,5 @@ +.. _User Mode Emulation: + ------------------- User Mode Emulation ------------------- --=20 2.34.1 From nobody Sat Apr 20 07:45:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673619210; cv=none; d=zohomail.com; s=zohoarc; b=MFGCt1zy9pqEP+tRAewQQsYyPf4jnfVhDxN1bQ88+416qBwnbfOTZYCDnMEvg4pE/VFxHgPBFmxRQFudcxjqrDs88kumr0nkrBgWrYEn4uH1vCLnNNgpGtFPGYeuPnrv3GX22byzRLeOQRD1w6ab5ch18GKNRTbh8+vUblRyXkw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673619210; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZkjvImv3urfubQ/CIur/IuzDRXVAlRae10Z3LaYvYZ8=; b=gxyWZ0m3qeVqyLVUbF2xNH8CaBhCn39plJq+Vb3wbmmhiq0W8pkRgY44F9BLXJUQ6JONNRwRNLW6vDh+o4rX/Iv5ecRi2R0D7kcH0+C6NnXz6rDZeJE2xkJDjIqNK9DiKgy7LfcKD2AX1MK8wALjoZJ77DhRBY+2mUN6d5gpcMQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16736192104951012.587024234104; Fri, 13 Jan 2023 06:13:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKHM-0007q8-Bk; Fri, 13 Jan 2023 08:39:32 -0500 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 1pGKHK-0007pR-7t for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKHH-000530-BT for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:29 -0500 Received: by mail-wm1-x333.google.com with SMTP id j34-20020a05600c1c2200b003da1b054057so3082868wms.5 for ; Fri, 13 Jan 2023 05:39:26 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id e18-20020a05600c4e5200b003d9876aa04asm29736196wmq.41.2023.01.13.05.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 05:39:25 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9BF251FFBA; Fri, 13 Jan 2023 13:39:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZkjvImv3urfubQ/CIur/IuzDRXVAlRae10Z3LaYvYZ8=; b=KQ98xfT4n3kDO82kAcafmt+RWC82neT/zuoienwDEIKc+hodyjnVHMesHlHXT+z4ts J8fGsmP/vYXoH/tfIKlAvS1Zl83xA4SPOmhN5voZaqYzEaX4GAHOkiML02CfPk7xOfLr BCHTihKYUFp2Eo8INa0P6eJd3p2CteOPOtlUO0vN2IEBdTiCZWcN3xySXW6qYmL6TUd1 gAYnXpWaZadpZ2HNbj60wj+5UMGvTzfCp04efohWd8ZSom/9+cHBJOZR/wwx12quaG9i mBNtYSGxiJ6vEuCbMCsDpcSflaztJA9XFOdzP4g9bQe27YdJh4c68b+zVFvrQC63sTs/ XFxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZkjvImv3urfubQ/CIur/IuzDRXVAlRae10Z3LaYvYZ8=; b=q3ccmp5cH0g6h8VD8mXGpcBdFYqQgrq/EftFCmBx0Dzzb3cA/i1l3S69jcRVztQ7vX Y6Wrh+iBfztXPcIc0AdvoLJfGnxAOYT6gIL2AmZOMud1P+20W8ABGGgjGUcnpgJq4GQ8 LLpxdBr4zmUu+5Hm52nH9EM3J80WkR5yV0rXHJBodrWgtJtjpTkCGY6kWzn/ZaOYR4M0 v265LocJBu4lGAR8MmvuAYnr+52P6exeMUbzgDGV+gxL7AP8Z7kPgem92JDDyeIBf7p1 FCyp/bdRqS5HoRHwu7zwDofKkAwlrxeFLyEw3+VWiHzrWlXO5fG07Vbg/9bmsXh7rSyz VmCA== X-Gm-Message-State: AFqh2kpPTg/+ksax5ogkVAhBmQKgAoms5x7g2KFJGVHhOaFRKj5fQKWF eEqIE5Xlzhsr3pxk38ZPzQPwHw== X-Google-Smtp-Source: AMrXdXuuhgpT9Aa6+pY/IZB9DBTFPtKdoyUB0ap/VBz4vh0hE9UqOKMYPnDVU8nZsl86bb4OjUsDoA== X-Received: by 2002:a05:600c:4fc6:b0:3d3:4a47:52e9 with SMTP id o6-20020a05600c4fc600b003d34a4752e9mr57953781wmq.15.1673617166105; Fri, 13 Jan 2023 05:39:26 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , John G Johnson , Elena Ufimtseva , Paolo Bonzini , Jagannathan Raman Subject: [PATCH 2/4] docs: add a new section to outline emulation support Date: Fri, 13 Jan 2023 13:39:21 +0000 Message-Id: <20230113133923.1642627-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113133923.1642627-1-alex.bennee@linaro.org> References: <20230113133923.1642627-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673619211822100003 This affects both system and user mode emulation so we should probably list it up front. Signed-off-by: Alex Benn=C3=A9e Acked-by: Richard Henderson --- docs/about/emulation.rst | 103 ++++++++++++++++++++++++++++++++++ docs/about/index.rst | 1 + docs/devel/tcg-plugins.rst | 2 + docs/system/arm/emulation.rst | 2 + 4 files changed, 108 insertions(+) create mode 100644 docs/about/emulation.rst diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst new file mode 100644 index 0000000000..d919175b5e --- /dev/null +++ b/docs/about/emulation.rst @@ -0,0 +1,103 @@ +Emulation +=3D=3D=3D=3D=3D=3D=3D=3D=3D + +QEMU's Tiny Code Generator (TCG) gives it the ability to emulate a +number of CPU architectures on any supported platform. Both +:ref:`System Emulation` and :ref:`User Mode Emulation` are supported +depending on the guest architecture. + +.. list-table:: Supported Guest Architectures for Emulation + :widths: 30 10 10 50 + :header-rows: 1 + + * - Architecture (qemu name) + - System + - User-mode + - Notes + * - Alpha + - Yes + - Yes + - Legacy 64 bit RISC ISA developed by DEC + * - Arm (arm, aarch64) + - Yes + - Yes + - Wide range of features, see :ref:`Arm Emulation` for details + * - AVR + - Yes + - No + - 8 bit micro controller, often used in maker projects + * - Cris + - Yes + - Yes + - Embedded RISC chip developed by AXIS + * - Hexagon + - No + - Yes + - Family of DSPs by Qualcomm + * - PA-RISC (hppa) + - Yes + - Yes + - A legacy RISC system used in HPs old minicomputers + * - x86 (i386, x86_64) + - Yes + - Yes + - The ubiquitous desktop PC CPU architecture, 32 and 64 bit. + * - Loongarch + - Yes + - Yes + - A MIPs-like 64bit RISC architecture developed in China + * - m68k + - Yes + - Yes + - Motorola 68000 variants and ColdFire + * - Microblaze + - Yes + - Yes + - RISC based soft-core by Xilinx + * - MIPS (mips, mipsel, mips64, mips64el) + - Yes + - Yes + - Venerable RISC architecture originally out of Stanford University + * - Nios2 + - Yes + - Yes + - 32 bit embedded soft-core by Altera + * - OpenRISC + - Yes + - Yes + - Open source RISC architecture developed by the OpenRISC community + * - Power (ppc, ppc64) + - Yes + - Yes + - A general purpose RISC architecture now managed by IBM + * - RISC-V + - Yes + - Yes + - An open standard RISC ISA maintained by RISC-V International + * - RX + - Yes + - No + - A 32 bit micro controller developed by Renesas + * - s390x + - Yes + - Yes + - A 64 bit CPU found in IBM's System Z mainframes + * - sh4 + - Yes + - Yes + - A 32 bit RISC embedded CPU developed by Hitachi + * - SPARC (sparc, sparc64) + - Yes + - Yes + - A RISC ISA originally developed by Sun Microsystems + * - Tricore + - Yes + - No + - A 32 bit RISC/uController/DSP developed by Infineon + * - Xtensa + - Yes + - Yes + - A configurable 32 bit soft core now owned by Cadence + +A number of features are are only available when running under +emulation including :ref:`Record/Replay` and :ref:`TCG Plugins`. diff --git a/docs/about/index.rst b/docs/about/index.rst index bae1309cc6..b00b584b31 100644 --- a/docs/about/index.rst +++ b/docs/about/index.rst @@ -23,6 +23,7 @@ allows you to create, convert and modify disk images. :maxdepth: 2 =20 build-platforms + emulation deprecated removed-features license diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 9740a70406..81dcd43a61 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -3,6 +3,8 @@ Copyright (c) 2019, Linaro Limited Written by Emilio Cota and Alex Benn=C3=A9e =20 +.. _TCG Plugins: + QEMU TCG Plugins =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/docs/system/arm/emulation.rst b/docs/system/arm/emulation.rst index b33d7c28dc..b87e064d9d 100644 --- a/docs/system/arm/emulation.rst +++ b/docs/system/arm/emulation.rst @@ -1,3 +1,5 @@ +.. _Arm Emulation: + A-profile CPU architecture support =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 --=20 2.34.1 From nobody Sat Apr 20 07:45:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673618112; cv=none; d=zohomail.com; s=zohoarc; b=FsIU6IY+R2IZhfHf6fJDBCRdi4oD1hThPo34DsZSY9zWRxiOy/c2PYVJTWnvUvNZeAKXsY78NRFc0PYa6IkAHxMGlHxXCrnkX2kKjTguq90jnXVrENWYmMkFWERDE+g+x1qg2wF8YmFOf2u2cSpiJ0WfJKOkw38CfVJJdsli0Ek= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673618112; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iH1g5BvDblNdu81W4rW5xEHawJ+gs3U9vzCLE7pUyII=; b=QaxSOGDyMulNY56tVit6tuikBShtsQQwPF0szQAYRB8kbdP5IuRrds0C97wjM2GbAIwUsWEhPc7m9M4NKHSESeaHIa+bZrolUjN3U4S2S0P3wxMCcu6mnc0l4qbSXCvm+t29ZnvP+0J0lY0Va+uDzPd/MpJWOEY8Tvm/ZAzJpnw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673618112225144.05396327516144; Fri, 13 Jan 2023 05:55:12 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKHN-0007rh-Gl; Fri, 13 Jan 2023 08:39:33 -0500 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 1pGKHK-0007pa-FM for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKHI-000539-75 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: by mail-wm1-x331.google.com with SMTP id m3so15308489wmq.0 for ; Fri, 13 Jan 2023 05:39:27 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id n14-20020a05600c3b8e00b003b49bd61b19sm33546346wms.15.2023.01.13.05.39.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 05:39:25 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B78621FFBB; Fri, 13 Jan 2023 13:39:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iH1g5BvDblNdu81W4rW5xEHawJ+gs3U9vzCLE7pUyII=; b=M61bcgJsCdi69o8BCb38mAr787MzdVz3EH30l4UmtN05bnkSiIxVuraCAoECjg5Azn gRHe7iGABN1SwUPnIqOfOnciQprWL0wzEagylDWxDHEvpzvLF/yASoIt02fR+nM39/Aq OEyuuyFEoPo/CXnknWL6qvjyH9NfcoQCjYogPLpElnJDhv6coTgs1wrKcfqZ0DGK55SR ZCtv3WsiBFLOpQ4mRrLmR26ZfziBJ11dQCd4pZ2JKCLr7JPnxQYi66O5xMYA3J2k7ne1 hRI3yacC/Ol+TS/cMOiPrUfvSxiUT6Qw2qO9Mg7ZPqZnrMFpN+U4MMLf5km0ZRfuSijS ok3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iH1g5BvDblNdu81W4rW5xEHawJ+gs3U9vzCLE7pUyII=; b=KhyuOPfxlwmg4tJDJ2Zc4vrF5n9ojubFwPWezao/0LfAeCDH/RePtOj82ty27mMM2b dinGmpemu2f6AxLdxnf1nrkzVNP+7FFmUQtS8hJodLeZLpNyiPhpA0NSOiaHFhcwgQcu JQB8lJYxXQB1vEj14c4813hHmZH9OQUvZ4e7VzyYD2R0t2kdcsHMNNVJjqxFvj0pALJU 4Q/e4DUswmqnvERwci1TFivUtJtHaFeUN0JEM8cE+uYweiIZMmcJLwAQoq2nAB8fuyy+ 2Mbp9RJjMXgHcYynzXWe388RhJK4e8BucpB2H3pozcEiuCwbX+Rts5wuM3794zOSMBXw beMA== X-Gm-Message-State: AFqh2kpF1YdH89tPd7M/1Y1SM9wXSxmH5zQb0RHA8RZpMLf/EAmoyVfj VY2KYSmTh7yqNYLWFqh9+GWEIg== X-Google-Smtp-Source: AMrXdXtfVRDz0Tv8Wh8D8E7pS7uGNHwDgaiR57/qn2ugOIHHQsiwO+h/tbcgTZ9pG9X4gRR+GzOttA== X-Received: by 2002:a05:600c:358a:b0:3cf:8d51:1622 with SMTP id p10-20020a05600c358a00b003cf8d511622mr59469648wmq.1.1673617166853; Fri, 13 Jan 2023 05:39:26 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , John G Johnson , Elena Ufimtseva , Paolo Bonzini , Jagannathan Raman Subject: [PATCH 3/4] semihosting: add semihosting section to the docs Date: Fri, 13 Jan 2023 13:39:22 +0000 Message-Id: <20230113133923.1642627-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113133923.1642627-1-alex.bennee@linaro.org> References: <20230113133923.1642627-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673618114382100003 The main reason to do this is to document our O_BINARY implementation decision somewhere. However I've also moved some of the implementation details out of qemu-options and added links between the two. As a bonus I've highlighted the scary warnings about host access with the appropriate RST tags. Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Acked-by: Richard Henderson --- v2 - moved inside the generic emulation section --- docs/about/emulation.rst | 80 ++++++++++++++++++++++++++++++++++++++++ qemu-options.hx | 27 +++++--------- 2 files changed, 90 insertions(+), 17 deletions(-) diff --git a/docs/about/emulation.rst b/docs/about/emulation.rst index d919175b5e..4d978e697b 100644 --- a/docs/about/emulation.rst +++ b/docs/about/emulation.rst @@ -101,3 +101,83 @@ depending on the guest architecture. =20 A number of features are are only available when running under emulation including :ref:`Record/Replay` and :ref:`TCG Plugins`. + +.. _Semihosting: + +Semihosting +----------- + +Semihosting is a feature provided by a number of guests that allow the +program running on the target to interact with the host system. On +real hardware this is usually provided by a debugger hooked directly +to the system. + +Generally semihosting makes it easier to bring up low level code before a +more fully functional operating system has been enabled. On QEMU it +also allows for embedded micro-controller code which typically doesn't +have a full libc to be run as "bare-metal" code under QEMU's user-mode +emulation. It is also useful for writing test cases and indeed a +number of compiler suites as well as QEMU itself use semihosting calls +to exit test code while reporting the success state. + +Semihosting is only available using TCG emulation. This is because the +instructions to trigger a semihosting call are typically reserved +causing most hypervisors to trap and fault on them. + +.. warning:: + Semihosting inherently bypasses any isolation there may be between + the guest and the host. As a result a program using semihosting can + happily trash your host system. You should only ever run trusted + code with semihosting enabled. + +Redirection +~~~~~~~~~~~ + +Semihosting calls can be re-directed to a (potentially remote) gdb +during debugging via the :ref:`gdbstub`. Output to the +semihosting console is configured as a ``chardev`` so can be +redirected to a file, pipe or socket like any other ``chardev`` +device. + +See :ref:`Semihosting Options` for details. + +Supported Targets +~~~~~~~~~~~~~~~~~ + +Most targets offer a similar semihosting implementations with some +minor changes to define the appropriate instruction to encode the +semihosting call and which registers hold the parameters. They tend to +presents a simple POSIX-like API which allows your program to read and +write files, access the console and some other basic interactions. + +.. note:: + QEMU makes an implementation decision to implement all file access + in ``O_BINARY`` mode regardless of the host operating system. This + is because gdb semihosting support doesn't make the distinction + between the modes and magically processing line endings can be confusin= g. + +.. list-table:: Guest Architectures supporting Semihosting + :widths: 10 10 80 + :header-rows: 1 + + * - Architecture + - Modes + - Specification + * - Arm + - System and User-mode + - https://github.com/ARM-software/abi-aa/blob/main/semihosting/semihos= ting.rst + * - m68k + - System + - https://sourceware.org/git/?p=3Dnewlib-cygwin.git;a=3Dblob;f=3Dlibgl= oss/m68k/m68k-semi.txt;hb=3DHEAD + * - mips + - System + - Unified Hosting Interface (MD01069) + * - Nios II + - System + - https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;a=3Dblob= ;f=3Dlibgloss/nios2/nios2-semi.txt;hb=3DHEAD + * - RISC-V + - System and User-mode + - https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semi= hosting-spec.adoc + * - Xtensa + - System + - Tensilica ISS SIMCALL diff --git a/qemu-options.hx b/qemu-options.hx index 3aa3a2f5a3..de3a368f58 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4633,10 +4633,13 @@ DEF("semihosting", 0, QEMU_OPTION_semihosting, QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) SRST ``-semihosting`` - Enable semihosting mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only= ). + Enable :ref:`Semihosting` mode (ARM, M68K, Xtensa, MIPS, Nios II, RISC= -V only). =20 - Note that this allows guest direct access to the host filesystem, so - should only be used with a trusted guest OS. + .. warning:: + Note that this allows guest direct access to the host filesystem, so + should only be used with a trusted guest OS. + + .. _Semihosting Options: =20 See the -semihosting-config option documentation for further information about the facilities this enables. @@ -4648,22 +4651,12 @@ QEMU_ARCH_ARM | QEMU_ARCH_M68K | QEMU_ARCH_XTENSA | QEMU_ARCH_MIPS | QEMU_ARCH_NIOS2 | QEMU_ARCH_RISCV) SRST ``-semihosting-config [enable=3Don|off][,target=3Dnative|gdb|auto][,charde= v=3Did][,userspace=3Don|off][,arg=3Dstr[,...]]`` - Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II, RI= SC-V + Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, Nios= II, RISC-V only). =20 - Note that this allows guest direct access to the host filesystem, so - should only be used with a trusted guest OS. - - On Arm this implements the standard semihosting API, version 2.0. - - On M68K this implements the "ColdFire GDB" interface used by - libgloss. - - Xtensa semihosting provides basic file IO calls, such as - open/read/write/seek/select. Tensilica baremetal libc for ISS and - linux platform "sim" use this interface. - - On RISC-V this implements the standard semihosting API, version 0.2. + .. warning:: + Note that this allows guest direct access to the host filesystem, so + should only be used with a trusted guest OS. =20 ``target=3Dnative|gdb|auto`` Defines where the semihosting calls will be addressed, to QEMU --=20 2.34.1 From nobody Sat Apr 20 07:45:57 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673618751; cv=none; d=zohomail.com; s=zohoarc; b=CJR2zX6SoJUp/HAp7/9y0HTfPvkGTLOlO61uBA2+xU/Gpf40X2T+FK4k2bPB2OxD56qWDpH7phB4k+K58Vsnlazh7YPOMOuP9uch20F0+K5+o/pxmDQlPMR2gJCehwopQKhhpe7yibre+KPnPwhGL2WFykU9XnXFJnumgd3rFZ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673618751; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IpI+f91+f5TQxZSZ9YYmXQNXzc5fyENbdAfl6yb8iI0=; b=XJ0euPHGI6mfKT9JLNe6ZXLdsWZEfpsLZZPZI05MAYwTldTrInrReKZFFNkvVcFemuyAbAbxSjwzQ0E4wCKBaKiZMjDeoZrT6dj4BsePMM65YJwy8hi9Kh4rp2VqUeCYBqDb9wymt9Zqnb+VpYLfauJfYT95diCHV2WEOHz8m/M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673618751288982.8907520019437; Fri, 13 Jan 2023 06:05:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pGKHM-0007qJ-Cr; Fri, 13 Jan 2023 08:39:32 -0500 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 1pGKHK-0007pp-OT for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pGKHH-00052w-F0 for qemu-devel@nongnu.org; Fri, 13 Jan 2023 08:39:30 -0500 Received: by mail-wm1-x332.google.com with SMTP id j34-20020a05600c1c2200b003da1b054057so3082853wms.5 for ; Fri, 13 Jan 2023 05:39:27 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id m7-20020a05600c3b0700b003cfd4cf0761sm33086908wms.1.2023.01.13.05.39.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Jan 2023 05:39:25 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DBEF71FFBC; Fri, 13 Jan 2023 13:39:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IpI+f91+f5TQxZSZ9YYmXQNXzc5fyENbdAfl6yb8iI0=; b=YWYBidxtquvEle0b+gcUGiVVaqAoWFgOz81WXVV4mGs2EkMkAeisDuh+9DrPvek9Tk ro59LmzpRXekMICZDRZ9cx4L5MqkdxpS8l90ImtpCKd+onYOc4GyT415ZK9mZ+aE2aTW bQ2oS+bcU4vZU6wP/eV37Tba3DpmrgSwywYyGxgVfn+o7BpauTT8WaHdzo5czwDOykC1 MH5A8YcUQPU1oSurHGHxG3pU+jNGMBU/VC5Sj/Io6u92dl9+WWp12lhRDsq2ocIQpRUu oHOlJFNUqquv8CGubkjk0y/v5itnSnEfC6f9WpIxonkioeDZ29WAMJuKx3u9BHbqVA0V zRCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IpI+f91+f5TQxZSZ9YYmXQNXzc5fyENbdAfl6yb8iI0=; b=3xRjWd6jNX8N6MdExWrQUHekEhiLySNEePBYHh/JAkf5R5611r3rTk6txps5kXBMQZ mEyuseIJUxq/CK3o0U7/YkFD189OD5zCcHeyxOjLpLax1pRB/zyg/ovPpHD9JUz/xoco 9fvW07PwwDh/Daad/mhr0FjhATNMgB+czIMvzMFy8xS62qdamut76NUbq6viovRQ/0hk cP4LcE06tdJ7p1aOMu8dv8MeZZT1IyAlldsiSYc91lnw1+H+4WGfFP2x/l/xVl+mnJte adR+Ltr5YcPQvCFu2pUFzuhepgy752NyukP6ukaKcLioJW5db8b2i3kyTNZvXtHXh3gA U2Gg== X-Gm-Message-State: AFqh2kquDwNeziYsIJUDKVP2cIwRZW73QT424LtBjFh8U1xlR+B0jkqd doWAYUrdEzSn2VTrDwKWiakjwA== X-Google-Smtp-Source: AMrXdXt8AeNDKflibce0uvi6rbCkE3IhhgwNfVXeVtDPbCYnMNcUa67z0MN8FAqCtJjPo6v0xVYd6Q== X-Received: by 2002:a05:600c:5113:b0:3d3:5c21:dd99 with SMTP id o19-20020a05600c511300b003d35c21dd99mr58335451wms.18.1673617165641; Fri, 13 Jan 2023 05:39:25 -0800 (PST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , John G Johnson , Elena Ufimtseva , Paolo Bonzini , Jagannathan Raman Subject: [PATCH 4/4] docs: add an introduction to the system docs Date: Fri, 13 Jan 2023 13:39:23 +0000 Message-Id: <20230113133923.1642627-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230113133923.1642627-1-alex.bennee@linaro.org> References: <20230113133923.1642627-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x332.google.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, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673618752685100001 Drop the frankly misleading quickstart section for a more rounded introduction section. This new section gives an overview of the accelerators and high level introduction to some of the key features of the emulator. We also expand on a general form for a QEMU command line with a hopefully not too scary worked example of what this looks like. Signed-off-by: Alex Benn=C3=A9e Acked-by: Richard Henderson Reviewed-by: Kashyap Chamarthy =20 --- docs/interop/qemu-qmp-ref.rst | 2 + docs/system/index.rst | 2 +- docs/system/introduction.rst | 216 ++++++++++++++++++++++++++++++++++ docs/system/multi-process.rst | 2 + docs/system/quickstart.rst | 21 ---- qemu-options.hx | 3 + 6 files changed, 224 insertions(+), 22 deletions(-) create mode 100644 docs/system/introduction.rst delete mode 100644 docs/system/quickstart.rst diff --git a/docs/interop/qemu-qmp-ref.rst b/docs/interop/qemu-qmp-ref.rst index 357effd64f..f94614a0b2 100644 --- a/docs/interop/qemu-qmp-ref.rst +++ b/docs/interop/qemu-qmp-ref.rst @@ -1,3 +1,5 @@ +.. _QMP Ref: + QEMU QMP Reference Manual =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =20 diff --git a/docs/system/index.rst b/docs/system/index.rst index 282b6ffb56..3605bbe1ce 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -12,7 +12,7 @@ or Hypervisor.Framework. .. toctree:: :maxdepth: 3 =20 - quickstart + introduction invocation device-emulation keys diff --git a/docs/system/introduction.rst b/docs/system/introduction.rst new file mode 100644 index 0000000000..15e4cf773d --- /dev/null +++ b/docs/system/introduction.rst @@ -0,0 +1,216 @@ +Introduction +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Virtualisation Accelerators +--------------------------- + +QEMU's system emulation provides a virtual model of a machine (CPU, +memory and emulated devices) to run a guest OS. It supports a number +of hypervisors (known as accelerators) as well as a dynamic JIT known +as the Tiny Code Generator (TCG) capable of emulating many CPUs. + +.. list-table:: Supported Accelerators + :header-rows: 1 + + * - Accelerator + - Host OS + - Host Architectures + * - KVM + - Linux + - Arm (64 bit only), MIPS, PPC, RISC-V, s390x, x86 + * - Xen + - Linux (as dom0) + - Arm, x86 + * - Intel HAXM (hax) + - Linux, Windows + - x86 + * - Hypervisor Framework (hvf) + - MacOS + - x86 (64 bit only), Arm (64 bit only) + * - Windows Hypervisor Platform (wphx) + - Windows + - x86 + * - NetBSD Virtual Machine Monitor (nvmm) + - NetBSD + - x86 + * - Tiny Code Generator (tcg) + - Linux, other POSIX, Windows, MacOS + - Arm, x86, Loongarch64, MIPS, PPC, s390x, Sparc64 + +Feature Overview +---------------- + +System emulation provides a wide range of device models to emulate +various hardware components you may want to add to your machine. This +includes a wide number of VirtIO devices which are specifically tuned +for efficient operation under virtualisation. Some of the device +emulation can be offloaded from the main QEMU process using either +vhost-user (for VirtIO) or :ref:`Multi-process QEMU`. If the platform +supports it QEMU also supports directly passing devices through to +guest VMs to eliminate the device emulation overhead. See +:ref:`device-emulation` for more details. + +There is a full featured block layer allows for construction of +complex storage topology which can be stacked across multiple layers +supporting redirection, networking, snapshots and migration support. + +The flexible ``chardev`` system allows for handling IO from character +like devices using stdio, files, unix sockets and TCP networking. + +QEMU provides a number of management interfaces including a line based +:ref:`Human Monitor Protocol (HMP)` that allows you to +dynamically add and remove devices as well as introspect the system +state. The :ref:`QEMU Monitor Protocol` (QMP) is a well +defined, versioned, machine usable API that presents a rich interface +to other tools to create, control and manage Virtual Machines. This is +the interface used by higher level tools interfaces such as `Virt +Manager `_ using the `libvirt framework +`_. + +For the common accelerators QEMU supported debugging with its +:ref:`gdbstub` which allows users to connect GDB and debug +system software images. + +Running +------- + +QEMU provides a rich and complex API which can be overwhelming to +understand. While some architectures can boot something with just a +disk image those examples elide a lot of details with defaults that +may not be optimal for modern systems. + +For a non-x86 system where we emulate a broad range of machine types, +the command lines are generally more explicit in defining the machine +and boot behaviour. You will find often find example command lines in +the :ref:`system-targets-ref` section of the manual. + +While the project doesn't want to discourage users from using the +command line to launch VMs we do want to highlight there are a number +of projects dedicated to providing a more user friendly experience. +Those built around the ``libvirt`` framework can make use of feature +probing to build modern VM images tailored to run on the hardware you +have. + +That said the general form of a QEMU command line could be expressed +as: + +.. parsed-literal:: + + $ |qemu_system| [machine opts] \\ + [cpu opts] \\ + [accelerator opts] \\ + [device opts] \\ + [backend opts] \\ + [interface opts] \\ + [boot opts]=20 + +Most options will generate some help information. So for example: + +.. parsed-literal:: + + $ |qemu_system| -M help + +will list the supported machine types by that QEMU binary. Help can +also be passed as an argument to another option. For example: + +.. parsed-literal:: + + $ |qemu_system| -device scsi-hd,help + +will list the arguments and their default values of additional options +that can control the behaviour of the ``scsi-hd`` device. + +.. list-table:: Options Overview + :header-rows: 1 + :widths: 10, 90 + + * - Options + - + * - Machine + - Define the :ref:`machine type`, amount of memory etc + * - CPU + - Type and number/topology of vCPUs. Most accelerators offer + a ``host`` cpu option which simply passes through your host CPU + configurtaion without filtering out any features. + * - Accelerator + - This will depend on the hypervisor you run, will fallback to + slow TCG emulation by default + * - Devices + - Additional devices that are not defined as default with the + machine type + * - Backends + - Backends are how QEMU deals with the guests data, for example + how a block device is stored, how network devices see the + network or a serial device is directed to the outside world. + * - Interfaces + - How the system is displayed, how it is managed and controlled or + debugged + * - Boot + - How the system boots, via firmware or direct kernel boot + +In the following example we first define a ``virt`` machine which is a +general purpose platform for running Aarch64 guests. We enable +virtualisation so we can use KVM inside the emulated guest + +.. code:: + + $ qemu-system-aarch64 \ + -machine type=3Dvirt,virtualization=3Don \ + -m 4096 \ + +We then define the 4 vCPUs using the ``max`` option which gives us all +the Arm features QEMU is capable of emulating. We enable a more +emulation friendly implementation of Arm's pointer authentication +algorithm. We specify TCG acceleration (although it would actually +default to that) + +.. code:: + + -cpu max,pauth-impdef=3Don \ + -smp 4 \ + -accel tcg \ + +As the ``virt`` platform doesn't have any default network or storage +devices we need to define them. We give them ids so we can link them +with the backend later on. + +.. code:: + + -device virtio-net-pci,netdev=3Dunet \ + -device virtio-scsi-pci \ + -device scsi-hd,drive=3Dhd \ + +We connect the user-mode networking to our network device. As +user-mode networking isn't directly accessible from the outside world +we forward localhost port 2222 to the ssh port on the guest. + +.. code:: + + -netdev user,id=3Dunet,hostfwd=3Dtcp::2222-:22 \ + +We connect the guest visible block device to an LVM partition we have +set aside for our guest. + +.. code:: + + -blockdev driver=3Draw,node-name=3Dhd,file.driver=3Dhost_device,file.file= name=3D/dev/lvm-disk/debian-bullseye-arm64 \ + +We then tell QEMU to multiplex the :ref:`QEMU monitor` with the serial +port output (we can switch between the two using :ref:`keys in the +character backend multiplexer`). As there is no default graphical +device we disable the display as we can work entirely in the terminal. + +.. code:: + + -serial mon:stdio \ + -display none \ + +Finally we override the default firmware to ensure we have have some +storage for EFI to persist its configuration. That firmware is +responsible for finding the disk, booting grub and eventually running +our system. + +.. code:: + + -drive if=3Dpflash,file=3D(pwd)/pc-bios/edk2-aarch64-code.fd,format=3Draw= ,readonly=3Don \ + -drive if=3Dpflash,file=3D$HOME/images/qemu-arm64-efivars,format=3Draw diff --git a/docs/system/multi-process.rst b/docs/system/multi-process.rst index 210531ee17..16f0352416 100644 --- a/docs/system/multi-process.rst +++ b/docs/system/multi-process.rst @@ -1,3 +1,5 @@ +.. _Multi-process QEMU: + Multi-process QEMU =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 diff --git a/docs/system/quickstart.rst b/docs/system/quickstart.rst deleted file mode 100644 index 681678c86e..0000000000 --- a/docs/system/quickstart.rst +++ /dev/null @@ -1,21 +0,0 @@ -.. _pcsys_005fquickstart: - -Quick Start ------------ - -Download and uncompress a PC hard disk image with Linux installed (e.g. -``linux.img``) and type: - -.. parsed-literal:: - - |qemu_system| linux.img - -Linux should boot and give you a prompt. - -Users should be aware the above example elides a lot of the complexity -of setting up a VM with x86_64 specific defaults and assumes the -first non switch argument is a PC compatible disk image with a boot -sector. For a non-x86 system where we emulate a broad range of machine -types, the command lines are generally more explicit in defining the -machine and boot behaviour. You will find more example command lines -in the :ref:`system-targets-ref` section of the manual. diff --git a/qemu-options.hx b/qemu-options.hx index de3a368f58..1568f1e496 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -20,6 +20,9 @@ DEF("version", 0, QEMU_OPTION_version, SRST ``-version`` Display version information and exit + + .. _Machine Options: + ERST =20 DEF("machine", HAS_ARG, QEMU_OPTION_machine, \ --=20 2.34.1