From patchwork Fri Jan 13 13:39:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 642034 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp350579pvb; Fri, 13 Jan 2023 10:11:43 -0800 (PST) X-Google-Smtp-Source: AMrXdXsnaWR2hk71mcEqgOu5tf7FUH2Shw66GJzHwfyXZCQFMupV4dXIIW22O78xEi9YNF5WK1Gu X-Received: by 2002:a25:8608:0:b0:7bf:edd2:2eca with SMTP id y8-20020a258608000000b007bfedd22ecamr15069380ybk.19.1673633503620; Fri, 13 Jan 2023 10:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673633503; cv=none; d=google.com; s=arc-20160816; b=Nk3+E5Jz3QrPYPKRQWzQo3/CNuiN+MNGF71YAo2BTcI2sME6/+PGG/JzXbC7T+ke2I qNNMLqpf81exo+VJxkE8MNWZrNNG7EGzGGnZEIz8rxN7QgPDmSIZ9pk6eLPzYVlkxTgH PHwsf1+Z8UGWerfQTkiX93d7kJPgN0D8lebN/+FcM2dTI2jHg5twoqOK3l0datVsh7pS V6gtnUTPV0z9sgL5X6gbjEBGR9UbfAfzB7TTQYplXJBtN6HDHy5u0vVmoNYOxi7ft+j4 EYGf2F9WLYbjSuUDHBpTWS9RWk/Iwn7DfWNDxzCT7K82032oKEVJFofRhDuzrFrXFLPv ENdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YX3naq5ZNqjOTiMOy0rg53RIUBd9djjd4qY57KHB7I4=; b=m2tC4ToPgcwkYRVc9sabK+s8A2yPQpYZ++L/l99qVHNNw7AsICLisWtc3MT0nVNfGN /GFotgaszzoyiAvYcHxVsEGm59QsvEWIwOamfbLxgrRHaGtl6z1x03zkwgMHZT3YZ0Mg VWlKTvtpK6l8qaXV7e9js728pgdqaIl/R4JnKiAZ178PNM8nlsXaVw20npFte5VBzTVI o+Fxlzu+o4l+kbXGxMzm1weoKCSR2lQp6//fBStbAKYMr7LuWRNcyAPxBvH94w92CyWm zqucq5Bm77355L7a1wSqhnHIQQw5d3e2coTp+Feili8ZhrNecYuP6sn/zwBV1safNUFq bASw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WjTtB4O9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g12-20020a05620a40cc00b006fccb6a8379si14026398qko.635.2023.01.13.10.11.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2023 10:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WjTtB4O9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Make it easier to navigate the documentation. Signed-off-by: Alex Bennée 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. 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. -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. -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. .. 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 ------------------- From patchwork Fri Jan 13 13:39:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 641947 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp225860pvb; Fri, 13 Jan 2023 06:13:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXvzX2QBVHyur+nPXxo5O+8yHlAid+H4hBfX0RTS2RzLOzXpmDRPD+zyeWKDT0f9KFuArQOf X-Received: by 2002:a81:5503:0:b0:4dd:52f0:3609 with SMTP id j3-20020a815503000000b004dd52f03609mr2529906ywb.43.1673619227423; Fri, 13 Jan 2023 06:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673619227; cv=none; d=google.com; s=arc-20160816; b=FVI+eu9/Mp91kYKsHqBkuQ1FvHKiIgEg1Niruq9Gt4xjavdfkckCGs4VQ1DojRkkFK 9u83a2/auIv5pr9W184uRVvZqtVy5hhv/KkYUhUiZiVMM2OwD+EghHDQQILe9NFYihQC zfDEIOm4PgPfJMSihwBhAQas1LFp1FyPg11ZsA9MNX7vR/DadMQ4asSeEFMNJrv68Pxn CDOuS6XhJAdCEYmvl/zhZazIwixTl0VD8FdALHVq92W/kI/sgkTyAFvmajEASkJSaFw2 ifRgaJqJ4qczL8jhvbdU6bW70aNqCt6EgjYKAJJxUS4oHSr1BTTna77Kegj1lnVCk3zl GV1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZkjvImv3urfubQ/CIur/IuzDRXVAlRae10Z3LaYvYZ8=; b=i2uGYKYoKDLQ71X7jYvdytBNJY9gmfOwYaFmPldtJkJkgJJxNI/PmRGDpJvpqdHfkT sgQVoNj2FepLiw1X8yuSBSblfuTfOVzcHnERAx3gkjwT89S/MSIHawERxCHepWTmxZ4m rIjyHigAtDavfM/lcdWPeBhfYZdzvvzhj++ZN2dXdyEdWZA4HdRmCujpt8A8eeE6nOIK jTqBBl7xw7uxPJLmDYMT+o6Wjp3h4CWT0nDkc7/P5vndfTAGGebarDI2uBmdOT3HbkMs h00b5JIUX/NE2OBfOXD++Qs91CNMow+zzyWVnY9o78ArXySxeTgBtja/bBvz9mk/QM0E jD+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQ98xfT4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTP id j4-20020a05620a410400b006ff045dc7e6si13516921qko.29.2023.01.13.06.13.46 for ; Fri, 13 Jan 2023 06:13:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KQ98xfT4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This affects both system and user mode emulation so we should probably list it up front. Signed-off-by: Alex Bennée --- 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 +========= + +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 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ée +.. _TCG Plugins: + QEMU TCG Plugins ================ 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 ================================== From patchwork Fri Jan 13 13:39:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 641945 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp214526pvb; Fri, 13 Jan 2023 05:55:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXscm7xcKwzNKaQMGIa7/Y4+snXQsjwAIrJCdrifmJbuqbcutBlAz6NkUoRDL69F5MF796Ec X-Received: by 2002:a05:6214:176a:b0:534:2b06:2d7 with SMTP id et10-20020a056214176a00b005342b0602d7mr10362730qvb.47.1673618109754; Fri, 13 Jan 2023 05:55:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673618109; cv=none; d=google.com; s=arc-20160816; b=JRzYga4g8/k+Ata9tJ+hIgDB2TzNaD3FR9qu+qcazp1gUuzBECuhVfBkRMXCFo29X4 5kxnfhu9YxuUEFH9HWMbV4OLP8rC6DnO+gKZgobFNhtsGzC6ySZpPHGzMrEprJdsfVic x2VUAIpIb7Y0MTX8a0ArugKa2EjbJYczv3N0ibQdQn1wiLnvv8K9pR79vV7szgVZ/hkK DnqNhzYe3Q4ax/SfNTWu/4OvZA5r5cBpoC6ASkabOd1gjTPuknh3kgqzyQu2CAfB/Rz/ d3jeFR0f6KVj9coDlhv6rbn+r8nzdpyPyiwuFCziR9KO0CmFLZwT1Re2La+aRd0EoLMX GxBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iH1g5BvDblNdu81W4rW5xEHawJ+gs3U9vzCLE7pUyII=; b=UoiGpDmy/EjSF9JB/u5t0TC2gsFgdo/bymbCH1qYEw9MC/FcexTCNe5bdOt/IwfTEz 1OyKgYJFqbRPXLeBLlaiQ4cme9i185n47XsJagKj6EUFrCzhutwrbvelwksVN6Zn6qPG fj8ZPSPkCtEZmMtzn2dnmZpYf9cptGH3LONpZ0J+RXa8fOtxgo/sJvpk8mD0ygX7q68W FWWwFFz/h4SjjqV5HxXvPhAGASRKEQSTnKorLn9yUV+qnOakH+eVkU7QwwFfwG2QtCc3 L0dOLRheJAmTl8tqcTEdcNIbXmy1g2aIN66D9R/YSivUiMY9bzgtEVvbGHfxyw+NGf5X 5ryA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M61bcgJs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v5-20020a372f05000000b00705cb0f9d74si6280264qkh.411.2023.01.13.05.55.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2023 05:55:09 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M61bcgJs; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée --- 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. 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 confusing. + +.. 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/semihosting.rst + * - m68k + - System + - https://sourceware.org/git/?p=newlib-cygwin.git;a=blob;f=libgloss/m68k/m68k-semi.txt;hb=HEAD + * - mips + - System + - Unified Hosting Interface (MD01069) + * - Nios II + - System + - https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=blob;f=libgloss/nios2/nios2-semi.txt;hb=HEAD + * - RISC-V + - System and User-mode + - https://github.com/riscv/riscv-semihosting-spec/blob/main/riscv-semihosting-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). - 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: 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=on|off][,target=native|gdb|auto][,chardev=id][,userspace=on|off][,arg=str[,...]]`` - Enable and configure semihosting (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V + Enable and configure :ref:`Semihosting` (ARM, M68K, Xtensa, MIPS, Nios II, RISC-V only). - 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. ``target=native|gdb|auto`` Defines where the semihosting calls will be addressed, to QEMU From patchwork Fri Jan 13 13:39:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 641946 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp221002pvb; Fri, 13 Jan 2023 06:05:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsMpTTjbpfJikIIGbBSLUvOenZspwaid5gc1Um5wwgJ70zGLNAhA5k4rhduk3ZwhFCdFtsi X-Received: by 2002:a05:6214:20a:b0:4c7:7257:68a2 with SMTP id i10-20020a056214020a00b004c7725768a2mr106506927qvt.15.1673618750643; Fri, 13 Jan 2023 06:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673618750; cv=none; d=google.com; s=arc-20160816; b=tOSXD32hgSXZKNOeRPVsAAHbImwoCr9/lHWtKU0NlSKGNhYWjJYIZGBMkewshoVHRC 9E9upaSWcV+lKcyGaQ1Hypk0ABl0QVVIJ00xRi+x0IF2Z2t4iD0aOvvTRd8tTHLux9eV ZSpDOQsTJbLJlf3040m+bbnUd3sbUIeOrWi9FLVTNqlVp0dG3hF2idKyU4F49CiwUIux 0hCPvMDxL4OQgK75DI3VqKQHwqdD/goDAPfmFqa9Q6e3qWT5RW/Lw0MtVeSS/UfhUO1U Sh6Sx0xSbbZWPdw1sd6z4G4h9PajtAvZH4P3UMBGdskThLXz1vaTq4KKWc9Uuh/9sxNy djew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IpI+f91+f5TQxZSZ9YYmXQNXzc5fyENbdAfl6yb8iI0=; b=D72hgxGNeGhUdAMNt4ynnR2vPxyYUDfEPUcQjLrPP/Q2fyXoRbD0nW5ZByZiX9JGvt vWe0hBIfNH3SAjf2tSKhXcyPz6BZgyJjnKUj5l2EcVyKcaPDNKB4ofq7cCRhEMzMrCq9 zJy00DYFF6gD7avJ2yrtSHqYwkuCXiJf8PKGzBNldYmkA7ui6sjVG2bxU4RHSMpa7xEO h925e6mMzdGAUPZDmGuyBzgZBhQbW3l0MjjxRcoFgc2eo8Du2fpPSmHhUJoqP+YVizCz rrVDJKB6/eJpXURCcWTVoeTE/kN++PzA9JBJ92ldCrAHpkEMwq52ILrwMdqsYllmkqnx UfEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWYBidxt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jl10-20020ad45e8a000000b0053423792bb9si6040437qvb.317.2023.01.13.06.05.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2023 06:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YWYBidxt; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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) 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-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) 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) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Alexandre Iooss , peter.maydell@linaro.org, Markus Armbruster , Mahmoud Mandour , =?utf-8?q?Alex_Benn=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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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ée Reviewed-by: Kashyap Chamarthy --- 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 ========================= 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 - 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 +============ + +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] + +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=virt,virtualization=on \ + -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=on \ + -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=unet \ + -device virtio-scsi-pci \ + -device scsi-hd,drive=hd \ + +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=unet,hostfwd=tcp::2222-:22 \ + +We connect the guest visible block device to an LVM partition we have +set aside for our guest. + +.. code:: + + -blockdev driver=raw,node-name=hd,file.driver=host_device,file.filename=/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=pflash,file=(pwd)/pc-bios/edk2-aarch64-code.fd,format=raw,readonly=on \ + -drive if=pflash,file=$HOME/images/qemu-arm64-efivars,format=raw 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 ================== 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 DEF("machine", HAS_ARG, QEMU_OPTION_machine, \