From patchwork Mon Mar 8 13:50:47 2021 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: 395419 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1833293ejz; Mon, 8 Mar 2021 05:51:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxWunwA9yXC8CQGVP6wA4G804Y88hcUl63Iu8xilc3vMKKmxKwOqkMkZZvpeRnL6yR3vPCR X-Received: by 2002:a02:6014:: with SMTP id i20mr22979300jac.101.1615211519512; Mon, 08 Mar 2021 05:51:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211519; cv=none; d=google.com; s=arc-20160816; b=j9HXklT3cx2aRB4tLjt+neFwsXM0jkk7UlOQHeK+P3LbmSFPQDqU+ZXwQMFr4v/Gi8 0Fp3SCuuqXuARNHOeahJJvppOJ9JMsruFyM4IbjVIDgqQx+uBll+5VPRdh6No+K6sGOk cZUiqrWEWd4dRk0mAqA84HiI/87Dy5Odi+SRsWmKVdzoWfwWxA1jeQ0xacj+6rkEBlaK cu8SHUP5+1zT/niKxrj7vYHNnlYSCjX6+Z4iMN8vcFoDKLPIFSpnCsOV6vM15tg08w3T gZgCSWs6WhJoJoLaKvCj/o4SF6qlLP8OUs5aRvHMoosn6zRxtq2pG3LSjVxL6anmPglT 80Hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=5ig15pshghu+eCUM7ti/ab+kHioEFzPWJ0umuCSDYnY=; b=CKOqvTM6wQusWEDY310R1OqeKpzyCb0HMi48FWNPC6Geu15FuehBXP6n7GP6XBwHFb kK6osAxIaRqJHI9zMMmIB2YiS9Cqe+e0Ibl1Ijm3DgEg4KKTslysQVArvVlYcTyyQwBO L/d4PPRLGxTUwC8tzqmL5TPyQN0jA8Y5HAJcNU7NJuBaRnDHsnEsvTWBIq/4Jw4D697k RHPvo9DmkTHglI2dG2k98iDpFlQLEV0J5D5jXZKBFTBipZQinwNvPtILpS0OFgyYBC3J AsV6+sRqhR16yJAxqW3wBiERU1huESQ3xWBbhfZxqsZHq6R0Tmt0fbpiEO2y8jP/lKh6 lyhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="z5G/ThX5"; 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=fail (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 d71si9757569jai.44.2021.03.08.05.51.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 05:51:59 -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=fail header.i=@linaro.org header.s=google header.b="z5G/ThX5"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37530 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGIg-0006M2-Om for patch@linaro.org; Mon, 08 Mar 2021 08:51:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGHw-0006KT-70 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:12 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:39426) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHu-00018Z-AJ for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:11 -0500 Received: by mail-wm1-x329.google.com with SMTP id 124-20020a1c00820000b029010b871409cfso3836567wma.4 for ; Mon, 08 Mar 2021 05:51:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ig15pshghu+eCUM7ti/ab+kHioEFzPWJ0umuCSDYnY=; b=z5G/ThX5vPlSTYpr7+kb7A9dA6jKSNWXefTep1CiZP5IZ35DvMyUWjd0WiPrDCpZxX pSqDjdLFnPVzlIQSzzb/DjfdA/dI87aQ7fDGeZTkeZvbwysAvDMkYIgWjuTqqcnBi5mp 3SyhgvJkcgjj5EIuPDOubzrZ61QwYUYjkYulj8Fg8eO+k87qqpKvRwheUjaXNlQAKmXf A/U/c6OzA6wt9KiB3k0bD7LCmPH+IUO+hWdIKy+d5QRZp51cwoFc6KsqsM9KB8LJMWnR iR/587KYDN9YDW99T8qAnHhF9+EWuBWVQluXFUieqScoq3H4wx5+s+3sn62gUzWAIUQz /TTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ig15pshghu+eCUM7ti/ab+kHioEFzPWJ0umuCSDYnY=; b=akHLmzZIqDznuRd2Zh0tVYuaUiYFCzifPiWdsxB35DrZqA/vnjkSR0t/potiHVvHvZ rsXniQrS7TUqV6DRPnowrdE9f/RgZHrlL27karywFelzNpYTE78T5BuCGJ4qdsuy6aNM n2eWTcxd0VT4Iwodyz2ofjKa6VqtU7a2peJQj3gC+MFyMI3r29pnIQlmy/P3l7+KGh4v JPJujjyM9teF3TP3RDq1uKig2zfQX/hR3e+KP5+tRwbVp9do5fa/7fgHx5zruVDyGtA2 /1VLExKC5B3Xhs0n0ODaLkWhx7i36x9gD5taAnG+LO5WLXC2jOcqQvLjbfzkmlN2cIrR rJNQ== X-Gm-Message-State: AOAM531Y+PbKS5tcfvkQWEgYBE82rO6gXnC1md5U/779djfZxaq5ehA8 PxB/xsBGgiAfVd9MKNe4bvwDNQ== X-Received: by 2002:a7b:cdf7:: with SMTP id p23mr22396937wmj.26.1615211467336; Mon, 08 Mar 2021 05:51:07 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 75sm21051147wma.23.2021.03.08.05.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:05 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D7C961FF87; Mon, 8 Mar 2021 13:51:04 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 01/18] docs/system: add a gentle prompt for the complexity to come Date: Mon, 8 Mar 2021 13:50:47 +0000 Message-Id: <20210308135104.24903-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: John Snow , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Stefan Hajnoczi Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We all know the QEMU command line can become a fiendishly complex beast. Lets gently prepare our user for the horrors to come by referencing where other example command lines can be found in the manual. Signed-off-by: Alex Bennée Reviewed-by: Stefan Hajnoczi Reviewed-by: John Snow Reviewed-by: Thomas Huth Message-Id: <20210305092328.31792-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/system/quickstart.rst b/docs/system/quickstart.rst index 3a3acab5e7..681678c86e 100644 --- a/docs/system/quickstart.rst +++ b/docs/system/quickstart.rst @@ -11,3 +11,11 @@ Download and uncompress a PC hard disk image with Linux installed (e.g. |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/docs/system/targets.rst b/docs/system/targets.rst index 75ed1087fd..9dcd95dd84 100644 --- a/docs/system/targets.rst +++ b/docs/system/targets.rst @@ -1,3 +1,5 @@ +.. _system-targets-ref: + QEMU System Emulator Targets ============================ From patchwork Mon Mar 8 13:50:48 2021 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: 395434 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1860187ejz; Mon, 8 Mar 2021 06:23:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWiY/r5R7r5515fo12CWP328T+fKbNSKOAbbEWQouoGuxi6Kn4J0kzYdUnHl2OxJ+I9+Pw X-Received: by 2002:a05:6e02:92f:: with SMTP id o15mr20281992ilt.111.1615213434346; Mon, 08 Mar 2021 06:23:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213434; cv=none; d=google.com; s=arc-20160816; b=vglk5NTdifyeh2N+BrgTpUjdnLVlDMsouW+bxhQVc8NqZdc7sw2snDhsscBNZyIpLG 1zIvlUGWB5RJb2AglFkH3acxZGlsByqW1VDBA/ryq769BsVYIyoXGl0g/fxH2FeOP6vB /KW5Q7OMRLD79IRiwIu3wMDHg/D2yzCpnax8i5RvkLHjbA5b8C1wr5Axu2kdk45pCtUA T7aFT7t4l2D98v0ntOipBVQ7GPaGmYmFXcNnlBBncvvXrwwHmB0EOjtmPJmHDiMo3vjI DRfZv+3cTT0LLCiyL6i2zlA2dM6Jx/V69+4NHLDMdLtJxG7Jxng8WMsRsm4qtbZ5RP1d Co3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=8s+rghqoDmtXn+vNGYx+gVftGGy4eFdbii8sa4jsLZY=; b=TOFn0TlZwiPDGZtX+dvxWAiRXD2aM15am9rUUyRJFAfkVxMk7aUw+F7lWlEu4vkK1m A6yEadpYqXrPNxZINy6uWdmifHq7vYF70F9/7yJSKe3EIqWc1NfKKk4NchupkdsPR0va 0GptWvuprawk/ObgVL7TzsNVp+mwmvcf0YItjbAJJlWAvhg7bFoi80oEgqzFAIJhO5G0 WxP6npaSAMYTzOjtBMUpjSGpx2juXYldp/oAsRrLZ8NcNpY8vJVWw07J6jqIeCQbkneS mRBilws0BB2LA6yS2JDh98x4B0smugACZKhHDLH+rAKGVLf9aMb5ps43mrUMA7IKtkLi GLlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JDikbxMe; 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=fail (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 m26si11011937jap.40.2021.03.08.06.23.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:23:54 -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=fail header.i=@linaro.org header.s=google header.b=JDikbxMe; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGnZ-0001zu-OP for patch@linaro.org; Mon, 08 Mar 2021 09:23:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53398) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGHw-0006LN-RO for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:12 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:43516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHu-00019K-D8 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:12 -0500 Received: by mail-wr1-x430.google.com with SMTP id w11so11520130wrr.10 for ; Mon, 08 Mar 2021 05:51:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8s+rghqoDmtXn+vNGYx+gVftGGy4eFdbii8sa4jsLZY=; b=JDikbxMe31Qs386NyhLVjDJP1O2ASmRPqTJr1Eo25jJA1aSYX5hNZgrkqIEtuFZQ8o GER0O6R2D6FYGFDD5JQ9Y8Xwn132jIAgudYG6TIchQBulqGZ6XohPihD1+sFvL8UCZqL wsBRCB+UZL1KkjFVFvuJUca8gTte58l0FMTocmR7KWT95FBdctukHW8H8e3KiMOYCCA9 IC5hUWW1rBOhFQTlrFPTTYgHs6RRGTLv2PxwlL/A3pffPs67z3HS4SGSf2j6c3AIqNyK 5CZB5O3evBOptQIJ01szDbLqBdylKokkkgWsejHH7x9Z1RstGE4RDUnuf5Pl+6czS2Od /m7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8s+rghqoDmtXn+vNGYx+gVftGGy4eFdbii8sa4jsLZY=; b=RwnL2iFnCHMg3dw9Y02mgTWivIOJ6Rj/u9alwcNjs4NUR4FrKxEjWiFxB+rGz/xVmA YRW4HEvKpa94oM6/88krZ7Gb0YgjQ81XHy5wlJdoXGBYXBvw5ZwCalyQ1x0YEVYXsnx4 D5i2053J5kANIvU7sn1DMIiq6P8T7s+P584g1YY9EE2NpEIkRGefijdXQH2oXtvqPQLu Y/LTXm7gav01aU/Yfv2tAk+5Xtmw5A0gHMubYm3KYbQH+c4waWQWbvF3mtV+aOfIkKRk uI0zIpOxsb1/u26H60awJVOS9tYH9grSqrnKHaZ3dqwVrfYaLn7+czGoW7tBqSOHPVWL XwAQ== X-Gm-Message-State: AOAM530jAEtyQ2ts9EeIgbgi4GRgRtXVnoW9PUh8aHDu0M18XDXWyp7T YGBJAkLB+J/PqwWu2PC7oCWxhQ== X-Received: by 2002:adf:ef4a:: with SMTP id c10mr22319349wrp.427.1615211468858; Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j11sm12300397wro.55.2021.03.08.05.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:05 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ED41C1FF8C; Mon, 8 Mar 2021 13:51:04 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 02/18] tests/docker: add a test-tcg for building then running check-tcg Date: Mon, 8 Mar 2021 13:50:48 +0000 Message-Id: <20210308135104.24903-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is mostly useful for verifying containers will work on the CI setup. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210305092328.31792-4-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/docker/test-tcg b/tests/docker/test-tcg new file mode 100755 index 0000000000..00993b73ba --- /dev/null +++ b/tests/docker/test-tcg @@ -0,0 +1,22 @@ +#!/bin/bash -e +# +# Build and run the TCG tests +# +# Copyright (c) 2021 Linaro Ltd. +# +# Authors: +# Alex Bennée +# +# This work is licensed under the terms of the GNU GPL, version 2 +# or (at your option) any later version. See the COPYING file in +# the top-level directory. + +. common.rc + +cd "$BUILD_DIR" + +# although we are not building QEMU itself we still need a configured +# build for the unit tests to be built and run +TARGET_LIST=${TARGET_LIST:-$DEF_TARGET_LIST} \ +build_qemu +check_qemu check-tcg From patchwork Mon Mar 8 13:50:49 2021 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: 395426 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1842095ejz; Mon, 8 Mar 2021 06:03:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJz2st6xuy70UCVXpLXYjNGrCRdd7f+lZS08y7BmH8oO7kUw/rxtdXH6d027+pD7P4Punik5 X-Received: by 2002:a05:6638:1192:: with SMTP id f18mr23534219jas.19.1615212214828; Mon, 08 Mar 2021 06:03:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212214; cv=none; d=google.com; s=arc-20160816; b=mmT0iyxA4sMm/QStRnAJSXcZ//zbY59tw6auEdQGobbd3JnWn65cA/x7F8UG6ef5Sd 3LBz3CloOGy1BvxT53WTb+nu6Q4/taWA7pQLDAFhfG7BiChXD/sYOTNbUaObSncuPwAf TPdQTfMIu6m6/ISqrk2XnKF9JZveQiaD8dNC0oZnZ/zu0rbV3w1rCvOlyHuzqXhEAx17 F2VqGLOa0Na0PFoeaqMJi5oTNVLhdKlLLYwZ9CLNbrr0DtfmMOHJybSC7u+AqXX8d0Kj cAS6B5Ank54ELNNG1qHOtt/o7NHqsc+GwhI7+miXcxaRaJudAzpNJ1OXrJo0/gfPLJum Lpaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=G76SoJtpg/utI3pi7yuaH54pQQHht3OmiN4w23IPZNk=; b=VFko/z2thc5iPE67EEFj875KqcCgniqjD00UqcuSzIbGIF+WeZn/sMvKDnWDNziE7X ppxb1037cdebswQqGPdEZgAekLj3CyaxqqJ05lW9XoctquJJR0KwOiQoXTrsjohg4N26 HaW1zGKTXvt6rOOHHRwf4VmC6TP++vD7uo2VQMq4REsA2jzVLy8tLoPKK6S/KBWBTS/M SOZ+hb3+If89X6cMCfwPGnr5Krv2T7dO3FIPHKJewuOeSeV1gAcinBZ+qZ7J77uJJcfa u8KtKLTxD3GE3M8nhBpIFgPGtZ5F+8WrA4708Hn3+MN0dxiyWuqciLboxS1mY2MV+MKR BEsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=scKbVmgG; 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=fail (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 d1si9573173jam.28.2021.03.08.06.03.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:03:34 -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=fail header.i=@linaro.org header.s=google header.b=scKbVmgG; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45136 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGTu-0004cY-4o for patch@linaro.org; Mon, 08 Mar 2021 09:03:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGHz-0006Ph-4C for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:15 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:36381) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHw-0001AL-El for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:14 -0500 Received: by mail-wr1-x435.google.com with SMTP id u14so11550766wri.3 for ; Mon, 08 Mar 2021 05:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G76SoJtpg/utI3pi7yuaH54pQQHht3OmiN4w23IPZNk=; b=scKbVmgGM4Rf0NqeHE7I8S1aaZXnfsVoJVEKzd32dpSgngZVw/UL3NsaOuwvX/HSsm qrPxy2Tdbs+opE4KnOA6RxxdSRl7DaiJcPqgEmigLgp7JYV0J06AXZPrzQtzWYX+qvLj +bSZz7rpoR3UnG1i4zEAurUexvYSqHplcgi/6OITgEl3EOUwOiVFTIFwWqd4CBmas3Sz PzE9KOCPzAHvKD9Z3vkdrc4ZhLKFVBXVBvUtiHxAiTg5Pf3oWV/fCEk56srW5EypW2d+ EzkxFVabBEwejjk4ZvVnyh6826To2q9NiU6tMDQV/fPSFzbPEQY4SNbDkMJGOeM3aPlv A6cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G76SoJtpg/utI3pi7yuaH54pQQHht3OmiN4w23IPZNk=; b=knDUHQvhVzgahdfWehdOapGKb9jTtN6mbbSv1dIh774Mc89gK8A2OTCXg5CVEQcHa2 DIo6jRvsQgzqG+Ptha4UiecRulMEG+oBrncmH/vFC7TcSNhH/6GI8X2WGW6orEAHLOc+ Gbn2W9td7vGxleRQce2Xf8zuw2jP9gJiHLlek42IijxtYUC5wCiLGjoBKUMDO6uIEGgc eU+TISUlSY/kNjaumWAmnunUHKgjXUGusaulk32H8z3QnY5kjTJ/AUzTX1F566HdOOca QMYznlCxaCF39tQQcgn5PdZRfrki+r5EGFEcmONN5+It7zy65gIoiElO3vDXFuOGzAyr PFAQ== X-Gm-Message-State: AOAM533oNUBqNsjjo7QBHbFxp7RpSuIswgQLeqf9ttPYpHoX/GcTV2Nr +vm4HYG4viPEx8x6IjKPTbS/Pg== X-Received: by 2002:adf:f4ce:: with SMTP id h14mr22803358wrp.257.1615211471157; Mon, 08 Mar 2021 05:51:11 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p10sm19395791wrw.33.2021.03.08.05.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1392F1FF8F; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 03/18] docker: Add Hexagon image Date: Mon, 8 Mar 2021 13:50:49 +0000 Message-Id: <20210308135104.24903-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Di Federico , Brian Cain , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alessandro Di Federico [PMD: Base on qemu/debian10, add missing EXTRA_FILES, remove X86] Signed-off-by: Alessandro Di Federico Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Brian Cain Message-Id: <20210228222314.304787-2-f4bug@amsat.org> [AJB: add build-dep for QEMU, include in MAINTAINERS] Signed-off-by: Alex Bennée squash! docker: Add Hexagon image Message-Id: <20210305092328.31792-5-alex.bennee@linaro.org> -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index 26c9454823..ab3118429b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -196,6 +196,8 @@ F: linux-user/hexagon/ F: tests/tcg/hexagon/ F: disas/hexagon.c F: default-configs/targets/hexagon-linux-user.mak +F: docker/dockerfiles/debian-hexagon-cross.docker +F: docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh HPPA (PA-RISC) TCG CPUs M: Richard Henderson diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 7cab761bf5..3aee031c4e 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -144,6 +144,8 @@ docker-image-debian-riscv64-cross: docker-image-debian10 docker-image-debian-s390x-cross: docker-image-debian10 docker-image-debian-sh4-cross: docker-image-debian10 docker-image-debian-sparc64-cross: docker-image-debian10 +docker-image-debian-hexagon-cross: \ + EXTRA_FILES:=$(SRC_PATH)/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh # Specialist build images, sometimes very limited tools docker-image-debian-tricore-cross: docker-image-debian10 diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/docker/dockerfiles/debian-hexagon-cross.docker new file mode 100644 index 0000000000..bf32536896 --- /dev/null +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker @@ -0,0 +1,27 @@ +FROM qemu/debian10 + +# What we need to build QEMU itself (as this is used in CI as well) +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt build-dep -yy qemu + +RUN DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ + bison \ + cmake \ + flex \ + lld \ + rsync \ + wget + +ENV TOOLCHAIN_INSTALL /usr +ENV ROOTFS /usr + +ENV LLVM_URL https://github.com/llvm/llvm-project/archive/3d8149c2a1228609fd7d7c91a04681304a2f0ca9.tar.gz +ENV MUSL_URL https://github.com/quic/musl/archive/aff74b395fbf59cd7e93b3691905aa1af6c0778c.tar.gz +ENV LINUX_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.18.tar.xz + +ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh + +RUN ( cd /root/hexagon-toolchain && ./build-toolchain.sh ) && \ + rm -rf /root/hexagon-toolchain diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh new file mode 100755 index 0000000000..19b1c9f83e --- /dev/null +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh @@ -0,0 +1,141 @@ +#!/bin/bash + +set -e + +BASE=$(readlink -f ${PWD}) + +TOOLCHAIN_INSTALL=$(readlink -f "$TOOLCHAIN_INSTALL") +ROOTFS=$(readlink -f "$ROOTFS") + +TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin +HEX_SYSROOT=${TOOLCHAIN_INSTALL}/hexagon-unknown-linux-musl +HEX_TOOLS_TARGET_BASE=${HEX_SYSROOT}/usr + +function cdp() { + DIR="$1" + mkdir -p "$DIR" + cd "$DIR" +} + +function fetch() { + DIR="$1" + URL="$2" + TEMP="$(readlink -f "$PWD/tmp.tar.gz")" + wget --quiet "$URL" -O "$TEMP" + cdp "$DIR" + tar xaf "$TEMP" --strip-components=1 + rm "$TEMP" + cd - +} + +build_llvm_clang() { + fetch "$BASE/llvm-project" "$LLVM_URL" + cdp "$BASE/build-llvm" + + cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=${TOOLCHAIN_INSTALL} \ + -DLLVM_ENABLE_LLD=ON \ + -DLLVM_TARGETS_TO_BUILD="Hexagon" \ + -DLLVM_ENABLE_PROJECTS="clang;lld" \ + "$BASE/llvm-project/llvm" + ninja all install + cd ${TOOLCHAIN_BIN} + ln -sf clang hexagon-unknown-linux-musl-clang + ln -sf clang++ hexagon-unknown-linux-musl-clang++ + ln -sf llvm-ar hexagon-unknown-linux-musl-ar + ln -sf llvm-objdump hexagon-unknown-linux-musl-objdump + ln -sf llvm-objcopy hexagon-unknown-linux-musl-objcopy + ln -sf llvm-readelf hexagon-unknown-linux-musl-readelf + ln -sf llvm-ranlib hexagon-unknown-linux-musl-ranlib + + # workaround for now: + cat < hexagon-unknown-linux-musl.cfg +-G0 --sysroot=${HEX_SYSROOT} +EOF +} + +build_clang_rt() { + cdp "$BASE/build-clang_rt" + cmake -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_CONFIG_PATH="$BASE/build-llvm/bin/llvm-config" \ + -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic --target=hexagon-unknown-linux-musl " \ + -DCMAKE_SYSTEM_NAME=Linux \ + -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \ + -DCMAKE_ASM_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \ + -DCMAKE_INSTALL_PREFIX=${HEX_TOOLS_TARGET_BASE} \ + -DCMAKE_CROSSCOMPILING=ON \ + -DCMAKE_C_COMPILER_FORCED=ON \ + -DCMAKE_CXX_COMPILER_FORCED=ON \ + -DCOMPILER_RT_BUILD_BUILTINS=ON \ + -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \ + -DCMAKE_SIZEOF_VOID_P=4 \ + -DCOMPILER_RT_OS_DIR= \ + -DCAN_TARGET_hexagon=1 \ + -DCAN_TARGET_x86_64=0 \ + -DCOMPILER_RT_SUPPORTED_ARCH=hexagon \ + -DLLVM_ENABLE_PROJECTS="compiler-rt" \ + "$BASE/llvm-project/compiler-rt" + ninja install-compiler-rt +} + +build_musl_headers() { + fetch "$BASE/musl" "$MUSL_URL" + cd "$BASE/musl" + make clean + CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \ + CROSS_COMPILE=hexagon-unknown-linux-musl \ + LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \ + CROSS_CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \ + ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE} + PATH=${TOOLCHAIN_BIN}:$PATH make CROSS_COMPILE= install-headers + + cd ${HEX_SYSROOT}/.. + ln -sf hexagon-unknown-linux-musl hexagon +} + +build_kernel_headers() { + fetch "$BASE/linux" "$LINUX_URL" + mkdir -p "$BASE/build-linux" + cd "$BASE/linux" + make O=../build-linux ARCH=hexagon \ + KBUILD_CFLAGS_KERNEL="-mlong-calls" \ + CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \ + LD=${TOOLCHAIN_BIN}/ld.lld \ + KBUILD_VERBOSE=1 comet_defconfig + make mrproper + + cd "$BASE/build-linux" + make \ + ARCH=hexagon \ + CC=${TOOLCHAIN_BIN}/clang \ + INSTALL_HDR_PATH=${HEX_TOOLS_TARGET_BASE} \ + V=1 \ + headers_install +} + +build_musl() { + cd "$BASE/musl" + make clean + CROSS_COMPILE=hexagon-unknown-linux-musl- \ + AR=llvm-ar \ + RANLIB=llvm-ranlib \ + STRIP=llvm-strip \ + CC=clang \ + LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \ + CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \ + ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE} + PATH=${TOOLCHAIN_BIN}/:$PATH make CROSS_COMPILE= install + cd ${HEX_TOOLS_TARGET_BASE}/lib + ln -sf libc.so ld-musl-hexagon.so + ln -sf ld-musl-hexagon.so ld-musl-hexagon.so.1 + cdp ${HEX_TOOLS_TARGET_BASE}/../lib + ln -sf ../usr/lib/ld-musl-hexagon.so.1 +} + +build_llvm_clang +build_kernel_headers +build_musl_headers +build_clang_rt +build_musl From patchwork Mon Mar 8 13:50:50 2021 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: 395420 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1833316ejz; Mon, 8 Mar 2021 05:52:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuGDpAfP4jN/XCp7WfrW4ganuW3sC4YoL5c+NPkX5rNBVa/MrT8Y/qnEyBJvOUhrA+PR1h X-Received: by 2002:a92:6b11:: with SMTP id g17mr20045003ilc.163.1615211521948; Mon, 08 Mar 2021 05:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211521; cv=none; d=google.com; s=arc-20160816; b=J5Eo2xltJourFzvO/Rf+TkDFZD1uMPtQkF3bYc2scfiUUHm+ZKc3DFmt2JYhhh9t6M apPZN+rxalhnDC7KxdpNvnTXRE09kdi3obbI+3q+uG8ejJTwjFhzGM7szVxYK0TquxrW Xfr4X9a9xOBgcUqKjQkz1h3VU0054/SGf4/XzozRfVYwmhbo2/+bsMP74F/mLAAQGhK8 k2VWsSldLNUE5cfmxqcaZm9Y6JOVrhbTWZnpEnjy+tIl7m9lpOFME8aHKxNq13ir2PZo zH/IjACu33olxqB8gATca0nAlHKYlbWj5XMJPYzrad3uLDV/go43RAUg5bPWG4i8Gzlg ahBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=4iLXz1N0BQOxTQbwmS1B/ilLFWZjmC6OV4ztuE458q0=; b=avVjG13ktB9x2fWICyMn8gnmMQN01ByTq3ZDhQcsy6szdhk4WotsZ59ErtjqF63LfR qKajBl6hsphnFdjKWXyyEOt14e7St4XKfP5d/W6njjBubLFkvRNVMW/eihfPK4L237RV dRBYNJR051WOorqLN8nKiY15gQIPU1/BQm7oE1KxSM7CFknMSVBunkw1o2wbnQsXD997 6UzxzpB4ktWXNgU1PRNMfALcSOHKA6RwO6dFFaV5lQM3lYNTfuhYZafBjcxQ7YE/7QsO 3eyeOsN8VgFo/c0MEiXmPSJ3l2NtdAiRdfsoTtoIJIS6T/5VVpNxQ4+m1w5nIRy7xhKA r0iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XZIB+zcE; 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=fail (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 m7si12881336jav.63.2021.03.08.05.52.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 05:52:01 -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=fail header.i=@linaro.org header.s=google header.b=XZIB+zcE; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:37740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGIj-0006RV-96 for patch@linaro.org; Mon, 08 Mar 2021 08:52:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGHy-0006OG-CF for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:14 -0500 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:38620) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHv-00019X-IK for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:14 -0500 Received: by mail-wr1-x433.google.com with SMTP id d15so11546026wrv.5 for ; Mon, 08 Mar 2021 05:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4iLXz1N0BQOxTQbwmS1B/ilLFWZjmC6OV4ztuE458q0=; b=XZIB+zcEYJgPNwb1xpbuurmaRjSb+XfMqvyDqzixqfD9jpzJSLWcYWax3tfJf8DZ6j bOyxkWCc4N6ggnDmVKu//6MgpzXDrquKQAxe0LPNF366lpTDmGZVlQrPO1+19xSw5cUE x/ictljpO7nUPPnw3U9yWQx0/HzEjMdh38HRdOHN5pTzqQG8XMJoJJgB8dBqoAPoJBQR VJSoOHiSPpslH5aZjQHMnaMkqt9t3OJwwrE1AsRx1DqON+aiMs6VeKdLi4WKGP/yd+KC eiWiQ+TEabLo6wi0oe3nBNFvCnSWCWZp4bD3qDsLjJiwMVNYPRdsIHsaMOFRkkqJy5Hq RRaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4iLXz1N0BQOxTQbwmS1B/ilLFWZjmC6OV4ztuE458q0=; b=DCfj6YT0AF6DTPhZ4YvhVbLuocreHO0lOT/ejh14VahI0yPWkJecoMnJVoCZaRLt/W Bdh4FLfJW8czNIEztsmw1Ie2eyJDJe7/D5ho+oTsLYrAbytNXkMTXKIl4teL3iZB1wPf CKrVbqaycNKnwioqHpRZJ1T0T6BNmIm0Z4XNsA4+P7aQZIH6zFHgw46IGybqFbhhxYIa N4+iYicVp9nM9X5ax4TBbn32qjTWIRW2xJE9YOMGLVdv5eduyp42/fHB8cRFM0TJMXUy Ovz/XxI71M42hYv/nJjksKcCM4qlDnRt8upG2ZcefjDABr5l3Ho67sjCMR/AkE7TTS+t yTvQ== X-Gm-Message-State: AOAM531zTNTaG96HV/fmpt0mc6XrjjTBA1F6t6HBymS1Hl4JP+Rt1dbd nGjtyGSMA/h4gHXHa9+YpGuciA== X-Received: by 2002:adf:e582:: with SMTP id l2mr23269724wrm.207.1615211470313; Mon, 08 Mar 2021 05:51:10 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t8sm20408018wrr.10.2021.03.08.05.51.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2B4661FF90; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 04/18] tests/tcg: Use Hexagon Docker image Date: Mon, 8 Mar 2021 13:50:50 +0000 Message-Id: <20210308135104.24903-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alessandro Di Federico , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Alessandro Di Federico [PMD: Split from 'Add Hexagon Docker image' patch] Signed-off-by: Alessandro Di Federico Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20210228222314.304787-5-f4bug@amsat.org> Message-Id: <20210305092328.31792-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 36b8a73a54..f70fd7435d 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -124,6 +124,10 @@ for target in $target_list; do container_image=fedora-cris-cross container_cross_cc=cris-linux-gnu-gcc ;; + hexagon-*) + container_image=debian-hexagon-cross + container_cross_cc=hexagon-unknown-linux-musl-clang + ;; hppa-*) container_image=debian-hppa-cross container_cross_cc=hppa-linux-gnu-gcc From patchwork Mon Mar 8 13:50:51 2021 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: 395428 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1844279ejz; Mon, 8 Mar 2021 06:05:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoVjFPYIXrecj7zerpSVjHL1TFv5C5UcTcyvYRst6iIQ1FcOLrYxer4cH8VBGbqCZArFTP X-Received: by 2002:a6b:b5c2:: with SMTP id e185mr19072753iof.204.1615212346583; Mon, 08 Mar 2021 06:05:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212346; cv=none; d=google.com; s=arc-20160816; b=P2I75GYZGH1lSddf+LxRQ4F3smPI3MOl6YmZnMQjkMI8ouG0Cs0ubJMBCsdQZOSnyV /sZsAiryKgc7obRpMFWcl8aFDQOeIP1ifR3m+1JTB/CDbwBD/2PyW+kCE81VataClAm3 ZMYvu1+s1Bv6nnzV+2qbnVvHpuqQo70Bw2uK2h+aSW0Elfe9Tkwb3Kb8BJt0hF+Sjf15 eaxiNCpaz7uoRcm/YyVGTX34ZRekMF26oTxCRVBNfgfTeFZULSX/Tqzxka/Nr+Ei+z9I m23y2PLKa4+xGApybgCAxlzkNyYJX4XWjraSaOUJ5hzgTL2zwuIyp5uiKGhoJxF0ZeTM xxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=JbCeKn+rxsjkV4xO+94bdK/cUlFuN3vETpd4EBOMSgc=; b=YgZcRSMV38b5SYmWbwc25ebV/S+iBa6DC6JUrb69fwB2mUG+JCvz40HVPjPeiuYoV6 +R44nMQYlhWnW02x5NKoWeG8xIpjY4epqB9inyNhGpvhMmkhkzAN0qK0WeOECBN13FxG KiO27IDZJRyKNZjdawu/lZXweO/o+D9tVvpocvPLx17iQ8cQKp2ogMKhTjOcDMsmG8pX x1+JBLlM9tygH+3AjcWtAzcq6lS6+ecdNyNdEqujlDxLzzWSZIMKHC6K2CzEo5/oHGj4 W5gNq0bqXRBwPxJYxxrhU6mVmWp49JQcMAAoQAFUD7pnZP57AtTR1l4BaLtIuHj85UQa MpBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=IWzg6KH6; 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=fail (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 g6si10866624jaq.124.2021.03.08.06.05.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:05:46 -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=fail header.i=@linaro.org header.s=google header.b=IWzg6KH6; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGW1-0007QM-P1 for patch@linaro.org; Mon, 08 Mar 2021 09:05:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53482) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGHz-0006Qw-TV for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:15 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:40923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHy-0001BD-9C for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:15 -0500 Received: by mail-wr1-x42e.google.com with SMTP id l11so8135424wrp.7 for ; Mon, 08 Mar 2021 05:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JbCeKn+rxsjkV4xO+94bdK/cUlFuN3vETpd4EBOMSgc=; b=IWzg6KH6RemAd2zL1BQd5UQHbz/aEp+oZKVCSuoDDkVeKYk7BFjYNkDldHfZkOdT40 miKQTzlh5Pkk2vRAXSKEzY6EPDdhOEavBTr4W2hsS2USF/Hw1njZNnXpznw/mJtjpzxt br4ubcltwb7DTxuEuDlnLspnEkeGElNb3VzLSHY/APxaiU34/FxjuGRXlPSIBM8rJQ1j mAoWv0PW7SPNFKAsbRslNzT31SNC004HI/nKmhnU45PUaBzfY2RdoGnWmu0r1gXKFTsf eTeXxFFh0IQO/qpE67EMn/sF1ZssoR8HrUqjRddheUZgMezdcEU2j7MtimbVGD7YTr9n 3n0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JbCeKn+rxsjkV4xO+94bdK/cUlFuN3vETpd4EBOMSgc=; b=e7ttBGyJw+ymw8BBU+3HrgC1POPsTXOky9kq91PU3Yu2EwKS7bL8cFj9rq3dRJMn09 onDLG51i/i3ixXkq0LEd+sXcdtU03qI7bni6OpogPJD/2s6sK4tH/9/Gi16xj8q3KaKJ 4seKN2Ae7/seTI+OolXpYz0IJ/T7lXu4E7gNOFq5LDVwGzDqC9RthX2eeWYl3dVwSjh5 NsFUOWFLVeqcrOwsETnkcGmmFH6VoKbGb80Ghb8UI6WvSD//wTRVswtjo8wi1unvtsLH zvqzSN55vjgKQWq8Q//n+Ud6i8ou6oDgPAnGlQdBjefA8RuKQKSg/K5HJL9yVoYCtqwB AgUw== X-Gm-Message-State: AOAM531Lo83RgWpEf2XiHNzqXtqKUx+YJYTmhw7FATgIPfQMkXJEvBnf CTwHu9oRwZzGeu4H3OprTmWl1w== X-Received: by 2002:adf:a4d0:: with SMTP id h16mr22670436wrb.52.1615211472905; Mon, 08 Mar 2021 05:51:12 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z25sm18351321wmi.23.2021.03.08.05.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 438511FF91; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 05/18] gitlab: add build-user-hexagon test Date: Mon, 8 Mar 2021 13:50:51 +0000 Message-Id: <20210308135104.24903-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We special case this as the container with the cross compiler for the tests takes so long to build it is manually uploaded into the registry. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Wainer dos Santos Moschetta Message-Id: <20210305092328.31792-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8b6d495288..c2c5196b8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -417,6 +417,17 @@ build-user-static: CONFIGURE_ARGS: --disable-tools --disable-system --static MAKE_CHECK_ARGS: check-tcg +# Because the hexagon cross-compiler takes so long to build we don't rely +# on the CI system to build it and hence this job has no dependency +# declared. The image is manually uploaded. +build-user-hexagon: + <<: *native_build_job_definition + variables: + IMAGE: debian-hexagon-cross + TARGETS: hexagon-linux-user + CONFIGURE_ARGS: --disable-tools --disable-docs --enable-debug-tcg + MAKE_CHECK_ARGS: check-tcg + # Only build the softmmu targets we have check-tcg tests for build-some-softmmu: <<: *native_build_job_definition From patchwork Mon Mar 8 13:50:52 2021 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: 395431 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1849684ejz; Mon, 8 Mar 2021 06:11:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwz2tGLSeRC30+EydwaQI+fs4QBILHPBQ5ImOfJWbXz46cHsHvXhbvN0tprN1cL5nnqXSyD X-Received: by 2002:aca:b48a:: with SMTP id d132mr6456363oif.11.1615212691475; Mon, 08 Mar 2021 06:11:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212691; cv=none; d=google.com; s=arc-20160816; b=sFUFofonH9NFfEFzcKlGZ1S8IVXbzvslPQRbjF5G9sp0MAM5uV/QqMSTcuwJxhJvpI m+oFyZQmFO6u/WuYld4K/UV4tmYFIgPkpL8RN04uPb5cC5CTFGzzwfSANnWW5vxJUk0G MQdYOgA/Es+m2QyvVnaQ9U2EVmApBA9WwIPGI1n+xoMQVZu6h4/ec0jKsX2YfKpj1xRS xRnR/ZON6rTu4JHQ7eU/GdhfHsib+Zyesodfd98ZSTf1l5xVOf0j9KYmALY/ytWWTku+ p8o/2ttmKQ04OoGYJHtu4szgUdMHCmUPMWvvdl+j2cdHo74612NlDmmbp9iXIu5A+oIO 5EEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=uTg3Tv32l8Xlt8XwDOEGmwz25MtkKlDZ8otFZdvh7to=; b=vlQiq416247d7BBdnHeqW2G3GlAkpKnuKZxhOK69/96czAz+m61SvFbV57uwhuC5sN HsvOZ7CZtRXXuKgTxbkD3Gt7rVmbWEesiCjVc/27mFuFX/QC/RMTWGnIFrVTgnAEaaha uZIqvw2UbDB1kKVrLZZhcfY7aUUbxzTzEoEa/B35EUCe9ilbkpF/7eXEQtd/YBvYQnF+ c8Ane2t2JS1xMmPIR082brU29YdbUyA/wwpEa6Cq7v7hfmZSGH2UnXcx2VIp1FH+madg 2NDdACjRwQSTsHAs5+cUVvp+IzwklkwbqzUkESF1OXkF3VDZ6/pq7hpugT+RCzvYmN1O rgMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lCcvNqxQ; 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=fail (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 j11si8642178otr.210.2021.03.08.06.11.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:11:31 -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=fail header.i=@linaro.org header.s=google header.b=lCcvNqxQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:44260 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGba-0007bh-Nj for patch@linaro.org; Mon, 08 Mar 2021 09:11:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGI5-0006Xk-E3 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:22 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:42676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI1-0001E8-Qt for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:21 -0500 Received: by mail-wm1-x32a.google.com with SMTP id b2-20020a7bc2420000b029010be1081172so3847642wmj.1 for ; Mon, 08 Mar 2021 05:51:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uTg3Tv32l8Xlt8XwDOEGmwz25MtkKlDZ8otFZdvh7to=; b=lCcvNqxQ1rLU7JVSPiokQwkYmfefY2HnkJLqQVH/NI+rYliIOISsTaMIX+KCA/Xxm9 PSpGRkNvtTce/gdfFp+bCd0LfUhm8zjY7IKtrTxdRPQKkAngxRTy2O+PYWtaAuuHVg5w AVjWH4QUfZ+6ait/jUfYzW8xGevVve0UQNOrzry6b+iHu2a8G3xkjxR70UZwNd3xHX+q ny0Jyh5clLL3S41/nCM9iN6D6ITR4msG82bwua6qccLJCyfXyhqb27xAQHQGq+8A7Ygz CU+GnlQPH4BLajon9rasJB7nEX+qHH52pFLFSaNYNSk3SxNwOJSGT/dWd7/D4YeN5B+q KeGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uTg3Tv32l8Xlt8XwDOEGmwz25MtkKlDZ8otFZdvh7to=; b=Vq1Rr3x++z6Gcd++Fq9XOqa2lz1R9EJ7hOcyJxoD7T/hEpgDv5GQHOKDXzcFF3B65l J9Q8KWCAVJnNunlRH3hsgIHByXMRjn6IXQkkt/BaXHHCdUEpcVJhkbIWbOrTfOqtqO82 RrbNks/VrduCIDWnnlyEQb+qMWyxZJpzZJg/n/Fsa0gZR36xtec+8svoySWZJJq2QX4p zxFyOrxaT4IRO59wl8dOG25Zgtrvxx5G6a3e3lu6e4yxAuFhyb4UlU8Kvzmgc04Nejky 81/ePKZhIfirdpSX2WLsB7fc/T3GdLPEaQeKhmhy0WSp2dD/1XFuVyyJGBj1UDNKMN6N j6Og== X-Gm-Message-State: AOAM531jdHyUrlU+GPRPdhCOmzVANsxL6SjTu9IEaOLQNWiEnEy9VdAf t27uaVTUXc3LoCmKkNv5s6atyA== X-Received: by 2002:a1c:3b02:: with SMTP id i2mr22233019wma.18.1615211476518; Mon, 08 Mar 2021 05:51:16 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a17sm19496485wmj.9.2021.03.08.05.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5BB811FF92; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 06/18] gitlab-ci.yml: Allow custom # of parallel linkers Date: Mon, 8 Mar 2021 13:50:52 +0000 Message-Id: <20210308135104.24903-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Daniel_P_=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Alex_Ben?= =?utf-8?q?n=C3=A9e?= , Daniele Buono Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniele Buono Define a new variable LD_JOBS, that can be used to select the maximum number of linking jobs to be executed in parallel. If the variable is not defined, maintain the default given by make -j Currently, make parallelism at build time is based on the number of cpus available. This doesn't work well with LTO at linking, because with LTO the linker has to load in memory all the intermediate object files for optimization. The end result is that, if the gitlab runner happens to run two linking processes at the same time, the job will fail with an out-of-memory error, This patch leverages the ability to maintain high parallelism at compile time, but limit the number of linkers executed in parallel. Signed-off-by: Daniele Buono Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé Message-Id: <20210304030948.9367-2-dbuono@linux.vnet.ibm.com> Message-Id: <20210305092328.31792-8-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c2c5196b8b..1ea944eb91 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,6 +27,10 @@ include: else ../configure --enable-werror $CONFIGURE_ARGS ; fi || { cat config.log meson-logs/meson-log.txt && exit 1; } + - if test -n "$LD_JOBS"; + then + meson configure . -Dbackend_max_links="$LD_JOBS" ; + fi || exit 1; - make -j"$JOBS" - if test -n "$MAKE_CHECK_ARGS"; then From patchwork Mon Mar 8 13:50:53 2021 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: 395421 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1834887ejz; Mon, 8 Mar 2021 05:54:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfdCgD+18kcIvC7zhkSJzlt6pxRnkVF5jtZTiyYQLQd4tXd94cMi6iiy8p4eqRNja5cZ5I X-Received: by 2002:a05:6e02:214f:: with SMTP id d15mr21125645ilv.180.1615211667364; Mon, 08 Mar 2021 05:54:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211667; cv=none; d=google.com; s=arc-20160816; b=t8Vd4s7AP3m8HLUUNEaVa//w1JqpgycRu6KMCIio1w41xoEFXi7dji9Es0YRWrv9ip xeRxM9oq/UVXx6y+dovxdkPhces5Zgc2a5cFpPqNLA5KFF06nsRF59QtjrxNggTmNFJg dujvkcAmifRHAiJ4bA5AxxYfc7Qq0wk4owAHzYwgf8xnii3UZFwRAWQrpoBRuow5SJts DbBJqpY14Od0PZ1RpvOyVO3GPo4ZBAE5ULkWF0Swr/kgJilzbtO0A5tESF5SQq3Ux5J/ x4XyJBGUQ4/DtTAmsf37o1txyYuFEl/hoGdR9eJztvlgfi7zqwVPIiLKNP4mxziIh6hw SRDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=zvlHmg3Gvm+4PGagR+ylVzZ1n3v00RRhYPBHrbsRAfc=; b=KkgURqo2X8QAGKzFCGd6RQ7B994Z4qcLj00baav0m1BtGdW+r1N80vJ1+g3Vkn1gBo /wmUUkCHz5QBRGccSaGKRa8QuumLSKxH1o3xtjYb8lv2s1Yo3aCgG8oOC2U3wMEk0m6g L6inGkNiLqYQuSGwBsB1UTLCdjKl7y4IT8kgVPeoPEGBgDSVg34QR0xMYgY7r3TnQc5U 0W5dxvVNV1u9vTeWsJug0Z8tkqGYHL02Gu8Maw0UDK4Q1h4lKZ4aRnbaYJrzJ41oL5nz 7Wlnu8iXlnxRYNvFyj6XeDJAqiqRcMu8YSKhbayLfG5aVtOX2z4Frqf9Co1MUvkqZwCl 80Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Y0iGh15r; 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=fail (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 v15si5803711jal.37.2021.03.08.05.54.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 05:54:27 -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=fail header.i=@linaro.org header.s=google header.b=Y0iGh15r; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGL4-0001QH-Kc for patch@linaro.org; Mon, 08 Mar 2021 08:54:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGI3-0006Wr-JH for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:19 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:50338) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI0-0001DT-QS for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:19 -0500 Received: by mail-wm1-x335.google.com with SMTP id i9so6045464wml.0 for ; Mon, 08 Mar 2021 05:51:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zvlHmg3Gvm+4PGagR+ylVzZ1n3v00RRhYPBHrbsRAfc=; b=Y0iGh15raylKqeIyeBOGp1/t6Jm+5pqSmFk058L31oVV83GImE83V2BYP3/TlAG1Ig At+UHfxOsPVfIcpbXA0iq3YthJ2L84FSx5phdsxNvqnGHzZVVsAtY7sqbvcThB2OTpp0 Le7hkUDK/NwXd7yRszxkGEuWIEnvaUSG3gmmSpsqsiM/KCsZSYNoxkY07FL3T4IS7lWI vwSTxMhGkOM6aQiJ2NCLcbvedx717nJeP/uYY0BwtmpNJDYywxK3mfmS+L3K9U7XvTCY NMWZC2kpQg/R/O+KbRpV2WFRnql6roqvVILm4xyHxVUchZVRLFx5m9wztys5xSlgNwvH CgfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zvlHmg3Gvm+4PGagR+ylVzZ1n3v00RRhYPBHrbsRAfc=; b=KmciYwjLzg8MouRDZdeS8Izj7pMAPDVfu0B91ZVIW3V5xhHfewpiwsJ5We1H2ydya4 gRYC7dFGihqQqjdIUouANnLrzCyvhqsb89BBzeRxnOLy6OS/aJ04nI5cdJFMuPfEu2Vw J0rOfJ6wTr2tASUUp01oxpWPxXCXGyYd4PQrfGr4opqxDXtpRA5O6hGobrpy+FIX4ApK Eo+83oxNNOXAfouARMFK6lWFKJSDRY7cjQ7bLrwdCNnVitHXVUnqoqGcOhP3TpzKhcBf eIWuftizlsc++/5KMjk+RQtOn+Wrv0u8KXlJCDgze9ghkphSjRmvuMweX6iLv2wB9sIX w6Lg== X-Gm-Message-State: AOAM533gzQwQ3sHLzIN6fuH0Re8v+LrTxlt6t2z0y7Q06JwMLbe7OAXV ZphpMaBRUsye+Aw89ze0/Tj/6Q== X-Received: by 2002:a05:600c:d1:: with SMTP id u17mr22836010wmm.64.1615211475477; Mon, 08 Mar 2021 05:51:15 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x6sm19597648wmj.32.2021.03.08.05.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 71BBF1FF93; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 07/18] gitlab-ci.yml: Add jobs to test CFI flags Date: Mon, 8 Mar 2021 13:50:53 +0000 Message-Id: <20210308135104.24903-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Wainer dos Santos Moschetta , =?utf-8?q?Philippe?= =?utf-8?q?_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Daniele Buono Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniele Buono QEMU has had options to enable control-flow integrity features for a few months now. Add two sets of build/check/acceptance jobs to ensure the binary produced is working fine. The three sets allow testing of x86_64 binaries for x86_64, s390x, ppc64 and aarch64 targets [AJB: tweak job names to avoid brands] Signed-off-by: Daniele Buono Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210304030948.9367-3-dbuono@linux.vnet.ibm.com> Message-Id: <20210305092328.31792-9-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1ea944eb91..5625265ef8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -494,6 +494,125 @@ clang-user: --extra-cflags=-fsanitize=undefined --extra-cflags=-fno-sanitize-recover=undefined MAKE_CHECK_ARGS: check-unit check-tcg +# Set LD_JOBS=1 because this requires LTO and ld consumes a large amount of memory. +# On gitlab runners, default value sometimes end up calling 2 lds concurrently and +# triggers an Out-Of-Memory error +# +# Since slirp callbacks are used in QEMU Timers, slirp needs to be compiled together +# with QEMU and linked as a static library to avoid false positives in CFI checks. +# This can be accomplished by using -enable-slirp=git, which avoids the use of +# a system-wide version of the library +# +# Split in three sets of build/check/acceptance to limit the execution time of each +# job +build-cfi-aarch64: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: aarch64-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-aarch64: + <<: *native_test_job_definition + needs: + - job: build-cfi-aarch64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-aarch64: + <<: *native_test_job_definition + needs: + - job: build-cfi-aarch64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + +build-cfi-ppc64-s390x: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: ppc64-softmmu s390x-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-ppc64-s390x: + <<: *native_test_job_definition + needs: + - job: build-cfi-ppc64-s390x + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-ppc64-s390x: + <<: *native_test_job_definition + needs: + - job: build-cfi-ppc64-s390x + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + +build-cfi-x86_64: + <<: *native_build_job_definition + needs: + - job: amd64-fedora-container + variables: + LD_JOBS: 1 + AR: llvm-ar + IMAGE: fedora + CONFIGURE_ARGS: --cc=clang --cxx=clang++ --enable-cfi --enable-cfi-debug + --enable-safe-stack --enable-slirp=git + TARGETS: x86_64-softmmu + MAKE_CHECK_ARGS: check-build + artifacts: + expire_in: 2 days + paths: + - build + +check-cfi-x86_64: + <<: *native_test_job_definition + needs: + - job: build-cfi-x86_64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check + +acceptance-cfi-x86_64: + <<: *native_test_job_definition + needs: + - job: build-cfi-x86_64 + artifacts: true + variables: + IMAGE: fedora + MAKE_CHECK_ARGS: check-acceptance + <<: *acceptance_definition + tsan-build: <<: *native_build_job_definition variables: From patchwork Mon Mar 8 13:50:54 2021 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: 395430 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1847518ejz; Mon, 8 Mar 2021 06:09:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6Oj17QCgDSARVe6aAwFTwR/xRKZz9M7vF8kCT5suObJ0aKjbjwotejAlJDHcok70YQFlp X-Received: by 2002:a05:6638:582:: with SMTP id a2mr23207686jar.133.1615212542815; Mon, 08 Mar 2021 06:09:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212542; cv=none; d=google.com; s=arc-20160816; b=D4lCf4LCwnYa1cCQBGw9X2G5WkNY8DW1deF5OVgjE+Qhh6OxLyYiWkt0Csu2714A3L TaZAs0bnsjD2agTi4JsClaZRk/vN8EWHBIxDP3/7Gha5WseJm6c00WVbftuNVK+SjCtt E+dq+8vKidr052/SdcGuWAss1ttlRUvSGGjo9JXZoJ2L1ySFU62nYINeyXaB/PSrnAyU RPNK/PErU/qJAIuFeSOxHId6a1CV2tAETr0l55a6juAHo/IrVy0Q93hzHCfMPsk5OtT0 MolRA+Gsa9Q2y2PpWxPe+mY1MutrJUj4aRUsR8q2byJ1KN/+a9MVpy6Dm5lQa5h6H9Xy soUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=a0BK8ypBSXh0RbNv4uKgBtQr0GJ8Tge8/vqHvw7yHfo=; b=IfogE2L0ZoaD8bbDIDfAk81FM/b9+bT0mpMS2uuhY62K8FtPdotBopSyKjywxWQclM JkNZPcvQfKDQ+bXgrmas5ofl/YbWheq8vsWoi2mzgQbUe3QecNnw+dkVB/jH0LIkXMNd I79XF22YUl1UwZy3j/z6Krn8MJvEmziAR3PKzNdTQHvC0GydrXQiQziQ43cJtA3DwKSS xwikN2ZqIwz2bf4+pPp5qu3/9d8rmlNbLscd9tgXPpifLl2QNBW4WGbXv4QxeLCjSFn0 wkL9kK89zpYqBdZTpKXgfqZVnWiiucqX700UWoLXg6R6hh/XyKoUx1pXggDGlb3AxXSz s6KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="GFqA4j/t"; 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=fail (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 z15si11478552ilu.107.2021.03.08.06.09.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:09:02 -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=fail header.i=@linaro.org header.s=google header.b="GFqA4j/t"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35376 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGZC-0003pl-4c for patch@linaro.org; Mon, 08 Mar 2021 09:09:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53490) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGI0-0006Sn-TW for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:16 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:32932) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGHz-0001Bn-3i for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:16 -0500 Received: by mail-wr1-x42c.google.com with SMTP id 7so11566357wrz.0 for ; Mon, 08 Mar 2021 05:51:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a0BK8ypBSXh0RbNv4uKgBtQr0GJ8Tge8/vqHvw7yHfo=; b=GFqA4j/t8CfChKj1RTNJoT3VZIPIHTHjzEgQDu/VQOutDN8clhNER9g3zt3RL5mXnE 1GvFGNyVQXu1Lm5bFEgtW1DC6HrNdrrHlvN6e3h7XpsGD60KZY/xizrvTGg7kj2cCDKX js3mIt5EXYq7Rh5xMW2jlmz8Zd3ZcHWxsQJtXrFbjDMHYdoRZexuN0rza8UpgkrtjvNO bWPs9yp2b9LHeZowap7OmnmEo8GON1tErU3vMFHGETjLJqNOsWdFI36+rTJkRSVWfUno Q5hRs5j7BDKpmkKhz6il8nl7u2/Z72FxAXVmnRseJQfjpETtXPopoAWbo5aEiFgXuc0S 4WIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a0BK8ypBSXh0RbNv4uKgBtQr0GJ8Tge8/vqHvw7yHfo=; b=CS7H0Q1inJ9Jwn9PfKBrS8XY8VHGAdMiVRM9stdHScpHRyxJRDoJMQ/GX981YMxdpk CSQOjEliiuCcWPPVXoszLf0bBrCewUy8pxR+7kyYNN2nS98cFVHuDKY1lOVqGFf21EcL y+/49Q+cPF3QAUMa2zSWm3M3CeltRwBAq3870BHwhO9VbuiCdHJNA1BYgE4RQtAY8cMt VSCoJHTnkJLTmK5cTingo79gQPa6YV3N/GDkyCB7ORzi5zK5wFs+DJjXAkiQHfWhAD7C /aqWozAFi2E33LpIN4PliiCVicjero8auK6Zg+hrQg3I5jVxkVaKexv/viAYHOn68mui hD8g== X-Gm-Message-State: AOAM5309dwj9/kVigSZMALAy+wcKKzvEaE+kzKrl7ADV8Rfk0CdmPd/J 5bWMupe4ExYA33MtvlMq6F5yXQ== X-Received: by 2002:adf:d205:: with SMTP id j5mr13364798wrh.211.1615211473691; Mon, 08 Mar 2021 05:51:13 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y18sm11344072wrw.39.2021.03.08.05.51.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:08 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 86CB71FF96; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 08/18] tests/docker: Use --arch-only when building Debian cross image Date: Mon, 8 Mar 2021 13:50:54 +0000 Message-Id: <20210308135104.24903-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Christian Ehrhardt , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé When building a Docker image based on debian10.docker on a non-x86 host, we get: [2/4] RUN apt update && DEBIAN_FRONTEND=noninteractive eatmydata apt build-dep -yy qemu Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: builddeps:qemu : Depends: gcc-s390x-linux-gnu but it is not installable Depends: gcc-alpha-linux-gnu but it is not installable E: Unable to correct problems, you have held broken packages. Fix by using the --arch-only option suggested here: https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1866032/comments/1 Suggested-by: Christian Ehrhardt Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Reviewed-by: Alex Bennée Message-Id: <20210223211115.2971565-1-f4bug@amsat.org> Message-Id: <20210305092328.31792-10-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker index 9d42b5a4b8..d034acbd25 100644 --- a/tests/docker/dockerfiles/debian10.docker +++ b/tests/docker/dockerfiles/debian10.docker @@ -32,6 +32,6 @@ RUN apt update && \ psmisc \ python3 \ python3-sphinx \ - $(apt-get -s build-dep qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) + $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) ENV FEATURES docs From patchwork Mon Mar 8 13:50:55 2021 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: 395435 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1862049ejz; Mon, 8 Mar 2021 06:26:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxkSm7N8qNYsWtA5eSx4tX/KroJ7Gl2AV8MuBKiRHsiPPwWxnBBCoWjlCrgSHqlQ612odO X-Received: by 2002:a05:6602:2f0c:: with SMTP id q12mr18437080iow.82.1615213595051; Mon, 08 Mar 2021 06:26:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213595; cv=none; d=google.com; s=arc-20160816; b=vQEOVqgt+Om99tKMrNt5jKwV64IfhRX4jVF2WnjHRa8L9rVe2KmEybf6wtoNlwbIhm FZu9goPdGaYhgFS86vhWJiPN5iay4yUaPrsYvVMaONRujXoTNKoCQO2NVP9+VERTiEX3 OJE7PL956dwj1gvLZxbWk+lKdr0UOv8HZfpf9qA+tD1aG/xKyLXzVZUFACRhDyjWMVIV OPl3eZUCOuPTLM3+2KR5/OrAeSWGmiKO4zX4SO2icjzBE/gRveJgGhF+ZD6HCsX10Swe wrVXdvPkthVtHpX68FPKuwfGcmzxHGFpO2XdM00n6pdiLp8azF93dRI9wkz/947c85c0 onFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=1U/ORcIBWROYJWFUfscqlCNl6s4lUhCxpTPOOlyuiKA=; b=nbM7x2NG8JT6HhiWjIw2zupK2wHoA+blMybKYSL3hqAG2J/s/KquFRJhjcBv4EGa89 fbEE4O8yRgcnoKZhZKSszUMVgxSofQ5Rjld8n2gUWdgTdeTbRQj7Yn/Wuf8jZqzUUXZS UNB+uw9vVq2DshjI5p0p027RwWs6oFeIa8KSx9NkDUyYH2cZcxkK5hA7nsemBG+rJ7Gc L9ASh7j6HIgcNlA7aCq9Kn81ZXr0yXZPuzk351yO30fyV++WO2FuOXrVoLWg+K0Pexvq Z2eEMqDf4L/gfu4aO/aTnk4iK2+mApzh8RkiAW9TmssIUR/hMOvOy2DI0jWy0gtoUhMr ux+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JafBYsOh; 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=fail (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 i6si10326785ilm.83.2021.03.08.06.26.34 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:26:35 -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=fail header.i=@linaro.org header.s=google header.b=JafBYsOh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:50768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGqA-0005jd-DH for patch@linaro.org; Mon, 08 Mar 2021 09:26:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGI9-0006aD-72 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:26 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46409) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI4-0001Fl-V4 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:24 -0500 Received: by mail-wr1-x42d.google.com with SMTP id a18so11485630wrc.13 for ; Mon, 08 Mar 2021 05:51:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1U/ORcIBWROYJWFUfscqlCNl6s4lUhCxpTPOOlyuiKA=; b=JafBYsOhFqw0jQ4ufeJB6QUtsxUz0t2qQa/nHgna7AXyYGSnZvxWqds0Exwsf5E494 NAJ7QP2+g0Gef/X6YjGcd9tTrCkEtfzpBDyxRVaSqs3gdQjS3ow0afwYUaQSh2N2hneS QTHBeaAeHzurZFEMUNNl0boKCidbJNLFtP5JXlQ6rblHuZclIEtNfaMw5mV3wXfd6edX iTtUrkaGWLepfkS3/Q7UfNBS7h5e01ot/YQpAHUpxU2SJDGVTjhGgqAkIESodDwCzLuY eWlC5mwwMwcwf61bnCswumkXlSzeGEa/CM2qlLJvaJevxuTgtcCoXAXXxMBJY1cHsY2O 1uAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1U/ORcIBWROYJWFUfscqlCNl6s4lUhCxpTPOOlyuiKA=; b=NrQPYrjdeOG7Y4p3YWCCJlo0ZmxQuke2iGPXJJ10m0X9wBJcV4+d9PA1LPbpy0oYsY MFIG6lgCop+sH2COavK63P/RbLDHtFQAdNM+N4i6qXrrrYwRpKNhtomL4Nf02yz93r2u WY6TgqH2lRL+xa1CvGpe3wjY3dGh6Tf4WyM4m8immy8W2vNb2FqVJX9ec7SFkm3G/gcZ 5PlAa9vzTi2zdADyR7u0UVFV3mq2j6dj+vXpRU0RSAGbLL6l9AiU9Bos29/vXaYWoJwz RRB7wONz2iTNcs/KEF+4INXbNkBD5gqWcHMN+5VTD6NNQOrtt8dQ2UjyoHs06p5kVBAY es5A== X-Gm-Message-State: AOAM530rcmuFrUYUBCGMJkilWnCtH7oa8kzy5dsYzsQnfgq2jE60fJRT g4W7N6rbTgAmvxgXAr8q+1qYr5W3xSKw1A== X-Received: by 2002:a5d:4d01:: with SMTP id z1mr22881557wrt.133.1615211478976; Mon, 08 Mar 2021 05:51:18 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z1sm19088078wru.95.2021.03.08.05.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9D1101FF98; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 09/18] .editorconfig: update the automatic mode setting for Emacs Date: Mon, 8 Mar 2021 13:50:55 +0000 Message-Id: <20210308135104.24903-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It seems the editor specific keywords have been deprecated in the main editorconfig plugin: https://github.com/editorconfig/editorconfig-emacs#file-type-file_type_ext-file_type_emacs Update the keywords to the suggested one and point users at the extension. Signed-off-by: Alex Bennée Reviewed-by: Marc-André Lureau Message-Id: <20210305144839.6558-1-alex.bennee@linaro.org> -- 2.20.1 diff --git a/.editorconfig b/.editorconfig index 22681d91c6..7303759ed7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -4,6 +4,11 @@ # plugin. # # Check https://editorconfig.org for details. +# +# Emacs: you need https://github.com/10sr/editorconfig-custom-majormode-el +# to automatically enable the appropriate major-mode for your files +# that aren't already caught by your existing config. +# root = true @@ -15,17 +20,17 @@ charset = utf-8 [*.mak] indent_style = tab indent_size = 8 -file_type_emacs = makefile +emacs_mode = makefile [Makefile*] indent_style = tab indent_size = 8 -file_type_emacs = makefile +emacs_mode = makefile [*.{c,h,c.inc,h.inc}] indent_style = space indent_size = 4 -file_type_emacs = c +emacs_mode = c [*.sh] indent_style = space @@ -34,11 +39,11 @@ indent_size = 4 [*.{s,S}] indent_style = tab indent_size = 8 -file_type_emacs = asm +emacs_mode = asm [*.{vert,frag}] -file_type_emacs = glsl +emacs_mode = glsl [*.json] indent_style = space -file_type_emacs = python +emacs_mode = python From patchwork Mon Mar 8 13:50:56 2021 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: 395432 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1851937ejz; Mon, 8 Mar 2021 06:14:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxJ3lqX3tIAWykj0im+M2odms7YurYsY0p7IBuDjYC0EZGgJXIQAE5r7CBMWBTurOe310XW X-Received: by 2002:a05:6808:140e:: with SMTP id w14mr17403876oiv.176.1615212843742; Mon, 08 Mar 2021 06:14:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212843; cv=none; d=google.com; s=arc-20160816; b=P98eHXoNP+XCXNRRSPDOyAs/ZihVwZy5EAHW9JSUbjyce4/D6JP3vtb3aagX6NMfaR SpJtXJZcpwM4jzoK7N+bmOCxahd9WS97/i/5kxHJgYxhIo0E4/ikMdgi5S/22CpDFYvy zKT+tqnxfzQfwdvP906JFGykSsjBytPSUmeSwQgTy8QrZEha65XM7pMhLsbFGXUk3GVD IJoNPatYIlXViKSY4XomVBut8KvO45Egjz/PdPN/Zre4G51K2CmSeU+gNDypGjlIINyf 1ykeD98he2+HTHj5JX0f7snyaVyskC0sYaVIyCByP5tm6xrnKrcBcLHy4qLvu4VkHjvU cHuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=xgE9V9DtnRL9QrGkXlRiVpJ3oUWVlB8PL3fF6X62Kk8=; b=tTvTns2OJHSbcaUgQAFHs+u2JvVN79Sjfp+LHbXygQi333/VylKk5XKQYAvjoBi7ra wpd72pnMW8aJJWOr02J9xq5zhXajT/MChgcN7fdytD0wY4QhQOqyrLvgnwjGGWe+ugn9 vzQKIb5cYBJctqG8ErJiVnyazNouGUVFhubgaT1lLkJLgoWLlvjpF2hN8N0PNSCVtxLp 3dDxs9wSmm8/1Gs4SfHwajdTYzthp8alEgLwhOeBTsaJK5I0FR9YOAyySqzWKXU4hKmp JLSOvN6JESn2j5fDeFDIjRPAjJFG4SL/0LEZhGy+WhXEzDdvUxv5WPVJ9GfLk0NdjIjr 9NZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KCSNuo2u; 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=fail (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 m11si11176125oiw.215.2021.03.08.06.14.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:14:03 -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=fail header.i=@linaro.org header.s=google header.b=KCSNuo2u; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51884 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGe2-0002KU-U5 for patch@linaro.org; Mon, 08 Mar 2021 09:14:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53674) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGIF-0006gI-5t for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:31 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:41843) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI8-0001GW-Vh for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:29 -0500 Received: by mail-wr1-x434.google.com with SMTP id f12so11522736wrx.8 for ; Mon, 08 Mar 2021 05:51:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xgE9V9DtnRL9QrGkXlRiVpJ3oUWVlB8PL3fF6X62Kk8=; b=KCSNuo2uJ8qxnwcAeBLmB9C5qqdddG5V6Sw24wOh+3UZs3EkpEAX/hiu18Dh70nF9R QgotMH1hdSKY4YRV62YdtJ0AnT9OJNvHXPdV5ftLIozKyi/r2eF6OslC1EEZujFHd7Mm 6LnlNelkD2UwNbz8+CqQCfA9K/51zVnTxAD0xOIvRAXvBUgUZGSZBBBnxwqXy3BzktFO //7PGlkpQdbRtMdK7L+06LrjzDik4E18gk4tWnqvTy0ggkJQJFLBiLycq7svnpAQfurV aMmCeRX2fAdx1HME2d/K1vz4CY7+O8B0fWbvzThjaqQ/1o2V0U7dSxtXfQxuPNYUaDpK Lhuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xgE9V9DtnRL9QrGkXlRiVpJ3oUWVlB8PL3fF6X62Kk8=; b=ZE6Urh3Fw6kRh6F7yfU2Dyfx06D8Q+medaWAHu9hGgaY8PwLwyjSSjqlOa5hn6gCBS XReI7nXu+LhS+W2+aprX68+iNNBQS9FW+U5mWZ5sO9IAf+r5FFmciW+EQWAVM+xjsp+g gf0oRd6dvPJBjOG8ZuUJi4Zc6XVDIYjxFb3hEpkmdejkBDd8gcbJa6KOc3TXjTBVdsRV vspFl8BZl/oYqYrhoGfHbAa66bZCwlGEDYee3aOeyX54wh4pLIvMG02VGjIrmIzhk0bY EpQVVTNSc7KqoA0xTJzJNSbn46ffbJGFNZzECvLUBN9o8/XwLQPUDC5MFcHHvxC+dR4t jILA== X-Gm-Message-State: AOAM532SxjWnC7U4hsaPOC98+f3rSDH3sIfZnSN6Y4TIX5S8PBMTkcw9 PUXfjvKoOvA90f+TozmTSBjJYw== X-Received: by 2002:a5d:5411:: with SMTP id g17mr23217260wrv.194.1615211482229; Mon, 08 Mar 2021 05:51:22 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u2sm2337781wmm.5.2021.03.08.05.51.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BAD151FF99; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 10/18] hw/board: promote fdt from ARM VirtMachineState to MachineState Date: Mon, 8 Mar 2021 13:50:56 +0000 Message-Id: <20210308135104.24903-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, "open list:Virt" , =?utf-8?q?Philippe_Mathieu-Da?= =?utf-8?q?ud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The use of FDT's is quite common across our various platforms. To allow the guest loader to tweak it we need to make it available in the generic state. This creates the field and migrates the initial user to use the generic field. Other boards will be updated in later patches. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210303173642.3805-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h index ee9a93101e..921416f918 100644 --- a/include/hw/arm/virt.h +++ b/include/hw/arm/virt.h @@ -153,7 +153,6 @@ struct VirtMachineState { MemMapEntry *memmap; char *pciehb_nodename; const int *irqmap; - void *fdt; int fdt_size; uint32_t clock_phandle; uint32_t gic_phandle; diff --git a/include/hw/boards.h b/include/hw/boards.h index a46dfe5d1a..5fda5fd128 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -258,6 +258,7 @@ struct MachineState { /*< public >*/ + void *fdt; char *dtb; char *dumpdtb; int phandle_start; diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 371147f3ae..c08bf11297 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -218,14 +218,14 @@ static bool cpu_type_valid(const char *cpu) return false; } -static void create_kaslr_seed(VirtMachineState *vms, const char *node) +static void create_kaslr_seed(MachineState *ms, const char *node) { uint64_t seed; if (qemu_guest_getrandom(&seed, sizeof(seed), NULL)) { return; } - qemu_fdt_setprop_u64(vms->fdt, node, "kaslr-seed", seed); + qemu_fdt_setprop_u64(ms->fdt, node, "kaslr-seed", seed); } static void create_fdt(VirtMachineState *vms) @@ -239,7 +239,7 @@ static void create_fdt(VirtMachineState *vms) exit(1); } - vms->fdt = fdt; + ms->fdt = fdt; /* Header */ qemu_fdt_setprop_string(fdt, "/", "compatible", "linux,dummy-virt"); @@ -248,11 +248,11 @@ static void create_fdt(VirtMachineState *vms) /* /chosen must exist for load_dtb to fill in necessary properties later */ qemu_fdt_add_subnode(fdt, "/chosen"); - create_kaslr_seed(vms, "/chosen"); + create_kaslr_seed(ms, "/chosen"); if (vms->secure) { qemu_fdt_add_subnode(fdt, "/secure-chosen"); - create_kaslr_seed(vms, "/secure-chosen"); + create_kaslr_seed(ms, "/secure-chosen"); } /* Clock node, for the benefit of the UART. The kernel device tree @@ -316,6 +316,7 @@ static void fdt_add_timer_nodes(const VirtMachineState *vms) ARMCPU *armcpu; VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI; + MachineState *ms = MACHINE(vms); if (vmc->claim_edge_triggered_timers) { irqflags = GIC_FDT_IRQ_FLAGS_EDGE_LO_HI; @@ -327,19 +328,19 @@ static void fdt_add_timer_nodes(const VirtMachineState *vms) (1 << MACHINE(vms)->smp.cpus) - 1); } - qemu_fdt_add_subnode(vms->fdt, "/timer"); + qemu_fdt_add_subnode(ms->fdt, "/timer"); armcpu = ARM_CPU(qemu_get_cpu(0)); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { const char compat[] = "arm,armv8-timer\0arm,armv7-timer"; - qemu_fdt_setprop(vms->fdt, "/timer", "compatible", + qemu_fdt_setprop(ms->fdt, "/timer", "compatible", compat, sizeof(compat)); } else { - qemu_fdt_setprop_string(vms->fdt, "/timer", "compatible", + qemu_fdt_setprop_string(ms->fdt, "/timer", "compatible", "arm,armv7-timer"); } - qemu_fdt_setprop(vms->fdt, "/timer", "always-on", NULL, 0); - qemu_fdt_setprop_cells(vms->fdt, "/timer", "interrupts", + qemu_fdt_setprop(ms->fdt, "/timer", "always-on", NULL, 0); + qemu_fdt_setprop_cells(ms->fdt, "/timer", "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_S_EL1_IRQ, irqflags, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_NS_EL1_IRQ, irqflags, GIC_FDT_IRQ_TYPE_PPI, ARCH_TIMER_VIRT_IRQ, irqflags, @@ -375,35 +376,35 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) } } - qemu_fdt_add_subnode(vms->fdt, "/cpus"); - qemu_fdt_setprop_cell(vms->fdt, "/cpus", "#address-cells", addr_cells); - qemu_fdt_setprop_cell(vms->fdt, "/cpus", "#size-cells", 0x0); + qemu_fdt_add_subnode(ms->fdt, "/cpus"); + qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#address-cells", addr_cells); + qemu_fdt_setprop_cell(ms->fdt, "/cpus", "#size-cells", 0x0); for (cpu = smp_cpus - 1; cpu >= 0; cpu--) { char *nodename = g_strdup_printf("/cpus/cpu@%d", cpu); ARMCPU *armcpu = ARM_CPU(qemu_get_cpu(cpu)); CPUState *cs = CPU(armcpu); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "cpu"); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "cpu"); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", armcpu->dtb_compatible); if (vms->psci_conduit != QEMU_PSCI_CONDUIT_DISABLED && smp_cpus > 1) { - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_setprop_string(ms->fdt, nodename, "enable-method", "psci"); } if (addr_cells == 2) { - qemu_fdt_setprop_u64(vms->fdt, nodename, "reg", + qemu_fdt_setprop_u64(ms->fdt, nodename, "reg", armcpu->mp_affinity); } else { - qemu_fdt_setprop_cell(vms->fdt, nodename, "reg", + qemu_fdt_setprop_cell(ms->fdt, nodename, "reg", armcpu->mp_affinity); } if (ms->possible_cpus->cpus[cs->cpu_index].props.has_node_id) { - qemu_fdt_setprop_cell(vms->fdt, nodename, "numa-node-id", + qemu_fdt_setprop_cell(ms->fdt, nodename, "numa-node-id", ms->possible_cpus->cpus[cs->cpu_index].props.node_id); } @@ -414,71 +415,74 @@ static void fdt_add_cpu_nodes(const VirtMachineState *vms) static void fdt_add_its_gic_node(VirtMachineState *vms) { char *nodename; + MachineState *ms = MACHINE(vms); - vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->msi_phandle = qemu_fdt_alloc_phandle(ms->fdt); nodename = g_strdup_printf("/intc/its@%" PRIx64, vms->memmap[VIRT_GIC_ITS].base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v3-its"); - qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop(ms->fdt, nodename, "msi-controller", NULL, 0); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_ITS].base, 2, vms->memmap[VIRT_GIC_ITS].size); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->msi_phandle); g_free(nodename); } static void fdt_add_v2m_gic_node(VirtMachineState *vms) { + MachineState *ms = MACHINE(vms); char *nodename; nodename = g_strdup_printf("/intc/v2m@%" PRIx64, vms->memmap[VIRT_GIC_V2M].base); - vms->msi_phandle = qemu_fdt_alloc_phandle(vms->fdt); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + vms->msi_phandle = qemu_fdt_alloc_phandle(ms->fdt); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v2m-frame"); - qemu_fdt_setprop(vms->fdt, nodename, "msi-controller", NULL, 0); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop(ms->fdt, nodename, "msi-controller", NULL, 0); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_V2M].base, 2, vms->memmap[VIRT_GIC_V2M].size); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->msi_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->msi_phandle); g_free(nodename); } static void fdt_add_gic_node(VirtMachineState *vms) { + MachineState *ms = MACHINE(vms); char *nodename; - vms->gic_phandle = qemu_fdt_alloc_phandle(vms->fdt); - qemu_fdt_setprop_cell(vms->fdt, "/", "interrupt-parent", vms->gic_phandle); + vms->gic_phandle = qemu_fdt_alloc_phandle(ms->fdt); + qemu_fdt_setprop_cell(ms->fdt, "/", "interrupt-parent", vms->gic_phandle); nodename = g_strdup_printf("/intc@%" PRIx64, vms->memmap[VIRT_GIC_DIST].base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 3); - qemu_fdt_setprop(vms->fdt, nodename, "interrupt-controller", NULL, 0); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#address-cells", 0x2); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#size-cells", 0x2); - qemu_fdt_setprop(vms->fdt, nodename, "ranges", NULL, 0); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#interrupt-cells", 3); + qemu_fdt_setprop(ms->fdt, nodename, "interrupt-controller", NULL, 0); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#address-cells", 0x2); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#size-cells", 0x2); + qemu_fdt_setprop(ms->fdt, nodename, "ranges", NULL, 0); if (vms->gic_version == VIRT_GIC_VERSION_3) { int nb_redist_regions = virt_gicv3_redist_region_count(vms); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,gic-v3"); - qemu_fdt_setprop_cell(vms->fdt, nodename, + qemu_fdt_setprop_cell(ms->fdt, nodename, "#redistributor-regions", nb_redist_regions); if (nb_redist_regions == 1) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_REDIST].base, 2, vms->memmap[VIRT_GIC_REDIST].size); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_REDIST].base, @@ -488,22 +492,22 @@ static void fdt_add_gic_node(VirtMachineState *vms) } if (vms->virt) { - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } else { /* 'cortex-a15-gic' means 'GIC v2' */ - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "arm,cortex-a15-gic"); if (!vms->virt) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_CPU].base, 2, vms->memmap[VIRT_GIC_CPU].size); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, vms->memmap[VIRT_GIC_DIST].base, 2, vms->memmap[VIRT_GIC_DIST].size, 2, vms->memmap[VIRT_GIC_CPU].base, @@ -512,13 +516,13 @@ static void fdt_add_gic_node(VirtMachineState *vms) 2, vms->memmap[VIRT_GIC_HYP].size, 2, vms->memmap[VIRT_GIC_VCPU].base, 2, vms->memmap[VIRT_GIC_VCPU].size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_PPI, ARCH_GIC_MAINT_IRQ, GIC_FDT_IRQ_FLAGS_LEVEL_HI); } } - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", vms->gic_phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", vms->gic_phandle); g_free(nodename); } @@ -526,6 +530,7 @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) { ARMCPU *armcpu = ARM_CPU(first_cpu); uint32_t irqflags = GIC_FDT_IRQ_FLAGS_LEVEL_HI; + MachineState *ms = MACHINE(vms); if (!arm_feature(&armcpu->env, ARM_FEATURE_PMU)) { assert(!object_property_get_bool(OBJECT(armcpu), "pmu", NULL)); @@ -538,12 +543,12 @@ static void fdt_add_pmu_nodes(const VirtMachineState *vms) (1 << MACHINE(vms)->smp.cpus) - 1); } - qemu_fdt_add_subnode(vms->fdt, "/pmu"); + qemu_fdt_add_subnode(ms->fdt, "/pmu"); if (arm_feature(&armcpu->env, ARM_FEATURE_V8)) { const char compat[] = "arm,armv8-pmuv3"; - qemu_fdt_setprop(vms->fdt, "/pmu", "compatible", + qemu_fdt_setprop(ms->fdt, "/pmu", "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_cells(vms->fdt, "/pmu", "interrupts", + qemu_fdt_setprop_cells(ms->fdt, "/pmu", "interrupts", GIC_FDT_IRQ_TYPE_PPI, VIRTUAL_PMU_IRQ, irqflags); } } @@ -749,6 +754,7 @@ static void create_uart(const VirtMachineState *vms, int uart, const char clocknames[] = "uartclk\0apb_pclk"; DeviceState *dev = qdev_new(TYPE_PL011); SysBusDevice *s = SYS_BUS_DEVICE(dev); + MachineState *ms = MACHINE(vms); qdev_prop_set_chr(dev, "chardev", chr); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -757,28 +763,28 @@ static void create_uart(const VirtMachineState *vms, int uart, sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); nodename = g_strdup_printf("/pl011@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); + qemu_fdt_add_subnode(ms->fdt, nodename); /* Note that we can't use setprop_string because of the embedded NUL */ - qemu_fdt_setprop(vms->fdt, nodename, "compatible", + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cells(vms->fdt, nodename, "clocks", + qemu_fdt_setprop_cells(ms->fdt, nodename, "clocks", vms->clock_phandle, vms->clock_phandle); - qemu_fdt_setprop(vms->fdt, nodename, "clock-names", + qemu_fdt_setprop(ms->fdt, nodename, "clock-names", clocknames, sizeof(clocknames)); if (uart == VIRT_UART) { - qemu_fdt_setprop_string(vms->fdt, "/chosen", "stdout-path", nodename); + qemu_fdt_setprop_string(ms->fdt, "/chosen", "stdout-path", nodename); } else { /* Mark as not usable by the normal world */ - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); - qemu_fdt_setprop_string(vms->fdt, "/secure-chosen", "stdout-path", + qemu_fdt_setprop_string(ms->fdt, "/secure-chosen", "stdout-path", nodename); } @@ -792,19 +798,20 @@ static void create_rtc(const VirtMachineState *vms) hwaddr size = vms->memmap[VIRT_RTC].size; int irq = vms->irqmap[VIRT_RTC]; const char compat[] = "arm,pl031\0arm,primecell"; + MachineState *ms = MACHINE(vms); sysbus_create_simple("pl031", base, qdev_get_gpio_in(vms->gic, irq)); nodename = g_strdup_printf("/pl031@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cell(vms->fdt, nodename, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, nodename, "clock-names", "apb_pclk"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, nodename, "clock-names", "apb_pclk"); g_free(nodename); } @@ -821,32 +828,30 @@ static void virt_powerdown_req(Notifier *n, void *opaque) } } -static void create_gpio_keys(const VirtMachineState *vms, - DeviceState *pl061_dev, +static void create_gpio_keys(char *fdt, DeviceState *pl061_dev, uint32_t phandle) { gpio_key_dev = sysbus_create_simple("gpio-key", -1, qdev_get_gpio_in(pl061_dev, 3)); - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys", "compatible", "gpio-keys"); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#size-cells", 0); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys", "#address-cells", 1); + qemu_fdt_add_subnode(fdt, "/gpio-keys"); + qemu_fdt_setprop_string(fdt, "/gpio-keys", "compatible", "gpio-keys"); + qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#size-cells", 0); + qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#address-cells", 1); - qemu_fdt_add_subnode(vms->fdt, "/gpio-keys/poweroff"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-keys/poweroff", + qemu_fdt_add_subnode(fdt, "/gpio-keys/poweroff"); + qemu_fdt_setprop_string(fdt, "/gpio-keys/poweroff", "label", "GPIO Key Poweroff"); - qemu_fdt_setprop_cell(vms->fdt, "/gpio-keys/poweroff", "linux,code", + qemu_fdt_setprop_cell(fdt, "/gpio-keys/poweroff", "linux,code", KEY_POWER); - qemu_fdt_setprop_cells(vms->fdt, "/gpio-keys/poweroff", + qemu_fdt_setprop_cells(fdt, "/gpio-keys/poweroff", "gpios", phandle, 3, 0); } #define SECURE_GPIO_POWEROFF 0 #define SECURE_GPIO_RESET 1 -static void create_secure_gpio_pwr(const VirtMachineState *vms, - DeviceState *pl061_dev, +static void create_secure_gpio_pwr(char *fdt, DeviceState *pl061_dev, uint32_t phandle) { DeviceState *gpio_pwr_dev; @@ -860,22 +865,22 @@ static void create_secure_gpio_pwr(const VirtMachineState *vms, qdev_connect_gpio_out(pl061_dev, SECURE_GPIO_POWEROFF, qdev_get_gpio_in_named(gpio_pwr_dev, "shutdown", 0)); - qemu_fdt_add_subnode(vms->fdt, "/gpio-poweroff"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-poweroff", "compatible", + qemu_fdt_add_subnode(fdt, "/gpio-poweroff"); + qemu_fdt_setprop_string(fdt, "/gpio-poweroff", "compatible", "gpio-poweroff"); - qemu_fdt_setprop_cells(vms->fdt, "/gpio-poweroff", + qemu_fdt_setprop_cells(fdt, "/gpio-poweroff", "gpios", phandle, SECURE_GPIO_POWEROFF, 0); - qemu_fdt_setprop_string(vms->fdt, "/gpio-poweroff", "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-poweroff", "secure-status", + qemu_fdt_setprop_string(fdt, "/gpio-poweroff", "status", "disabled"); + qemu_fdt_setprop_string(fdt, "/gpio-poweroff", "secure-status", "okay"); - qemu_fdt_add_subnode(vms->fdt, "/gpio-restart"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-restart", "compatible", + qemu_fdt_add_subnode(fdt, "/gpio-restart"); + qemu_fdt_setprop_string(fdt, "/gpio-restart", "compatible", "gpio-restart"); - qemu_fdt_setprop_cells(vms->fdt, "/gpio-restart", + qemu_fdt_setprop_cells(fdt, "/gpio-restart", "gpios", phandle, SECURE_GPIO_RESET, 0); - qemu_fdt_setprop_string(vms->fdt, "/gpio-restart", "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, "/gpio-restart", "secure-status", + qemu_fdt_setprop_string(fdt, "/gpio-restart", "status", "disabled"); + qemu_fdt_setprop_string(fdt, "/gpio-restart", "secure-status", "okay"); } @@ -889,6 +894,7 @@ static void create_gpio_devices(const VirtMachineState *vms, int gpio, int irq = vms->irqmap[gpio]; const char compat[] = "arm,pl061\0arm,primecell"; SysBusDevice *s; + MachineState *ms = MACHINE(vms); pl061_dev = qdev_new("pl061"); s = SYS_BUS_DEVICE(pl061_dev); @@ -896,33 +902,33 @@ static void create_gpio_devices(const VirtMachineState *vms, int gpio, memory_region_add_subregion(mem, base, sysbus_mmio_get_region(s, 0)); sysbus_connect_irq(s, 0, qdev_get_gpio_in(vms->gic, irq)); - uint32_t phandle = qemu_fdt_alloc_phandle(vms->fdt); + uint32_t phandle = qemu_fdt_alloc_phandle(ms->fdt); nodename = g_strdup_printf("/pl061@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#gpio-cells", 2); - qemu_fdt_setprop(vms->fdt, nodename, "gpio-controller", NULL, 0); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop(ms->fdt, nodename, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#gpio-cells", 2); + qemu_fdt_setprop(ms->fdt, nodename, "gpio-controller", NULL, 0); + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_LEVEL_HI); - qemu_fdt_setprop_cell(vms->fdt, nodename, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, nodename, "clock-names", "apb_pclk"); - qemu_fdt_setprop_cell(vms->fdt, nodename, "phandle", phandle); + qemu_fdt_setprop_cell(ms->fdt, nodename, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, nodename, "clock-names", "apb_pclk"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "phandle", phandle); if (gpio != VIRT_GPIO) { /* Mark as not usable by the normal world */ - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); } g_free(nodename); /* Child gpio devices */ if (gpio == VIRT_GPIO) { - create_gpio_keys(vms, pl061_dev, phandle); + create_gpio_keys(ms->fdt, pl061_dev, phandle); } else { - create_secure_gpio_pwr(vms, pl061_dev, phandle); + create_secure_gpio_pwr(ms->fdt, pl061_dev, phandle); } } @@ -930,6 +936,7 @@ static void create_virtio_devices(const VirtMachineState *vms) { int i; hwaddr size = vms->memmap[VIRT_MMIO].size; + MachineState *ms = MACHINE(vms); /* We create the transports in forwards order. Since qbus_realize() * prepends (not appends) new child buses, the incrementing loop below will @@ -979,15 +986,15 @@ static void create_virtio_devices(const VirtMachineState *vms) hwaddr base = vms->memmap[VIRT_MMIO].base + i * size; nodename = g_strdup_printf("/virtio_mmio@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "virtio,mmio"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); g_free(nodename); } } @@ -1068,17 +1075,18 @@ static void virt_flash_fdt(VirtMachineState *vms, { hwaddr flashsize = vms->memmap[VIRT_FLASH].size / 2; hwaddr flashbase = vms->memmap[VIRT_FLASH].base; + MachineState *ms = MACHINE(vms); char *nodename; if (sysmem == secure_sysmem) { /* Report both flash devices as a single node in the DT */ nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase, 2, flashsize, 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); g_free(nodename); } else { /* @@ -1086,21 +1094,21 @@ static void virt_flash_fdt(VirtMachineState *vms, * only visible to the secure world. */ nodename = g_strdup_printf("/secflash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); g_free(nodename); nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(vms->fdt, nodename, "bank-width", 4); + qemu_fdt_setprop_cell(ms->fdt, nodename, "bank-width", 4); g_free(nodename); } } @@ -1167,17 +1175,17 @@ static FWCfgState *create_fw_cfg(const VirtMachineState *vms, AddressSpace *as) fw_cfg_add_i16(fw_cfg, FW_CFG_NB_CPUS, (uint16_t)ms->smp.cpus); nodename = g_strdup_printf("/fw-cfg@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "qemu,fw-cfg-mmio"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); g_free(nodename); return fw_cfg; } -static void create_pcie_irq_map(const VirtMachineState *vms, +static void create_pcie_irq_map(const MachineState *ms, uint32_t gic_phandle, int first_irq, const char *nodename) { @@ -1205,10 +1213,10 @@ static void create_pcie_irq_map(const VirtMachineState *vms, } } - qemu_fdt_setprop(vms->fdt, nodename, "interrupt-map", + qemu_fdt_setprop(ms->fdt, nodename, "interrupt-map", full_irq_map, sizeof(full_irq_map)); - qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupt-map-mask", + qemu_fdt_setprop_cells(ms->fdt, nodename, "interrupt-map-mask", cpu_to_be16(PCI_DEVFN(3, 0)), /* Slot 3 */ 0, 0, 0x7 /* PCI irq */); @@ -1225,6 +1233,7 @@ static void create_smmu(const VirtMachineState *vms, hwaddr size = vms->memmap[VIRT_SMMU].size; const char irq_names[] = "eventq\0priq\0cmdq-sync\0gerror"; DeviceState *dev; + MachineState *ms = MACHINE(vms); if (vms->iommu != VIRT_IOMMU_SMMUV3 || !vms->iommu_phandle) { return; @@ -1242,26 +1251,26 @@ static void create_smmu(const VirtMachineState *vms, } node = g_strdup_printf("/smmuv3@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, node); - qemu_fdt_setprop(vms->fdt, node, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, node, "reg", 2, base, 2, size); + qemu_fdt_add_subnode(ms->fdt, node); + qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg", 2, base, 2, size); - qemu_fdt_setprop_cells(vms->fdt, node, "interrupts", + qemu_fdt_setprop_cells(ms->fdt, node, "interrupts", GIC_FDT_IRQ_TYPE_SPI, irq , GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 1, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 2, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI, GIC_FDT_IRQ_TYPE_SPI, irq + 3, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI); - qemu_fdt_setprop(vms->fdt, node, "interrupt-names", irq_names, + qemu_fdt_setprop(ms->fdt, node, "interrupt-names", irq_names, sizeof(irq_names)); - qemu_fdt_setprop_cell(vms->fdt, node, "clocks", vms->clock_phandle); - qemu_fdt_setprop_string(vms->fdt, node, "clock-names", "apb_pclk"); - qemu_fdt_setprop(vms->fdt, node, "dma-coherent", NULL, 0); + qemu_fdt_setprop_cell(ms->fdt, node, "clocks", vms->clock_phandle); + qemu_fdt_setprop_string(ms->fdt, node, "clock-names", "apb_pclk"); + qemu_fdt_setprop(ms->fdt, node, "dma-coherent", NULL, 0); - qemu_fdt_setprop_cell(vms->fdt, node, "#iommu-cells", 1); + qemu_fdt_setprop_cell(ms->fdt, node, "#iommu-cells", 1); - qemu_fdt_setprop_cell(vms->fdt, node, "phandle", vms->iommu_phandle); + qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle); g_free(node); } @@ -1269,22 +1278,23 @@ static void create_virtio_iommu_dt_bindings(VirtMachineState *vms) { const char compat[] = "virtio,pci-iommu"; uint16_t bdf = vms->virtio_iommu_bdf; + MachineState *ms = MACHINE(vms); char *node; - vms->iommu_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->iommu_phandle = qemu_fdt_alloc_phandle(ms->fdt); node = g_strdup_printf("%s/virtio_iommu@%d", vms->pciehb_nodename, bdf); - qemu_fdt_add_subnode(vms->fdt, node); - qemu_fdt_setprop(vms->fdt, node, "compatible", compat, sizeof(compat)); - qemu_fdt_setprop_sized_cells(vms->fdt, node, "reg", + qemu_fdt_add_subnode(ms->fdt, node); + qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat)); + qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg", 1, bdf << 8, 1, 0, 1, 0, 1, 0, 1, 0); - qemu_fdt_setprop_cell(vms->fdt, node, "#iommu-cells", 1); - qemu_fdt_setprop_cell(vms->fdt, node, "phandle", vms->iommu_phandle); + qemu_fdt_setprop_cell(ms->fdt, node, "#iommu-cells", 1); + qemu_fdt_setprop_cell(ms->fdt, node, "phandle", vms->iommu_phandle); g_free(node); - qemu_fdt_setprop_cells(vms->fdt, vms->pciehb_nodename, "iommu-map", + qemu_fdt_setprop_cells(ms->fdt, vms->pciehb_nodename, "iommu-map", 0x0, vms->iommu_phandle, 0x0, bdf, bdf + 1, vms->iommu_phandle, bdf + 1, 0xffff - bdf); } @@ -1309,6 +1319,7 @@ static void create_pcie(VirtMachineState *vms) char *nodename; int i, ecam_id; PCIHostState *pci; + MachineState *ms = MACHINE(vms); dev = qdev_new(TYPE_GPEX_HOST); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); @@ -1369,27 +1380,27 @@ static void create_pcie(VirtMachineState *vms) } nodename = vms->pciehb_nodename = g_strdup_printf("/pcie@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "pci-host-ecam-generic"); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "pci"); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#address-cells", 3); - qemu_fdt_setprop_cell(vms->fdt, nodename, "#size-cells", 2); - qemu_fdt_setprop_cell(vms->fdt, nodename, "linux,pci-domain", 0); - qemu_fdt_setprop_cells(vms->fdt, nodename, "bus-range", 0, + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "pci"); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#address-cells", 3); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#size-cells", 2); + qemu_fdt_setprop_cell(ms->fdt, nodename, "linux,pci-domain", 0); + qemu_fdt_setprop_cells(ms->fdt, nodename, "bus-range", 0, nr_pcie_buses - 1); - qemu_fdt_setprop(vms->fdt, nodename, "dma-coherent", NULL, 0); + qemu_fdt_setprop(ms->fdt, nodename, "dma-coherent", NULL, 0); if (vms->msi_phandle) { - qemu_fdt_setprop_cells(vms->fdt, nodename, "msi-parent", + qemu_fdt_setprop_cells(ms->fdt, nodename, "msi-parent", vms->msi_phandle); } - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base_ecam, 2, size_ecam); if (vms->highmem) { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", 1, FDT_PCI_RANGE_IOPORT, 2, 0, 2, base_pio, 2, size_pio, 1, FDT_PCI_RANGE_MMIO, 2, base_mmio, @@ -1398,23 +1409,23 @@ static void create_pcie(VirtMachineState *vms) 2, base_mmio_high, 2, base_mmio_high, 2, size_mmio_high); } else { - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "ranges", + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "ranges", 1, FDT_PCI_RANGE_IOPORT, 2, 0, 2, base_pio, 2, size_pio, 1, FDT_PCI_RANGE_MMIO, 2, base_mmio, 2, base_mmio, 2, size_mmio); } - qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 1); - create_pcie_irq_map(vms, vms->gic_phandle, irq, nodename); + qemu_fdt_setprop_cell(ms->fdt, nodename, "#interrupt-cells", 1); + create_pcie_irq_map(ms, vms->gic_phandle, irq, nodename); if (vms->iommu) { - vms->iommu_phandle = qemu_fdt_alloc_phandle(vms->fdt); + vms->iommu_phandle = qemu_fdt_alloc_phandle(ms->fdt); switch (vms->iommu) { case VIRT_IOMMU_SMMUV3: create_smmu(vms, vms->bus); - qemu_fdt_setprop_cells(vms->fdt, nodename, "iommu-map", + qemu_fdt_setprop_cells(ms->fdt, nodename, "iommu-map", 0x0, vms->iommu_phandle, 0x0, 0x10000); break; default: @@ -1466,17 +1477,18 @@ static void create_secure_ram(VirtMachineState *vms, char *nodename; hwaddr base = vms->memmap[VIRT_SECURE_MEM].base; hwaddr size = vms->memmap[VIRT_SECURE_MEM].size; + MachineState *ms = MACHINE(vms); memory_region_init_ram(secram, NULL, "virt.secure-ram", size, &error_fatal); memory_region_add_subregion(secure_sysmem, base, secram); nodename = g_strdup_printf("/secram@%" PRIx64, base); - qemu_fdt_add_subnode(vms->fdt, nodename); - qemu_fdt_setprop_string(vms->fdt, nodename, "device_type", "memory"); - qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg", 2, base, 2, size); - qemu_fdt_setprop_string(vms->fdt, nodename, "status", "disabled"); - qemu_fdt_setprop_string(vms->fdt, nodename, "secure-status", "okay"); + qemu_fdt_add_subnode(ms->fdt, nodename); + qemu_fdt_setprop_string(ms->fdt, nodename, "device_type", "memory"); + qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", 2, base, 2, size); + qemu_fdt_setprop_string(ms->fdt, nodename, "status", "disabled"); + qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); if (secure_tag_sysmem) { create_tag_ram(secure_tag_sysmem, base, size, "mach-virt.secure-tag"); @@ -1489,9 +1501,11 @@ static void *machvirt_dtb(const struct arm_boot_info *binfo, int *fdt_size) { const VirtMachineState *board = container_of(binfo, VirtMachineState, bootinfo); + MachineState *ms = MACHINE(board); + *fdt_size = board->fdt_size; - return board->fdt; + return ms->fdt; } static void virt_build_smbios(VirtMachineState *vms) @@ -1539,7 +1553,7 @@ void virt_machine_done(Notifier *notifier, void *data) * while qemu takes charge of the qom stuff. */ if (info->dtb_filename == NULL) { - platform_bus_add_all_fdt_nodes(vms->fdt, "/intc", + platform_bus_add_all_fdt_nodes(ms->fdt, "/intc", vms->memmap[VIRT_PLATFORM_BUS].base, vms->memmap[VIRT_PLATFORM_BUS].size, vms->irqmap[VIRT_PLATFORM_BUS]); From patchwork Mon Mar 8 13:50:57 2021 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: 395423 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1836300ejz; Mon, 8 Mar 2021 05:56:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzP2Fw67+uYFFTpeL5eWRw6mdL25e3j4pAa+11JohlEbinD4FLeKDpmqGPGR9g9J/GOonfh X-Received: by 2002:a5d:9d56:: with SMTP id k22mr18785789iok.145.1615211800914; Mon, 08 Mar 2021 05:56:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211800; cv=none; d=google.com; s=arc-20160816; b=OToHGnKxn11tKfASSb0Rwr5z7v4PVUt7nYnavQORgMdlEtifEBwwXhe4HA3lZ0w0pl 6dSaswebi61v3F00LFRJhOOUiouYTTfR1XZF0LgyYiFoyy/CC+TpyuPDC8W3BvT6td5Z aKIueks2a2JBC9qQTfNifJguCpTOPeUUru6VHtYE7NgpJWfUkffj3L0p7UjWMzTPezNx vSf23Q6Vz5AEc4OUBdrM/kyj09ifgnhHUJ6C9VJ3W8EA1dTlmLQpYgN1g34Il95wYvo9 ax3rI3MT7MNDd2COWnafneVr3qXESfZ2hS4vgDF3wcUzHdFOPeGLYpQHZk5ED7JmEeyI x33A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=5ViVWtZ3No3EwiuLvapp181B6jvA1Zl37fC61JHK5PU=; b=FtO5ILtsIB0ZAFfF9EFPgjraEhvCsVPYE2K9laZY/af2JDR/2rqKvY0MmBp007Z3eK VukCoRZQVyTcYOAvm83frsvz/8q5AnL/Ut1qNYLNpqVskqd7j95BFadJBxkFObZaj9Er CHzIIM6aourtimqDh54Hrs5CL46uYSxkiVKTxSsqjQX6m5IUdXQmnmLcuKGyXEy+oAUq julu9rd+f1RbrPplKP61GE/o8qIE/TNFqy+Ch73tISpcWuz8WqHfF7XEJ7EIo0uYs0ps rE4QC5owlkQSUWo8m1xOPlbj4Vsojj2zlmbXEpqGUMrPb2VzNdPeY5bbHt7xZvl0v25y EVOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TJORMraY; 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=fail (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 y23si10874591jai.77.2021.03.08.05.56.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 05:56:40 -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=fail header.i=@linaro.org header.s=google header.b=TJORMraY; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:54404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGNE-000554-4C for patch@linaro.org; Mon, 08 Mar 2021 08:56:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53624) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGIA-0006bi-Nw for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:26 -0500 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:54110) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI5-0001Fw-5J for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:26 -0500 Received: by mail-wm1-x32b.google.com with SMTP id e23so6093509wmh.3 for ; Mon, 08 Mar 2021 05:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5ViVWtZ3No3EwiuLvapp181B6jvA1Zl37fC61JHK5PU=; b=TJORMraYWiV20w8qDxwleyRNVTbR0TIBeI94ghcyq8tlh79y0d4L7nwo/m3niOq40b hXKK7FhGpIhdRB7lomBs4Ho0ubfN2MUOCAzkymSbZPcQGPIGys3hUeX0WYRxKqdQVPqg pSqeLwW4OdDG5xCwE0ysa7Z9A0GiCxYS34KpTShrJeWuR0XmLxDqhw1PxK8F2fvBRbbw agelcXI94uSbi+BTHoZFP4O8sPC5BhN5AYPXjTpVq3U/cmpCzObRBDuQ6FEfSMBrjGSJ B15zYfWEIPmPQYFaq8XJKAdE9OAmANB/1RwOyIgx4UQ8mT0rR2ZVgOdc/Fbv31eF3mio g0GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5ViVWtZ3No3EwiuLvapp181B6jvA1Zl37fC61JHK5PU=; b=erSIm/WI2Dfeq4eKY2B1XCoWTBZdcpTaz7ObdsSbNAzb3wh53ot9S+qJu/2poOooFT pmWDknUr+EecIVMSbCzDvWkCIuYmn5ZSm3jgTGBrz2oRx9Y7JnZYOxNTwrJyblUzIxRy zzZ2uliCELM4J1f8d80D4rxfR90UPpCy1o1IF/+QALf8rwG53xbJCjbIRpD1f4II8xNw rEjXCK5+V1a2/IhQCA+s15smKX8JaMTN7jMcbxqtny/Ri/ozSQq1sULV8x33l96hHD+O OZt8um09Zv9sXmB9UV8CR4z7ZIRPehgUrPMPPP3A8+QApXi18SnRE0AOOG56OnMLWtge 1eOQ== X-Gm-Message-State: AOAM533y21QtRUofJCG+ETELzwPg5PvPZEE0d/OJ2e3M4+F9pZfKy9Pd hYXe/ruI+BXuIYkyFtsYeG1jCA== X-Received: by 2002:a1c:195:: with SMTP id 143mr21688670wmb.81.1615211479644; Mon, 08 Mar 2021 05:51:19 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k4sm23496842wrd.9.2021.03.08.05.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D4BE61FF9A; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 11/18] hw/riscv: migrate fdt field to generic MachineState Date: Mon, 8 Mar 2021 13:50:57 +0000 Message-Id: <20210308135104.24903-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "open list:RISC-V TCG CPUs" , Sagar Karandikar , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Alistair Francis , Bastian Koppelmann , Palmer Dabbelt , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a mechanical change to make the fdt available through MachineState. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210303173642.3805-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/hw/riscv/virt.h b/include/hw/riscv/virt.h index 84b7a3848f..632da52018 100644 --- a/include/hw/riscv/virt.h +++ b/include/hw/riscv/virt.h @@ -41,7 +41,6 @@ struct RISCVVirtState { DeviceState *plic[VIRT_SOCKETS_MAX]; PFlashCFI01 *flash[2]; - void *fdt; int fdt_size; }; diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 4f0c2fbca0..0b39101a5e 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -195,14 +195,14 @@ static void create_fdt(RISCVVirtState *s, const MemMapEntry *memmap, hwaddr flashbase = virt_memmap[VIRT_FLASH].base; if (mc->dtb) { - fdt = s->fdt = load_device_tree(mc->dtb, &s->fdt_size); + fdt = mc->fdt = load_device_tree(mc->dtb, &s->fdt_size); if (!fdt) { error_report("load_device_tree() failed"); exit(1); } goto update_bootargs; } else { - fdt = s->fdt = create_device_tree(&s->fdt_size); + fdt = mc->fdt = create_device_tree(&s->fdt_size); if (!fdt) { error_report("create_device_tree() failed"); exit(1); @@ -444,12 +444,12 @@ static void create_fdt(RISCVVirtState *s, const MemMapEntry *memmap, g_free(name); name = g_strdup_printf("/soc/flash@%" PRIx64, flashbase); - qemu_fdt_add_subnode(s->fdt, name); - qemu_fdt_setprop_string(s->fdt, name, "compatible", "cfi-flash"); - qemu_fdt_setprop_sized_cells(s->fdt, name, "reg", + qemu_fdt_add_subnode(mc->fdt, name); + qemu_fdt_setprop_string(mc->fdt, name, "compatible", "cfi-flash"); + qemu_fdt_setprop_sized_cells(mc->fdt, name, "reg", 2, flashbase, 2, flashsize, 2, flashbase + flashsize, 2, flashsize); - qemu_fdt_setprop_cell(s->fdt, name, "bank-width", 4); + qemu_fdt_setprop_cell(mc->fdt, name, "bank-width", 4); g_free(name); update_bootargs: @@ -667,9 +667,9 @@ static void virt_machine_init(MachineState *machine) hwaddr end = riscv_load_initrd(machine->initrd_filename, machine->ram_size, kernel_entry, &start); - qemu_fdt_setprop_cell(s->fdt, "/chosen", + qemu_fdt_setprop_cell(machine->fdt, "/chosen", "linux,initrd-start", start); - qemu_fdt_setprop_cell(s->fdt, "/chosen", "linux,initrd-end", + qemu_fdt_setprop_cell(machine->fdt, "/chosen", "linux,initrd-end", end); } } else { @@ -690,12 +690,12 @@ static void virt_machine_init(MachineState *machine) /* Compute the fdt load address in dram */ fdt_load_addr = riscv_load_fdt(memmap[VIRT_DRAM].base, - machine->ram_size, s->fdt); + machine->ram_size, machine->fdt); /* load the reset vector */ riscv_setup_rom_reset_vec(machine, &s->soc[0], start_addr, virt_memmap[VIRT_MROM].base, virt_memmap[VIRT_MROM].size, kernel_entry, - fdt_load_addr, s->fdt); + fdt_load_addr, machine->fdt); /* SiFive Test MMIO device */ sifive_test_create(memmap[VIRT_TEST].base); From patchwork Mon Mar 8 13:50:58 2021 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: 395425 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1840570ejz; Mon, 8 Mar 2021 06:02:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJytOCT5xrwnXX/KkoynC0Z+hm/I+SPVM1vu6XaPezZDZNVdx17eqZYoqVQC6MLydWWA25TN X-Received: by 2002:a05:6e02:12c7:: with SMTP id i7mr20368580ilm.66.1615212120637; Mon, 08 Mar 2021 06:02:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212120; cv=none; d=google.com; s=arc-20160816; b=SPBU5gUa96NzST5J7Sr19K0NTnUBqLNFGTfr01OZhNLlpUujcddpBqCVaE4q2Anqdz ix+NN/V3FtPMgQ5gCGPQ+FGilv1y+vflbn/qaf3XHEup9O+AEnJMQuGo+MXsyWQVHSqD 3VmQWulUO8KZ4YwikLDh0QVIWt7DsSO3RMTx2+4u1dHQIN8bjQX47OapizMv/qU7n6FY 4pD3ftAcco5RNXIH6GCJ3ZxwCKu0bq/nfmn7kTL6PjTJnNvT7vAJyz968FWxDqAdaSJV 4nG6xS0we2TDx7TdXo79zPEYmMgoqi7nMMLfjOTIMc39rtfCukyiyQwojx85jc5IpGmH mZEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=qdRJRL3+3BE/JH14YpiGu383dDrAlP7VpAQihL8OqOE=; b=k5CAW9IEL4TG/Upz8VWmOpxrL9NJC66igKzcuNUYqeX7Xwty2+qD6M5sLIyDS01BVS WIc2IOEwvNF6lGDIrfP/TX36Q7TPlpKK+NrVTf7tLQv1d+bZHFZ6Y3iHkBDx58HZSrK9 x58KNlwPA/XEHnO3XTqC5EXCBaoalEbOI0HEXXyVCJIrOKUe3n/tboC3lYd5SQKjPHt1 St4nd50QBa2MKv0M24i+Z9qVQRoYsT4rFuSvCgQeZCPdvlNCKpbanftiuF21Q97xRsMT nZ7fuujzoQv5sbiUXvN0tc44BsPQhL4QJwgt+kxg4Au3brY5tkIW13zqnesHwJk318cc 3Ccg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jG+Ocu+p; 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=fail (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 g14si11685472ilf.0.2021.03.08.06.02.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:02:00 -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=fail header.i=@linaro.org header.s=google header.b=jG+Ocu+p; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGSN-0003W9-QG for patch@linaro.org; Mon, 08 Mar 2021 09:01:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55156) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO5-0007H6-0w for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:46896) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO3-0003uw-4m for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:32 -0500 Received: by mail-wm1-x333.google.com with SMTP id d139-20020a1c1d910000b029010b895cb6f2so3859256wmd.5 for ; Mon, 08 Mar 2021 05:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qdRJRL3+3BE/JH14YpiGu383dDrAlP7VpAQihL8OqOE=; b=jG+Ocu+pvktYB4XAD03JfHf645e595o4p1nYB4PsmZGQpJ9zsozfOikfy7Qeieq4Y+ Q4xnlskGVQ4g4Ift9Ak7uDfXqbSX9nfmLXoo3d3EDTrGH8j9DZ072zYQbE3RFoyU0ljA lricDeaQwrkgeERXq79kZ04+qS9OGmtT9cDbcTDiZw7pob0KNB47vqUhT4YLP+QGoeHu j4bi58loqf1POne+kc4MVoIm+xiEwwEeG3o+FCtS3nvs6BC0XPTaInSRhI00fSRlgNc9 Fvn6He6ipHGSZYAXGHWLlo8tFrpQThyNUGaSUmGUGgcGRyOTm9+ZjGiNoEMALQYjd/Ya 6MCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qdRJRL3+3BE/JH14YpiGu383dDrAlP7VpAQihL8OqOE=; b=r/XAThMLxJuGK1Pb1Fx+p+1D38fC9ojjAum2wVV/5kYplVvwHsJBLDSNlnNqxWR0vo spzeaTRI5Ui3tI4AbsrkYmEVN+DNlvX+KsC6Qyh+fCiH9MEkGdAVtg3HBigJkZ0RGvPY 3hZu12gkSYy/LEpaZoMJXVySXn4mFb8I2YwBdI8EaKA9BPCJeyDHzgmTVf1ca9oJs9to MwMwuBX5jxCZIPVhftLWhMO8DnQ9c5RlLBYyS0ivbtHOgXqhbtQuoBrk23a1j54Q3OgO CrzHgcl1Is7W5vWcYtf6eBzfD306C3rfbf+d6GPPXWvGKbr8QdXQPvB4MOdgzYEl5sIE Lq7A== X-Gm-Message-State: AOAM531zgY3IfXRTlfmWaM+mneVcOpxrWOZBWgdFI8Luag2tfeGRw38p cLAgmpX1hY3o9vuBjiuqC5CWMg== X-Received: by 2002:a1c:7714:: with SMTP id t20mr21838401wmi.107.1615211849713; Mon, 08 Mar 2021 05:57:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k11sm19444723wmj.1.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ED12A1FF9B; Mon, 8 Mar 2021 13:51:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 12/18] device_tree: add qemu_fdt_setprop_string_array helper Date: Mon, 8 Mar 2021 13:50:58 +0000 Message-Id: <20210308135104.24903-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" A string array in device tree is simply a series of \0 terminated strings next to each other. As libfdt doesn't support that directly we need to build it ourselves. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20210303173642.3805-4-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h index 982c89345f..8a2fe55622 100644 --- a/include/sysemu/device_tree.h +++ b/include/sysemu/device_tree.h @@ -70,6 +70,23 @@ int qemu_fdt_setprop_u64(void *fdt, const char *node_path, const char *property, uint64_t val); int qemu_fdt_setprop_string(void *fdt, const char *node_path, const char *property, const char *string); + +/** + * qemu_fdt_setprop_string_array: set a string array property + * + * @fdt: pointer to the dt blob + * @name: node name + * @prop: property array + * @array: pointer to an array of string pointers + * @len: length of array + * + * assigns a string array to a property. This function converts and + * array of strings to a sequential string with \0 separators before + * setting the property. + */ +int qemu_fdt_setprop_string_array(void *fdt, const char *node_path, + const char *prop, char **array, int len); + int qemu_fdt_setprop_phandle(void *fdt, const char *node_path, const char *property, const char *target_node_path); diff --git a/softmmu/device_tree.c b/softmmu/device_tree.c index b9a3ddc518..2691c58cf6 100644 --- a/softmmu/device_tree.c +++ b/softmmu/device_tree.c @@ -21,6 +21,7 @@ #include "qemu/error-report.h" #include "qemu/option.h" #include "qemu/bswap.h" +#include "qemu/cutils.h" #include "sysemu/device_tree.h" #include "sysemu/sysemu.h" #include "hw/loader.h" @@ -397,6 +398,31 @@ int qemu_fdt_setprop_string(void *fdt, const char *node_path, return r; } +/* + * libfdt doesn't allow us to add string arrays directly but they are + * test a series of null terminated strings with a length. We build + * the string up here so we can calculate the final length. + */ +int qemu_fdt_setprop_string_array(void *fdt, const char *node_path, + const char *prop, char **array, int len) +{ + int ret, i, total_len = 0; + char *str, *p; + for (i = 0; i < len; i++) { + total_len += strlen(array[i]) + 1; + } + p = str = g_malloc0(total_len); + for (i = 0; i < len; i++) { + int len = strlen(array[i]) + 1; + pstrcpy(p, len, array[i]); + p += len; + } + + ret = qemu_fdt_setprop(fdt, node_path, prop, str, total_len); + g_free(str); + return ret; +} + const void *qemu_fdt_getprop(void *fdt, const char *node_path, const char *property, int *lenp, Error **errp) { From patchwork Mon Mar 8 13:50:59 2021 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: 395422 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1834891ejz; Mon, 8 Mar 2021 05:54:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyormJ/R/fZtwhfwXS0rdY0OxX3j7fYD8KxoEAs09TrnyVfUbGDFGnTxsPxa1BV2l+o2IV4 X-Received: by 2002:a02:cbb2:: with SMTP id v18mr23397039jap.4.1615211668403; Mon, 08 Mar 2021 05:54:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615211668; cv=none; d=google.com; s=arc-20160816; b=mg+Wjg5vuDJ1LIf3qCyTnR+ZbDdNxnj5h+w7MvKfAqmvCGG1GyNrXLF0CbZo3uxk56 Qhf2NZ27BTI4xalrgCg2F8pRkc281MpdUDEep77TJlbzHrd3lx+7/eeMVqtttev2hq14 DmQxy9Lh7kWE4fQb722mvWirScNyGOc1k9+AoAmCv2nNVkU2U3E/Zeh7rNdD6N3nHTcS E9YcNBzqrMIgMaTc3EiD6aiDyUQB0HdIzXregAV4bQd4bWBENJ9G7x2YQa1jw4aflQ/b fytQAz9SJkHcigNKXr7yFpoughQt/Yf1gtqqZ+Surx0+/tZV2gF3jc+sQWS8l+E2uzl2 gS9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=CR8IvXeaMjbmmjcnKO1Mvlz93ruIxw19ZKqjVnLky5o=; b=jhUmkJcg5Rp2KY6aooJj6fNf3z+vZNMOvVYzmusdJ0oZPyL8aqQRNDvmgkE5mJu5j6 DcKnSdSDqGthHf5MMoxb4efn5xJghe+tjaSXrMEhFIyYknRAJ4k1y8nsDgoJxsZYyJoe 2yl/Oy4CAkHtwGSjE3bGbLwV5fISqHBMfgYCVQaxOKJZa2DVd+0rBGA8pRRpxsq7jMp9 zRJsmfWEcEcRmaJydl+zrH9X5WURYWicQSKIQaqvopHJAKEC/I6lJQyzty83i5JYyukI o7vpKPSwnbJ21b/K+CdCUrwidECqv12wNQ2k6OWXATp2dsCmstfDcEyGSK66D3xGk4Jf xziw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jK2neIyW; 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=fail (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 j7si10581559iow.89.2021.03.08.05.54.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 05:54:28 -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=fail header.i=@linaro.org header.s=google header.b=jK2neIyW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGL5-0001U2-L9 for patch@linaro.org; Mon, 08 Mar 2021 08:54:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGIF-0006gd-A5 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:31 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:34412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI8-0001HL-V4 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:30 -0500 Received: by mail-wm1-x330.google.com with SMTP id n11-20020a05600c4f8bb029010e5cf86347so2804834wmq.1 for ; Mon, 08 Mar 2021 05:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CR8IvXeaMjbmmjcnKO1Mvlz93ruIxw19ZKqjVnLky5o=; b=jK2neIyWgFy2LPGx2vjqtlVSAARf+4xUWbg9jw+ow97HgO925lNWZQ0T9slt1XxdXz FUooTOcQaZLrWhXLmQ9vNI2auH6o9lkmwzRTSEwBECZVUcXtvhWy4GmN/YfQ3sRMqa4X OsOY1QPunc6/TfDMwM9L89KGpX5KjqGMOyfUlWtTzCXZ8w2aD2Kb9Zap/LXEjx0c89pb At0/2ax/8Zce+La7DlBoNP1Mj1e2naM3lZ5lMJQv7L6O6+GJwsv7dLeOylnIbSvRHP/w +raHedh2gl1vf3t1M/+cEhQ4r4AQnOP1xzAogymmwkMqzuI+vJB+FTcbGD1SZofEgFtj cpXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CR8IvXeaMjbmmjcnKO1Mvlz93ruIxw19ZKqjVnLky5o=; b=O5CXMun3CaSbD18To/Cl9wEMwGRGVXGymlJpY5/XgmIqKA8XYLl09VBBBiEYFZfBF1 FsQUnmEFg3ZZvHtqVfm6/gD5PAcqdTSbC6JLlmKTbUy6jkTXwBVw2vhCXwSFxk2BVSyv vB3lJzZf+GT1KefSRPlCZ/J2E1imItK3K6n3vya6VE9qTiiCfdQW/g3inDIGJkY3ycFl jgPqN98fVlViC6+iHkNGSQcI31QBRV4f0fqw6PriJIHSW1XIEH3bCcgfcFKh6ODb4jDF UOhWxRekqSCI+UY1H5wlp9t7zoU8KEMp0aE2HugFNCVHP7TlLsL24T2Z9/++9EQFqicJ TAng== X-Gm-Message-State: AOAM530Ud4zg0nNR3YnnaCuBVYYscaLO0n/Iimj67trLQr3NuD8ke8v7 ngTGclBuv4k67TiNgdMMjdYFFA== X-Received: by 2002:a7b:ce19:: with SMTP id m25mr22489739wmc.74.1615211483426; Mon, 08 Mar 2021 05:51:23 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x6sm19597897wmj.32.2021.03.08.05.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 148AE1FF9C; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 13/18] hw/core: implement a guest-loader to support static hypervisor guests Date: Mon, 8 Mar 2021 13:50:59 +0000 Message-Id: <20210308135104.24903-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Ma?= =?utf-8?q?thieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hypervisors, especially type-1 ones, need the firmware/bootcode to put their initial guest somewhere in memory and pass the information to it via platform data. The guest-loader is modelled after the generic loader for exactly this sort of purpose: $QEMU $ARGS -kernel ~/xen.git/xen/xen \ -append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \ -device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \ -device guest-loader,addr=0x47000000,initrd=rootfs.cpio Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20210303173642.3805-5-alex.bennee@linaro.org> -- 2.20.1 Tested-by: Christian Borntraeger Tested-by: Christian Borntraeger diff --git a/hw/core/guest-loader.h b/hw/core/guest-loader.h new file mode 100644 index 0000000000..07f4b4884b --- /dev/null +++ b/hw/core/guest-loader.h @@ -0,0 +1,34 @@ +/* + * Guest Loader + * + * Copyright (C) 2020 Linaro + * Written by Alex Bennée + * (based on the generic-loader by Li Guang ) + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef GUEST_LOADER_H +#define GUEST_LOADER_H + +#include "hw/qdev-core.h" +#include "qom/object.h" + +struct GuestLoaderState { + /* */ + DeviceState parent_obj; + + /* */ + uint64_t addr; + char *kernel; + char *args; + char *initrd; +}; + +#define TYPE_GUEST_LOADER "guest-loader" +OBJECT_DECLARE_SIMPLE_TYPE(GuestLoaderState, GUEST_LOADER) + +#endif diff --git a/hw/core/guest-loader.c b/hw/core/guest-loader.c new file mode 100644 index 0000000000..bde44e27b4 --- /dev/null +++ b/hw/core/guest-loader.c @@ -0,0 +1,145 @@ +/* + * Guest Loader + * + * Copyright (C) 2020 Linaro + * Written by Alex Bennée + * (based on the generic-loader by Li Guang ) + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +/* + * Much like the generic-loader this is treated as a special device + * inside QEMU. However unlike the generic-loader this device is used + * to load guest images for hypervisors. As part of that process the + * hypervisor needs to have platform information passed to it by the + * lower levels of the stack (e.g. firmware/bootloader). If you boot + * the hypervisor directly you use the guest-loader to load the Dom0 + * or equivalent guest images in the right place in the same way a + * boot loader would. + * + * This is only relevant for full system emulation. + */ + +#include "qemu/osdep.h" +#include "hw/core/cpu.h" +#include "hw/sysbus.h" +#include "sysemu/dma.h" +#include "hw/loader.h" +#include "hw/qdev-properties.h" +#include "qapi/error.h" +#include "qemu/module.h" +#include "guest-loader.h" +#include "sysemu/device_tree.h" +#include "hw/boards.h" + +/* + * Insert some FDT nodes for the loaded blob. + */ +static void loader_insert_platform_data(GuestLoaderState *s, int size, + Error **errp) +{ + MachineState *machine = MACHINE(qdev_get_machine()); + void *fdt = machine->fdt; + g_autofree char *node = g_strdup_printf("/chosen/module@0x%08" PRIx64, + s->addr); + uint64_t reg_attr[2] = {cpu_to_be64(s->addr), cpu_to_be64(size)}; + + if (!fdt) { + error_setg(errp, "Cannot modify FDT fields if the machine has none"); + return; + } + + qemu_fdt_add_subnode(fdt, node); + qemu_fdt_setprop(fdt, node, "reg", ®_attr, sizeof(reg_attr)); + + if (s->kernel) { + const char *compat[2] = { "multiboot,module", "multiboot,kernel" }; + if (qemu_fdt_setprop_string_array(fdt, node, "compatible", + (char **) &compat, + ARRAY_SIZE(compat)) < 0) { + error_setg(errp, "couldn't set %s/compatible", node); + return; + } + if (s->args) { + if (qemu_fdt_setprop_string(fdt, node, "bootargs", s->args) < 0) { + error_setg(errp, "couldn't set %s/bootargs", node); + } + } + } else if (s->initrd) { + const char *compat[2] = { "multiboot,module", "multiboot,ramdisk" }; + if (qemu_fdt_setprop_string_array(fdt, node, "compatible", + (char **) &compat, + ARRAY_SIZE(compat)) < 0) { + error_setg(errp, "couldn't set %s/compatible", node); + return; + } + } +} + +static void guest_loader_realize(DeviceState *dev, Error **errp) +{ + GuestLoaderState *s = GUEST_LOADER(dev); + char *file = s->kernel ? s->kernel : s->initrd; + int size = 0; + + /* Perform some error checking on the user's options */ + if (s->kernel && s->initrd) { + error_setg(errp, "Cannot specify a kernel and initrd in same stanza"); + return; + } else if (!s->kernel && !s->initrd) { + error_setg(errp, "Need to specify a kernel or initrd image"); + return; + } else if (!s->addr) { + error_setg(errp, "Need to specify the address of guest blob"); + return; + } else if (s->args && !s->kernel) { + error_setg(errp, "Boot args only relevant to kernel blobs"); + } + + /* Default to the maximum size being the machine's ram size */ + size = load_image_targphys_as(file, s->addr, current_machine->ram_size, + NULL); + if (size < 0) { + error_setg(errp, "Cannot load specified image %s", file); + return; + } + + /* Now the image is loaded we need to update the platform data */ + loader_insert_platform_data(s, size, errp); +} + +static Property guest_loader_props[] = { + DEFINE_PROP_UINT64("addr", GuestLoaderState, addr, 0), + DEFINE_PROP_STRING("kernel", GuestLoaderState, kernel), + DEFINE_PROP_STRING("bootargs", GuestLoaderState, args), + DEFINE_PROP_STRING("initrd", GuestLoaderState, initrd), + DEFINE_PROP_END_OF_LIST(), +}; + +static void guest_loader_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->realize = guest_loader_realize; + device_class_set_props(dc, guest_loader_props); + dc->desc = "Guest Loader"; + set_bit(DEVICE_CATEGORY_MISC, dc->categories); +} + +static TypeInfo guest_loader_info = { + .name = TYPE_GUEST_LOADER, + .parent = TYPE_DEVICE, + .instance_size = sizeof(GuestLoaderState), + .class_init = guest_loader_class_init, +}; + +static void guest_loader_register_type(void) +{ + type_register_static(&guest_loader_info); +} + +type_init(guest_loader_register_type) diff --git a/MAINTAINERS b/MAINTAINERS index ab3118429b..0134cad491 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2018,6 +2018,11 @@ F: hw/core/generic-loader.c F: include/hw/core/generic-loader.h F: docs/generic-loader.txt +Guest Loader +M: Alex Bennée +S: Maintained +F: hw/core/guest-loader.c + Intel Hexadecimal Object File Loader M: Su Hang S: Maintained diff --git a/hw/core/meson.build b/hw/core/meson.build index 032576f571..9cd72edf51 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -37,6 +37,8 @@ softmmu_ss.add(files( 'clock-vmstate.c', )) +softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c')) + specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( 'machine-qmp-cmds.c', 'numa.c', From patchwork Mon Mar 8 13:51:00 2021 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: 395436 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1863670ejz; Mon, 8 Mar 2021 06:28:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJy8oMUWF8G0IPTl3LSUYe/G+qp8mM1KBvjXHpxLCwYSVUkM05jpXCGl4YBjZrZCX4tLGlQ5 X-Received: by 2002:aca:3007:: with SMTP id w7mr8115928oiw.154.1615213734584; Mon, 08 Mar 2021 06:28:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213734; cv=none; d=google.com; s=arc-20160816; b=SwWIVJD43glT6LKcEvnoVFWLFrxbG00xLM9qU7hKTm6nudy1cFCNWEc+qn6qsg/ZS5 fN4EmCmXK1IcWuB5UOwVfe6OJZrLRQEiQd1G2k/rzVKK8vhOZL+fTXB1B3xV8CM4A6Zv XvPTLyyUwSKH6UKLPPvMchZvpIQ3D04Aj0cyYTz9B624U/qJh4A0IShDgu7mGe92wG9g pnDJ7bM9aBwyvZFytG1bQRvPp77Np0/76ebrFb+Q/mhVbi86MWEnb7j14dcLILVPdXf3 t5XVyqnILP+D23EWjwame5FHcT228OkDnD6tfGhI84tZl9I0bVtlCF0KDxntpQbpCT9E Njqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=V68ytxbgmqYFZZPfjTqpoCec0EKffKJjoQ6qIdSpZexXCciFkYATaBKez+TvLdoJUB XThl9N9oRkgoDnzQwWovYbSuKYxviaIqCdnG+/Dv0sEAmRId2VUAbiW2rfWTHp/D+OI7 eETx8Z4CgcUWjGpa9VfGk6CsREM27QKe1wD/thWSy7OqfDcoSXrsA5wjuUsYdvUpegEf IJnFXK6nZq6IsWGmyYlVuNFvlgmft7LkExKGxpj2JJQPcwY/NswscKpi6AiRQkRSF849 76Tj0tbsCOkoIwHsctWUk9ETsAoeWKL9iyy7X3e68u0f7X6AvG+b1WA05qzhyc9srj0r 2P8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xxV1L6f+; 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=fail (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 n9si10021318oib.233.2021.03.08.06.28.54 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:28:54 -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=fail header.i=@linaro.org header.s=google header.b=xxV1L6f+; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:55198 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGsP-0007d0-Nc for patch@linaro.org; Mon, 08 Mar 2021 09:28:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGIC-0006dc-09 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:28 -0500 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:45244) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGI7-0001GO-20 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:51:27 -0500 Received: by mail-wr1-x435.google.com with SMTP id e10so11493570wro.12 for ; Mon, 08 Mar 2021 05:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=xxV1L6f+Lv5a9baKHjvRRjoxFbkvWdJ6X/5/uFwUSVU+mEJCEbAg/fonTfH0vtfowZ a9TU6aRzgOTB9SoODZpWFv3V79ButsPcZXyF12tpVYthOcHWzjXo8PW0kYjItJgywB2o 7ruldkd8gU5Ex+YgtCOsWPsxZXnA85vEdcHgOxb8G+9MoP2fkCVod1XSstrtmptbQXwB E+DJueGlps0mqDUMrqrdaaeYA+oi7TZNx7wOcEnGBl3dzE6bO6uN2TILxR7dVzGZ2iZ3 5z5xlruA0bXq23fjdmOcrJr+QrICpbRYn+SMSBN3lBG9HahRnsAzbTiiqcj4uidLcGV3 xJzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=e2s2r/+NfeVKeys87ugSZc5DKzDIrEIIPjFuy/f+xuQ=; b=DOjnB0bIWyfnVUV/yCeSp5cQUPFyY+bbESZc3yvlQVgqC9M1xRDIUrnxM/KxlvG752 QWgzejIX+53JvnLdLoFqNnZq/2ZCrnL7idECt88OQpvdJ8w/9A+5qO/zx6pD+yOQTJX3 HqwYuAPSgkUmAxMZhMD69i/0v8584uRI3zA9v8i3osAPyZX8XXhw5lgnldmLcIixTzV8 lVcmxknYSn2LFDzKahAJctto10bjK9ii3kWI5B1KePowimkCyHGF3SMYjsVQYx9KbjXE ZtJbvPWHkjX5qLitvLvnSomASM+ivCypeFlRV61B9gj4pBBSXvdVjiG8NaGbuImgcwSg kP7A== X-Gm-Message-State: AOAM533tT+UaTkRUaQXHPHDL3+3jNgSBEhzwWJEhw+75mw3bb65FPA6P EQw0c/Gilg3xKojKDouCfhQeew== X-Received: by 2002:adf:ec83:: with SMTP id z3mr22730679wrn.59.1615211481357; Mon, 08 Mar 2021 05:51:21 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s9sm4589633wmh.31.2021.03.08.05.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:51:17 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 339591FF9D; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 14/18] docs: move generic-loader documentation into the main manual Date: Mon, 8 Mar 2021 13:51:00 +0000 Message-Id: <20210308135104.24903-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x435.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We might as well surface this useful information in the manual so users can find it easily. It is a fairly simple conversion to rst with the only textual fixes being QemuOps to QemuOpts. Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20210303173642.3805-6-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/generic-loader.txt b/docs/generic-loader.txt deleted file mode 100644 index a9603a2af7..0000000000 --- a/docs/generic-loader.txt +++ /dev/null @@ -1,92 +0,0 @@ -Copyright (c) 2016 Xilinx Inc. - -This work is licensed under the terms of the GNU GPL, version 2 or later. See -the COPYING file in the top-level directory. - - -The 'loader' device allows the user to load multiple images or values into -QEMU at startup. - -Loading Data into Memory Values -------------------------------- -The loader device allows memory values to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,data=,data-len= - [,data-be=][,cpu-num=] - - - The address to store the data in. - - The value to be written to the address. The maximum size of - the data is 8 bytes. - - The length of the data in bytes. This argument must be - included if the data argument is. - - Set to true if the data to be stored on the guest should be - written as big endian data. The default is to write little - endian data. - - The number of the CPU's address space where the data should - be loaded. If not specified the address space of the first - CPU is used. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of loading value 0x8000000e to address 0xfd1a0104 is: - -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 - -Setting a CPU's Program Counter -------------------------------- -The loader device allows the CPU's PC to be set from the command line. This -can be done by following the syntax below: - - -device loader,addr=,cpu-num= - - - The value to use as the CPU's PC. - - The number of the CPU whose PC should be set to the - specified value. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of setting CPU 0's PC to 0x8000 is: - -device loader,addr=0x8000,cpu-num=0 - -Loading Files -------------- -The loader device also allows files to be loaded into memory. It can load ELF, -U-Boot, and Intel HEX executable formats as well as raw images. The syntax is -shown below: - - -device loader,file=[,addr=][,cpu-num=][,force-raw=] - - - A file to be loaded into memory - - The memory address where the file should be loaded. This is - required for raw images and ignored for non-raw files. - - This specifies the CPU that should be used. This is an - optional argument and will cause the CPU's PC to be set to - the memory address where the raw file is loaded or the entry - point specified in the executable format header. This option - should only be used for the boot image. - This will also cause the image to be written to the specified - CPU's address space. If not specified, the default is CPU 0. - - Setting force-raw=on forces the file to be treated as a raw - image. This can be used to load supported executable formats - as if they were raw. - -All values are parsed using the standard QemuOps parsing. This allows the user -to specify any values in any format supported. By default the values -will be parsed as decimal. To use hex values the user should prefix the number -with a '0x'. - -An example of loading an ELF file which CPU0 will boot is shown below: - -device loader,file=./images/boot.elf,cpu-num=0 - -Restrictions and ToDos ----------------------- - - At the moment it is just assumed that if you specify a cpu-num then you - want to set the PC as well. This might not always be the case. In future - the internal state 'set_pc' (which exists in the generic loader now) should - be exposed to the user so that they can choose if the PC is set or not. diff --git a/docs/system/generic-loader.rst b/docs/system/generic-loader.rst new file mode 100644 index 0000000000..6bf8a4eb48 --- /dev/null +++ b/docs/system/generic-loader.rst @@ -0,0 +1,117 @@ +.. + Copyright (c) 2016, Xilinx Inc. + +This work is licensed under the terms of the GNU GPL, version 2 or later. See +the COPYING file in the top-level directory. + +Generic Loader +-------------- + +The 'loader' device allows the user to load multiple images or values into +QEMU at startup. + +Loading Data into Memory Values +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +The loader device allows memory values to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,data=,data-len= \ + [,data-be=][,cpu-num=] + +```` + The address to store the data in. + +```` + The value to be written to the address. The maximum size of the data + is 8 bytes. + +```` + The length of the data in bytes. This argument must be included if + the data argument is. + +```` + Set to true if the data to be stored on the guest should be written + as big endian data. The default is to write little endian data. + +```` + The number of the CPU's address space where the data should be + loaded. If not specified the address space of the first CPU is used. + +All values are parsed using the standard QemuOps parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of loading value 0x8000000e to address 0xfd1a0104 is:: + + -device loader,addr=0xfd1a0104,data=0x8000000e,data-len=4 + +Setting a CPU's Program Counter +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The loader device allows the CPU's PC to be set from the command line. This +can be done by following the syntax below:: + + -device loader,addr=,cpu-num= + +```` + The value to use as the CPU's PC. + +```` + The number of the CPU whose PC should be set to the specified value. + +All values are parsed using the standard QemuOpts parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of setting CPU 0's PC to 0x8000 is:: + + -device loader,addr=0x8000,cpu-num=0 + +Loading Files +^^^^^^^^^^^^^ + +The loader device also allows files to be loaded into memory. It can load ELF, +U-Boot, and Intel HEX executable formats as well as raw images. The syntax is +shown below: + + -device loader,file=[,addr=][,cpu-num=][,force-raw=] + +```` + A file to be loaded into memory + +```` + The memory address where the file should be loaded. This is required + for raw images and ignored for non-raw files. + +```` + This specifies the CPU that should be used. This is an + optional argument and will cause the CPU's PC to be set to the + memory address where the raw file is loaded or the entry point + specified in the executable format header. This option should only + be used for the boot image. This will also cause the image to be + written to the specified CPU's address space. If not specified, the + default is CPU 0. - Setting force-raw=on forces the file + to be treated as a raw image. This can be used to load supported + executable formats as if they were raw. + +All values are parsed using the standard QemuOpts parsing. This allows the user +to specify any values in any format supported. By default the values +will be parsed as decimal. To use hex values the user should prefix the number +with a '0x'. + +An example of loading an ELF file which CPU0 will boot is shown below:: + + -device loader,file=./images/boot.elf,cpu-num=0 + +Restrictions and ToDos +^^^^^^^^^^^^^^^^^^^^^^ + +At the moment it is just assumed that if you specify a cpu-num then +you want to set the PC as well. This might not always be the case. In +future the internal state 'set_pc' (which exists in the generic loader +now) should be exposed to the user so that they can choose if the PC +is set or not. + + diff --git a/docs/system/index.rst b/docs/system/index.rst index 625b494372..cee1c83540 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -25,6 +25,7 @@ Contents: usb ivshmem linuxboot + generic-loader vnc-security tls gdb diff --git a/MAINTAINERS b/MAINTAINERS index 0134cad491..7a37599427 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2016,7 +2016,7 @@ M: Alistair Francis S: Maintained F: hw/core/generic-loader.c F: include/hw/core/generic-loader.h -F: docs/generic-loader.txt +F: docs/system/generic-loader.rst Guest Loader M: Alex Bennée From patchwork Mon Mar 8 13:51:01 2021 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: 395429 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1845800ejz; Mon, 8 Mar 2021 06:07:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyiwYqBnnwdxRDmz7dNsFpFY29Cc0qx6/HaQFo8SIOfhNX1hut6+d/+vmQI7Ygp2li0twPd X-Received: by 2002:a6b:4f09:: with SMTP id d9mr5942892iob.60.1615212436485; Mon, 08 Mar 2021 06:07:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212436; cv=none; d=google.com; s=arc-20160816; b=Kws+2V/GrLOtT2dasBT0yVYAwwagUzoNv3MjOHCW2yiQ3xFGaLQ6g6WOWoaWqh1Jd8 aH/CZBBcR02W7IZS1iVka3iO8V04r/4bIQr76lNHLWtWZwJx7AMLkt3qtq7JuiZAs9iN jMkAFGtZqmZm78DjjVGO+JLS0E2qpkUG0GqhCelokFUQQlL95bR/SExnrCgwkVt2sT5j 1DSrK/Zj4zckWJHc1yPRUsB3qFkwTkTiccloKwqGxGxJ0BAbQsLt/I/7NPmamn8XTmxJ iTchQQfuOkbDT/b0a9Spv3DQ2eFnDEkongELqlOL4L4eOeubGH2FmXGnmUWx/6mwHJ2Z JQxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=BFpfdIouIUP72Oj5FjQO/wu5NmbntZ+aXWf5u52LtJfHgTKttCYZG72fPb576dJ0Q/ OV2/xMh6G4UZuQaVuVqO9fYeEPMtNhO2hYoymVKxZyemgcy/iD6CzL63LIbPl+780C2+ S9sUkZ4+uUNKszFc6LNf7dPTG+LqFirS6qgG6ZdL+qHqSjW3/xwzcSFzaHXqgcz9GEwY NHGw9ogXBdjeey6DHbIF43RAbHbwYSsJc8bf8apArF5kXMBCd6vBQOXwrlzEtx1lO3dT 35YUlCHDc9oTUC8UVvPAx4/r7us6CRUhE/mPU86eBqlC2m7P/N5ODHq6+AXv3kYQ2aEi KuPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eGtMdgxh; 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=fail (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 h13si11570407iow.73.2021.03.08.06.07.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:07:16 -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=fail header.i=@linaro.org header.s=google header.b=eGtMdgxh; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGXT-0001M8-Gh for patch@linaro.org; Mon, 08 Mar 2021 09:07:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO5-0007JT-Re for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO3-0003vb-VJ for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: by mail-wr1-x42f.google.com with SMTP id u14so11573173wri.3 for ; Mon, 08 Mar 2021 05:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=eGtMdgxhkh/REo354iMrO/HadqCk26xEkTQGhn10jgukuD5v6/rBS71VTlIiakcdLA Ta9dCU64K+ygKrjAzLxHkB4gPYQA4fnzYoP30VLc6kx7VLZnY7LQG4rHXM0E1H+zIrld mb8JfoBX1fvZeZUeycjkPON68Fe//MDCKB6jV+/DoPUdPgAiIPJxfykBRJZTvE8YdxuN kN2zJM5JON2nqPQKVOOm8vW30G+4GxoloC422ZKg1fAohyCSbuIbSDlM06mToDk/9YrT xT972naNqdmEbKwUj+6eNK2ytT0nxNx9F7/fkdfiRQqaAvwhKmJ47XZq6DWSkTKhqTjM QKhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p+5D2HHD+BVS0BJkIQMQ27L655/TTuIBhMWPQAKF8AU=; b=EVYv0lFQDH/aNxew/Xv/8/SnvkR6dmxJ51uIV7uSwI0bZ4nZQXx//sfO4j7AVJwdFJ bVjJLCa6mBaSEFL+mHpQZ1/DdEaAAiczg1ePqk385MY5FBwuuO23qLlKCEoH4zqO5EfK GUTgV+oreGdFi0zqGLTeji4uyBzOPPMBqkHw/om4sZ90M0wa5m/usfYKt/46b0+CPtq4 41b57SIO2sjADxLxXSQ2RBWDWbpNAffo6q7iEgsCNXVCj81xc1cgh/h/XejC5UtDU0SV 7Zd3UYhLgN8TgruItH70U4sFWrGpYL77WIOAo48lswfbfSPepIGDtpuMmfW7nThZMdOb mA0g== X-Gm-Message-State: AOAM531bsfA3jdrfI8CzgRYx9d9bkGKx8IYBY1NbnbFWN3RiuF6HfOTK nXUsnIRnd7JqqX0l5mJp8Gb/duyYla9cnQ== X-Received: by 2002:a5d:4b06:: with SMTP id v6mr12797505wrq.41.1615211850396; Mon, 08 Mar 2021 05:57:30 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i26sm21238747wmb.18.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4CA101FF9E; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 15/18] docs: add some documentation for the guest-loader Date: Mon, 8 Mar 2021 13:51:01 +0000 Message-Id: <20210308135104.24903-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Message-Id: <20210303173642.3805-7-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/system/guest-loader.rst b/docs/system/guest-loader.rst new file mode 100644 index 0000000000..37d03cbd89 --- /dev/null +++ b/docs/system/guest-loader.rst @@ -0,0 +1,54 @@ +.. + Copyright (c) 2020, Linaro + +Guest Loader +------------ + +The guest loader is similar to the `generic-loader` although it is +aimed at a particular use case of loading hypervisor guests. This is +useful for debugging hypervisors without having to jump through the +hoops of firmware and boot-loaders. + +The guest loader does two things: + + - load blobs (kernels and initial ram disks) into memory + - sets platform FDT data so hypervisors can find and boot them + +This is what is typically done by a boot-loader like grub using it's +multi-boot capability. A typical example would look like: + +.. parsed-literal:: + + |qemu_system| -kernel ~/xen.git/xen/xen \ + -append "dom0_mem=1G,max:1G loglvl=all guest_loglvl=all" \ + -device guest-loader,addr=0x42000000,kernel=Image,bootargs="root=/dev/sda2 ro console=hvc0 earlyprintk=xen" \ + -device guest-loader,addr=0x47000000,initrd=rootfs.cpio + +In the above example the Xen hypervisor is loaded by the -kernel +parameter and passed it's boot arguments via -append. The Dom0 guest +is loaded into the areas of memory. Each blob will get +`/chosen/module@` entry in the FDT to indicate it's location and +size. Additional information can be passed with by using additional +arguments. + +Currently the only supported machines which use FDT data to boot are +the ARM and RiscV `virt` machines. + +Arguments +^^^^^^^^^ + +The full syntax of the guest-loader is:: + + -device guest-loader,addr=[,kernel=,[bootargs=]][,initrd=] + +``addr=`` + This is mandatory and indicates the start address of the blob. + +``kernel|initrd=`` + Indicates the filename of the kernel or initrd blob. Both blobs will + have the "multiboot,module" compatibility string as well as + "multiboot,kernel" or "multiboot,ramdisk" as appropriate. + +``bootargs=`` + This is an optional field for kernel blobs which will pass command + like via the `/chosen/module@/bootargs` node. diff --git a/docs/system/index.rst b/docs/system/index.rst index cee1c83540..6ad9c93806 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -26,6 +26,7 @@ Contents: ivshmem linuxboot generic-loader + guest-loader vnc-security tls gdb diff --git a/MAINTAINERS b/MAINTAINERS index 7a37599427..6bebd5279b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2022,6 +2022,7 @@ Guest Loader M: Alex Bennée S: Maintained F: hw/core/guest-loader.c +F: docs/system/guest-loader.rst Intel Hexadecimal Object File Loader M: Su Hang From patchwork Mon Mar 8 13:51:02 2021 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: 395427 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1842830ejz; Mon, 8 Mar 2021 06:04:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjEf5rSP3DtsZWyyaCnM99EzWYxx50gZvuvZDAEi+Vp2MvrxqPVto2UF+3J6Lv7LflTaDV X-Received: by 2002:a05:6e02:b46:: with SMTP id f6mr18379432ilu.230.1615212258796; Mon, 08 Mar 2021 06:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615212258; cv=none; d=google.com; s=arc-20160816; b=0iEZQqSDyLUNnNUhYBN8QxWY6Gkg4Fl3uTSH8mBz8b44OAEhK9j6Qbz/Riv4+tGly0 era+k5ioWgjwjp+agGZlzmOQ/l0KUtdsWbQcOPyWXaWtu/vvretT1qYVMzkcmw4gba1X vvKHrz/DjI14+XTtlKGv2yb73VD0sK+TgMC5n3Hhlzi9juGEmZ0SzY5LznHg1P9R1+nB faY2/SQxT3/mzugxBMsApdqy+yNlZOHrYxzmJuVSSc/7WxXbqFy5ImWZ8QdUIJSIgdDo MKAMPBIXKPSOUnEajEwEQNgB3RviBWb75ARHXhF/O3n6BWslFH54Zvd1QiyxZYRA/BOU mBfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=lATrIEPGwmzcWZ6ui8eeo8UnfJDdVIWgXFsp1qvDA7I=; b=Jb0tHuwWe8MorlLv+9LcgPO60bU5PiFDnA5dH5chzFbdEwC/8L6jdtF+IY3SEp3bOy IiqyH5V2WkX1qtHSRg8hvqx7h8+pAWVkTGOdWgjwlVXz5TGCRni5DLB0yhhu3vvGrTqD FYfNarhULJAtLJZOF6I6Pw8PY0wAP/pCoW3nepAeAIsRWetaGo8kO3sjgUGftwsG891R 0d+GiFIDgjWj+79jy1sj/Vkai9vDhdZ7RsCNuwrwA9eVF6U48P+jEMyDibXMiS23YYde zDQU4WVsze02mkQYrsVU7tnVry40qJZst6CV9nUmuTk70DTgybScbWTiaprpoL9b3SJH zj8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DPHzJFxQ; 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=fail (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 n82si10686986iod.64.2021.03.08.06.04.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:04:18 -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=fail header.i=@linaro.org header.s=google header.b=DPHzJFxQ; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:49498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGUc-0006Qj-1p for patch@linaro.org; Mon, 08 Mar 2021 09:04:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55162) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO5-0007IC-BA for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39144) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO3-0003vC-6s for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:33 -0500 Received: by mail-wr1-x431.google.com with SMTP id b18so11559575wrn.6 for ; Mon, 08 Mar 2021 05:57:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lATrIEPGwmzcWZ6ui8eeo8UnfJDdVIWgXFsp1qvDA7I=; b=DPHzJFxQxoGVUCeYEWVfEVlD4Pa3UOgFIfOuCbj8L7cZitpj0DMBCUS5z3u6ePQrLF AZ8YA3eTlT7z01VImsu9ykQVmAiRzTbFExJP7GdrMMpcEy5iubLOYLV5aMLUpSHuiUmo S2ZHyNzs1AhQJoGMZaEFCAstr22VvfOEz560XKHWWdjQnF/rImJZlG5m/F/obxH3kJtj wESXwmuepwOKPboP6FAIinKrJ1q99bSBcwlqhiq5yxZiBQDNrbiHryXGtQniHsnf17DX 8JxxWmBm7dWw2GWzZ8LmHr2QllJbJFjngw0vxYPfyqHJ8Hea0RJfvgD7TIgDZnf2v4Qp FbEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lATrIEPGwmzcWZ6ui8eeo8UnfJDdVIWgXFsp1qvDA7I=; b=pUfAbrlM8UKxXHaZvTZ2VJ35WzSfr7jqE9dLbcLuv4vTgmEkUTRcxbXakx3bBs/yD7 Yt/uuDEvZCpxLf8a4pw7G3wC2qlkUv6XwdTpqWXC6fiNa4CBvxQI3muPZFT04pTU5VG4 /YGGZATC3X/bjyVVXONbAzluKeR/uYBgA10L9K6n5E+e86t9Nxu3cY1ED4INBMfTLZMb ZzhJ364Hyw7wNuV/CFmiHYp5LExbwt8gyJGjuGCHLrZYi2DHlOloas70LdKxQc+33fXJ tKI1XCqcJmBwbKCPcYKXbudL83ktv1PtDjOitPw/ZDwMhR1qIiFvRtfQz/pz0/g/1jVA HU/A== X-Gm-Message-State: AOAM5311euNCUpOU0ZADjiJUAiuxredvfZo/eZDICM+JIfGkti/8E0e0 E44NKDglmJIU5gLcPMeE33zRQA== X-Received: by 2002:adf:ebc9:: with SMTP id v9mr23196380wrn.387.1615211849897; Mon, 08 Mar 2021 05:57:29 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s8sm19705136wrn.97.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 64B491FF9F; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 16/18] tests/avocado: add boot_xen tests Date: Mon, 8 Mar 2021 13:51:02 +0000 Message-Id: <20210308135104.24903-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , qemu-devel@nongnu.org, Cleber Rosa , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These tests make sure we can boot the Xen hypervisor with a Dom0 kernel using the guest-loader. We currently have to use a kernel I built myself because there are issues using the Debian kernel images. Signed-off-by: Alex Bennée Tested-by: Cleber Rosa Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Cleber Rosa Message-Id: <20210303173642.3805-8-alex.bennee@linaro.org> -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index 6bebd5279b..b54a22475b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2023,6 +2023,7 @@ M: Alex Bennée S: Maintained F: hw/core/guest-loader.c F: docs/system/guest-loader.rst +F: tests/acceptance/boot_xen.py Intel Hexadecimal Object File Loader M: Su Hang diff --git a/tests/acceptance/boot_xen.py b/tests/acceptance/boot_xen.py new file mode 100644 index 0000000000..75c2d44492 --- /dev/null +++ b/tests/acceptance/boot_xen.py @@ -0,0 +1,118 @@ +# Functional test that boots a Xen hypervisor with a domU kernel and +# checks the console output is vaguely sane . +# +# Copyright (c) 2020 Linaro +# +# Author: +# Alex Bennée +# +# SPDX-License-Identifier: GPL-2.0-or-later +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os + +from avocado import skipIf +from avocado_qemu import wait_for_console_pattern +from boot_linux_console import LinuxKernelTest + + +class BootXenBase(LinuxKernelTest): + """ + Boots a Xen hypervisor with a Linux DomU kernel. + """ + + timeout = 90 + XEN_COMMON_COMMAND_LINE = 'dom0_mem=128M loglvl=all guest_loglvl=all' + + def fetch_guest_kernel(self): + # Using my own built kernel - which works + kernel_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download?path=%2F&files=' + 'linux-5.9.9-arm64-ajb') + kernel_sha1 = '4f92bc4b9f88d5ab792fa7a43a68555d344e1b83' + kernel_path = self.fetch_asset(kernel_url, + asset_hash=kernel_sha1) + + return kernel_path + + def launch_xen(self, xen_path): + """ + Launch Xen with a dom0 guest kernel + """ + self.log.info("launch with xen_path: %s", xen_path) + kernel_path = self.fetch_guest_kernel() + + self.vm.set_console() + + xen_command_line = self.XEN_COMMON_COMMAND_LINE + self.vm.add_args('-machine', 'virtualization=on', + '-cpu', 'cortex-a57', + '-m', '768', + '-kernel', xen_path, + '-append', xen_command_line, + '-device', + 'guest-loader,addr=0x47000000,kernel=%s,bootargs=console=hvc0' + % (kernel_path)) + + self.vm.launch() + + console_pattern = 'VFS: Cannot open root device' + wait_for_console_pattern(self, console_pattern, "Panic on CPU 0:") + + +class BootXen(BootXenBase): + + def test_arm64_xen_411_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + + # archive of file from https://deb.debian.org/debian/pool/main/x/xen/ + xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/' + 'download?path=%2F&files=' + 'xen-hypervisor-4.11-arm64_4.11.4%2B37-g3263f257ca-1_arm64.deb') + xen_sha1 = '034e634d4416adbad1212d59b62bccdcda63e62a' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.11-arm64") + + self.launch_xen(xen_path) + + def test_arm64_xen_414_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + + # archive of file from https://deb.debian.org/debian/pool/main/x/xen/ + xen_url = ('https://fileserver.linaro.org/s/JSsewXGZ6mqxPr5/' + 'download?path=%2F&files=' + 'xen-hypervisor-4.14-arm64_4.14.0%2B80-gd101b417b7-1_arm64.deb') + xen_sha1 = 'b9d209dd689ed2b393e625303a225badefec1160' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.14-arm64") + + self.launch_xen(xen_path) + + def test_arm64_xen_415_and_dom0(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=accel:tcg + :avocado: tags=cpu:cortex-a57 + :avocado: tags=machine:virt + """ + + xen_url = ('https://fileserver.linaro.org/' + 's/JSsewXGZ6mqxPr5/download' + '?path=%2F&files=xen-upstream-4.15-unstable.deb') + xen_sha1 = 'fc191172b85cf355abb95d275a24cc0f6d6579d8' + xen_deb = self.fetch_asset(xen_url, asset_hash=xen_sha1) + xen_path = self.extract_from_deb(xen_deb, "/boot/xen-4.15-unstable") + + self.launch_xen(xen_path) From patchwork Mon Mar 8 13:51:03 2021 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: 395433 Delivered-To: patch@linaro.org Received: by 2002:a17:906:a383:0:0:0:0 with SMTP id k3csp1858522ejz; Mon, 8 Mar 2021 06:21:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh+fGgVgnKSrz+2eipXt4qMsAJCttSkJ+vujTqUalUPsFdX1Q1Sh9AWJRBQ1k+VRX7vhgY X-Received: by 2002:a92:cc49:: with SMTP id t9mr19617856ilq.86.1615213312971; Mon, 08 Mar 2021 06:21:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615213312; cv=none; d=google.com; s=arc-20160816; b=vP1Auijy6FBtx8lZza6+b7dwQTbyh05ZHheE2UYby9zvaDizbRMAW3r7WhyIqZmGrt cQW2r5IgzbZZUjPBEWVYiwyn+EvHOk3Ex44gtGsWIJopOJmw3N18dyFmYa71BIGmQbN5 DzLDxuGyRv+vnI2zisF9ppn/IslP5tF1nOmmWCjijFqdjn6K/o5h9FlwDPPT81cgXqkO 7411NoBfmAE5/p1Ocl/fqgIqgOqE1JmiNi1OPhvJ7KBFAOA1E9hO8EuWEkK1HZBHDiEn 1YzBG2U/1m6Vn9P4kKMBuqBVexwxE0mRUstLjWCH5AJo7ttQz5idyRY7g10my0XaBFwR NcHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=Tt2yZqXKIFZKTwQI0xUJgunkMs97WBSUmjzoBdId4gE=; b=hiPz1IHmMfJs41T1DZQCSSmAb6HjqVL1ztBI4C0UqdU9VKuRhn6YzJE4qHIViuZJdJ AoZ+vPaArAdfyI7AFc9Z9KKwSWmTBdpqGomrtDwxqRZuEkQDuVs+3tL7z0gMI2pp0TB6 Zgd9I9L0yqKby6m6JVidT8n7HKhUhNWKtA0CYZaFYppM85MiS59Ar0NAQe/+vemcd6JH 7WYoeFCDEysxVT3Gv+bfw/A54FVW6xc3Gsv88wKR4g8Cl2jKwjuXpU7LrXTtZDj/HPTl XcdywSTNMn/tihTUFLKPV2nGS6BRwXKUlDorCZ9jPOg5L0k5zVF0ALChDPc606fUP3EN e9Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WCx0/bUn"; 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=fail (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 v23si10429463ion.99.2021.03.08.06.21.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:21:52 -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=fail header.i=@linaro.org header.s=google header.b="WCx0/bUn"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:36634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGlc-0007uc-8B for patch@linaro.org; Mon, 08 Mar 2021 09:21:52 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO8-0007Qd-OY for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:36 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:51673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO6-0003wg-54 for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:36 -0500 Received: by mail-wm1-x333.google.com with SMTP id l22so6116244wme.1 for ; Mon, 08 Mar 2021 05:57:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Tt2yZqXKIFZKTwQI0xUJgunkMs97WBSUmjzoBdId4gE=; b=WCx0/bUnc5bzKwqRxloVJXaBJcZnQIKpScr2AyyRb8velvjy26rVsVYFtBqLHBMPyH YbExifV5JKpJj/26n5nzFlGpAwxMvMG8M/w4s+3IbccnAiSKEqMNjcXyJzaFXdg5QYVv Ym7AoUl5/sIr6K2zW5qxKivfUKfhCFXf4rXvk1oozePnJ0L2J/B/4NpSyxOMQZ4SLaWm X9N6DctUZjAIXAEicTF3GkEXQSSV+IKERJl/EnSW+nipUlp3D2Oyy+1W92NqPUXwM9I4 WXCyVnzIZXoCSVsBjDLXMlfFmUS6CKgYQ4hQOn0XC0A0WZJCLdQKMDPXCyapAaoHybhb fYEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Tt2yZqXKIFZKTwQI0xUJgunkMs97WBSUmjzoBdId4gE=; b=ZF9UE7opLynkYWpaNbMKAr8VCTSnfCF/N5mTpyTfU0aq3Z5FysLySCgAhPQNh2jdHj Qqij88NQ72h4fU1j1MFDzka7ZfJ+oL/ylei3Q1N2/P/u8VwAJzVH1zbcE0cN/Bn1803M d9oRkPczTEyhYrucsi3sKTryz7gWE1/+K+orXwv9EuKCv2EllrfOy+Fj99QH3MFox9Qg AunbY+b8Yv+MVyYvcjnAOTLBRXeDi28oXNfcO0f0l7uUrdoEcmezAsmtH6QTi9fVazyj R7LFpT6Yj0lU/2nJJxASzLxvfvf1zXr/3EmGBSLpQ/1hDyBymGUwRjH8fIb8PXOr8BGy RC9Q== X-Gm-Message-State: AOAM532U6JG2WExfI4iyi0R9rX836anxPVhVq8VP7kxqBSVN7UlHJ5W+ TTdTKrQkSfr1Q/CBUZK5107ENQ== X-Received: by 2002:a1c:7e16:: with SMTP id z22mr22142731wmc.74.1615211852768; Mon, 08 Mar 2021 05:57:32 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q15sm19377088wrr.58.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AA54A1FF7E; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 17/18] semihosting: Move include/hw/semihosting/ -> include/semihosting/ Date: Mon, 8 Mar 2021 13:51:03 +0000 Message-Id: <20210308135104.24903-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Aleksandar Rikalo , "open list:RISC-V TCG CPUs" , Sagar Karandikar , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , Chris Wulff , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Max Filippov , Michael Walle , "open list:ARM TCG CPUs" , Palmer Dabbelt , Bastian Koppelmann , Paolo Bonzini , Alistair Francis , Guan Xuetao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Aurelien Jarno , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We want to move the semihosting code out of hw/ in the next patch. This patch contains the mechanical steps, created using: $ git mv include/hw/semihosting/ include/ $ sed -i s,hw/semihosting,semihosting, $(git grep -l hw/semihosting) Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20210226131356.3964782-2-f4bug@amsat.org> Message-Id: <20210305135451.15427-2-alex.bennee@linaro.org> -- 2.20.1 diff --git a/include/hw/semihosting/console.h b/include/semihosting/console.h similarity index 100% rename from include/hw/semihosting/console.h rename to include/semihosting/console.h diff --git a/include/hw/semihosting/semihost.h b/include/semihosting/semihost.h similarity index 100% rename from include/hw/semihosting/semihost.h rename to include/semihosting/semihost.h diff --git a/gdbstub.c b/gdbstub.c index 3ee40479b6..e51e33cc70 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -49,7 +49,7 @@ #include "sysemu/hw_accel.h" #include "sysemu/kvm.h" #include "sysemu/runstate.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "exec/exec-all.h" #include "sysemu/replay.h" diff --git a/hw/mips/malta.c b/hw/mips/malta.c index 9afc0b427b..26e7b1bd9f 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -58,7 +58,7 @@ #include "qemu/error-report.h" #include "hw/misc/empty_slot.h" #include "sysemu/kvm.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "hw/mips/cps.h" #include "hw/qdev-clock.h" diff --git a/hw/semihosting/arm-compat-semi.c b/hw/semihosting/arm-compat-semi.c index 23c6e3edcb..94950b6c56 100644 --- a/hw/semihosting/arm-compat-semi.c +++ b/hw/semihosting/arm-compat-semi.c @@ -34,9 +34,9 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "hw/semihosting/semihost.h" -#include "hw/semihosting/console.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/semihost.h" +#include "semihosting/console.h" +#include "semihosting/common-semi.h" #include "qemu/log.h" #include "qemu/timer.h" #ifdef CONFIG_USER_ONLY diff --git a/hw/semihosting/config.c b/hw/semihosting/config.c index 9807f10cb0..3548e0f627 100644 --- a/hw/semihosting/config.c +++ b/hw/semihosting/config.c @@ -22,7 +22,7 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/error-report.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "chardev/char.h" #include "sysemu/sysemu.h" diff --git a/hw/semihosting/console.c b/hw/semihosting/console.c index 9b4fee9260..c9ebd6fdd0 100644 --- a/hw/semihosting/console.c +++ b/hw/semihosting/console.c @@ -17,8 +17,8 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "hw/semihosting/semihost.h" -#include "hw/semihosting/console.h" +#include "semihosting/semihost.h" +#include "semihosting/console.h" #include "exec/gdbstub.h" #include "exec/exec-all.h" #include "qemu/log.h" diff --git a/linux-user/aarch64/cpu_loop.c b/linux-user/aarch64/cpu_loop.c index 7c42f65706..ee72a1c20f 100644 --- a/linux-user/aarch64/cpu_loop.c +++ b/linux-user/aarch64/cpu_loop.c @@ -22,7 +22,7 @@ #include "qemu.h" #include "cpu_loop-common.h" #include "qemu/guest-random.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" #include "target/arm/syndrome.h" #define get_user_code_u32(x, gaddr, env) \ diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c index cadfb7fa43..989d03cd89 100644 --- a/linux-user/arm/cpu_loop.c +++ b/linux-user/arm/cpu_loop.c @@ -22,7 +22,7 @@ #include "qemu.h" #include "elf.h" #include "cpu_loop-common.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" #define get_user_code_u32(x, gaddr, env) \ ({ abi_long __r = get_user_u32((x), (gaddr)); \ diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c index 9665dabb09..6767f941e8 100644 --- a/linux-user/riscv/cpu_loop.c +++ b/linux-user/riscv/cpu_loop.c @@ -23,7 +23,7 @@ #include "qemu.h" #include "cpu_loop-common.h" #include "elf.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" void cpu_loop(CPURISCVState *env) { diff --git a/linux-user/semihost.c b/linux-user/semihost.c index c0015ee7f6..82013b8b48 100644 --- a/linux-user/semihost.c +++ b/linux-user/semihost.c @@ -12,7 +12,7 @@ #include "qemu/osdep.h" #include "cpu.h" -#include "hw/semihosting/console.h" +#include "semihosting/console.h" #include "qemu.h" #include diff --git a/softmmu/vl.c b/softmmu/vl.c index 10bd8a10a3..ac06dfbae0 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -108,7 +108,7 @@ #include "qapi/opts-visitor.h" #include "qapi/clone-visitor.h" #include "qom/object_interfaces.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "crypto/init.h" #include "sysemu/replay.h" #include "qapi/qapi-events-run-state.h" diff --git a/stubs/semihost.c b/stubs/semihost.c index 1d8b37f7b2..1b30f38b03 100644 --- a/stubs/semihost.c +++ b/stubs/semihost.c @@ -11,7 +11,7 @@ #include "qemu/osdep.h" #include "qemu/option.h" #include "qemu/error-report.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "sysemu/sysemu.h" /* Empty config */ diff --git a/target/arm/helper.c b/target/arm/helper.c index 0e1a3b9421..d763f376c6 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -22,7 +22,7 @@ #include "exec/exec-all.h" #include /* For crc32 */ #include "hw/irq.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "sysemu/cpus.h" #include "sysemu/cpu-timers.h" #include "sysemu/kvm.h" @@ -34,7 +34,7 @@ #ifdef CONFIG_TCG #include "arm_ldst.h" #include "exec/cpu_ldst.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" #endif #define ARM_CPU_FREQ 1000000000 /* FIXME: 1 GHz, should be configurable */ diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c index 731c435c00..d63ae465e1 100644 --- a/target/arm/m_helper.c +++ b/target/arm/m_helper.c @@ -21,7 +21,7 @@ #include "qemu/qemu-print.h" #include "exec/exec-all.h" #include /* For crc32 */ -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "sysemu/cpus.h" #include "sysemu/kvm.h" #include "qemu/range.h" @@ -31,7 +31,7 @@ #ifdef CONFIG_TCG #include "arm_ldst.h" #include "exec/cpu_ldst.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" #endif static void v7m_msr_xpsr(CPUARMState *env, uint32_t mask, diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b23a8975d5..6d002e2c63 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -28,7 +28,7 @@ #include "internals.h" #include "qemu/host-utils.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "exec/gen-icount.h" #include "exec/helper-proto.h" diff --git a/target/arm/translate.c b/target/arm/translate.c index 1653cca1aa..62b1c2081b 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -29,7 +29,7 @@ #include "qemu/log.h" #include "qemu/bitops.h" #include "arm_ldst.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" diff --git a/target/lm32/helper.c b/target/lm32/helper.c index 7c52ae76d6..01cc3c53a5 100644 --- a/target/lm32/helper.c +++ b/target/lm32/helper.c @@ -21,7 +21,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "qemu/host-utils.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "exec/log.h" bool lm32_cpu_tlb_fill(CPUState *cs, vaddr address, int size, diff --git a/target/m68k/op_helper.c b/target/m68k/op_helper.c index 202498deb5..730cdf7744 100644 --- a/target/m68k/op_helper.c +++ b/target/m68k/op_helper.c @@ -21,7 +21,7 @@ #include "exec/helper-proto.h" #include "exec/exec-all.h" #include "exec/cpu_ldst.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #if defined(CONFIG_USER_ONLY) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index bf70c77295..bd4dca571f 100644 --- a/target/mips/cpu.c +++ b/target/mips/cpu.c @@ -31,7 +31,7 @@ #include "exec/exec-all.h" #include "hw/qdev-properties.h" #include "hw/qdev-clock.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "qapi/qapi-commands-machine-target.h" #include "fpu_helper.h" diff --git a/target/mips/mips-semi.c b/target/mips/mips-semi.c index 898251aa02..6de60fa6dd 100644 --- a/target/mips/mips-semi.c +++ b/target/mips/mips-semi.c @@ -22,8 +22,8 @@ #include "qemu/log.h" #include "exec/helper-proto.h" #include "exec/softmmu-semi.h" -#include "hw/semihosting/semihost.h" -#include "hw/semihosting/console.h" +#include "semihosting/semihost.h" +#include "semihosting/console.h" typedef enum UHIOp { UHI_exit = 1, diff --git a/target/mips/translate.c b/target/mips/translate.c index 70891c37cd..0b6d82d228 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -29,7 +29,7 @@ #include "exec/translator.h" #include "exec/helper-proto.h" #include "exec/helper-gen.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "target/mips/trace.h" #include "trace-tcg.h" diff --git a/target/nios2/helper.c b/target/nios2/helper.c index 57c97bde3c..53be8398e9 100644 --- a/target/nios2/helper.c +++ b/target/nios2/helper.c @@ -26,7 +26,7 @@ #include "exec/cpu_ldst.h" #include "exec/log.h" #include "exec/helper-proto.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #if defined(CONFIG_USER_ONLY) diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c index 2f43939fb6..83a6bcfad0 100644 --- a/target/riscv/cpu_helper.c +++ b/target/riscv/cpu_helper.c @@ -24,7 +24,7 @@ #include "exec/exec-all.h" #include "tcg/tcg-op.h" #include "trace.h" -#include "hw/semihosting/common-semi.h" +#include "semihosting/common-semi.h" int riscv_cpu_mmu_index(CPURISCVState *env, bool ifetch) { diff --git a/target/unicore32/helper.c b/target/unicore32/helper.c index 54c26871fe..704393c27f 100644 --- a/target/unicore32/helper.c +++ b/target/unicore32/helper.c @@ -14,7 +14,7 @@ #include "cpu.h" #include "exec/exec-all.h" #include "exec/helper-proto.h" -#include "hw/semihosting/console.h" +#include "semihosting/console.h" #undef DEBUG_UC32 diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 944a157747..0ae4efc48a 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -37,7 +37,7 @@ #include "qemu/log.h" #include "qemu/qemu-print.h" #include "exec/cpu_ldst.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "exec/translator.h" #include "exec/helper-proto.h" diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index 25f57a6500..79f2b043f2 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -29,7 +29,7 @@ #include "cpu.h" #include "chardev/char-fe.h" #include "exec/helper-proto.h" -#include "hw/semihosting/semihost.h" +#include "semihosting/semihost.h" #include "qapi/error.h" #include "qemu/log.h" diff --git a/MAINTAINERS b/MAINTAINERS index b54a22475b..99e9874fd2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3243,7 +3243,7 @@ Semihosting M: Alex Bennée S: Maintained F: hw/semihosting/ -F: include/hw/semihosting/ +F: include/semihosting/ Multi-process QEMU M: Elena Ufimtseva From patchwork Mon Mar 8 13:51:04 2021 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: 395437 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1761573jai; Mon, 8 Mar 2021 06:35:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxUHuxjxUI1D7SRYUobTB8gOc/HJyloBnw7njoX+Q/zwUByIiAqdnCRVUJNGmqjk8RCDvdc X-Received: by 2002:a05:6e02:1545:: with SMTP id j5mr20116118ilu.296.1615214110727; Mon, 08 Mar 2021 06:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615214110; cv=none; d=google.com; s=arc-20160816; b=L9SSVTHb+621pyZxcWOw1YqIukZbk7UQ8ksj/MzEg0m4HntvO6XyLkdofnkyEbzHjn +WGGFbn8jU4J9Hy4VIOAL21T+XgF0XPUJJd2Ibv+TjAbAyxptm73lkQIUBQo4dNJRM53 1QzjFbbDwYu77S375IlUC+gj8ZVCrMVwdTcPi7Bkea+5vmYMf2M7nGgcTpZuTWOYYVmg 4NWFoXViJnzGbPVBdhemKue+tg5v3vhfEu+1XWxNKzMIhPfVZdzOr4AbdfTltDmByTfL 0F+pH8vZEc5XqG35id+bl+dCLgrDZRR7qm96Hdj8q6pnztv9/VH0WEEvmuzD7LM4kmMF YNyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=dbHIRkW5mOeLd+eNU43aSU4kAGhV/trcLXwzgkkHJ4w=; b=RRNuy0aX1yWcp9lhZBQ7K1OC7t19JUYNH7iq7BnD131Ay915ss6Ba8jWW8bLa9WgQC +Zo2u1ZXdu+DAAM2+ALAPjEZxfrnISzvE5KXwnloIE7SizjI6NINriKwlBlmyiMwyOlV rQAUAfm6/1qGMlcB/siuiaFcmV5DdP2WXnPxoFXrq1HxqQ8ETfYUlZqkteP51JuwX+bC BbX5h30tyS1QU5uSVx2TljnF7a9Lcp6e/9kLwLSIC6TuoBROSyBrJX6EGzEn2pI81s4j 3aYlBqV61PTn/zTfAoRYkYkkMnh+16dXroWoIdn5LEA11h1Y5M/uJsT0J+0sSEkUmRFz B3pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NEan6uhH; 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=fail (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 z10si10641856ior.84.2021.03.08.06.35.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Mar 2021 06:35:10 -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=fail header.i=@linaro.org header.s=google header.b=NEan6uhH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJGyU-0006Hg-2i for patch@linaro.org; Mon, 08 Mar 2021 09:35:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:55248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJGO9-0007SH-Cp for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:37 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJGO6-0003x1-Tz for qemu-devel@nongnu.org; Mon, 08 Mar 2021 08:57:37 -0500 Received: by mail-wr1-x436.google.com with SMTP id e10so11515446wro.12 for ; Mon, 08 Mar 2021 05:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dbHIRkW5mOeLd+eNU43aSU4kAGhV/trcLXwzgkkHJ4w=; b=NEan6uhHObg/wVt3s2hDI0RbyI5AX+F8r5+SVn5YXX5qfCZZ2/bTHG581NI9nNqWi4 BkMvfwv67akZ7WosCwXVlQ+U4FNPkf7LFVKG7qf7NlCZ1QZ9j7XNVQ/1Z81GuBzgNdCe NKPmiN1YC3kY/5DISlrvH17WGUzLtgHEdZWllx1WpBY3o/qo/YNXDRRRQFFCs2dJsC4e H9mI7nbFaDYKK1DyvuPPJI7nofREZgLRqjbFGFsVDAZny5nx+/5Yka6O65BSi9h3Mz4y X0ZxNMZuyGRsmQHwlWBcBAbxqS907vichhgKfuCh76roZtUVnTB3XPmpPLeQSteP2H5s riUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dbHIRkW5mOeLd+eNU43aSU4kAGhV/trcLXwzgkkHJ4w=; b=fK4S98Pcs/7wLAPWaETJPj886aUBWrxryVSYkWtuVtIItjnf0wIPDcHOtI4jkt5P27 Tm7FZFsexWoy6rJe9KM1nPefri5a/Eikakn6caCGaH3z+YxiScC2nbvBbz49YzQYE6UQ GBNnH4qR8eVBsRBqUR1/5u7FsMU6h6D6xPyXA/hOz7gIS09lobrwpCcHGVLW3L0gU5v5 0R3NELVfg7c4bFRkK2iKsQyjagSWwRbXGHPa4e3tnO4FKj4rlXkw2f1odSKwuNbX/G8v AveJN5JssoPykVOKoc7xJ/NpmVPu18MyUGkSE4Gll+23dqIfwJnLKezA5yRiXkOlg12/ rasQ== X-Gm-Message-State: AOAM533AZrdscCjDBdTDxZdh1fhMPYvNBJQVBof/0gUyjNsMc9QapPdt v+jMUi/gbEcnLaQimH1k3KNfbw== X-Received: by 2002:adf:e94a:: with SMTP id m10mr22811282wrn.55.1615211853573; Mon, 08 Mar 2021 05:57:33 -0800 (PST) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c128sm19542433wma.37.2021.03.08.05.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 05:57:28 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CB43A1FFA5; Mon, 8 Mar 2021 13:51:06 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 18/18] semihosting: Move hw/semihosting/ -> semihosting/ Date: Mon, 8 Mar 2021 13:51:04 +0000 Message-Id: <20210308135104.24903-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210308135104.24903-1-alex.bennee@linaro.org> References: <20210308135104.24903-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé With the exception of hw/core/, the hw/ directory only contains device models used in system emulation. Semihosting is also used by user emulation. As a generic feature, move it out of hw/ directory. Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20210226131356.3964782-3-f4bug@amsat.org> Message-Id: <20210305135451.15427-3-alex.bennee@linaro.org> -- 2.20.1 diff --git a/meson.build b/meson.build index 81d760d6e8..16dbb6fc12 100644 --- a/meson.build +++ b/meson.build @@ -1939,6 +1939,7 @@ subdir('migration') subdir('monitor') subdir('net') subdir('replay') +subdir('semihosting') subdir('hw') subdir('accel') subdir('plugins') diff --git a/hw/semihosting/common-semi.h b/semihosting/common-semi.h similarity index 100% rename from hw/semihosting/common-semi.h rename to semihosting/common-semi.h diff --git a/hw/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c similarity index 100% rename from hw/semihosting/arm-compat-semi.c rename to semihosting/arm-compat-semi.c diff --git a/hw/semihosting/config.c b/semihosting/config.c similarity index 100% rename from hw/semihosting/config.c rename to semihosting/config.c diff --git a/hw/semihosting/console.c b/semihosting/console.c similarity index 100% rename from hw/semihosting/console.c rename to semihosting/console.c diff --git a/Kconfig b/Kconfig index bf694c42af..d52ebd839b 100644 --- a/Kconfig +++ b/Kconfig @@ -2,3 +2,4 @@ source Kconfig.host source backends/Kconfig source accel/Kconfig source hw/Kconfig +source semihosting/Kconfig diff --git a/MAINTAINERS b/MAINTAINERS index 99e9874fd2..8956bd2f32 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3242,7 +3242,7 @@ F: qapi/rdma.json Semihosting M: Alex Bennée S: Maintained -F: hw/semihosting/ +F: semihosting/ F: include/semihosting/ Multi-process QEMU diff --git a/hw/Kconfig b/hw/Kconfig index 8ea26479c4..ff40bd3f7b 100644 --- a/hw/Kconfig +++ b/hw/Kconfig @@ -31,7 +31,6 @@ source remote/Kconfig source rtc/Kconfig source scsi/Kconfig source sd/Kconfig -source semihosting/Kconfig source smbios/Kconfig source ssi/Kconfig source timer/Kconfig diff --git a/hw/meson.build b/hw/meson.build index e615d72d4d..8ba79b1a52 100644 --- a/hw/meson.build +++ b/hw/meson.build @@ -30,7 +30,6 @@ subdir('rdma') subdir('rtc') subdir('scsi') subdir('sd') -subdir('semihosting') subdir('smbios') subdir('ssi') subdir('timer') diff --git a/hw/semihosting/Kconfig b/semihosting/Kconfig similarity index 100% rename from hw/semihosting/Kconfig rename to semihosting/Kconfig diff --git a/hw/semihosting/meson.build b/semihosting/meson.build similarity index 100% rename from hw/semihosting/meson.build rename to semihosting/meson.build