From patchwork Fri Oct 25 06:36:01 2019 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: 177621 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3235197ill; Thu, 24 Oct 2019 23:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxUDRN3fda0oHK3peLxvghj0Zol+/K9a532P7qB2QQ+5yAHc4VHvuVZx1rRi4kc90YAvtD X-Received: by 2002:aa7:dcd7:: with SMTP id w23mr2209440edu.34.1571985722086; Thu, 24 Oct 2019 23:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985722; cv=none; d=google.com; s=arc-20160816; b=yi8/S6pyeDCsUEdYKsbIR/ga45fncjFQK4dlovVqnb7HY7RdP4HmpKXHmceVgnErmj PELMpFtJ5KznODjDB4EEwhiQmcAuv6AZigo7+zRVVuniDwhd00lFkaDCGK9sVFK2vFiT qv25xIQdWYowXE6oRKHM/KEwrBsiPM8qzGx5QCEYX0ux+wFCj2N5VXiZ5jsLGTNZMG8h 2uyIcSgaaFdK6432kriLor9LWoqW0WqgKZ0TGqmEgVv3iURR32DFFnjeyKeFoCnrqW5U FwkUNiy/gdq9NSFViz+JunA7eCSE9N7BI8qrNxstajRMvzQ1+VFEzK6a3JxSv9LDp+AP 7dKw== 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=5I5UoFas/oMecYMX9Nd86Bz4Y4H1FsmbDV1CnX/LR6E=; b=r4qrFtrkVvBACPMOJT2bufHPMfjqW9dn1kKQwLdXVfSsrrtJ3COEbMm67RNM5qZajN ubAaxgVhOUvQMIsLCg4WOKPMFXC2ej8/WS+b7MUlVtAtZQ9XD7J8WH5dY8YGvCSwtpyA XVmdW4S9LFvQOY0midkHtlphz9abU12wO0MOKYEqbqS2MOxHkJFJkeegfJJe0BTam5I5 Qj59AoMEtb7I51bvE4BByaeaoP9UwqsM4lz3ZiNz78GzmSFjmd8iRj3YW8Z4Wz8WF0qx JNgJBUjqPoi0a9FIxrvY3ZgoJOSrYmF8ba0qTwopFf+XKCcPUSC2k3Qq8uTTOGOzv3kC iPzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rWe0ZgTk; 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 g7si649937edg.66.2019.10.24.23.42.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:42:02 -0700 (PDT) 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=rWe0ZgTk; 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]:55844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtIO-00054T-8y for patch@linaro.org; Fri, 25 Oct 2019 02:42:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35344) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDr-0002sj-0Y for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDp-0008Lh-OC for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:18 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:36908) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDp-0008LL-GW for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:17 -0400 Received: by mail-wm1-x32a.google.com with SMTP id q130so761429wme.2 for ; Thu, 24 Oct 2019 23:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5I5UoFas/oMecYMX9Nd86Bz4Y4H1FsmbDV1CnX/LR6E=; b=rWe0ZgTkAlC8UfOmc3669+jDAnTAMhu92Nq9Ql6zv0px97u6z1Kc7pplBlWpukVzRB ccxh0JxUV//cZPwen8Eykkp/gIhdPjv0Lpx0MxCMlg1FxRcTxFD16sXZs3uvgjIKIP9k zd5LBoGH1VlobU5F1kezHIBs9kwbClyasfRDucJvWSfxn18blCdXL/02jv8iGo/yHBnL DErmJFLBGO5OwJTZZAD7b9ASMVCnKMjrD1xX1mu98V7bXWkCtxqqTrm5pZSTs5APiX7h sGmDoVqtFPLPaK4eU84VY3Iafobgnz4XSb+1T3jBVS1D2m0NL9gCoUPEhmRVu5Tzj10j zIzg== 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=5I5UoFas/oMecYMX9Nd86Bz4Y4H1FsmbDV1CnX/LR6E=; b=c+KBZG3yL87DBJQsb21Fie2WjdFP7uUeVHSmaTNHDBb6rZZbIudnaWonyCk5aBx8Rg lnYvVDlly5dI6EazdK4fTNAFSCPlJa+FaBzZE7ugAYRqyJBJNNcA1K7RWsYxyMvlPrOi xf8j2MPq5SCRmjjEBE8nfoBmJ0c9KKUL3jXm5JmIoqZYPKj/ZFR+aIs4i28bplphzhvB 2FfCHZgetilQ1lO2Dkf8ikK9THDqXnfHMUhLCHDJ89vS7o0hpDWEmp51zDG9bqcWylWX yq5a/EqAwoKarUaWU90/XotP3Twe7KZaWngXIwL1U53hndjg7LKJPPwiCgFfKEMDR1jW iiSg== X-Gm-Message-State: APjAAAXZtoBuQRhSGAcTiJuJkTOrcGmd728AhQyoLuWOTJNBfHPdnOM2 7+Ei8kdsRjj1d5omEMt+8l0HbQ== X-Received: by 2002:a1c:398b:: with SMTP id g133mr1971190wma.130.1571985436029; Thu, 24 Oct 2019 23:37:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q14sm1445345wre.27.2019.10.24.23.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CB5631FF8C; Fri, 25 Oct 2019 07:37:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 01/73] travis.yml: reduce scope of the --enable-debug build Date: Fri, 25 Oct 2019 07:36:01 +0100 Message-Id: <20191025063713.23374-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Adding debug makes things run a bit slower so lets not hammer all the targets. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index d0b9e099b9c..7d90b87540f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -124,12 +124,13 @@ matrix: - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + # --enable-debug implies --enable-debug-tcg, also runs quite a bit slower - env: - - CONFIG="--enable-debug --enable-debug-tcg --disable-user" + - CONFIG="--enable-debug --target-list=${MAIN_SOFTMMU_TARGETS}" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug" - # TCG debug can be run just on it's own and is mostly agnostic to user/softmmu distinctions + # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions - env: - CONFIG="--enable-debug-tcg --disable-system" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug" From patchwork Fri Oct 25 06:36:02 2019 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: 177616 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3231970ill; Thu, 24 Oct 2019 23:38:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhWVELrKO3MoOI/G0R7vEq3r8e+UoLfc2dMfE5F/GPl6w47+AcyzbJfTc+uMYdrddgzeXW X-Received: by 2002:ac8:525a:: with SMTP id y26mr1533109qtn.86.1571985485381; Thu, 24 Oct 2019 23:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985485; cv=none; d=google.com; s=arc-20160816; b=N7FdN2rQBecS3/MAJ0J2fvfS3BT07aBAYmWzsxpcHo+QSZfA8HOuRB3npTQlrEtxB9 eVEWtUF8F9QJDqSze/MBpm1pfiGPwe0F+DmYqtmp7D4m7P45z+kK2CGmLl/fD4ncB4fY FC1FuYPxB2yr0/qqmqfa0cauYMzPH0RDleyDsE3uSx94XFWU2kq1JxzX5fY0p9B7YpXV F54L3lWlxPUI+IdgHE0KdtdR4MTskei+ZIKF1+buux1EYhjA1vYr4mTshzjKTQty+fKF 9VGZ22UsfL014gt1QZitQqdLcHI4dIMTza3ugG0y7IuweRqmtixhnGOYIzoI0dhSs4Dh Uong== 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=RnAEdxIMsOBRs/5T7Ts8em7DhClh/2QoH7on8QJvikk=; b=wMJ5z0xgg14eWWOpK0mbUnI/5tFFdRX6McrbkTszl6v0cIm1YIAlVgoeZw3Cm5nQXw i9C8Q7joY+ljEWCEPopm+jdjWbPmF8i4H09qUv9+Bs/pf8/ICDj6tKuFAD28hZwNH1E9 mzShQ99NXMO4C1IRatBzEI66xr3w1MTS/Z/mWgNV6YaG5rhoJvBJmGSixK63s5aDjZmd lR8t29IoAYITQ8MxtngARt/hCbjDr0TfiMoqogZpyrRpRylKRpyzkzhZzei5EAhDaAlQ 0aHFOhmmiqjX/xa+gatdht4/F2SSnXeXLTks6vK90Xxvg0dVMqSsPxKD8NKClPGqKWJS UeAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GXF77aQ6; 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 i2si588771qtp.398.2019.10.24.23.38.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:38:05 -0700 (PDT) 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=GXF77aQ6; 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]:55660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtEa-00030L-ED for patch@linaro.org; Fri, 25 Oct 2019 02:38:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35346) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDr-0002tR-0h for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDq-0008Ln-1w for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:18 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:33587) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDp-0008LR-SE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:17 -0400 Received: by mail-wr1-x42a.google.com with SMTP id s1so950077wro.0 for ; Thu, 24 Oct 2019 23:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RnAEdxIMsOBRs/5T7Ts8em7DhClh/2QoH7on8QJvikk=; b=GXF77aQ6K7GUQI/DBeGy/kss9IBhyssgrJldSSwFr2v9jQTeLec6jgrWu4A1pB3KCV PcIY1sGkS7rPi2meeAh2yjAEmD8+RbVtJgtrOFl8x8HFKmjTJNPDbl3Cguv/BmmLutqr LHp0Nl3XScG89lEZm6aqjuu9X4y4SrSHfDRscW0IZwJtH2hQfLGkC2q8waMif0qlGQ70 ahUGIA5RLDNpdO1m6tBsfsCWft+h6PqwdFfjBf0oiP9Y+wLKKdT22CvfOMG9YIhOwVAe waB0fnMB9kHkQQiLCZsYVCsijRUtPSqxLM9XbmS0scji1JXQ3ojoBEtCbf/k8I/kar06 eeDg== 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=RnAEdxIMsOBRs/5T7Ts8em7DhClh/2QoH7on8QJvikk=; b=NrE/kNVG35jsPL8PKRdtBDvtIx4KYuIzX9a0gzemPAUHK8BzyhxSm4ZJqtdoMXZYwd PSV2F/JYUEgrfEmOPLK4h1j/palM4aknbH9QLWa06htNvK9rnv3Kyq8FGK5rYzIqrEZw nOuXONdcP+m1kRwYO++mw//F3YpvcdSkkIkt+m3MWce5e8wqYq1QE9fWiM+InXo9QBnU yngb9PTTyR7BwegCPsjQIcFhqj9HgbOPW6lIxP3rFIbfu/SnQTL8j2mRr23J5W0aQ0gp w9qYFuANLyt4S2AJ7DLqzoWrhpRGA7UjsNdTmTwqYVIysukilW02laUQfb+hK9zRcSXm a7LQ== X-Gm-Message-State: APjAAAV5O8W7oG3/0bxIWnVnFfiUr49c3Dhr9SxtnPXfuG3UWQ2z0bMV jRa+z3PtaArXs9noQOS1j0+45A== X-Received: by 2002:a5d:60ce:: with SMTP id x14mr1187808wrt.294.1571985436529; Thu, 24 Oct 2019 23:37:16 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o18sm1555923wrm.11.2019.10.24.23.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:14 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E0B931FF8F; Fri, 25 Oct 2019 07:37:13 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 02/73] travis.yml: Add libvdeplug-dev to compile-test net/vde.c Date: Fri, 25 Oct 2019 07:36:02 +0100 Message-Id: <20191025063713.23374-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a 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?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth This library is needed to compile the VDE network backend. Signed-off-by: Thomas Huth Message-Id: <20191009170701.14756-2-thuth@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 7d90b87540f..7be2a9949f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,6 +46,7 @@ addons: - libssh-dev - liburcu-dev - libusb-1.0-0-dev + - libvdeplug-dev - libvte-2.91-dev - sparse - uuid-dev From patchwork Fri Oct 25 06:36:03 2019 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: 177619 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3234857ill; Thu, 24 Oct 2019 23:41:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxG1V+6+/QFbWC9aQ20BECz6BqQtL/DEIuAyt6d91dq6pVpsEa6yvE9J3eoX5eKuBZ30NM5 X-Received: by 2002:a05:620a:16cf:: with SMTP id a15mr1382823qkn.187.1571985693306; Thu, 24 Oct 2019 23:41:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985693; cv=none; d=google.com; s=arc-20160816; b=tgD32aMWuShl+fECYUbGhG3+EhR6q9UlRS4zZicQB3L57G7qQc0LxzzeLUtKOb/uOE hQM1dKQVdaz5I0Dgfnwf42apI1RuczVXg4XlwBQCiydQqcOW8d2VdrdWCBmVxISw6Dw4 DApCe77aUv7JUgPXUFuZhjvcN7eASpde+JMM1+V+DqazllQ31K5pUWmipuN+qaVZZCK6 cEvv6WXkc5ADoMrENoKJ0HUJhAb6QSs/lESOrPAQhYoydsUB/YuBBS3Ov0FSGn29eSbv kFQTIvo3zkoq1FnBBTyf3NJjoWHewD6cHaOzkedCVH2lpBMeeBxVYr9Vk7HNBudlgcCI 5hTA== 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=4cAF+jXyqILcdqYr8jn1OJvirZtMtT4XAzWjgRvCIE8=; b=OOiOJEFR2xk86LpubQH6F+dhmp30SUq8/qGFfUMQLJ5cajAZxDRiMZKwdra/NsOXm0 wK6/1pC85LbGd+RTWh8BmCUP2QVqc1oFXvC59d/mSp6kdlweHi18WSB+volIS4jkC51R GeUjR+UkRY8aPX1TajVzQMk+7W9ajN19CsP1qlbNBo5KXoS1oiHzEgMd1S8hcHyqPpT6 ipUbm7c9bzzF2PURB2/b4ejRuXAL4UUiu+cCiaROgshpfE0nuVhMZJJIZg8YKBDGTS3y FQ2PdCDU3xH2+TJtT0CwDUQkNWXO+TYRIohB2LXRd9Q8qIWad4FiTz1Y1kxbRaiyV/qN opbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kOFeiEMX; 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 z134si877118qkb.84.2019.10.24.23.41.33 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:41:33 -0700 (PDT) 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=kOFeiEMX; 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]:55830 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtHw-0004gb-6x for patch@linaro.org; Fri, 25 Oct 2019 02:41:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35379) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDs-0002yE-OP for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDr-0008Mb-MD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:20 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44100) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDr-0008MA-Fb for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:19 -0400 Received: by mail-wr1-x42a.google.com with SMTP id z11so890796wro.11 for ; Thu, 24 Oct 2019 23:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4cAF+jXyqILcdqYr8jn1OJvirZtMtT4XAzWjgRvCIE8=; b=kOFeiEMXDYOHwQPfl0kHuMvl4tKU5HFm844orqsJ85Zo6fWzxr46OCGfsNoVngzo4y 8h3drd0lpCuucb8IGu2DyMElEplMsID+fKGbOit0eRkRECyAqAF5EbscrRtlGVYxemEr vdF8azx19nNZPbAMT4G52qtbPpaj/81W3pkGPW4fiOcnXaxnDbSJ1L21sepoyWVS2PyJ wHD+J51Dfs/1txCW2+M0wC9HraRf1DBx/aUTMEbT8eQSa066FrggZxcOzE0SuHWLijzS TMdBdWLRsHN9yAAXEI6Ek+wwlqbGFWE/0KvQ5l2jjYl1aK9SkgaeybQsc1fD6MDnmDyJ m4NA== 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=4cAF+jXyqILcdqYr8jn1OJvirZtMtT4XAzWjgRvCIE8=; b=HMyo99cl2w26utt4hjAhZe36/SSCOpqyXbT1Zfpq4zXpHtwPL+rhlkG6q9Nu3sfVVA UOYMZNrIO/C4EznhS0M4ySU3q4v5T3K3ffMmawBnRYcXUHi9OJxnhTnWL7B56lbEQTRm ai4IiD7rjKgze3LQmXnzdTW37vptmgrf9dmo2QzHHSMqi0D4Mekrd6fTdIQNB8KAGbS9 DttOOVatkwMdQksqgxfc55/vfWAgXJUcwptw+I7aZURskAqCAY7XxTMz+v+8PY91fxg7 fwpJmQvUJAHnqlll9RxM9IojPIsEFaXeFXtgvTEZ5t2Tj5MjFk7VPUsk2f/kBMu320tm jiVw== X-Gm-Message-State: APjAAAUNXHzueYQeRSv3aXZQ7ugjrbLWVthyUbGRwFmDpiODK0trUqHn 5t+xUGE7shlMQ3e6iha4q7cM7w== X-Received: by 2002:adf:e886:: with SMTP id d6mr1329495wrm.188.1571985438400; Thu, 24 Oct 2019 23:37:18 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a186sm1326161wmd.3.2019.10.24.23.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 041B71FF90; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 03/73] travis.yml: Use libsdl2 instead of libsdl1.2, and install libsdl2-image Date: Fri, 25 Oct 2019 07:36:03 +0100 Message-Id: <20191025063713.23374-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a 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?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth We've removed support for SDL 1.2 quite a while ago already, so let's use SDL 2 now in Travis to get test coverage for SDL again. And while we're at it, also add libsdl2-image-dev which can be used by QEMU nowadays, too. Signed-off-by: Thomas Huth Message-Id: <20191009170701.14756-3-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 7be2a9949f5..b446e04e8ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,8 @@ addons: - libpixman-1-dev - libpng12-dev - librados-dev - - libsdl1.2-dev + - libsdl2-dev + - libsdl2-image-dev - libseccomp-dev - libspice-protocol-dev - libspice-server-dev @@ -309,7 +310,8 @@ matrix: - libpixman-1-dev - libpng12-dev - librados-dev - - libsdl1.2-dev + - libsdl2-dev + - libsdl2-image-dev - libseccomp-dev - libspice-protocol-dev - libspice-server-dev From patchwork Fri Oct 25 06:36:04 2019 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: 177618 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3234671ill; Thu, 24 Oct 2019 23:41:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+FOjsXQO92mi27t8O82ntG0bM7z1Si37pjvPnvOXw0KPmuzJ2yGUDx8pDl+byu3l5IwFN X-Received: by 2002:a0c:c3c5:: with SMTP id p5mr1777954qvi.34.1571985680417; Thu, 24 Oct 2019 23:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985680; cv=none; d=google.com; s=arc-20160816; b=vdyiHXNfNOhKj7gBlI8RAcwDik+eaygBn5++0DU7C3owJkETLTPSQR8LVZbllJtllN uxAj9byeo5ub4ez1mgOoeGJ3niFCAJuKEs0sYJn+puCUpu51VjBcajY0XPDy60zTfA0H jFnYeIlV5fY+w7PA/ibOjPFjWjWudMHETwQpaswfucdb/Jxbmn3VdkPzdDBh6Of96Zim pwPzJJcIeNcx+/NUG7kQ2kYSi64hzYr5H0P/eISH807Uev2lD1O5Bx2WQEyt4f9JlGB7 MLhNLvCh7DBVjEiD8KasIC2XxYNUImscwqkmr67r7tKBUeQJg/0HRJY8tvasHPHyMBKY +quw== 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=yblh+Oppt2iwvTtsCKOox3v37OMPEfvHfRdTq2vJFiQ=; b=sVply1rIgPQNblS2ksYsKtqDVJifT+QiprFGa+a3GAeJQ8jEerafQzz0XyxEjKOSsS NkNbzvIYLegdxXwpvNHM9VZMzZ/J47kIruYmh/KLzYIHAyqFPqLbwUzwMR6GeeFqQXDI ATO1nmtA0yGn8xMv87fcjUMIfdo8VOoWyO9/dKijlAANRMJeZvTW10AAlYxAsWZzz1iB wN6G4etqON9AZ2wDM1PXxn52Kxz5/M1ETHZ+iFuqQCJsfy0SzICLuuPmlC2MDPkg6KOM N8nPNnY/mW2SttUJ+BRi49IB+POmDEcoU+71AKHToE9qWc/14/QEPprU/BFRaajX5kYx xYDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=fjWyH5by; 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 n10si709884qtl.331.2019.10.24.23.41.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:41:20 -0700 (PDT) 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=fjWyH5by; 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]:55840 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtHj-0004tw-Il for patch@linaro.org; Fri, 25 Oct 2019 02:41:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35393) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDt-0002zW-AJ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDs-0008Ms-9g for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:21 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:54460) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDs-0008MX-3r for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:20 -0400 Received: by mail-wm1-x334.google.com with SMTP id g7so756191wmk.4 for ; Thu, 24 Oct 2019 23:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yblh+Oppt2iwvTtsCKOox3v37OMPEfvHfRdTq2vJFiQ=; b=fjWyH5byVP69EJAiUClMw6cdLxt3NpFMSoix//VxL1XiNcvMGLdSfI6Pa1lO3KFs2O mKdSzyOGi9jzyl644guVpZTpsySPNoPeMWCr7xaPvTC1pVMAfNE5OcrC9PhTlvk1g1NK bcclD3FGlAkOwdRwJWF/rmq75M3KTGt5CYmOr+lYgvDoLVqLeXLlYKUAIqEoVFi4m4sm dQ1shoY4kBcWhMU0B5IFjLKip6aJHcxsq4NedDpo6dRrgr2vjXIw8sLcqRhEasZi+YY0 p6ZmlqCTVgCQKa8nGGpAbUcZWys9kfObCDhL29CY+s1vFagYSM7sWBIRNCX0+Zgwdv3J UVrQ== 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=yblh+Oppt2iwvTtsCKOox3v37OMPEfvHfRdTq2vJFiQ=; b=YGgqBcCEs9WbW79K71p2rqmpmxO3VVNTRxc30x3ZcoJ3SN6i64Nj6t51RT5Z+DvL82 ie6LZJ/ft2jRGegzIm0eTjiepGXajilL9MCL1bxXhjdrTsQQuSQtPnsPoRUGUOyEpCXT hrKMBBJU991Ber0dLII3xzZh8OM5pFZep6b2QAR0cC9ozBVfBs7pWWo3AQFGw/6X7rLf eacuXW+96mY/EGB4GXj8xXYMAcFfnV14un2n9H6ZV8KUn271SgGZTbtXFxK282aBUuoG EhVytY5iiUgSobzlhEFhbZSgcXmU7Fg/HCJTxeMpUEkb1NMT4bs0MnOPfhnOeWidJzFL hO/w== X-Gm-Message-State: APjAAAVQmlS4xYEWPldlq2mVUIoQcx7AE4uxqBAt828Udz8T8joHDwgS x6gls6n0wuB+gw4Iz1AS7bU1e2My4oY= X-Received: by 2002:a05:600c:219a:: with SMTP id e26mr1884489wme.147.1571985439065; Thu, 24 Oct 2019 23:37:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 36sm3277624wrj.42.2019.10.24.23.37.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A1F11FF91; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 04/73] travis.yml: Use newer version of libgnutls and libpng Date: Fri, 25 Oct 2019 07:36:04 +0100 Message-Id: <20191025063713.23374-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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?= , Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth libgnutls-dev and libpng12-dev are not available in newer versions of Ubuntu anymore, so installing these packages fails e.g. in the new arm64 containers on Travis. Let's use newer versions of these packages by default instead. (The old versions still get tested in the "gcc-9" build). Signed-off-by: Thomas Huth Message-Id: <20191009170701.14756-4-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index b446e04e8ae..e65e53f3d7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ addons: - libcap-dev - libcap-ng-dev - libgcc-4.8-dev - - libgnutls-dev + - libgnutls28-dev - libgtk-3-dev - libiscsi-dev - liblttng-ust-dev @@ -37,7 +37,7 @@ addons: - libnfs-dev - libnss3-dev - libpixman-1-dev - - libpng12-dev + - libpng-dev - librados-dev - libsdl2-dev - libsdl2-image-dev From patchwork Fri Oct 25 06:36:05 2019 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: 177617 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3234578ill; Thu, 24 Oct 2019 23:41:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqysS2QXNJ+bo8mz/5zMN5L5ucISzjte/YHnCY2gi1zuKrcrvX3wIB6kefjDD1VkUEGC5vis X-Received: by 2002:a0c:e982:: with SMTP id z2mr1736593qvn.196.1571985674281; Thu, 24 Oct 2019 23:41:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985674; cv=none; d=google.com; s=arc-20160816; b=kY3Y8OY8ZJi+JpOyXreElIi2DfmJXSyvH9SmEtp2goFTX0DzcHkMR3LLQICYc3221F r7EPG+H96DsRoYajUpHX55ZDn1zXuN1kG6Xfbfc6I0DuDaDECGJJPllBD+9B3VP4MDOP l9HKUeB6X7KAkPvuKghu/cDiWvp/AOYrL86aqdz78qkEBBvIaGTL/iLHSr1t3dM6KLO6 YvDkOmUSuX2r3fnGe8Y3kOZ8w9FDZQq9F2kyfoDkFK14Yl1szAuVZv/Ol4psMRuixE79 Na4oxXt9lKWsWuRqMYUCylxX6aA+MlEAH/QoUp6aSOYsWts65xR7dXjQIZuK9TPHATZq yh1w== 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=HDnFETyoSIS8dCFtwOkMGxSV5Cme4iWm+VQG9FYgBJY=; b=NUMFcXTh8Xy+7oABFoL46rCJAWlhin8+VEVw2OtKg6bz9GOdMxSQu/Z0Z5BMugowoN hhtdiS7OIIKNWWd1v/h3e0TScAWVh3Z7U29QgjhLudLLs02B03aeAX0wTvu9sZvu7D93 47eOhAuojikFyKimFBsZ16i8GS0f81ku/w9cc9WqO/wy7dlB/I8pWq1NYFMH9pujR4tw qCi12qHoe7YnnFpflM07MnUagi0Y8G2JPd8ZcsZw/bDleDbzylsX10BiQxpM74ZTfJV1 kkqkNdJNEUdpKq7D6E+nh8ArmPyjddJYLaeUS1sv9i/HudkDt9s1hvC1Msg5fHByrAA4 XeCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BVJvA2yq; 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 a2si44551qth.266.2019.10.24.23.41.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:41:14 -0700 (PDT) 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=BVJvA2yq; 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]:55826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtHd-0004fS-53 for patch@linaro.org; Fri, 25 Oct 2019 02:41:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35432) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDv-00033N-1j for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDt-0008Ni-Vw for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:22 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40998) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDt-0008NI-Pq for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:21 -0400 Received: by mail-wr1-x429.google.com with SMTP id p4so902806wrm.8 for ; Thu, 24 Oct 2019 23:37:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HDnFETyoSIS8dCFtwOkMGxSV5Cme4iWm+VQG9FYgBJY=; b=BVJvA2yqHYZAiaGEyIppJbFRs4G+yCx49/V6avT4Sa/D/zgUQeoKJiakUZdu3stBEy QoYV+/8yFVQ71uaUzZEyZZpnGuxBl6aN4/9hHDjeLE4TPoNLi1uRqIxoQrFc6EqBXl/6 KolpLIlmKhkYiJ2G0VNF+cVjziA6AAmohYAXo27QUiS6Pw0mOVJIoYOpIypWiRwT4Z2D sQAE+2gAkPm4epyr5jB1M0Mwula1HFBfRA0EsQzLR8Nz2AqzFbcGAdSUS/6TJxCdw+HN 8m9Ht7qHz/O45FWX3DtRvjNb0XV3s0H63EHypDR46CL84DB6DAghqeBgvfWOJ8DYDIHx lHdQ== 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=HDnFETyoSIS8dCFtwOkMGxSV5Cme4iWm+VQG9FYgBJY=; b=p7LQ8ECa8NWWlv0cQ+nPPCqal2c9Itc5fcqvQqa3qu3IRQgI91vU4bfFCpmz5zIAic kpj7eczMzUFoPsPVABV7gilJFmoj5BJuFNhoag0PTAxw5E3JAQy62rkWidwdb2CcFuyG 90PZKNv51a4jam60B59njqXbNChi8BPjV/DdHkdrltP2xi4DBn69gCDuTqUERoF18Er2 iO6NFUrer9y4Ue3MtncMiY2JHEFqURcEakSYcaXfjKLMG2/WrycTtl/ezLI2jgbbvjCK kQKn2X9gVsJ4ga2CPrgBOiGT18hZe6MSJI4I90+jG0TT1LGkqVkvYLnliaM4PAUGNOuJ ViBw== X-Gm-Message-State: APjAAAVuw2PChG4Hr7snabMMTwd1rO1h7kyE6ry6m+hmoJlcgJlApVqa GjaZMK014JCaj/QM47GqWFLmDg== X-Received: by 2002:adf:b21a:: with SMTP id u26mr1300646wra.119.1571985440635; Thu, 24 Oct 2019 23:37:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d11sm1269265wrf.80.2019.10.24.23.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 312AA1FF92; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 05/73] travis.yml: Fix the ccache lines Date: Fri, 25 Oct 2019 07:36:05 +0100 Message-Id: <20191025063713.23374-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The "command -v ccache && ccache ..." likely were supposed to test the availability of ccache before running the program. But this shell construct causes Travis to abort if ccache is not available. Use an if-statement instead to fix this problem. Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Message-Id: <20191009170701.14756-5-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index e65e53f3d7e..7e0d4ad2b31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -91,13 +91,13 @@ git: before_script: - if [ "$TRAVIS_OS_NAME" == "osx" ] ; then export PATH="/usr/local/opt/ccache/libexec:$PATH" ; fi - - command -v ccache && ccache --zero-stats + - if command -v ccache ; then ccache --zero-stats ; fi - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} - ${SRC_DIR}/configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } script: - make -j3 && travis_retry ${TEST_CMD} after_script: - - command -v ccache && ccache --show-stats + - if command -v ccache ; then ccache --show-stats ; fi matrix: From patchwork Fri Oct 25 06:36:06 2019 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: 177629 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3244892ill; Thu, 24 Oct 2019 23:53:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5vM2Wc/GSkEQL+aJoCTwddVQmfuOTQc1XOcSCZwS6drFnUuM6Zq9nASm3AZuz+ykD2IHi X-Received: by 2002:a05:6402:1049:: with SMTP id e9mr1819963edu.91.1571986421649; Thu, 24 Oct 2019 23:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986421; cv=none; d=google.com; s=arc-20160816; b=0PzW7znv60Fbr8qAF/kFePremLTdzAAAgl9Gc8JAmzsQFKDIUiSoOd8ObZHNlWGx0K ETzZi2wQdHbkRRkBTsbm8amb7z+wYcBc2p+l6pYRyi2kw/ymTXMyffbSzSzEKyjFS+e1 1OtH8deDSO9rAl70Cjlnvq/ZS3r1sQyY1wSA57u3jeUbpSv84tNTvXEcose21WHgtJpM WCJ6G4vvyVC1LVaSvpCqFjAg6sRA2872Q83q7b0kFl292lO7lXA/xHou9xaMAvgt/qiZ sH+pqPnTCv1TBoLqMKpVJsN1vhlLbdXRi4X7sFjskrFuAJDEqD5BqK4r290hyoKGsxrv 81Tg== 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=9U6VJzyn/CEOB4/CyQIKZOWv5ZeIvdrRbrpNWyazKps=; b=ro9SqLrulzr6VXS02cXZTqUMdrvQ3QJbpAGbRLciw7gc5iz1YLRKbNecQToXRHOwNG IGgIBbpdN9iK+VnfJI2QTW8iRxgDE8lZpeAsP518mGGx0PQgDcb5LboVlVH0dY3ni3NJ js83svOQf5tTfziUhE0AGZP9FjuKLUrOgKH7HavxdXY5vaY4lJNOwe5lZn4/bcqVLQoR ZIVLu8meHg4QNiZzogKJrmuEZ2xAwZKvMqnUarbwgcTgruzgq0f7HsrtQhQx7ondMTSH 8lJxIvTs536zepf7XHbexUucCDlJgv0qg+58o7Jt/e0tAhNLDvqaw4igcwwIE5AjpgOx b4Uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PfWmAA2t; 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 gf5si641525ejb.324.2019.10.24.23.53.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:53:41 -0700 (PDT) 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=PfWmAA2t; 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]:56088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtTg-0003m7-A4 for patch@linaro.org; Fri, 25 Oct 2019 02:53:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35405) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDu-000312-2Q for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDt-0008NC-0P for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:21 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35097) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDs-0008Mk-PJ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:20 -0400 Received: by mail-wr1-x42d.google.com with SMTP id l10so932019wrb.2 for ; Thu, 24 Oct 2019 23:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9U6VJzyn/CEOB4/CyQIKZOWv5ZeIvdrRbrpNWyazKps=; b=PfWmAA2tKSj1JXHJduG2Jsmf/itFFTtpUPo3EsUmzgOG6c99pe3YhIXT8WpcUxVwPI EvZN0jGdIKyiyi57XAvBVnu45sRAt3iZKVxY1/BOyOC81e1Geh1RMTaS5DCEzqS60rIp OInFlWo3Z3sZdOafLFKiWAxolDgsxgKGH4DrdZ9EHgJgdoQhdWt8YR7IDy8+OV4xojj7 GgA/UV2dtjYg3x55Yy3VvtHsAWNvZnR/5gtBqYLAa6J1ABAHShz3radWhcvUbXTzQg5Z fyGJx1AUjmRkGE+g9+d5U79URcoFLqg8pavtKy7omUcD39PvmrHveYOdklCVXnfZnoC9 BBQQ== 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=9U6VJzyn/CEOB4/CyQIKZOWv5ZeIvdrRbrpNWyazKps=; b=dybksaDBU5zfwEnz0UvuWe/J4sOkbjIzJyvXhW9XYQoHhN+f907aWXb21hkCpuo1QB H8+AQPqQRCNCUldWZS7+OTRM+cWIfzmk3A3JPXBmL/i5hCOf/RRnLitb68WcFMSiwBFv ay0Hgg/5fA1GRDXT3zfwkGbYGTz/jgKoM0RvXVbIB20JO19fDarjcoeS8goNfsiLo3Yo gGyc2X/Xu4+uUA9BUP9+4A9jOeBchXgdFCKLGFbv0+fYGIwcRt5tele+3yI1aMXu6MRz C4iEL7G5hfdccd9gYbZh1C6U7Ndt2qOfbksNxN/Gw3gv3T/6SAiHhOK1f1Mbprib+hQM OtNQ== X-Gm-Message-State: APjAAAW7vo7VTLLD+/7z4GHKC9+KIK99kWhg6EO/3bYOYRRYKEtM0rEj 8E9s2kPHZDl7NxzWqFFjcfSvJQ== X-Received: by 2002:adf:9f08:: with SMTP id l8mr1200053wrf.325.1571985439615; Thu, 24 Oct 2019 23:37:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f20sm1069033wmb.6.2019.10.24.23.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4515F1FF93; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 06/73] travis.yml: Test the release tarball Date: Fri, 25 Oct 2019 07:36:06 +0100 Message-Id: <20191025063713.23374-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Add a job to generate the release tarball and build/install few QEMU targets from it. Ideally we should build the 'efi' target from the 'roms' directory, but it is too time consuming. This job is only triggered when a tag starting with 'v' is pushed, which is the case with release candidate tags. Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20191007160450.3619-1-philmd@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index 7e0d4ad2b31..f2b679fe701 100644 --- a/.travis.yml +++ b/.travis.yml @@ -343,3 +343,26 @@ matrix: - CONFIG="--target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - TEST_CMD="make -j3 check-tcg V=1" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + + + # Release builds + # The make-release script expect a QEMU version, so our tag must start with a 'v'. + # This is the case when release candidate tags are created. + - if: tag IS present AND tag =~ /^v\d+\.\d+(\.\d+)?(-\S*)?$/ + env: + # We want to build from the release tarball + - BUILD_DIR="release/build/dir" SRC_DIR="../../.." + - BASE_CONFIG="--prefix=$PWD/dist" + - CONFIG="--target-list=x86_64-softmmu,aarch64-softmmu,armeb-linux-user,ppc-linux-user" + - TEST_CMD="make install -j3" + - QEMU_VERSION="${TRAVIS_TAG:1}" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + before_script: + - command -v ccache && ccache --zero-stats + - mkdir -p ${BUILD_DIR} && cd ${BUILD_DIR} + script: + - make -C ${SRC_DIR} qemu-${QEMU_VERSION}.tar.bz2 + - ls -l ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 + - tar -xf ${SRC_DIR}/qemu-${QEMU_VERSION}.tar.bz2 && cd qemu-${QEMU_VERSION} + - ./configure ${BASE_CONFIG} ${CONFIG} || { cat config.log && exit 1; } + - make install From patchwork Fri Oct 25 06:36:07 2019 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: 177622 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3235230ill; Thu, 24 Oct 2019 23:42:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqxArbyJKDDvoQy8YVK4JY8qkCDS/fI57IfLAvYA6tJ25kelLobS0B1gGcw7cofVi5ErVBM+ X-Received: by 2002:aa7:cfd4:: with SMTP id r20mr2133483edy.268.1571985724149; Thu, 24 Oct 2019 23:42:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985724; cv=none; d=google.com; s=arc-20160816; b=zMdfO1k8pZBbzI/TT5bfybIa5MNL7TN9WfrCgN4RvHnMEqYZXP81WuUG7G7vVWB2XM 6Nv7K2ddElcG+hGIIA3MLZJZfBr2HDdYpNpd0RzDXGDM3Ux+I+piAavAzEchNeZ4bprj oqZ9RaFg8XzTdys6f8wlg/IKBSleF7/6tq2vlk3kenhQd1z/PMlbXbmD3ye6Jyl+EwYR AVb514T9KIuYD5NihU1N8CcC9bBwZWMkIuULAb6pU0evtQ61ebYebTtn39NLYNQx7sOK WDyHhwgt7uYS/9ctSgfKJhHCCoxrlH6sY3JNnUM3cK0ISekbC64DmhPmz8S2YU6co2aV 9B+w== 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=TdZ5GZorCml1FjL+yJ8DutcSWJmng0qMadQB/3SWejo=; b=cJJEYgMCd7DHloo8XiHeKvGDRClfouut/fGG8ywTNIPA59T9CWchf5rRLBtQEoZiYm Yw74R5Urq9hk+xAQ+73veihh1VXxsYBvE8FoA53Jz+nPaV39YWv37tpVilTcbxv+Y/Ck GFLR1PIDIqEm1O3l8TnLJR2ntVAUryDKVc+05EkhX2GMmiZAgOeSsuNqlHnCpawAHqFf ySxxLn/0D1r0Ihnkan9hC03Xr1fmQA6sdHl7S2kEAc0jEEXlkxGwcR25AbXWSx/6dpC/ xTk92hLzzVFnMinw9ye95hun/iXQT27hnFRXJmnL1npIctO+YoDNeC0KMLnFlfa1o/jJ g78g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=smYSJqcH; 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 x21si605691eda.366.2019.10.24.23.42.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:42:04 -0700 (PDT) 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=smYSJqcH; 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]:55848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtIQ-0005Ba-E5 for patch@linaro.org; Fri, 25 Oct 2019 02:42:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35458) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDw-00036P-3Z for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDu-0008OG-RF for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:23 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40496) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDu-0008Np-LD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:22 -0400 Received: by mail-wr1-x429.google.com with SMTP id o28so910579wro.7 for ; Thu, 24 Oct 2019 23:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TdZ5GZorCml1FjL+yJ8DutcSWJmng0qMadQB/3SWejo=; b=smYSJqcHCcYvobR7/VDxV3lMDqhuscsa2UqavQnx/Hsf/n+vM9Jfjos+eJCmLo10iS l9AD86wO5weQ8gTB+ROzfUd7q729LksArF2SGsL9vZ432037qpvgLVdw/siw71Stnp6T 3cs5D8kVVOxS2rIrsgH220Mgck4SpageQqmZ7JhbARUVEoUl0tN6QerHfU8zP81uHs0/ IdVntJXGT6W3WqPqJtznfbqzfKqr2tmcIqaFxWzxNHYDD5/RAZVeUDY86eXoGYzGVPm4 oEDPDQyxnA2fWw0vOyYj0FvvdAH9R/PL/hbxkAQdTblphZ5CYJFZ1J01pghiwk70BTEJ dB2w== 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=TdZ5GZorCml1FjL+yJ8DutcSWJmng0qMadQB/3SWejo=; b=XMf/nPtt0Qt615gVAeezH/+DGvmW1uNYRGDYi1evjSngydTgDCUTGI5KgFAd7aPkvV KI1N33YMza3vNirMCUj7YXnlFkE0H93HVo+Mziu4nzt5NKpsPL/DIoyVzAcp1B7jnZbc lunG8Jqbq5VJEMtZjBuqVzDAuG1Cg6bGbKvF0i4qewBZKYPKtfpJIz7+RMabHThHMMn4 DCpf7q+zNj/aZ3Y97Oc3X0jHr6B/0O+tqMeXmJkWwsqnw+uARd2M2N9ExUXHX5evitln MWaAkARupzBcPsJZlyor+fT1nlG0TKTKleL1fkutqYWGCpxja51Csnw74a6afX2U+Ecc Fj+w== X-Gm-Message-State: APjAAAVcjfAD204zM0j3/o8yPHSpYRWEeLSQOMtigKjcaG8igr1NyqJX Rvmr1NJJVcswzg7GjfdDaQ/2qYl/gNA= X-Received: by 2002:adf:de91:: with SMTP id w17mr448426wrl.322.1571985441631; Thu, 24 Oct 2019 23:37:21 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t16sm1278343wrq.52.2019.10.24.23.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:18 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 591F41FF96; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 07/73] travis.yml: bump Xcode 10 to latest dot release Date: Fri, 25 Oct 2019 07:36:07 +0100 Message-Id: <20191025063713.23374-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" According to: https://docs.travis-ci.com/user/reference/osx/#macos-version we have 10.3 available so lets use it. I don't know what Apple's deprecation policy is for Xcode because it requires an AppleID to find out. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index f2b679fe701..da6a2063fca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -247,7 +247,7 @@ matrix: - env: - CONFIG="--target-list=i386-softmmu,ppc-softmmu,ppc64-softmmu,m68k-softmmu,x86_64-softmmu" os: osx - osx_image: xcode10.2 + osx_image: xcode10.3 compiler: clang From patchwork Fri Oct 25 06:36:08 2019 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: 177625 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3241896ill; Thu, 24 Oct 2019 23:50:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyEgYqJGSLwQA0XAfMsl5EzNQ129u0HfwGgywIH0COLNyTyRsL790oUXJOXF3Xv6M0SBll7 X-Received: by 2002:a17:906:4d16:: with SMTP id r22mr1938997eju.244.1571986211573; Thu, 24 Oct 2019 23:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986211; cv=none; d=google.com; s=arc-20160816; b=YQSuZtW7R8vx63SLqk3pBPH6YbUw8EdoROAP11XAcbryGloMgwTs+oTGGrSMMlUjhw DGsFtP920B/Um95qRwSuxJT6mJIhMilfm/8WSsTGsG7S27/jSLJBeP8sZE3zRnjJNMrp RJpLU3o9AMTlrpeBzEU9FQvbHcxqgA6RpHCz52TKV/NC0R1isfIr22kEwEn+Qgsv9jJs nNcehVCmsPvu/z0Dn4UxBHWipLDokZtCvEFWwCtd/M/f0fmSgMiMen5EaAmIOmYoompk Dp0x19AWFWvtRyteWrqSXoEJrH5m5zV7jD3wS25cijD0qx8xM1C+W+CEer65LBeMjal7 ujGw== 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=kn+bIv7NEtU84TBVO2Hwfc6C0EcPLqpDAq6Bnw3x5TY=; b=DddJgUwJV6DGFjfo2PjcygrgdrPxBuThAeF60bM+gSX6tNH5Yx9er0OV+ebDU9BMXg a77lPtRSmJwSowqUqja36DTaWK+HxQdZM/T/FM68f6j6yS4s/q/ikbEkGB3u2puXdfLd AivjwFMkV+U9SRsI48z+8SixhATMyGv34598B2PNNbnxnZjBzSM3FPAHa+oTA2v0YJYT kH3UheeGAnBPH7ymIFUs6vEHcLGlNB8rRuI4XfUi4La1kBJEoArxS6LuZUfg2zCOAuTS ZzYwcScm96QCcwPyKsy8W7TYRwShrpOMdL2Ljnm0suREEB6OQ2lEv3pPH3V3autg4qIA zANw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F8cuiAAK; 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 v3si616284eju.230.2019.10.24.23.50.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:50:11 -0700 (PDT) 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=F8cuiAAK; 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]:56052 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtQG-0004v0-UV for patch@linaro.org; Fri, 25 Oct 2019 02:50:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35469) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDw-00037t-Mz for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDv-0008Oj-LK for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:34127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDv-0008OO-EU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:23 -0400 Received: by mail-wr1-x42a.google.com with SMTP id t16so935524wrr.1 for ; Thu, 24 Oct 2019 23:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kn+bIv7NEtU84TBVO2Hwfc6C0EcPLqpDAq6Bnw3x5TY=; b=F8cuiAAKLYadLgs+9qvTXeOTNyVqqKnarEldfKF09/+wzGF/4Mb4dKJhwP4xIfGjky jH9ZVXR2iOT7eupmV4SmpQVx3lzV376Sv7eF5/vulgMHR3O8kIQqam1uRZ7I67SHcBOz 8mYEReEn5UtdJ7NPcw09shfxacvhYYXLq0HPo7sMZSbYahc9DeHNx8JpYA61fSBoxj22 XDpVr7Q4VDco41m63NfM+Xj5ewYxssqg/4b2aIqOsogvwSB/x6rDzkcGYBWE4f8a8HWS En8+a5rw7kEy86yUEi3P7vIiQmt09tm7/HdVFuLmJKC4qSMuubnlS+oLqI9UR/Abm+JL zk0w== 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=kn+bIv7NEtU84TBVO2Hwfc6C0EcPLqpDAq6Bnw3x5TY=; b=cuWr0Hv09C3HLRWvC9g2KCW4h+WEAKNn6F5EOj6RskUsF2YqXrSgfS0hvA1wJvNvof WWxN54eWd0Sus6YIV+CHlWPmw5r+chZL7I11l2miqDB3xlZKUXD0mNMOmKNZp3TVutcA AkExyLt2GFyeumsqbuxKdU2tteE/bRD13Kz1N5+t8AAxEGDoQ8koDcUTKG+nYxNo8ghc 9SrG4toAfNY7llPbwWKAx/Vsv9OjgilUr5sUgib+NBRyHxl065B5LFAKZEJVQVvgTZ3V tnyWvGvDJ7P+cjFAOyyTCRItkM2pazsx0qmw/mmf4amEWPCa9s7Y3XE2fM+vzMShdlA0 cMpw== X-Gm-Message-State: APjAAAV+5KxBFuM8kZFQbUzPjP5KuHdXojzdcwpYRh4yndNGbIradc7Z bIzJuIk+3tlVPdF8pG7A9CKilQ== X-Received: by 2002:a5d:638f:: with SMTP id p15mr1346951wru.150.1571985442269; Thu, 24 Oct 2019 23:37:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o4sm1324890wre.91.2019.10.24.23.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:18 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6E0BB1FF98; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 08/73] cirrus.yml: add latest Xcode build target Date: Fri, 25 Oct 2019 07:36:08 +0100 Message-Id: <20191025063713.23374-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42a 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: Ed Maste , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Li-Wen Hsu Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" CirrusCI provides a mojave-xcode alias for the latest Xcode available. Let's use it to make sure we track the latest releases. Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.cirrus.yml b/.cirrus.yml index 8326a3a4b16..27efc48619b 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -25,3 +25,14 @@ macos_task: - ./configure --python=/usr/local/bin/python3 || { cat config.log; exit 1; } - gmake -j$(sysctl -n hw.ncpu) - gmake check -j$(sysctl -n hw.ncpu) + +macos_xcode_task: + osx_instance: + # this is an alias for the latest Xcode + image: mojave-xcode + install_script: + - brew install pkg-config gnu-sed glib pixman make sdl2 + script: + - ./configure --cc=clang || { cat config.log; exit 1; } + - gmake -j$(sysctl -n hw.ncpu) + - gmake check -j$(sysctl -n hw.ncpu) From patchwork Fri Oct 25 06:36:09 2019 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: 177624 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3241735ill; Thu, 24 Oct 2019 23:50:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0nr+m2wM1kGS/pQkDCDQkpCdVl2ePBZ+phzAPX8zyfBKmZOdLokrIwzJ2rkc8vzmvYuyL X-Received: by 2002:ac8:3711:: with SMTP id o17mr1553385qtb.159.1571986201939; Thu, 24 Oct 2019 23:50:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986201; cv=none; d=google.com; s=arc-20160816; b=SUKmsNf9Uc1MpKJIdClLNUSFCxb+emlSe2oHqkhpVM+fJeOyIaxsCCdYOv3ChhXWZa SDlZmdNXG1IbF799V/g0CgJosfQS3iyJN48OxKhN9Kxs+2LegQDpBXB/aOUcNEfSw8QT 6yFx3UUZlITdezEykwsNbyR/ltAooYGSCD61Qj86Qlun7FJZTPPeF3PSDIrfyju3X7PO zlotQUG4s5zfgKGJW9dH4nf3SjvsJvDDO4QKz8arvoTwDyXdYqd4T4pBPc247CrfIktX yZRhxOLAm0TNbrE+YozU33AhKh77YzIyDYrqCzjL6VCNFUBwI4v4oBzgO/RCjngClnzm IOBQ== 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=iN5buEdDbJrZgM90PFtKMcJHp8iF6WMAPDsVqIM3zCw=; b=zNYd8jgw20Rc7CcPYo6e1haPJgU0YV2OAyF5bY6q2AURElU7pExb4TpT9wLwxcS7hC SPzpKE7orC8WVQQzRX+MRUxiTL3jf640Q5cj2/UnMPXusSYrsD9Qv9ewnWLZ1GOPqmwp gswg85MP6rpOBMykh07PxcNP8OWW40LIh6svPZKcy+hVzn67Eb06XTqNIwfwPWw8k5c8 o0PErLoeFDIsDLnjF5Z48sQKdspM+kVSnNuJR8Nom/rrDFeGFXmfgFkMGownljxTWIcD 8zDyp7ksvDuG/3clKXJXwNrGDYV8T5yN/eLZKlf2n5lLN2JMoF1nh61hMgB8neTcmN34 zx/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=JXk4rt0+; 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 x39si752002qvf.48.2019.10.24.23.50.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:50:01 -0700 (PDT) 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=JXk4rt0+; 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]:56038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtQ8-0004bC-Gx for patch@linaro.org; Fri, 25 Oct 2019 02:50:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35466) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDw-00037N-EJ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDu-0008Nz-EJ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:41481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDu-0008NY-6j for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:22 -0400 Received: by mail-wr1-x442.google.com with SMTP id p4so902815wrm.8 for ; Thu, 24 Oct 2019 23:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iN5buEdDbJrZgM90PFtKMcJHp8iF6WMAPDsVqIM3zCw=; b=JXk4rt0+wUc5a7ZAD818PSrOTtKFtZTCDzJkw/uwVu6v7pMchaP5H67BY11Yn26jA8 jURifZbqvoJd7w9fl/y4WLm+0lpFzYHTRFDSQtcc7MlLoSh1dmA/SdbKYluk4Vjh6zhT i/GdhHl27Sa/jyIGXxxecTuTdaX/YwsNi0Y19u4b0mffgxgZ1+rz3u9FerwifKieCFSa EkwHEPX9RA8nErl4z2KYX0Hy1mrGII5qghNyypVFFp9vsrOSGKbmJaAK4hQD9s6eQrrl BIcGNsUWYNnZjDg2bfWTLEyJpqCzV5rNLQEt3SB0JiRAQhejCmgFbUT2ZiSW+NT4ay1j Wgeg== 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=iN5buEdDbJrZgM90PFtKMcJHp8iF6WMAPDsVqIM3zCw=; b=C9/LOhiuLkVNcqLKr9BOcD8BbDp5/Dsa6/9ncIxCPMvlgvRxe0r+qsbiH0TcX1dh2y imyD2C+CVyUJjFp8CiDU5ekX3H90m6PI7a9mTYTbx6pE+25eAgEIHS1R0S8BBF3ERw9y GPyxRfIsp6eHao+FlKhoO9Ht7h61Yx1SP4VhMtqU4BBpdQxatYChC8YCM9QXKTBauVL/ Bw4DlHAuE77SZAcJJ+IXUDe2sw9BrB2dssySoRV7ah69yxozezDuFzWVQeMTSNB4c0Fr B2icIf3mx3YR3ceAan4f1Ml4usYmrXp91wYoILF+zRKlmCumty4DPdKARLePO9uxynSZ swnQ== X-Gm-Message-State: APjAAAUF/wQtawfEuCCdZRTKr2NYaJbBG366mumyTgcQaQF+ILqEpcoz XsdIQljHsz493FCvj6lNo8K/jg== X-Received: by 2002:a5d:6785:: with SMTP id v5mr1268704wru.174.1571985440945; Thu, 24 Oct 2019 23:37:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t1sm1526630wrn.81.2019.10.24.23.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 862331FF99; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 09/73] tests/vm: netbsd autoinstall, using serial console Date: Fri, 25 Oct 2019 07:36:09 +0100 Message-Id: <20191025063713.23374-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::442 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 , Thomas Huth , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, Kamil Rytarowski , Gerd Hoffmann , Kamil Rytarowski , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Gerd Hoffmann Instead of fetching the prebuilt image from patchew download the install iso and prepare the image locally. Install to disk, using the serial console. Create qemu user, configure ssh login. Install packages needed for qemu builds. Signed-off-by: Gerd Hoffmann Reviewed-by: Kamil Rytarowski Tested-by: Thomas Huth [ehabkost: rebased to latest qemu.git master] Signed-off-by: Eduardo Habkost Message-Id: <20191018181705.17957-2-ehabkost@redhat.com> [AJB: add sha512sum, rm path check] Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index b5d1479bee9..4921e47f9f2 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -92,19 +92,25 @@ class BaseVM(object): logging.info("KVM not available, not using -enable-kvm") self._data_args = [] - def _download_with_cache(self, url, sha256sum=None): + def _download_with_cache(self, url, sha256sum=None, sha512sum=None): def check_sha256sum(fname): if not sha256sum: return True checksum = subprocess.check_output(["sha256sum", fname]).split()[0] return sha256sum == checksum.decode("utf-8") + def check_sha512sum(fname): + if not sha512sum: + return True + checksum = subprocess.check_output(["sha512sum", fname]).split()[0] + return sha512sum == checksum.decode("utf-8") + cache_dir = os.path.expanduser("~/.cache/qemu-vm/download") if not os.path.exists(cache_dir): os.makedirs(cache_dir) fname = os.path.join(cache_dir, hashlib.sha1(url.encode("utf-8")).hexdigest()) - if os.path.exists(fname) and check_sha256sum(fname): + if os.path.exists(fname) and check_sha256sum(fname) and check_sha512sum(fname): return fname logging.debug("Downloading %s to %s...", url, fname) subprocess.check_call(["wget", "-c", url, "-O", fname + ".download"], diff --git a/tests/vm/netbsd b/tests/vm/netbsd index ee9eaeab504..9558a672efa 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -2,10 +2,11 @@ # # NetBSD VM image # -# Copyright 2017 Red Hat Inc. +# Copyright 2017-2019 Red Hat Inc. # # Authors: # Fam Zheng +# Gerd Hoffmann # # This code is licensed under the GPL version 2 or later. See # the COPYING file in the top-level directory. @@ -13,30 +14,197 @@ import os import sys +import time import subprocess import basevm class NetBSDVM(basevm.BaseVM): name = "netbsd" arch = "x86_64" + + link = "https://cdn.netbsd.org/pub/NetBSD/NetBSD-8.1/images/NetBSD-8.1-amd64.iso" + csum = "718f275b7e0879599bdac95630c5e3f2184700032fdb6cdebf3bdd63687898c48ff3f08f57b89f4437a86cdd8ea07c01a39d432dbb37e1e4b008f4985f98da3f" + size = "20G" + pkgs = [ + # tools + "git-base", + "pkgconf", + "xz", + "python37", + + # gnu tools + "bash", + "gmake", + "gsed", + "flex", "bison", + + # libs: crypto + "gnutls", + + # libs: images + "jpeg", + "png", + + # libs: ui + "SDL2", + "gtk3+", + "libxkbcommon", + ] + BUILD_SCRIPT = """ set -e; - rm -rf /var/tmp/qemu-test.* - cd $(mktemp -d /var/tmp/qemu-test.XXXXXX); + rm -rf /home/qemu/qemu-test.* + cd $(mktemp -d /home/qemu/qemu-test.XXXXXX); + mkdir src build; cd src; tar -xf /dev/rld1a; - ./configure --python=python2.7 {configure_opts}; + cd ../build + ../src/configure --python=python3.7 --disable-opengl {configure_opts}; gmake --output-sync -j{jobs} {target} {verbose}; """ + poweroff = "/sbin/poweroff" def build_image(self, img): - cimg = self._download_with_cache("http://download.patchew.org/netbsd-7.1-amd64.img.xz", - sha256sum='b633d565b0eac3d02015cd0c81440bd8a7a8df8512615ac1ee05d318be015732') - img_tmp_xz = img + ".tmp.xz" + cimg = self._download_with_cache(self.link, sha512sum=self.csum) img_tmp = img + ".tmp" - sys.stderr.write("Extracting the image...\n") - subprocess.check_call(["ln", "-f", cimg, img_tmp_xz]) - subprocess.check_call(["xz", "--keep", "-dvf", img_tmp_xz]) + iso = img + ".install.iso" + + self.print_step("Preparing iso and disk image") + subprocess.check_call(["ln", "-f", cimg, iso]) + subprocess.check_call(["qemu-img", "create", "-f", "qcow2", + img_tmp, self.size]) + + self.print_step("Booting installer") + self.boot(img_tmp, extra_args = [ + "-bios", "pc-bios/bios-256k.bin", + "-machine", "graphics=off", + "-cdrom", iso + ]) + self.console_init() + self.console_wait("Primary Bootstrap") + + # serial console boot menu output doesn't work for some + # reason, so we have to fly blind ... + for char in list("5consdev com0\n"): + time.sleep(0.2) + self.console_send(char) + self.console_wait("") + self.console_wait_send("> ", "boot\n") + + self.console_wait_send("Terminal type", "xterm\n") + self.console_wait_send("a: Installation messages", "a\n") + self.console_wait_send("b: US-English", "b\n") + self.console_wait_send("a: Install NetBSD", "a\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("a: ld0", "a\n") + self.console_wait_send("a: This is the correct", "a\n") + self.console_wait_send("b: Use the entire disk", "b\n") + self.console_wait("NetBSD bootcode") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("b: Use existing part", "b\n") + self.console_wait_send("x: Partition sizes ok", "x\n") + self.console_wait_send("for your NetBSD disk", "\n") + self.console_wait("Shall we continue?") + self.console_wait_send("b: Yes", "b\n") + + self.console_wait_send("b: Use serial port com0", "b\n") + self.console_wait_send("f: Set serial baud rate", "f\n") + self.console_wait_send("a: 9600", "a\n") + self.console_wait_send("x: Exit", "x\n") + + self.console_wait_send("a: Full installation", "a\n") + self.console_wait_send("a: CD-ROM", "a\n") + + self.print_step("Installation started now, this will take a while") + self.console_wait_send("Hit enter to continue", "\n") + + self.console_wait_send("d: Change root password", "d\n") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.ROOT_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.ROOT_PASS) + + self.console_wait_send("o: Add a user", "o\n") + self.console_wait("username") + self.console_send("%s\n" % self.GUEST_USER) + self.console_wait("to group wheel") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("a: /bin/sh", "a\n") + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("New password:") + self.console_send("%s\n" % self.GUEST_PASS) + self.console_wait("Retype new password:") + self.console_send("%s\n" % self.GUEST_PASS) + + self.console_wait_send("a: Configure network", "a\n") + self.console_wait_send("a: vioif0", "a\n") + self.console_wait_send("Network media type", "\n") + self.console_wait("autoconfiguration") + self.console_wait_send("a: Yes", "a\n") + self.console_wait_send("DNS domain", "localnet\n") + self.console_wait("Are they OK?") + self.console_wait_send("a: Yes", "a\n") + self.console_wait("installed in /etc") + self.console_wait_send("a: Yes", "a\n") + + self.console_wait_send("e: Enable install", "e\n") + proxy = os.environ.get("http_proxy") + if not proxy is None: + self.console_wait_send("f: Proxy", "f\n") + self.console_wait("Proxy") + self.console_send("%s\n" % proxy) + self.console_wait_send("x: Install pkgin", "x\n") + self.console_init(1200) + self.console_wait_send("Hit enter to continue", "\n") + self.console_init() + + self.console_wait_send("g: Enable sshd", "g\n") + self.console_wait_send("x: Finished conf", "x\n") + self.console_wait_send("Hit enter to continue", "\n") + + self.print_step("Installation finished, rebooting") + self.console_wait_send("d: Reboot the computer", "d\n") + + # setup qemu user + prompt = "localhost$" + self.console_ssh_init(prompt, self.GUEST_USER, self.GUEST_PASS) + self.console_wait_send(prompt, "exit\n") + + # setup root user + prompt = "localhost#" + self.console_ssh_init(prompt, "root", self.ROOT_PASS) + self.console_sshd_config(prompt) + + # setup virtio-blk #1 (tarfile) + self.console_wait(prompt) + self.console_send("echo 'chmod 666 /dev/rld1a' >> /etc/rc.local\n") + + # turn off mprotect (conflicts with tcg) + self.console_wait(prompt) + self.console_send("echo security.pax.mprotect.enabled=0 >> /etc/sysctl.conf\n") + + self.print_step("Configuration finished, rebooting") + self.console_wait_send(prompt, "reboot\n") + self.console_wait("login:") + self.wait_ssh() + + self.print_step("Installing packages") + self.ssh_root_check("pkgin update\n") + self.ssh_root_check("pkgin -y install %s\n" % " ".join(self.pkgs)) + + # shutdown + self.ssh_root(self.poweroff) + self.console_wait("entering state S5") + self.wait() + os.rename(img_tmp, img) + os.remove(iso) + self.print_step("All done") if __name__ == "__main__": sys.exit(basevm.main(NetBSDVM)) From patchwork Fri Oct 25 06:36:10 2019 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: 177620 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3235078ill; Thu, 24 Oct 2019 23:41:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwWzKNzz3EPvueabtGxvkYhh5VLhdxsrw7fSDLuCe0Y7JobT9sJDejDJawZr36OMFbgx8ED X-Received: by 2002:a50:8969:: with SMTP id f38mr2110149edf.211.1571985711796; Thu, 24 Oct 2019 23:41:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571985711; cv=none; d=google.com; s=arc-20160816; b=hjYfzCB9azxKzCRo8R6y2J7Mgt1IT1gK1YEcIZZPQVn99nHgUPNKq5Sj3wbQ6NxdXN pPtk+KOK1z/AcyKYMuaSo1gjc/pJAQE5nqlg0u5yFPUibl5/sSiGHE4gSOQjqzoTA9pz LCPdEfV1H5Tbc/joCemAtXkE52/6JMEKaFxMit2a2qMtj8GfChDTPB1D6dUbBZK/34tU 9fRfE0sxFxMUlTbRcTvvql0vp7oUycBqktozwgb3j12F2PH7tIEtGkJProD1lb49I7zN uI2NeKiRhzTIipjfv25Oj7jOYgCflJVM5SNaV3KQxAavebcCDSSnplSHJX3OA65l4A68 8r/w== 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=7lImME4yU8lQjHY3wQXqs44DBkoFK3uSqvZ6R7jQMW0=; b=pu4QfvN4bNRSoO32OMuqXAevDY0lanDLy8PR0T/xMvD8adIcFSlKPO/5HVcc8hXEtW TYY/UPqpmNZEW5+iq+3yq0b/AXT/J7DtjY3SDsKPyeg9SJT0D7rA1+5ND1DHJXNIdTcx EOcA72hzjzxJUIRaVEfhIiLGoJbgcuYLvb3zW1z1itqmqAW/qmEzlyULhvcGdEz20Cvm NZv860Og5+71An/NLy1SEgCbKOvWlv47Nr3MT0i51CvV1WJQyLaWKa5uoN4Vr1Wdun9b nNJ8yjx86e1QeFXp6gXw/IHHIqhxmFpGG6u66DSgxolvzb2LR2HUPUF8HQ8FtOQRohgb LbfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gdwQ7JDc; 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 gz25si689272ejb.81.2019.10.24.23.41.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:41:51 -0700 (PDT) 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=gdwQ7JDc; 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]:55836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtIE-0004t2-CD for patch@linaro.org; Fri, 25 Oct 2019 02:41:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35434) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDv-000347-8P for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDu-0008Nt-8e for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:23 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50775) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDu-0008NU-2Q for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:22 -0400 Received: by mail-wm1-x343.google.com with SMTP id 11so770392wmk.0 for ; Thu, 24 Oct 2019 23:37:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7lImME4yU8lQjHY3wQXqs44DBkoFK3uSqvZ6R7jQMW0=; b=gdwQ7JDcWrA0gpmlZx20c6JON2HQJ+vy1mn/tvvxbCuO0QfvZblL0ezEI/fbMZv6xI 2pOK3C6IqYZv8POQeR1ax/4kzYZ19IcuywSaqBqOwUz5uaFj+i26O2efRFBkOx1w7JCA lPgYhPVjYCzOqDMSrnqyLTpia9f0ufZyEjtaoJI4GljwaHWvrbQkczfb490Uw412EkYi PZGeyOFg4z1ILZ1lMBQg+NFcQvQtwDgHtANFMvG70szuYy8xdGKSpFU8z+ACeaUGkzKQ a8HUnfruIPgRl18eYe6JgJRgJyZDK2zEbTGKQtzbn6Kcjjm8Yi7KIULB1Tz/I1YDAPUK SW4w== 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=7lImME4yU8lQjHY3wQXqs44DBkoFK3uSqvZ6R7jQMW0=; b=J0KsjES6dqLLBDZi4SOZYCcXZ5Iwn9Al/QWfRBNUqzOgH99EGMmvtZ+9rPRtKz+n5y XUcyBGd8D8vBTMlCGVoNdpTIaO9grz1kNIrXSgbVRiYND6wMXkCDfRA0jvN1xBl9mzj9 aMjoDHh4vFwTTX0wwZwzya8DS2w7wdl7Kl1T0+MDB79oFec86zvQ1VrTowj0WwxWbmT9 sKcTp4kwIEwCFUj69XfX0W0MI9H0l7YRDO1UvTs+JPbDOVfEkNNmeuDyfUp77uXH4zqC eAIPQVAakwoVkq0BoRWbrZGL1Xepwa3RmWSqe9RrJw8hGtmy95OQ3Lx7f56N2N79DPCP 7aCA== X-Gm-Message-State: APjAAAXOCUQI8oXDIBbjWsCj4lj7+zxYw9vr5/6vLfH6JWBEJIFTpEB0 o2wcB3H2dUThAvaSQItv8RZfdQ== X-Received: by 2002:a1c:610b:: with SMTP id v11mr1823629wmb.156.1571985440911; Thu, 24 Oct 2019 23:37:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f20sm1069070wmb.6.2019.10.24.23.37.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 9BE3B1FF9A; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 10/73] tests/vm: Let subclasses disable IPv6 Date: Fri, 25 Oct 2019 07:36:10 +0100 Message-Id: <20191025063713.23374-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 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 , Thomas Huth , Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost The mechanism will be used to work around issues related to IPv6 on the netbsd image builder. Signed-off-by: Eduardo Habkost Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20191018181705.17957-3-ehabkost@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 4921e47f9f2..59bd1d31fbe 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -57,6 +57,8 @@ class BaseVM(object): arch = "#arch" # command to halt the guest, can be overridden by subclasses poweroff = "poweroff" + # enable IPv6 networking + ipv6 = True def __init__(self, debug=False, vcpus=None): self._guest = None self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", @@ -81,7 +83,8 @@ class BaseVM(object): self._args = [ \ "-nodefaults", "-m", "4G", "-cpu", "max", - "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22", + "-netdev", "user,id=vnet,hostfwd=:127.0.0.1:0-:22" + + (",ipv6=no" if not self.ipv6 else ""), "-device", "virtio-net-pci,netdev=vnet", "-vnc", "127.0.0.1:0,to=20"] if vcpus and vcpus > 1: From patchwork Fri Oct 25 06:36:11 2019 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: 177631 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3245228ill; Thu, 24 Oct 2019 23:54:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqx4VZUUJB+6DhimnwmT3XhVfKXDGNa1uurBAaJkCPE/Nl25h7c9yejEy+UiVWqc/hBQhsYy X-Received: by 2002:aa7:d8c7:: with SMTP id k7mr2233284eds.138.1571986446879; Thu, 24 Oct 2019 23:54:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986446; cv=none; d=google.com; s=arc-20160816; b=LN2fSk2N+mcDhQu3e0U5wAjQir4tEW4nQa9lBGJjPgh1Wgrs8OgwH/N8JAnuZTEYbX geH3QOwI8sWgRWcToEcT1ZNlzO0+HvzuRty7yWO/OF/3vGhS4g2pZtyrOS0/R5Ot/YAq L/CBZe0S1kabphff8aQr15WdbSNL5oTY/dPN0j36FhOkhpfduqpyuSOTUPitsyLzU0Iw jH2t5JlYo0YY76kHTs+RekQL1GwkUmva7IhS9jIMsHOvOQoquH0uYkpFqccWTSJHy9Pz 5DLxgANf8JHKesmXx08XIyCxjHb/JsHbasBzuuaGC8CL1b3QGx5JWA8fQkD2Jg1cmULN zlYg== 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=0daDUPmy7VqJtOPnYQKTH35LlZ0A9ZxcamAsZRQwgj4=; b=lCxjPET9rM97ssQXo/4x7+bBKX4msSLEo5FnBU8k7ubP357ZZde/Kyr9XNWLbvLnax zdu1ICOG8WCe8xOkHAIGpat3JXg3mOfIZLn4EeTfnhEJTHm+4rvX4WfnEk45r71/b3cp Wu0zky92PiJEJLtX8TP69k+qReuJIKVUwF7tRQiFhRHlRUkKplbir/DTZi9Zi05yEVy7 1CX0xiXldtQpjwUXL+kB9V59BGRXEw8GWDRG0oeJZY3AeDKvZgBlB89kgPJLrPUS5M8X CRJtj2mMKsstAT9fH2cXuAsEXpk0to6lZZ/y1Q4I0e8tKYaA9eAiDhv2CH0c29v61gYZ aECg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yDqArvks; 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 cw1si646078ejb.117.2019.10.24.23.54.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:54:06 -0700 (PDT) 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=yDqArvks; 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]:56092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtU4-00040C-V3 for patch@linaro.org; Fri, 25 Oct 2019 02:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35490) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDx-0003B0-J3 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDw-0008PN-Kh for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:25 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:53572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDw-0008Ou-Ea for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: by mail-wm1-x32f.google.com with SMTP id n7so761757wmc.3 for ; Thu, 24 Oct 2019 23:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0daDUPmy7VqJtOPnYQKTH35LlZ0A9ZxcamAsZRQwgj4=; b=yDqArvksbhSUaibIWxhFzsUnuES/S1gxKsRTrslnosnHokbP/UCnUbfJOD3r/d4jum ItHMwqAf0Ml8dMm9mbN5VkOXjljJjhc5npwxL42HdP8lM+cOGSQGkPtcLHA7T//z0WIA G7yjJb4hySRKfurFwur0T5gJS1ni59iLXUjdvtb2MtTRYMciqobQPnRov30+XjUuCmZB pS+EZFrnH2dNXZCV5XI++K8e39Q0pZPG3p8PUxLNU04Bw6kHwkN8s/XIgUuUIwJmBJ01 eZUmYg3nrjPu/8g0KO2Pb/NdWiGD+09NsqcJbZdeBK5KjO4BDAIVvR/kVSGRityhQzY9 9juQ== 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=0daDUPmy7VqJtOPnYQKTH35LlZ0A9ZxcamAsZRQwgj4=; b=DQYOun2IzLhceGf5xEU+JRuhQCT8phgY2ssQNLaeWgu4YneuKSn80ioMx9rkBV4LG0 LBd9Z7exJzTEBm2Bc59YklGwe9xHWWTW4uPIR7YbuUw1slv9oUCnyC9ppSW5hYz1wL26 Kj5zzXkgUD4C4FP2GEyVGrQt/+02ycusC4442HH51+zRcqMdGWCuNUwh3u72JwLoXcya DYgfTqvnlGG4IocmrSlrudBm1xjDRX8GTHoTWa9z/eJGpgbgVQR1LadqxxZ9dRyXw/8s ehKSQUxfIh8HeJtXxk7o5TWbrpCLEmHBC9lKPPZRrdD5mOdwV7OQCwa4+UQBqw7SrPCr VPmQ== X-Gm-Message-State: APjAAAVLcpqSQmyE7Q+E5NVZjN0AMWmHRTB96IaPzY1gyfe/0XPlp5ao TRAjUhgqXh4Va9uOZLZmd3MbVQ== X-Received: by 2002:a1c:f602:: with SMTP id w2mr1776340wmc.83.1571985443116; Thu, 24 Oct 2019 23:37:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r1sm1033311wmh.37.2019.10.24.23.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B19081FF9B; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 11/73] tests/vm/netbsd: Disable IPv6 Date: Fri, 25 Oct 2019 07:36:11 +0100 Message-Id: <20191025063713.23374-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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 , Thomas Huth , Eduardo Habkost , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?b?w6k=?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Eduardo Habkost Workaround for issues when the host has no IPv6 connectivity. Signed-off-by: Eduardo Habkost Reviewed-by: Thomas Huth Message-Id: <20191018181705.17957-4-ehabkost@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/vm/netbsd b/tests/vm/netbsd index 9558a672efa..d4dd1929f2d 100755 --- a/tests/vm/netbsd +++ b/tests/vm/netbsd @@ -63,6 +63,13 @@ class NetBSDVM(basevm.BaseVM): """ poweroff = "/sbin/poweroff" + # Workaround for NetBSD + IPv6 + slirp issues. + # NetBSD seems to ignore the ICMPv6 Destination Unreachable + # messages generated by slirp. When the host has no IPv6 + # connectivity, this causes every connection to ftp.NetBSD.org + # take more than a minute to be established. + ipv6 = False + def build_image(self, img): cimg = self._download_with_cache(self.link, sha512sum=self.csum) img_tmp = img + ".tmp" From patchwork Fri Oct 25 06:36:12 2019 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: 177627 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3242264ill; Thu, 24 Oct 2019 23:50:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwl1KJ2eDHKfcCNWJU82QycoH+Z1rBQDrjYbwW7i2pOkDyRiXijahigvZjKGypQTpcsFST X-Received: by 2002:a17:906:a459:: with SMTP id cb25mr1884015ejb.63.1571986236772; Thu, 24 Oct 2019 23:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986236; cv=none; d=google.com; s=arc-20160816; b=jhFA80I3TbrQsQRs7fUWG/jmQxiO8tjXwIsllZGRBM+8n1jy+ZKX0srVgk0b7NXpQ6 wgd7Ptqkd1j4Zytjf6afZuhxYCBFYO/Az02i8H4oPkcGGMaOQC+q/L8Be0LYJReG4Ycf JPYHNOHmnmUBevyxW8AkxTNbFnfNTLbChh4w2stfFTZJo9aOjz7emqPXYfuCGqX18D9W qZTHB8ijtnMds3+2dTu5upZYCZzpWon/gFsNX6uE4b+8hHhShtPh1dN8zBC5vHWKWFak lqivQG7qU6sgSi8nnEUd0UaohprdTjb6O5g70qX1J7NmxdXlohJWnbjhZRF8JcL+OctB xx5Q== 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=KMazBJxRnY0zm7YsZlBAdLDLJgZeGc4MSXDFTtk/xpM=; b=JzhIUFHcvMHZOm4xmqY88+dtfwVgN/qFMimE97C3IBoQ0BGqvmyEOITzDquk5g2gLr BcIBdtX19I20F2HgNdlDDaw0WtKPmQkpVtJM3dSqxi8SxhygLkOKcWM48l+ZUn8u8LOd bAPXnjofN2/oY4IsqSZW+hTI4jL3rN89Qhetx6dvtqnrsZJDy1skceY4A0cEmjPucONs fKqu5MS9wVjUWTdoqimGFih8EDxfaN/KfRyqjBCc9TW5y/78Z99J9xT5bXROCBYUxZrq wCL1ehyIj9rwnQYKZjc9N7BXHcLkB57ztBn5SmOIQlsbUel8Br1Ep6EcfzZH9jBFPd61 9k9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=GNIlXtzB; 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 w5si663481edf.283.2019.10.24.23.50.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:50:36 -0700 (PDT) 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=GNIlXtzB; 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]:56048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtQf-0004tf-Up for patch@linaro.org; Fri, 25 Oct 2019 02:50:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35509) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDz-0003F3-3C for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDx-0008Pd-2y for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:27 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:35892) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDw-0008P7-TN for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:25 -0400 Received: by mail-wm1-x333.google.com with SMTP id c22so765604wmd.1 for ; Thu, 24 Oct 2019 23:37:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KMazBJxRnY0zm7YsZlBAdLDLJgZeGc4MSXDFTtk/xpM=; b=GNIlXtzBhwrtoqWrbFpsN/cIUOXNuxaoT6Wlx7XeTbIUkU50xnhQA3rifiW8ZFXjyE twgwfgFZov1y/s+Eku1PCbTSCp3n8rLw4e0qlTb3O3fCBm1MQDt/GMJ5BuL8PhrwGk4I ZqTMDlq7OlI3kTzqhD1qW72CI6XWs+POtXvI9AXyXWZ5Ib/SbFJD/3LmvwddwmEV5Mkm EgTihJuqaOWnc29OMnPJ0c6OG/HT/OefIE4Ni2HRO3XE/1xOWJSfErPix5cvR9Hro8u8 0HfOWQB30CbBQlhNV+pDiq4RhHR/DvUcVDa2V84MMK4E2M6PEqvETZAVVNAuq4zU3r/2 TA0g== 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=KMazBJxRnY0zm7YsZlBAdLDLJgZeGc4MSXDFTtk/xpM=; b=fulMmq1Yq6JTIBKi71crMD3d6GBTq5zuiviN8PW1K3nRPFJ2bZiy5DGAiBfNONnTtR DIb2fqTR9eYjq1DctEDpsHmPZXdAbw+PkL8uThuRwDbVWBYOaoGd2Ea8slTL88YsIu8Y MlcGyIp6tlWmIN+x8ZIpWFVB64hAob8uG+W6Pd8diWQgMjndWn+e6H2zrWZZGpPvzs20 Xayb9XgEkiht+xF1GgcinNXVQD1u4oiv26qBxQ0UH83wuMdIRKb2Ef2qACJkSOAHcVeO hhgACba2I9X8nnFvXGbUbLF0gTycqPv+4tiKd4qubJ2e8QmCtHc8FtilqOlIxfF5RL/e 0TdA== X-Gm-Message-State: APjAAAWh/0mLYaJDoKh9Kxex9+3FZYA4UIvUHw83NvDbX24AnQIY17HW Zvq4Va6MvMZJyOTtAZJiS1mCtAYeIh4= X-Received: by 2002:a1c:ed0d:: with SMTP id l13mr1876851wmh.76.1571985443807; Thu, 24 Oct 2019 23:37:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h3sm1107207wrt.88.2019.10.24.23.37.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C62241FF9C; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 12/73] travis.yml: cache the clang sanitizer build Date: Fri, 25 Oct 2019 07:36:12 +0100 Message-Id: <20191025063713.23374-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Hopefully we'll see the same benefits as the other builds. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index da6a2063fca..c43597f1331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -189,6 +189,7 @@ matrix: - env: - CONFIG="--target-list=${MAIN_SOFTMMU_TARGETS} " + - CACHE_NAME="${TRAVIS_BRANCH}-linux-clang-sanitize" compiler: clang before_script: - ./configure ${CONFIG} --extra-cflags="-fsanitize=undefined -Werror" || { cat config.log && exit 1; } From patchwork Fri Oct 25 06:36:13 2019 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: 177626 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3241966ill; Thu, 24 Oct 2019 23:50:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqx1PRNhwi8mACfdzDcYPl723P7qWf86sUb4fpVAUaatpDwbQHq+T06vHyejT/fz72mi6VXe X-Received: by 2002:a17:907:429e:: with SMTP id ny22mr1831108ejb.174.1571986215645; Thu, 24 Oct 2019 23:50:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986215; cv=none; d=google.com; s=arc-20160816; b=Hrft2+ureGakDQxu+cCDy7exve/ClJqY5zj9Ebeu6sPsLvEGnw25Nn52paPj2glQta w7Af7a/l++YYQLIxycyJTCs93Ca8WPlszXBiGxhbEueoH2Oh0j6ruzjUbtZPC5I77AW4 Zh5bTcv+zx0C3LeQU1Z4KPMosT+/zTndHiX5E9q67Nv3KOaHJ7TcVF8K/XcFic7f3FNt /JHNck3QcfvHAej6aB5K5Fsf1IA4eExdVULjW273iiQeXZSHaO+XiBbmdP//Pgkd8Gcz FKdbepp3c2WWeeRPI8L46d/h1Rkqjrcb1lf3R0fw/CBzHYbPKJvILL7A++OoF9MCm21B mCcQ== 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=KBMNgmBi7/k8LJ63MGoqOawSxFhttAR/bJdyMWQnEAU=; b=nC5m5sReV+UEr0Zoh2vizk2Z5pfkvBXzabaofBhpN5/mk2GZx3UP9zP6OyfkAcffGy l66DETPwX9rmStbSKwCgDFJPxdnIpGr5OXUMcp2QpjDCwmZzK01fgT9dhz0fuyD3uVcP whqtqd/b8b3MveCXHv2/w+AxQ7OpTdZIEkDNOCurM6hiy5hm6+xgOZ7l/iSpIK+OKpdb 9YQdDK1kM3sm5DT3CNsJyX2HNWcdHWbUpr/DlGOT1t7wfah/6PWfC9vZWHDEh46ZAosW lXoxnEDQjxu5OMJ8PQPY2fwPsgwZVaO7sKK9ZMmrMjDW6WGDDXRKwiYlLquwH1PNl4ZS 3Bog== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="YNdn/MR0"; 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 c30si646732ede.125.2019.10.24.23.50.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:50:15 -0700 (PDT) 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="YNdn/MR0"; 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]:56056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtQK-0004zT-7V for patch@linaro.org; Fri, 25 Oct 2019 02:50:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35472) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtDw-00038H-Px for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDv-0008Op-MQ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:24 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:39704) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDv-0008OM-GH for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:23 -0400 Received: by mail-wm1-x329.google.com with SMTP id r141so754162wme.4 for ; Thu, 24 Oct 2019 23:37:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=KBMNgmBi7/k8LJ63MGoqOawSxFhttAR/bJdyMWQnEAU=; b=YNdn/MR01lP6bgUrABEkCfoZTLgqwbuUnTNet4W8WkH0MSiblfSWPVtxxxRmtt6RF7 PSfcEYAB0/kim6MspgMaUbhXAJv22VYLJtc+6faZgvxg+xZ3xZBzf46Pt0QwPPnMi4mK niu3ZYM8cuD1mH4vnSarQWs5FVnjy0f6qqTPRvtX9rP/+cqzGkT4XJOdpNRkjFwRqFQF zKkf7rHI7rc2DH7DksuUmlaIiGAPRowtH8zvFgSguIBpOEp88zcWju2OIW1ehvt4tJ7L XbQ9+itpWNsQl0vODdHHu+wdIymJXMGQvk4Tg5pPrfPmVp8jxSzyHKvea1R2Jsgguu7F 6MNg== 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=KBMNgmBi7/k8LJ63MGoqOawSxFhttAR/bJdyMWQnEAU=; b=XjxPlbDLaTfyB0Ng6EFVq2Afwe+NjJ5+mA71nIEYY3qThajd8dxPZ7OWK2neNDtC3w 4wxC6NmoJLQPu5TNKprMiItI2DZfaspKDOdS7KYGI84QffdEcPglL3JopbEF9aRVaRlj vDZWldp5V7YE8k21JulUN9Rq0x4kvJJ+OINCS0JiTSkjspeAu0W73G+k1KBSPlSSMyC6 Soo5bF454p4UBtOgbnjlDkOFY6iiG+4MTUDpkfFcbVAk4AHtFZOVIyR10UxuVCpKNl3A RQIrRdcLIyOj3MKxhwHB914lvXguI0LANyPV7KGJWSOehMlX0dqIMV2DMWrkYZDt6ScQ nUSg== X-Gm-Message-State: APjAAAX/9sxc7hdt6Vl2WtmR+FCbKJCga+b7NrWa44zbfMJlvP4INual r3CVEyiBpF6wJM/ONwHQYe3f0w== X-Received: by 2002:a05:600c:2293:: with SMTP id 19mr1829021wmf.9.1571985442376; Thu, 24 Oct 2019 23:37:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p18sm1173048wmi.42.2019.10.24.23.37.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D93CF1FF9D; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 13/73] gitlab-ci.yml: Use libvdeplug-dev to compile-test the VDE network backend Date: Fri, 25 Oct 2019 07:36:13 +0100 Message-Id: <20191025063713.23374-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The libvdeplug-dev package is required to compile-test net/vde.c. Signed-off-by: Thomas Huth Message-Id: <20191016131002.29663-1-thuth@redhat.com> Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed8067f5cf9..be57c6a454a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,7 +5,7 @@ before_script: build-system1: script: - apt-get install -y -qq libgtk-3-dev libvte-dev nettle-dev libcacard-dev - libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev + libusb-dev libvde-dev libspice-protocol-dev libgl1-mesa-dev libvdeplug-dev - ./configure --enable-werror --target-list="aarch64-softmmu alpha-softmmu cris-softmmu hppa-softmmu lm32-softmmu moxie-softmmu microblazeel-softmmu mips64el-softmmu m68k-softmmu ppc-softmmu riscv64-softmmu sparc-softmmu" From patchwork Fri Oct 25 06:36:14 2019 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: 177693 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3298504ill; Fri, 25 Oct 2019 00:46:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS6K8ogg8VHCVAbfGV0G+Phjdr8wlcimA3pEznMvWdTuS3LUJnf2+J4ylTYfSAYQ/nAeq7 X-Received: by 2002:aa7:d6ca:: with SMTP id x10mr2370680edr.27.1571989568706; Fri, 25 Oct 2019 00:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989568; cv=none; d=google.com; s=arc-20160816; b=e8K2Km9hCVEHm8HDk3cfmfoCJJnROnLiw2fkuKXE+MdRXmDqCq/H3u5L1n0wqH2xAr nrfhvGQHrWa67aAmQujkyDOk4HoY5U6SozlzdYXstGLIMCkefFsu9tmyHuhcy4LqUpxs LB+o9b8k7Is7M8MA7WC3j7W1CMNEW2rq1t9Yoo0tdjQnsnLj5d6RzNsqEL7dDfH+x2JR /wWV1MUXB82j6gflHfEdJjTpFI28a6i7PLfkhYmKWqz8qlFAC2vAJ6xz2+GG9YJEcUVw UWMUkt62kEjyqQ642s+iuDr3X1McbGs02bo/K7JEQvRrJ3rM2c6r8he9Xz6eTdkv4dIb k3ZQ== 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=yaLEb0Rvga8cR2LHsL8/9HPdNDQgpcbnXqsduwaSFKE=; b=n+Ec7yy3nvjrJgEQXiehH5zl57dwnhuwvL0DFg8xJyyiB4qKjC/R9F/Xo8PrEEfozH Z29zMNNrXRDHlwXowgTGqaF12TCSx3N/mEf5SgZLbm7ZqACwf2Ooeoqrt38RmnVtG8ir s4WWtJlBx90q/VsUMKYP1Y2ooQt1P1WM2GZLpF7ROKc7Gul39JK3J8E9ZGw2f4zMwhEP uWxwIKiVPS9kljJTOjcr1i9ghbjYi8qnaxljwyEt2eJxCuoDr0PikVxWSCubdOliciU2 aj9W3G6eUfV9AD+hgsRKj4Xs4KSLdnZAjlnu1SjhMBs+aH6dYuX5jjin0EREnnRdOvdn Mz6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=DV92W8iP; 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 v46si697784edc.295.2019.10.25.00.46.08 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:46:08 -0700 (PDT) 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=DV92W8iP; 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]:57072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuIR-0007iu-EW for patch@linaro.org; Fri, 25 Oct 2019 03:46:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40390) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpw-0004bY-IG for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpv-0007CC-Eu for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:40 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:39315) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpv-0007AG-8v for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: by mail-wr1-x435.google.com with SMTP id a11so1027979wra.6 for ; Fri, 25 Oct 2019 00:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yaLEb0Rvga8cR2LHsL8/9HPdNDQgpcbnXqsduwaSFKE=; b=DV92W8iPJYuVhcCjjEuUQvuwknYl5XIvSo5IFuKq5r9+4se8JE0RWiCLrix3S1jtH2 UanMOA9+tujGwdwXmiacX8JB6ym4jnUUDhRtIK3LmMRm+bZJtOyoipigzbgIE1oh2gOj eE2L2rxQV9nmBPWszHXf3c3tGMveftqixh4bruf3F9LDsqPkPehX2zQOZ5Pm5oFdPh43 5D1IvKREsw7hovtZKZ346Qy/0X/+V2a2NhRR3US0OoDkPDRcmD+xN4y/rNpWBlN7JcV5 ox+2ip6sFAc4QuDxuiV0djUrezOP40vDXUfwzlAcy05+rv44wBtfsxsO9w9wjQ5oPOp2 5gBw== 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=yaLEb0Rvga8cR2LHsL8/9HPdNDQgpcbnXqsduwaSFKE=; b=P4DrSoO/mi8MUrcr/kWIg+0zf44qVeADqKlZcHCIpNlRF05mUHRVKFxYRgjSvFNh5x xJnUcXijq8HpaQ0ufuAmzeUMnxu+z7lscXAYZ0nXip1+xpsmBQy/aqHLeOPmV8t4djQc 16aiqdBs1YcqPWKzfOtsQ/GaQCIk7W5/fHKfWhXN49/1kOS/ukRAZ2jSlzoKU/2WYbPT uhRos4iMT50oNEMMww+jE58FjxkubyoxObtqFgYNOX1hpxX2l9I13lUAYK5bm6BviDFl R9Fx/iLLfLA0bJ94KcAb6I6d0ZIvrOM7LS3LABF7OhpY/GyjMQ1vpbYxkvb2nGukBpM5 F6rw== X-Gm-Message-State: APjAAAVIVl+sL4R0tzpuqgzUL5DuwWZH9sd5giglABa8QIn0yKFiQD5n jN+P9FRgVkb8S92saxqO/359JQ== X-Received: by 2002:a05:6000:118f:: with SMTP id g15mr1371829wrx.242.1571987797740; Fri, 25 Oct 2019 00:16:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g184sm1762554wma.8.2019.10.25.00.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EEA481FF9E; Fri, 25 Oct 2019 07:37:14 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 14/73] travis.yml: --enable-debug-tcg to check-tcg Date: Fri, 25 Oct 2019 07:36:14 +0100 Message-Id: <20191025063713.23374-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adds a whole bunch of asserts which will catch bugs you might introduce into the TCG code. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index c43597f1331..ba3a8d4cfc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -334,14 +334,14 @@ matrix: # Run check-tcg against linux-user - env: - - CONFIG="--disable-system" + - CONFIG="--disable-system --enable-debug-tcg" - TEST_CMD="make -j3 check-tcg V=1" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" # Run check-tcg against softmmu targets - env: - - CONFIG="--target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" + - CONFIG="--enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - TEST_CMD="make -j3 check-tcg V=1" - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" From patchwork Fri Oct 25 06:36:15 2019 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: 177680 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3286090ill; Fri, 25 Oct 2019 00:33:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPvF57M1P/qnsiSs8R1t9OTXOdEG+iv+Vf50Cw3u26eX38rmymvcCd9QVjSbq44byWHgzP X-Received: by 2002:aa7:cfcd:: with SMTP id r13mr2404576edy.146.1571988831983; Fri, 25 Oct 2019 00:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988831; cv=none; d=google.com; s=arc-20160816; b=sB+JbLWye0ZuncmYVX87thdWXspjF2Rn1YR9Ptyn7PKht3zMjDpMLb264asKTsOlg5 r0hGV/liyfGJ6OJcLm1dzjLN9/KnWLJG8PO3wnUYzRYkxCjj6oYKMY3ddB3rTQOnE90q gNZhfCvipy8LOANldnelMWRXNqG4KfHi1guYfQHb6O/Qerodnb67G6Z70wOuMTcZ1CDE nP0V/o5hvvxWzs8kOcteSPLezzotevD8mwC79s1wVSkU+kI874LEZratiYr+UchvEDRk ubE+P2fttSnJVjTEytufMqzh/KZ95eERjwdeH16ymyflmL6Qsou0nskB6/pMrZTWfnJw QDnQ== 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=5aMWHoUAPHVKIGtZD9kL4mkNdNLEvsYrFkunGwuaRjU=; b=Crm+6SOpTn/l/mijVffwXsHJjOSRf8P2k/fIVT0Btys699lonVvCvkN1N0XPlp7JcM d2Cz2jM0c2UxYw0bzCFAtIcIrW1MDeCFOUojFFnN1HgMQ9nobNXD0fAHmju+I7pja5xX Sc3mhD+2/U6TjLjXNV9ZxusfMEx7tvu8hgZJLhYkHmVjfmRwk99heiGHw9HuBbO+NeOX dnffjiNTsvegwvHBpg0a4MMeFAiludntC5XWtrG+7H5ERswbWeHEQTreV7O1uWUmfs6+ 8xCb9JAO44oz3wWT0AQa2I1cYaVZt+e9suNS2pKV0I6Sn/pfnMX3IZoCoEVGYn5L0SvW J6HA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=baJW9X1q; 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 x12si294925ejj.247.2019.10.25.00.33.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:33:51 -0700 (PDT) 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=baJW9X1q; 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]:56872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu6Y-0001No-5o for patch@linaro.org; Fri, 25 Oct 2019 03:33:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38155) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWX-0003GL-4Y for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWV-0007c9-VF for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:39143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWV-0007bB-P6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:35 -0400 Received: by mail-wr1-x42c.google.com with SMTP id a11so966874wra.6 for ; Thu, 24 Oct 2019 23:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5aMWHoUAPHVKIGtZD9kL4mkNdNLEvsYrFkunGwuaRjU=; b=baJW9X1q2PsP+D1A+AAMaHbouFbEl87zioirgbS2MZAZWNkLaw7J1TwUhiYEO4FQyQ ImNNHmDzoPC5satXnWI8zLqfDMSFEUedmpx8CltG4I0ZjJnqix8aqd5vXTqeIAL/7u2f q1FXaJpIT4gCnJtnUBmyfLfUtUJvfW9dAL7+6BPbjDOiIrjcTLmBaSlzFWwbCEGWzo82 Arnz6mdDGFGs5pgo9TeXg95UjzC+rcSc3etJGe8dsHNsWVEZiaQwQwhfichrpitJHR4j +7TO60ZG5m7R/Y6/XlxrXxrOWne+azGpdbmZcRGdflawHqwJwaTa5I9ylNjJtLF/1ftS wUDQ== 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=5aMWHoUAPHVKIGtZD9kL4mkNdNLEvsYrFkunGwuaRjU=; b=mlpw1DDrkMuAnFAH3h7jZnUAV1xBDoCFcPjBO7/iUBaPwQqzag9C27Q5wfuVKMgeuW kJsi0TX9cPIiexOBiuI7opyrddQIZCOZiUhyMKA5UMq8ceAZ2gBepRmxyeBxDbKS7Ut/ 9ctff/aumFf6OaCsh1pUPePfsewWnSFthLUtFC32CIiHwTDI0zb94THEn4JtWb++d89G QtnZ4o5h7oqUXZi7SjIwKkDBb01KPqafu9M0QpL6NIGSXTki/haEcto4+pG3dpD7G4nk wV79VnE8P6wI4Ycf8oSVSeFOyKnWsCg3C/JKkrNlXOhtosRILWsgzmwDh4a+P7P58J2W a4vg== X-Gm-Message-State: APjAAAWUOfYBLW4dnvzkmCmps0TTKua0xS4wv0Ybg3tAdCaAVgGi73Yf 24urtKwsj2AOZzLJWBgbiQWtLw== X-Received: by 2002:a5d:4a8a:: with SMTP id o10mr1358573wrq.101.1571986594167; Thu, 24 Oct 2019 23:56:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z189sm2007437wmc.25.2019.10.24.23.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 119AA1FF9F; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 15/73] tests/docker: set HOST_ARCH if we don't have ARCH Date: Fri, 25 Oct 2019 07:36:15 +0100 Message-Id: <20191025063713.23374-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" As the docker rules want to be able to be run on a virgin unconfigured checkout add a fallback and use it if we need to. Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/.shippable.yml b/.shippable.yml index bbc6f88510f..f74a3de3ffd 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -27,8 +27,6 @@ env: TARGET_LIST=ppc64-softmmu,ppc64-linux-user,ppc64abi32-linux-user build: pre_ci: - # usually host ARCH is set by configure - - echo "ARCH=$(uname -m)" > config-host.mak - make docker-image-${IMAGE} V=1 pre_ci_boot: image_name: qemu diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 89c56a3a88c..19dbe261699 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -2,6 +2,8 @@ .PHONY: docker docker-test docker-clean docker-image docker-qemu-src +HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m)) + DOCKER_SUFFIX := .docker DOCKER_FILES_DIR := $(SRC_PATH)/tests/docker/dockerfiles # we don't run tests on intermediate images (used as base by another image) @@ -88,7 +90,7 @@ endif # Enforce dependencies for composite images docker-image-debian9-mxe: docker-image-debian9 -ifeq ($(ARCH),x86_64) +ifeq ($(HOST_ARCH),x86_64) docker-image-debian-amd64: docker-image-debian9 DOCKER_PARTIAL_IMAGES += debian-amd64-cross else @@ -106,7 +108,7 @@ docker-image-debian-win32-cross: docker-image-debian9-mxe docker-image-debian-win64-cross: docker-image-debian9-mxe # For non-x86 hosts not all cross-compilers have been packaged -ifneq ($(ARCH),x86_64) +ifneq ($(HOST_ARCH),x86_64) DOCKER_PARTIAL_IMAGES += debian-mips-cross debian-mipsel-cross debian-mips64el-cross DOCKER_PARTIAL_IMAGES += debian-ppc64el-cross DOCKER_PARTIAL_IMAGES += debian-s390x-cross From patchwork Fri Oct 25 06:36:16 2019 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: 177699 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3307869ill; Fri, 25 Oct 2019 00:53:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5xIntY/JN/24xfF6C1vm0bzjzg/U+TZ5Gp0KHA0RM39qaCsqpVEStYjRdWGcdahK3JZud X-Received: by 2002:aa7:c587:: with SMTP id g7mr2398501edq.151.1571990034429; Fri, 25 Oct 2019 00:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571990034; cv=none; d=google.com; s=arc-20160816; b=EdoAUVkPhf1YXBp0wfSOXlmQMdQc7wdZ1OpU82G4zJ7iL+NufpTdyjBNJCJ7e9FDCw /1iPKkkVmhiI/vhgdoz35RmW58v9q8WVNbcGuSslGCVktOm0CZ8BKLyRpi4LrdUvalUY L73fypM24iaaiiyqHmLVX+IGJVbYwIAZ6BjvkvSwgjwE6xZ6/AW0W/EElofzRHRW5jK5 bn/5Yoc4FvYO0ltrFpTZdmCxZh0/T89BCo2Yrz32QK/dfCJpa0jtbQWpkgS8sa8Q+CSV presGB/eijpu03H/xrNwvKXq1XfBFxwTB41ZzYdlr2yZt2tgAUeRVylarn/QRDTVFmwa PDvg== 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=71jlC4Z8g9Q/EoUX8xnqEL9oQfxujIcEuUZtk5+Z8NY=; b=UW2X0Y3Cpbj3pQogo9VmPowOnrM5d/0eZgMpV63SmZo9geLX81ZFMpzmbBEuv3ayJw Loq19OnjuWI+IbvttsIK3syXrGT/6+7QBH3TuizC40lMc0J0Cm8OKQ+qlRUPPndAXfEd y4NzO/mx8F1kf/FcefiKIg7mzNd4LSxwtOyv89cuKHLeUZX9YtITE6zx4n5Fy4h9LL5P /TiNMuR3pbRcpWOcwpThOARcDO5aWOo2IRQvwBOrij5vX/Yb2VemZuLi2Ig2wXcy2+y7 N1TVyBjWxlL/f/CgxJg7Tv7SimrqfDUZZgYQWbaZWsxJA/JM83eKWfE0AmCCBe9gxfLU vuMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Pr6ppy9U; 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 d44si766183ede.149.2019.10.25.00.53.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:53:54 -0700 (PDT) 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=Pr6ppy9U; 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]:57212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuPx-0007yK-0m for patch@linaro.org; Fri, 25 Oct 2019 03:53:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40476) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtq1-0004jc-Aa for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpz-0007FM-T6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:45 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:33463) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpz-0007ES-Mb for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 6so3596141wmf.0 for ; Fri, 25 Oct 2019 00:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=71jlC4Z8g9Q/EoUX8xnqEL9oQfxujIcEuUZtk5+Z8NY=; b=Pr6ppy9UpYTjaVN47IQ8zuN+NmWFcUAUJLPDCGsPpJCHXwOjo4FSKpG3I6iw/0wA6D zkJfSG5Oow1GkYuJamGx6lm94nmBwDWKs3hk0kG8bYcid4Ogj/+uqX+Mvnezb4bVxkLr kb/DNfhRJS6VoiaPPNvAYTRbFxHtEFQn0V7qo4gUXoq5vG9bq/DrS/liqi7XvD4Fhek3 H5p9yyP/Gd56OClOzxqUBSAK6cP5OTQAAGzlO43ZK/kfgf5nBzMvhNBhezTH4W/WOKUF GsiE9EKDlebEifdI+oc5x1HCW6CPgHog1VoLENnkOXM4FvYxZZCsKcnuYGmiXjWUNHPG 1ksw== 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=71jlC4Z8g9Q/EoUX8xnqEL9oQfxujIcEuUZtk5+Z8NY=; b=A+EQsVWyGgljmQD8yCoaH3PXz2JLrECEnT1ntdDj+4TwDIHdETymd+DX6DfBalPz9p opCeTbLBT35kasQ4ZWkXEYbhbl/nhtlwTAM0bVVfajOFlcp4OjjhZaVQjDFBYspniOm+ eT63ICGKyK97bezcEe2BqOOTiOSEQXDMXP68pZCuDFBnxQQFwJupEg9DRU8KL7+l7ibQ xsmZIw5+YQ1SnXazhiNsI91mdl//48cy49uAAPKNG6/Vtk1pHR7VIKT3b7LQ5OE8G/AM 4CrUeI6NFegGNgGI1JPNdpuaQSDTkaf+neUmNy7nnxT1PulOWy1aIx3BZjCVemQ6ArL9 aLmQ== X-Gm-Message-State: APjAAAWH3eUfeWa5wcI57/SEnYeDEPZJN+9Bsq2uEVZI/HYnvxTkPeU7 TGAckkTPHOR9cXnyusIl6pU5lA== X-Received: by 2002:a1c:5f42:: with SMTP id t63mr1888031wmb.163.1571987802599; Fri, 25 Oct 2019 00:16:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p12sm1201236wrt.7.2019.10.25.00.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 27B0B1FFA3; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 16/73] tests/docker: update Travis image to a more current version Date: Fri, 25 Oct 2019 07:36:16 +0100 Message-Id: <20191025063713.23374-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This isn't the latest one available on hub.docker.com but it does match the ID reported by the Xenial builds running on Travis: instance: ... travis-ci-sardonyx-xenial-1553530528-f909ac5 Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tests/docker/dockerfiles/travis.docker b/tests/docker/dockerfiles/travis.docker index ea14da29d97..e8eb48dccfd 100644 --- a/tests/docker/dockerfiles/travis.docker +++ b/tests/docker/dockerfiles/travis.docker @@ -1,4 +1,8 @@ -FROM travisci/ci-sardonyx:packer-1546978056-2c98a19 +# +# Travis Image - this is broadly the same image that we run our CI +# tests on. +# +FROM travisci/ci-sardonyx:packer-1552557266-f909ac5 ENV DEBIAN_FRONTEND noninteractive ENV LANG en_US.UTF-8 ENV LC_ALL en_US.UTF-8 From patchwork Fri Oct 25 06:36:17 2019 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: 177662 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3277561ill; Fri, 25 Oct 2019 00:25:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqxb4PXblF6lCJ0LgDvV+mG0k2uNDUJDXYp3cZt7hDoCyoRIdmXeaIR4v4VbY2htgms2R/7e X-Received: by 2002:a37:4ed5:: with SMTP id c204mr1505480qkb.41.1571988319001; Fri, 25 Oct 2019 00:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988318; cv=none; d=google.com; s=arc-20160816; b=lcgxng5CNyOKPcwJWqicMu5y1ef+yZAVLeQa0EmGo42fBIJTu0UqBD4CHnYYZiIJle k/H9T6AAXQsBdrzPy09UClRdZKj4WUYahilVuMvPq0+kmEr6LJQMYV5HVNEdJXPPazv0 oGkH5Whz8dVpYKwjqKa1XeM4OF/cUVTwkXzRYHoZBo6U2X1oPZWB2IJMliNxGST4icFW fu8TJE3NxMIBEpjLXV+HjbsEJgMYM6LsoERxu788Bo5/EmjzBZnZzKyTjK+rGJgODfYB VKp/nTOLNo/MaSlGuJMinbH4CkAdBxrUhGhl1HSt6X3BR8U8XKNs4gFfVTknZhEAAeZ4 BZzw== 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=p0/8VjboGQtbPpCK+UTcACIJfDHT1FU/+NDtOrh1cRU=; b=HNXWUNvts/6TP16MTGZmBnp7gthu1S9j8AHHyKZbqCmTPFz326HocyUSaYjfCGdW0v IcRJNZcEAkbYh6WH/s0RpvWQmbtfc9o/WiPT47AxI4yhM2BIfx6Q/aULfjgW1jeyKma6 PpxWOMyYxBHkpevLcJxQonVor1QY35BNOLI3HAhZbUMEIL8hIav7fgsRv8Vf9jPFEXDd QJK/PgK2s6VrpHZXMIcQuMu00tm/wXeBdianozxBVGLBTePlwtSKLX697wPLlD1RS3oh Yi431MdaWkZVlhobkXsuHvBd7hB88T1xsxUuVF0SnocY6nUI8C7uwoqgWlayxbjF4WaA D++Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UH1syymH; 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 h31si735668qtb.60.2019.10.25.00.25.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:25:18 -0700 (PDT) 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=UH1syymH; 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]:56730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtyI-0002ST-2s for patch@linaro.org; Fri, 25 Oct 2019 03:25:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37075) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN8-00088S-2l for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003Hv-Ul for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:53 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:33656) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN5-0003CF-Dc for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x42c.google.com with SMTP id s1so974280wro.0 for ; Thu, 24 Oct 2019 23:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p0/8VjboGQtbPpCK+UTcACIJfDHT1FU/+NDtOrh1cRU=; b=UH1syymHb6VlfpNc/Fvk498HXtLxWtZHl8uMAjiOK4ti5GKPYnf3oIm0BhMjlk32pN YeLShB4srmVpebIh6sPLhfGJRc9nWtEscpRK+zG9k2Em8VVowsYNADs2Gmx9YQ+iiVu3 s0x8MHya6eKWbXmJeDF+Xqv3sNOx/lOM+TIO5P1Q9c2ARL/dKztbhy5qmJClUMnkOzaL 5+Eztr+SnyIzePoEqD4t45UOYqI6buTX+VWevBds1e6R5LI1AOHtAvmsby/qkSfmgUC6 HnWHC0kD/OQC0CZKIIfUo1raiA2bDiZGn2jfOmuOQ92ij6/GgtixKYmNiXC+lHXGbQQk MzKA== 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=p0/8VjboGQtbPpCK+UTcACIJfDHT1FU/+NDtOrh1cRU=; b=LfUVs58pDlWhMtDGJjWWsp1UeLyWmryADzGcRfcBqyTjHY6FdXX06L7Cyn9hufd9AH 75tC5ukj3Pz5Xqudj6GiUHI5mND4LhE5cogKGFUM07hqaq9b84MuZO399ThoORqXhUq6 shfYt1sgkq1nopWQ6KtvKopdGOvQUSPv9XJkzMErkU8z+Kvn0P7k6vnjbM/pStI6ZtJf OQ2ggU9T3OKo7oYStu+t9uK4n3V3JakqUqiJ73unM2vTPRLxtWLekGGEl0XG5nxZKFv7 9MY4Nk8NkmQgt31tMoup+5uChFC1Xd0aotmhw+ugdYC2fo1Ew7/dr6kYJRhH6pXavwqw lLpA== X-Gm-Message-State: APjAAAUeuJcytMJRH3xnElIpEJ4S9OZk8/yBSitR27ptBM7DMziCWpVz nkTPR29ae85vbY/me2koTDgxpg== X-Received: by 2002:adf:f54c:: with SMTP id j12mr1378225wrp.182.1571986004315; Thu, 24 Oct 2019 23:46:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t13sm1280482wra.70.2019.10.24.23.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:41 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3E29A1FFA5; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 17/73] trace: expand mem_info:size_shift to 4 bits Date: Fri, 25 Oct 2019 07:36:17 +0100 Message-Id: <20191025063713.23374-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42c 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: Richard Henderson , "Emilio G. Cota" , =?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" From: "Emilio G. Cota" This will allow us to trace 32k-long memory accesses (although our maximum is something like 256 bytes at the moment). Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota [AJB: expanded to 3->4 bits] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/trace-events b/trace-events index 20821ba545c..22133dfd3fa 100644 --- a/trace-events +++ b/trace-events @@ -149,7 +149,7 @@ vcpu guest_cpu_reset(void) # Access information can be parsed as: # # struct mem_info { -# uint8_t size_shift : 2; /* interpreted as "1 << size_shift" bytes */ +# uint8_t size_shift : 4; /* interpreted as "1 << size_shift" bytes */ # bool sign_extend: 1; /* sign-extended */ # uint8_t endianness : 1; /* 0: little, 1: big */ # bool store : 1; /* wheter it's a store operation */ diff --git a/trace/mem-internal.h b/trace/mem-internal.h index 3444fbc5968..1a010c1b277 100644 --- a/trace/mem-internal.h +++ b/trace/mem-internal.h @@ -10,10 +10,10 @@ #ifndef TRACE__MEM_INTERNAL_H #define TRACE__MEM_INTERNAL_H -#define TRACE_MEM_SZ_SHIFT_MASK 0x7 /* size shift mask */ -#define TRACE_MEM_SE (1ULL << 3) /* sign extended (y/n) */ -#define TRACE_MEM_BE (1ULL << 4) /* big endian (y/n) */ -#define TRACE_MEM_ST (1ULL << 5) /* store (y/n) */ +#define TRACE_MEM_SZ_SHIFT_MASK 0xf /* size shift mask */ +#define TRACE_MEM_SE (1ULL << 4) /* sign extended (y/n) */ +#define TRACE_MEM_BE (1ULL << 5) /* big endian (y/n) */ +#define TRACE_MEM_ST (1ULL << 6) /* store (y/n) */ static inline uint8_t trace_mem_build_info( int size_shift, bool sign_extend, MemOp endianness, bool store) From patchwork Fri Oct 25 06:36:18 2019 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: 177672 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3283057ill; Fri, 25 Oct 2019 00:30:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqytz8sP85hcHo+8PRoo/VyHaChdCPFkrM//KdFkq7VT10Yw5PkxL8sByVQuHLRdz4BKMmaC X-Received: by 2002:a05:6402:4c7:: with SMTP id n7mr535272edw.263.1571988657325; Fri, 25 Oct 2019 00:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988657; cv=none; d=google.com; s=arc-20160816; b=gkrLgm4hM9JvxEZSBbWAlF9aFTTPvUNY9qCt+u0VD7GAaG0GReUccBJ8BQ+r6hbvx0 QMobyF9luNL2GCsS+9CjSFPCsBhs+vyCLbY0HultU+6JM5OCebpa5YfQWvcL0mQspK3N U1oL6LGUOf1ICNt1K/XCwjOQen6cqZpaV9xWjv2jreIguMQxIGXyhz07333P236Q5yQm bqjzV0gWNnFJsk5dr7Aguui5/sWnZF9+uL2zvUZe4x06TOAjpfUhT+/HlWTlj7bnNx/p xHe24rF6TqqWeh0z5XXtcUz7eLCakS8ZGoddTVA2gqBN40G4hEpLWouzGbDOLlcxslJj KR1g== 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=vPFAO1P3yheq7LPHs2PUsFCtoO1DNS7CzmpaZxf7x2Y=; b=YiBXJKFiEc0trWeeNGJc6obLiWp90X5UbPxL+ceOMeQj0QePVBzIE1Gyt3SbnJhs4q vWYwSidEqgfGNpTLcScRgw8MhlR09i/p+1ZTacdQ6fZJ55m21J7KEzRkYARj/YgP60Lq jqKeqvPJ6jZ/6k2ihKjzs+DBi+7ZblTaAZ+8ghgQ2gOOYl3AEC4gOplbm9cMXv0zF1+Q F9GB0gjnFPVyPn7rAitKsb3iCRprA4jOL7tBkhzYg+jCa57BHlMEkzO4cDwaViF6QBMa j1TvI3+4Co12RrmGntPOzfhGA3C6LZk7Vtd2WZ08oo2FVsfXM//30pgE4Oj0IH69gc3v sj5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=mWd7+Unj; 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 a30si657435eda.39.2019.10.25.00.30.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:30:57 -0700 (PDT) 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=mWd7+Unj; 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]:56820 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu3j-0005Xu-C9 for patch@linaro.org; Fri, 25 Oct 2019 03:30:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37024) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN6-00087b-Pl for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN2-0003F4-T7 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMz-0003Ak-UE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:47 -0400 Received: by mail-wr1-x42e.google.com with SMTP id r1so925387wrs.9 for ; Thu, 24 Oct 2019 23:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vPFAO1P3yheq7LPHs2PUsFCtoO1DNS7CzmpaZxf7x2Y=; b=mWd7+Unj/DkuSbKRgcqNqUOpzBCnr4XD+xP5trNpP2dInpeKU/zs7lxpfv8Sbhb4YG Z21JRbGVC3pk8pX8WQEO4gXrtijp38lJqzTyrrH/HvyDo3SnqHCSnVvqnzR6ZzejIk/J l6Vw6VVNmJOjh0IUlGxNmq0BcPhgjCm2AFyh93rDUyu9Ge8geqHRmq9xFB1oFE9fcot2 eCWukOCMAWaA3QHXbxOFy6Wi60c6Bm8aXZIrYS+ia2hMCz46IPHeBtrW4HSAc/bJHwii VtzQSEhF1EvDkCO2NA5ztYyZoP7MLSmuCZdlWnm+xiLiL0B0XMs5sJXbyNtwvLCpMqSM 7OMw== 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=vPFAO1P3yheq7LPHs2PUsFCtoO1DNS7CzmpaZxf7x2Y=; b=H5UHC6gBtqyEYfRrAThNqfotkwDMHPSlrmiwZuZwAKB705y7auA5as2ghijki+2ZHz Tuo1Wt86r23VsSzouWkT3Tb8jHpLY0HsuWhhloZlvWpTA3zo0Ut0Dzs/QZF9xyODx+ck +BVeH3+IBmbLJJ//lNDZlm3jEF6roXeQ9o9bPdVTfXZwiltsd39LVNzYfqMVZx5zSoCK 1Gh76Rmj3lr47A/n0k+GyQhxrScCyyoZP+TINCCddLEIngUKpP2o4//71H8bHVx4x4eA kIlgXP5edcibsyCrKwdyjuc5uDTr1CIdF7pBd5PTa7WeADnyu7C5uSIiNweThgI/noxG epqQ== X-Gm-Message-State: APjAAAVqS8mZg/S2Exdv4OAGArrQJuA0Sf4YgAdkqVi3llCWWv8voUP9 LW4KTleX5r+5VK2iq+eGStOKiQ== X-Received: by 2002:a05:6000:92:: with SMTP id m18mr1360524wrx.105.1571985999712; Thu, 24 Oct 2019 23:46:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a186sm1359813wmd.3.2019.10.24.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 61A551FFA6; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 18/73] trace: add mmu_index to mem_info Date: Fri, 25 Oct 2019 07:36:18 +0100 Message-Id: <20191025063713.23374-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e 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: Riku Voipio , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We are going to re-use mem_info later for plugins and will need to track the mmu_idx for softmmu code. Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index 287433d809b..473d7e5a943 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -60,23 +60,26 @@ #endif #define ATOMIC_TRACE_RMW do { \ - uint8_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, false); \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ + (SHIFT, false, ATOMIC_MMU_IDX); \ \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ - trace_guest_mem_before_exec(env_cpu(env), addr, \ + trace_guest_mem_before_exec(env_cpu(env), addr, info); \ + trace_guest_mem_before_exec(env_cpu(env), addr, \ info | TRACE_MEM_ST); \ } while (0) #define ATOMIC_TRACE_LD do { \ - uint8_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, false); \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ + (SHIFT, false, ATOMIC_MMU_IDX); \ \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ + trace_guest_mem_before_exec(env_cpu(env), addr, info); \ } while (0) -# define ATOMIC_TRACE_ST do { \ - uint8_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, true); \ - \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ +#define ATOMIC_TRACE_ST do { \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ + (SHIFT, true, ATOMIC_MMU_IDX); \ + \ + trace_guest_mem_before_exec(env_cpu(env), addr, info); \ } while (0) /* Define host-endian atomic operations. Note that END is used within diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index defc8d59292..a8f90695823 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1811,6 +1811,7 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, #define ATOMIC_MMU_DECLS #define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, oi, retaddr) #define ATOMIC_MMU_CLEANUP +#define ATOMIC_MMU_IDX get_mmuidx(oi) #define DATA_SIZE 1 #include "atomic_template.h" @@ -1853,6 +1854,7 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, #define DATA_SIZE 8 #include "atomic_template.h" #endif +#undef ATOMIC_MMU_IDX /* Code access functions. */ diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 71c4bf6477d..8d315a65876 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -751,6 +751,7 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, #define ATOMIC_MMU_DECLS do {} while (0) #define ATOMIC_MMU_LOOKUP atomic_mmu_lookup(env, addr, DATA_SIZE, GETPC()) #define ATOMIC_MMU_CLEANUP do { clear_helper_retaddr(); } while (0) +#define ATOMIC_MMU_IDX MMU_USER_IDX #define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END)) #define EXTRA_ARGS diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index af7e0b49f2d..5750a26b9ec 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -84,17 +84,16 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, CPUTLBEntry *entry; RES_TYPE res; target_ulong addr; - int mmu_idx; + int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; #if !defined(SOFTMMU_CODE_ACCESS) trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, false)); + trace_mem_build_info(SHIFT, false, MO_TE, false, mmu_idx)); #endif addr = ptr; - mmu_idx = CPU_MMU_INDEX; entry = tlb_entry(env, mmu_idx, addr); if (unlikely(entry->ADDR_READ != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { @@ -123,17 +122,16 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, CPUTLBEntry *entry; int res; target_ulong addr; - int mmu_idx; + int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; #if !defined(SOFTMMU_CODE_ACCESS) trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, true, MO_TE, false)); + trace_mem_build_info(SHIFT, true, MO_TE, false, mmu_idx)); #endif addr = ptr; - mmu_idx = CPU_MMU_INDEX; entry = tlb_entry(env, mmu_idx, addr); if (unlikely(entry->ADDR_READ != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { @@ -165,17 +163,16 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, { CPUTLBEntry *entry; target_ulong addr; - int mmu_idx; + int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; #if !defined(SOFTMMU_CODE_ACCESS) trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, true)); + trace_mem_build_info(SHIFT, false, MO_TE, true, mmu_idx)); #endif addr = ptr; - mmu_idx = CPU_MMU_INDEX; entry = tlb_entry(env, mmu_idx, addr); if (unlikely(tlb_addr_write(entry) != (addr & (TARGET_PAGE_MASK | (DATA_SIZE - 1))))) { diff --git a/include/exec/cpu_ldst_useronly_template.h b/include/exec/cpu_ldst_useronly_template.h index 2378f2958c9..93ad532f943 100644 --- a/include/exec/cpu_ldst_useronly_template.h +++ b/include/exec/cpu_ldst_useronly_template.h @@ -73,7 +73,7 @@ glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) #else trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, false)); + trace_mem_build_info(SHIFT, false, MO_TE, false, MMU_USER_IDX)); return glue(glue(ld, USUFFIX), _p)(g2h(ptr)); #endif } @@ -105,7 +105,7 @@ glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) #else trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, true, MO_TE, false)); + trace_mem_build_info(SHIFT, true, MO_TE, false, MMU_USER_IDX)); return glue(glue(lds, SUFFIX), _p)(g2h(ptr)); #endif } @@ -132,7 +132,7 @@ glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr, { trace_guest_mem_before_exec( env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, true)); + trace_mem_build_info(SHIFT, false, MO_TE, true, MMU_USER_IDX)); glue(glue(st, SUFFIX), _p)(g2h(ptr), v); } diff --git a/scripts/tracetool/transform.py b/scripts/tracetool/transform.py index e18b05315ef..2ca9286046d 100644 --- a/scripts/tracetool/transform.py +++ b/scripts/tracetool/transform.py @@ -83,6 +83,7 @@ TCG_2_HOST = { HOST_2_TCG_COMPAT = { "uint8_t": "uint32_t", + "uint16_t": "uint32_t", } diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index e87c327fbf9..1388bd344d3 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -2795,7 +2795,7 @@ void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); memop = tcg_canonicalize_memop(memop, 0, 0); trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, 0)); + addr, trace_mem_get_info(memop, idx, 0)); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -2832,7 +2832,7 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_ST | TCG_MO_ST_ST); memop = tcg_canonicalize_memop(memop, 0, 1); trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, 1)); + addr, trace_mem_get_info(memop, idx, 1)); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i32(); @@ -2875,7 +2875,7 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); memop = tcg_canonicalize_memop(memop, 1, 0); trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, 0)); + addr, trace_mem_get_info(memop, idx, 0)); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -2923,7 +2923,7 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_ST | TCG_MO_ST_ST); memop = tcg_canonicalize_memop(memop, 1, 1); trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, 1)); + addr, trace_mem_get_info(memop, idx, 1)); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i64(); diff --git a/trace-events b/trace-events index 22133dfd3fa..42107ebc697 100644 --- a/trace-events +++ b/trace-events @@ -152,12 +152,14 @@ vcpu guest_cpu_reset(void) # uint8_t size_shift : 4; /* interpreted as "1 << size_shift" bytes */ # bool sign_extend: 1; /* sign-extended */ # uint8_t endianness : 1; /* 0: little, 1: big */ -# bool store : 1; /* wheter it's a store operation */ +# bool store : 1; /* whether it is a store operation */ +# pad : 1; +# uint8_t mmuidx : 4; /* mmuidx (softmmu only) */ # }; # # Mode: user, softmmu # Targets: TCG(all) -vcpu tcg guest_mem_before(TCGv vaddr, uint8_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d" +vcpu tcg guest_mem_before(TCGv vaddr, uint16_t info) "info=%d", "vaddr=0x%016"PRIx64" info=%d" # linux-user/syscall.c # bsd-user/syscall.c diff --git a/trace/mem-internal.h b/trace/mem-internal.h index 1a010c1b277..0a32aa22ca0 100644 --- a/trace/mem-internal.h +++ b/trace/mem-internal.h @@ -14,11 +14,13 @@ #define TRACE_MEM_SE (1ULL << 4) /* sign extended (y/n) */ #define TRACE_MEM_BE (1ULL << 5) /* big endian (y/n) */ #define TRACE_MEM_ST (1ULL << 6) /* store (y/n) */ +#define TRACE_MEM_MMU_SHIFT 8 /* mmu idx */ -static inline uint8_t trace_mem_build_info( - int size_shift, bool sign_extend, MemOp endianness, bool store) +static inline uint16_t trace_mem_build_info( + int size_shift, bool sign_extend, MemOp endianness, + bool store, unsigned int mmu_idx) { - uint8_t res; + uint16_t res; res = size_shift & TRACE_MEM_SZ_SHIFT_MASK; if (sign_extend) { @@ -30,25 +32,36 @@ static inline uint8_t trace_mem_build_info( if (store) { res |= TRACE_MEM_ST; } +#ifdef CONFIG_SOFTMMU + res |= mmu_idx << TRACE_MEM_MMU_SHIFT; +#endif return res; } -static inline uint8_t trace_mem_get_info(MemOp op, bool store) +static inline uint16_t trace_mem_get_info(MemOp op, + unsigned int mmu_idx, + bool store) { return trace_mem_build_info(op & MO_SIZE, !!(op & MO_SIGN), - op & MO_BSWAP, store); + op & MO_BSWAP, store, + mmu_idx); } +/* Used by the atomic helpers */ static inline -uint8_t trace_mem_build_info_no_se_be(int size_shift, bool store) +uint16_t trace_mem_build_info_no_se_be(int size_shift, bool store, + TCGMemOpIdx oi) { - return trace_mem_build_info(size_shift, false, MO_BE, store); + return trace_mem_build_info(size_shift, false, MO_BE, store, + get_mmuidx(oi)); } static inline -uint8_t trace_mem_build_info_no_se_le(int size_shift, bool store) +uint16_t trace_mem_build_info_no_se_le(int size_shift, bool store, + TCGMemOpIdx oi) { - return trace_mem_build_info(size_shift, false, MO_LE, store); + return trace_mem_build_info(size_shift, false, MO_LE, store, + get_mmuidx(oi)); } #endif /* TRACE__MEM_INTERNAL_H */ diff --git a/trace/mem.h b/trace/mem.h index 8cf213d85b8..9644f592b4f 100644 --- a/trace/mem.h +++ b/trace/mem.h @@ -18,15 +18,16 @@ * * Return a value for the 'info' argument in guest memory access traces. */ -static uint8_t trace_mem_get_info(MemOp op, bool store); +static uint16_t trace_mem_get_info(MemOp op, unsigned int mmu_idx, bool store); /** * trace_mem_build_info: * * Return a value for the 'info' argument in guest memory access traces. */ -static uint8_t trace_mem_build_info(int size_shift, bool sign_extend, - MemOp endianness, bool store); +static uint16_t trace_mem_build_info(int size_shift, bool sign_extend, + MemOp endianness, bool store, + unsigned int mmuidx); #include "trace/mem-internal.h" From patchwork Fri Oct 25 06:36:19 2019 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: 177636 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3250949ill; Fri, 25 Oct 2019 00:00:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqx/w47mKc6zORtSASyUrBjstsMWhVXHyBBSUqtY21aD+5xGzSoMH9T0cbwgrDMf17DNHy4j X-Received: by 2002:a50:ef0d:: with SMTP id m13mr2183472eds.210.1571986828113; Fri, 25 Oct 2019 00:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986828; cv=none; d=google.com; s=arc-20160816; b=Ugc0sUy9gxx5wIvNDNt2p+DPwAcD4iQUR8gdJRW/h7TG864yKGSvWGb1PYB+yLtSTD KLAAH27C+/qX4FlwbUiXmqvF0u5x2FTblW6a4w/NT/4nSysyCXEjJgZndo35T1UnleMc TP2HJfQ0w4gGLKXCjeCjqHqYsbaOsf+rKC7aayQpCKn3vdrVHxpH17u8fRh7euWAAFJM QNslO2ZLFWzQrZ5JzPrNKTtnH/mpp0zsAEKHOCHqI2jCrwb+2mvS/nt0wnpBVQaScH21 uR4EvImb3Nd+wZw9KRMP7BFH2DUhjcJVV2Ma2Nz0tOTNVU2718KY2FFO8IXjZZvtHkAU 2V8w== 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=jANiCoc6xQGO++RZKyflS33Oep2oq+6QqQq5UE1fZNk=; b=y8T6Ja90MaJNho5aOK3/FPWJ6xmeFzwUm9h8F292utdkscDlshnuktYHq9HgoHR8JO oUiVU3zyICRYLxKt1RwODYfQQJjOceL0g8SQQ+Dvn1zj5Rov5h5vhjTFgqqgmGJgbcmS ROMLR1NtrRMZJ9Xo4cZL0nAz3z3Ur1hH2zczbXaE3dJjish+EqZgCh0CX7LF5hhlbCXF O1bxHEz5VqoNme+qCZ/E+5uhZLK1Bm3gBwygaCKqwIqeS5/879QXA+ZisB403dKaHYSn CVrmOgvPrstWmn7lshHdnJyzOg9+s1kz0uSvRDxWMQblYF3y4O7pXxTQnfHabudfqlxL 5FZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OkPO8vLQ; 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 q4si671068edc.403.2019.10.25.00.00.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:00:28 -0700 (PDT) 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=OkPO8vLQ; 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]:56294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtaE-000394-4t for patch@linaro.org; Fri, 25 Oct 2019 03:00:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35569) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE2-0003KK-Gb for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE1-0008RE-7u for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:30 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:35326) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE1-0008Qa-1X for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:29 -0400 Received: by mail-wm1-x332.google.com with SMTP id v6so770847wmj.0 for ; Thu, 24 Oct 2019 23:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jANiCoc6xQGO++RZKyflS33Oep2oq+6QqQq5UE1fZNk=; b=OkPO8vLQJdj9P8QXqbLcGeCFebaq5e9uSD8NiVe6Ci6tCM/VGrY30xO0wl9dXCK+BD XSko3o0U23HfpKa1qb1js0TD/XM+IWWR3KtbQtHs5rrK9YVwUnnlybGCdj9xbLCbwEr+ /X4JcPqSXbq9fNAOtIFiAAvDYrJqLmIzXBDOLgcEGHIuNV4rfA+ldvRiQwTldr45GwDm Q45Gk+jNOVuPFSIaq54Ian3sJk8ckVYYOIpZ3dPp16w7SwLF7s9tzAkZ6jbitXIm56vT 57k83ghkS5x5jUobXQzC+7N2bVh+wNJSJSPnXRaxjzujkIgTBCQuN3qO47LMiHOjFQIU AnEQ== 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=jANiCoc6xQGO++RZKyflS33Oep2oq+6QqQq5UE1fZNk=; b=T34qPVdkJPV3t1RzO+Djb9gp0oTI5fGrSm7pPMKm80JLVoZh51D4BSIfr4VMv50D5u btCW/JQzz4NtY243MhH7ICjzXo9C2HP9kpybAN+Iw5OBKiKZb2oaqkIhLI/2Gwu5KheB gkEz0lsVg/mi0Ip+3u3EDPM4hYXPp6Og6wUVbw749snp/NozBw+GMi3PW0Erdrdw/D2I bvzUNllEZ/NhSiI2ZN+tBEHKitDJ+WXQ68IdTn9H7UV8qtRWLcddghOsQTtRUF6F2eEb TA3ICl+Xkhpa0EuQVGzAS8bPEapku761b4IaSo3jWpIsalZ3ghvRlz771qJUMh+LqshQ /HEQ== X-Gm-Message-State: APjAAAWxh6v8/feZKFW9KotrM6S/xLvmKomgpfvl29vBCq2RV8Rs4UuU 4qZQ/dBAzEQuJhtlCpDhvi1+Ug== X-Received: by 2002:a1c:44b:: with SMTP id 72mr1806509wme.72.1571985446981; Thu, 24 Oct 2019 23:37:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a13sm1259387wrf.73.2019.10.24.23.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7B6891FFA9; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 19/73] cpu: introduce cpu_in_exclusive_context() Date: Fri, 25 Oct 2019 07:36:19 +0100 Message-Id: <20191025063713.23374-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 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 , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Suggested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota [AJB: moved inside start/end_exclusive fns + cleanup] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 48272c781b7..81c33d6475d 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -238,8 +238,6 @@ void cpu_exec_step_atomic(CPUState *cpu) uint32_t flags; uint32_t cflags = 1; uint32_t cf_mask = cflags & CF_HASH_MASK; - /* volatile because we modify it between setjmp and longjmp */ - volatile bool in_exclusive_region = false; if (sigsetjmp(cpu->jmp_env, 0) == 0) { tb = tb_lookup__cpu_state(cpu, &pc, &cs_base, &flags, cf_mask); @@ -253,7 +251,6 @@ void cpu_exec_step_atomic(CPUState *cpu) /* Since we got here, we know that parallel_cpus must be true. */ parallel_cpus = false; - in_exclusive_region = true; cc->cpu_exec_enter(cpu); /* execute the generated code */ trace_exec_tb(tb, pc); @@ -273,7 +270,7 @@ void cpu_exec_step_atomic(CPUState *cpu) assert_no_pages_locked(); } - if (in_exclusive_region) { + if (cpu_in_exclusive_context(cpu)) { /* We might longjump out of either the codegen or the * execution, so must make sure we only end the exclusive * region if we started it. diff --git a/cpus-common.c b/cpus-common.c index af3385a2968..eaf590cb387 100644 --- a/cpus-common.c +++ b/cpus-common.c @@ -200,11 +200,15 @@ void start_exclusive(void) * section until end_exclusive resets pending_cpus to 0. */ qemu_mutex_unlock(&qemu_cpu_list_lock); + + current_cpu->in_exclusive_context = true; } /* Finish an exclusive operation. */ void end_exclusive(void) { + current_cpu->in_exclusive_context = false; + qemu_mutex_lock(&qemu_cpu_list_lock); atomic_set(&pending_cpus, 0); qemu_cond_broadcast(&exclusive_resume); diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 031f587e512..07f2ab05903 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -372,6 +372,7 @@ struct CPUState { bool unplug; bool crash_occurred; bool exit_request; + bool in_exclusive_context; uint32_t cflags_next_tb; /* updates protected by BQL */ uint32_t interrupt_request; @@ -783,6 +784,18 @@ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data) */ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data); +/** + * cpu_in_exclusive_context() + * @cpu: The vCPU to check + * + * Returns true if @cpu is an exclusive context, for example running + * something which has previously been queued via async_safe_run_on_cpu(). + */ +static inline bool cpu_in_exclusive_context(const CPUState *cpu) +{ + return cpu->in_exclusive_context; +} + /** * qemu_get_cpu: * @index: The CPUState@cpu_index value of the CPU to obtain. From patchwork Fri Oct 25 06:36:20 2019 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: 177641 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3252737ill; Fri, 25 Oct 2019 00:01:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnxEscnOYLGTwpNlKl3mj0QubECBmGs1/8XCCeVbUrsp9L9oRnOsOBMm53WvJOzGZXFHHf X-Received: by 2002:a0c:9adf:: with SMTP id k31mr1817992qvf.126.1571986915524; Fri, 25 Oct 2019 00:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986915; cv=none; d=google.com; s=arc-20160816; b=RY8Lcht6Bp7Bd9vl1Wk1CsdY5Zeyl0f5rVrERmgKzEMfhaE/iUTkj9Nk4o9qHLFJ85 88yRT7TInh0+PyAuNpJMocf7BtAswvoMh+XFexLA/hNt+JJrCuiRrIAHfqFTSCpGUTBv 5PBzXknU2B5lPDZgwLPGYSnFXSIZBzqRDjuFDcAlPJyzjOj1d8rxcpKXp0viYotItVBi N1WLm6wZEdX8t/ueKFQX+DvBml35qACUsaQLW+Qnpwl0R1TkB8KzdmB/b7i/nqr/iRjz NGhkq3qTDn4hHyjTpDC0Cgn7lcdnINEOdzMqRjQTZ2tHAAlpPjQAeeefo+SdrWdJpdIt /Mbg== 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=a+CNlZHOsvnPAzo+1k2Dke9GSSUrs8d4XRw46Zp2gXU=; b=klV3ydzfsTsxu884P3an/Iqj7W3zs/A9QdP8hCBkbS1BjjjMSTBHNbW5Qa9/tRAaOa ZKcZm/0HkffRsv/bUApDgYndgn3iKd44ecz0gbueBp2+lIWyrI7qjT/8Nb2VzS7Jmnuh lcfY2rEyWK8WMdkbuqn27I65ctiFjjU3eAjmJ2ZPGFxMLI9okkZQPxqZeGWijTVoWHGr vwuOCnnYeuLednfxyx0i4CIqB9wQ51Yjv3MACizXTrUaGe0mNek94GNghRitXx52DNOs VEvkYGpFVNR6a82f5CSA/C7Ch/1Fp6GjbvCHC9MB4GwuTIZSvUdilkIf0QZBwyEDtHXK BIJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eaVEqL4d; 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 w19si761416qkj.333.2019.10.25.00.01.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:01:55 -0700 (PDT) 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=eaVEqL4d; 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]:56318 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtbe-00048x-1v for patch@linaro.org; Fri, 25 Oct 2019 03:01:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36907) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMr-0007l9-D9 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMp-00037q-NI for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:36 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:37501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMp-00037C-GT for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:35 -0400 Received: by mail-wr1-x430.google.com with SMTP id e11so947858wrv.4 for ; Thu, 24 Oct 2019 23:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a+CNlZHOsvnPAzo+1k2Dke9GSSUrs8d4XRw46Zp2gXU=; b=eaVEqL4dgXXp0wqHt21xpcwDfEqgH6Wc8jxwn2b1RM2bQ9mGZakHuwEJaiK3lkeBBd ljJ9epTY7OvH/NDMmP/hDld0Yt2ZNr9pkRVKP1K47BFn273Kpqa5EyJKWG7Vz4E8aAXh Wci5e1Ng8M0EKVP6BcddPxpGGq+PUACrZ/V15Y6VVfzg/hc0T5z0NvWL6ZPWhMvNJGyd mqKrYNDaoCyWgCevr2w3rjOmq48mUhdth50v5myfoLKZxLdL/mRRLG8gD7HqiJowwgHR 9BMoIe6Dj/2tBfbYgPuhmqDr47QO5xIh5+NJ5ZRbrGXZLPEePBatswaX/ndEP2QXID/3 EaPw== 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=a+CNlZHOsvnPAzo+1k2Dke9GSSUrs8d4XRw46Zp2gXU=; b=OLSQcZbllcGn9b8yHhWZiD1kRZqV0sOx5/gV4rbdjtWV7EkMVNQb/7O3seG/XVRadz OMVig/BFxScCZ3EPH6GuP7gK+g3uBbwnKKo73hSLwVk1B+EO8E0pMaGfohKDk+oqp9xv /kRByZPBeOHmGLI3JvlrVOcBA49gyN99Lm4vZCmKtKfWhyKHRYMrG37Q14hVmq5Jyj57 z/DuLFe8UsjM+FLS8eadK9CU/ONLIfU6L8z0yisUzsiSTGpJIEPn+87k3gj5bpp6WWsm DgN4m0eP08XScFSP4aQVbBenxRvmT8a5ce94Lefjkz3Rxfx1tbfk8yY2fwYfUT8K8b4M WFjw== X-Gm-Message-State: APjAAAWRLO6SUMpXwhc+RnbJWhj9Khp9gYTuQeM/805BEs7jLANxgdXh 5GUvBNcrwbvstfcwnuMCyPorEQ== X-Received: by 2002:a5d:498e:: with SMTP id r14mr1279313wrq.36.1571985993857; Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w8sm1779491wrr.44.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 918D11FFAA; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 20/73] translate-all: use cpu_in_exclusive_work_context() in tb_flush Date: Fri, 25 Oct 2019 07:36:20 +0100 Message-Id: <20191025063713.23374-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" tb_flush will be called by the plugin module from a safe work environment. Prepare for that. Suggested-by: Alex Bennée Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 66d4bc4341a..0a08fcda3e8 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1268,8 +1268,13 @@ void tb_flush(CPUState *cpu) { if (tcg_enabled()) { unsigned tb_flush_count = atomic_mb_read(&tb_ctx.tb_flush_count); - async_safe_run_on_cpu(cpu, do_tb_flush, - RUN_ON_CPU_HOST_INT(tb_flush_count)); + + if (cpu_in_exclusive_context(cpu)) { + do_tb_flush(cpu, RUN_ON_CPU_HOST_INT(tb_flush_count)); + } else { + async_safe_run_on_cpu(cpu, do_tb_flush, + RUN_ON_CPU_HOST_INT(tb_flush_count)); + } } } From patchwork Fri Oct 25 06:36:21 2019 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: 177630 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3245004ill; Thu, 24 Oct 2019 23:53:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNaO+pXcFkTbRmvHx6DwkqEBQtVX1ENJvTdB4fOHwsuuga10B5NNXjE/4nW29vF4/5jVCm X-Received: by 2002:a17:906:1e07:: with SMTP id g7mr1957925ejj.256.1571986429938; Thu, 24 Oct 2019 23:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986429; cv=none; d=google.com; s=arc-20160816; b=i3OA2KsCXXH5Rmq6O4CW3HH/nqXZyNjWaNduwYOmYOl4el2R0ukPtC3pSEwTtMwFGc 3tpLn6JXf4jp3l/ja393obRxuxNhOfvyYF5GiIBWmKbtFYS/z7h8vpp9uX8RWR/6psUe w/3pcTRPia0MWHWOl7bpz2njvvWuWc/+HVU6CnMKleY1LkALBKvGbsZswgfrIylfiPuN pAuVFuvdUSgkThruQiS0Ym8HrF/RFksfTk2QdsKvYNUaJWe12N6WDbhaC6lOXgEPM3eU u1BTH6o/ar41V0aYxhFL938+v1MbycYrZSDY680S49mh+w5225nnou024NKizAzSj6GO oKlA== 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=9UrS1uw6AZDTMRq/tP2Ot5sPWM4GF3Yu6lTDbahkAEo=; b=zOW/+N/N+bVcHLlo6v17KlQ+QxfvwDUtdJ5iIZYJkLtJLr2ZtND9DwBxBc5u5i9d0Q Q8dLe6KRnoJLRI1ufZI5ecak16H9ojDuPWk1PDBFdlUV+QCaUU4k4aG19+ttVkVN/7Za AIO3vwjeoETEooIbKsdL9+pv1v/3LkSyHUKBF3N/YJVAlu4qujZLEW1zUrhGyhu7EIxj adtNkoDrU1u4VOKfHYohJKoAoOlarF2W4MhfbHWEukTKYsVOmuenh6GGFbkHg6tZVTOv jKUiIQY5Kw3gm/kltS14E4vGj3JMi9RRGJCDAIuOKiMeEncAgomwYCxZuPG4DwnzMxp4 2vXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gCiZ80fP; 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 gv25si677550ejb.209.2019.10.24.23.53.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:53:49 -0700 (PDT) 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=gCiZ80fP; 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]:56100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtTn-00047A-Rk for patch@linaro.org; Fri, 25 Oct 2019 02:53:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35543) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE1-0003Hu-Ji for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE0-0008Qn-5r for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:29 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:46549) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDz-0008QG-Dl for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:28 -0400 Received: by mail-wr1-x42d.google.com with SMTP id n15so884227wrw.13 for ; Thu, 24 Oct 2019 23:37:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9UrS1uw6AZDTMRq/tP2Ot5sPWM4GF3Yu6lTDbahkAEo=; b=gCiZ80fP6IaH1GG9J2JrpclaWG4fUpRiyvGpWRjlE6f2tZK2YkikjIjyzDdefpjyo4 1F0Z0lfOYSbWSjuaz7EvwCRcItiERn8OJmDYbYMxPBNL1nFJyEUIBIAgXGQNM4/+gkjw jhvKqFPsQQCf6qtrTLPd4+Eb+ZdMvqT7mdhin3AYzvnPg1/03xkqQZtTkzo84bodtHrn nYkfWabUTWwPP6yr4UYciTIVsqTscRpu6SNM6kZeLpcejXmpU6mtMgP/b1PLih1+DyHi 6QLrM7gNo3rVIdsxoOMfnypTppsW4Bn8bF+cWGbjWLiRuwReRFvHpgyzFB7cRiaYIVyB 6DxQ== 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=9UrS1uw6AZDTMRq/tP2Ot5sPWM4GF3Yu6lTDbahkAEo=; b=ao8ILi/I4oGbyfjAUB8ojmH0CrcvEvXZbTrZ7Q4SHjUlY3+3SXF1E3WDweYFDXxXk9 igAwrhYnYelZDowvhO+rJ76lsbJxbGJp1OgiwGYDTakD/B/4q3SwggC+mTqkU55TNwjG N5LXnbksutG5vcm85sv3QBSAC5bH/WnXAJOxo5/+G+xGzNJ0JKkTYFeGwDOFIvFmGkfy SPNDIKbpkLNmJSupwkzX0//SEeFsHxvZ/pKj7skm0G3WBJjQKn32yRFcNiKeT8zlIiyl SkV0wgAQ3eZ0bPgk8fVPwVE33BMwD1iHtKeCzxZmC8WB96Obpg+C7NhM8bOqA6NECfjb +C3w== X-Gm-Message-State: APjAAAWbDdvfJ6q30EDCWOLhjkYvwVuU+5DfHKVlscfzAby7I/KFLH+8 yhIJJme5mzHp1ZoNQGIUF3XbgQ== X-Received: by 2002:adf:f40a:: with SMTP id g10mr1262888wro.228.1571985446192; Thu, 24 Oct 2019 23:37:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id z189sm1918933wmc.25.2019.10.24.23.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A80581FFAB; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 21/73] docs/devel: add plugins.rst design document Date: Fri, 25 Oct 2019 07:36:21 +0100 Message-Id: <20191025063713.23374-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is mostly extracted from Emilio's more verbose commit comments with some additional verbiage from me. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/docs/devel/index.rst b/docs/devel/index.rst index 1ec61fcfed9..2ff058bae38 100644 --- a/docs/devel/index.rst +++ b/docs/devel/index.rst @@ -22,3 +22,4 @@ Contents: decodetree secure-coding-practices tcg + plugins diff --git a/docs/devel/plugins.rst b/docs/devel/plugins.rst new file mode 100644 index 00000000000..b18fb6729e3 --- /dev/null +++ b/docs/devel/plugins.rst @@ -0,0 +1,112 @@ +.. + Copyright (C) 2017, Emilio G. Cota + Copyright (c) 2019, Linaro Limited + Written by Emilio Cota and Alex Bennée + +================ +QEMU TCG Plugins +================ + +QEMU TCG plugins provide a way for users to run experiments taking +advantage of the total system control emulation can have over a guest. +It provides a mechanism for plugins to subscribe to events during +translation and execution and optionally callback into the plugin +during these events. TCG plugins are unable to change the system state +only monitor it passively. However they can do this down to an +individual instruction granularity including potentially subscribing +to all load and store operations. + +API Stability +============= + +This is a new feature for QEMU and it does allow people to develop +out-of-tree plugins that can be dynamically linked into a running QEMU +process. However the project reserves the right to change or break the +API should it need to do so. The best way to avoid this is to submit +your plugin upstream so they can be updated if/when the API changes. + + +Exposure of QEMU internals +-------------------------- + +The plugin architecture actively avoids leaking implementation details +about how QEMU's translation works to the plugins. While there are +conceptions such as translation time and translation blocks the +details are opaque to plugins. The plugin is able to query select +details of instructions and system configuration only through the +exported *qemu_plugin* functions. The types used to describe +instructions and events are opaque to the plugins themselves. + +Usage +===== + +The QEMU binary needs to be compiled for plugin support: + +:: + configure --enable-plugins + +Once built a program can be run with multiple plugins loaded each with +their own arguments: + +:: + $QEMU $OTHER_QEMU_ARGS \ + -plugin tests/plugin/libhowvec.so,arg=inline,arg=hint \ + -plugin tests/plugin/libhotblocks.so + +Arguments are plugin specific and can be used to modify their +behaviour. In this case the howvec plugin is being asked to use inline +ops to count and break down the hint instructions by type. + +Plugin Life cycle +================= + +First the plugin is loaded and the public qemu_plugin_install function +is called. The plugin will then register callbacks for various plugin +events. Generally plugins will register a handler for the *atexit* +if they want to dump a summary of collected information once the +program/system has finished running. + +When a registered event occurs the plugin callback is invoked. The +callbacks may provide additional information. In the case of a +translation event the plugin has an option to enumerate the +instructions in a block of instructions and optionally register +callbacks to some or all instructions when they are executed. + +There is also a facility to add an inline event where code to +increment a counter can be directly inlined with the translation. +Currently only a simple increment is supported. This is not atomic so +can miss counts. If you want absolute precision you should use a +callback which can then ensure atomicity itself. + +Finally when QEMU exits all the registered *atexit* callbacks are +invoked. + +Internals +========= + +Locking +------- + +We have to ensure we cannot deadlock, particularly under MTTCG. For +this we acquire a lock when called from plugin code. We also keep the +list of callbacks under RCU so that we do not have to hold the lock +when calling the callbacks. This is also for performance, since some +callbacks (e.g. memory access callbacks) might be called very +frequently. + + * A consequence of this is that we keep our own list of CPUs, so that + we do not have to worry about locking order wrt cpu_list_lock. + * Use a recursive lock, since we can get registration calls from + callbacks. + +As a result registering/unregistering callbacks is "slow", since it +takes a lock. But this is very infrequent; we want performance when +calling (or not calling) callbacks, not when registering them. Using +RCU is great for this. + +We support the uninstallation of a plugin at any time (e.g. from +plugin callbacks). This allows plugins to remove themselves if they no +longer want to instrument the code. This operation is asynchronous +which means callbacks may still occur after the uninstall operation is +requested. The plugin isn't completely uninstalled until the safe work +has executed while all vCPUs are quiescent. From patchwork Fri Oct 25 06:36:22 2019 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: 177637 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3250992ill; Fri, 25 Oct 2019 00:00:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqy57o94eS182zlyXOgIgWZEeqPogKjMakaKisMTGagL3BYRs37HZ0nE0jtjLCLDuWStYeZR X-Received: by 2002:a50:ab10:: with SMTP id s16mr2184059edc.118.1571986830306; Fri, 25 Oct 2019 00:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986830; cv=none; d=google.com; s=arc-20160816; b=gC9GovzWlHyD6DEC/MKwFHLJdRDGrBmXHMsZIwGa5snugi9ocoGWbpC3WYaDTPA1dp JVyaiux/IQ5zECHVn2viZ0F3ovp/itcgEv4m+KBUuRIKvHR9Vd8CX/UdUitnQ9RFtMn7 Zu3mgS+Hg6v/nUw+HU23Qy141t4F626HTeSmV32ClCarF7PaQbqwOFiMSeL5mKMX0ebE Z0r4Txuxtdbto2jvrZAek76bQCOhqYSoXnAzjWGwk7huxHXflTZR5DjBAvMzvfA4RJOf BvjYh3SPpLNlATQSUv1Ww5HOh4fK0U35Ct8NJVvdxW+nLILeDjpnFCbGHTpNl+pQQ/55 MU1w== 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=2ki5hRzj89s13VKfj3RSaJdLQEClcEWqDIviltV7kgU=; b=fKChbJhRe1PcBNiox44aOTM9ccvlbwuvmdqdZQZLXtKCotAzMyHlaAss9141Aq13Kt IPL3XMR4K0W0asqaAk+iZSpc62/ZKUE76jBin6YLMPsjE244FYFU9zqBXeV+9A2e8aqW 6ykyK5aDL93V2KJ4IXIVfooyMQ69bgEKtJvCt2zuDB0fcajLmyg02+eFw6HNtl6C8KlQ KDkQNCwRiLZN5XUw6MHN114yIYi1VitV5RuOI3fvh6oairZCf+Snbf9dYmtqNAkKEMe8 wGiQQvhLTusSUdFc2UlVi/DeLoj6j6xrKUZpTI1xl9KFSAj3DepzSBXK5eAHcrN2/aLl 0fVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tKvYPrxd; 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 2si684809ejq.243.2019.10.25.00.00.29 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:00:30 -0700 (PDT) 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=tKvYPrxd; 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]:56298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtaG-0003Cl-7o for patch@linaro.org; Fri, 25 Oct 2019 03:00:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35656) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE7-0003Rq-OO for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE5-0008Tf-NL for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:35 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:53579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE5-0008SO-B5 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:33 -0400 Received: by mail-wm1-x336.google.com with SMTP id n7so762028wmc.3 for ; Thu, 24 Oct 2019 23:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2ki5hRzj89s13VKfj3RSaJdLQEClcEWqDIviltV7kgU=; b=tKvYPrxdmfKvLZxB976DebcC8c5ofepmvdmKv3EQPMHX2dOhhOPi0+mgutiDDLzBCO 7xqiqpSH6PYNyd9UlW/KfBvupdNoWTcF704H47h6K9S7rXMG9ZFi3FXbbhSFFwH8Dres fPsXTloc/WDH7nxgx0rq7uZaBrWYVLjoEuNBukljGgelKc5qtSKGwpmrIh67jJZgSlXg TO6FxlcujMSYWoPSaR4e8tK5OyOUdHuGmM+AwXZURZ47O8LUTJEHj9S+4cPcpzX7Ggc/ aq3tPQb9/K9SU1/JcVbEAy8B4a1AjXGBEV05xG65NbQV8DfATj6Ko6gKNftJMnK2yIub UH1Q== 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=2ki5hRzj89s13VKfj3RSaJdLQEClcEWqDIviltV7kgU=; b=qQNCp/Rzn/RASsFI7hbigOppJqp9ffLJkFI4v9plLwKNYbIvl7gSI7OqVupZIey3Rv R2jIV2SuSvyB94ISOnB71emv/EGjUhMlVpz7yRNUQRKp4F3ftiA8rTGj/ITVqiXQ3aBU dR/JJ8gr36/tmnFU0Oaczy+dG7NeReOOcgCHyQEN2MV4ZamOfYvRs9L32DdgCIAZytWj dFvhtFnl+ofFA2SvS1wuQyR7mJEgOa3yhZQe7ox9nCLXqXbBkVM2uKyXfkqV6nYO0xkT c5Q6TbH33fev7D+uSBpAxfoL7y8gVQjeIZxnEs83iLYcMC7carJLMcow1n5BqTKYo645 5QaA== X-Gm-Message-State: APjAAAWr+YwMOJbrjn6L79Lm542QFaWYfPG9c1MVZVNoCnvVKMzCe+08 hYRJOCIaIxIDPyUefTmnxEyziA== X-Received: by 2002:a1c:8055:: with SMTP id b82mr1903945wmd.176.1571985450476; Thu, 24 Oct 2019 23:37:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p5sm1510130wmi.4.2019.10.24.23.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BCD301FFAC; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 22/73] plugin: add user-facing API Date: Fri, 25 Oct 2019 07:36:22 +0100 Message-Id: <20191025063713.23374-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::336 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Add the API first to ease review. Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h new file mode 100644 index 00000000000..d9c1ca3b4cf --- /dev/null +++ b/include/qemu/qemu-plugin.h @@ -0,0 +1,351 @@ +/* + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019, Linaro + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#ifndef QEMU_PLUGIN_API_H +#define QEMU_PLUGIN_API_H + +#include +#include + +/* + * For best performance, build the plugin with -fvisibility=hidden so that + * QEMU_PLUGIN_LOCAL is implicit. Then, just mark qemu_plugin_install with + * QEMU_PLUGIN_EXPORT. For more info, see + * https://gcc.gnu.org/wiki/Visibility + */ +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_DLL + #define QEMU_PLUGIN_EXPORT __declspec(dllexport) + #else + #define QEMU_PLUGIN_EXPORT __declspec(dllimport) + #endif + #define QEMU_PLUGIN_LOCAL +#else + #if __GNUC__ >= 4 + #define QEMU_PLUGIN_EXPORT __attribute__((visibility("default"))) + #define QEMU_PLUGIN_LOCAL __attribute__((visibility("hidden"))) + #else + #define QEMU_PLUGIN_EXPORT + #define QEMU_PLUGIN_LOCAL + #endif +#endif + +typedef uint64_t qemu_plugin_id_t; + +/** + * qemu_plugin_install() - Install a plugin + * @id: this plugin's opaque ID + * @argc: number of arguments + * @argv: array of arguments (@argc elements) + * + * All plugins must export this symbol. + * + * Note: Calling qemu_plugin_uninstall() from this function is a bug. To raise + * an error during install, return !0. + * + * Note: @argv remains valid throughout the lifetime of the loaded plugin. + */ +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, int argc, + char **argv); + +/* + * Prototypes for the various callback styles we will be registering + * in the following functions. + */ +typedef void (*qemu_plugin_simple_cb_t)(qemu_plugin_id_t id); + +typedef void (*qemu_plugin_udata_cb_t)(qemu_plugin_id_t id, void *userdata); + +typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plugin_id_t id, + unsigned int vcpu_index); + +typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, + void *userdata); + +/** + * qemu_plugin_uninstall() - Uninstall a plugin + * @id: this plugin's opaque ID + * @cb: callback to be called once the plugin has been removed + * + * Do NOT assume that the plugin has been uninstalled once this function + * returns. Plugins are uninstalled asynchronously, and therefore the given + * plugin receives callbacks until @cb is called. + * + * Note: Calling this function from qemu_plugin_install() is a bug. + */ +void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); + +/** + * qemu_plugin_reset() - Reset a plugin + * @id: this plugin's opaque ID + * @cb: callback to be called once the plugin has been reset + * + * Unregisters all callbacks for the plugin given by @id. + * + * Do NOT assume that the plugin has been reset once this function returns. + * Plugins are reset asynchronously, and therefore the given plugin receives + * callbacks until @cb is called. + */ +void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb); + +/** + * qemu_plugin_register_vcpu_init_cb() - register a vCPU initialization callback + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called every time a vCPU is initialized. + * + * See also: qemu_plugin_register_vcpu_exit_cb() + */ +void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb); + +/** + * qemu_plugin_register_vcpu_exit_cb() - register a vCPU exit callback + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called every time a vCPU exits. + * + * See also: qemu_plugin_register_vcpu_init_cb() + */ +void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb); + +/** + * qemu_plugin_register_vcpu_idle_cb() - register a vCPU idle callback + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called every time a vCPU idles. + */ +void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb); + +/** + * qemu_plugin_register_vcpu_resume_cb() - register a vCPU resume callback + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called every time a vCPU resumes execution. + */ +void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb); + +/* + * Opaque types that the plugin is given during the translation and + * instrumentation phase. + */ +struct qemu_plugin_tb; +struct qemu_plugin_insn; + +enum qemu_plugin_cb_flags { + QEMU_PLUGIN_CB_NO_REGS, /* callback does not access the CPU's regs */ + QEMU_PLUGIN_CB_R_REGS, /* callback reads the CPU's regs */ + QEMU_PLUGIN_CB_RW_REGS, /* callback reads and writes the CPU's regs */ +}; + +enum qemu_plugin_mem_rw { + QEMU_PLUGIN_MEM_R = 1, + QEMU_PLUGIN_MEM_W, + QEMU_PLUGIN_MEM_RW, +}; + +/** + * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called every time a translation occurs. The @cb + * function is passed an opaque qemu_plugin_type which it can query + * for additional information including the list of translated + * instructions. At this point the plugin can register further + * callbacks to be triggered when the block or individual instruction + * executes. + */ +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, + struct qemu_plugin_tb *tb); + +void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_tb_trans_cb_t cb); + +/** + * qemu_plugin_register_vcpu_tb_trans_exec_cb() - register execution callback + * @tb: the opaque qemu_plugin_tb handle for the translation + * @cb: callback function + * @flags: does the plugin read or write the CPU's registers? + * @userdata: any plugin data to pass to the @cb? + * + * The @cb function is called every time a translated unit executes. + */ +void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, + void *userdata); + +enum qemu_plugin_op { + QEMU_PLUGIN_INLINE_ADD_U64, +}; + +/** + * qemu_plugin_register_vcpu_tb_trans_exec_inline() - execution inline op + * @tb: the opaque qemu_plugin_tb handle for the translation + * @op: the type of qemu_plugin_op (e.g. ADD_U64) + * @ptr: the target memory location for the op + * @imm: the op data (e.g. 1) + * + * Insert an inline op to every time a translated unit executes. + * Useful if you just want to increment a single counter somewhere in + * memory. + */ +void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, + enum qemu_plugin_op op, + void *ptr, uint64_t imm); + +/** + * qemu_plugin_register_vcpu_insn_exec_cb() - register insn execution cb + * @insn: the opaque qemu_plugin_insn handle for an instruction + * @cb: callback function + * @flags: does the plugin read or write the CPU's registers? + * @userdata: any plugin data to pass to the @cb? + * + * The @cb function is called every time an instruction is executed + */ +void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, + void *userdata); + +/** + * qemu_plugin_register_vcpu_insn_exec_inline() - insn execution inline op + * @insn: the opaque qemu_plugin_insn handle for an instruction + * @cb: callback function + * @op: the type of qemu_plugin_op (e.g. ADD_U64) + * @ptr: the target memory location for the op + * @imm: the op data (e.g. 1) + * + * Insert an inline op to every time an instruction executes. Useful + * if you just want to increment a single counter somewhere in memory. + */ +void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *insn, + enum qemu_plugin_op op, + void *ptr, uint64_t imm); + +/* + * Helpers to query information about the instructions in a block + */ +size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb); + +uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb); + +struct qemu_plugin_insn * +qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx); + +const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn); + +size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn); + +uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); +void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); + +/* + * Memory Instrumentation + * + * The anonymous qemu_plugin_meminfo_t and qemu_plugin_hwaddr types + * can be used in queries to QEMU to get more information about a + * given memory access. + */ +typedef uint32_t qemu_plugin_meminfo_t; +struct qemu_plugin_hwaddr; + +/* meminfo queries */ +unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info); +bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); +bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); +bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); + +/* + * qemu_plugin_get_hwaddr(): + * @vaddr: the virtual address of the memory operation + * + * For system emulation returns a qemu_plugin_hwaddr handle to query + * details about the actual physical address backing the virtual + * address. For linux-user guests it just returns NULL. + * + * This handle is *only* valid for the duration of the callback. Any + * information about the handle should be recovered before the + * callback returns. + */ +struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, + uint64_t vaddr); + +bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr); +uint64_t qemu_plugin_hwaddr_to_raddr(const struct qemu_plugin_hwaddr *haddr); + +typedef void +(*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, + qemu_plugin_meminfo_t info, uint64_t vaddr, + void *userdata); + +void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, + qemu_plugin_vcpu_mem_cb_t cb, + enum qemu_plugin_cb_flags flags, + enum qemu_plugin_mem_rw rw, + void *userdata); + +void qemu_plugin_register_vcpu_mem_inline(struct qemu_plugin_insn *insn, + enum qemu_plugin_mem_rw rw, + enum qemu_plugin_op op, void *ptr, + uint64_t imm); + + + +typedef void +(*qemu_plugin_vcpu_syscall_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_index, + int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8); + +void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_syscall_cb_t cb); + +typedef void +(*qemu_plugin_vcpu_syscall_ret_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_idx, + int64_t num, int64_t ret); + +void +qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_syscall_ret_cb_t cb); + + +/** + * qemu_plugin_vcpu_for_each() - iterate over the existing vCPU + * @id: plugin ID + * @cb: callback function + * + * The @cb function is called once for each existing vCPU. + * + * See also: qemu_plugin_register_vcpu_init_cb() + */ +void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb); + +void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, + qemu_plugin_simple_cb_t cb); + +void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, + qemu_plugin_udata_cb_t cb, void *userdata); + +/* returns -1 in user-mode */ +int qemu_plugin_n_vcpus(void); + +/* returns -1 in user-mode */ +int qemu_plugin_n_max_vcpus(void); + +#endif /* QEMU_PLUGIN_API_H */ From patchwork Fri Oct 25 06:36:23 2019 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: 177696 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3304599ill; Fri, 25 Oct 2019 00:51:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxGwaAQ48AOi5lB8xLbJGctTgOAFu9CBi/qfis60wLW0p6TV0uczOo2IP3iDBSVldrUcyXt X-Received: by 2002:a17:906:1542:: with SMTP id c2mr2114192ejd.80.1571989870221; Fri, 25 Oct 2019 00:51:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989870; cv=none; d=google.com; s=arc-20160816; b=mIGPNhCkQseh84yEJHlA2Ujon9E2McYExMlP3L5OMVM5TK6sFwe6uKBooBVO6vN6ht WR6Y8dRu1hV3hRh2bubAEnWqwsIufsP99Kh1g7DYCcOIwYQImI+HOewUup2D5TR/PflI PMwA51tDDlPNpmrMr39iwhwFVjvUS1F2fED5PLAPpwJ+slIDaifoVKHynqnQILVQiQQS i7F5cg6X6HKDz8MTuY+9VOPHiDdI3uo9TLWZOi7mtaBYTVgDRyUplRFzZzqQpV6u6JmL XOhsVf5N/ogU5m+Mq8PUd9IDKXsKhvP2t/g3mGlLwXIpo9pxtguESF5EN0w1qsuEpB2+ WW4w== 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=4Li0IoaoftCe8hT5jQXHUzrpxDOiLTWMPKmuoigEGQ0=; b=EBE2uLVNr9eiR9u8QBToC3UQcMRn36QrR1t43O5qgYLRnXNfnPDsEgyO1F/FPaU+Ek yCWQcxBAXyyZsLq1WZiyC5t4/ROPJkOKIMC6EQAiJRJq5GoIRXNHJfmd5HMBYZqFuW2W lTagBhpaPzPPFiSUMDfvMvDDgv/+TXG/oRHRoLTpC23eT8rMDAr8noaK7sHG3zltjxoa Qsremc3Oc5fXBdOa7wTA5Lb+/i7+DRpGmIffvcKxkT0YHMXpDX+YZQjivy08fPosB7Na KRkvMDRINu0x6Ld2dRuJMQxsjl5muqyL133C+ogljUWZkefIpJVhYdmX06J8uQrrTphi lSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EfyUjB1B; 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 c26si745917edx.353.2019.10.25.00.51.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:51:10 -0700 (PDT) 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=EfyUjB1B; 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]:57158 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuNH-0001sX-UM for patch@linaro.org; Fri, 25 Oct 2019 03:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40514) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtq3-0004p4-P8 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpz-0007F2-H3 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:47 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:37490) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpz-0007Dg-4H for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:43 -0400 Received: by mail-wr1-x441.google.com with SMTP id e11so1035500wrv.4 for ; Fri, 25 Oct 2019 00:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Li0IoaoftCe8hT5jQXHUzrpxDOiLTWMPKmuoigEGQ0=; b=EfyUjB1BIUdWeeTOY4RdIbTBXxiX7XJm2T4kPyMUAM4q+be0fv6dCP+Exzr/80utti wtaB8XZ9utZKLqHPD499x6xt0k1JBsUbAbgMTno0Z77gmbwjBhAe39bxAnQtP5jIXMqv IVSztGGwPHzRDnzCbuQenjpVOdP9/jdyhJR6uSP6TR1znqdqht4Tftbd6/J8XttGVbAp iZWRCXWIRNb4m9YLI4XmGs9sarfcwIHS0el+lEj59SiDZ3txeyzfQCQvFyk8XJ8jCpGV BEtFvock9kz+d3yiyN7WrMOHKxSxQ/DTPoS9J5OZFkHcQM/+WvVa+OACbaBRNwThfbpc OVOQ== 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=4Li0IoaoftCe8hT5jQXHUzrpxDOiLTWMPKmuoigEGQ0=; b=McVwhMl2ZLBoBe5DeK8w/rFitNGFjY0Ib2H0NHfBemwGblV2fpEs94h68G11Xs+pKB gjKKrTa7MXm9bKJQpjfgn767pOYvaGRoljPsSFLxfuiBAeRAOC3cn4Xl22GMDDUgx0AL g8eC+azGfPi46FpbVomrEqFn6ILwHf6olNrZEZ4g8cM8+7DeEf9xFtUjgy/stA19c18e sVobt+GIDj0ysRMRSZF8xqKdveoCDw4ZecqFE43QuegxRq5Q9T7g6t5WItMTm0yIKXGv kE29vqZpWhibwh3k9SgzkFvV5hkygo677EFXgYrsNm6jeq6is886Lh2RUjhNMv1KFLIk FDlw== X-Gm-Message-State: APjAAAUi7PddCPwlbwVF2h0CjOMxTbnjIkqLdvCNES6ea+S3RppgWj6E 3ZVUGn8kaprOm9gQHcbAOT670w== X-Received: by 2002:a5d:464f:: with SMTP id j15mr1420857wrs.366.1571987800015; Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w8sm1900999wrr.44.2019.10.25.00.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E1C0B1FFAE; Fri, 25 Oct 2019 07:37:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 23/73] plugin: add core code Date: Fri, 25 Oct 2019 07:36:23 +0100 Message-Id: <20191025063713.23374-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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 , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota [AJB: moved directory and merged various fixes] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/Makefile b/Makefile index 0e994a275d4..94d25185511 100644 --- a/Makefile +++ b/Makefile @@ -853,7 +853,11 @@ endif ICON_SIZES=16x16 24x24 32x32 48x48 64x64 128x128 256x256 512x512 -install: all $(if $(BUILD_DOCS),install-doc) install-datadir install-localstatedir \ +install-includedir: + $(INSTALL_DIR) "$(DESTDIR)$(includedir)" + +install: all $(if $(BUILD_DOCS),install-doc) \ + install-datadir install-localstatedir install-includedir \ $(if $(INSTALL_BLOBS),$(edk2-decompressed)) \ recurse-install ifneq ($(TOOLS),) @@ -915,6 +919,9 @@ endif "$(DESTDIR)$(qemu_desktopdir)/qemu.desktop" ifdef CONFIG_GTK $(MAKE) -C po $@ +endif +ifeq ($(CONFIG_PLUGIN),y) + $(INSTALL_DATA) $(SRC_PATH)/include/qemu/qemu-plugin.h "$(DESTDIR)$(includedir)/qemu-plugin.h" endif $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/keymaps" set -e; for x in $(KEYMAPS); do \ diff --git a/Makefile.target b/Makefile.target index 5e916230c43..5de6c95efb8 100644 --- a/Makefile.target +++ b/Makefile.target @@ -119,6 +119,8 @@ obj-y += disas.o obj-$(call notempty,$(TARGET_XML_FILES)) += gdbstub-xml.o LIBS := $(libs_cpu) $(LIBS) +obj-$(CONFIG_PLUGIN) += plugins/ + ######################################################### # Linux user emulator target diff --git a/configure b/configure index 145fcabbb3c..d6fbcf45e4f 100755 --- a/configure +++ b/configure @@ -3616,6 +3616,9 @@ glib_modules=gthread-2.0 if test "$modules" = yes; then glib_modules="$glib_modules gmodule-export-2.0" fi +if test "$plugins" = yes; then + glib_modules="$glib_modules gmodule-2.0" +fi # This workaround is required due to a bug in pkg-config file for glib as it # doesn't define GLIB_STATIC_COMPILATION for pkg-config --static diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 07f2ab05903..e1c383ba846 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -29,6 +29,7 @@ #include "qemu/rcu_queue.h" #include "qemu/queue.h" #include "qemu/thread.h" +#include "qemu/plugin.h" typedef int (*WriteCoreDumpFunction)(const void *buf, size_t size, void *opaque); @@ -344,6 +345,7 @@ struct qemu_work_item; * @trace_dstate_delayed: Delayed changes to trace_dstate (includes all changes * to @trace_dstate). * @trace_dstate: Dynamic tracing state of events for this vCPU (bitmask). + * @plugin_mask: Plugin event bitmap. Modified only via async work. * @ignore_memory_transaction_failures: Cached copy of the MachineState * flag of the same name: allows the board to suppress calling of the * CPU do_transaction_failed hook function. @@ -428,6 +430,10 @@ struct CPUState { DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); + DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX); + + GArray *plugin_mem_cbs; + /* TODO Move common fields from CPUArchState here. */ int cpu_index; int cluster_index; diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h new file mode 100644 index 00000000000..11687e8cdc3 --- /dev/null +++ b/include/qemu/plugin.h @@ -0,0 +1,255 @@ +/* + * Copyright (C) 2017, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef QEMU_PLUGIN_H +#define QEMU_PLUGIN_H + +#include "qemu/config-file.h" +#include "qemu/qemu-plugin.h" +#include "qemu/error-report.h" +#include "qemu/queue.h" +#include "qemu/option.h" + +/* + * Option parsing/processing. + * Note that we can load an arbitrary number of plugins. + */ +struct qemu_plugin_desc; +typedef QTAILQ_HEAD(, qemu_plugin_desc) QemuPluginList; + +#ifdef CONFIG_PLUGIN +extern QemuOptsList qemu_plugin_opts; + +static inline void qemu_plugin_add_opts(void) +{ + qemu_add_opts(&qemu_plugin_opts); +} + +void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head); +int qemu_plugin_load_list(QemuPluginList *head); +#else /* !CONFIG_PLUGIN */ +static inline void qemu_plugin_add_opts(void) +{ } + +static inline void qemu_plugin_opt_parse(const char *optarg, + QemuPluginList *head) +{ + error_report("plugin interface not enabled in this build"); + exit(1); +} + +static inline int qemu_plugin_load_list(QemuPluginList *head) +{ + return 0; +} +#endif /* !CONFIG_PLUGIN */ + +/* + * Events that plugins can subscribe to. + */ +enum qemu_plugin_event { + QEMU_PLUGIN_EV_VCPU_INIT, + QEMU_PLUGIN_EV_VCPU_EXIT, + QEMU_PLUGIN_EV_VCPU_TB_TRANS, + QEMU_PLUGIN_EV_VCPU_IDLE, + QEMU_PLUGIN_EV_VCPU_RESUME, + QEMU_PLUGIN_EV_VCPU_SYSCALL, + QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, + QEMU_PLUGIN_EV_FLUSH, + QEMU_PLUGIN_EV_ATEXIT, + QEMU_PLUGIN_EV_MAX, /* total number of plugin events we support */ +}; + +union qemu_plugin_cb_sig { + qemu_plugin_simple_cb_t simple; + qemu_plugin_udata_cb_t udata; + qemu_plugin_vcpu_simple_cb_t vcpu_simple; + qemu_plugin_vcpu_udata_cb_t vcpu_udata; + qemu_plugin_vcpu_tb_trans_cb_t vcpu_tb_trans; + qemu_plugin_vcpu_mem_cb_t vcpu_mem; + qemu_plugin_vcpu_syscall_cb_t vcpu_syscall; + qemu_plugin_vcpu_syscall_ret_cb_t vcpu_syscall_ret; + void *generic; +}; + +enum plugin_dyn_cb_type { + PLUGIN_CB_INSN, + PLUGIN_CB_MEM, + PLUGIN_N_CB_TYPES, +}; + +enum plugin_dyn_cb_subtype { + PLUGIN_CB_REGULAR, + PLUGIN_CB_INLINE, + PLUGIN_N_CB_SUBTYPES, +}; + +/* + * A dynamic callback has an insertion point that is determined at run-time. + * Usually the insertion point is somewhere in the code cache; think for + * instance of a callback to be called upon the execution of a particular TB. + */ +struct qemu_plugin_dyn_cb { + union qemu_plugin_cb_sig f; + void *userp; + unsigned tcg_flags; + enum plugin_dyn_cb_subtype type; + /* @rw applies to mem callbacks only (both regular and inline) */ + enum qemu_plugin_mem_rw rw; + /* fields specific to each dyn_cb type go here */ + union { + struct { + enum qemu_plugin_op op; + uint64_t imm; + } inline_insn; + }; +}; + +struct qemu_plugin_insn { + GByteArray *data; + uint64_t vaddr; + void *haddr; + GArray *cbs[PLUGIN_N_CB_TYPES][PLUGIN_N_CB_SUBTYPES]; + bool calls_helpers; + bool mem_helper; +}; + +/* + * qemu_plugin_insn allocate and cleanup functions. We don't expect to + * cleanup many of these structures. They are reused for each fresh + * translation. + */ + +static inline void qemu_plugin_insn_cleanup_fn(gpointer data) +{ + struct qemu_plugin_insn *insn = (struct qemu_plugin_insn *) data; + g_byte_array_free(insn->data, true); +} + +static inline struct qemu_plugin_insn *qemu_plugin_insn_alloc(void) +{ + int i, j; + struct qemu_plugin_insn *insn = g_new0(struct qemu_plugin_insn, 1); + insn->data = g_byte_array_sized_new(4); + + for (i = 0; i < PLUGIN_N_CB_TYPES; i++) { + for (j = 0; j < PLUGIN_N_CB_SUBTYPES; j++) { + insn->cbs[i][j] = g_array_new(false, false, + sizeof(struct qemu_plugin_dyn_cb)); + } + } + return insn; +} + +struct qemu_plugin_tb { + GPtrArray *insns; + size_t n; + uint64_t vaddr; + uint64_t vaddr2; + void *haddr1; + void *haddr2; + GArray *cbs[PLUGIN_N_CB_SUBTYPES]; +}; + +/** + * qemu_plugin_tb_insn_get(): get next plugin record for translation. + * + */ +static inline +struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb) +{ + struct qemu_plugin_insn *insn; + int i, j; + + if (unlikely(tb->n == tb->insns->len)) { + struct qemu_plugin_insn *new_insn = qemu_plugin_insn_alloc(); + g_ptr_array_add(tb->insns, new_insn); + } + insn = g_ptr_array_index(tb->insns, tb->n++); + g_byte_array_set_size(insn->data, 0); + insn->calls_helpers = false; + insn->mem_helper = false; + + for (i = 0; i < PLUGIN_N_CB_TYPES; i++) { + for (j = 0; j < PLUGIN_N_CB_SUBTYPES; j++) { + g_array_set_size(insn->cbs[i][j], 0); + } + } + + return insn; +} + +#ifdef CONFIG_PLUGIN + +void qemu_plugin_vcpu_init_hook(CPUState *cpu); +void qemu_plugin_vcpu_exit_hook(CPUState *cpu); +void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb); +void qemu_plugin_vcpu_idle_cb(CPUState *cpu); +void qemu_plugin_vcpu_resume_cb(CPUState *cpu); +void +qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, + uint64_t a2, uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8); +void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_t num, int64_t ret); + +void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, uint32_t meminfo); + +void qemu_plugin_flush_cb(void); + +void qemu_plugin_atexit_cb(void); + +void qemu_plugin_add_dyn_cb_arr(GArray *arr); + +void qemu_plugin_disable_mem_helpers(CPUState *cpu); + +#else /* !CONFIG_PLUGIN */ + +static inline void qemu_plugin_vcpu_init_hook(CPUState *cpu) +{ } + +static inline void qemu_plugin_vcpu_exit_hook(CPUState *cpu) +{ } + +static inline void qemu_plugin_tb_trans_cb(CPUState *cpu, + struct qemu_plugin_tb *tb) +{ } + +static inline void qemu_plugin_vcpu_idle_cb(CPUState *cpu) +{ } + +static inline void qemu_plugin_vcpu_resume_cb(CPUState *cpu) +{ } + +static inline void +qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, uint64_t a6, + uint64_t a7, uint64_t a8) +{ } + +static inline +void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_t num, int64_t ret) +{ } + +static inline void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, + uint32_t meminfo) +{ } + +static inline void qemu_plugin_flush_cb(void) +{ } + +static inline void qemu_plugin_atexit_cb(void) +{ } + +static inline +void qemu_plugin_add_dyn_cb_arr(GArray *arr) +{ } + +static inline void qemu_plugin_disable_mem_helpers(CPUState *cpu) +{ } + +#endif /* !CONFIG_PLUGIN */ + +#endif /* QEMU_PLUGIN_H */ diff --git a/plugins/Makefile.objs b/plugins/Makefile.objs new file mode 100644 index 00000000000..58940335bca --- /dev/null +++ b/plugins/Makefile.objs @@ -0,0 +1,6 @@ +# +# Plugin Support +# + +obj-y += loader.o +obj-y += core.o diff --git a/plugins/core.c b/plugins/core.c new file mode 100644 index 00000000000..9e1b9e7a915 --- /dev/null +++ b/plugins/core.c @@ -0,0 +1,502 @@ +/* + * QEMU Plugin Core code + * + * This is the core code that deals with injecting instrumentation into the code + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019, Linaro + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qemu/config-file.h" +#include "qapi/error.h" +#include "qemu/option.h" +#include "qemu/rcu_queue.h" +#include "qemu/xxhash.h" +#include "qemu/rcu.h" +#include "hw/core/cpu.h" +#include "exec/cpu-common.h" + +#include "cpu.h" +#include "exec/exec-all.h" +#include "exec/helper-proto.h" +#include "sysemu/sysemu.h" +#include "tcg/tcg.h" +#include "tcg/tcg-op.h" +#include "trace/mem-internal.h" /* mem_info macros */ +#include "plugin.h" + +struct qemu_plugin_cb { + struct qemu_plugin_ctx *ctx; + union qemu_plugin_cb_sig f; + void *udata; + QLIST_ENTRY(qemu_plugin_cb) entry; +}; + +struct qemu_plugin_state plugin; + +struct qemu_plugin_ctx *plugin_id_to_ctx_locked(qemu_plugin_id_t id) +{ + struct qemu_plugin_ctx *ctx; + qemu_plugin_id_t *id_p; + + id_p = g_hash_table_lookup(plugin.id_ht, &id); + ctx = container_of(id_p, struct qemu_plugin_ctx, id); + if (ctx == NULL) { + error_report("plugin: invalid plugin id %" PRIu64, id); + abort(); + } + return ctx; +} + +static void plugin_cpu_update__async(CPUState *cpu, run_on_cpu_data data) +{ + bitmap_copy(cpu->plugin_mask, &data.host_ulong, QEMU_PLUGIN_EV_MAX); + cpu_tb_jmp_cache_clear(cpu); +} + +static void plugin_cpu_update__locked(gpointer k, gpointer v, gpointer udata) +{ + CPUState *cpu = container_of(k, CPUState, cpu_index); + run_on_cpu_data mask = RUN_ON_CPU_HOST_ULONG(*plugin.mask); + + if (cpu->created) { + async_run_on_cpu(cpu, plugin_cpu_update__async, mask); + } else { + plugin_cpu_update__async(cpu, mask); + } +} + +void plugin_unregister_cb__locked(struct qemu_plugin_ctx *ctx, + enum qemu_plugin_event ev) +{ + struct qemu_plugin_cb *cb = ctx->callbacks[ev]; + + if (cb == NULL) { + return; + } + QLIST_REMOVE_RCU(cb, entry); + g_free(cb); + ctx->callbacks[ev] = NULL; + if (QLIST_EMPTY_RCU(&plugin.cb_lists[ev])) { + clear_bit(ev, plugin.mask); + g_hash_table_foreach(plugin.cpu_ht, plugin_cpu_update__locked, NULL); + } +} + +static void plugin_vcpu_cb__simple(CPUState *cpu, enum qemu_plugin_event ev) +{ + struct qemu_plugin_cb *cb, *next; + + switch (ev) { + case QEMU_PLUGIN_EV_VCPU_INIT: + case QEMU_PLUGIN_EV_VCPU_EXIT: + case QEMU_PLUGIN_EV_VCPU_IDLE: + case QEMU_PLUGIN_EV_VCPU_RESUME: + /* iterate safely; plugins might uninstall themselves at any time */ + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_simple_cb_t func = cb->f.vcpu_simple; + + func(cb->ctx->id, cpu->cpu_index); + } + break; + default: + g_assert_not_reached(); + } +} + +static void plugin_cb__simple(enum qemu_plugin_event ev) +{ + struct qemu_plugin_cb *cb, *next; + + switch (ev) { + case QEMU_PLUGIN_EV_FLUSH: + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_simple_cb_t func = cb->f.simple; + + func(cb->ctx->id); + } + break; + default: + g_assert_not_reached(); + } +} + +static void plugin_cb__udata(enum qemu_plugin_event ev) +{ + struct qemu_plugin_cb *cb, *next; + + switch (ev) { + case QEMU_PLUGIN_EV_ATEXIT: + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_udata_cb_t func = cb->f.udata; + + func(cb->ctx->id, cb->udata); + } + break; + default: + g_assert_not_reached(); + } +} + +static void +do_plugin_register_cb(qemu_plugin_id_t id, enum qemu_plugin_event ev, + void *func, void *udata) +{ + struct qemu_plugin_ctx *ctx; + + qemu_rec_mutex_lock(&plugin.lock); + ctx = plugin_id_to_ctx_locked(id); + /* if the plugin is on its way out, ignore this request */ + if (unlikely(ctx->uninstalling)) { + goto out_unlock; + } + if (func) { + struct qemu_plugin_cb *cb = ctx->callbacks[ev]; + + if (cb) { + cb->f.generic = func; + cb->udata = udata; + } else { + cb = g_new(struct qemu_plugin_cb, 1); + cb->ctx = ctx; + cb->f.generic = func; + cb->udata = udata; + ctx->callbacks[ev] = cb; + QLIST_INSERT_HEAD_RCU(&plugin.cb_lists[ev], cb, entry); + if (!test_bit(ev, plugin.mask)) { + set_bit(ev, plugin.mask); + g_hash_table_foreach(plugin.cpu_ht, plugin_cpu_update__locked, + NULL); + } + } + } else { + plugin_unregister_cb__locked(ctx, ev); + } + out_unlock: + qemu_rec_mutex_unlock(&plugin.lock); +} + +void plugin_register_cb(qemu_plugin_id_t id, enum qemu_plugin_event ev, + void *func) +{ + do_plugin_register_cb(id, ev, func, NULL); +} + +void +plugin_register_cb_udata(qemu_plugin_id_t id, enum qemu_plugin_event ev, + void *func, void *udata) +{ + do_plugin_register_cb(id, ev, func, udata); +} + +void qemu_plugin_vcpu_init_hook(CPUState *cpu) +{ + bool success; + + qemu_rec_mutex_lock(&plugin.lock); + plugin_cpu_update__locked(&cpu->cpu_index, NULL, NULL); + success = g_hash_table_insert(plugin.cpu_ht, &cpu->cpu_index, + &cpu->cpu_index); + g_assert(success); + qemu_rec_mutex_unlock(&plugin.lock); + + plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_INIT); +} + +void qemu_plugin_vcpu_exit_hook(CPUState *cpu) +{ + bool success; + + plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_EXIT); + + qemu_rec_mutex_lock(&plugin.lock); + success = g_hash_table_remove(plugin.cpu_ht, &cpu->cpu_index); + g_assert(success); + qemu_rec_mutex_unlock(&plugin.lock); +} + +struct plugin_for_each_args { + struct qemu_plugin_ctx *ctx; + qemu_plugin_vcpu_simple_cb_t cb; +}; + +static void plugin_vcpu_for_each(gpointer k, gpointer v, gpointer udata) +{ + struct plugin_for_each_args *args = udata; + int cpu_index = *(int *)k; + + args->cb(args->ctx->id, cpu_index); +} + +void qemu_plugin_vcpu_for_each(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb) +{ + struct plugin_for_each_args args; + + if (cb == NULL) { + return; + } + qemu_rec_mutex_lock(&plugin.lock); + args.ctx = plugin_id_to_ctx_locked(id); + args.cb = cb; + g_hash_table_foreach(plugin.cpu_ht, plugin_vcpu_for_each, &args); + qemu_rec_mutex_unlock(&plugin.lock); +} + +/* Allocate and return a callback record */ +static struct qemu_plugin_dyn_cb *plugin_get_dyn_cb(GArray **arr) +{ + GArray *cbs = *arr; + + if (!cbs) { + cbs = g_array_sized_new(false, false, + sizeof(struct qemu_plugin_dyn_cb), 1); + *arr = cbs; + } + + g_array_set_size(cbs, cbs->len + 1); + return &g_array_index(cbs, struct qemu_plugin_dyn_cb, cbs->len - 1); +} + +void plugin_register_inline_op(GArray **arr, + enum qemu_plugin_mem_rw rw, + enum qemu_plugin_op op, void *ptr, + uint64_t imm) +{ + struct qemu_plugin_dyn_cb *dyn_cb; + + dyn_cb = plugin_get_dyn_cb(arr); + dyn_cb->userp = ptr; + dyn_cb->type = PLUGIN_CB_INLINE; + dyn_cb->rw = rw; + dyn_cb->inline_insn.op = op; + dyn_cb->inline_insn.imm = imm; +} + +static inline uint32_t cb_to_tcg_flags(enum qemu_plugin_cb_flags flags) +{ + uint32_t ret; + + switch (flags) { + case QEMU_PLUGIN_CB_RW_REGS: + ret = 0; + case QEMU_PLUGIN_CB_R_REGS: + ret = TCG_CALL_NO_WG; + break; + case QEMU_PLUGIN_CB_NO_REGS: + default: + ret = TCG_CALL_NO_RWG; + } + return ret; +} + +inline void +plugin_register_dyn_cb__udata(GArray **arr, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, void *udata) +{ + struct qemu_plugin_dyn_cb *dyn_cb = plugin_get_dyn_cb(arr); + + dyn_cb->userp = udata; + dyn_cb->tcg_flags = cb_to_tcg_flags(flags); + dyn_cb->f.vcpu_udata = cb; + dyn_cb->type = PLUGIN_CB_REGULAR; +} + +void plugin_register_vcpu_mem_cb(GArray **arr, + void *cb, + enum qemu_plugin_cb_flags flags, + enum qemu_plugin_mem_rw rw, + void *udata) +{ + struct qemu_plugin_dyn_cb *dyn_cb; + + dyn_cb = plugin_get_dyn_cb(arr); + dyn_cb->userp = udata; + dyn_cb->tcg_flags = cb_to_tcg_flags(flags); + dyn_cb->type = PLUGIN_CB_REGULAR; + dyn_cb->rw = rw; + dyn_cb->f.generic = cb; +} + +void qemu_plugin_tb_trans_cb(CPUState *cpu, struct qemu_plugin_tb *tb) +{ + struct qemu_plugin_cb *cb, *next; + enum qemu_plugin_event ev = QEMU_PLUGIN_EV_VCPU_TB_TRANS; + + /* no plugin_mask check here; caller should have checked */ + + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_tb_trans_cb_t func = cb->f.vcpu_tb_trans; + + func(cb->ctx->id, tb); + } +} + +void +qemu_plugin_vcpu_syscall(CPUState *cpu, int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8) +{ + struct qemu_plugin_cb *cb, *next; + enum qemu_plugin_event ev = QEMU_PLUGIN_EV_VCPU_SYSCALL; + + if (!test_bit(ev, cpu->plugin_mask)) { + return; + } + + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_syscall_cb_t func = cb->f.vcpu_syscall; + + func(cb->ctx->id, cpu->cpu_index, num, a1, a2, a3, a4, a5, a6, a7, a8); + } +} + +void qemu_plugin_vcpu_syscall_ret(CPUState *cpu, int64_t num, int64_t ret) +{ + struct qemu_plugin_cb *cb, *next; + enum qemu_plugin_event ev = QEMU_PLUGIN_EV_VCPU_SYSCALL_RET; + + if (!test_bit(ev, cpu->plugin_mask)) { + return; + } + + QLIST_FOREACH_SAFE_RCU(cb, &plugin.cb_lists[ev], entry, next) { + qemu_plugin_vcpu_syscall_ret_cb_t func = cb->f.vcpu_syscall_ret; + + func(cb->ctx->id, cpu->cpu_index, num, ret); + } +} + +void qemu_plugin_vcpu_idle_cb(CPUState *cpu) +{ + plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_IDLE); +} + +void qemu_plugin_vcpu_resume_cb(CPUState *cpu) +{ + plugin_vcpu_cb__simple(cpu, QEMU_PLUGIN_EV_VCPU_RESUME); +} + +void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_IDLE, cb); +} + +void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_RESUME, cb); +} + +void qemu_plugin_register_flush_cb(qemu_plugin_id_t id, + qemu_plugin_simple_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_FLUSH, cb); +} + +static bool free_dyn_cb_arr(void *p, uint32_t h, void *userp) +{ + g_array_free((GArray *) p, true); + return true; +} + +void qemu_plugin_flush_cb(void) +{ + qht_iter_remove(&plugin.dyn_cb_arr_ht, free_dyn_cb_arr, NULL); + qht_reset(&plugin.dyn_cb_arr_ht); + + plugin_cb__simple(QEMU_PLUGIN_EV_FLUSH); +} + +void exec_inline_op(struct qemu_plugin_dyn_cb *cb) +{ + uint64_t *val = cb->userp; + + switch (cb->inline_insn.op) { + case QEMU_PLUGIN_INLINE_ADD_U64: + *val += cb->inline_insn.imm; + break; + default: + g_assert_not_reached(); + } +} + +void qemu_plugin_vcpu_mem_cb(CPUState *cpu, uint64_t vaddr, uint32_t info) +{ + GArray *arr = cpu->plugin_mem_cbs; + size_t i; + + if (arr == NULL) { + return; + } + for (i = 0; i < arr->len; i++) { + struct qemu_plugin_dyn_cb *cb = + &g_array_index(arr, struct qemu_plugin_dyn_cb, i); + int w = !!(info & TRACE_MEM_ST) + 1; + + if (!(w & cb->rw)) { + break; + } + switch (cb->type) { + case PLUGIN_CB_REGULAR: + cb->f.vcpu_mem(cpu->cpu_index, info, vaddr, cb->userp); + break; + case PLUGIN_CB_INLINE: + exec_inline_op(cb); + break; + default: + g_assert_not_reached(); + } + } +} + +void qemu_plugin_atexit_cb(void) +{ + plugin_cb__udata(QEMU_PLUGIN_EV_ATEXIT); +} + +void qemu_plugin_register_atexit_cb(qemu_plugin_id_t id, + qemu_plugin_udata_cb_t cb, + void *udata) +{ + plugin_register_cb_udata(id, QEMU_PLUGIN_EV_ATEXIT, cb, udata); +} + +/* + * Call this function after longjmp'ing to the main loop. It's possible that the + * last instruction of a TB might have used helpers, and therefore the + * "disable" instruction will never execute because it ended up as dead code. + */ +void qemu_plugin_disable_mem_helpers(CPUState *cpu) +{ + cpu->plugin_mem_cbs = NULL; +} + +static bool plugin_dyn_cb_arr_cmp(const void *ap, const void *bp) +{ + return ap == bp; +} + +static void __attribute__((__constructor__)) plugin_init(void) +{ + int i; + + for (i = 0; i < QEMU_PLUGIN_EV_MAX; i++) { + QLIST_INIT(&plugin.cb_lists[i]); + } + qemu_rec_mutex_init(&plugin.lock); + plugin.id_ht = g_hash_table_new(g_int64_hash, g_int64_equal); + plugin.cpu_ht = g_hash_table_new(g_int_hash, g_int_equal); + QTAILQ_INIT(&plugin.ctxs); + qht_init(&plugin.dyn_cb_arr_ht, plugin_dyn_cb_arr_cmp, 16, + QHT_MODE_AUTO_RESIZE); + atexit(qemu_plugin_atexit_cb); +} diff --git a/plugins/loader.c b/plugins/loader.c new file mode 100644 index 00000000000..eaedff577c3 --- /dev/null +++ b/plugins/loader.c @@ -0,0 +1,362 @@ +/* + * QEMU Plugin Core Loader Code + * + * This is the code responsible for loading and unloading the plugins. + * Aside from the basic housekeeping tasks we also need to ensure any + * generated code is flushed when we remove a plugin so we cannot end + * up calling and unloaded helper function. + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019, Linaro + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qemu/config-file.h" +#include "qapi/error.h" +#include "qemu/option.h" +#include "qemu/rcu_queue.h" +#include "qemu/qht.h" +#include "qemu/bitmap.h" +#include "qemu/xxhash.h" +#include "qemu/plugin.h" +#include "hw/core/cpu.h" +#include "cpu.h" +#include "exec/exec-all.h" +#include "plugin.h" + +/* + * For convenience we use a bitmap for plugin.mask, but really all we need is a + * u32, which is what we store in TranslationBlock. + */ +QEMU_BUILD_BUG_ON(QEMU_PLUGIN_EV_MAX > 32); + +struct qemu_plugin_desc { + char *path; + char **argv; + QTAILQ_ENTRY(qemu_plugin_desc) entry; + int argc; +}; + +struct qemu_plugin_parse_arg { + QemuPluginList *head; + struct qemu_plugin_desc *curr; +}; + +QemuOptsList qemu_plugin_opts = { + .name = "plugin", + .implied_opt_name = "file", + .head = QTAILQ_HEAD_INITIALIZER(qemu_plugin_opts.head), + .desc = { + /* do our own parsing to support multiple plugins */ + { /* end of list */ } + }, +}; + +typedef int (*qemu_plugin_install_func_t)(qemu_plugin_id_t, int, char **); + +extern struct qemu_plugin_state plugin; + +void qemu_plugin_add_dyn_cb_arr(GArray *arr) +{ + uint32_t hash = qemu_xxhash2((uint64_t)(uintptr_t)arr); + bool inserted; + + inserted = qht_insert(&plugin.dyn_cb_arr_ht, arr, hash, NULL); + g_assert(inserted); +} + +static struct qemu_plugin_desc *plugin_find_desc(QemuPluginList *head, + const char *path) +{ + struct qemu_plugin_desc *desc; + + QTAILQ_FOREACH(desc, head, entry) { + if (strcmp(desc->path, path) == 0) { + return desc; + } + } + return NULL; +} + +static int plugin_add(void *opaque, const char *name, const char *value, + Error **errp) +{ + struct qemu_plugin_parse_arg *arg = opaque; + struct qemu_plugin_desc *p; + + if (strcmp(name, "file") == 0) { + if (strcmp(value, "") == 0) { + error_setg(errp, "requires a non-empty argument"); + return 1; + } + p = plugin_find_desc(arg->head, value); + if (p == NULL) { + p = g_new0(struct qemu_plugin_desc, 1); + p->path = g_strdup(value); + QTAILQ_INSERT_TAIL(arg->head, p, entry); + } + arg->curr = p; + } else if (strcmp(name, "arg") == 0) { + if (arg->curr == NULL) { + error_setg(errp, "missing earlier '-plugin file=' option"); + return 1; + } + p = arg->curr; + p->argc++; + p->argv = g_realloc_n(p->argv, p->argc, sizeof(char *)); + p->argv[p->argc - 1] = g_strdup(value); + } else { + error_setg(errp, "-plugin: unexpected parameter '%s'; ignored", name); + } + return 0; +} + +void qemu_plugin_opt_parse(const char *optarg, QemuPluginList *head) +{ + struct qemu_plugin_parse_arg arg; + QemuOpts *opts; + + opts = qemu_opts_parse_noisily(qemu_find_opts("plugin"), optarg, true); + if (opts == NULL) { + exit(1); + } + arg.head = head; + arg.curr = NULL; + qemu_opt_foreach(opts, plugin_add, &arg, &error_fatal); + qemu_opts_del(opts); +} + +/* + * From: https://en.wikipedia.org/wiki/Xorshift + * This is faster than rand_r(), and gives us a wider range (RAND_MAX is only + * guaranteed to be >= INT_MAX). + */ +static uint64_t xorshift64star(uint64_t x) +{ + x ^= x >> 12; /* a */ + x ^= x << 25; /* b */ + x ^= x >> 27; /* c */ + return x * UINT64_C(2685821657736338717); +} + +static int plugin_load(struct qemu_plugin_desc *desc) +{ + qemu_plugin_install_func_t install; + struct qemu_plugin_ctx *ctx; + gpointer sym; + int rc; + + ctx = qemu_memalign(qemu_dcache_linesize, sizeof(*ctx)); + memset(ctx, 0, sizeof(*ctx)); + ctx->desc = desc; + + ctx->handle = g_module_open(desc->path, G_MODULE_BIND_LOCAL); + if (ctx->handle == NULL) { + error_report("%s: %s", __func__, g_module_error()); + goto err_dlopen; + } + + if (!g_module_symbol(ctx->handle, "qemu_plugin_install", &sym)) { + error_report("%s: %s", __func__, g_module_error()); + goto err_symbol; + } + install = (qemu_plugin_install_func_t) sym; + /* symbol was found; it could be NULL though */ + if (install == NULL) { + error_report("%s: %s: qemu_plugin_install is NULL", + __func__, desc->path); + goto err_symbol; + } + + qemu_rec_mutex_lock(&plugin.lock); + + /* find an unused random id with &ctx as the seed */ + ctx->id = (uint64_t)(uintptr_t)ctx; + for (;;) { + void *existing; + + ctx->id = xorshift64star(ctx->id); + existing = g_hash_table_lookup(plugin.id_ht, &ctx->id); + if (likely(existing == NULL)) { + bool success; + + success = g_hash_table_insert(plugin.id_ht, &ctx->id, &ctx->id); + g_assert(success); + break; + } + } + QTAILQ_INSERT_TAIL(&plugin.ctxs, ctx, entry); + ctx->installing = true; + rc = install(ctx->id, desc->argc, desc->argv); + ctx->installing = false; + if (rc) { + error_report("%s: qemu_plugin_install returned error code %d", + __func__, rc); + /* + * we cannot rely on the plugin doing its own cleanup, so + * call a full uninstall if the plugin did not yet call it. + */ + if (!ctx->uninstalling) { + plugin_reset_uninstall(ctx->id, NULL, false); + } + } + + qemu_rec_mutex_unlock(&plugin.lock); + return rc; + + err_symbol: + err_dlopen: + qemu_vfree(ctx); + return 1; +} + +/* call after having removed @desc from the list */ +static void plugin_desc_free(struct qemu_plugin_desc *desc) +{ + int i; + + for (i = 0; i < desc->argc; i++) { + g_free(desc->argv[i]); + } + g_free(desc->argv); + g_free(desc->path); + g_free(desc); +} + +/** + * qemu_plugin_load_list - load a list of plugins + * @head: head of the list of descriptors of the plugins to be loaded + * + * Returns 0 if all plugins in the list are installed, !0 otherwise. + * + * Note: the descriptor of each successfully installed plugin is removed + * from the list given by @head. + */ +int qemu_plugin_load_list(QemuPluginList *head) +{ + struct qemu_plugin_desc *desc, *next; + + QTAILQ_FOREACH_SAFE(desc, head, entry, next) { + int err; + + err = plugin_load(desc); + if (err) { + return err; + } + QTAILQ_REMOVE(head, desc, entry); + } + return 0; +} + +struct qemu_plugin_reset_data { + struct qemu_plugin_ctx *ctx; + qemu_plugin_simple_cb_t cb; + bool reset; +}; + +static void plugin_reset_destroy__locked(struct qemu_plugin_reset_data *data) +{ + struct qemu_plugin_ctx *ctx = data->ctx; + enum qemu_plugin_event ev; + bool success; + + /* + * After updating the subscription lists there is no need to wait for an RCU + * grace period to elapse, because right now we either are in a "safe async" + * work environment (i.e. all vCPUs are asleep), or no vCPUs have yet been + * created. + */ + for (ev = 0; ev < QEMU_PLUGIN_EV_MAX; ev++) { + plugin_unregister_cb__locked(ctx, ev); + } + + if (data->reset) { + g_assert(ctx->resetting); + if (data->cb) { + data->cb(ctx->id); + } + ctx->resetting = false; + g_free(data); + return; + } + + g_assert(ctx->uninstalling); + /* we cannot dlclose if we are going to return to plugin code */ + if (ctx->installing) { + error_report("Calling qemu_plugin_uninstall from the install function " + "is a bug. Instead, return !0 from the install function."); + abort(); + } + + success = g_hash_table_remove(plugin.id_ht, &ctx->id); + g_assert(success); + QTAILQ_REMOVE(&plugin.ctxs, ctx, entry); + if (data->cb) { + data->cb(ctx->id); + } + if (!g_module_close(ctx->handle)) { + warn_report("%s: %s", __func__, g_module_error()); + } + plugin_desc_free(ctx->desc); + qemu_vfree(ctx); + g_free(data); +} + +static void plugin_reset_destroy(struct qemu_plugin_reset_data *data) +{ + qemu_rec_mutex_lock(&plugin.lock); + plugin_reset_destroy__locked(data); + qemu_rec_mutex_lock(&plugin.lock); +} + +static void plugin_flush_destroy(CPUState *cpu, run_on_cpu_data arg) +{ + struct qemu_plugin_reset_data *data = arg.host_ptr; + + g_assert(cpu_in_exclusive_context(cpu)); + tb_flush(cpu); + plugin_reset_destroy(data); +} + +void plugin_reset_uninstall(qemu_plugin_id_t id, + qemu_plugin_simple_cb_t cb, + bool reset) +{ + struct qemu_plugin_reset_data *data; + struct qemu_plugin_ctx *ctx; + + qemu_rec_mutex_lock(&plugin.lock); + ctx = plugin_id_to_ctx_locked(id); + if (ctx->uninstalling || (reset && ctx->resetting)) { + qemu_rec_mutex_unlock(&plugin.lock); + return; + } + ctx->resetting = reset; + ctx->uninstalling = !reset; + qemu_rec_mutex_unlock(&plugin.lock); + + data = g_new(struct qemu_plugin_reset_data, 1); + data->ctx = ctx; + data->cb = cb; + data->reset = reset; + /* + * Only flush the code cache if the vCPUs have been created. If so, + * current_cpu must be non-NULL. + */ + if (current_cpu) { + async_safe_run_on_cpu(current_cpu, plugin_flush_destroy, + RUN_ON_CPU_HOST_PTR(data)); + } else { + /* + * If current_cpu isn't set, then we don't have yet any vCPU threads + * and we therefore can remove the callbacks synchronously. + */ + plugin_reset_destroy(data); + } +} diff --git a/plugins/plugin.h b/plugins/plugin.h new file mode 100644 index 00000000000..5482168d797 --- /dev/null +++ b/plugins/plugin.h @@ -0,0 +1,97 @@ +/* + * Plugin Shared Internal Functions + * + * Copyright (C) 2019, Linaro + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _PLUGIN_INTERNAL_H_ +#define _PLUGIN_INTERNAL_H_ + +#include + +/* global state */ +struct qemu_plugin_state { + QTAILQ_HEAD(, qemu_plugin_ctx) ctxs; + QLIST_HEAD(, qemu_plugin_cb) cb_lists[QEMU_PLUGIN_EV_MAX]; + /* + * Use the HT as a hash map by inserting k == v, which saves memory as + * documented by GLib. The parent struct is obtained with container_of(). + */ + GHashTable *id_ht; + /* + * Use the HT as a hash map. Note that we could use a list here, + * but with the HT we avoid adding a field to CPUState. + */ + GHashTable *cpu_ht; + DECLARE_BITMAP(mask, QEMU_PLUGIN_EV_MAX); + /* + * @lock protects the struct as well as ctx->uninstalling. + * The lock must be acquired by all API ops. + * The lock is recursive, which greatly simplifies things, e.g. + * callback registration from qemu_plugin_vcpu_for_each(). + */ + QemuRecMutex lock; + /* + * HT of callbacks invoked from helpers. All entries are freed when + * the code cache is flushed. + */ + struct qht dyn_cb_arr_ht; +}; + + +struct qemu_plugin_ctx { + GModule *handle; + qemu_plugin_id_t id; + struct qemu_plugin_cb *callbacks[QEMU_PLUGIN_EV_MAX]; + QTAILQ_ENTRY(qemu_plugin_ctx) entry; + /* + * keep a reference to @desc until uninstall, so that plugins do not have + * to strdup plugin args. + */ + struct qemu_plugin_desc *desc; + bool installing; + bool uninstalling; + bool resetting; +}; + +struct qemu_plugin_ctx *plugin_id_to_ctx_locked(qemu_plugin_id_t id); + +void plugin_register_inline_op(GArray **arr, + enum qemu_plugin_mem_rw rw, + enum qemu_plugin_op op, void *ptr, + uint64_t imm); + +void plugin_reset_uninstall(qemu_plugin_id_t id, + qemu_plugin_simple_cb_t cb, + bool reset); + +void plugin_register_cb(qemu_plugin_id_t id, enum qemu_plugin_event ev, + void *func); + +void plugin_unregister_cb__locked(struct qemu_plugin_ctx *ctx, + enum qemu_plugin_event ev); + +void +plugin_register_cb_udata(qemu_plugin_id_t id, enum qemu_plugin_event ev, + void *func, void *udata); + +void +plugin_register_dyn_cb__udata(GArray **arr, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, void *udata); + + +void plugin_register_vcpu_mem_cb(GArray **arr, + void *cb, + enum qemu_plugin_cb_flags flags, + enum qemu_plugin_mem_rw rw, + void *udata); + +void exec_inline_op(struct qemu_plugin_dyn_cb *cb); + +#endif /* _PLUGIN_INTERNAL_H_ */ From patchwork Fri Oct 25 06:36:24 2019 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: 177639 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3251972ill; Fri, 25 Oct 2019 00:01:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQaD3kMulKTotJ+g5nOoOK7oAmzHMyLghG2mrwoEgn0EKfpN0yEfJ5gwjKDUO0LImvJKOr X-Received: by 2002:a17:906:4cd2:: with SMTP id q18mr1843813ejt.319.1571986880955; Fri, 25 Oct 2019 00:01:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986880; cv=none; d=google.com; s=arc-20160816; b=uPYB4XP7uYbb92eAiGmprM3honC0t0L3d1FJFHS7YPN3eznDuxLd/XWip9/0EKOdss 4u3uQynYQdyzVyipj4wT7rC4Cn3p+nB6aQ9Qxq1CEkDf1XM1sPyJ7MDaC7QbofywahAC dqsbeZ0QdbCt+DxS/EBc4crU92TQfw+A1JB0sw2z9HZZCi1862W0er7eHCOk1F9ghlO8 b15pFa2bwhz+T6mQ5zhJXA4DFU5WkWnVz7Os+CyuArU8lSHtpl+Ab8xMWVBqGlYtiBqV SYodAh5NPL9DXw3zZn9Y/9o0GY7Og7fI6/mn9Ygf9TWhEfD3Su0tK1wBrY9x/gDzOpY4 uG+A== 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=5s3tXkniHiajMAZNtKExssnEt0SyXXt6OlkPAhkKoaE=; b=aeNArPTLw779iTZQk6Qj6fq7Rk1KQiJK9qEEgmGQpjeYaLKrLu0ckEFQpmece/w2O2 CuqEKGbRG4WcZnI7jrP5FxUZ5euvhnnUqCVsdphuVbbje6UK/e47iUTc46p73IP/JscC S14AXaq1ce93A/GdeLTN5kkOgaflAaqIg32uIoK8KF/SxFZUxQklcepobrvTQsoou/z4 g1dFexS+ACuY0fUwmuNPWVM73hSV4gFhUfOOCa3sdI8TDsq4xmjDOssd0RLKDGxyLHL8 PssBlYkeppaC/X/p0ERqcLWJXN7blkW0RD/tfZbwhRBUcsob2TiLVk8FDY3e1cQkNLm4 Qweg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=umCVsXGM; 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 h50si606364ede.423.2019.10.25.00.01.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:01:20 -0700 (PDT) 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=umCVsXGM; 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]:56306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtb4-0003S1-Nu for patch@linaro.org; Fri, 25 Oct 2019 03:01:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35647) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE7-0003R3-DP for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE5-0008Ta-N6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:35 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46558) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE5-0008Sk-Di for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:33 -0400 Received: by mail-wr1-x436.google.com with SMTP id n15so884427wrw.13 for ; Thu, 24 Oct 2019 23:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5s3tXkniHiajMAZNtKExssnEt0SyXXt6OlkPAhkKoaE=; b=umCVsXGMBtAu/jr8nW+NF/cOtEuni1LXVmt2ofgPfrrPzCUGpMjajlKdxGpJRJp2SR SxLeWFaXOEqm0FMQB5YRMYs5e6SiRLs9pwwMYBO6xOYchw73Agdijvl52bUCV6hpmVlZ W3s6AEIjmST47maYbYjgeR/P1c9fcBWj1PEnmpljjOiHCIfPA6pETccd8+E5+3bUh7eV h6hM8pYb2BGhp9eM3IdOLBhDn+KroKqfzJc7xU6ZLzsG2VwRGqRyhhzo99np3NybwUY+ LveofiqsVt+Z9mXWqI7hiD3qIOrbAgyRXr69DfbJFWNqNyYmSloyyqHjRcCnzKhkU/zl jsdw== 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=5s3tXkniHiajMAZNtKExssnEt0SyXXt6OlkPAhkKoaE=; b=RfqWN13CM8okaqlIWw3DNP2/Pq/jeO1FCH0VmdZKdZbc/H1ciINU514MFbagtcwSR7 5KINGpMeU9UxbWu+TZRfuzo6LZTbplCwGA9x2tLaPOHC6LrFqXoEk/mbE7J1z1/QVINj rbjQnE+4swDTGsub+OtemVPHFgQNNhiWOQtocmCeDzuXjN9AmtFsUlW22YWY+wRiJHti uGAtlYXlq8MdVh9oHnbBZBUXfNcQSBM0VIXk+wSq512jACK80/gADwI3eYr3CcNguzgr oiUsx1BcwtNQPricuJKN5n+7UQda2/l+48wsfM7RnEtZeqIh+XYWUqeKxYDKbP+PRNKz BeJA== X-Gm-Message-State: APjAAAX3l/8rzMqkdqBE7aUX0eHPhDS7j8eeubY8VhyKTmSovMwoWDgD O8pSe5Hj4hVwUgyRoUTn9UwNfw== X-Received: by 2002:a5d:4f04:: with SMTP id c4mr1214440wru.373.1571985452190; Thu, 24 Oct 2019 23:37:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id i18sm1291336wrx.14.2019.10.24.23.37.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 068CA1FFAF; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 24/73] plugin: add implementation of the api Date: Fri, 25 Oct 2019 07:36:24 +0100 Message-Id: <20191025063713.23374-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" [AJB: split from the core code commit] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index d9c1ca3b4cf..b9a4a4b6841 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -285,9 +285,6 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr); -bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr); -uint64_t qemu_plugin_hwaddr_to_raddr(const struct qemu_plugin_hwaddr *haddr); - typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, qemu_plugin_meminfo_t info, uint64_t vaddr, diff --git a/plugins/Makefile.objs b/plugins/Makefile.objs index 58940335bca..95baabf3d2f 100644 --- a/plugins/Makefile.objs +++ b/plugins/Makefile.objs @@ -4,3 +4,4 @@ obj-y += loader.o obj-y += core.o +obj-y += api.o diff --git a/plugins/api.c b/plugins/api.c new file mode 100644 index 00000000000..facf2a132de --- /dev/null +++ b/plugins/api.c @@ -0,0 +1,277 @@ +/* + * QEMU Plugin API + * + * This provides the API that is available to the plugins to interact + * with QEMU. We have to be careful not to expose internal details of + * how QEMU works so we abstract out things like translation and + * instructions to anonymous data types: + * + * qemu_plugin_tb + * qemu_plugin_insn + * + * Which can then be passed back into the API to do additional things. + * As such all the public functions in here are exported in + * qemu-plugin.h. + * + * The general life-cycle of a plugin is: + * + * - plugin is loaded, public qemu_plugin_install called + * - the install func registers callbacks for events + * - usually an atexit_cb is registered to dump info at the end + * - when a registered event occurs the plugin is called + * - some events pass additional info + * - during translation the plugin can decide to instrument any + * instruction + * - when QEMU exits all the registered atexit callbacks are called + * + * Copyright (C) 2017, Emilio G. Cota + * Copyright (C) 2019, Linaro + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * SPDX-License-Identifier: GPL-2.0-or-later + * + */ + +#include "qemu/osdep.h" +#include "qemu/plugin.h" +#include "cpu.h" +#include "sysemu/sysemu.h" +#include "tcg/tcg.h" +#include "trace/mem-internal.h" /* mem_info macros */ +#include "plugin.h" +#ifndef CONFIG_USER_ONLY +#include "hw/boards.h" +#endif + +/* Uninstall and Reset handlers */ + +void qemu_plugin_uninstall(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +{ + plugin_reset_uninstall(id, cb, false); +} + +void qemu_plugin_reset(qemu_plugin_id_t id, qemu_plugin_simple_cb_t cb) +{ + plugin_reset_uninstall(id, cb, true); +} + +/* + * Plugin Register Functions + * + * This allows the plugin to register callbacks for various events + * during the translation. + */ + +void qemu_plugin_register_vcpu_init_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_INIT, cb); +} + +void qemu_plugin_register_vcpu_exit_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_simple_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_EXIT, cb); +} + +void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, + void *udata) +{ + plugin_register_dyn_cb__udata(&tb->cbs[PLUGIN_CB_REGULAR], + cb, flags, udata); +} + +void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, + enum qemu_plugin_op op, + void *ptr, uint64_t imm) +{ + plugin_register_inline_op(&tb->cbs[PLUGIN_CB_INLINE], 0, op, ptr, imm); +} + +void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, + qemu_plugin_vcpu_udata_cb_t cb, + enum qemu_plugin_cb_flags flags, + void *udata) +{ + plugin_register_dyn_cb__udata(&insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_REGULAR], + cb, flags, udata); +} + +void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *insn, + enum qemu_plugin_op op, + void *ptr, uint64_t imm) +{ + plugin_register_inline_op(&insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_INLINE], + 0, op, ptr, imm); +} + + + +void qemu_plugin_register_vcpu_mem_cb(struct qemu_plugin_insn *insn, + qemu_plugin_vcpu_mem_cb_t cb, + enum qemu_plugin_cb_flags flags, + enum qemu_plugin_mem_rw rw, + void *udata) +{ + plugin_register_vcpu_mem_cb(&insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_REGULAR], + cb, flags, rw, udata); +} + +void qemu_plugin_register_vcpu_mem_inline(struct qemu_plugin_insn *insn, + enum qemu_plugin_mem_rw rw, + enum qemu_plugin_op op, void *ptr, + uint64_t imm) +{ + plugin_register_inline_op(&insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_INLINE], + rw, op, ptr, imm); +} + +void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_tb_trans_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_TB_TRANS, cb); +} + +void qemu_plugin_register_vcpu_syscall_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_syscall_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL, cb); +} + +void +qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, + qemu_plugin_vcpu_syscall_ret_cb_t cb) +{ + plugin_register_cb(id, QEMU_PLUGIN_EV_VCPU_SYSCALL_RET, cb); +} + +/* + * Plugin Queries + * + * These are queries that the plugin can make to gauge information + * from our opaque data types. We do not want to leak internal details + * here just information useful to the plugin. + */ + +/* + * Translation block information: + * + * A plugin can query the virtual address of the start of the block + * and the number of instructions in it. It can also get access to + * each translated instruction. + */ + +size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb) +{ + return tb->n; +} + +uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb) +{ + return tb->vaddr; +} + +struct qemu_plugin_insn * +qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx) +{ + if (unlikely(idx >= tb->n)) { + return NULL; + } + return g_ptr_array_index(tb->insns, idx); +} + +/* + * Instruction information + * + * These queries allow the plugin to retrieve information about each + * instruction being translated. + */ + +const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn) +{ + return insn->data->data; +} + +size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn) +{ + return insn->data->len; +} + +uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn) +{ + return insn->vaddr; +} + +void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) +{ + return insn->haddr; +} + +/* + * The memory queries allow the plugin to query information about a + * memory access. + */ + +unsigned qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info) +{ + return info & TRACE_MEM_SZ_SHIFT_MASK; +} + +bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info) +{ + return !!(info & TRACE_MEM_SE); +} + +bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info) +{ + return !!(info & TRACE_MEM_BE); +} + +bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info) +{ + return !!(info & TRACE_MEM_ST); +} + +/* + * Virtual Memory queries + */ + +struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, + uint64_t vaddr) +{ + return NULL; +} + +/* + * Queries to the number and potential maximum number of vCPUs there + * will be. This helps the plugin dimension per-vcpu arrays. + */ + +#ifndef CONFIG_USER_ONLY +static MachineState * get_ms(void) +{ + return MACHINE(qdev_get_machine()); +} +#endif + +int qemu_plugin_n_vcpus(void) +{ +#ifdef CONFIG_USER_ONLY + return -1; +#else + return get_ms()->smp.cpus; +#endif +} + +int qemu_plugin_n_max_vcpus(void) +{ +#ifdef CONFIG_USER_ONLY + return -1; +#else + return get_ms()->smp.max_cpus; +#endif +} From patchwork Fri Oct 25 06:36:25 2019 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: 177646 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3260868ill; Fri, 25 Oct 2019 00:09:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7HwaiNrzpUA00rh/MjuLnAJPWRIBWeaZziNnkOr9q0EERYMIXYUq2Qypc7XwiyWg4adu2 X-Received: by 2002:a17:906:6d82:: with SMTP id h2mr1942942ejt.127.1571987357330; Fri, 25 Oct 2019 00:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987357; cv=none; d=google.com; s=arc-20160816; b=VT76cdP2afd3Cw8cYzxAhfBkgumHUcVp6sjythxka9IKw0zK/SbA31yxdGjulJd8io 6G9IRRFXiYCycEsFi5S44UbVT1ZCl3xutDVklBKMNWaflBIT4tc/xpao0Z12sxSk7oGf BJwCvUYk9fV8mafxti9bjl65/Gl2Z+J4URpgUvcsHM7qXzgJEdEMUc4EFREZhrs55uAa 1w6nxl0ha4ggdtLODP2AjpALDV6jCqIlo9cUlsfo2rG89wF+26UxVO7QS2cpXoDAKptO Oga6eL7mPE+bMNXH3boVhrLStus8rgGZHLuEy1fnUR1ALv4PScGcwrKgF9uI+YQa9mht Pr+A== 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=ARdcrEhdcWtFfl52Az/c8K3t0fy2I7ICblv42Psekak=; b=DN36xUn0cAA1KQKMH6z+t8nMnNzJYqvfdu6ztwtR0BTlVVhGHnMjVsXKxmRSqkdkqv sRICJ74SouSRbvPcTTkIB4YzeI+8TNgzbRXL4FFqliPphLEMzBetc41CGF8zxtLsfB30 5j9YKSKA7tRoNS+G4ynSSYpgLlLhOcAqGt6M1SisbzC6mZeR8v5x88q4FLVRGjTR904l SIsAPvZ59ecdbaz64yfnN+c9vuv0YIEoyFDnuSB+xW4iGeINbVQBuCfh6lQRknyD020x hQrOKapkGUCQWCvhpUF/YXfG35evtHf4jk0oRGM6zKM4aOY2L4B1C0a7Dg/oNlzhgPxd Am1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=e+vrO2MI; 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 f13si671304edl.170.2019.10.25.00.09.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:09:17 -0700 (PDT) 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=e+vrO2MI; 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]:56428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtil-0007AF-H3 for patch@linaro.org; Fri, 25 Oct 2019 03:09:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38146) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWW-0003EK-HU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWV-0007bX-Aj for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:36 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:53062) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWV-0007Z1-35 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:35 -0400 Received: by mail-wm1-x32b.google.com with SMTP id p21so809691wmg.2 for ; Thu, 24 Oct 2019 23:56:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ARdcrEhdcWtFfl52Az/c8K3t0fy2I7ICblv42Psekak=; b=e+vrO2MIyhFMxPEB1Oau06arYJkfr516sbLEQhJS/M7YK6z1PspKhe4VuSzgjcdERd /ub0RUvlAV9S+7ThGXabpaxGHqgXCEO1owMugwt+jGaziRXyDZxnW/jA6z85SHCWjorG KeMrHWSLdDU0qF0izLYu4DhRnSOy6E+SwdFAUbUY3NOILIsuZW3xITkaNQgb9ogHmaSc 5bIUCXYIW0zrPLJh7nVXQ24JS/AXqYaQQ1PoZwfrilz0hlnRyPq1hI11Jw9F+NBmMGEd OHI1iNvNCZMaDidi3e6i4r3OCYRoSCMlun/b4472oP3bcjRIViWCn2w9wpD58Li3uBaO /GAg== 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=ARdcrEhdcWtFfl52Az/c8K3t0fy2I7ICblv42Psekak=; b=U7a57fBKbfQ5xoh0C2EPKZ77/Trnt44JH75dNqsKRIYRGZu8pWpmHwLn6zwXqx3AnD LctjGLLmdAhP2S9wR+Dkmlo/qtSNccmiRd3W/FDyNyFt1IUbDlQ2AvfB/eNnKODS7i30 Oq4wOyIY64MpssClP83Dy2KRD6Ue0f2OysxKNSc4l2gXYzMYKQP33rvMJ5m0k/08ubmJ C4Ht5WBnww0mou0oYStRY5V0RniRSvix0UqWT0h2w/svyu97O3hkkHb5UewPZnaTuGQT jkaRgHGlsedmwOmXZek+f4TOZbLiuaVPj6/s+AxWC9Pq5pKEoaUjSMSJM8Pv7W5G63ja g1bQ== X-Gm-Message-State: APjAAAWPTjxZnIySyNAgZPmrdZqi3f3JTyqYgZjkVSE8YKJJZGbZgYog iH3DMv0YHuMLaXZncUvPfDFl2A== X-Received: by 2002:a1c:5641:: with SMTP id k62mr1916872wmb.97.1571986593641; Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a71sm1205364wme.11.2019.10.24.23.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1A89C1FF8C; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 25/73] queue: add QTAILQ_REMOVE_SEVERAL Date: Fri, 25 Oct 2019 07:36:25 +0100 Message-Id: <20191025063713.23374-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This is faster than removing elements one by one. Will gain a user soon. Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/qemu/queue.h b/include/qemu/queue.h index 73bf4a984d8..4764d93ea3f 100644 --- a/include/qemu/queue.h +++ b/include/qemu/queue.h @@ -420,6 +420,16 @@ union { \ (elm)->field.tqe_circ.tql_prev = NULL; \ } while (/*CONSTCOND*/0) +/* remove @left, @right and all elements in between from @head */ +#define QTAILQ_REMOVE_SEVERAL(head, left, right, field) do { \ + if (((right)->field.tqe_next) != NULL) \ + (right)->field.tqe_next->field.tqe_circ.tql_prev = \ + (left)->field.tqe_circ.tql_prev; \ + else \ + (head)->tqh_circ.tql_prev = (left)->field.tqe_circ.tql_prev; \ + (left)->field.tqe_circ.tql_prev->tql_next = (right)->field.tqe_next; \ + } while (/*CONSTCOND*/0) + #define QTAILQ_FOREACH(var, head, field) \ for ((var) = ((head)->tqh_first); \ (var); \ From patchwork Fri Oct 25 06:36:26 2019 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: 177694 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3302195ill; Fri, 25 Oct 2019 00:49:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxeZTDBTZil28SOYwFHc/DGN6qus6qjZn9yH2i1AkZrdYMOo/i8fuPOyOSS+lqN2AUOmhQ6 X-Received: by 2002:a05:6402:643:: with SMTP id u3mr2440868edx.60.1571989752549; Fri, 25 Oct 2019 00:49:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989752; cv=none; d=google.com; s=arc-20160816; b=LiSWB5dm5pRczygTXvTVMSyiG6fnwUMIhnR56eZgc+1W2I/Pc/OHRBue9QVj78K7+A zoQSwp9a3z/Qfsxjyrk7LLBpFoVKXpYZoehcSGU+vL5093lKvHXhLXI8ofQAm0uquYZg vgp+koMfi0RU/lNbQnnCOdbwLvNKQozZxphgtT7h9Q7PV5SgF8R95DAsHyeEq1swVDwh SFnqnyGrxwcLhyioy00x37fMZuC8QiGwkTMtVkkV9K7zHEQxK3gBdJVqIM0uI3TaNjZq z4f1YmD0+oDiT6Orx6nMlDrZ/BeQe1IX/glGmr/3BVGqBzX92cW1K5zxX8DebRzwL6IQ 63kA== 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=x4NCzYC99zoESCZyFO/budr+59cfbMJoRMt7ZJOzWZo=; b=APMJIABUJvYPJlNCQuJKRzWVPI+paTDD8h8ySwZsuCySUeCN8c8lG8Im6TtgHadQ1h terClRl+23GBj1uiic8BVAjSZF6Dq4TfMRKXlH7WG/MvdiFzNvc2oSz0TMe9cpvQJ3uQ H5pZqQgzFKdorEnDd56YsiryULLpVKi59NfzcN6Uu1ZM/56609vrZKhMV6+OmeVIiOhh 8zrpRnP/l6lkBiDQ243vacma3i8x7Ldek5ogGfPoWeZEoKTP0priudOP8u5FbG0aFWv3 1/uvo5IhoOObxN5+pCe/W+RrB7Vxpo+OYKYLtcd47wH+tImQK8pdicEpUMn4c6E77vak n+Ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OSQ0wPaQ; 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 p25si726161eji.211.2019.10.25.00.49.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:49:12 -0700 (PDT) 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=OSQ0wPaQ; 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]:57120 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuLO-0005Yy-ES for patch@linaro.org; Fri, 25 Oct 2019 03:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40504) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtq2-0004m7-Id for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtq1-0007G9-9h for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:46 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:36842) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtq1-0007Fa-3T for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:45 -0400 Received: by mail-wr1-x430.google.com with SMTP id w18so1044229wrt.3 for ; Fri, 25 Oct 2019 00:16:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x4NCzYC99zoESCZyFO/budr+59cfbMJoRMt7ZJOzWZo=; b=OSQ0wPaQ3ag3mCuDwABCaH20SIneB8V1zyejbabQKTWq7Ug+37t2WRuqGJpiEJiYwd 9t2iQxebV4ZFzAKHz0cjv2ToxfPSc0eOx1sgeSvCfkYZaemK98Und2KkAmYVdo2eoMfG L+UI9YZihO/3JQK1XjGqRLcI+3m7emphnCWMrIcIFlMCSt5MBm4UKNTtaIKHYYsxeztM BDRyUxEG7NWqlgC+w+Ac5Cp1vPDRIt1oG4OYOhGOJErXrwN135vQDc9m7IcQiKqL56l+ o3y/A0avVRGbXQSOzQvyjehKxsXerusqC7eUj912hjBB02TIdErkwF0lIkJl2BUmiHnH +l4A== 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=x4NCzYC99zoESCZyFO/budr+59cfbMJoRMt7ZJOzWZo=; b=khsZTc7lcHsgG3Mw0sFol+FsNIgMEKD/fI7/NF408mnnEfYq+aGtR7Dp09Bdp7O607 fDOI0Av1O0W5GS6cAQee0MY4KlAV0P/rINvS12gUF4gsMd2XATVJbugm605HPrLMzShh LzxBgcaTB3J85k61w2uUA5gwLo4W9SljDMAmLsY5+pkbCO8LNDTaJ7HjPXXxx7TNJskB 3O6ULUvZj/jEMpGyHYPCl+VvjJsKFQ66LP1kSJC+a1Dyr8KZ9uW3kV6Bkv7FhruUwUuy Et0xExQ0ZbiCbER5W+sGjM1RheOF8VGcvvE6lbDMME5o6LLmBlm/gWzJlueyiARDM3o4 5Uqw== X-Gm-Message-State: APjAAAU6GrNEYVz+LZDTtbxh24GXWQI0AeeJnhxHTkPPRnD8OASCra2w hidwJAUXBGWFJjCawlXaH+/0qA== X-Received: by 2002:adf:cf11:: with SMTP id o17mr1419556wrj.284.1571987803926; Fri, 25 Oct 2019 00:16:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k8sm2558155wrg.15.2019.10.25.00.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2EA6F1FFB1; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 26/73] cputlb: document get_page_addr_code Date: Fri, 25 Oct 2019 07:36:26 +0100 Message-Id: <20191025063713.23374-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Suggested-by: Alex Bennée Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 04795c49bf4..e4206cb1735 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -504,7 +504,15 @@ void mmap_lock(void); void mmap_unlock(void); bool have_mmap_lock(void); -static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr) +/** + * get_page_addr_code() - user-mode version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * Returns @addr. + */ +static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, + target_ulong addr) { return addr; } @@ -512,8 +520,18 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} -/* cputlb.c */ -tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr); +/** + * get_page_addr_code() - full-system version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * If we cannot translate and execute from the entire RAM page, or if + * the region is not backed by RAM, returns -1. Otherwise, returns the + * ram_addr_t corresponding to the guest code at @addr. + * + * Note: this function can trigger an exception. + */ +tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr); void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); From patchwork Fri Oct 25 06:36:27 2019 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: 177691 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3295306ill; Fri, 25 Oct 2019 00:43:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqz6dTvtvBTnANPgZEHum+f/GIP26/G5+lpZGnUiUE7TZ55p4hBP/Mn/niKWBb8EJx7PCT6y X-Received: by 2002:ac8:549:: with SMTP id c9mr1719408qth.178.1571989405644; Fri, 25 Oct 2019 00:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989405; cv=none; d=google.com; s=arc-20160816; b=w19UbCn3SrYxO8p+8FrRDhLUOZQl44Kz3JL1NIszHdFdThXgTw4n8AaYvK/4eHbinK dOEfBLGBigUTfeaWbLyDd9mvJlwFgdfhc8kNM++iT8Vs76XL92IoonZ4J4T7Bz0xh9dO c0xfsAr3hlNg3QWbSciUaGSYpVrZfPsq5BkyNuyOz4ptfhslt3F5LhuU2Xi0yf7OFmuH x+oSzdlTmvEIloOXhhWjAdBWTC/umH2a2zrpoRJTbKUi3HsT5w2Icgqpi4KDblatFR3e k9Se3YG6XDevE/3Dx4ee+a3zHLbcub8N8tnKPdVwQ3L8B9zjntRZjeMPgaP/YNHxvA2e 6tLA== 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=3XXJ55rizfMHVWoEJhJkoN6kRNivslxLA8FD/i7sBTY=; b=ou8ExHxdK9mt4/S5zU1VVzUCCYBMHCJX5a1mP4md6R8u6qXYIJzFDSKuez10bHHyUW HXHDC2bThbKf1Uglna/iHO882hr9gmhK13CTSrdYI9ByunUyszXTqjO42Uh/xTX3YOt2 uZ2lozKcNzVn7WnvvVPCsdywxfOELlsvTh6xi7Q0xADkMZYIGeX4iKYywrJKfFrGLDSE /JYD4lr53b3+0B7ZIrvPOd/3HkPCzckZ2/6CSHDqGaoHh2ziq37H30Y4tZgWUw5gg6ki WsN/6DL2z842KgK9pjEaWV9M/zXQaRwYbaglNnEe7X7sGpPanf27drkqt22SCkiwMMBn DYDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="FaFhvQ/e"; 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 b5si850840qke.196.2019.10.25.00.43.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:43:25 -0700 (PDT) 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="FaFhvQ/e"; 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]:57036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuFo-0007ke-U3 for patch@linaro.org; Fri, 25 Oct 2019 03:43:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38292) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWe-0003aK-DQ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWd-0007nl-00 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:44 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:50925) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWc-0007nD-Q6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: by mail-wm1-x329.google.com with SMTP id 11so816786wmk.0 for ; Thu, 24 Oct 2019 23:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3XXJ55rizfMHVWoEJhJkoN6kRNivslxLA8FD/i7sBTY=; b=FaFhvQ/enAlj+6/0IvcSBmfqTXmTymOIKmSBTlm1ijCY4WQHLpTPp69ahLvxk//dtB gR+xCBSBqy2oiYbuEtxlygsiX/zQB5zFcnue1mwxdLKxCcBw3UUnQ6ZXkmaQm+fE0Ye8 L1wG5d9s0ZPDukEQqn/dZem9GpJF8M+8UEoERfKmKPOAbo+Lx1zNHOhnfguYCWYtbHJT vOCOiRX69aOEhyHlXbOIgBLYXEa7GCGrBgW52MIjOjz6g7Z/ZHRdjQwxCwYvx2NEdnVj Q88IYpZZHzJRiWVYt0uSpu55kI3I1QRExt3IPFyHzloZo3OifbjbvTBgFmpV5vPdxi7t 0UjQ== 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=3XXJ55rizfMHVWoEJhJkoN6kRNivslxLA8FD/i7sBTY=; b=HMNIIGTm0yh65DHenfXtHUphKPqQwuwfASrU4z0DHFi59DG6JXHYK9/TF8NArPH+G0 bUOPPUhIycoiB6Mnj8cax38brPfZDOTR6q2HA94hSFvU2G4Y5lzy/fxl+yCQktPP6gem 82O4rsiaSW6cIR0pesPSpmVL3KXui8uVEBMBJh0mcWAafH4KKXKiyxbr/Val80/bAiHA Uhk0lwfaDxtR69m+YnC5e96YO8igi52860ZXIcjd8/4vJAG7eW8LLJD0JV/rbfSLDl49 adF24/xY571J21pMqKeQaumN+Id+PByXUURWjTrPOB1umI/4cbp8f01CKEhQAtg3KnbZ sfaw== X-Gm-Message-State: APjAAAUPWj3BlvHZdiCto9KK5injMyUMv5NpnGlmHgJZU2XQNXaS398j B6dhhqQypFYxjTCXj4VJEtIM6g== X-Received: by 2002:a1c:2344:: with SMTP id j65mr2052716wmj.38.1571986601666; Thu, 24 Oct 2019 23:56:41 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o18sm1632403wrm.11.2019.10.24.23.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4428E1FFB3; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 27/73] cputlb: introduce get_page_addr_code_hostp Date: Fri, 25 Oct 2019 07:36:27 +0100 Message-Id: <20191025063713.23374-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This will be used by plugins to get the host address of instructions. Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index a8f90695823..82a5783a2bc 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1051,7 +1051,8 @@ static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, * NOTE: This function will trigger an exception if the page is * not executable. */ -tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr) +tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr, + void **hostp) { uintptr_t mmu_idx = cpu_mmu_index(env, true); uintptr_t index = tlb_index(env, mmu_idx, addr); @@ -1077,13 +1078,24 @@ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr) if (unlikely(entry->addr_code & TLB_MMIO)) { /* The region is not backed by RAM. */ + if (hostp) { + *hostp = NULL; + } return -1; } p = (void *)((uintptr_t)addr + entry->addend); + if (hostp) { + *hostp = p; + } return qemu_ram_addr_from_host_nofail(p); } +tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr) +{ + return get_page_addr_code_hostp(env, addr, NULL); +} + static void notdirty_write(CPUState *cpu, vaddr mem_vaddr, unsigned size, CPUIOTLBEntry *iotlbentry, uintptr_t retaddr) { diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index e4206cb1735..eadcf29d0c4 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -22,6 +22,7 @@ #include "cpu.h" #include "exec/tb-context.h" +#include "exec/cpu_ldst.h" #include "sysemu/cpus.h" /* allow to see translation results - the slowdown should be negligible, so we leave it */ @@ -516,6 +517,26 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, { return addr; } + +/** + * get_page_addr_code_hostp() - user-mode version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * Returns @addr. + * + * If @hostp is non-NULL, sets *@hostp to the host address where @addr's content + * is kept. + */ +static inline tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, + target_ulong addr, + void **hostp) +{ + if (hostp) { + *hostp = g2h(addr); + } + return addr; +} #else static inline void mmap_lock(void) {} static inline void mmap_unlock(void) {} @@ -533,6 +554,23 @@ static inline void mmap_unlock(void) {} */ tb_page_addr_t get_page_addr_code(CPUArchState *env, target_ulong addr); +/** + * get_page_addr_code_hostp() - full-system version + * @env: CPUArchState + * @addr: guest virtual address of guest code + * + * See get_page_addr_code() (full-system version) for documentation on the + * return value. + * + * Sets *@hostp (when @hostp is non-NULL) as follows. + * If the return value is -1, sets *@hostp to NULL. Otherwise, sets *@hostp + * to the host address where @addr's content is kept. + * + * Note: this function can trigger an exception. + */ +tb_page_addr_t get_page_addr_code_hostp(CPUArchState *env, target_ulong addr, + void **hostp); + void tlb_reset_dirty(CPUState *cpu, ram_addr_t start1, ram_addr_t length); void tlb_set_dirty(CPUState *cpu, target_ulong vaddr); From patchwork Fri Oct 25 06:36:28 2019 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: 177642 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3256931ill; Fri, 25 Oct 2019 00:05:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqziOfyUhQ4MUHXLocZ2gxPDA6HXZ/vpnL/bHKgQnsMqewE2Yax0H6tSlLlLp4CYvGJ3krl7 X-Received: by 2002:a05:620a:38d:: with SMTP id q13mr1548954qkm.314.1571987137167; Fri, 25 Oct 2019 00:05:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987137; cv=none; d=google.com; s=arc-20160816; b=w8Uk5Zf/AGgBGLauVnr9zatJwNHnFHyiNS5WAuWgkb4Fe6uS2Cx3eE+5IgV/DPC+of P1QBkiNKuEMv2rKvQC/EVWjRmztIO/XJboX8KBWRLXMjlx4rLQno/0JpjBq3sI8czRu8 hO1IdiWyNF0TLyPgu0Uwkej/NPdDBaNsmRMSgz57E4zRMGXGIS5tu+YcsME5Y1zLCHf7 QN85HZRlx5HpxxEYQKhSngNxLdN/+RqD/FCypx3Ph/UkU+dCgurVnORpNF4SyTeC9QtP OsmU7UQUi0k9rpuPQTpwXrUe+axUdqBcve+zzWZp0gx+ZC5CunanssDCmEgpQnv7Ufgf AUiA== 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=d77se2AWHQTDPWAjRF6o7tLkcsKtKX6IpL5FuyPE0Bw=; b=Ng8AcPwr30V7OZtdZCRdgrJu+31susxxpXkGH3MCS601THf6ZFcBF9JAkxlQTJUbUa 4QLc3UTA/KgbYQuNq4UJzBBsr+CrXx1Laxp7j0jiK6T2yJx0zUtbUWa0jB8h4tW2pOBp gDDKff3bY8Sais9bz4eRwjQ9Vs77a3bi/u25q3vE0znUv3cm+xgNHax5ikw+k9MQPpaG 1URUUPUqRebD0DV70w+kt4F/njgVSNUWRawLzUMSs+1tM/wOoz9aPXwQIqKv4Ni7FrXy k4isEFVwARqrzkiVUwECyDURVEtlrKmbBMbbsVAblpPklUEOVSmApWW+Wz1gNhZAEC00 9GCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pNMhZ45J; 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 m23si722391qtp.225.2019.10.25.00.05.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:05:37 -0700 (PDT) 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=pNMhZ45J; 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]:56374 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtfD-0005uf-AB for patch@linaro.org; Fri, 25 Oct 2019 03:05:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36989) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN2-000864-UM for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMz-0003Ci-UY for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:47 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:51313) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMu-0003A4-4J for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:40 -0400 Received: by mail-wm1-x334.google.com with SMTP id q70so790819wme.1 for ; Thu, 24 Oct 2019 23:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d77se2AWHQTDPWAjRF6o7tLkcsKtKX6IpL5FuyPE0Bw=; b=pNMhZ45JBOvME59FiyNdglxMN/f9D8Do0wWVkbQIRwk5VNcrXvPBM/jZwGD9SfzL1q mAf4e5Eio+quxIUZYCFNvCsdew4uO0u01TWodA0NQs9vOELS7lgC1887gYmoLZsvI8om GrrRePeBaSy58RazAhCfiWTA2w/D8bRJYy0OtVg/2EQAz16VpbyO69IKwy90VknEH+Gb s0dYMXNYrtlvIzmFyaWeXbg6Sl55ASe2aXXzvh46zWjyNuz0hDgpnlAzDHtvcNAO+0RC uvZR8H5DtRoKZduEeuGPsU3Y7+61GdP2aOh3dyeGMBjvKABDE0F//lozLJ2GOSMlZgBV EyIg== 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=d77se2AWHQTDPWAjRF6o7tLkcsKtKX6IpL5FuyPE0Bw=; b=NbX2+U0QXFGR0AJYzmhnsvKvGPTNF/8bsVNgkC0Fy6nSOn/EwcuR/sVRO+qjyAocHJ 368yl9Y0mXPJFb3/N6am6uhqAn0uZRoOMa7B7LNICShpb+9NARWr/XwyLTbkNms5CUuj 33+o3LHMhRe/309qEsBej6TzQwgSkoCcaP2HtweSzlrAApXzWFtnrRFUyFyv2lqUxXYa oR5EI+XOJ49ffT2EyBaeW7tEncMwlttcDYsXqyxy3MMa2jfBCwTo4NWmh2VS/tccOSjV 7hyXCzNi3Q17z9itzsGsNFzw3suxKYXn6RrIOtbmXNwUVx1LySpnddQESGKWPXthveu5 0Cjw== X-Gm-Message-State: APjAAAVnzO1QvkcnnC4NnMVffSLNrMhD49gRs1GMRMEnli5EbsPiZpoM wVVj7kkGLuPqu+9kbKTGMvuKZA== X-Received: by 2002:a05:600c:2487:: with SMTP id 7mr1855217wms.164.1571985998432; Thu, 24 Oct 2019 23:46:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n187sm1570516wmb.47.2019.10.24.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 574441FFB4; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 28/73] tcg: add tcg_gen_st_ptr Date: Fri, 25 Oct 2019 07:36:28 +0100 Message-Id: <20191025063713.23374-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Will gain a user soon. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index e9cf172762e..7c778f96f3b 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -1249,6 +1249,11 @@ static inline void tcg_gen_ld_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o) glue(tcg_gen_ld_,PTR)((NAT)r, a, o); } +static inline void tcg_gen_st_ptr(TCGv_ptr r, TCGv_ptr a, intptr_t o) +{ + glue(tcg_gen_st_, PTR)((NAT)r, a, o); +} + static inline void tcg_gen_discard_ptr(TCGv_ptr a) { glue(tcg_gen_discard_,PTR)((NAT)a); From patchwork Fri Oct 25 06:36:29 2019 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: 177702 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3318513ill; Fri, 25 Oct 2019 01:02:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxtUSXdtCf+A/R/DrKGqxnD7MUIldj6u9D1xgnNslEK/KMWfqWSo8/H7ld42bpx1Ew9mXi X-Received: by 2002:a05:6402:b17:: with SMTP id bm23mr2460711edb.6.1571990564416; Fri, 25 Oct 2019 01:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571990564; cv=none; d=google.com; s=arc-20160816; b=jy9KGfZ9cN8Fw3/f7U4J5X7Dx/w3PlM0kw661wm0+R4gF/nFRkTMkffrCT8FTNK1aR alYH27tzLvFR8+K8WhL/kXMuk/pVFY1e/Mse0o1Cp1HqPwuBtRewfG56ECnLIGa/bmmK DHom/KZWrwz5hDi8giMGT8qULGi/BvA97GHoIvcfwyKpkLAMzmYrywp/2yR6GB8wc6BX 0cExrNiYNXxdZhEDgNIIWC/DCwjHY9SpBguhwPDyKp1m6EjhK5tTNEFOhUF0EGEsZh+9 3bQXSEQsWfirYcg86g62CGTKnuTdPtPdQaEhWqELG45scvGgZPxLi0thT4hoUHQFfzOp Qvkw== 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=hdiK7MiqgQ+vVrAsT7VDLlk93moHeARlVFqasEobaSA=; b=kfT3JBL8H4EpRkCnn4qBXm3lVqYzEWObrqsudX0hFmDBWY0xsBUyCCqHjoQUW9nsUr uKvSKrl0igU93UXxM/7HB5EnCd4IKiVxdByxt/+tvKmAaQtnPDIOG+xFYrUX/1xjryUu toTvOsNU2lQeAXx161IqWjtYmLXWMCyUQM+J1QR5gd+mjN2gw47F1jldiBoR60Qwd9nm a5F5cGTyQKY4wjbipWwW3HswE7FvGMJFgrfic/Bv1JqZCsLlBoKxACYb8C56OYUWR7AI gAgcMA9kkco6kuWVO0ZrIwaWP2QssDeCPIAKJsCHpzQgRMtbYL9CQFcrtQYJ//3reuPH s9ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=M2kewBm6; 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 a11si946212edj.143.2019.10.25.01.02.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 01:02:44 -0700 (PDT) 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=M2kewBm6; 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]:57336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuYV-0007rq-4N for patch@linaro.org; Fri, 25 Oct 2019 04:02:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44936) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuSe-00067e-Is for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNuSa-00080B-Rs for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:40 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:52521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNuSa-0007yD-Ew for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:36 -0400 Received: by mail-wm1-x32d.google.com with SMTP id p21so994968wmg.2 for ; Fri, 25 Oct 2019 00:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hdiK7MiqgQ+vVrAsT7VDLlk93moHeARlVFqasEobaSA=; b=M2kewBm6c12zOdP1GTipw7c+lYp/PYJMB34bivIeot5bjMH2fVoAU078h0odlnSLKX 4gNN5Pr25wXL9g6MJWxlJoWUihK9iiTkxOf2MKVYicB5Z2vegR0DkmrAF5umCONCEWbQ +bab6eTEXyLI9ARw4yQXl44GRX/Viz6wH6sfzv3U0dd51Aw/P86eP+Kks8Hb9zvstICD kXheM3xL8VBpMfHZ5jhr69ZLdXz0X42BkbRv6Rpn+BKmjcv3TuBHGsO8sXkXsYnHJiXP DRwB2QHsPHv1c6FR7Q+BIVej/9GtssP7Vshd/R4RNzYJaVAsNMdq09koJKXHb2E9SpBc dsdw== 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=hdiK7MiqgQ+vVrAsT7VDLlk93moHeARlVFqasEobaSA=; b=lF81sCPfwdjgUgCsZHcCqJSA5k1NdwKv4iZ0omYY05UjDKnz9EAxcpAryUcTV3q4rk j1gsklX8dvraC3L0zB071jkWslyx6t+/efDk8Ax4/hzaHs1sIPWXr9XQ28tCqXcg8T2j krMRgKcZZSSouGyf/8OSE/1mnEoIR0aefxxxBrX82oGdPiEb7Mh/fYplAI2zu3RE6bme m8HM3lkwAJCCKnjwo4ddBlPCyH6GMdfoYbLJ1U7Wnhbhe9XOadw5Mw23ZpCyLIUUnSV9 lNow3MkqWKzaIH/ydgVWKdFz9CAtvhOg0eJGrcAJ8kiF88xa+TiKJc5vD6TgqoutF/Z4 uGmg== X-Gm-Message-State: APjAAAWYhh28EfrJzx+hMHJ8LDtfGHDWabSkmO6g8MZtKIL6/Bh/sjYK hqcfHyTrceMdlq9qmE1x8o0oXA== X-Received: by 2002:a1c:9a4f:: with SMTP id c76mr1304898wme.103.1571990194061; Fri, 25 Oct 2019 00:56:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g184sm1912141wma.8.2019.10.25.00.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:56:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7CC821FFB5; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 29/73] plugin-gen: add module for TCG-related code Date: Fri, 25 Oct 2019 07:36:29 +0100 Message-Id: <20191025063713.23374-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32d 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We first inject empty instrumentation from translator_loop. After translation, we go through the plugins to see what they want to register for, filling in the empty instrumentation. If if turns out that some instrumentation remains unused, we remove it. This approach supports the following features: - Inlining TCG code for simple operations. Note that we do not export TCG ops to plugins. Instead, we give them a C API to insert inlined ops. So far we only support adding an immediate to a u64, e.g. to count events. - "Direct" callbacks. These are callbacks that do not go via a helper. Instead, the helper is defined at run-time, so that the plugin code is directly called from TCG. This makes direct callbacks as efficient as possible; they are therefore used for very frequent events, e.g. memory callbacks. - Passing the host address to memory callbacks. Most of this is implemented in a later patch though. - Instrumentation of memory accesses performed from helpers. See the corresponding comment, as well as a later patch. Signed-off-by: Emilio G. Cota [AJB: add alloc_tcg_plugin_context, use glib, rm hwaddr] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/Makefile.objs b/accel/tcg/Makefile.objs index d381a02f347..a92f2c454b9 100644 --- a/accel/tcg/Makefile.objs +++ b/accel/tcg/Makefile.objs @@ -6,3 +6,4 @@ obj-y += translator.o obj-$(CONFIG_USER_ONLY) += user-exec.o obj-$(call lnot,$(CONFIG_SOFTMMU)) += user-exec-stub.o +obj-$(CONFIG_PLUGIN) += plugin-gen.o diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c new file mode 100644 index 00000000000..51580d51a0b --- /dev/null +++ b/accel/tcg/plugin-gen.c @@ -0,0 +1,932 @@ +/* + * plugin-gen.c - TCG-related bits of plugin infrastructure + * + * Copyright (C) 2018, Emilio G. Cota + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * We support instrumentation at an instruction granularity. That is, + * if a plugin wants to instrument the memory accesses performed by a + * particular instruction, it can just do that instead of instrumenting + * all memory accesses. Thus, in order to do this we first have to + * translate a TB, so that plugins can decide what/where to instrument. + * + * Injecting the desired instrumentation could be done with a second + * translation pass that combined the instrumentation requests, but that + * would be ugly and inefficient since we would decode the guest code twice. + * Instead, during TB translation we add "empty" instrumentation calls for all + * possible instrumentation events, and then once we collect the instrumentation + * requests from plugins, we either "fill in" those empty events or remove them + * if they have no requests. + * + * When "filling in" an event we first copy the empty callback's TCG ops. This + * might seem unnecessary, but it is done to support an arbitrary number + * of callbacks per event. Take for example a regular instruction callback. + * We first generate a callback to an empty helper function. Then, if two + * plugins register one callback each for this instruction, we make two copies + * of the TCG ops generated for the empty callback, substituting the function + * pointer that points to the empty helper function with the plugins' desired + * callback functions. After that we remove the empty callback's ops. + * + * Note that the location in TCGOp.args[] of the pointer to a helper function + * varies across different guest and host architectures. Instead of duplicating + * the logic that figures this out, we rely on the fact that the empty + * callbacks point to empty functions that are unique pointers in the program. + * Thus, to find the right location we just have to look for a match in + * TCGOp.args[]. This is the main reason why we first copy an empty callback's + * TCG ops and then fill them in; regardless of whether we have one or many + * callbacks for that event, the logic to add all of them is the same. + * + * When generating more than one callback per event, we make a small + * optimization to avoid generating redundant operations. For instance, for the + * second and all subsequent callbacks of an event, we do not need to reload the + * CPU's index into a TCG temp, since the first callback did it already. + */ +#include "qemu/osdep.h" +#include "cpu.h" +#include "tcg/tcg.h" +#include "tcg/tcg-op.h" +#include "trace/mem.h" +#include "exec/exec-all.h" +#include "exec/plugin-gen.h" +#include "exec/translator.h" + +#ifdef CONFIG_SOFTMMU +# define CONFIG_SOFTMMU_GATE 1 +#else +# define CONFIG_SOFTMMU_GATE 0 +#endif + +/* + * plugin_cb_start TCG op args[]: + * 0: enum plugin_gen_from + * 1: enum plugin_gen_cb + * 2: set to 1 for mem callback that is a write, 0 otherwise. + */ + +enum plugin_gen_from { + PLUGIN_GEN_FROM_TB, + PLUGIN_GEN_FROM_INSN, + PLUGIN_GEN_FROM_MEM, + PLUGIN_GEN_AFTER_INSN, + PLUGIN_GEN_N_FROMS, +}; + +enum plugin_gen_cb { + PLUGIN_GEN_CB_UDATA, + PLUGIN_GEN_CB_INLINE, + PLUGIN_GEN_CB_MEM, + PLUGIN_GEN_ENABLE_MEM_HELPER, + PLUGIN_GEN_DISABLE_MEM_HELPER, + PLUGIN_GEN_N_CBS, +}; + +/* + * These helpers are stubs that get dynamically switched out for calls + * direct to the plugin if they are subscribed to. + */ +void HELPER(plugin_vcpu_udata_cb)(uint32_t cpu_index, void *udata) +{ } + +void HELPER(plugin_vcpu_mem_cb)(unsigned int vcpu_index, + qemu_plugin_meminfo_t info, uint64_t vaddr, + void *userdata) +{ } + +static void do_gen_mem_cb(TCGv vaddr, uint32_t info) +{ + TCGv_i32 cpu_index = tcg_temp_new_i32(); + TCGv_i32 meminfo = tcg_const_i32(info); + TCGv_i64 vaddr64 = tcg_temp_new_i64(); + TCGv_ptr udata = tcg_const_ptr(NULL); + + tcg_gen_ld_i32(cpu_index, cpu_env, + -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); + tcg_gen_extu_tl_i64(vaddr64, vaddr); + + gen_helper_plugin_vcpu_mem_cb(cpu_index, meminfo, vaddr64, udata); + + tcg_temp_free_ptr(udata); + tcg_temp_free_i64(vaddr64); + tcg_temp_free_i32(meminfo); + tcg_temp_free_i32(cpu_index); +} + +static void gen_empty_udata_cb(void) +{ + TCGv_i32 cpu_index = tcg_temp_new_i32(); + TCGv_ptr udata = tcg_const_ptr(NULL); /* will be overwritten later */ + + tcg_gen_ld_i32(cpu_index, cpu_env, + -offsetof(ArchCPU, env) + offsetof(CPUState, cpu_index)); + gen_helper_plugin_vcpu_udata_cb(cpu_index, udata); + + tcg_temp_free_ptr(udata); + tcg_temp_free_i32(cpu_index); +} + +/* + * For now we only support addi_i64. + * When we support more ops, we can generate one empty inline cb for each. + */ +static void gen_empty_inline_cb(void) +{ + TCGv_i64 val = tcg_temp_new_i64(); + TCGv_ptr ptr = tcg_const_ptr(NULL); /* overwritten later */ + + tcg_gen_ld_i64(val, ptr, 0); + /* pass an immediate != 0 so that it doesn't get optimized away */ + tcg_gen_addi_i64(val, val, 0xdeadface); + tcg_gen_st_i64(val, ptr, 0); + tcg_temp_free_ptr(ptr); + tcg_temp_free_i64(val); +} + +static void gen_empty_mem_cb(TCGv addr, uint32_t info) +{ + do_gen_mem_cb(addr, info); +} + +/* + * Share the same function for enable/disable. When enabling, the NULL + * pointer will be overwritten later. + */ +static void gen_empty_mem_helper(void) +{ + TCGv_ptr ptr; + + ptr = tcg_const_ptr(NULL); + tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) - + offsetof(ArchCPU, env)); + tcg_temp_free_ptr(ptr); +} + +static inline +void gen_plugin_cb_start(enum plugin_gen_from from, + enum plugin_gen_cb type, unsigned wr) +{ + TCGOp *op; + + tcg_gen_plugin_cb_start(from, type, wr); + op = tcg_last_op(); + QSIMPLEQ_INSERT_TAIL(&tcg_ctx->plugin_ops, op, plugin_link); +} + +static void gen_wrapped(enum plugin_gen_from from, + enum plugin_gen_cb type, void (*func)(void)) +{ + gen_plugin_cb_start(from, type, 0); + func(); + tcg_gen_plugin_cb_end(); +} + +static inline void plugin_gen_empty_callback(enum plugin_gen_from from) +{ + switch (from) { + case PLUGIN_GEN_AFTER_INSN: + gen_wrapped(from, PLUGIN_GEN_DISABLE_MEM_HELPER, + gen_empty_mem_helper); + break; + case PLUGIN_GEN_FROM_INSN: + /* + * Note: plugin_gen_inject() relies on ENABLE_MEM_HELPER being + * the first callback of an instruction + */ + gen_wrapped(from, PLUGIN_GEN_ENABLE_MEM_HELPER, + gen_empty_mem_helper); + /* fall through */ + case PLUGIN_GEN_FROM_TB: + gen_wrapped(from, PLUGIN_GEN_CB_UDATA, gen_empty_udata_cb); + gen_wrapped(from, PLUGIN_GEN_CB_INLINE, gen_empty_inline_cb); + break; + default: + g_assert_not_reached(); + } +} + +union mem_gen_fn { + void (*mem_fn)(TCGv, uint32_t); + void (*inline_fn)(void); +}; + +static void gen_mem_wrapped(enum plugin_gen_cb type, + const union mem_gen_fn *f, TCGv addr, + uint32_t info, bool is_mem) +{ + int wr = !!(info & TRACE_MEM_ST); + + gen_plugin_cb_start(PLUGIN_GEN_FROM_MEM, type, wr); + if (is_mem) { + f->mem_fn(addr, info); + } else { + f->inline_fn(); + } + tcg_gen_plugin_cb_end(); +} + +void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) +{ + union mem_gen_fn fn; + + fn.mem_fn = gen_empty_mem_cb; + gen_mem_wrapped(PLUGIN_GEN_CB_MEM, &fn, addr, info, true); + + fn.inline_fn = gen_empty_inline_cb; + gen_mem_wrapped(PLUGIN_GEN_CB_INLINE, &fn, 0, info, false); +} + +static TCGOp *find_op(TCGOp *op, TCGOpcode opc) +{ + while (op) { + if (op->opc == opc) { + return op; + } + op = QTAILQ_NEXT(op, link); + } + return NULL; +} + +static TCGOp *rm_ops_range(TCGOp *begin, TCGOp *end) +{ + TCGOp *ret = QTAILQ_NEXT(end, link); + + QTAILQ_REMOVE_SEVERAL(&tcg_ctx->ops, begin, end, link); + return ret; +} + +/* remove all ops until (and including) plugin_cb_end */ +static TCGOp *rm_ops(TCGOp *op) +{ + TCGOp *end_op = find_op(op, INDEX_op_plugin_cb_end); + + tcg_debug_assert(end_op); + return rm_ops_range(op, end_op); +} + +static TCGOp *copy_op_nocheck(TCGOp **begin_op, TCGOp *op) +{ + *begin_op = QTAILQ_NEXT(*begin_op, link); + tcg_debug_assert(*begin_op); + op = tcg_op_insert_after(tcg_ctx, op, (*begin_op)->opc); + memcpy(op->args, (*begin_op)->args, sizeof(op->args)); + return op; +} + +static TCGOp *copy_op(TCGOp **begin_op, TCGOp *op, TCGOpcode opc) +{ + op = copy_op_nocheck(begin_op, op); + tcg_debug_assert((*begin_op)->opc == opc); + return op; +} + +static TCGOp *copy_extu_i32_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* mov_i32 */ + op = copy_op(begin_op, op, INDEX_op_mov_i32); + /* movi_i32 */ + op = copy_op(begin_op, op, INDEX_op_movi_i32); + } else { + /* extu_i32_i64 */ + op = copy_op(begin_op, op, INDEX_op_extu_i32_i64); + } + return op; +} + +static TCGOp *copy_mov_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* 2x mov_i32 */ + op = copy_op(begin_op, op, INDEX_op_mov_i32); + op = copy_op(begin_op, op, INDEX_op_mov_i32); + } else { + /* mov_i64 */ + op = copy_op(begin_op, op, INDEX_op_mov_i64); + } + return op; +} + +static TCGOp *copy_movi_i64(TCGOp **begin_op, TCGOp *op, uint64_t v) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* 2x movi_i32 */ + op = copy_op(begin_op, op, INDEX_op_movi_i32); + op->args[1] = v; + + op = copy_op(begin_op, op, INDEX_op_movi_i32); + op->args[1] = v >> 32; + } else { + /* movi_i64 */ + op = copy_op(begin_op, op, INDEX_op_movi_i64); + op->args[1] = v; + } + return op; +} + +static TCGOp *copy_const_ptr(TCGOp **begin_op, TCGOp *op, void *ptr) +{ + if (UINTPTR_MAX == UINT32_MAX) { + /* movi_i32 */ + op = copy_op(begin_op, op, INDEX_op_movi_i32); + op->args[1] = (uintptr_t)ptr; + } else { + /* movi_i64 */ + op = copy_movi_i64(begin_op, op, (uint64_t)(uintptr_t)ptr); + } + return op; +} + +static TCGOp *copy_const_i64(TCGOp **begin_op, TCGOp *op, uint64_t v) +{ + return copy_movi_i64(begin_op, op, v); +} + +static TCGOp *copy_extu_tl_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TARGET_LONG_BITS == 32) { + /* extu_i32_i64 */ + op = copy_extu_i32_i64(begin_op, op); + } else { + /* mov_i64 */ + op = copy_mov_i64(begin_op, op); + } + return op; +} + +static TCGOp *copy_ld_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* 2x ld_i32 */ + op = copy_op(begin_op, op, INDEX_op_ld_i32); + op = copy_op(begin_op, op, INDEX_op_ld_i32); + } else { + /* ld_i64 */ + op = copy_op(begin_op, op, INDEX_op_ld_i64); + } + return op; +} + +static TCGOp *copy_st_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* 2x st_i32 */ + op = copy_op(begin_op, op, INDEX_op_st_i32); + op = copy_op(begin_op, op, INDEX_op_st_i32); + } else { + /* st_i64 */ + op = copy_op(begin_op, op, INDEX_op_st_i64); + } + return op; +} + +static TCGOp *copy_add_i64(TCGOp **begin_op, TCGOp *op) +{ + if (TCG_TARGET_REG_BITS == 32) { + /* all 32-bit backends must implement add2_i32 */ + g_assert(TCG_TARGET_HAS_add2_i32); + op = copy_op(begin_op, op, INDEX_op_add2_i32); + } else { + op = copy_op(begin_op, op, INDEX_op_add_i64); + } + return op; +} + +static TCGOp *copy_st_ptr(TCGOp **begin_op, TCGOp *op) +{ + if (UINTPTR_MAX == UINT32_MAX) { + /* st_i32 */ + op = copy_op(begin_op, op, INDEX_op_st_i32); + } else { + /* st_i64 */ + op = copy_st_i64(begin_op, op); + } + return op; +} + +static TCGOp *copy_call(TCGOp **begin_op, TCGOp *op, void *empty_func, + void *func, unsigned tcg_flags, int *cb_idx) +{ + /* copy all ops until the call */ + do { + op = copy_op_nocheck(begin_op, op); + } while (op->opc != INDEX_op_call); + + /* fill in the op call */ + op->param1 = (*begin_op)->param1; + op->param2 = (*begin_op)->param2; + tcg_debug_assert(op->life == 0); + if (*cb_idx == -1) { + int i; + + /* + * Instead of working out the position of the callback in args[], just + * look for @empty_func, since it should be a unique pointer. + */ + for (i = 0; i < MAX_OPC_PARAM_ARGS; i++) { + if ((uintptr_t)(*begin_op)->args[i] == (uintptr_t)empty_func) { + *cb_idx = i; + break; + } + } + tcg_debug_assert(i < MAX_OPC_PARAM_ARGS); + } + op->args[*cb_idx] = (uintptr_t)func; + op->args[*cb_idx + 1] = tcg_flags; + + return op; +} + +static TCGOp *append_udata_cb(const struct qemu_plugin_dyn_cb *cb, + TCGOp *begin_op, TCGOp *op, int *cb_idx) +{ + /* const_ptr */ + op = copy_const_ptr(&begin_op, op, cb->userp); + + /* copy the ld_i32, but note that we only have to copy it once */ + begin_op = QTAILQ_NEXT(begin_op, link); + tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); + if (*cb_idx == -1) { + op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32); + memcpy(op->args, begin_op->args, sizeof(op->args)); + } + + /* call */ + op = copy_call(&begin_op, op, HELPER(plugin_vcpu_udata_cb), + cb->f.vcpu_udata, cb->tcg_flags, cb_idx); + + return op; +} + +static TCGOp *append_inline_cb(const struct qemu_plugin_dyn_cb *cb, + TCGOp *begin_op, TCGOp *op, + int *unused) +{ + /* const_ptr */ + op = copy_const_ptr(&begin_op, op, cb->userp); + + /* ld_i64 */ + op = copy_ld_i64(&begin_op, op); + + /* const_i64 */ + op = copy_const_i64(&begin_op, op, cb->inline_insn.imm); + + /* add_i64 */ + op = copy_add_i64(&begin_op, op); + + /* st_i64 */ + op = copy_st_i64(&begin_op, op); + + return op; +} + +static TCGOp *append_mem_cb(const struct qemu_plugin_dyn_cb *cb, + TCGOp *begin_op, TCGOp *op, int *cb_idx) +{ + enum plugin_gen_cb type = begin_op->args[1]; + + tcg_debug_assert(type == PLUGIN_GEN_CB_MEM); + + /* const_i32 == movi_i32 ("info", so it remains as is) */ + op = copy_op(&begin_op, op, INDEX_op_movi_i32); + + /* const_ptr */ + op = copy_const_ptr(&begin_op, op, cb->userp); + + /* copy the ld_i32, but note that we only have to copy it once */ + begin_op = QTAILQ_NEXT(begin_op, link); + tcg_debug_assert(begin_op && begin_op->opc == INDEX_op_ld_i32); + if (*cb_idx == -1) { + op = tcg_op_insert_after(tcg_ctx, op, INDEX_op_ld_i32); + memcpy(op->args, begin_op->args, sizeof(op->args)); + } + + /* extu_tl_i64 */ + op = copy_extu_tl_i64(&begin_op, op); + + if (type == PLUGIN_GEN_CB_MEM) { + /* call */ + op = copy_call(&begin_op, op, HELPER(plugin_vcpu_mem_cb), + cb->f.vcpu_udata, cb->tcg_flags, cb_idx); + } + + return op; +} + +typedef TCGOp *(*inject_fn)(const struct qemu_plugin_dyn_cb *cb, + TCGOp *begin_op, TCGOp *op, int *intp); +typedef bool (*op_ok_fn)(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb); + +static bool op_ok(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb) +{ + return true; +} + +static bool op_rw(const TCGOp *op, const struct qemu_plugin_dyn_cb *cb) +{ + int w; + + w = op->args[2]; + return !!(cb->rw & (w + 1)); +} + +static inline +void inject_cb_type(const GArray *cbs, TCGOp *begin_op, inject_fn inject, + op_ok_fn ok) +{ + TCGOp *end_op; + TCGOp *op; + int cb_idx = -1; + int i; + + if (!cbs || cbs->len == 0) { + rm_ops(begin_op); + return; + } + + end_op = find_op(begin_op, INDEX_op_plugin_cb_end); + tcg_debug_assert(end_op); + + op = end_op; + for (i = 0; i < cbs->len; i++) { + struct qemu_plugin_dyn_cb *cb = + &g_array_index(cbs, struct qemu_plugin_dyn_cb, i); + + if (!ok(begin_op, cb)) { + continue; + } + op = inject(cb, begin_op, op, &cb_idx); + } + rm_ops_range(begin_op, end_op); +} + +static void +inject_udata_cb(const GArray *cbs, TCGOp *begin_op) +{ + inject_cb_type(cbs, begin_op, append_udata_cb, op_ok); +} + +static void +inject_inline_cb(const GArray *cbs, TCGOp *begin_op, op_ok_fn ok) +{ + inject_cb_type(cbs, begin_op, append_inline_cb, ok); +} + +static void +inject_mem_cb(const GArray *cbs, TCGOp *begin_op) +{ + inject_cb_type(cbs, begin_op, append_mem_cb, op_rw); +} + +/* we could change the ops in place, but we can reuse more code by copying */ +static void inject_mem_helper(TCGOp *begin_op, GArray *arr) +{ + TCGOp *orig_op = begin_op; + TCGOp *end_op; + TCGOp *op; + + end_op = find_op(begin_op, INDEX_op_plugin_cb_end); + tcg_debug_assert(end_op); + + /* const ptr */ + op = copy_const_ptr(&begin_op, end_op, arr); + + /* st_ptr */ + op = copy_st_ptr(&begin_op, op); + + rm_ops_range(orig_op, end_op); +} + +/* + * Tracking memory accesses performed from helpers requires extra work. + * If an instruction is emulated with helpers, we do two things: + * (1) copy the CB descriptors, and keep track of it so that they can be + * freed later on, and (2) point CPUState.plugin_mem_cbs to the descriptors, so + * that we can read them at run-time (i.e. when the helper executes). + * This run-time access is performed from qemu_plugin_vcpu_mem_cb. + * + * Note that plugin_gen_disable_mem_helpers undoes (2). Since it + * is possible that the code we generate after the instruction is + * dead, we also add checks before generating tb_exit etc. + */ +static void inject_mem_enable_helper(struct qemu_plugin_insn *plugin_insn, + TCGOp *begin_op) +{ + GArray *cbs[2]; + GArray *arr; + size_t n_cbs, i; + + cbs[0] = plugin_insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_REGULAR]; + cbs[1] = plugin_insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_INLINE]; + + n_cbs = 0; + for (i = 0; i < ARRAY_SIZE(cbs); i++) { + n_cbs += cbs[i]->len; + } + + plugin_insn->mem_helper = plugin_insn->calls_helpers && n_cbs; + if (likely(!plugin_insn->mem_helper)) { + rm_ops(begin_op); + return; + } + + arr = g_array_sized_new(false, false, + sizeof(struct qemu_plugin_dyn_cb), n_cbs); + + for (i = 0; i < ARRAY_SIZE(cbs); i++) { + g_array_append_vals(arr, cbs[i]->data, cbs[i]->len); + } + + qemu_plugin_add_dyn_cb_arr(arr); + inject_mem_helper(begin_op, arr); +} + +static void inject_mem_disable_helper(struct qemu_plugin_insn *plugin_insn, + TCGOp *begin_op) +{ + if (likely(!plugin_insn->mem_helper)) { + rm_ops(begin_op); + return; + } + inject_mem_helper(begin_op, NULL); +} + +/* called before finishing a TB with exit_tb, goto_tb or goto_ptr */ +void plugin_gen_disable_mem_helpers(void) +{ + TCGv_ptr ptr; + + if (likely(tcg_ctx->plugin_insn == NULL || + !tcg_ctx->plugin_insn->mem_helper)) { + return; + } + ptr = tcg_const_ptr(NULL); + tcg_gen_st_ptr(ptr, cpu_env, offsetof(CPUState, plugin_mem_cbs) - + offsetof(ArchCPU, env)); + tcg_temp_free_ptr(ptr); + tcg_ctx->plugin_insn->mem_helper = false; +} + +static void plugin_gen_tb_udata(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op) +{ + inject_udata_cb(ptb->cbs[PLUGIN_CB_REGULAR], begin_op); +} + +static void plugin_gen_tb_inline(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op) +{ + inject_inline_cb(ptb->cbs[PLUGIN_CB_INLINE], begin_op, op_ok); +} + +static void plugin_gen_insn_udata(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + + inject_udata_cb(insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_REGULAR], begin_op); +} + +static void plugin_gen_insn_inline(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + inject_inline_cb(insn->cbs[PLUGIN_CB_INSN][PLUGIN_CB_INLINE], + begin_op, op_ok); +} + +static void plugin_gen_mem_regular(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + inject_mem_cb(insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_REGULAR], begin_op); +} + +static void plugin_gen_mem_inline(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + const GArray *cbs; + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + + cbs = insn->cbs[PLUGIN_CB_MEM][PLUGIN_CB_INLINE]; + inject_inline_cb(cbs, begin_op, op_rw); +} + +static void plugin_gen_enable_mem_helper(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + inject_mem_enable_helper(insn, begin_op); +} + +static void plugin_gen_disable_mem_helper(const struct qemu_plugin_tb *ptb, + TCGOp *begin_op, int insn_idx) +{ + struct qemu_plugin_insn *insn = g_ptr_array_index(ptb->insns, insn_idx); + inject_mem_disable_helper(insn, begin_op); +} + +static void plugin_inject_cb(const struct qemu_plugin_tb *ptb, TCGOp *begin_op, + int insn_idx) +{ + enum plugin_gen_from from = begin_op->args[0]; + enum plugin_gen_cb type = begin_op->args[1]; + + switch (from) { + case PLUGIN_GEN_FROM_TB: + switch (type) { + case PLUGIN_GEN_CB_UDATA: + plugin_gen_tb_udata(ptb, begin_op); + return; + case PLUGIN_GEN_CB_INLINE: + plugin_gen_tb_inline(ptb, begin_op); + return; + default: + g_assert_not_reached(); + } + case PLUGIN_GEN_FROM_INSN: + switch (type) { + case PLUGIN_GEN_CB_UDATA: + plugin_gen_insn_udata(ptb, begin_op, insn_idx); + return; + case PLUGIN_GEN_CB_INLINE: + plugin_gen_insn_inline(ptb, begin_op, insn_idx); + return; + case PLUGIN_GEN_ENABLE_MEM_HELPER: + plugin_gen_enable_mem_helper(ptb, begin_op, insn_idx); + return; + default: + g_assert_not_reached(); + } + case PLUGIN_GEN_FROM_MEM: + switch (type) { + case PLUGIN_GEN_CB_MEM: + plugin_gen_mem_regular(ptb, begin_op, insn_idx); + return; + case PLUGIN_GEN_CB_INLINE: + plugin_gen_mem_inline(ptb, begin_op, insn_idx); + return; + default: + g_assert_not_reached(); + } + case PLUGIN_GEN_AFTER_INSN: + switch (type) { + case PLUGIN_GEN_DISABLE_MEM_HELPER: + plugin_gen_disable_mem_helper(ptb, begin_op, insn_idx); + return; + default: + g_assert_not_reached(); + } + default: + g_assert_not_reached(); + } +} + +/* #define DEBUG_PLUGIN_GEN_OPS */ +static void pr_ops(void) +{ +#ifdef DEBUG_PLUGIN_GEN_OPS + TCGOp *op; + int i = 0; + + QTAILQ_FOREACH(op, &tcg_ctx->ops, link) { + const char *name = ""; + const char *type = ""; + + if (op->opc == INDEX_op_plugin_cb_start) { + switch (op->args[0]) { + case PLUGIN_GEN_FROM_TB: + name = "tb"; + break; + case PLUGIN_GEN_FROM_INSN: + name = "insn"; + break; + case PLUGIN_GEN_FROM_MEM: + name = "mem"; + break; + case PLUGIN_GEN_AFTER_INSN: + name = "after insn"; + break; + default: + break; + } + switch (op->args[1]) { + case PLUGIN_GEN_CB_UDATA: + type = "udata"; + break; + case PLUGIN_GEN_CB_INLINE: + type = "inline"; + break; + case PLUGIN_GEN_CB_MEM: + type = "mem"; + break; + case PLUGIN_GEN_ENABLE_MEM_HELPER: + type = "enable mem helper"; + break; + case PLUGIN_GEN_DISABLE_MEM_HELPER: + type = "disable mem helper"; + break; + default: + break; + } + } + printf("op[%2i]: %s %s %s\n", i, tcg_op_defs[op->opc].name, name, type); + i++; + } +#endif +} + +static void plugin_gen_inject(const struct qemu_plugin_tb *plugin_tb) +{ + TCGOp *op; + int insn_idx; + + pr_ops(); + insn_idx = -1; + QSIMPLEQ_FOREACH(op, &tcg_ctx->plugin_ops, plugin_link) { + enum plugin_gen_from from = op->args[0]; + enum plugin_gen_cb type = op->args[1]; + + tcg_debug_assert(op->opc == INDEX_op_plugin_cb_start); + /* ENABLE_MEM_HELPER is the first callback of an instruction */ + if (from == PLUGIN_GEN_FROM_INSN && + type == PLUGIN_GEN_ENABLE_MEM_HELPER) { + insn_idx++; + } + plugin_inject_cb(plugin_tb, op, insn_idx); + } + pr_ops(); +} + +bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb) +{ + struct qemu_plugin_tb *ptb = tcg_ctx->plugin_tb; + bool ret = false; + + if (test_bit(QEMU_PLUGIN_EV_VCPU_TB_TRANS, cpu->plugin_mask)) { + ret = true; + + QSIMPLEQ_INIT(&tcg_ctx->plugin_ops); + ptb->vaddr = tb->pc; + ptb->vaddr2 = -1; + get_page_addr_code_hostp(cpu->env_ptr, tb->pc, &ptb->haddr1); + ptb->haddr2 = NULL; + + plugin_gen_empty_callback(PLUGIN_GEN_FROM_TB); + } + return ret; +} + +void plugin_gen_insn_start(CPUState *cpu, const DisasContextBase *db) +{ + struct qemu_plugin_tb *ptb = tcg_ctx->plugin_tb; + struct qemu_plugin_insn *pinsn; + + pinsn = qemu_plugin_tb_insn_get(ptb); + tcg_ctx->plugin_insn = pinsn; + pinsn->vaddr = db->pc_next; + plugin_gen_empty_callback(PLUGIN_GEN_FROM_INSN); + + /* + * Detect page crossing to get the new host address. + * Note that we skip this when haddr1 == NULL, e.g. when we're + * fetching instructions from a region not backed by RAM. + */ + if (likely(ptb->haddr1 != NULL && ptb->vaddr2 == -1) && + unlikely((db->pc_next & TARGET_PAGE_MASK) != + (db->pc_first & TARGET_PAGE_MASK))) { + get_page_addr_code_hostp(cpu->env_ptr, db->pc_next, + &ptb->haddr2); + ptb->vaddr2 = db->pc_next; + } + if (likely(ptb->vaddr2 == -1)) { + pinsn->haddr = ptb->haddr1 + pinsn->vaddr - ptb->vaddr; + } else { + pinsn->haddr = ptb->haddr2 + pinsn->vaddr - ptb->vaddr2; + } +} + +void plugin_gen_insn_end(void) +{ + plugin_gen_empty_callback(PLUGIN_GEN_AFTER_INSN); +} + +void plugin_gen_tb_end(CPUState *cpu) +{ + struct qemu_plugin_tb *ptb = tcg_ctx->plugin_tb; + int i; + + /* collect instrumentation requests */ + qemu_plugin_tb_trans_cb(cpu, ptb); + + /* inject the instrumentation at the appropriate places */ + plugin_gen_inject(ptb); + + /* clean up */ + for (i = 0; i < PLUGIN_N_CB_SUBTYPES; i++) { + if (ptb->cbs[i]) { + g_array_set_size(ptb->cbs[i], 0); + } + } + ptb->n = 0; + tcg_ctx->plugin_insn = NULL; +} diff --git a/accel/tcg/plugin-helpers.h b/accel/tcg/plugin-helpers.h new file mode 100644 index 00000000000..1916ee79206 --- /dev/null +++ b/accel/tcg/plugin-helpers.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_PLUGIN +/* Note: no TCG flags because those are overwritten later */ +DEF_HELPER_2(plugin_vcpu_udata_cb, void, i32, ptr) +DEF_HELPER_4(plugin_vcpu_mem_cb, void, i32, i32, i64, ptr) +#endif diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h index 22381a17088..236ff405243 100644 --- a/include/exec/helper-gen.h +++ b/include/exec/helper-gen.h @@ -70,6 +70,7 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \ #include "trace/generated-helpers.h" #include "trace/generated-helpers-wrappers.h" #include "tcg-runtime.h" +#include "plugin-helpers.h" #undef DEF_HELPER_FLAGS_0 #undef DEF_HELPER_FLAGS_1 diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h index 74943edb13a..1c4ba9bc788 100644 --- a/include/exec/helper-proto.h +++ b/include/exec/helper-proto.h @@ -33,6 +33,7 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ #include "helper.h" #include "trace/generated-helpers.h" #include "tcg-runtime.h" +#include "plugin-helpers.h" #undef DEF_HELPER_FLAGS_0 #undef DEF_HELPER_FLAGS_1 diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h index 268e0f804be..573c2ce2e98 100644 --- a/include/exec/helper-tcg.h +++ b/include/exec/helper-tcg.h @@ -55,6 +55,7 @@ #include "helper.h" #include "trace/generated-helpers.h" #include "tcg-runtime.h" +#include "plugin-helpers.h" #undef str #undef DEF_HELPER_FLAGS_0 diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h new file mode 100644 index 00000000000..de519883b16 --- /dev/null +++ b/include/exec/plugin-gen.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2017, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + * plugin-gen.h - TCG-dependent definitions for generating plugin code + * + * This header should be included only from plugin.c and C files that emit + * TCG code. + */ +#ifndef QEMU_PLUGIN_GEN_H +#define QEMU_PLUGIN_GEN_H + +#include "qemu/plugin.h" +#include "tcg/tcg.h" + +struct DisasContextBase; + +#ifdef CONFIG_PLUGIN + +bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb); +void plugin_gen_tb_end(CPUState *cpu); +void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db); +void plugin_gen_insn_end(void); + +void plugin_gen_disable_mem_helpers(void); +void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info); + +#else /* !CONFIG_PLUGIN */ + +static inline +bool plugin_gen_tb_start(CPUState *cpu, const TranslationBlock *tb) +{ + return false; +} + +static inline +void plugin_gen_insn_start(CPUState *cpu, const struct DisasContextBase *db) +{ } + +static inline void plugin_gen_insn_end(void) +{ } + +static inline void plugin_gen_tb_end(CPUState *cpu) +{ } + +static inline void plugin_gen_disable_mem_helpers(void) +{ } + +static inline void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) +{ } + +#endif /* CONFIG_PLUGIN */ + +#endif /* QEMU_PLUGIN_GEN_H */ + diff --git a/tcg/tcg-op.h b/tcg/tcg-op.h index 7c778f96f3b..4af272daa5a 100644 --- a/tcg/tcg-op.h +++ b/tcg/tcg-op.h @@ -833,6 +833,17 @@ void tcg_gen_goto_tb(unsigned idx); */ void tcg_gen_lookup_and_goto_ptr(void); +static inline void tcg_gen_plugin_cb_start(unsigned from, unsigned type, + unsigned wr) +{ + tcg_gen_op3(INDEX_op_plugin_cb_start, from, type, wr); +} + +static inline void tcg_gen_plugin_cb_end(void) +{ + tcg_emit_op(INDEX_op_plugin_cb_end); +} + #if TARGET_LONG_BITS == 32 #define tcg_temp_new() tcg_temp_new_i32() #define tcg_global_reg_new tcg_global_reg_new_i32 diff --git a/tcg/tcg-opc.h b/tcg/tcg-opc.h index 242d608e6db..9288a049468 100644 --- a/tcg/tcg-opc.h +++ b/tcg/tcg-opc.h @@ -198,6 +198,9 @@ DEF(goto_tb, 0, 0, 1, TCG_OPF_BB_EXIT | TCG_OPF_BB_END) DEF(goto_ptr, 0, 1, 0, TCG_OPF_BB_EXIT | TCG_OPF_BB_END | IMPL(TCG_TARGET_HAS_goto_ptr)) +DEF(plugin_cb_start, 0, 0, 3, TCG_OPF_NOT_PRESENT) +DEF(plugin_cb_end, 0, 0, 0, TCG_OPF_NOT_PRESENT) + DEF(qemu_ld_i32, 1, TLADDR_ARGS, 1, TCG_OPF_CALL_CLOBBER | TCG_OPF_SIDE_EFFECTS) DEF(qemu_st_i32, 0, TLADDR_ARGS + 1, 1, diff --git a/tcg/tcg.c b/tcg/tcg.c index 16b2d0e0ece..5475d49ed11 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -736,6 +736,15 @@ void tcg_region_init(void) #endif } +static void alloc_tcg_plugin_context(TCGContext *s) +{ +#ifdef CONFIG_PLUGIN + s->plugin_tb = g_new0(struct qemu_plugin_tb, 1); + s->plugin_tb->insns = + g_ptr_array_new_with_free_func(qemu_plugin_insn_cleanup_fn); +#endif +} + /* * All TCG threads except the parent (i.e. the one that called tcg_context_init * and registered the target's TCG globals) must register with this function @@ -780,6 +789,10 @@ void tcg_register_thread(void) g_assert(n < ms->smp.max_cpus); atomic_set(&tcg_ctxs[n], s); + if (n > 0) { + alloc_tcg_plugin_context(s); + } + tcg_ctx = s; qemu_mutex_lock(®ion.lock); err = tcg_region_initial_alloc__locked(tcg_ctx); @@ -976,6 +989,8 @@ void tcg_context_init(TCGContext *s) indirect_reg_alloc_order[i] = tcg_target_reg_alloc_order[i]; } + alloc_tcg_plugin_context(s); + tcg_ctx = s; /* * In user-mode we simply share the init context among threads, since we @@ -1681,6 +1696,13 @@ void tcg_gen_callN(void *func, TCGTemp *ret, int nargs, TCGTemp **args) flags = info->flags; sizemask = info->sizemask; +#ifdef CONFIG_PLUGIN + /* detect non-plugin helpers */ + if (tcg_ctx->plugin_insn && unlikely(strncmp(info->name, "plugin_", 7))) { + tcg_ctx->plugin_insn->calls_helpers = true; + } +#endif + #if defined(__sparc__) && !defined(__arch64__) \ && !defined(CONFIG_TCG_INTERPRETER) /* We have 64-bit values in one register, but need to pass as two diff --git a/tcg/tcg.h b/tcg/tcg.h index a37181c8998..d234b4c9a53 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -538,6 +538,9 @@ typedef struct TCGOp { /* Next and previous opcodes. */ QTAILQ_ENTRY(TCGOp) link; +#ifdef CONFIG_PLUGIN + QSIMPLEQ_ENTRY(TCGOp) plugin_link; +#endif /* Arguments for the opcode. */ TCGArg args[MAX_OPC_PARAM]; @@ -639,6 +642,23 @@ struct TCGContext { TCGLabel *exitreq_label; +#ifdef CONFIG_PLUGIN + /* + * We keep one plugin_tb struct per TCGContext. Note that on every TB + * translation we clear but do not free its contents; this way we + * avoid a lot of malloc/free churn, since after a few TB's it's + * unlikely that we'll need to allocate either more instructions or more + * space for instructions (for variable-instruction-length ISAs). + */ + struct qemu_plugin_tb *plugin_tb; + + /* descriptor of the instruction being translated */ + struct qemu_plugin_insn *plugin_insn; + + /* list to quickly access the injected ops */ + QSIMPLEQ_HEAD(, TCGOp) plugin_ops; +#endif + TCGTempSet free_temps[TCG_TYPE_COUNT * 2]; TCGTemp temps[TCG_MAX_TEMPS]; /* globals first, temps after */ From patchwork Fri Oct 25 06:36:30 2019 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: 177640 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3252055ill; Fri, 25 Oct 2019 00:01:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzLejVnmkb42k6vpajc1Z2SAQVggwHdg/cDY6eeTUgtuOTTG3yA4h3Eu6YgPYBsO/fLCNhH X-Received: by 2002:aa7:d305:: with SMTP id p5mr2302208edq.80.1571986884209; Fri, 25 Oct 2019 00:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986884; cv=none; d=google.com; s=arc-20160816; b=DUgp6d3vH2pFvVlC/27CZdIpeORYhfFa0zJlkCQkrC0eZ9zLyMo4JGLCNPXUu+gVWQ eJ4bubGkc6dN3tcmsuyDsMBqbHPPDjX/fyMVbq/2hViNd2bbxl6B6TdDXgtGyiLQB1Np dZG8A0S+L/htbpPKztbSF7wyJf5cpSt1NTM05AGb7Czc2vOGVp4J/q78uNQjgt23Q+jx dfxFwfGVTpTurbuCkmOYzCyT5yiLrRfYS3Qv7ibND0kpYQexxt1OKNVD/ICltlCyK2Wh RMGw0GulYnnsI2aWPcM5WEIeP1LUcj9E2zvtRSl8PenHbH9fgJzLTHENUQ/xTJMiVd8w yIfA== 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=dvKj57A9L+pl8UQofu98oEK7aBByVTgI27jwik1jQTA=; b=z1CF7qqKvjLp4DYLGBuRBGvKha44OAiGNPl9MrT1jYifrSUrQkQEMbT6x4FpJf1fLB rCz0AOvbmo0LDv/ZOefamQUw/OXBxpB5sZD0tgPqfPufTT+L9ZbJbvgm0cib4Sax8f1I TlC8EEgtbgFymsQEDNV8T0kqXs1iCbh3MgHx2qLXTFrFa4SGPMLm3oJ6zz314ZoWw1oo zPak3XJwSYBtzcIeQsIi4TTs5tPsFArSUzJ9wlZRyk4xamJyw4qOZuAvN4pxIlZCsTnu Zgq5cJh76quwQnmDddUyHVFpa4QbpZXh9GnOTlCgiKIV3Wokb3P/3DSl36Sav2Etpbxt SfBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YFcHWczN; 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 b7si578055edb.439.2019.10.25.00.01.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:01:24 -0700 (PDT) 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=YFcHWczN; 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]:56310 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtb8-0003aJ-1J for patch@linaro.org; Fri, 25 Oct 2019 03:01:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36956) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMu-0007vx-7g for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMs-00039l-CS for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:40 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:44168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMs-00038q-4N for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:38 -0400 Received: by mail-wr1-x430.google.com with SMTP id z11so914570wro.11 for ; Thu, 24 Oct 2019 23:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dvKj57A9L+pl8UQofu98oEK7aBByVTgI27jwik1jQTA=; b=YFcHWczNciX39Fj2/074URfAdSgfRo1Izxm1htRd/CBAvARp3Buj52CsDkVF+DHK7f tW0XJomPKaD2vmNlHmKIT3AVlTL8LmqxmiT7e69fXl11qDnQMZySDViQcYG9s88t1DiK ObtwM7CQtJOkxN7SyyKQyGAaJWJ87JkzB2m8P1yncvmJ2U31+McCDZKmAakYrhXnA8OU ygRzEXbeD4OhP62JzzU1hAinQ2FprvOKFgkpEgPrBIuzADplOGSO/oX68ZDs6FJNP5KW t6l9ebcS4plOesugPfcYwusYyFC0m0ZKvzTBMaZ63I2rluHGEkX04atpBS2qe2AGEWm2 0caw== 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=dvKj57A9L+pl8UQofu98oEK7aBByVTgI27jwik1jQTA=; b=mxex7eJ4+n+hkWWbg5WVKK1lpc1tDwVIrxAGVfJLkrycvp7Lfm6wWw09UM3B0QuhGG 7SddosipGYwx1QLIf0cudasEIBq2PaDiWqGwctolwISxiMTKV98oY5kHaHi4DZtVV0jg pmNhp6+aTXyxfU+cQW/44Ge1EzjH/HTt2O2z+AA+LwB8uNM8FbHesjTxnlJOZRcqCLeg uPI7VKHWnGrDioKbHmMtK1Xe4Gxmr9xCns23dzEFscRnJim1REx+PWuAYWw8aSuhNy4a nSDDB6dT89qjjWPwsnxYfO/rTWxsGjIuYcc/vWXO/au/RLMovH5rtFrZ8t42wMw2p3kl yVAQ== X-Gm-Message-State: APjAAAXVr+QCCDQ4ykJ6lJ4NmL6P38bzCTncOp5wzcNbZoPEbberhGJC DYofeD41xibpVboEahUWFOmY8f16HTk= X-Received: by 2002:adf:ea83:: with SMTP id s3mr1310048wrm.43.1571985996505; Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p5sm1536491wmi.4.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 96E361FFB7; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 30/73] atomic_template: add inline trace/plugin helpers Date: Fri, 25 Oct 2019 07:36:30 +0100 Message-Id: <20191025063713.23374-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Riku Voipio , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" In preparation for plugin support. Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/atomic_common.inc.c b/accel/tcg/atomic_common.inc.c new file mode 100644 index 00000000000..a86098fb2de --- /dev/null +++ b/accel/tcg/atomic_common.inc.c @@ -0,0 +1,50 @@ +/* + * Common Atomic Helper Functions + * + * This file should be included before the various instantiations of + * the atomic_template.h helpers. + * + * Copyright (c) 2019 Linaro + * Written by 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. + */ + +static inline +void atomic_trace_rmw_pre(CPUArchState *env, target_ulong addr, uint16_t info) +{ + CPUState *cpu = env_cpu(env); + + trace_guest_mem_before_exec(cpu, addr, info); + trace_guest_mem_before_exec(cpu, addr, info | TRACE_MEM_ST); +} + +static inline void +atomic_trace_rmw_post(CPUArchState *env, target_ulong addr, uint16_t info) +{ +} + +static inline +void atomic_trace_ld_pre(CPUArchState *env, target_ulong addr, uint16_t info) +{ + trace_guest_mem_before_exec(env_cpu(env), addr, info); +} + +static inline +void atomic_trace_ld_post(CPUArchState *env, target_ulong addr, uint16_t info) +{ +} + +static inline +void atomic_trace_st_pre(CPUArchState *env, target_ulong addr, uint16_t info) +{ + trace_guest_mem_before_exec(env_cpu(env), addr, info); +} + +static inline +void atomic_trace_st_post(CPUArchState *env, target_ulong addr, uint16_t info) +{ +} diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index 473d7e5a943..84d3370bf01 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -59,29 +59,6 @@ # define ABI_TYPE uint32_t #endif -#define ATOMIC_TRACE_RMW do { \ - uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ - (SHIFT, false, ATOMIC_MMU_IDX); \ - \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ - trace_guest_mem_before_exec(env_cpu(env), addr, \ - info | TRACE_MEM_ST); \ - } while (0) - -#define ATOMIC_TRACE_LD do { \ - uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ - (SHIFT, false, ATOMIC_MMU_IDX); \ - \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ - } while (0) - -#define ATOMIC_TRACE_ST do { \ - uint16_t info = glue(trace_mem_build_info_no_se, MEND) \ - (SHIFT, true, ATOMIC_MMU_IDX); \ - \ - trace_guest_mem_before_exec(env_cpu(env), addr, info); \ - } while (0) - /* Define host-endian atomic operations. Note that END is used within the ATOMIC_NAME macro, and redefined below. */ #if DATA_SIZE == 1 @@ -101,14 +78,17 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; DATA_TYPE ret; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_RMW; + atomic_trace_rmw_pre(env, addr, info); #if DATA_SIZE == 16 ret = atomic16_cmpxchg(haddr, cmpv, newv); #else ret = atomic_cmpxchg__nocheck(haddr, cmpv, newv); #endif ATOMIC_MMU_CLEANUP; + atomic_trace_rmw_post(env, addr, info); return ret; } @@ -118,10 +98,13 @@ ABI_TYPE ATOMIC_NAME(ld)(CPUArchState *env, target_ulong addr EXTRA_ARGS) { ATOMIC_MMU_DECLS; DATA_TYPE val, *haddr = ATOMIC_MMU_LOOKUP; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_LD; + atomic_trace_ld_pre(env, addr, info); val = atomic16_read(haddr); ATOMIC_MMU_CLEANUP; + atomic_trace_ld_post(env, addr, info); return val; } @@ -130,10 +113,13 @@ void ATOMIC_NAME(st)(CPUArchState *env, target_ulong addr, { ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, true, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_ST; + atomic_trace_st_pre(env, addr, info); atomic16_set(haddr, val); ATOMIC_MMU_CLEANUP; + atomic_trace_st_post(env, addr, info); } #endif #else @@ -143,10 +129,13 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; DATA_TYPE ret; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_RMW; + atomic_trace_rmw_pre(env, addr, info); ret = atomic_xchg__nocheck(haddr, val); ATOMIC_MMU_CLEANUP; + atomic_trace_rmw_post(env, addr, info); return ret; } @@ -157,10 +146,14 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ ATOMIC_MMU_DECLS; \ DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; \ DATA_TYPE ret; \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, \ + false, \ + ATOMIC_MMU_IDX); \ \ - ATOMIC_TRACE_RMW; \ + atomic_trace_rmw_pre(env, addr, info); \ ret = atomic_##X(haddr, val); \ ATOMIC_MMU_CLEANUP; \ + atomic_trace_rmw_post(env, addr, info); \ return ret; \ } @@ -189,8 +182,11 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ ATOMIC_MMU_DECLS; \ XDATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; \ XDATA_TYPE cmp, old, new, val = xval; \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, \ + false, \ + ATOMIC_MMU_IDX); \ \ - ATOMIC_TRACE_RMW; \ + atomic_trace_rmw_pre(env, addr, info); \ smp_mb(); \ cmp = atomic_read__nocheck(haddr); \ do { \ @@ -198,6 +194,7 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ cmp = atomic_cmpxchg__nocheck(haddr, old, new); \ } while (cmp != old); \ ATOMIC_MMU_CLEANUP; \ + atomic_trace_rmw_post(env, addr, info); \ return RET; \ } @@ -235,14 +232,18 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; DATA_TYPE ret; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, + false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_RMW; + atomic_trace_rmw_pre(env, addr, info); #if DATA_SIZE == 16 ret = atomic16_cmpxchg(haddr, BSWAP(cmpv), BSWAP(newv)); #else ret = atomic_cmpxchg__nocheck(haddr, BSWAP(cmpv), BSWAP(newv)); #endif ATOMIC_MMU_CLEANUP; + atomic_trace_rmw_post(env, addr, info); return BSWAP(ret); } @@ -252,10 +253,14 @@ ABI_TYPE ATOMIC_NAME(ld)(CPUArchState *env, target_ulong addr EXTRA_ARGS) { ATOMIC_MMU_DECLS; DATA_TYPE val, *haddr = ATOMIC_MMU_LOOKUP; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, + false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_LD; + atomic_trace_ld_pre(env, addr, info); val = atomic16_read(haddr); ATOMIC_MMU_CLEANUP; + atomic_trace_ld_post(env, addr, info); return BSWAP(val); } @@ -264,11 +269,16 @@ void ATOMIC_NAME(st)(CPUArchState *env, target_ulong addr, { ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, + true, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_ST; + val = BSWAP(val); + atomic_trace_st_pre(env, addr, info); val = BSWAP(val); atomic16_set(haddr, val); ATOMIC_MMU_CLEANUP; + atomic_trace_st_post(env, addr, info); } #endif #else @@ -278,10 +288,14 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ATOMIC_MMU_DECLS; DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; ABI_TYPE ret; + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, + false, + ATOMIC_MMU_IDX); - ATOMIC_TRACE_RMW; + atomic_trace_rmw_pre(env, addr, info); ret = atomic_xchg__nocheck(haddr, BSWAP(val)); ATOMIC_MMU_CLEANUP; + atomic_trace_rmw_post(env, addr, info); return BSWAP(ret); } @@ -292,10 +306,14 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ ATOMIC_MMU_DECLS; \ DATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; \ DATA_TYPE ret; \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, \ + false, \ + ATOMIC_MMU_IDX); \ \ - ATOMIC_TRACE_RMW; \ + atomic_trace_rmw_pre(env, addr, info); \ ret = atomic_##X(haddr, BSWAP(val)); \ ATOMIC_MMU_CLEANUP; \ + atomic_trace_rmw_post(env, addr, info); \ return BSWAP(ret); \ } @@ -322,8 +340,11 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ ATOMIC_MMU_DECLS; \ XDATA_TYPE *haddr = ATOMIC_MMU_LOOKUP; \ XDATA_TYPE ldo, ldn, old, new, val = xval; \ + uint16_t info = glue(trace_mem_build_info_no_se, MEND)(SHIFT, \ + false, \ + ATOMIC_MMU_IDX); \ \ - ATOMIC_TRACE_RMW; \ + atomic_trace_rmw_pre(env, addr, info); \ smp_mb(); \ ldn = atomic_read__nocheck(haddr); \ do { \ @@ -331,6 +352,7 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ ldn = atomic_cmpxchg__nocheck(haddr, ldo, BSWAP(new)); \ } while (ldo != ldn); \ ATOMIC_MMU_CLEANUP; \ + atomic_trace_rmw_post(env, addr, info); \ return RET; \ } @@ -358,10 +380,6 @@ GEN_ATOMIC_HELPER_FN(add_fetch, ADD, DATA_TYPE, new) #undef MEND #endif /* DATA_SIZE > 1 */ -#undef ATOMIC_TRACE_ST -#undef ATOMIC_TRACE_LD -#undef ATOMIC_TRACE_RMW - #undef BSWAP #undef ABI_TYPE #undef DATA_TYPE diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 82a5783a2bc..82282d30d93 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1825,6 +1825,8 @@ void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, #define ATOMIC_MMU_CLEANUP #define ATOMIC_MMU_IDX get_mmuidx(oi) +#include "atomic_common.inc.c" + #define DATA_SIZE 1 #include "atomic_template.h" diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index 8d315a65876..b09f7a15770 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -756,6 +756,8 @@ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, #define ATOMIC_NAME(X) HELPER(glue(glue(atomic_ ## X, SUFFIX), END)) #define EXTRA_ARGS +#include "atomic_common.inc.c" + #define DATA_SIZE 1 #include "atomic_template.h" From patchwork Fri Oct 25 06:36:31 2019 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: 177673 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3285115ill; Fri, 25 Oct 2019 00:32:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxaGqK2PrN/RME8cATrXkcdJPkxmml1ak2neCjeerIZgRqD9XznfJreVxi1ojK3CxUcOA/R X-Received: by 2002:ac8:4618:: with SMTP id p24mr241316qtn.151.1571988773111; Fri, 25 Oct 2019 00:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988773; cv=none; d=google.com; s=arc-20160816; b=AyKbcLCEJ/0ppBDA7HPlXOL0IOuV8ul/MLCGFDRkGjGrb9DE3VEZgWRdueDuMjBrlK CaDIa9YSrh6FoF4lxmG2emyHwLlLL4PdRkcYLbh5n4+wLdGElmEf16ppa6mfi8xYynG2 zDaEZHYu3jisCd5BBdmoMRwC4Nzk6nomDtIhZfwgUkN1emnXFaNPVr+qlZMXfFqDvwBh baulbWDDbb56UkrVYPKumM2NgCbWzFHYchkjLV+3SosPOLqN83mGbUj1HLLFmROC0X5X pzYLoSh3PMo0DSTsTKk4mhtpFZAJ2BBASAfNcNicQAWO/Wh+wi2pQncLIn78IzRSpKz8 dnZw== 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=91dz7KJADMxPUVCAuh+UOifd4EFprDikV0cfmChkEVM=; b=tFX36rMoGcw0nEODs2liUNZiETqV2PJMg//cQBAPBv4NuOMIfAqgOw8ocPhho8wVcD Z0PyjPujbQDtTMm9U4AJbR+fcVxTxgHUxYxqcBILIZoh9wHcqMaAd169SQy1Tz2NYrNu ls170URvViiXddQ7E7tpqRqbn7XCYG3c9QXrnbKDLUSOlntIoa9tsPxJXJ024V40WUip 6Ic+2okuLec9KKrMNVQGkZG79v44/4FA+2GZnu7YLYUPxkWxsaG9p8AR7L7uoQxvp3Uf gN6+P6a2tBuTyH4FsYl54gknOpTCAJgvUq8LI8YxUya0TL+w4X8xC0YmG5EY55L5eN1d YqHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T+N7XBlw; 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 z195si912005qkb.20.2019.10.25.00.32.52 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:32:53 -0700 (PDT) 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=T+N7XBlw; 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]:56852 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu5b-0000F6-Uz for patch@linaro.org; Fri, 25 Oct 2019 03:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38340) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWi-0003kZ-8a for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWf-0007pM-II for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:48 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45946) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWf-0007ow-AU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:45 -0400 Received: by mail-wr1-x436.google.com with SMTP id q13so937477wrs.12 for ; Thu, 24 Oct 2019 23:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=91dz7KJADMxPUVCAuh+UOifd4EFprDikV0cfmChkEVM=; b=T+N7XBlwRwJjXw63dKnSEQP0tYvN7HTOBf/FD6e47vP6GtHvp6uiszceVLA/DQYeRE VgLrl8zkMBMsDjTY9FooRVZn8Kfzv9zaDz15VvFHctlLixp7QgS/JEnILQ3vy6P+QCFr ysCUJeOO4HkOcenzgpdlWmU6wFLhUiFYs7UP4VdQ9FecrkFr9vhatCuQcJEV7SZDZSOc EAbRjwcT8OYRvLKYVulK8KjGPfqAhyu0pGmq17m9F8DWyV/ZDhr+0Ny78uK4tTRhfPfO //Kzcty5liEDrg/SkW+ccK1kVo0PjJco2k71TLqo5NJPqM2pKgTyywJx7QOFP2ajOCoB a5vA== 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=91dz7KJADMxPUVCAuh+UOifd4EFprDikV0cfmChkEVM=; b=TyHmgQFP8wQA42EBznO3RfGgw8TyDubnrIys7gMKm4DpJ8+KCIOBhhLkfHwUP9tnir 0+Es9Di3SglEBV2X8cnD6sqrMszYzzrMDeI8+Bs5N6NvB21lKFXqTtz+qyuurWs9PXdx SyuedI4SAc/P8pGmZkofSwTCG47HTypLONFsVJ93HeQFB19mCm+p40cIu40vj4xfDlOc 1AegC7lIVCM+Qlmlcu+deWh2jWGKNaZx3qCHd3vDesh6+NRabxRKSmUyFwTyN1ZdbZrl xF57tEDCwHsy2MPZ4S0RUKpzDbymAfSZxsGCIVNsS5Asll8qBte2R76pat8a1CKwHy5+ Tlow== X-Gm-Message-State: APjAAAUQ15PJFzX0KEPoovLP5SfIiHMYZp1J40jcvbeeX4mTXJvxRTOI 2l6DZfPVDjs82FOTZOvrORVUCw== X-Received: by 2002:a5d:404d:: with SMTP id w13mr1393010wrp.185.1571986603974; Thu, 24 Oct 2019 23:56:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h205sm1191520wmf.35.2019.10.24.23.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B75271FF8F; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 31/73] tcg: let plugins instrument virtual memory accesses Date: Fri, 25 Oct 2019 07:36:31 +0100 Message-Id: <20191025063713.23374-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" To capture all memory accesses we need hook into all the various helper functions that are involved in memory operations as well as the injected inline helper calls. A later commit will allow us to resolve the actual guest HW addresses by replaying the lookup. Signed-off-by: Emilio G. Cota [AJB: drop haddr handling, just deal in vaddr] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/atomic_common.inc.c b/accel/tcg/atomic_common.inc.c index a86098fb2de..344525b0bb3 100644 --- a/accel/tcg/atomic_common.inc.c +++ b/accel/tcg/atomic_common.inc.c @@ -25,6 +25,8 @@ void atomic_trace_rmw_pre(CPUArchState *env, target_ulong addr, uint16_t info) static inline void atomic_trace_rmw_post(CPUArchState *env, target_ulong addr, uint16_t info) { + qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info); + qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info | TRACE_MEM_ST); } static inline @@ -36,6 +38,7 @@ void atomic_trace_ld_pre(CPUArchState *env, target_ulong addr, uint16_t info) static inline void atomic_trace_ld_post(CPUArchState *env, target_ulong addr, uint16_t info) { + qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info); } static inline @@ -47,4 +50,5 @@ void atomic_trace_st_pre(CPUArchState *env, target_ulong addr, uint16_t info) static inline void atomic_trace_st_post(CPUArchState *env, target_ulong addr, uint16_t info) { + qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, info); } diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index 84d3370bf01..837676231f6 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -18,6 +18,7 @@ * License along with this library; if not, see . */ +#include "qemu/plugin.h" #include "trace/mem.h" #if DATA_SIZE == 16 diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 81c33d6475d..c01f59c7433 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -268,6 +268,7 @@ void cpu_exec_step_atomic(CPUState *cpu) qemu_mutex_unlock_iothread(); } assert_no_pages_locked(); + qemu_plugin_disable_mem_helpers(cpu); } if (cpu_in_exclusive_context(cpu)) { @@ -701,6 +702,8 @@ int cpu_exec(CPUState *cpu) if (qemu_mutex_iothread_locked()) { qemu_mutex_unlock_iothread(); } + qemu_plugin_disable_mem_helpers(cpu); + assert_no_pages_locked(); } diff --git a/include/exec/cpu-defs.h b/include/exec/cpu-defs.h index be946ba1ce5..8c44abefa22 100644 --- a/include/exec/cpu-defs.h +++ b/include/exec/cpu-defs.h @@ -214,6 +214,7 @@ typedef struct CPUTLBCommon { * Since this is placed within CPUNegativeOffsetState, the smallest * negative offsets are at the end of the struct. */ + typedef struct CPUTLB { CPUTLBCommon c; CPUTLBDesc d[NB_MMU_MODES]; diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index 5750a26b9ec..6f0d3407979 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -28,6 +28,7 @@ #include "trace-root.h" #endif +#include "qemu/plugin.h" #include "trace/mem.h" #if DATA_SIZE == 8 @@ -86,11 +87,9 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, target_ulong addr; int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; - #if !defined(SOFTMMU_CODE_ACCESS) - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, false, mmu_idx)); + uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, false, mmu_idx); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif addr = ptr; @@ -104,6 +103,9 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, uintptr_t hostaddr = addr + entry->addend; res = glue(glue(ld, USUFFIX), _p)((uint8_t *)hostaddr); } +#ifndef SOFTMMU_CODE_ACCESS + qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); +#endif return res; } @@ -124,11 +126,9 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, target_ulong addr; int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; - #if !defined(SOFTMMU_CODE_ACCESS) - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, true, MO_TE, false, mmu_idx)); + uint16_t meminfo = trace_mem_build_info(SHIFT, true, MO_TE, false, mmu_idx); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif addr = ptr; @@ -142,6 +142,9 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, uintptr_t hostaddr = addr + entry->addend; res = glue(glue(lds, SUFFIX), _p)((uint8_t *)hostaddr); } +#ifndef SOFTMMU_CODE_ACCESS + qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); +#endif return res; } @@ -165,11 +168,9 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, target_ulong addr; int mmu_idx = CPU_MMU_INDEX; TCGMemOpIdx oi; - #if !defined(SOFTMMU_CODE_ACCESS) - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, true, mmu_idx)); + uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, true, mmu_idx); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); #endif addr = ptr; @@ -183,6 +184,9 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, uintptr_t hostaddr = addr + entry->addend; glue(glue(st, SUFFIX), _p)((uint8_t *)hostaddr, v); } +#ifndef SOFTMMU_CODE_ACCESS + qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); +#endif } static inline void diff --git a/include/exec/cpu_ldst_useronly_template.h b/include/exec/cpu_ldst_useronly_template.h index 93ad532f943..dbdc7a845d6 100644 --- a/include/exec/cpu_ldst_useronly_template.h +++ b/include/exec/cpu_ldst_useronly_template.h @@ -64,18 +64,18 @@ static inline RES_TYPE glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) { -#ifdef CODE_ACCESS RES_TYPE ret; +#ifdef CODE_ACCESS set_helper_retaddr(1); ret = glue(glue(ld, USUFFIX), _p)(g2h(ptr)); clear_helper_retaddr(); - return ret; #else - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, false, MMU_USER_IDX)); - return glue(glue(ld, USUFFIX), _p)(g2h(ptr)); + uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, false, + MMU_USER_IDX); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); + ret = glue(glue(ld, USUFFIX), _p)(g2h(ptr)); #endif + return ret; } #ifndef CODE_ACCESS @@ -96,18 +96,19 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, static inline int glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr) { -#ifdef CODE_ACCESS int ret; +#ifdef CODE_ACCESS set_helper_retaddr(1); ret = glue(glue(lds, SUFFIX), _p)(g2h(ptr)); clear_helper_retaddr(); - return ret; #else - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, true, MO_TE, false, MMU_USER_IDX)); - return glue(glue(lds, SUFFIX), _p)(g2h(ptr)); + uint16_t meminfo = trace_mem_build_info(SHIFT, true, MO_TE, false, + MMU_USER_IDX); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); + ret = glue(glue(lds, SUFFIX), _p)(g2h(ptr)); + qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); #endif + return ret; } #ifndef CODE_ACCESS @@ -130,10 +131,11 @@ static inline void glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, abi_ptr ptr, RES_TYPE v) { - trace_guest_mem_before_exec( - env_cpu(env), ptr, - trace_mem_build_info(SHIFT, false, MO_TE, true, MMU_USER_IDX)); + uint16_t meminfo = trace_mem_build_info(SHIFT, false, MO_TE, true, + MMU_USER_IDX); + trace_guest_mem_before_exec(env_cpu(env), ptr, meminfo); glue(glue(st, SUFFIX), _p)(g2h(ptr), v); + qemu_plugin_vcpu_mem_cb(env_cpu(env), ptr, meminfo); } static inline void diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 1388bd344d3..c245126f981 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -30,6 +30,7 @@ #include "tcg-mo.h" #include "trace-tcg.h" #include "trace/mem.h" +#include "exec/plugin-gen.h" /* Reduce the number of ifdefs below. This assumes that all uses of TCGV_HIGH and TCGV_LOW are properly protected by a conditional that @@ -2684,6 +2685,7 @@ void tcg_gen_exit_tb(TranslationBlock *tb, unsigned idx) tcg_debug_assert(idx == TB_EXIT_REQUESTED); } + plugin_gen_disable_mem_helpers(); tcg_gen_op1i(INDEX_op_exit_tb, val); } @@ -2696,6 +2698,7 @@ void tcg_gen_goto_tb(unsigned idx) tcg_debug_assert((tcg_ctx->goto_tb_issue_mask & (1 << idx)) == 0); tcg_ctx->goto_tb_issue_mask |= 1 << idx; #endif + plugin_gen_disable_mem_helpers(); /* When not chaining, we simply fall through to the "fallback" exit. */ if (!qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { tcg_gen_op1i(INDEX_op_goto_tb, idx); @@ -2705,7 +2708,10 @@ void tcg_gen_goto_tb(unsigned idx) void tcg_gen_lookup_and_goto_ptr(void) { if (TCG_TARGET_HAS_goto_ptr && !qemu_loglevel_mask(CPU_LOG_TB_NOCHAIN)) { - TCGv_ptr ptr = tcg_temp_new_ptr(); + TCGv_ptr ptr; + + plugin_gen_disable_mem_helpers(); + ptr = tcg_temp_new_ptr(); gen_helper_lookup_tb_ptr(ptr, cpu_env); tcg_gen_op1i(INDEX_op_goto_ptr, tcgv_ptr_arg(ptr)); tcg_temp_free_ptr(ptr); @@ -2788,14 +2794,24 @@ static void tcg_gen_req_mo(TCGBar type) } } +static inline void plugin_gen_mem_callbacks(TCGv vaddr, uint16_t info) +{ +#ifdef CONFIG_PLUGIN + if (tcg_ctx->plugin_insn == NULL) { + return; + } + plugin_gen_empty_mem_callback(vaddr, info); +#endif +} + void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) { MemOp orig_memop; + uint16_t info = trace_mem_get_info(memop, idx, 0); tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); memop = tcg_canonicalize_memop(memop, 0, 0); - trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, idx, 0)); + trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, addr, info); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -2807,6 +2823,7 @@ void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) } gen_ldst_i32(INDEX_op_qemu_ld_i32, val, addr, memop, idx); + plugin_gen_mem_callbacks(addr, info); if ((orig_memop ^ memop) & MO_BSWAP) { switch (orig_memop & MO_SIZE) { @@ -2828,11 +2845,11 @@ void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) { TCGv_i32 swap = NULL; + uint16_t info = trace_mem_get_info(memop, idx, 1); tcg_gen_req_mo(TCG_MO_LD_ST | TCG_MO_ST_ST); memop = tcg_canonicalize_memop(memop, 0, 1); - trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, idx, 1)); + trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, addr, info); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i32(); @@ -2852,6 +2869,7 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) } gen_ldst_i32(INDEX_op_qemu_st_i32, val, addr, memop, idx); + plugin_gen_mem_callbacks(addr, info); if (swap) { tcg_temp_free_i32(swap); @@ -2861,6 +2879,7 @@ void tcg_gen_qemu_st_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop) void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) { MemOp orig_memop; + uint16_t info; if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_ld_i32(TCGV_LOW(val), addr, idx, memop); @@ -2874,8 +2893,8 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD); memop = tcg_canonicalize_memop(memop, 1, 0); - trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, idx, 0)); + info = trace_mem_get_info(memop, idx, 0); + trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, addr, info); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -2887,6 +2906,7 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) } gen_ldst_i64(INDEX_op_qemu_ld_i64, val, addr, memop, idx); + plugin_gen_mem_callbacks(addr, info); if ((orig_memop ^ memop) & MO_BSWAP) { switch (orig_memop & MO_SIZE) { @@ -2914,6 +2934,7 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) { TCGv_i64 swap = NULL; + uint16_t info; if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) { tcg_gen_qemu_st_i32(TCGV_LOW(val), addr, idx, memop); @@ -2922,8 +2943,8 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) tcg_gen_req_mo(TCG_MO_LD_ST | TCG_MO_ST_ST); memop = tcg_canonicalize_memop(memop, 1, 1); - trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, - addr, trace_mem_get_info(memop, idx, 1)); + info = trace_mem_get_info(memop, idx, 1); + trace_guest_mem_before_tcg(tcg_ctx->cpu, cpu_env, addr, info); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i64(); @@ -2947,6 +2968,7 @@ void tcg_gen_qemu_st_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop) } gen_ldst_i64(INDEX_op_qemu_st_i64, val, addr, memop, idx); + plugin_gen_mem_callbacks(addr, info); if (swap) { tcg_temp_free_i64(swap); diff --git a/tcg/tcg.h b/tcg/tcg.h index d234b4c9a53..a38659ea5b3 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -29,6 +29,7 @@ #include "exec/memop.h" #include "exec/tb-context.h" #include "qemu/bitops.h" +#include "qemu/plugin.h" #include "qemu/queue.h" #include "tcg-mo.h" #include "tcg-target.h" From patchwork Fri Oct 25 06:36:32 2019 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: 177653 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3265836ill; Fri, 25 Oct 2019 00:13:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzak7VASdJ1lWJNitqvexwChjmzmBVVNOnRAI4pBMN45pn+x4+thyygdeY/FUbnBFRyJbec X-Received: by 2002:a05:620a:12c6:: with SMTP id e6mr1437265qkl.465.1571987629460; Fri, 25 Oct 2019 00:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987629; cv=none; d=google.com; s=arc-20160816; b=hT2zUpcX9MyFszfpnaIZ35fTJO5zZoj6g/65v2Nw8F5aKnzIq94LYYaEunETkbxACx uD+oRPnqig6qcXqbUSuDkzYY0wedpuXaeY+ExBL8nv+yvqM+0sH5gMsgrNJYJJfJCD+6 qtOT8oBFKP8WMBnPMXyZBIDTmLv+orrZbV5zGOanxIuV6xe+1PQEbbFugGvieUsxVGma TzEGJxprVYewVl2rrwIILslRw1U5R48W8Ri10nmM3sZJOsgyifRRcRRZjthkRVzsru09 SDei8QPY8uGEFv1rGXqI4yEi5i+D5LtOB3fvvPW/g3eXzHT2VOFcnxym+AisfGxhOZfe lX3g== 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=vsT1sDdN9tyjeDx32IurIboRHv52kBAte0kwCWRATNA=; b=0AMMOc62sqZsx/F6edEIK9RsOvVDoVnO6zQ/IFx06qEbVNx1rPeUvYxrneyeesD32J cpY3VLD8MSqWfBJnmOkicl7ZTBGgRuG52xCsaYlKYyTnD2wRnqpHSveCbFUOVx1jdVcQ BfhCjpkPcVm1t8NUjDX8qCIZ/hJPNgcksPeBIMJmM7hsBuTqwWyQNNZrepnuCws76noz 04r4S+d7d4JXFlC45D4lFbIgedo2tIr94h6+mASdIvVOOBtr2unydSQYHqxUrHV+m6rU +eQ79WYmuvQFPNjDI8jQcMUu3agUYuamel9yFveyRU40uJHITwwJRvU7yLW4aB55Bt9b 6Dig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YCYQsGIZ; 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 y6si743675qvp.203.2019.10.25.00.13.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:13:49 -0700 (PDT) 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=YCYQsGIZ; 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]:56478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtnA-0007F8-Nv for patch@linaro.org; Fri, 25 Oct 2019 03:13:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38276) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWd-0003XW-GR for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWb-0007mp-TD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:43 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:51376) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWa-0007jX-KE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:41 -0400 Received: by mail-wm1-x334.google.com with SMTP id q70so814906wme.1 for ; Thu, 24 Oct 2019 23:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vsT1sDdN9tyjeDx32IurIboRHv52kBAte0kwCWRATNA=; b=YCYQsGIZhwITd+2i+kCfjmzRhP79sQ0PedGrgO5limZdzE7857DcvxUok1znyUrvUW YhlpvUeN7jDoaON5s2bu7P8Q0QBeJPgE0VY4/p11tq7J+SiKpN6SyfwPddl97qPhox3p DW5wJoHpqFWo7ribgFbKx06fgaaA8Hx/jtcOqhhdEdq4MgHuAPTYc0BxOlZqHE068uW2 FMi1i0qlwNeUgmpxfmRmLFZmrVEQaJJLBubNMu7xnvMwNpjrE5vCSSvaotIOGXoN4NmS oDUvbkEl1ps8X7nJdNJkzDr/PM2UtVhGPAGLLfk76gzLvMGwPLC04/3l06F90YVCYmI0 3z6g== 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=vsT1sDdN9tyjeDx32IurIboRHv52kBAte0kwCWRATNA=; b=LrHB3dqKRhtkPe1byi8BxN1o/Rv6V16lMV+W1pYE975Y6fK786XcdizpD7cqxCbmN/ 0dchMO9ptnVteexMWiY5tKup2UMlmaEH95xph1E6EoV6UX7oz3iLQkVp/764kJXULYDk QXzL1ubfF2j73wODBgwdku2XBt/dTJuD4+df3JwloOx7nOL9/kb4HDnREzDjfJFpocxS ZVVKyc3Eg4CEXMru7K5ecpzf7vrA4GmW6jjLZB/OdgLF7kJhcSmyJECsfDi9HxmPn3Am GRQk7TLCzGauLtC7tIg9mrFqZLbLCQcOKYOH0jo8FNmHHQ8kobVORUrb33hu2ByqTF1/ twHQ== X-Gm-Message-State: APjAAAX6EVGIEiFtJRq3KirBD3lEyts9RUvyql50ixtbHhBbQJsgHPWB KHPNswuXe2VDTdT1Xki4q5VXFA== X-Received: by 2002:a1c:4907:: with SMTP id w7mr1857820wma.62.1571986599375; Thu, 24 Oct 2019 23:56:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d199sm1300928wmd.35.2019.10.24.23.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D09DE1FFB8; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 32/73] plugins: implement helpers for resolving hwaddr Date: Fri, 25 Oct 2019 07:36:32 +0100 Message-Id: <20191025063713.23374-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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: Richard Henderson , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We need to keep a local per-cpu copy of the data as other threads may be running. Currently we can provide insight as to if the access was IO or not and give the offset into a given device (usually the main RAMBlock). We store enough information to get details such as the MemoryRegion which might be useful in later expansions to the API. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 82282d30d93..2c06b57272e 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -34,6 +34,9 @@ #include "qemu/atomic.h" #include "qemu/atomic128.h" #include "translate-all.h" +#ifdef CONFIG_PLUGIN +#include "qemu/plugin-memory.h" +#endif /* DEBUG defines, enable DEBUG_TLB_LOG to log to the CPU_LOG_MMU target */ /* #define DEBUG_TLB */ @@ -1247,6 +1250,45 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, return (void *)((uintptr_t)addr + entry->addend); } + +#ifdef CONFIG_PLUGIN +/* + * Perform a TLB lookup and populate the qemu_plugin_hwaddr structure. + * This should be a hot path as we will have just looked this path up + * in the softmmu lookup code (or helper). We don't handle re-fills or + * checking the victim table. This is purely informational. + * + * This should never fail as the memory access being instrumented + * should have just filled the TLB. + */ + +bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, + bool is_store, struct qemu_plugin_hwaddr *data) +{ + CPUArchState *env = cpu->env_ptr; + CPUTLBEntry *tlbe = tlb_entry(env, mmu_idx, addr); + uintptr_t index = tlb_index(env, mmu_idx, addr); + target_ulong tlb_addr = is_store ? tlb_addr_write(tlbe) : tlbe->addr_read; + + if (likely(tlb_hit(tlb_addr, addr))) { + /* We must have an iotlb entry for MMIO */ + if (tlb_addr & TLB_MMIO) { + CPUIOTLBEntry *iotlbentry; + iotlbentry = &env_tlb(env)->d[mmu_idx].iotlb[index]; + data->is_io = true; + data->v.io.section = iotlb_to_section(cpu, iotlbentry->addr, iotlbentry->attrs); + data->v.io.offset = (iotlbentry->addr & TARGET_PAGE_MASK) + addr; + } else { + data->is_io = false; + data->v.ram.hostaddr = addr + tlbe->addend; + } + return true; + } + return false; +} + +#endif + /* Probe for a read-modify-write atomic operation. Do not allow unaligned * operations, or io operations to proceed. Return the host address. */ static void *atomic_mmu_lookup(CPUArchState *env, target_ulong addr, diff --git a/include/qemu/plugin-memory.h b/include/qemu/plugin-memory.h new file mode 100644 index 00000000000..fbbe99474bd --- /dev/null +++ b/include/qemu/plugin-memory.h @@ -0,0 +1,40 @@ +/* + * Plugin Memory API + * + * Copyright (c) 2019 Linaro Ltd + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _PLUGIN_MEMORY_H_ +#define _PLUGIN_MEMORY_H_ + +struct qemu_plugin_hwaddr { + bool is_io; + bool is_store; + union { + struct { + MemoryRegionSection *section; + hwaddr offset; + } io; + struct { + uint64_t hostaddr; + } ram; + } v; +}; + +/** + * tlb_plugin_lookup: query last TLB lookup + * @cpu: cpu environment + * + * This function can be used directly after a memory operation to + * query information about the access. It is used by the plugin + * infrastructure to expose more information about the address. + * + * It would only fail if not called from an instrumented memory access + * which would be an abuse of the API. + */ +bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, + bool is_store, struct qemu_plugin_hwaddr *data); + +#endif /* _PLUGIN_MEMORY_H_ */ diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index b9a4a4b6841..c213d1dd19f 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -285,6 +285,14 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr); +/* + * The following additional queries can be run on the hwaddr structure + * to return information about it. For non-IO accesses the device + * offset will be into the appropriate block of RAM. + */ +bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr); +uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr); + typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, qemu_plugin_meminfo_t info, uint64_t vaddr, diff --git a/plugins/api.c b/plugins/api.c index facf2a132de..33dac8e790d 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -42,6 +42,7 @@ #include "trace/mem-internal.h" /* mem_info macros */ #include "plugin.h" #ifndef CONFIG_USER_ONLY +#include "qemu/plugin-memory.h" #include "hw/boards.h" #endif @@ -240,11 +241,59 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info) * Virtual Memory queries */ +#ifdef CONFIG_SOFTMMU +static __thread struct qemu_plugin_hwaddr hwaddr_info; + +struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, + uint64_t vaddr) +{ + CPUState *cpu = current_cpu; + unsigned int mmu_idx = info >> TRACE_MEM_MMU_SHIFT; + hwaddr_info.is_store = info & TRACE_MEM_ST; + + if (!tlb_plugin_lookup(cpu, vaddr, mmu_idx, + info & TRACE_MEM_ST, &hwaddr_info)) { + error_report("invalid use of qemu_plugin_get_hwaddr"); + return NULL; + } + + return &hwaddr_info; +} +#else struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr) { return NULL; } +#endif + +bool qemu_plugin_hwaddr_is_io(struct qemu_plugin_hwaddr *hwaddr) +{ +#ifdef CONFIG_SOFTMMU + return hwaddr->is_io; +#else + return false; +#endif +} + +uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr) +{ +#ifdef CONFIG_SOFTMMU + if (haddr) { + if (!haddr->is_io) { + ram_addr_t ram_addr = qemu_ram_addr_from_host((void *) haddr->v.ram.hostaddr); + if (ram_addr == RAM_ADDR_INVALID) { + error_report("Bad ram pointer %"PRIx64"", haddr->v.ram.hostaddr); + abort(); + } + return ram_addr; + } else { + return haddr->v.io.offset; + } + } +#endif + return 0; +} /* * Queries to the number and potential maximum number of vCPUs there From patchwork Fri Oct 25 06:36:33 2019 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: 177688 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3294256ill; Fri, 25 Oct 2019 00:42:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYO0zHzK0Lte0CzZHlIncentznRaTNxjcLbH8ZBFj1hPVIBH/9MGlrkL4Iea/O1dgJonFs X-Received: by 2002:ad4:51cb:: with SMTP id p11mr1904477qvq.81.1571989343684; Fri, 25 Oct 2019 00:42:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989343; cv=none; d=google.com; s=arc-20160816; b=u7CsKyrVCXQ5UPriMor/BOZGlHW3WA5mJyR64pgOro+yV4RLi4ScPUzm8yTjR+MLk/ Q3pBnnEOmFm0SHLnosuq8c+xlkuJpfsfqyy+lJpMCW4/EF+Ch9PHIx/WdEJd2YU5o2tx RhDOZAMhLv9Jw82FzJ8ZgO9PGztOkCKD576qAYpJVu/i6biFP90SElVS7gs2Fz3qC1gL IEcFa1BIGUOY3e9LfXLffRHBRR9VmAnH4Gsk8bFelrU7NP5IGu2+F0PkSzQqIsrqNRnB E4yvd7A1fM4Kn6BtkWjdOzmBo2HGQKk9NVa1Xu5oSsJH9cjUJxBA9/QAUchsyMjJIyIp Zo8A== 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=cjhNljTqxQ/Ky0zLZM+uPTgv6SRPxcnS2TkxZBhdmPA=; b=bvixYWulzF2gSy3eirOPPriCGBTltOkpBVy4cLnWLjB8YeNW8j8YRd4LKgufZVGRwM XD3iUdBktvSAdjfCsptBxtYywIcaL2iJasjZ1KTBEKBlb6ELa5mhpNx5HqloaNDal5Ip h9xHre/Kyt1VBXcXdYIwroHPTM5Tsos44wo6c7iGSYhH16lfzcPwcdZldTLhdD9hbkUT rT9++lrVDps/IeB7pDYWtlr1yQjNLK24TWAzD5Fxbw3O19hf4gFyCivTn6VXYj5vRGyr FcomLIMCLY974cdw3DGodg+Sfr0rA1TzAdZ6trXXl92wKgB31WI6gwaAUu0tOpQwrHch U5ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=oNf1gFR5; 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 q28si791472qtf.22.2019.10.25.00.42.23 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:42:23 -0700 (PDT) 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=oNf1gFR5; 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]:57022 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuEo-0006Vj-Pa for patch@linaro.org; Fri, 25 Oct 2019 03:42:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40393) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpw-0004bl-RT for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpv-0007CR-Jo for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:40 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:40483) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpv-00079s-Cx for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: by mail-wm1-x335.google.com with SMTP id w9so847836wmm.5 for ; Fri, 25 Oct 2019 00:16:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cjhNljTqxQ/Ky0zLZM+uPTgv6SRPxcnS2TkxZBhdmPA=; b=oNf1gFR5duTDlT5RDMLSpVO44tj0vJQJgB4HN8RuN0SnPNkCtG1j1YkDXe2Yw4fY0V Cf00WkY1H5WMp+g7jAkDjBcds5ERu+6HV6XyFB0OM/43uW7n1XyjI+67pXPaWfkV4H6S Y0+Cc0/5nvgQKgAaj9NsmAjAdg/qlRs83OarP94vlY/xVAN00wVRgjaoZifVY7y1c2C9 liyjBCBT04loKEVcjzMQfOYDAAObYrEgUqxDBK5vVmMIotpmD+fxluTNClUtLN4Tacme r8b8UlxVlGVbEvOXJ1sspa3vgAKrnjMUV92keM5572OmKn2fFwJ16xKIyaNuQaSBSgG0 BPpQ== 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=cjhNljTqxQ/Ky0zLZM+uPTgv6SRPxcnS2TkxZBhdmPA=; b=i4Zc+40s7gXymliWLmNwfvLlPHnoTJuI0b53cKWSSuJbt4ypAC0CS0oysDsHcVAXIa Vg1SMmVVuXpVaIcbhnqkgRKbyd2TrR2oX/w+P/6URt6XWJfXatnmuAZtHAIh9Cuqpaa+ LR0fiUP75ff/0RebV59FjZzDSWr6xMCXAM8dXqzG+DZBFuA7pw38MXWL3QoAxtvo27hP pOnCI3NcQSldkW65tUBZfhS7tCLFASZuFoVF/P0RFGXdiA22YmpgJfAM7nuk/k5JOFZm JF8DObnIAggb/oVZ6El/tS7dnLR1kKWcL53qTnLXGPdedkykrCZzaVvjuJ3EYSrthwVz ghCw== X-Gm-Message-State: APjAAAUx8QZLfjQ8Eg6owavoVXnCMBF4x7eUIEQUKi74dRE0WKnLga6m 0R02YzLZroZULsZ695eKDV1zdA== X-Received: by 2002:a05:600c:410:: with SMTP id q16mr1972360wmb.169.1571987797190; Fri, 25 Oct 2019 00:16:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h3sm1188235wrt.88.2019.10.25.00.16.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E43B51FFBA; Fri, 25 Oct 2019 07:37:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 33/73] translate-all: notify plugin code of tb_flush Date: Fri, 25 Oct 2019 07:36:33 +0100 Message-Id: <20191025063713.23374-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Plugins might allocate per-TB data that then they get passed each time a TB is executed (via the *userdata pointer). Notify plugin code every time a code cache flush occurs, so that plugins can then reclaim the memory of the per-TB data. Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 0a08fcda3e8..6d1b0ecd69f 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -1231,6 +1231,8 @@ static gboolean tb_host_size_iter(gpointer key, gpointer value, gpointer data) /* flush all the translation blocks */ static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count) { + bool did_flush = false; + mmap_lock(); /* If it is already been done on request of another CPU, * just retry. @@ -1238,6 +1240,7 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count) if (tb_ctx.tb_flush_count != tb_flush_count.host_int) { goto done; } + did_flush = true; if (DEBUG_TB_FLUSH_GATE) { size_t nb_tbs = tcg_nb_tbs(); @@ -1262,6 +1265,9 @@ static void do_tb_flush(CPUState *cpu, run_on_cpu_data tb_flush_count) done: mmap_unlock(); + if (did_flush) { + qemu_plugin_flush_cb(); + } } void tb_flush(CPUState *cpu) From patchwork Fri Oct 25 06:36:34 2019 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: 177661 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3277495ill; Fri, 25 Oct 2019 00:25:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUGwJruA44ZPuDWEwnVJgBLL2ca9mDy799GEVGC57YPa8U35W95WQUJZgniN0ZrLUHP6sU X-Received: by 2002:a37:684f:: with SMTP id d76mr1439848qkc.315.1571988314693; Fri, 25 Oct 2019 00:25:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988314; cv=none; d=google.com; s=arc-20160816; b=TYsSoTipO5Pe9GS256lOcut/5eZB+bmwM760S+xk2VM8jm7R2FUDVoQF+qhNHbEtcz WMcua2qD/0s3Zgq+MzSxrFHwWjkZH0TmWdN64uOeBvT+ySvOr8VAIlv/Z4kxET1LYd9W b448KLyTctHWPP+42oba8Z6DLTu0sJqjSDKuzPRhwBllag05UzfGjCuuNELSk6A5sqbd kijkwl7MF/DvJ+gi+ycybiOhIBpUY6KVcF7TdeibTwA6DwxTRyT7TPHydaRvrJA6StgF L368a0Q4DyZNMZcbXZd0BWCFfQsecue9gB2Rr2cRkJL7EY25WUGfS/v9e7cMJqSz2yF5 mVZw== 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=InxJufY4GZdXxhorR8TFr2dyO/+lRhEgHf6keWCHq84=; b=qDTljpxwpSAy/6MdT+LoBsmJNtQikRx0D5T4LfnQCHw4s4Q5D61o5t353LoprMR+Ii ICqr9+QYkKowJKrIWTL0Jh1212GnFcollBZtfcufXHKtx75AIM0Ea/GH/gC12uygB3M7 GPH+AT7uij57+ff2i1rzLckeI39F4lLJBJXLWpvuCO7yZAWxbpFrZE/JGqJnzOdQy8Mh PrhqR2swwWrKw4pImOhxBw+3O88J+FxytPFlI5F28nSVk1/Eu3oNzA7NCcuhf5MwmASu +UBMNZMtVjnUgbUOb5d7c8aYqqQIvPaaJt5LchnpI2H5kKECSvzFAP/z1p7cbq3cN0bI tnyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hnWHV+EL; 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 g13si816695qki.134.2019.10.25.00.25.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:25:14 -0700 (PDT) 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=hnWHV+EL; 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]:56734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtyD-0002yq-N7 for patch@linaro.org; Fri, 25 Oct 2019 03:25:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38205) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWZ-0003OE-Uy for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWY-0007gH-PF for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:39 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:56230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWY-0007ey-J9 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:38 -0400 Received: by mail-wm1-x32e.google.com with SMTP id g24so796776wmh.5 for ; Thu, 24 Oct 2019 23:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=InxJufY4GZdXxhorR8TFr2dyO/+lRhEgHf6keWCHq84=; b=hnWHV+ELMptqNqlmI81JXyI4tT0hGhEgvyPo6cntZiYZJxFrB/8okHPF2LlpBMknTM DL7aM/8P18p6Hi9TNSZMOjT466NMw2RDl85YkwoBMrCONRHWtt0iRNZMtnITlob9MZ2+ xpyfMoRUmhKiaCSdgJKgg67aD0Jppgd08hWi/vQWuTD5HNLh0/mMjq5JrZKGAgnQQVQK JbpsxFdxSV6UwYtzfraMHRaS5k9bx3UpAzUkG//ftKcUE2oA8yUI3W3hAW4Flr+m4t7y TgN8tnXGDZicCfhkQ+kwHRjQgNK3KSM1Wy7fIAstxbde1trEHo4edJB6srx0rDUoaBDQ H5sA== 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=InxJufY4GZdXxhorR8TFr2dyO/+lRhEgHf6keWCHq84=; b=mgZXOd81gK5eYSaA6fXjWuvOpUynSavwdgUF35ocRA5TemKOe+/3tEReR1vi7XTn5n LXdFFfcbToF/jFUqMNcUhK1EGXldGpxdKpPZd6DBW+Dj1Xxr4ZeKCEW5WkQxcHklEoip OfHcdf8m3qLmedaklu01aeThg9J/LX93hQDj6ejx5n58oUdzjEYGR0b2fsZZ/mpVo7kv FuuaWtKib06BNzSIUHQgNAgZkCP7C0I2IKo2aH0KCKgE7DXyQ8Ij4AL53ysHotmfVi/E TfYqCAMEi3bkK/jFoY9I86AUa3iPudtXwTLnyp6eWWJ6mjW4TVzJaejaBMjqdy3A3P2M NXwA== X-Gm-Message-State: APjAAAUDh00fA7/9MaHaJJl9x/Bp2ltP3KJ71XnVpZ9W3+KUcZXynfrW ms+2mxKnI75ZJunazCkAJ4ftMQ== X-Received: by 2002:a7b:c7d9:: with SMTP id z25mr2026014wmk.127.1571986597523; Thu, 24 Oct 2019 23:56:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a186sm1396359wmd.3.2019.10.24.23.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0547C1FFBB; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 34/73] *-user: notify plugin of exit Date: Fri, 25 Oct 2019 07:36:34 +0100 Message-Id: <20191025063713.23374-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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: Riku Voipio , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , "Emilio G. Cota" , =?utf-8?q?Ale?= =?utf-8?b?eCBCZW5uw6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Reviewed-by: Alex Bennée Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 1ee6195d9ff..84a983a9a12 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -332,6 +332,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, _mcleanup(); #endif gdb_exit(cpu_env, arg1); + qemu_plugin_atexit_cb(); /* XXX: should free thread stack and CPU env */ _exit(arg1); ret = 0; /* avoid warning */ @@ -430,6 +431,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, _mcleanup(); #endif gdb_exit(cpu_env, arg1); + qemu_plugin_atexit_cb(); /* XXX: should free thread stack and CPU env */ _exit(arg1); ret = 0; /* avoid warning */ @@ -505,6 +507,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, _mcleanup(); #endif gdb_exit(cpu_env, arg1); + qemu_plugin_atexit_cb(); /* XXX: should free thread stack and CPU env */ _exit(arg1); ret = 0; /* avoid warning */ diff --git a/linux-user/exit.c b/linux-user/exit.c index bdda7205532..a362ef67d2c 100644 --- a/linux-user/exit.c +++ b/linux-user/exit.c @@ -35,4 +35,5 @@ void preexit_cleanup(CPUArchState *env, int code) __gcov_dump(); #endif gdb_exit(env, code); + qemu_plugin_atexit_cb(); } From patchwork Fri Oct 25 06:36:35 2019 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: 177657 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3269917ill; Fri, 25 Oct 2019 00:17:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMojF7VOPBMMHzGwQXozKUhK358S0NS0XKnMEe6+Mqs8U4JW9grqseHE79j2WHeiCxtZzG X-Received: by 2002:a37:4812:: with SMTP id v18mr1449031qka.27.1571987869228; Fri, 25 Oct 2019 00:17:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987869; cv=none; d=google.com; s=arc-20160816; b=ijMcK9Rq/rrZfllcpzEfR/MykCHNqRR/+BhX/6NOYumsYm3YuAdj2ELUY9mAvLhygJ qhc6UdyDxHjSIoPQ/d58Kc3VFd5RMzwldP3vomU+5iAqyYQVDAjqaO1ee/2Wa+PYyW3m 24G4oaUNf2fp5PGc18uE95HHLDwCnF4oxry6dPGD7GE9NCGG4kbDJV3boJBSCYzBVAfa HuTZnxfgevzdqPI5kRmWjTc0RT/1jFaGLgzC4+WCDTRXRC4lc2Ad3s16Hsez9F1DyrsZ eD0CGqQMIdRCmzDtja5m9AzVoPh2/15UZzsPxVMMARx1S2y9WZClF78OStt1UBD5FmL3 lUJQ== 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=x47k/VxsI+WVM0DfT2oDeIPT5nZyOR1szQ7TpFo9UBw=; b=0aZgESAKHJM7KvpJBgPuExTAXG4UiDqGjriClRjQTkXlliZWu3HNXprgRCtx38srbX 8GSL7wzyITLqJ5uyl2L+p7ioU9BCFj9bgA/f8blZVN2rMpaLYXK9Dy0+WfiygFHE+ylp ozU0371gw/wPfsHpITnoZvm0yj6e2iFVk6gxcDv+rTLZwF+PsjRsAxx/XHB7phyDdXt9 bK0A6ru3FmverAOYd+rfa75awg2WHUVwl/O/Y3kthKNWnDNm0bkNw9qZ6TdnwssZw9sw Ilrx66Oqtbp2Yq1e4EU7DEN1f+VZruzT5+IW+gJBYkWqTnBNZja0PcYRWsyVLLmGhP5t DQmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=T0izpLM0; 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 k4si746403qtq.10.2019.10.25.00.17.49 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:17:49 -0700 (PDT) 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=T0izpLM0; 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]:56632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtr2-0005Vz-7j for patch@linaro.org; Fri, 25 Oct 2019 03:17:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38175) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWY-0003KN-EG for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWW-0007do-T2 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:38 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42629) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWW-0007bu-Lq for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:36 -0400 Received: by mail-wr1-x441.google.com with SMTP id r1so951354wrs.9 for ; Thu, 24 Oct 2019 23:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x47k/VxsI+WVM0DfT2oDeIPT5nZyOR1szQ7TpFo9UBw=; b=T0izpLM0apia/pOyYCgJ7Db/DMNeS7kKrQvA1yEhusGCcxMn3U9Rw1gV5r7Dd4m6Qh oEkzDpXyNyxomqv4o6oBLF3qqpuGV/uaTNE8qVdAn0I3wNtcGt0at6sMSTPqRgAYibhQ yDf2TMX3Lygdt5iUeXbWN8Ije0qEf1+W3OUtFHfngzd01fPMCcNli8wZltJozrhc72tm WMsTpZ6uuoeNA3hMNTVgQuk2kpeygarjm3Fsn/HchJcBuLV8MHTEk4X8H+8RV44azX/x mNMkIE6cPOEI+/15NaBv7GeY+6UtFtcVD+txKkkD4ib8hA/QupE8AWSjTq86/JP8A0Rx McDA== 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=x47k/VxsI+WVM0DfT2oDeIPT5nZyOR1szQ7TpFo9UBw=; b=L+wuIQsNj2nNTAWVrUjY0OsCLH6q1hkBBnik1ImDCefJMfYJJaIVrZ4kW3xqsIdJGR WW64syQ9NgQUXcyvWvik7yzFMW9j8QMOuTwXKiO7YkJ4coOXpmtCnyD+PVaCLBWcae2v LRfFd919U3Ewjr0qVmT49ZLRfv1U6u3rdVBB9BXWaYyt4S9pUE0l4u/1OvPZ7OVqpCts PsBtr9kDZ4t2jIebbuGftiwXUZl6dadpXetuyHN3jsWN6FZn6z2PCBzXOIjgTsu8vDAg yR7jepQMtNcDfhsCGAxZxTgRva/8+qdUuq7713Nxs4BMubT4Ekd6gfs8iIWRt2tO/R6Z RVTQ== X-Gm-Message-State: APjAAAU4al9P8WEVG0C5zv6zp0aJhvvFPa3I4Z+XG58kzKNee2ddKVBW eC0eE93+ZLZt0f5+8kNAWhkFeg== X-Received: by 2002:a5d:544d:: with SMTP id w13mr1363580wrv.19.1571986594761; Thu, 24 Oct 2019 23:56:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r5sm1724815wrs.57.2019.10.24.23.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1DAC71FFBC; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 35/73] *-user: plugin syscalls Date: Fri, 25 Oct 2019 07:36:35 +0100 Message-Id: <20191025063713.23374-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 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: Riku Voipio , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , "Emilio G. Cota" , =?utf-8?q?Ale?= =?utf-8?b?eCBCZW5uw6ll?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" To avoid too much duplication add a wrapper that the existing trace and the new plugin calls can live in. We could move the -strace code here as well but that is left for a future series as the code is subtly different between the bsd and linux. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson [AJB: wrap in syscall-trace.h, expand commit msg] Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/bsd-user/syscall.c b/bsd-user/syscall.c index 84a983a9a12..0d45b654bb3 100644 --- a/bsd-user/syscall.c +++ b/bsd-user/syscall.c @@ -26,6 +26,7 @@ #include "qemu.h" #include "qemu-common.h" +#include "user/syscall-trace.h" //#define DEBUG @@ -322,7 +323,8 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, #ifdef DEBUG gemu_log("freebsd syscall %d\n", num); #endif - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); + record_syscall_start(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); + if(do_strace) print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -403,7 +405,8 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_freebsd_syscall_ret(num, ret); - trace_guest_user_syscall_ret(cpu, num, ret); + + record_syscall_return(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; @@ -421,7 +424,9 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, #ifdef DEBUG gemu_log("netbsd syscall %d\n", num); #endif - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); + + record_syscall_start(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); + if(do_strace) print_netbsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -479,7 +484,8 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_netbsd_syscall_ret(num, ret); - trace_guest_user_syscall_ret(cpu, num, ret); + + record_syscall_return(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; @@ -497,7 +503,9 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, #ifdef DEBUG gemu_log("openbsd syscall %d\n", num); #endif - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); + + record_syscall_start(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, 0, 0); + if(do_strace) print_openbsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -555,7 +563,8 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, #endif if (do_strace) print_openbsd_syscall_ret(num, ret); - trace_guest_user_syscall_ret(cpu, num, ret); + + record_syscall_return(cpu, num, ret); return ret; efault: ret = -TARGET_EFAULT; diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h new file mode 100644 index 00000000000..9e604736433 --- /dev/null +++ b/include/user/syscall-trace.h @@ -0,0 +1,40 @@ +/* + * Common System Call Tracing Wrappers for *-user + * + * Copyright (c) 2019 Linaro + * Written by Alex Bennée + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _SYSCALL_TRACE_H_ +#define _SYSCALL_TRACE_H_ + +/* + * These helpers just provide a common place for the various + * subsystems that want to track syscalls to put their hooks in. We + * could potentially unify the -strace code here as well. + */ + +static inline void record_syscall_start(void *cpu, int num, + abi_long arg1, abi_long arg2, + abi_long arg3, abi_long arg4, + abi_long arg5, abi_long arg6, + abi_long arg7, abi_long arg8) +{ + trace_guest_user_syscall(cpu, num, + arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8); + qemu_plugin_vcpu_syscall(cpu, num, + arg1, arg2, arg3, arg4, + arg5, arg6, arg7, arg8); +} + +static inline void record_syscall_return(void *cpu, int num, abi_long ret) +{ + trace_guest_user_syscall_ret(cpu, num, ret); + qemu_plugin_vcpu_syscall_ret(cpu, num, ret); +} + + +#endif /* _SYSCALL_TRACE_H_ */ diff --git a/linux-user/syscall.c b/linux-user/syscall.c index f1ab81b9177..be2a3b93b3a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -112,6 +112,7 @@ #include "qemu.h" #include "qemu/guest-random.h" +#include "user/syscall-trace.h" #include "qapi/error.h" #include "fd-trans.h" @@ -11983,8 +11984,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, } #endif - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); + record_syscall_start(cpu, num, arg1, + arg2, arg3, arg4, arg5, arg6, arg7, arg8); if (unlikely(do_strace)) { print_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); @@ -11996,6 +11997,6 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, arg5, arg6, arg7, arg8); } - trace_guest_user_syscall_ret(cpu, num, ret); + record_syscall_return(cpu, num, ret); return ret; } From patchwork Fri Oct 25 06:36:36 2019 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: 177650 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3264228ill; Fri, 25 Oct 2019 00:12:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxI2usRpxDX+v/c4VFd0lJVC7t5iVFIDljLjF9Mq/uDkZwN4cXkyPRY+yVNGaTnEitZsNXf X-Received: by 2002:ac8:542:: with SMTP id c2mr1649583qth.338.1571987540530; Fri, 25 Oct 2019 00:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987540; cv=none; d=google.com; s=arc-20160816; b=qQQ6y7YyEUvzzdRX8edNZ56LeDdHV9yQFclXKRQ95LtT0P3J0+6ChUVHWxY2KYoI/Y 4Rf3rHsZsQO+a6vh5cSzWz1By8oN/qGHVfZlnaqA6EuNzdx6kGtGiev4L3XfzZs/hx82 XHYuXg0PVuzo+vWqPPRGsJUmlEZC6gdB/UFuCIkcm2RKEZ4Pneh/SjJ8S1k2ZbYsfVjI Yk7pclEfZ532DXIVe8Joxw7hjQ36D8E40sSzwxbg0bRZ1cLBmtVFPqiBjyT5xdqkdfzA gAts5V5+cpDLSHUSukimlMIu7Dr0v30IizKCOofQtwX6pJXW9/gCWHbRQbREZwSC/JVq 2p6w== 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=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=on+lWgdyGbMgyiiocbkSh3WSaQjkHBt1xgT/j3s/5iJWOiuBIt5caBozBuCk+mqsjn tEbiypXMNSyB7JEoecoitSfrp5bB7UC5ivAt4ZcDxpbrwksGLTTq6g7JJ43yotEEXNHl hUSztT8w255vXBczJaHAEpc3svwtcSNgYPWv2qBz0l96M5AYWIq+ZeihDcS5IroEISX/ iN57Rax5bOvm4vVYwuZtUmL9zzNGRIDzccza4higSiifnf24TU2WgEzXUCPkoKmEFw9e pKQ/GYSPMXbwVTgXkrgdgSrnvH1QeYYHYW5e2W+0KisGCz8uofK+elfzAxaoV+yppkPD gOWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QYJFGeGq; 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 m47si800717qvc.214.2019.10.25.00.12.20 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:12:20 -0700 (PDT) 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=QYJFGeGq; 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]:56456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtlj-00056M-FH for patch@linaro.org; Fri, 25 Oct 2019 03:12:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37068) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN7-00088Q-Vv for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003HW-Sn for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:53 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN4-0003Bu-Oe for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x435.google.com with SMTP id z11so914806wro.11 for ; Thu, 24 Oct 2019 23:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=QYJFGeGq0sSo9sbz/GAMzd1EHA0zEkKRQJYiSnce21KSMl5ACw9b3zfx0+xncshEcW kWr5FMUW0V+b/TeQd27lqsEc3NyD+NXC3+RiJebvHcZe0j8jNux6tSCF2LYOS9klsbZQ oQKH9iyBFfO0P83MZhIFUyBsa6Ku/8+QgbyGd847gBlgeEmzhEBLIWSKC9gzkHIffmKj jEG18/r2tU1g7TevfBOUVBHj+C5kdLKaqhPmN2Brxbo35F5mdDZuZhEUWu2RN0JIt8iR QLqZV9NUM9oAkLkQmIpqG/kwhvw9j5Oi6VF+dKezf0Xm47h+EMmNDGreNUnuFvsH+IUA 4UFg== 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=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=QY30FWx8kNmlT5AQCNQvL7+nMKmN9V2aHQRfaHtMbTcHdRiajvi5sS+qlMKd8a6Xoc 2gLhC/ems2PLh9wQ2HyBhTcnC+9UKMSkttHQEMK9aLBiq6GiJ4C/WqLItj9qGcvBj2FO 8dAW1CBohkmNsVyu799gd2/SpzgADnKAiHuV7x/un0whZXEE0iibzUEcSrIWlxfk111h lZxLa1G3f6qQvb2PO9W9X1b3U1lUXdIhWmLcBX2N6X0HCVAG+UJb+p2eAh2DpZRstmLO OLzoso2/Gblu92MD4xvvEFyPgbBWpPosXFCRfu1b4W/syrMSiuHvDzVkqECK3E7kWUzG tqyA== X-Gm-Message-State: APjAAAUrR3S715/qTnHBpNW5L7SlXsVlgiHlD/0lJ0r7eBi7UFHGMveB 0i5moegXuqCRyOT9+aMevlpDjHcV00M= X-Received: by 2002:a05:6000:34f:: with SMTP id e15mr1436825wre.232.1571986002905; Thu, 24 Oct 2019 23:46:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j19sm1777794wre.0.2019.10.24.23.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3660B1FFBD; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 36/73] cpu: hook plugin vcpu events Date: Fri, 25 Oct 2019 07:36:36 +0100 Message-Id: <20191025063713.23374-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 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 , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/cpus.c b/cpus.c index fabbeca6f46..63bda152f57 100644 --- a/cpus.c +++ b/cpus.c @@ -45,6 +45,7 @@ #include "exec/exec-all.h" #include "qemu/thread.h" +#include "qemu/plugin.h" #include "sysemu/cpus.h" #include "sysemu/qtest.h" #include "qemu/main-loop.h" @@ -1264,9 +1265,18 @@ static void qemu_tcg_rr_wait_io_event(void) static void qemu_wait_io_event(CPUState *cpu) { + bool slept = false; + while (cpu_thread_is_idle(cpu)) { + if (!slept) { + slept = true; + qemu_plugin_vcpu_idle_cb(cpu); + } qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); } + if (slept) { + qemu_plugin_vcpu_resume_cb(cpu); + } #ifdef _WIN32 /* Eat dummy APC queued by qemu_cpu_kick_thread. */ diff --git a/exec.c b/exec.c index fb0943cfed6..1feda0ca761 100644 --- a/exec.c +++ b/exec.c @@ -975,6 +975,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) } tlb_init(cpu); + qemu_plugin_vcpu_init_hook(cpu); + #ifndef CONFIG_USER_ONLY if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu); diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 73b1ee34d04..db1a03c6bbb 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -32,6 +32,7 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace-root.h" +#include "qemu/plugin.h" CPUInterruptHandler cpu_interrupt_handler; @@ -352,6 +353,7 @@ static void cpu_common_unrealizefn(DeviceState *dev, Error **errp) CPUState *cpu = CPU(dev); /* NOTE: latest generic point before the cpu is fully unrealized */ trace_fini_vcpu(cpu); + qemu_plugin_vcpu_exit_hook(cpu); cpu_exec_unrealizefn(cpu); } From patchwork Fri Oct 25 06:36:37 2019 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: 177685 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3291373ill; Fri, 25 Oct 2019 00:39:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbvZZVX6RHmAtArrE1TfRNwRFoAvWF/JUkYHh9ivJR4rwuFyN3ljwdUWbnjazw6HO4IXjF X-Received: by 2002:a37:816:: with SMTP id 22mr1682636qki.454.1571989170578; Fri, 25 Oct 2019 00:39:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989170; cv=none; d=google.com; s=arc-20160816; b=sjk7gxU5sk5wRl6A+swfEghzqkK6wda94uYtK3y3ifFr4YPBcgtPMiSYeK58RhQliy QY+2cTdT9gNdmvz51khTgTfmfg3+WeS/lceMOiahFB1ApsrPa3sfqO1b3PVgGOm/81RJ a2LD80rfBke+EkKhgzm5Lzy8DNSXG9jaMQXhHPjCYRUHkI2xOVUE6GcJ78xVOCld1IS3 UjCcKGYJ7altcBUKMBdmJxxo1lgcGG/2hVO+BcR7p+mR29lTFyzN5R36qtVnqO8sUvoR 5jHo3KfrRzl8WQCy86dtoHaFK0VWPNMeTl+NejDdKJ6i/KQ6nmFmahNOo9ExOUhw+quV G09Q== 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=DFJwHA2AP1ezAjJK1JlPulxO+eNr4yTHxJXk/vo/FGk=; b=lqvPkoeIa2Efh8/tTGH2iA2CiC9ibAmveKMkYreqSultOWjCRcrC1G4HU1PX9jjKtq LBvuiQpQa/lX9cDVXxVnNFL9ILSHtiE8k6366N+hLAoN5OnPjxSQn7LqB57I0c87/BLg 0iZgdXeNstJSwFpWGizruAYgRVRRZ8AeKUvq7WwcyMlYNaAprIMTlVcwL8cxXthjpMcP /6VwcDS+eYCWIYxaG31Zuti8LHay9oQXruCsOz4K7CPEywR60J9Qfe9hjLQ/QgLPeRCz /bfEOCULe2vrmKu/1pS/iCsu1HbPAhyDPAudX8WiN+jDIUkuj2A+e1SuQbg34ogxdszY JB5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hyVfbRSF; 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 z64si777918qtc.169.2019.10.25.00.39.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:39:30 -0700 (PDT) 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=hyVfbRSF; 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]:56974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuC1-0005XM-OH for patch@linaro.org; Fri, 25 Oct 2019 03:39:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38241) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWc-0003UK-9R for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWa-0007jj-4r for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:41127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWZ-0007ig-V9 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:40 -0400 Received: by mail-wr1-x429.google.com with SMTP id p4so953216wrm.8 for ; Thu, 24 Oct 2019 23:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DFJwHA2AP1ezAjJK1JlPulxO+eNr4yTHxJXk/vo/FGk=; b=hyVfbRSFVyqFWE/FQax+KcYI51JMsQYvlHCrNR0WO5xsiJQ4Pkg8YWEAn/CATSJ8w9 7nGgWbkWdEW5fSh8IDF+nosMuZB2yF/SCSXQE8Te5YLyoaa8nVeiELGl8mcv2cgtIlCt +qLZbE987GwchvLsSmstRIGTsbv/nJ+csZLd/mi6dcb40DITJN/Qe6EH0PnhIm7KCXlL 9bzSEORD2D75PZUG4d1etQH4Wu9nVfAkgBHmgKGeybEUMIo9cwyAQPEweTtkCTygKSIw 97DAsdR/HaLS7t3hS8SIQ0wnXNc4sUAu+Yt8/vVImF4rqnq/+6Vccs2uufEW55RJA0a0 sWNw== 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=DFJwHA2AP1ezAjJK1JlPulxO+eNr4yTHxJXk/vo/FGk=; b=S2QXcr/VCqOGOb6KYpjSyy0OVtA8wlh31KPbevQsVyx/UK8+p/YF1Q1Dpb0/YdKnlm 15jcoX+YXumLJFa+EGa1zRu2E7+4XL9VvBx40nLZZE2KOjmlBIY/Yc/3M+c21dxGN3Wn rXpB3z5aUwuFNwfyd/iY8FjK29vVfCsmsspl2dOTUsdpfW4B0IieESIRD9CejwnI4aCk DSGhBLiIWjz86Z74+ZQK5otiIxZrzxO2F7wJxOkgynK/I2Y7yb66ci0UDodOQy7FLtQk y0J06MAm401uFD3s/R+kQT9cRElL8dEK0DorcduOuy/lTkuRLOCURHkpcKRGi6T9nHc6 WYLg== X-Gm-Message-State: APjAAAXQ5JQ1lh1PipPPN2hXjTrOujksjWQM2XU86by302yCoiNkEM3M zFhNtxTf/E9vLABiN2x4Z1LlIQ== X-Received: by 2002:a05:6000:4c:: with SMTP id k12mr1446329wrx.100.1571986598867; Thu, 24 Oct 2019 23:56:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o187sm5777083wmo.3.2019.10.24.23.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4B9F71FFBE; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 37/73] plugin-gen: add plugin_insn_append Date: Fri, 25 Oct 2019 07:36:37 +0100 Message-Id: <20191025063713.23374-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" By adding it to plugin-gen's header file, we can export is as an inline, since tcg.h is included in the header (we need tcg_ctx). Signed-off-by: Emilio G. Cota [AJB: use g_byte_array] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h index de519883b16..4834a9e2f40 100644 --- a/include/exec/plugin-gen.h +++ b/include/exec/plugin-gen.h @@ -27,6 +27,17 @@ void plugin_gen_insn_end(void); void plugin_gen_disable_mem_helpers(void); void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info); +static inline void plugin_insn_append(const void *from, size_t size) +{ + struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn; + + if (insn == NULL) { + return; + } + + insn->data = g_byte_array_append(insn->data, from, size); +} + #else /* !CONFIG_PLUGIN */ static inline @@ -51,6 +62,9 @@ static inline void plugin_gen_disable_mem_helpers(void) static inline void plugin_gen_empty_mem_callback(TCGv addr, uint32_t info) { } +static inline void plugin_insn_append(const void *from, size_t size) +{ } + #endif /* CONFIG_PLUGIN */ #endif /* QEMU_PLUGIN_GEN_H */ From patchwork Fri Oct 25 06:36:38 2019 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: 177651 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3264898ill; Fri, 25 Oct 2019 00:12:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzg/vejZ6+FYHnK97Ot9CPDf5Vo54RyjgC6Br8ftBHnIvQlxy7KXGo6i6IuwCpoAOxmgnfL X-Received: by 2002:a37:78f:: with SMTP id 137mr1445311qkh.321.1571987579304; Fri, 25 Oct 2019 00:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987579; cv=none; d=google.com; s=arc-20160816; b=xTQbepQO7avX5E/azkXLxK63Lz5ti/AUsr9rWdFeVNTmQ4m9Z7WLUXIWOVhjwQ+dNy KvjJepM09285GK7KRBAwEs27qmQbi/SfEEyJtLj55if1359VjigfOdAmiT3M/FhELl5m Jqj6+180LnsgSqTtk3OWlRZU0/9TvZ/lA7nebgiGVMiYGVSD8rUTzasR5QNEQQJgMUtP 1s8a3FEUD1qFiX04zvtzBENcSXe5ee3prtG4zav1Wfq5i/WeNtEXjXYhPnDfqJuAo+xZ xQVravhEo5WLPe16bbTJVm3uSvlm11zGvNkTdHbsYVjEth/S5k7ugSXSRBEw3RCrjeNa suxg== 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=BlVPTXUE+8KwJhfzqDWAcBn9rcfGn0EwpwkN7L2kZ/g=; b=XsJ5oOz8jz5Q15FQxketxgl420xwYCURtQxWC52DP3el3MmaBbElvysb1KZ7wYXJCG 62Umd8xA2cC7G/MbZ76QsiO7wLjEBstydABo7kGIvycgnkPxgiTkxyHLoCXtK+NXptDS 9Qxu7O11bqg3azL06h62x09YZIykZPlhrDe27QfSYbZMMjRxY0T9BPyWBoJx4ZdTPyl1 aLCHJz8QNTNWMQicaq5guaxCKHyszM1Y+QoUVWzdCu7UuY+Z5MCrZTeToWE3WGI+KN/S JbhW+EaQVhVMqMLN8JTEgXqfR+01DgT+YyUcesjORCeXIqVIwA9DXxh2PprxUl02JUIW zEpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uDvByOEM; 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 l62si681409qtd.146.2019.10.25.00.12.59 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:12:59 -0700 (PDT) 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=uDvByOEM; 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]:56462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtmL-0005Np-8K for patch@linaro.org; Fri, 25 Oct 2019 03:12:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37088) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN8-00088U-EZ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003Hi-TN for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:54 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35164) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN4-0003BK-OC for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x42d.google.com with SMTP id l10so956757wrb.2 for ; Thu, 24 Oct 2019 23:46:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BlVPTXUE+8KwJhfzqDWAcBn9rcfGn0EwpwkN7L2kZ/g=; b=uDvByOEMTl6kPqlyoTri2+TmxebnUuDxLWSWe9MnIAD9cB+JwOIrirHuFRLso4i4MX 507f9CSE7D8Sueue4ZmRslr+dPgZlQlsxjzM3dKbMxAH3Eq+Bj8g8NbzH8EzqRvS4ckf VYN0xLrGDNUsRr/zeXKereJn2c8HIDiAzjIbyMxmEFc0MefxqdXcixSV3Moxa8HjXWHj cPJYif3huJpOW4+Sc2989dGzD0tcVkCkSzehnXKp1pUeTyPuEYgnNR0Dn1m2IRKjMs13 rNPAq992j9qUDp339OVfo74dN0j0yQf/bWwT5+k6X6xddK6l4s9xATBvWZ/e/g+wNnHD +lSQ== 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=BlVPTXUE+8KwJhfzqDWAcBn9rcfGn0EwpwkN7L2kZ/g=; b=DCu8v5kqrEpf17No2bjddvystQju/hcr6XvfBsGtXYjAWAXQ1t/lYVTlJQVjrrEtan NMkzJgEQctDwe9Mif/+y8a4S1GQVFq/kCJbDr3nFfNJVdvlxjWJ1KS9fVVGkBxl9DnQi 0Ha5ffyWjJe7bNTsQR2aFoI/HRRQ63w1fruha4ZIIY/qMhrQop/QXoV1KzPVga9c0O0h VkB19A5Aa+gy4dPbxGCXsfnQaSyDzRtDyPZE0MpZEQeQ9jFFAniuBD985P+QQev2MFOk nLTc37oRwShXgE4LGH+aPEi/5PqJh8WagTqDkA3rak2xQK3dO4CaFLh9lQ6LN1lvAaHM 3G8w== X-Gm-Message-State: APjAAAWSNpdvF9vdHpyfbTBBul84/hK6aRVq8AaFO5Sq+6kxqeyvDWNy Oz2j41COIn1axjTxur+cjB5TIA== X-Received: by 2002:a5d:51c3:: with SMTP id n3mr1308685wrv.5.1571986001590; Thu, 24 Oct 2019 23:46:41 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c189sm1241767wme.24.2019.10.24.23.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 671411FF87; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 38/73] cputlb: ensure _cmmu helper functions follow the naming standard Date: Fri, 25 Oct 2019 07:36:38 +0100 Message-Id: <20191025063713.23374-39-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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: Richard Henderson , qemu-devel@nongnu.org, Paolo Bonzini , "Edgar E. Iglesias" , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We document this in docs/devel/load-stores.rst so lets follow it. The 32 bit and 64 bit access functions have historically not included the sign so we leave those as is. We also introduce some signed helpers which are used for loading immediate values in the translator. Fixes: 282dffc8 Signed-off-by: Alex Bennée Message-Id: <20191021150910.23216-1-alex.bennee@linaro.org> Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 2c06b57272e..c7a986d7cb2 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1920,12 +1920,18 @@ static uint64_t full_ldub_cmmu(CPUArchState *env, target_ulong addr, return load_helper(env, addr, oi, retaddr, MO_8, true, full_ldub_cmmu); } -uint8_t helper_ret_ldb_cmmu(CPUArchState *env, target_ulong addr, +uint8_t helper_ret_ldub_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { return full_ldub_cmmu(env, addr, oi, retaddr); } +int8_t helper_ret_ldsb_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr) +{ + return (int8_t) full_ldub_cmmu(env, addr, oi, retaddr); +} + static uint64_t full_le_lduw_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { @@ -1933,12 +1939,18 @@ static uint64_t full_le_lduw_cmmu(CPUArchState *env, target_ulong addr, full_le_lduw_cmmu); } -uint16_t helper_le_ldw_cmmu(CPUArchState *env, target_ulong addr, +uint16_t helper_le_lduw_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { return full_le_lduw_cmmu(env, addr, oi, retaddr); } +int16_t helper_le_ldsw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr) +{ + return (int16_t) full_le_lduw_cmmu(env, addr, oi, retaddr); +} + static uint64_t full_be_lduw_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { @@ -1946,12 +1958,18 @@ static uint64_t full_be_lduw_cmmu(CPUArchState *env, target_ulong addr, full_be_lduw_cmmu); } -uint16_t helper_be_ldw_cmmu(CPUArchState *env, target_ulong addr, +uint16_t helper_be_lduw_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { return full_be_lduw_cmmu(env, addr, oi, retaddr); } +int16_t helper_be_ldsw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr) +{ + return (int16_t) full_be_lduw_cmmu(env, addr, oi, retaddr); +} + static uint64_t full_le_ldul_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr) { diff --git a/include/exec/cpu_ldst_template.h b/include/exec/cpu_ldst_template.h index 6f0d3407979..54b5e858cee 100644 --- a/include/exec/cpu_ldst_template.h +++ b/include/exec/cpu_ldst_template.h @@ -66,8 +66,8 @@ #ifdef SOFTMMU_CODE_ACCESS #define ADDR_READ addr_code #define MMUSUFFIX _cmmu -#define URETSUFFIX SUFFIX -#define SRETSUFFIX SUFFIX +#define URETSUFFIX USUFFIX +#define SRETSUFFIX glue(s, SUFFIX) #else #define ADDR_READ addr_read #define MMUSUFFIX _mmu diff --git a/target/cris/translate_v10.inc.c b/target/cris/translate_v10.inc.c index a87b8bb2813..ae34a0d1a3d 100644 --- a/target/cris/translate_v10.inc.c +++ b/target/cris/translate_v10.inc.c @@ -1202,8 +1202,7 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc) case CRISV10_IND_BCC_M: cris_cc_mask(dc, 0); - imm = cpu_ldsw_code(env, dc->pc + 2); - simm = (int16_t)imm; + simm = cpu_ldsw_code(env, dc->pc + 2); simm += 4; LOG_DIS("bcc_m: b%s %x\n", cc_name(dc->cond), dc->pc + simm); diff --git a/tcg/tcg.h b/tcg/tcg.h index a38659ea5b3..92ca10dffc1 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -1290,16 +1290,22 @@ void helper_be_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val, void helper_be_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val, TCGMemOpIdx oi, uintptr_t retaddr); -uint8_t helper_ret_ldb_cmmu(CPUArchState *env, target_ulong addr, +uint8_t helper_ret_ldub_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); -uint16_t helper_le_ldw_cmmu(CPUArchState *env, target_ulong addr, +int8_t helper_ret_ldsb_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); +uint16_t helper_le_lduw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr); +int16_t helper_le_ldsw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr); uint32_t helper_le_ldl_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); uint64_t helper_le_ldq_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); -uint16_t helper_be_ldw_cmmu(CPUArchState *env, target_ulong addr, - TCGMemOpIdx oi, uintptr_t retaddr); +uint16_t helper_be_lduw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr); +int16_t helper_be_ldsw_cmmu(CPUArchState *env, target_ulong addr, + TCGMemOpIdx oi, uintptr_t retaddr); uint32_t helper_be_ldl_cmmu(CPUArchState *env, target_ulong addr, TCGMemOpIdx oi, uintptr_t retaddr); uint64_t helper_be_ldq_cmmu(CPUArchState *env, target_ulong addr, @@ -1316,7 +1322,8 @@ uint64_t helper_be_ldq_cmmu(CPUArchState *env, target_ulong addr, # define helper_ret_stw_mmu helper_be_stw_mmu # define helper_ret_stl_mmu helper_be_stl_mmu # define helper_ret_stq_mmu helper_be_stq_mmu -# define helper_ret_ldw_cmmu helper_be_ldw_cmmu +# define helper_ret_lduw_cmmu helper_be_lduw_cmmu +# define helper_ret_ldsw_cmmu helper_be_ldsw_cmmu # define helper_ret_ldl_cmmu helper_be_ldl_cmmu # define helper_ret_ldq_cmmu helper_be_ldq_cmmu #else @@ -1329,7 +1336,8 @@ uint64_t helper_be_ldq_cmmu(CPUArchState *env, target_ulong addr, # define helper_ret_stw_mmu helper_le_stw_mmu # define helper_ret_stl_mmu helper_le_stl_mmu # define helper_ret_stq_mmu helper_le_stq_mmu -# define helper_ret_ldw_cmmu helper_le_ldw_cmmu +# define helper_ret_lduw_cmmu helper_le_lduw_cmmu +# define helper_ret_ldsw_cmmu helper_le_ldsw_cmmu # define helper_ret_ldl_cmmu helper_le_ldl_cmmu # define helper_ret_ldq_cmmu helper_le_ldq_cmmu #endif From patchwork Fri Oct 25 06:36:39 2019 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: 177667 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3281135ill; Fri, 25 Oct 2019 00:29:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzsXjP9YCURdJPM9kP01uS2uGqnhIfYp1jGqqRs9o0zkEAuLD583PHpXSHcEFGNv182m+1d X-Received: by 2002:a05:6402:13d5:: with SMTP id a21mr2374161edx.242.1571988545541; Fri, 25 Oct 2019 00:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988545; cv=none; d=google.com; s=arc-20160816; b=HfGNyNXKYGN+q7XHmXJYN60XQ2XbTumyMJ88idg0io6LmGXKuGRLCrmOLKKcWabDBK VkO8ofwdqzTr6xNjj3Mj13E+H/uonsnqIHrAPd08nx3QKJS1s5TQQ64HQ5EzdjEfbmLs Fv0x71A7v4Oq0YKm4Uncs3vgtCoIhtnreaqWiQMSc1/wMPtsKMVCZ6R+syFX2dwgKd6M CK6iZKJjgchwbKE282FcDnX5bQhLzSdVAjDd9xnjukzAQXpHiDU/Iy4FExgnEtvaeNGi jyucwc3njYEsev1s2NBOAaHL0r8CPSPdV3vU/jJfdr98enhv4g+2mCAZzbBKE7XX2J2Q SbTQ== 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=X9uOunAsx7Jvs5CSUNvC6FsYnZMcFnpqu3r55fNjaWc=; b=0vREJ4DB/6ShSJoRyFE34Sxhl5R9b5BT+DhWzWzW/fSzLN9g91GGGFC3eErHx1CRp3 FtziGizgLpXmWXhfcMGAt55sXfelD8hHh/knskmfk4d9qBzP3mvbvyW7khWCTr5mUit+ pUOC85eGWr+BrCkmfG1evH0Ep3Beu3xzsZKa29KjFi5LLoJJvh5WXxeBl+J7lYY3DuUG uqIX7tZnn19WeIzdqoYA45+/ZiR2d9e2whA5lEhOz2N6PfGqeCdqigUmUyJ+YMSLZeha qhoEbja3gkhO9QjWRCmAwqSVlQ2pyP7ZQFRRLeI6Legqn/X/LLZPyYBHUSSsXWcE/nbQ gHFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=EcXAeJIb; 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 9si660469ejw.272.2019.10.25.00.29.05 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:29:05 -0700 (PDT) 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=EcXAeJIb; 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]:56794 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu1v-0002OT-VC for patch@linaro.org; Fri, 25 Oct 2019 03:29:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40438) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpz-0004fv-84 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpw-0007DG-Qm for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:43 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38958) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpw-0007Cg-KU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:40 -0400 Received: by mail-wm1-x332.google.com with SMTP id r141so854609wme.4 for ; Fri, 25 Oct 2019 00:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X9uOunAsx7Jvs5CSUNvC6FsYnZMcFnpqu3r55fNjaWc=; b=EcXAeJIbBofHsAmXdo9HkxWK4GDPA6Inthin6Vro718hYwG0R8S6P+i77th3z4vA/Q nwgL0BCRwlMWT7Y7Xhd6Z1D5wLhFfL69mtRvmwTBKs3DZsJhN/c6ik8KfV7do8owDaZN Uc7qwyVbckPWiW/xC707QV8I1pDXoyr5Og2MRacf7qYrbdHqnxVC82k8Z/xT6fJsF8YB lcPGAXc6YP4Ks7g/pCUsHFPz834I01/JLWDMKm6FTuwUpWKYHPAPJ9J3RhAIQTo7Pfk5 x9+fZ79yQSBMmFJQrAfUjYGF/SNU9rPXjmbM8FnokvvnPnYKGam4XNWH4Yc5uvD/1LDn 8/1A== 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=X9uOunAsx7Jvs5CSUNvC6FsYnZMcFnpqu3r55fNjaWc=; b=Og/fIwtmldWvgSGs7o4od1RUiUa5X6v0snhQj793me5CZQZ+JkzvxaXUWHMsWkAQVz 4061cKIDckqCz5URJOLsupszN4NCA6IIc0r+f+zpvQj86fSancMszO5tH/uSjUJ4Bio/ 23VZx5y2o1JePeWzaQfob4ezikOZAbxPZpATTpgBpmguETQ7TMGnHgxourodKE/tExPK LU0bbd6G3qCFTT6ZVWaB9Impkl4ISeO8TY1hUFaFqhoB5KxeyxDxQueeeAL7zk/27rvD wyYoKTHKqIKHmEPQhffgByZpRVXfWVW+kONxN5A/OU6D6Y4dksKHgDLMfuXQ9kukxXkX IpHg== X-Gm-Message-State: APjAAAVlRNBoP0sa0EpN6K7nqexu6aG6FI6vON0i2yrm1v4Q8YXmy28w gP76vzgf5cNEMuLhC71hjXSHUQ== X-Received: by 2002:a05:600c:219:: with SMTP id 25mr1910518wmi.174.1571987799347; Fri, 25 Oct 2019 00:16:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r3sm1519258wre.29.2019.10.25.00.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7E5561FFBF; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 39/73] translator: add translator_ld{ub,sw,uw,l,q} Date: Fri, 25 Oct 2019 07:36:39 +0100 Message-Id: <20191025063713.23374-40-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::332 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" We don't bother with replicating the fast path (tlb_hit) of the old cpu_ldst helpers as it has no measurable effect on performance. This probably indicates we should consider flattening the whole set of helpers but that is out of scope for this change. Suggested-by: Richard Henderson Signed-off-by: Emilio G. Cota [AJB: directly plumb into softmmu/user helpers] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 9151fdb042c..fd499f7e2ff 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -129,6 +129,11 @@ static inline void clear_helper_retaddr(void) #include "exec/cpu_ldst_useronly_template.h" #undef MEMSUFFIX +/* + * Code access is deprecated in favour of translator_ld* functions + * (see translator.h). However there are still users that need to + * converted so for now these stay. + */ #define MEMSUFFIX _code #define CODE_ACCESS #define DATA_SIZE 1 @@ -427,6 +432,12 @@ static inline CPUTLBEntry *tlb_entry(CPUArchState *env, uintptr_t mmu_idx, #undef CPU_MMU_INDEX #undef MEMSUFFIX +/* + * Code access is deprecated in favour of translator_ld* functions + * (see translator.h). However there are still users that need to + * converted so for now these stay. + */ + #define CPU_MMU_INDEX (cpu_mmu_index(env, true)) #define MEMSUFFIX _code #define SOFTMMU_CODE_ACCESS diff --git a/include/exec/translator.h b/include/exec/translator.h index 180c51d5092..459dd72aabc 100644 --- a/include/exec/translator.h +++ b/include/exec/translator.h @@ -19,7 +19,10 @@ */ +#include "qemu/bswap.h" #include "exec/exec-all.h" +#include "exec/cpu_ldst.h" +#include "exec/plugin-gen.h" #include "tcg/tcg.h" @@ -142,4 +145,61 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, void translator_loop_temp_check(DisasContextBase *db); -#endif /* EXEC__TRANSLATOR_H */ +/* + * Translator Load Functions + * + * These are intended to replace the old cpu_ld*_code functions and + * are mandatory for front-ends that have been migrated to the common + * translator_loop. These functions are only intended to be called + * from the translation stage and should not be called from helper + * functions. Those functions should be converted to encode the + * relevant information at translation time. + */ + +#ifdef CONFIG_USER_ONLY + +#define DO_LOAD(type, name, shift) \ + do { \ + set_helper_retaddr(1); \ + ret = name ## _p(g2h(pc)); \ + clear_helper_retaddr(); \ + } while (0) + +#else + +#define DO_LOAD(type, name, shift) \ + do { \ + int mmu_idx = cpu_mmu_index(env, true); \ + TCGMemOpIdx oi = make_memop_idx(shift, mmu_idx); \ + ret = helper_ret_ ## name ## _cmmu(env, pc, oi, 0); \ + } while (0) + +#endif + +#define GEN_TRANSLATOR_LD(fullname, name, type, shift, swap_fn) \ + static inline type \ + fullname ## _swap(CPUArchState *env, abi_ptr pc, bool do_swap) \ + { \ + type ret; \ + DO_LOAD(type, name, shift); \ + \ + if (do_swap) { \ + ret = swap_fn(ret); \ + } \ + plugin_insn_append(&ret, sizeof(ret)); \ + return ret; \ + } \ + \ + static inline type fullname(CPUArchState *env, abi_ptr pc) \ + { \ + return fullname ## _swap(env, pc, false); \ + } + +GEN_TRANSLATOR_LD(translator_ldub, ldub, uint8_t, 0, /* no swap */ ) +GEN_TRANSLATOR_LD(translator_ldsw, ldsw, int16_t, 1, bswap16) +GEN_TRANSLATOR_LD(translator_lduw, lduw, uint16_t, 1, bswap16) +GEN_TRANSLATOR_LD(translator_ldl, ldl, uint32_t, 2, bswap32) +GEN_TRANSLATOR_LD(translator_ldq, ldq, uint64_t, 3, bswap64) +#undef GEN_TRANSLATOR_LD + +#endif /* EXEC__TRANSLATOR_H */ From patchwork Fri Oct 25 06:36:40 2019 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: 177658 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3272396ill; Fri, 25 Oct 2019 00:20:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvRyo5+cCW0iJlpD0R32QZLGqUmuiCvRJ2KvKo0MQDUReQX9sNDv+XKoCnWkL3j15vHk5F X-Received: by 2002:a50:aadc:: with SMTP id r28mr2274502edc.107.1571988011278; Fri, 25 Oct 2019 00:20:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988011; cv=none; d=google.com; s=arc-20160816; b=AXv5fWZkQHTtY+NVowrfV7LBUBfbOLtOi63XGqmLBKuLj7eCBrkUcIJkcSSQXQt/UO jjZNUtzJPRsewGBlDXYfPfWKHh3EX4Art5P+kXZPW0hDkyVViL1HYNEk1EgaTxncPrAb FS52wAiJRf0PQ7Ie1xAjRaMR1lR5pSFYAmABddnXCkRPDNUAZ8QwpmsbO4bqvosl8srL zv/kmIgGxJDyL7pD43lcfNUU70abDz0e2puiy4eshz12RQxDvExoEoynw5CTEwjl01qw /VEWk3uGvj8XavM8GF/gB52IuDsmj0UJP21Tlk26lm3kXUhz4u2uTN2OxIx3p4nT42/n ICtQ== 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=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=YYa/8AtEiOi6Srq2FJjW+GKF3qT5ApK8F4uTyan9gJWraCcsgqVsTdjOAMc9Aw6zHc JxEZZ/JVPH2iJ2WskPEULKkDyImgsoaThDkxL14oVAomXRb7JplDV26wm0IrcX2jNYW5 v3o1ngV4t2QB6drwixakMYdu9M5oy2FPUJRKrCusxre1rV0g4iIEZw0x6MShKVzfz9cd WoPafe9YhjMK1ypUjefOJXOJ/EOTfizp1mARpNMk44+CGgWM9u5jYWdtAAzO61OP8ah9 +h8jAHcRvO0ATXjhvqk/aVgKpeh3LpldCHEmu2TMoCLHLt/Nesd62Xgt45GOjIPH+dPz UCrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KLIDlxNU; 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 d6si675157ede.119.2019.10.25.00.20.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:20:11 -0700 (PDT) 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=KLIDlxNU; 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]:56658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNttJ-00051d-LO for patch@linaro.org; Fri, 25 Oct 2019 03:20:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMr-0007nU-57 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMp-000384-R6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:37 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:52999) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMp-00037V-K4 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:35 -0400 Received: by mail-wm1-x329.google.com with SMTP id p21so785890wmg.2 for ; Thu, 24 Oct 2019 23:46:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=KLIDlxNUJlIxZFmWN1MrzXnVXNZPTZlJuSNIKa5NtxLSL7TcSOy5XqPrMYB2nzCrWA N6kWE1j7IcD335igkmzUbRz4akfz0FgvyEt5AunuEAr/QQpnGW8Ow78gAR/NqFMzdSaE qJb7LBP/9/IvAob81XZx2mynxOqUf8TnxU3fYz5Xy7sN11hjzuey+D46PXD3AFtSzp2s MkYUPVhzz9HYXW93AW/N3zmnl1WsG7DryHH/oHnW4GnDvvGUOXh0S2AI6TVb4q7rWfDZ A5zM4zaWxxG1n3B7n195XV5Me5zhMQ3qtA4TFqriyQfBvdpWapNi2xVS3BzjhFKuFH+y /f8w== 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=U/q1GG1kwgwOT4ErsA8UxTYQsC7aPfxd1sGDgtCJFgc=; b=nirL+tCPnS8KQeM1QKgC6UBWW+bSQhVbrR1Adll2t4uxsLkUeNQ2djTmK2OdXHUbYY VNjni0RpYTC0gWXseLBnR7KGNP4murckrwve8s2i8g86UZpusCMprKFvfzGcJU4sI+vr JHUkEcrJb+2qFCREi/4ACVfO6JAN96yVetYLx+NO8Q1u2mgBUss2TkqgiSOLfTz/dr4j Lf4dXuI9sXeyepnNnfy1Fn1laBcZ3x61+qaE+rjllPYbXqAS0Jy7WpfUJTkfRzsjq+d3 0fbj26TZ7u1ARapsEvmG1qCynhoj+X+kehYwH5i90l1Gz+CShKDj59HSw5hrQ8019PXp XjIg== X-Gm-Message-State: APjAAAVTpmGoTKTWS33vw9Sfjf3fVdIEZuKBKQA2SFv/QYTCSk6dUZwS o+UY+CCTuBgIVLZVMDzswiXpFQ== X-Received: by 2002:a1c:7e57:: with SMTP id z84mr1964935wmc.84.1571985994414; Thu, 24 Oct 2019 23:46:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q25sm2634668wra.3.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 93FBE1FFC0; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 40/73] target/arm: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:40 +0100 Message-Id: <20191025063713.23374-41-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::329 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, "open list:ARM TCG CPUs" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Now the arm_ld*_code functions are only used at translate time we can just pass down to translator_ld functions. Signed-off-by: Emilio G. Cota [AJB: convert from plugin_insn_append to translator_ld] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/target/arm/arm_ldst.h b/target/arm/arm_ldst.h index 5e0ac8bef06..45edb108f6a 100644 --- a/target/arm/arm_ldst.h +++ b/target/arm/arm_ldst.h @@ -20,25 +20,20 @@ #ifndef ARM_LDST_H #define ARM_LDST_H -#include "exec/cpu_ldst.h" +#include "exec/translator.h" #include "qemu/bswap.h" /* Load an instruction and return it in the standard little-endian order */ static inline uint32_t arm_ldl_code(CPUARMState *env, target_ulong addr, bool sctlr_b) { - uint32_t insn = cpu_ldl_code(env, addr); - if (bswap_code(sctlr_b)) { - return bswap32(insn); - } - return insn; + return translator_ldl_swap(env, addr, bswap_code(sctlr_b)); } /* Ditto, for a halfword (Thumb) instruction */ static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr, bool sctlr_b) { - uint16_t insn; #ifndef CONFIG_USER_ONLY /* In big-endian (BE32) mode, adjacent Thumb instructions have been swapped within each word. Undo that now. */ @@ -46,11 +41,7 @@ static inline uint16_t arm_lduw_code(CPUARMState *env, target_ulong addr, addr ^= 2; } #endif - insn = cpu_lduw_code(env, addr); - if (bswap_code(sctlr_b)) { - return bswap16(insn); - } - return insn; + return translator_lduw_swap(env, addr, bswap_code(sctlr_b)); } #endif From patchwork Fri Oct 25 06:36:41 2019 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: 177648 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3261409ill; Fri, 25 Oct 2019 00:09:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMfpnIMXYBHTiNg5sCiF4tc2Exa2JreBqwz8ORYE1la7B5Amo1uEXuf5Yla0x8BIFfVQeH X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr1948856ejn.53.1571987380862; Fri, 25 Oct 2019 00:09:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987380; cv=none; d=google.com; s=arc-20160816; b=ipR78jO6+SpR+/1u+c02TAG4RaBXHKjEY6CBpog+2PG0Tgavt/ObK7RZtE56Lxe6l4 l0cqFP3rY3jg4ERMj67ocjUF0g5+DM6g5xtSB5Ew52Di5Gfx/4c34o8s1HrM/0FW4ZFL DaZ3Jlx/NjvJlo6LJFNYE0/ugF+sZPr57lI/VZXkxopM9f7ZTxXk/z0T4dUm70zOEVEy 3afRIPxfnd2oP9db1Z6nQXM5zv8iagqh46+5g1h/EXJnOvZsZXwdRT6TU7xAGx50NKmN vSyyo+JxfyGim4149F2LLOUfCAkrr+GtOr5Pjpy4ljyCkqyl00DpxX5vEtxyqq9KXqFl 1o7w== 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=WDjpXJj0uBYd5PmXLsk0rGmuclu/FmbPxSWoq/ihEys=; b=V4aC1OwVn1mclZZyUUfjauN9d7wclwmXRDDhfKhNxAXdQCTvu5eczoRYkWdExDYy4f PtMmLS/DCHLuYbXd46r4GKK6y75Q9Fe8dPRg5et1aBsbxYisVbuA0QfMaKdqyUvVHAOc 24aTmQ/Ig1L0DOHYZedj4/WwT5UBUfrBClo/7F262iZXT4jR05YwU/OYSByj6irzewmv g/0gfIIp60+j0yzCIp4VdQ4c4pioAlRjYU3wUpidYdZgA1nqLnxzxnmuREZBRslqjnKf dkQIkNfDqAPmggDMfM76nNqDcFedavxLuT4BWqGYNVWOFdgRy39e6nCJeBxozA2U3G4u HFjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zp7idPz+; 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 17si620254ejt.419.2019.10.25.00.09.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:09:40 -0700 (PDT) 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=zp7idPz+; 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]:56432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtj9-0007Pg-8J for patch@linaro.org; Fri, 25 Oct 2019 03:09:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38278) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWd-0003Xo-Lm for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWc-0007nN-Dx for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:43 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:38635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWc-0007mT-79 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: by mail-wm1-x335.google.com with SMTP id 22so674076wms.3 for ; Thu, 24 Oct 2019 23:56:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WDjpXJj0uBYd5PmXLsk0rGmuclu/FmbPxSWoq/ihEys=; b=zp7idPz+dJzqoea/z9N9v+Wji6ytiTbObbMh9fR3+OeUNf/HeYIFCpiudd+y6pbuQY O57o62aqDCpGG8ffzDJXY/ihp3plZBics5IVp78+1z5oU/g9HjdWCuvMxjgD7k92cWqt t3JZD7ZyCb/UaetUbas2I1f0oV/VOSGDZQQE+UkP3OkK7hheJqRKGyVZejaasG2RdPxJ uezz721tJS9eTt/FzXpvhwNjdBYKyAT/Dleo0xY4A4m54b2/iwntRtcJ90LRLIzioWjr /oT5irmxaCXmf5r8s1BY+swULZnE1dcLd8cPbSn/o4mErvjQktdngp2cbJn4he3rX7qA w6Kw== 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=WDjpXJj0uBYd5PmXLsk0rGmuclu/FmbPxSWoq/ihEys=; b=K89uuzuqZMTJsuDDJiY165Bh5Gvf60q/SqDHZTaLGqLjE/QKaP4Uo6nyC5djQ3TBOL u4K6VywxWbnRu0seEjzD8XZ0QFOLLDFaE9YX20n30pyuDyoUh4Dw2m4GNo7QHRIFPvkr 3iJoI5QU/Cp2lhhHWAToo3QfZiLbke3d0Iz9+S1uYM/yUBvtg4ZXB8fOTx11tp6Jk9Dg gvo6UgkfpCDZr3do5tFNF+ghraWr6i9Wh7f+AXxnxjfpMRY42rlPL4vZd2KVhin45xvD 3KObALiQEOMs0unuc+nUroi+BUT8sOT9w1Wb5+WErs5KbfLqETSp8xGzwFuCHZVY0Hgv IxBg== X-Gm-Message-State: APjAAAWbjs8Wnes2bJWz8gC/OkFR6nOvO/rrnHRoWn5Ndnt4vTZqrQeT 09g6wPT3EGF+m5VqSTbdAw3t9Q== X-Received: by 2002:a1c:1f03:: with SMTP id f3mr1894019wmf.131.1571986600989; Thu, 24 Oct 2019 23:56:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r3sm1446173wre.29.2019.10.24.23.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A78CB1FFC1; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 41/73] target/ppc: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:41 +0100 Message-Id: <20191025063713.23374-42-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::335 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , "open list:PowerPC TCG CPUs" , =?utf-8?q?Alex_Benn=C3=A9e?= , David Gibson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Acked-by: David Gibson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index adb8fd516f1..f5fe5d06118 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -7853,11 +7853,9 @@ static void ppc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) LOG_DISAS("nip=" TARGET_FMT_lx " super=%d ir=%d\n", ctx->base.pc_next, ctx->mem_idx, (int)msr_ir); - if (unlikely(need_byteswap(ctx))) { - ctx->opcode = bswap32(cpu_ldl_code(env, ctx->base.pc_next)); - } else { - ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next); - } + ctx->opcode = translator_ldl_swap(env, ctx->base.pc_next, + need_byteswap(ctx)); + LOG_DISAS("translate opcode %08x (%02x %02x %02x %02x) (%s)\n", ctx->opcode, opc1(ctx->opcode), opc2(ctx->opcode), opc3(ctx->opcode), opc4(ctx->opcode), From patchwork Fri Oct 25 06:36:42 2019 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: 177682 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3289678ill; Fri, 25 Oct 2019 00:37:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwG78LpFQnPHmV0F48XTWI8WDQJIFcOIqPz8enyJUlbhD2VC8DeAKRTTgvHvIZ1deaDqJg9 X-Received: by 2002:a37:b981:: with SMTP id j123mr1621058qkf.205.1571989061441; Fri, 25 Oct 2019 00:37:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989061; cv=none; d=google.com; s=arc-20160816; b=NaUS+f+n7VQmZcAWBu71dYuqMfAnKXuOKdmwInNZroKj15D0cEZMAJcqn1p2guuoDR vD8eJ0bXkjIK4LC3VtJCmhWvADeQPfCtf9JX2ae2u1w1BEzy3sYYAnAoZH5i93ili6+O GnXeyD5cY0fsGuShOBe/4sDRdb53h4YnXbibhRRSrvR/BLczjke/iIpdCUjJ49zSEnjm X2uHUZwq6Jff8M1CJHDCSvOJBSNeg1pAmWV5RbGtcsq18mLYVh7filgxHdSj09zjmJut TgoitYCRwSWkoDl/X4EOvJRWjogsD5nGG2O/15F+awJfg1kDQNCJCZ6EbzlKPmOBonSW YX/A== 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=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=Bs/OUlkdNplY+Jbco+l7Xa4ZqKpkT/tPBZ0SpBoCp9KLOLuHaJyNQm3adtgUU+2Pj5 Q7/jOrHDrlRwXw90bASkQctyjmw4DVpE72T+PZgobHWETx2NeqxiFrtyuRpnLx04Blvo xjyxaZuHWCpG0l303eHQSl4ewBBabVrLw7ifuDVDPGQy+NE8fFVH4wH1mW5d6BVLDOtP iPh9nqVXd3JPdkykG4UFJmAGY/aKeznfAYL8f/3FvrQC7XhXoazzq2jj4kepPmgseNCH 6gn+DjBIMjOttNGBnXahgxCxPVJivBtYzOuynBAayUBkR+iI0lPJTSgrqr4eAPrfFzrL VcVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=hJdUnxpf; 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 b6si853169qke.255.2019.10.25.00.37.41 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:37:41 -0700 (PDT) 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=hJdUnxpf; 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]:56946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuAG-0001ZL-K4 for patch@linaro.org; Fri, 25 Oct 2019 03:37:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40308) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtps-0004S8-Gu for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpr-00077d-7X for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:39309) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpr-000772-0R for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:35 -0400 Received: by mail-wr1-x42f.google.com with SMTP id a11so1027781wra.6 for ; Fri, 25 Oct 2019 00:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=hJdUnxpfVzARh68uiyeBFQXhq+SfZO6AlM4JXKZchVWq+pfDS/LHnsILQoERXChkX9 GzBbzaa3+AmSHWqSTL66K+WTmtgCGS01EgpPmbwwv5rmOlV61sPVJqrRoUIm+dudlg97 OrTeuRFAf2bYVKtUCBy3O3QrD1Rpm4mLMXh/P7mlhLqRwxmcE8wlX2qJHBQc95+rb/2M NPkSlC5HAx/xAy3KqAGT0ainFgBVWtFPzrqjBDfy6CpJmgPy5NPwqx4+TjlbdklpZ5wC 75KIopEIN5+z2Jusjol+afxJ1XEmL90Fzi3XTjgrNDcT4szOm2LnS9SYEtFPtsOnCdsu 2UoQ== 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=xEhoj1zEJpx/eHbcjzF4pAJZUeLviMrjuMQMfk2ktQM=; b=YBQzX4ARso4o5GC+hNg1chPlTfYpkmNUazoo+jgyT22NLUWEgxlDc0hSYUGiqd514P F4g59tUKg41acT1pwGK4No9yZV7ap2Sb4ACd/NU2o4N8cJ9dc+4bgzCq/FZpkeVXeYxT 8lhG7E/OvCVnew9FBcoVzd9aCnqqt9F7JVtpS7y3reId08Xxt8oywHf6v9U6clr4XUVH VEHttAl+MAQFvrnrAijxo17bX4SAu8eZqKShc66rH6HX9FbXczVHTGrrEW7Cswsly1dg jhI39cIaGp+d3IPQm1HPx6Qr2siDP/qUZJsP8iwzb8vlVmLlIhVfEMkU80Ny/JYjdGKT 3lVQ== X-Gm-Message-State: APjAAAVtj62ueo8h3KLd25Ti6nI7JHi/qh75Pn+GCFuleLpv40ReG//D rIRHCX80iDOkjPONXh6hj3veLg== X-Received: by 2002:adf:e28f:: with SMTP id v15mr1387314wri.130.1571987793415; Fri, 25 Oct 2019 00:16:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k1sm315914wru.10.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BB3BA1FFC2; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 42/73] target/sh4: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:42 +0100 Message-Id: <20191025063713.23374-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42f 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" There is a small wrinkle with the gUSA instruction. The translator effectively treats a (known) gUSA sequence as a single instruction. For the purposes of the plugin we end up with a long multi-instruction qemu_plugin_insn. If the known sequence isn't detected we shall never run this translation anyway. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/sh4/translate.c b/target/sh4/translate.c index 5a7d8c45355..922785e225e 100644 --- a/target/sh4/translate.c +++ b/target/sh4/translate.c @@ -1917,7 +1917,7 @@ static void decode_gusa(DisasContext *ctx, CPUSH4State *env) /* Read all of the insns for the region. */ for (i = 0; i < max_insns; ++i) { - insns[i] = cpu_lduw_code(env, pc + i * 2); + insns[i] = translator_lduw(env, pc + i * 2); } ld_adr = ld_dst = ld_mop = -1; @@ -2332,7 +2332,7 @@ static void sh4_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) } #endif - ctx->opcode = cpu_lduw_code(env, ctx->base.pc_next); + ctx->opcode = translator_lduw(env, ctx->base.pc_next); decode_opc(ctx); ctx->base.pc_next += 2; } From patchwork Fri Oct 25 06:36:43 2019 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: 177687 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3292420ill; Fri, 25 Oct 2019 00:40:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxObY3norNeiBI6aOreRiRZIKO8B64ivMfV0g/L1KcNLu0B3eWO52OClFva2XIJvWESq9Xx X-Received: by 2002:ac8:3209:: with SMTP id x9mr1093444qta.293.1571989235068; Fri, 25 Oct 2019 00:40:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989235; cv=none; d=google.com; s=arc-20160816; b=crblpoorkJssZBrBrhoNBOp8ZOnPRsprYv+hIwfGXVH9/MkgZwzh3EUoZ8pCYl0YkN ub1zYLIROyr9+r1Rg41euU4+/cLIKAIYVT+J39ONFByzjADX7zZSZUB09g2l931BlIqK DHUd+ln6b01JAEtjtv/QoQexG8n2G1cSd4FUUkbU1m0fTe8ObQqIhirD6X3AHMhZi38F LhzYLIR2KyP4Y/k1ZiBx4Ahs2D6IupQN6bFNK99J9N63kJWLdSgcaV0eJixkQHQwuM4+ dsRFdUQdrHwcY/r4maVf5M3CIOjYqofpQmGDJ94BMSUSoA3JAj8o3NQY8brBob2zphLE x0SQ== 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=RJkX+FSx41NmsCqdZkvH4L5KYPcUzyeYKNjS8EG2fRk=; b=wCsU7x+evWTKTmvfj2jb6bzJzuvcCYTI0owX8hkPDml4NYL2EaBHLjfuuvUhKyM8KR ZRc+TDcfkIBQYyK0XceC7Fru7XzMO27uQxdEIlhi5LVIsy+WJYJTIrnLMlKRCYI9S/SL HThCWlxFw7iZnU4Z6YV/shkR/96CfYNiK8w+4n7AVVAdoQyKL5Touu9IQ9LFspCEKShM f9Llkl9fXXQQcEpxmZT3yNW/JBy9jjTXBIPe4JfvsnkEpLKmgH2WBE8Wqz6luBwh/5Pi GGZoJoKPwfwHAmAaqOHeFHzn5Mvu0kCgTZY/djhzcmzvpxQHqmSHraA2tfVvQSM6jITM eyHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="F/8ICshc"; 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 p189si906804qkf.128.2019.10.25.00.40.34 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:40:35 -0700 (PDT) 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="F/8ICshc"; 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]:56982 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuD4-0006xw-7S for patch@linaro.org; Fri, 25 Oct 2019 03:40:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40311) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtps-0004SI-G7 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpr-00077j-9p for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:34075) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpr-00077C-4E for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:35 -0400 Received: by mail-wm1-x32f.google.com with SMTP id v3so3584262wmh.1 for ; Fri, 25 Oct 2019 00:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RJkX+FSx41NmsCqdZkvH4L5KYPcUzyeYKNjS8EG2fRk=; b=F/8ICshcU4B0Z9LUtYMGqT3Oy3VVkbT+rM6vb0dNjwovvaiCp5brG6mdJimrGi6crz MhIfwHK1+aHfZy8mMM076a3mnhNSF6IBRZxJzhOy7/e7vTFfW3kTHjsNM7X64iGFFpU+ SwDLt34T8VfKhoeTF/SPsZ6J9vNKDlSY2xl18ZQbTukOWau9p6+R24XFRLN22HZjD0Vm CrbxATYU2Gw0LGlTsjhxvWh9a8aTaEnVEL0CG3xkHy+7WP1tUbo4B5d3LC9/zskU++N0 dSXAMvXWAxU9v1p9HLQJfi0on2haCKAXEB2MnpuqIVAgS4bYgY2+7l0/RUt3SxqhgJdb phJQ== 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=RJkX+FSx41NmsCqdZkvH4L5KYPcUzyeYKNjS8EG2fRk=; b=DfUEC3wkvyZCIWOduQbcrkeSkz7qgyLiw/BWJtd4e5cvoishpcpf62lrsTaYKiEgzA Dx/hRvCTe5LQQ6sIaW7wJ3oapT9RD20D0Fl8qJzZESLSaQ04ieea772DZ4cOtVOpGgU0 x7ihtiViQtquubtXkyv28da5Q6HZXiW+f/F4ZnbFZ/FckibPUVFji58QrGMVk1nbzyY/ UHtOnLgSE4aThH4kcfbX4FQfIVtRBne9UY/RLJb2/N6joCRCy30JBLpZSdAvkTKYAUBz gunOm0z8JOe7+sdZz36nGkWQ4mn7TGo/bjAh80iEjGIXQHt631EyCfPD2iqMbtuFlO84 TPbA== X-Gm-Message-State: APjAAAWdXtuKtnvSGlw3VNx4IkOToaQNtzz9mih70Tde9Wt7Jj3DEuzz ZwH2iZvLupX66PDLkCGLUZRRUA== X-Received: by 2002:a1c:8189:: with SMTP id c131mr1959751wmd.151.1571987793906; Fri, 25 Oct 2019 00:16:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b5sm1145818wmj.18.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id CEB9D1FFC3; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 43/73] target/i386: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:43 +0100 Message-Id: <20191025063713.23374-44-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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 , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/i386/translate.c b/target/i386/translate.c index 868b0acafe8..77e932d8276 100644 --- a/target/i386/translate.c +++ b/target/i386/translate.c @@ -1925,28 +1925,28 @@ static uint64_t advance_pc(CPUX86State *env, DisasContext *s, int num_bytes) static inline uint8_t x86_ldub_code(CPUX86State *env, DisasContext *s) { - return cpu_ldub_code(env, advance_pc(env, s, 1)); + return translator_ldub(env, advance_pc(env, s, 1)); } static inline int16_t x86_ldsw_code(CPUX86State *env, DisasContext *s) { - return cpu_ldsw_code(env, advance_pc(env, s, 2)); + return translator_ldsw(env, advance_pc(env, s, 2)); } static inline uint16_t x86_lduw_code(CPUX86State *env, DisasContext *s) { - return cpu_lduw_code(env, advance_pc(env, s, 2)); + return translator_lduw(env, advance_pc(env, s, 2)); } static inline uint32_t x86_ldl_code(CPUX86State *env, DisasContext *s) { - return cpu_ldl_code(env, advance_pc(env, s, 4)); + return translator_ldl(env, advance_pc(env, s, 4)); } #ifdef TARGET_X86_64 static inline uint64_t x86_ldq_code(CPUX86State *env, DisasContext *s) { - return cpu_ldq_code(env, advance_pc(env, s, 8)); + return translator_ldq(env, advance_pc(env, s, 8)); } #endif From patchwork Fri Oct 25 06:36:44 2019 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: 177692 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3297807ill; Fri, 25 Oct 2019 00:45:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkZ3kIuavkDsBzQ3U/E1HaPozDNWSN6zXLdWAf9jJm7uFaO8wodsfYoIyUi6+6yVrtKsRf X-Received: by 2002:a17:906:4c97:: with SMTP id q23mr2070388eju.78.1571989537796; Fri, 25 Oct 2019 00:45:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989537; cv=none; d=google.com; s=arc-20160816; b=ZQrbKfHequj4cLEgYpKifNMF9OgnydCaVKiz3+APVdOQ3hTIupZkM20xi64Xt3E9+T CNtfplVxWfSncq3Ck58Ij8y9mdAd6+lddEQDnkVvK9DXaO4ppNTJt+I0VETUrEYEAl7p 77ivBFmKeUw5glmikHMfq5EHebOgTtqVgSesSa9ZcFAVRjyVOYnwyTOQcNnu222rIfIE z37dA8XlLymb37Istl/+1b25TsBAzFphVpyKoLFy2p1DnwLgyog+urI6fvYYXq4qiY42 cvKSEOvEzsQVjCYODh6Cjqy310WNpeJ/RePA1Ich7PgVnZ6yEnO15aFEYUncxGlMvMk3 YIiQ== 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=zhRtg+sEApcMcRytM7hTlQSCCfAJvUQn9AKAeTxM7RA=; b=Fo2kULuXc2zZnSmCCMIDarpK+/nOsiwxSf5rQmvo7OdHf8NqTn85AamRtg/Aa0+qxt MMp8RsiLhRuSEmiWgj0RTQM8qEKcVWVLzi5+z6nnzOPIMLiFAtlhjqg65kyecyN2yjNe djT+BUQZYkBKpG0tnigTN0dFcs8WxC26wkcbwwmsISAbv7nD3eEkx7IkoPscDEDiq5kg k2rAPuPxdMr+bFrQco/3uFCVdEdjfKkGlmFdqfp2sh/eQ8ACBq79EJD6EQbN/GGgpva+ UKfpIpYyDXSJy6ea/u3XTUPMpx8IWwf1ViuuOrfrh5xwmaxhsEl2CDlXDsRPubr0mW11 SWWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ag8ntVPr; 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 v26si749167edd.364.2019.10.25.00.45.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:45:37 -0700 (PDT) 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=ag8ntVPr; 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]:57068 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuHw-0007aK-GP for patch@linaro.org; Fri, 25 Oct 2019 03:45:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40339) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpt-0004W8-S8 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtps-00078m-MN for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35402) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtps-000780-Gl for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: by mail-wr1-x432.google.com with SMTP id l10so1044272wrb.2 for ; Fri, 25 Oct 2019 00:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zhRtg+sEApcMcRytM7hTlQSCCfAJvUQn9AKAeTxM7RA=; b=ag8ntVPrTB6Hdqcf0VI6ZBY+jozPz0D/WjuQZXT6cK4lR7mLJAoTbN+sekjAw5eTO9 JqUHa3La6o6DRx/x6aKG2TNwSl0jmfGtjWoNjQqcoSjK7OW2zgSHWhuhuNr9oYU5lNjv 39OBRo5wZMJMHQcaLim+Imjt6Zpbdtj7gOgs1AqvV7R+kZb1VYy5OXbT+lnsiK1ngNEy v2mAwqlwPwlM61g7rraBOsG3UmwUU2mXPWlBPy+EyrHCEWPS/HBN6kJPVrIvtgwMzmJR ueLgr0BlJui4CBB/QFTztofBNoigWCp450izXI43FN5OYbBUGjTMQ9Ge3qjloQsrqxEJ 0GMg== 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=zhRtg+sEApcMcRytM7hTlQSCCfAJvUQn9AKAeTxM7RA=; b=BVv8tGdU3ogt1AP6B3Py/thkFERFgFwtGGyDq0WYreAg1rGlShMiaBr7SQ87BID9A3 7zIr2AY/Mw0D8yfxggG3egCdL8UygtAJqk+5z21w9t/k47kaRlTbwn2QRJ0K1tbNIKLH U3RZLkqh7J+KFiuc5xWsS+ekqMfK0ceoyYBQZqu412FAzVdpadObxqATV/bIGr+MDS1Q 9p2ZrfEVUeFm/LVh7X5wRTXH/Txt83rtZO+7Bh8avpmXn5dBb/+I+5xa1hB8SKyLaXv7 bv3/P8pUYDtcRZc69kmcwKEx2ZJbfKkLRQTpSP6HYymfyCuhEeDcKsWeMvQbdUxrrUpK 9Nsg== X-Gm-Message-State: APjAAAXX2qRqjiM3+ulEC0Y5KZLYwGywtWXpP5W6gKWBzExjLm4jQr4p XGFotl70L6WSK1W3kpZpHdF9PQ== X-Received: by 2002:adf:eb8c:: with SMTP id t12mr1419545wrn.34.1571987795305; Fri, 25 Oct 2019 00:16:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w17sm1199346wra.34.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E43A01FFC4; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 44/73] target/hppa: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:44 +0100 Message-Id: <20191025063713.23374-45-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/hppa/translate.c b/target/hppa/translate.c index c1b2822f605..2f8d407a82b 100644 --- a/target/hppa/translate.c +++ b/target/hppa/translate.c @@ -4221,7 +4221,7 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) { /* Always fetch the insn, even if nullified, so that we check the page permissions for execute. */ - uint32_t insn = cpu_ldl_code(env, ctx->base.pc_next); + uint32_t insn = translator_ldl(env, ctx->base.pc_next); /* Set up the IA queue for the next insn. This will be overwritten by a branch. */ From patchwork Fri Oct 25 06:36:45 2019 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: 177684 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3290129ill; Fri, 25 Oct 2019 00:38:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwva72aPm5PhP9AYmeH5D2CQHmEXQOZlp41Quhduwh4BJOJGvcaIb9hPqWQNL6CETW8NrPA X-Received: by 2002:ac8:378d:: with SMTP id d13mr1703716qtc.69.1571989092332; Fri, 25 Oct 2019 00:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989092; cv=none; d=google.com; s=arc-20160816; b=biyjOfgSOwNRIpshA3tqXo60WuCODfyRUY6MuZx8jWRZTLOfUhSJWHpJZBPLrAYYk8 ZNuIkOXCfQimpPJTt+dA/IR/gIw7HIsFZeYwuZFovsG5DM++wrGsmHzv16Sz6jD0sXdp uzG02r9rEScVHe36qy/kx7BtC4yS41f+t68XvOgRn5aZixc7+d8S8jXd7KPGrhNMchi6 3OnAr9tnnOgbzU4nmfwS3d2W9uJ6naLLcPtydg/gTxlrmcaTgatoeQuHkYCvFkdXqnN6 /bbrTc5DqvEpzCxFEbpvzYB09rUanHGJDzc8bRMF64zhaW858licfHfaM8itxgDD+LbM ODXQ== 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=T2JS5tpytl0ipi63acoLVuF4tI9OGVeaa1yG5nPh+p8=; b=NWkpwrrMBsE9BdD2+MJfaZDni2VMAgaxEMnCW+byvfvr6BFQcmKCEDNGc9UO6yZJYa wH6OcQJDqu5zkMBg+qHZm+W0JWtsCl6rTgo2y4+i1wj3ADuz1tt6UEgBesZc3rZmq7li YwTsEcUAkpxuHxWnhWknsVy7pbUAlMKJxRa81tPs4f4x00ySrQJGmsr6tyK+Amxgyi7w RhXYPrPjGKrVp85A3jpqYAxpXYCz/RaTY8nH3vKNIHWj1gBsNzZBG8s8pIDPjK2xe/zM AMffZpiS/sYECOvXdRXEqsuAEifGJ1RMYoCprgs5s070hQ8Rx7N8fyDGueTD7llRfhE7 nNjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=g+2HT04w; 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 m5si763460qtb.134.2019.10.25.00.38.12 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:38:12 -0700 (PDT) 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=g+2HT04w; 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]:56958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuAl-0002O9-NL for patch@linaro.org; Fri, 25 Oct 2019 03:38:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38212) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWa-0003PU-9B for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWZ-0007iL-90 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:40 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:37036) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWZ-0007fJ-2j for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:39 -0400 Received: by mail-wm1-x32e.google.com with SMTP id q130so808311wme.2 for ; Thu, 24 Oct 2019 23:56:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T2JS5tpytl0ipi63acoLVuF4tI9OGVeaa1yG5nPh+p8=; b=g+2HT04wtDnVWJWN3ti1IWJObmTzDbVFpunoVejBtF2unoTBiVvJGcLv+QZ6mu9HJl CDCP7HB9U0sgUYnClrtOZtM0bJU7UqSDWIDJEErzdjYkoBv6V7t5JQZYFf3KP/V0C8Hl h69CgheTLA3NZFAxqMMcm+xValOePtkUjrRv3hCf5xgszJUiX+VL4WOwgvLBipo2IZEc RlZt41GUP8SSP8gC0lNRmrakDijFsIP2PmHRg/X7cvvlS17EeI/3pnUDjNs42Q0N4Qc6 d/jbo8OQbVF5oEGK3BP/Kv/KgS7lO3UyWY7DOdSH4nHUSnkHwATVvdp/Q7ShLwjGFH5t pVtA== 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=T2JS5tpytl0ipi63acoLVuF4tI9OGVeaa1yG5nPh+p8=; b=pX95sXjPwY3/a92cIAC+6dpnzMx8lOQt8fA7Md3n/z00Dis0UTuQBvTO5JK4bbT1B7 8+2D40DsYU06h5p3yNMQ4GTnTCs9+gGZzVoVByZwrQOW0tqLG6SLaUT9nmPzt/q9Mp59 t0QvIfHIDg+iPcyqewnFjMUih1MZR9JiVIkUmp2ifjLeVJ6i5QHI/BwYWQbsEVq9PZQf PKQgnkDK0Y7O6sRWtq7Gtnk8SJfHKUTV3kIP3A1pqwcT71vgv9gxKfkAdaaNw8nmXRey J+s5CCNV3T4EAZi/uAldt2EexJsXsdANQ5uIz/wGOEZ+nfdlAQ0ziuMCaYKITgKjxqqL Dymg== X-Gm-Message-State: APjAAAVYB9995A8ymOjEIwnRFOv+hN0YJc4SZdObG6D+deWjju1x5TTt lTgD+zh/5F9zp57FSgo35akdAw== X-Received: by 2002:a1c:e154:: with SMTP id y81mr1923565wmg.126.1571986598038; Thu, 24 Oct 2019 23:56:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q18sm1034542wmk.39.2019.10.24.23.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 050211FFC5; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 45/73] target/m68k: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:45 +0100 Message-Id: <20191025063713.23374-46-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 24c1dd3408a..fcdb7bc8e4e 100644 --- a/target/m68k/translate.c +++ b/target/m68k/translate.c @@ -384,7 +384,7 @@ static TCGv gen_ldst(DisasContext *s, int opsize, TCGv addr, TCGv val, static inline uint16_t read_im16(CPUM68KState *env, DisasContext *s) { uint16_t im; - im = cpu_lduw_code(env, s->pc); + im = translator_lduw(env, s->pc); s->pc += 2; return im; } From patchwork Fri Oct 25 06:36:46 2019 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: 177683 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3289885ill; Fri, 25 Oct 2019 00:37:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkURtW6s+/eSEvxHJKobENUv8WFScXJvn81qCVFXq7RxCvHK/bOCwcaNjTm3Cmn9KrAJGI X-Received: by 2002:a37:4817:: with SMTP id v23mr1643588qka.264.1571989075514; Fri, 25 Oct 2019 00:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989075; cv=none; d=google.com; s=arc-20160816; b=GU27laC7/uOmVHcb4AqgQRKvEyMe6i4Qa/bu/un/LX6qbEeMK7d9LWNSEAxRHAqphs ndMwT4SUtZt9iJwVrz8llzB+koaAw7qyOsjEvdNzoIDbOxSpQQruna09zjWt14+q0Nap m87RRclkZgng75V90LvnB6o3OaYiN38o8qErwAGWlt534+RA53/0Hrxv89ZaRTtkDGT/ ZIYqYTFzFqivsBZKT412JeurptirDEjWz3C7QGMCHNhLLkfzQMMvdsAkkLDXPo8Vs3Pj lJSLfc+77uGivWSNuEUBiuYPVkLyXS2FIhqHHRo8II68TWvxB8Ran3bpKllJM4ZDNo8P Z7yw== 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=v2mAjqtuZOYE0ZtUDVZuiSZ00TgB6ibRdPm0eNtlQKI=; b=faAMng10/SMXs2A5pTQvrXM2QvbeeP+Csc69CN9IHsxArqBKPxsYUCNKpKKZ9pfUrh 090AM1Dq/HMsi1pI0eC9K0XzdrccbdVFkb19I5cMBG4WTFTandNNRECs61K1g808YVUD HYkHIVVOASDpOB7F8BNwlYEwX9ZAPqw0/JH1ijgK5Mc5PveMyW9vCIXQqd00uoWDFX5u bikX2wdCBmce7Zk5cJHoQQJeKZ2gcQqwguSt2Gx47YLQe2HHGhzQjIUHLj0i5+46n6ts NUBNqgt6SNlKdgKDgUW0sU2zjAl1gtZ/zWCVWqfaQGgo5jr16vhE1X8rI3IOMzr7i4+t m4HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F6+wjd6M; 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 f61si748793qtd.221.2019.10.25.00.37.55 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:37:55 -0700 (PDT) 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=F6+wjd6M; 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]:56954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuAU-000295-Rz for patch@linaro.org; Fri, 25 Oct 2019 03:37:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38179) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWY-0003Km-KO for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWX-0007e8-AI for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:38 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:39837) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWX-0007dO-4c for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:37 -0400 Received: by mail-wm1-x333.google.com with SMTP id r141so800628wme.4 for ; Thu, 24 Oct 2019 23:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=v2mAjqtuZOYE0ZtUDVZuiSZ00TgB6ibRdPm0eNtlQKI=; b=F6+wjd6MKAEFZdSJYbNPD9WS7D5r5oehojabF04cobSgTdb9eui3COyquhRFU8pZYL +0NxyRln6SYT31eN7hXYhdRnm7LFjtOsPNGGqtchjefnnVmxRqIRs8EqHoteCWx8teeM HV1INgZxJ66aSG7Wi/ikV4FTquufgCxW7xPuswZgQPGU/lNFyMDxj2fhhCx/KozuykBZ X1MsmrBfbWvfkull6RVw+bUtpRTkUg3/MlU24LcxHKMzorWQLXHVqI3HIXdj6sjdMC1R ZAHX1WHdL6Ueb8DtD8ys2stjbBSaSXASlbo9rEQ5iTELhz3ogZ7S421gNJOn2LAZpQQc 3eUQ== 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=v2mAjqtuZOYE0ZtUDVZuiSZ00TgB6ibRdPm0eNtlQKI=; b=JqrsKzyCHifZT65w8q2B+5jJew0FWm6AGnPIAh+vj8TsTVSoCsgrBN5w9acSKolF4W P0WsjCucrW5JuabviTPakwj2AQexxXp/T5rjhEahnzRDRJGRDMZQEabWYgP8Mrk4i9br d2n1ic01MplA5chZFMIdIrjMdNrWSG1/iQ7pdl1WuC+fHrqVVla03TyHQQl5YLJBsz6T XA5C5hJFW9hlxPt33cr1ttQNuUB40AzaO6R/S9tSz72y3DYVHij1HmRJVtF//auedSHv th/5yxZ/OM3mYDkNqK8txDpibJjhhJCnCpdGS+yMo03NnhSXD37mbI4LWi/YTCS7o/SG +aLw== X-Gm-Message-State: APjAAAWqpBDzWQQIJpwqf2xhqC3oSoZ2uJvtPrJCb1XLNqgXV62vyBMz MSNu3FSy2QKfTiadc/SJHaREmQ== X-Received: by 2002:a05:600c:2295:: with SMTP id 21mr1858740wmf.63.1571986595349; Thu, 24 Oct 2019 23:56:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q6sm1250675wrx.30.2019.10.24.23.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1B2971FFC6; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 46/73] target/alpha: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:46 +0100 Message-Id: <20191025063713.23374-47-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/alpha/translate.c b/target/alpha/translate.c index a69f58bf658..f7f1ed0f411 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -2987,7 +2987,7 @@ static void alpha_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) { DisasContext *ctx = container_of(dcbase, DisasContext, base); CPUAlphaState *env = cpu->env_ptr; - uint32_t insn = cpu_ldl_code(env, ctx->base.pc_next); + uint32_t insn = translator_ldl(env, ctx->base.pc_next); ctx->base.pc_next += 4; ctx->base.is_jmp = translate_one(ctx, insn); From patchwork Fri Oct 25 06:36:47 2019 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: 177690 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3294714ill; Fri, 25 Oct 2019 00:42:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCpBf6gzKHeDW5kZu6mGYo/uyZzC3fhKqectAApRWNiwzcrfpTZ/S5o11YqjpTWKB5Nfww X-Received: by 2002:a37:8ec7:: with SMTP id q190mr1673505qkd.46.1571989371564; Fri, 25 Oct 2019 00:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989371; cv=none; d=google.com; s=arc-20160816; b=oaaQb74XF+HT+NNMiu4z9BQG4YMqew8474Gb+Fod/PMMLkqfhAAZVGeWvhEK63E5r2 hi2dA8CBIE+90I7azHscwjRFFKBkuWq2zOc4wSHVUGomyoUjgxBH7B2doSJj3uDdOrni NgR8HeB8KCsR1mURX43Pg5AKPOl7u6rPXruxA1Fx5cM6o00HAEu5l8406l3z+F02eXnA /6209Xr4Gfb1J8RXGxV9DY6z01csWSs+focDopAXHYfRQ7BU0cECaPPJ16QorACIeJ6r D2rjRM2ARQrazRZ4MrNCuWCqygbWPKZ/aTSV14CpHJQd87mWCdZscnGAnJln/UPnnxeY 6U8Q== 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=e6OWosr3vkKtYZuEhZpOOVQK50EP38/6kxdAzEYGV48=; b=s0qk4MQ/POTpWrVEVYYI6IoRRXj3+w5TfYqAmSS5obZvAmt8D6y/gL0l3bc3iuzWP9 prpgG8YysMQxHRAlodrfktpSZx4K7tzndzPdhRFXuyon3XR6EzN47dQ30wG/wDM892/U h3NpAlx0DuBtpFuiDnVw/uJLtZDZTiCsMkV+w9ZjodOvKXrsLi48kiq6ajdeMT26OQR7 JyLjDSME0uLMr+npGrFItRDaNwMVlsrXhhZS521zC4OrGWgYjJB34dO+35CjpC1tCVv8 v9AtcQk+VRZK56IfP8SNY38XtLsahS9tEzKrvWbQ7YZ3eEyLxXp/jkV8SSfNVQGrjN87 hX+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=O0cbxHjU; 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 z64si782461qtc.169.2019.10.25.00.42.51 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:42:51 -0700 (PDT) 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=O0cbxHjU; 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]:57026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuFF-0006qE-MW for patch@linaro.org; Fri, 25 Oct 2019 03:42:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40472) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtq0-0004iv-VS for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpz-0007F7-HC for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:44 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:38952) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpz-0007EC-A7 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:43 -0400 Received: by mail-wm1-x32b.google.com with SMTP id r141so854747wme.4 for ; Fri, 25 Oct 2019 00:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=e6OWosr3vkKtYZuEhZpOOVQK50EP38/6kxdAzEYGV48=; b=O0cbxHjU7L9AvD0g3dMSk5Ee9wETctht8caLB2opxTRjFKTAxvHwpKurLzQnpyHCZ9 eEfJOJnz8cBghbdYpU5B2Xuox9MIkISKsX7N3FXiZkAW7rEVw1Ge7rEaHQJQwCT/l36o uPT/vNe4YMPWgV5h2GVAWa0iTLc1HGnWJU2dbKaDUAq5gKKT9eaTKv2fBQEK2EOPX11H o8uqZFjaTWFktYY9rO5TbMCxEHj7N/pEtbFUmTBYgOoCt3mXkpAJGh3o3jQNQLDmGvp7 1cBG4yGE/RcODDOWrqAp3ytUgKZIXkcXtQV7xoZsytXThw2QQ3x5cav8k0/dC34W550K TA1A== 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=e6OWosr3vkKtYZuEhZpOOVQK50EP38/6kxdAzEYGV48=; b=WlS57LlKKRqAKpMFFhHzJn4udGbp7xN64s21RLjpNuULTTnKPhuy93URKwQrsxK9I8 Nu0mnRRrTyyodQypcg9VxsylR2Xb5I+msTI8jBug+iYNMPkQZdLj3EBmJWB3R5IVJkPF cEWnEJseCXjzZ9XZGCDA69A9j4+FxIVBqXqsrrNxnsnou2HiQA7VvPqiOI188qF3ToGm nXOTKizdmogzPkRd8SB9hIR0x9W+BAYHFTRL/C6vNtcCs4Pt74xSeU11pyTsTtCtK6lA XCM9GQK4cCzL8LReD+P3h2D4S1JfC/68XaN/KhgEJ52ab+3lbf8BAkih9HTXF13hbQop DP4w== X-Gm-Message-State: APjAAAW4wjpLR/AY69sxeyDuEa41hTYkWXDr7HCftbeeZPjRvoCggLAZ iB9TF/O1wHgYhnM4GjEggnuEW2x1rRs= X-Received: by 2002:a1c:7e10:: with SMTP id z16mr1906939wmc.11.1571987802066; Fri, 25 Oct 2019 00:16:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a17sm1176786wmb.8.2019.10.25.00.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2F5E91FFC7; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 47/73] target/riscv: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:47 +0100 Message-Id: <20191025063713.23374-48-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b 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 , Bastian Koppelmann , Palmer Dabbelt , Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Alistair Francis , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Reviewed-by: Alistair Francis Acked-by: Palmer Dabbelt -- 2.20.1 diff --git a/target/riscv/translate.c b/target/riscv/translate.c index adeddb85f67..b26533d4fd7 100644 --- a/target/riscv/translate.c +++ b/target/riscv/translate.c @@ -779,7 +779,7 @@ static void riscv_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu) DisasContext *ctx = container_of(dcbase, DisasContext, base); CPURISCVState *env = cpu->env_ptr; - ctx->opcode = cpu_ldl_code(env, ctx->base.pc_next); + ctx->opcode = translator_ldl(env, ctx->base.pc_next); decode_opc(ctx); ctx->base.pc_next = ctx->pc_succ_insn; From patchwork Fri Oct 25 06:36:48 2019 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: 177689 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3294524ill; Fri, 25 Oct 2019 00:42:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyejn1kSv6ycl1hLpOxz0EITV0o8R8Pj58fd3TrvMHN/m4bUU60uomPPdmwSrYZeSoZqch8 X-Received: by 2002:a05:620a:1358:: with SMTP id c24mr1672039qkl.236.1571989359067; Fri, 25 Oct 2019 00:42:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989359; cv=none; d=google.com; s=arc-20160816; b=hQxCK8MqlLTCUKonlWmjUEmi8eflvCroQakUUy+XadDifWOtE7mST/PLN6zYTG59Kt HUCcWYc124ANzT4Q8fC3alCaO17MQABV8hThGmtI4rFktPQbtJL2hWktXUAxm3pO6sZP WG125Gha6lFfxRvBQQroLLJ0Q6Y1qMU5L4RaG40AF4d6A37eGAIHWwBATDA9G8M5gb56 HzbdOG3aA6l5l9Sbbmigg+QaHquhwArauRJNbp7abV3Gb62gNP/nNC9/Vmk+x1yn3dz6 OyxW0SCN5jGKDMKNij291pjhhZuGpNZ6obJRgRANgeinKa8RUn6dsrmuRZ4YdjyHLOm2 J73A== 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=zsxj+Te98ElygZXLVw1dEmLIe6iHMU9Zd9rL8Doapxo=; b=PxB/KZ0ThWx86olzYxLr1HdeZLKbe2OfUho5Nj/SRxeJSLyWRKHNXI6bCVVFtWxYvj JDFINWwc+fPtDSkQRLSMeuTgNa2ymy3d60CiJopUpQDwn91MVC9HTY0O0B4dq76nuPDZ 3cJenspcgsiDloeCW6gofaD29jli4nA30qUYuMw4/xzaqhddd94ywflIJUD2GGgbJh0/ txiwY8vUsgVUuin4pVwfkECgCYPBAWSo7RK6pncQs/mzI74TS/QXLbJ+mSr2qMNcwg5A csNl90aY+eGa2hY9yl8INHXSmqClSnEOElyvibYj7L2mZSqJjojt408SyqI1KqHrKGi+ l3eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=O5G0nWpj; 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 2si741563qte.346.2019.10.25.00.42.39 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:42:39 -0700 (PDT) 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=O5G0nWpj; 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]:57032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuF3-0007QA-Ip for patch@linaro.org; Fri, 25 Oct 2019 03:42:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38247) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWc-0003Un-GS for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWb-0007mM-CT for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:42 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:41132) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWb-0007lr-6c for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:41 -0400 Received: by mail-wr1-x42e.google.com with SMTP id p4so953268wrm.8 for ; Thu, 24 Oct 2019 23:56:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zsxj+Te98ElygZXLVw1dEmLIe6iHMU9Zd9rL8Doapxo=; b=O5G0nWpjZR6s8YZg/7unvZdkCQNFgRBttQc8gGuTZyDWSFEzPI5D2ls0A1zNJLFUUb bQpEcnsmyCiUs0E+NHd90vvW/ZvpMncSxX+yfRvpv31WuZw6wCee5zXjQ8taPh62Ufe2 z2aFu8Vp7j007jy4TA1dRj3DgFr7HcKYUDG85zZriK0LUuhYdyYiSdc2cENH4MiJ0UcZ geJS6ZPFi79+ZYB23jkE3/RPZ0HG9Z4g8JYP/SlwPiWKRDToddZeAu5pa208KdAtr+k1 vYXZNj6Uu4NoyE+GKv2ICTWgnkMPCvazeeE/mYY2aiTRQKqfqxDXd7CmE6Xss2VEGgwU Aeow== 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=zsxj+Te98ElygZXLVw1dEmLIe6iHMU9Zd9rL8Doapxo=; b=PP1lvrrWUyG/c1qa5PqRgpFWPX+Tyujp98/uVv3XL4xgaVd6qDiqM0sJnapdh8rA1C cs06dobIwo5r9P0WiDqyccVNzro50A2lH/uSoOrakG3YmoLlbGl5SSHwGNXsA/Q7Jk2y UYyfcFZ/Gb8eiCNvimgTVojiP1PrJkUKpYtTPGmeK9+ki33/NgAgn9TyFI6u1zP6xfq3 lo1vQkQX4Mwl6P1TnOcj1QDdzGXoSbb7ha+6oRyH35A77uHDhzyU6cFj8tXbyXDluQjR AOeriag8HzuHbsQvc3CRcdNGlhpghgS4Bwt/igVq1GqyRBzUXkncpZz8YbhmBmZRBajt SiUg== X-Gm-Message-State: APjAAAX68QOkkBAwsscQN5PFbhtrPrt9S58tkL/8VDO/K38OtXVtBIQ6 cAcme76yLEfIlcl2luDkkc4rdA== X-Received: by 2002:adf:ee03:: with SMTP id y3mr1343060wrn.116.1571986600154; Thu, 24 Oct 2019 23:56:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g14sm1238663wro.33.2019.10.24.23.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 43C571FFC8; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 48/73] target/sparc: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:48 +0100 Message-Id: <20191025063713.23374-49-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42e 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: Richard Henderson , Mark Cave-Ayland , qemu-devel@nongnu.org, "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/sparc/translate.c b/target/sparc/translate.c index c68bf4a2e41..edc23a7c403 100644 --- a/target/sparc/translate.c +++ b/target/sparc/translate.c @@ -5884,7 +5884,7 @@ static void sparc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) CPUSPARCState *env = cs->env_ptr; unsigned int insn; - insn = cpu_ldl_code(env, dc->pc); + insn = translator_ldl(env, dc->pc); dc->base.pc_next += 4; disas_sparc_insn(dc, insn); From patchwork Fri Oct 25 06:36:49 2019 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: 177643 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3257609ill; Fri, 25 Oct 2019 00:06:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmsvFCw3530lBrEh/PNpF6UXeg/oMNhveAQn63MSGI5yG+50xIXFoYp7JTGHD8KRnTouIn X-Received: by 2002:a0c:8d09:: with SMTP id r9mr1860158qvb.90.1571987174081; Fri, 25 Oct 2019 00:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987174; cv=none; d=google.com; s=arc-20160816; b=IfSWEzbmwpH2YYClr4qixnsxZvl8AQWuq6VD7qwgXAimvQ8N1qydRDnDtb61HIZxd4 jne8NizZcWG4JLK9OYJ/ORXotoozsn1RbAsPrqAIOToh2z9hizJsR8UaLQtT6Zb2nGVP /dw6x6Mi+9rOHUZwu7kxmFO45/Uo+GRw66TayWIdXz9ZOFbd70uKFdunNwx3mChvlHQw /OLB3CPE0V8O9j8ADXGgs7jkuzUjdNjHIBeWUAj1tIj4eVtQoo+68nl/zqRxRUInkQsS /7gqygbJ2RuyEfUNzUySOvu2OEAjjflz+2dUXjkRc/0CViX3SbB4+9mU0eAupl/kd7aa shTA== 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=08b51CcPx/wlpoxLjc9OfnTHhyd7AMd9x8LJx1IeIRE=; b=a1WXJR8COsk5gy+VDJsfGfovkyScVHr0vO3vZSOsTaFp4DWJjUjOJzPjTF1NX25RKM VMsxd6doQwCSqIP8Gu4u+GNsv7buBel3y2DHY9hxAhXE5FbZvLYjBJP4QABn81f/xUuY zP6L2Zxq4tP3PVhbHrhpmkpwwHxuvOILjqK9g5AtdBQUf6AfntN+r3JXKYEeXSN4ouyV nZv2P+pOagQkk3rKpEawLTM3UAzYtXDxaANohH8SiipKC6/+4SE030hFDngBpLwr5FRb I2qJA5K0pj2KypSoURQwETsKPlQ2sH3jJ7ufHN3KDdGYUo8NGlk2mSNme8M8Rwro8sJL ISJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=K9A1+p0i; 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 n4si728152qtd.176.2019.10.25.00.06.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:06:14 -0700 (PDT) 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=K9A1+p0i; 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]:56378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtfp-0006Ce-3y for patch@linaro.org; Fri, 25 Oct 2019 03:06:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36990) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN2-000865-UN for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMz-0003Cd-UE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:47 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:35168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMu-00039s-3I for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:40 -0400 Received: by mail-wr1-x432.google.com with SMTP id l10so956585wrb.2 for ; Thu, 24 Oct 2019 23:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=08b51CcPx/wlpoxLjc9OfnTHhyd7AMd9x8LJx1IeIRE=; b=K9A1+p0i9YS+hvxKJC4p1zE04JMb1tk6wQS00P44kiYyIu2unx2ZhDXMtjLlzwz49J DrhyHBB4QRea+eLoY0tMLj+0KhfYj/AMqgkIP9CTgk2BvHGogi1iDkag23HKB/iWhAl1 Nw2OPpEbBg/Nlnbt+2YiUU4Fzv1LXW4wjQm1nbzH87b5Yy4U7M7kv71UrmF+VDCTOesj 59cde4UZHVLzD7sSUNSW9R+h6wnxjZZRlWjBgBps4Fm9f2T0SPAEdrUh9lA79n3ffr1r rcK1H+hFFMDBF0ZqlF5TCM/ST3FEba37WyHjzGk4q2Nw7Y1ul6mk9OxFjFSUfbDL5IUz jPow== 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=08b51CcPx/wlpoxLjc9OfnTHhyd7AMd9x8LJx1IeIRE=; b=Vx5UB9K3E6Gn+2mQaTFPUVRP7SyJ9P9ncJu7xTRNIlEnxgP9SDwigPPWvVyMX/hDXY LU3RAACOMEhOL1vkXtMx7Hy76AYw1p19dnl5OnHtAhEaj5olkV9VmBUuxM5UaoRZRUDF XiaNUKNyoRvd+zRs2mKlNePImi82gnh2vJzS0vc8dgJ/m8zjSunG/VfquvwDa8cbPyGe 4+jOIFr8f/5K/U25W+22o3JRrBvvnhnpM1CcD4b4TIwaE+wVsfhWJM4Lii5uHVsyosWZ bCseGG5p/09MsHEW5EvAILwM5GvP5DmuKMQw+TKGbVnYL6PqHpDkqZX983kesp2YVfLA kYqA== X-Gm-Message-State: APjAAAVjs8zt7Vvoe9w8yMlD6glq9G652vhNVnoqRk2WdM5ZEoH5TmWT HLTINyfitOhwwwoZp9Mi0Ke05g== X-Received: by 2002:a05:6000:350:: with SMTP id e16mr1398583wre.276.1571985997845; Thu, 24 Oct 2019 23:46:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c144sm1201199wmd.1.2019.10.24.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 571831FFC9; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 49/73] target/xtensa: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:49 +0100 Message-Id: <20191025063713.23374-50-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 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?= , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org, Max Filippov Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index d20e60ce770..a99f5296e2f 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -859,7 +859,7 @@ static int arg_copy_compare(const void *a, const void *b) static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc) { xtensa_isa isa = dc->config->isa; - unsigned char b[MAX_INSN_LENGTH] = {cpu_ldub_code(env, dc->pc)}; + unsigned char b[MAX_INSN_LENGTH] = {translator_ldub(env, dc->pc)}; unsigned len = xtensa_op0_insn_len(dc, b[0]); xtensa_format fmt; int slot, slots; @@ -883,7 +883,7 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc) dc->base.pc_next = dc->pc + len; for (i = 1; i < len; ++i) { - b[i] = cpu_ldub_code(env, dc->pc + i); + b[i] = translator_ldub(env, dc->pc + i); } xtensa_insnbuf_from_chars(isa, dc->insnbuf, b, len); fmt = xtensa_format_decode(isa, dc->insnbuf); From patchwork Fri Oct 25 06:36:50 2019 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: 177652 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3265582ill; Fri, 25 Oct 2019 00:13:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwa1GnS3es++Nc/ydChRwrBhl683/Ov1jGQq9zhngT86cuCEncnoN6B7M8l6RqSAhZjCBpq X-Received: by 2002:a05:620a:12b9:: with SMTP id x25mr1580278qki.4.1571987615228; Fri, 25 Oct 2019 00:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987615; cv=none; d=google.com; s=arc-20160816; b=qF8LfnF65y8dxgx3zwpVo6jcgCRxYnFAqUdY5i/dMK+/nsQNXiRbZRSBGe4ldcTkuo Cm7Ipe0Kp6QbtaG94OGN/MuRwuS2WCuXyJydpQ/aKeXv9mRrytISwKHL3kVWyetT6PN9 xOcsQA6G6/fAxnnZm6p3mrq4TyZH5A+hr6OMa1XwRHNv/44oHToKoLxqHYeTZnwFTSVv zGsC1stXuPyV2MImarSSlWg0diGmVnyMOlhZIzDiS07J6KRl1aesftFz0NxYiIfVfPV1 T7ff3P2dqVOcr+muFmyHW2UBpgHkqxueLb+Dohga6hy/LP4XdplCywrWeDwfPwXJPF9y jtmw== 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=jFa/hOu9KHZ8ebr83jt0r9dYBdNGFT8yLTa2Nx/5eIw=; b=u/ss2DWRjjFz0GX165tPUSMGpem9VsrHsRbJ9erWijpNsT4TH5W9Izd0v6qkq7uVd2 Ew+RZTzO00f882He8XLg+1f3pdNNKjOc2IwqUyo4qHpWA1T+s4Jv75vmSYInsGLcbiFf eH5DvnAv77HpxCIdUtl8L5+IYGrZK+aPw9Uo5JH06GZQADsuzK2jLmjLffJ4/HuNVIRo oZk9JRkAyxOMm72zrnxy0QqlcXdg8yegMlxy2XoLAndYLLGh0quUFFvKmPgUs+izawBx HuVP5obIx6e+39RQ+pZbkHgtxjCAF6WT2BF3LhLp9yJMotMxyfIhAiB68ESoRKx07Tsp SWtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lvqRnqz9; 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 o188si791789qkf.352.2019.10.25.00.13.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:13:35 -0700 (PDT) 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=lvqRnqz9; 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]:56470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtmu-000605-JF for patch@linaro.org; Fri, 25 Oct 2019 03:13:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37070) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN7-00088R-Vk for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003Hm-Ty for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:53 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:39772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN5-0003Aw-D4 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wm1-x331.google.com with SMTP id r141so776628wme.4 for ; Thu, 24 Oct 2019 23:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jFa/hOu9KHZ8ebr83jt0r9dYBdNGFT8yLTa2Nx/5eIw=; b=lvqRnqz98JlEd9uvJ5JM9/fjGz10OL5WoKXPl7IXscz4f2YbppADPoMQl48ELI3LLJ ySAJtlJ46mVQGFEqxG1VEGx0eA1K2nKs0osMcmMy7C4bCnvKeJq5kCcp3TLdsgM0qTnh AmVGZZJcvxr6fIgOqmoT9aMjL856SdSzbOowNzlsDjj+Jm3ZHouKRGuGByo8IR5f4lNs b4jO6bjGWxX7Fd1Hso+EJUx2R9tPXefjDj3G3li7+oVZTjx8FlcMNkHBXvxeblbjUU6Y pt+Ya+AG0bJbwvG04oz+bgmb1i93V0Cya6WZi+l84Pv94hhoIKlhZk6H39E6c7ZBVRs9 I8Fg== 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=jFa/hOu9KHZ8ebr83jt0r9dYBdNGFT8yLTa2Nx/5eIw=; b=tvZP2MZK5xXhALmbYaDdwQ0bf46K6yY1kWQNBK1z9khSsjqKvhA6/c0rijv9i36CmZ G6iFsrzvYNowI2XoxPmjtFFzR9sm3QAWidMnylUABm7G/kWykNInaR9kYpWKlVkt13Lr RqNIf3H0meea08LYdx6gMptVk5L5e8R0gdKXANB4Nduv8LGnYYiigqX3IyNt9ii5pEcs DT2JBAGR9PQoY880nD+aY2cbUd5tg6xSHU62Id7hJ+cne8Khn4Z5XoSqD9l5aNAdv0/X nTZwi4ag1Kbvv8hztvUjgDM1eDjppdMu75wpb5XunrlBJQG5UHaeE+/1GwryuvWINaiX pKIw== X-Gm-Message-State: APjAAAWhmZQnXxJli4BijbAjJYH908dsJu+6pyChfgdDrD4kL0bn2Yn5 Dyp8Iy3tOgpTCHYBI81pcF8sLQ== X-Received: by 2002:a7b:c216:: with SMTP id x22mr1920672wmi.161.1571986000366; Thu, 24 Oct 2019 23:46:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f17sm1136373wrs.66.2019.10.24.23.46.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6B0AC1FFCA; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 50/73] target/openrisc: fetch code with translator_ld Date: Fri, 25 Oct 2019 07:36:50 +0100 Message-Id: <20191025063713.23374-51-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::331 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?= , Stafford Horne , "Emilio G. Cota" , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/target/openrisc/translate.c b/target/openrisc/translate.c index 6addbac8d63..8dd28d6cf17 100644 --- a/target/openrisc/translate.c +++ b/target/openrisc/translate.c @@ -1645,7 +1645,7 @@ static void openrisc_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs) { DisasContext *dc = container_of(dcbase, DisasContext, base); OpenRISCCPU *cpu = OPENRISC_CPU(cs); - uint32_t insn = cpu_ldl_code(&cpu->env, dc->base.pc_next); + uint32_t insn = translator_ldl(&cpu->env, dc->base.pc_next); if (!decode(dc, insn)) { gen_illegal_exception(dc); From patchwork Fri Oct 25 06:36:51 2019 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: 177686 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3292002ill; Fri, 25 Oct 2019 00:40:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnUINyk2Ati5f+a3xR4hSi5jiUEe9XUoVWsSoxiYvfP8/Js3z0yLKkXC4rgkCS2kuSC3Do X-Received: by 2002:ac8:22f1:: with SMTP id g46mr1707887qta.12.1571989211453; Fri, 25 Oct 2019 00:40:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989211; cv=none; d=google.com; s=arc-20160816; b=YQOh3IoSe2z6o49w6qEIlE2e1B0kvwLMZSE/yLK+rF4ED9V7UneJLlUJHtR+6roEc9 eMHDFzA9PaTVYu7g37FnJINNbMXw4/BvOQN5RB85kC3Rk656ngHunMm3I0xXdPNqJ/XP RA6teqKRhSxePUFpisanQ/QwV3JQ9GK+rJyv/1u6SRYoilPWZiESmFHTtw0M+VRkMhqq dD3Gy4Ll7xv5BldfXN0Yk+qm8k1+wlhx+cBYstfPGJSfKbljcNhNZXbu0nDq022fay2C fQHJDg6ijxqLIRpWKkzpnHY3BlskxiTPDZXO93VWCdnSESgvgOoO3PBBfhN2YngLNChe YV4w== 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=avDcFa6vNjqfkFm9Eh7Mdg86NxTMA5t/4HoZgIMcBpg=; b=DkhsxsZjBKmixZo0QzAKSIjWmlxPM49tl2YYkupStcGY6Nx/YxLYj31+Y399MCuqMn ehFcH0OZzepxRyUqW6lXNWWbyFTpPmj0sj1bjU7DgPTs0ji9qtRaCWdrXDZiN5CrjA6G wMn8X2YSuSXrQpxmf2u3RqEYt4e/FuWGY5KBd93R1i3QR+906dqPgGisrS7Dav6fprDk FgD/4Dc2nnCR7mxIh1afQxPCtcOniX9On7l0iceJRZ9ycQGh1C5YA2vfPYirkq9bGzkz EgEuGiZW/3rd7ioECo4BbDceE8mlCzYtU5Yx2jh9cSktdQAYOKWI+MQc2gEcMnjcamIf pPbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NbHuFF+g; 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 g32si766347qta.163.2019.10.25.00.40.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:40:11 -0700 (PDT) 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=NbHuFF+g; 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]:56986 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuCf-00075B-RY for patch@linaro.org; Fri, 25 Oct 2019 03:40:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40410) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpx-0004dJ-GL for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpw-0007Cq-3L for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:41 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:39306) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpv-0007C4-Sx for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:40 -0400 Received: by mail-wr1-x42b.google.com with SMTP id a11so1028015wra.6 for ; Fri, 25 Oct 2019 00:16:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=avDcFa6vNjqfkFm9Eh7Mdg86NxTMA5t/4HoZgIMcBpg=; b=NbHuFF+ghhkCeBnDkW5o4yXAtJTkfu5Mz1Pi6zikfUp6Pq+XwIRNb7T39SbuUQOHi9 W/I94CSKVORkaYaf2oJbKpJ3GHG2EwZzEm7TlxT2EElAfE10cvvHEOGFPGJuqyr/SGSJ +U/BYJPNrPBBGR2iO4MhfoqXbyoXjBGa215puULkSCchjWr53z74o0NG/IZfY8yEwjmF 0hV/RVbRQc+nrDTaXnrk2QlzdDAJWlMaMED2S3qd67GdkdSB8z45bETLCbPduwge0i2W WPUVQ5e88jsRQTVWQhqsncOb/9E4w2JJjHr6qAHN/PmY9yA0OEt+wltjaGkNsospMK0x lvzQ== 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=avDcFa6vNjqfkFm9Eh7Mdg86NxTMA5t/4HoZgIMcBpg=; b=AQiplSpzI7giXeQNdUn5e8UD/aYY+Xobw0gjONkc9kWCFQ7DbatS+WpVyE0CpLIull 6rwVWF3CradWoIXbcXHA37s3WL31o1Kt1IAxYXRFa1b9/mAO1O6lm+Omm6OTbn0ataYO dkgHhOITFmQXDn6TzUh4zALShH1zCuCxTi5O8EnVQxiBkvIK3zVRkZZEt44hzcAFg0dV LOFCxODyWtmAZTJ7sqzNOtf4LOyMTvttQyEZptGcLxNXU2qUSBG3sLanEk7jjCuyfqvW XnUHCquZlJT4gw/FPRUpVbrwPQV1Q/pVmGPqd1uVggSshd/RT7z4TwcmhnX8hfCQl9P4 yJCQ== X-Gm-Message-State: APjAAAW5xhIQ4mHQMajem0YfZiwi/SoWNTKAr+apvq3/gaxD6Gn9m3c7 /CHaVO2Lq7RsXz+8eRD3kc9irXagmlQ= X-Received: by 2002:a5d:69c8:: with SMTP id s8mr1414873wrw.167.1571987798667; Fri, 25 Oct 2019 00:16:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id r15sm1316713wro.20.2019.10.25.00.16.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7F5401FF90; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 51/73] translator: inject instrumentation from plugins Date: Fri, 25 Oct 2019 07:36:51 +0100 Message-Id: <20191025063713.23374-52-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G. Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 70c66c538cf..f977682be79 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -16,6 +16,7 @@ #include "exec/gen-icount.h" #include "exec/log.h" #include "exec/translator.h" +#include "exec/plugin-gen.h" /* Pairs with tcg_clear_temp_count. To be called by #TranslatorOps.{translate_insn,tb_stop} if @@ -34,6 +35,7 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, CPUState *cpu, TranslationBlock *tb, int max_insns) { int bp_insn = 0; + bool plugin_enabled; /* Initialize DisasContext */ db->tb = tb; @@ -55,11 +57,17 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, ops->tb_start(db, cpu); tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */ + plugin_enabled = plugin_gen_tb_start(cpu, tb); + while (true) { db->num_insns++; ops->insn_start(db, cpu); tcg_debug_assert(db->is_jmp == DISAS_NEXT); /* no early exit */ + if (plugin_enabled) { + plugin_gen_insn_start(cpu, db); + } + /* Pass breakpoint hits to target for further processing */ if (!db->singlestep_enabled && unlikely(!QTAILQ_EMPTY(&cpu->breakpoints))) { @@ -99,6 +107,14 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, break; } + /* + * We can't instrument after instructions that change control + * flow although this only really affects post-load operations. + */ + if (plugin_enabled) { + plugin_gen_insn_end(); + } + /* Stop translation if the output buffer is full, or we have executed all of the allowed instructions. */ if (tcg_op_buf_full() || db->num_insns >= db->max_insns) { @@ -111,6 +127,10 @@ void translator_loop(const TranslatorOps *ops, DisasContextBase *db, ops->tb_stop(db, cpu); gen_tb_end(db->tb, db->num_insns - bp_insn); + if (plugin_enabled) { + plugin_gen_tb_end(cpu); + } + /* The disas_log hook may use these values rather than recompute. */ db->tb->size = db->pc_next - db->pc_first; db->tb->icount = db->num_insns; From patchwork Fri Oct 25 06:36:52 2019 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: 177638 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3251027ill; Fri, 25 Oct 2019 00:00:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/frH/lkVF/nwUliwTrGByPs/LyqBxPJj3MOvITV8aLG05wUa69tmreR4cirhMVkvBkB/G X-Received: by 2002:a17:906:694d:: with SMTP id c13mr520592ejs.223.1571986832080; Fri, 25 Oct 2019 00:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986832; cv=none; d=google.com; s=arc-20160816; b=YxV1AhjNpPEvJ08MB+ed9U9OFs4gXbLnqn9WGKhaq4lsnKzKpuWF3WCgZkhfB6WPmt CetcXVuxCrsn6kValvDW61A9ExmBOSKkOYD20WcSjXfQdoFzegTZLpffuyctQc0kGR7T zSoxKukZSKGpBAdctgbDGbXZcb+KZXlzIVXMFnqDi8krXgnIvjam3tW6Z8phvWKHx77L 9GcrgW+N46kpSwCCI51B5f31qx1QtIjjUL+3JR3h3HZDjSY7fOeEswPAgc26JxY7GnWz yXt3pQyOd1OylbQhcTrGmjnDzyv+0jkjIhI6LFAVukE/o+Or5BMIMqp3c6Dmx9ZSDuJD LNqQ== 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=s6dUXbiyhwUKB16Q3aSXxKi++FouEOb+/iuvzgagYLA=; b=bXHbbqkLlZISO8lyxVCAuoI0qFVJkcBsN0aIqirh9GmUL+RcMpJ3wN4CTCZfEmZ9LL /LZdSATumXcnRghK8byc+y9TUiXU5AIv2KH1kPrdAruOAjTph7tOS5pwM+/OBOoHzWlh OsPWSAEx5MckhH7vQsQ7EOKJC+gZdbvWO5dXkpYfOUwk61HYcz910U1hALx0m7jo8PT+ 1GeUVsIFOkaEliAa9mkypxxjiiHa2xWB6jLY3QoeXD5JMRSclV1yjWDmZKU98fafdnug QSMINCnseWWF0QDbvMkfWCgnlhl2EBN6CZwn6Lbz+k/wE+lWNufrBhs71as6CRL8Rdva O2FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=F6cnekdT; 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 b15si684133ejd.66.2019.10.25.00.00.31 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:00:32 -0700 (PDT) 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=F6cnekdT; 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]:56302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtaH-0003H1-Kh for patch@linaro.org; Fri, 25 Oct 2019 03:00:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36918) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMr-0007nX-F5 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMq-00038K-DP for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:37 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:35163) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMq-00037l-7U for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:36 -0400 Received: by mail-wr1-x42d.google.com with SMTP id l10so956455wrb.2 for ; Thu, 24 Oct 2019 23:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6dUXbiyhwUKB16Q3aSXxKi++FouEOb+/iuvzgagYLA=; b=F6cnekdTs4Di1+8Zm6PTW2chDDEAQsC+Z3rNSo85HXtP+zsQnOxamognLd4LnJZyMI TbZY9yJRCcUYbqgrycErNioTOjnukwYwWITWnnQwBV0LMNrfVCI+1U4lAKKsPWxVojCd bRAwTVb9Cb0cuPhOjQa8oGn7NMRJrzvFYOtbnqIhp6BnJPl2qZgS8Gs5QdS/22CHNr/q dVp08Oh6j40if8YrscbeeQ1mCI1euIRJYo6vQcNGOl2nU8uy1jUHPc+suozrMCNolDYj mfM5FpDVqQ7eJzDbqKPYmVv39xgsdUTwoOaQw+78j1d7NfmcROd/pZv//TrtK0EuBYsW qP7Q== 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=s6dUXbiyhwUKB16Q3aSXxKi++FouEOb+/iuvzgagYLA=; b=eGPf6ZQpfielN10Ub/INUPYrkusx0dbptkuFFl3QhHN+0vbI/r/UdyKA1h0ex7UIKE DzW1rDW/D2xnlXSMV3zdRNiiO8qf3++1Bf8q2sDpWnvQteZBRqMrmVS9gwMSI9cSIYHk sDIuUmisj6hWi4bPNsXrHz6+kh08e5A/RQ5T3MSTRr6yvjIjGdb02FUq0AoYTvf+FcTV EioqEmn4AbuyX5cFFmDJ3nWd25JStTUTSWRd+s6fTn7e7mQMKLZ/zepiy+vZv3l3l7/Z giTcFFpxJYilvSgNCJ7sWYHOtFxQTaV8LS+UPF9GXtDWM6sMgtk+Hvxu7L+9NYih9WDs o6HA== X-Gm-Message-State: APjAAAV53CN8+/4n2RPjG2DUPb/yLYInTxXuJvmiwaDGXauiWlul9BHp KAvbvRIQz9W6uJFYRvwNtspkGYFaXxc= X-Received: by 2002:adf:f04e:: with SMTP id t14mr1368959wro.106.1571985995059; Thu, 24 Oct 2019 23:46:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p17sm1824079wrn.4.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 945611FFCB; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 52/73] configure: add --enable-plugins Date: Fri, 25 Oct 2019 07:36:52 +0100 Message-Id: <20191025063713.23374-53-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This adds the basic boilerplate feature enable option for the build. We shall expand it later. [AJB: split from larger patch] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/configure b/configure index d6fbcf45e4f..2995559ed21 100755 --- a/configure +++ b/configure @@ -498,6 +498,7 @@ libxml2="" debug_mutex="no" libpmem="" default_devices="yes" +plugins="no" supported_cpu="no" supported_os="no" @@ -1529,6 +1530,10 @@ for opt do ;; --disable-xkbcommon) xkbcommon=no ;; + --enable-plugins) plugins="yes" + ;; + --disable-plugins) plugins="no" + ;; *) echo "ERROR: unknown option $opt" echo "Try '$0 --help' for more information" @@ -1710,6 +1715,8 @@ Advanced options (experts only): --enable-profiler profiler support --enable-debug-stack-usage track the maximum stack usage of stacks created by qemu_alloc_stack + --enable-plugins + enable plugins via shared library loading Optional features, enabled with --enable-FEATURE and disabled with --disable-FEATURE, default is enabled if available: @@ -6442,6 +6449,7 @@ echo "capstone $capstone" echo "libpmem support $libpmem" echo "libudev $libudev" echo "default devices $default_devices" +echo "plugin support $plugins" if test "$supported_cpu" = "no"; then echo @@ -7272,6 +7280,11 @@ if test "$sheepdog" = "yes" ; then echo "CONFIG_SHEEPDOG=y" >> $config_host_mak fi +if test "$plugins" = "yes" ; then + echo "CONFIG_PLUGIN=y" >> $config_host_mak + LIBS="-ldl $LIBS" +fi + if test "$tcg_interpreter" = "yes"; then QEMU_INCLUDES="-iquote \$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" elif test "$ARCH" = "sparc64" ; then From patchwork Fri Oct 25 06:36:53 2019 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: 177628 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3242381ill; Thu, 24 Oct 2019 23:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBZybBSlUgWufE3r5qz2dSWQnawGy1VXOmWcEms6JVZkfKyQC/DI+2QQMUA4j4xocFqaJl X-Received: by 2002:a50:9eac:: with SMTP id a41mr2144155edf.237.1571986245945; Thu, 24 Oct 2019 23:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986245; cv=none; d=google.com; s=arc-20160816; b=Irjmx3N558JzSfR/a78C4FQkq9FNEkkW1PrsoiMNg8uB/Jlhpyp9+HsbUt+bvstw16 OSfD3S8aGgCouMv5N9b8FXN74+4QdzSfrvYuBmBz2lPQIWKv9Cra3XrO9scmHzMqLKji aKo6aezcj2l9pN1KCYDXsQqAbM5J0KUKH9NMZga5ndmecSU8oBVXT+PgidRyMl/ua5kb oDm08f45ujIPJvNPQhjVPILLDkZPY8zRKDMrU+2O7dWuBwKLbC7Hwo+S0akDvgrTXJGO HJFQ6A1UO+HzAjrRzPff5cB5Az156IQEG2pdD+cVObgQ33QlAK2ZZxOFARqHNczuAke+ TzXg== 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=44V7jQqOs3ZoLqNrh7jJMlyq1xec1lAdesBPk7eaAP4=; b=HFV0hCNtY1xGG0pGPtNz77qDHX4FM6CL+LmHeVQVETJP8WA+FPgHhNdfo+JjeibUN1 lgnI5IsxwMNxptsi2ChnlyIe10i/jURhu5tkDCiEP2ds83l6JV/NtUiC5Bn7c0HpEEkf e5ja7nXWC0P3lVUWEx8k/FVl3u9HP0dGpapYDIUnd4FHQgrxZ+PVB7MjzegTlx4baGod i4BMxk/XBWmiXef7a7jv86Fyix+gAAB5HxFNywPgz3VjD/uTTUsEp5Oj2duFwQy39Z3i LlD+WorlDQktNKIRo3gFOL3KVcK8J5+w8BDG/d8qwLZM0T/HIUsnNPM8MVdB6lq7rETY mJQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=labMApue; 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 i6si611306ejr.430.2019.10.24.23.50.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:50:45 -0700 (PDT) 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=labMApue; 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]:56060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtQq-0005DZ-4A for patch@linaro.org; Fri, 25 Oct 2019 02:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35530) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE1-0003Hq-3k for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtDz-0008QK-0K for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:29 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:33275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtDy-0008Q5-PR for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:26 -0400 Received: by mail-wm1-x334.google.com with SMTP id 6so3526459wmf.0 for ; Thu, 24 Oct 2019 23:37:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=44V7jQqOs3ZoLqNrh7jJMlyq1xec1lAdesBPk7eaAP4=; b=labMApuedQHad2h2Hq2Hy+SJhDAUXrp9o0fLu4a67lYCUd3WLNBaVQQ3D8mjKZM9J9 pJAbvSFkPvu4l8c9i24yRHhDePn44MuNVt4Z5YD9Z3vphr8UugLgvbkgDdlt/CC3g/LQ /Q8bj+aDVRyXjX78sgOGCoCLtBfIXUqFmB14sNSsuLeGwT8Cm6IiHCUJv9WNFKGzx6Ho Kx/5qz+4OA2FnVNuEEIVZMy75rirKOu8g6hFBpOxuyXJjLviWZGuDfa3uqwYg9eZmKt5 /C6Xc+zUGYM3SKvKmYWrAUC8XeUN4toof2oIZi8V4HYTjgGeA8WajW16LqSivtktKb+g fqnQ== 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=44V7jQqOs3ZoLqNrh7jJMlyq1xec1lAdesBPk7eaAP4=; b=HuFSPL13rLz/S7hKuHTD5tCpYbCaTPxilLl7VXM3nPNpOISnMUAwvRNOrrpuimA7RE MXRMsPJH6EbfhdRG6DTqMa8wgX3xG2W/Wrs7dpzoYlzalU1kDJns7wzj05Yohk501kMt Dhf30ik92iXAPUd5oza8hT8aYXhHcTE4NmtpE+PMMFFBZHJRwtIYNaos1ggHr5GpbvM5 Hy8xGiERPoM6SJxfK1XJ2fZJMT9BAoPDwaNMi6i8QGmBTz5KUiS1q/eVV8krTKaB/QLl Vyx7BZ9nppHWxOiCvCMeXl3cauNtSGLlYjjXb4rHgClTiBY5OUCLDxnTNWsKEXcGjGSE is6Q== X-Gm-Message-State: APjAAAVTX+C1L9zh7KH2g6AuWxOcMYhlwOXZ3bpl5QiDvDH4e0Kosdqy QKyq2sKXx5WRmQr7LRBz3RlDRw== X-Received: by 2002:a05:600c:2487:: with SMTP id 7mr1823283wms.164.1571985445608; Thu, 24 Oct 2019 23:37:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q25sm2598951wra.3.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AE4101FFCC; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 53/73] plugin: add API symbols to qemu-plugins.symbols Date: Fri, 25 Oct 2019 07:36:53 +0100 Message-Id: <20191025063713.23374-54-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::334 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Signed-off-by: Emilio G. Cota [AJB: moved into plugins] Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/Makefile b/Makefile index 94d25185511..bd6376d295f 100644 --- a/Makefile +++ b/Makefile @@ -74,6 +74,12 @@ CONFIG_ALL=y config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION @echo $@ is out-of-date, running configure @./config.status + +# Force configure to re-run if the API symbols are updated +ifeq ($(CONFIG_PLUGIN),y) +config-host.mak: $(SRC_PATH)/plugins/qemu-plugins.symbols +endif + else config-host.mak: ifneq ($(filter-out $(UNCHECKED_GOALS),$(MAKECMDGOALS)),$(if $(MAKECMDGOALS),,fail)) @@ -737,6 +743,7 @@ distclean: clean rm -f qemu-doc.fn qemu-doc.fns qemu-doc.info qemu-doc.ky qemu-doc.kys rm -f qemu-doc.log qemu-doc.pdf qemu-doc.pg qemu-doc.toc qemu-doc.tp rm -f qemu-doc.vr qemu-doc.txt + rm -f qemu-plugins-ld.symbols qemu-plugins-ld64.symbols rm -f config.log rm -f linux-headers/asm rm -f docs/version.texi diff --git a/configure b/configure index 2995559ed21..eabe84af6ed 100755 --- a/configure +++ b/configure @@ -30,6 +30,7 @@ TMPO="${TMPDIR1}/${TMPB}.o" TMPCXX="${TMPDIR1}/${TMPB}.cxx" TMPE="${TMPDIR1}/${TMPB}.exe" TMPMO="${TMPDIR1}/${TMPB}.mo" +TMPTXT="${TMPDIR1}/${TMPB}.txt" rm -f config.log @@ -5476,6 +5477,61 @@ if compile_prog "" "" ; then atomic64=yes fi +######################################### +# See if --dynamic-list is supported by the linker +ld_dynamic_list="no" +if test "$static" = "no" ; then + cat > $TMPTXT < $TMPC < +void foo(void); + +void foo(void) +{ + printf("foo\n"); +} + +int main(void) +{ + foo(); + return 0; +} +EOF + + if compile_prog "" "-Wl,--dynamic-list=$TMPTXT" ; then + ld_dynamic_list="yes" + fi +fi + +######################################### +# See if -exported_symbols_list is supported by the linker + +ld_exported_symbols_list="no" +if test "$static" = "no" ; then + cat > $TMPTXT <> $config_host_mak LIBS="-ldl $LIBS" + # Copy the export object list to the build dir + if test "$ld_dynamic_list" = "yes" ; then + echo "CONFIG_HAS_LD_DYNAMIC_LIST=yes" >> $config_host_mak + ld_symbols=qemu-plugins-ld.symbols + cp "$source_path/plugins/qemu-plugins.symbols" $ld_symbols + elif test "$ld_exported_symbols_list" = "yes" ; then + echo "CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST=yes" >> $config_host_mak + ld64_symbols=qemu-plugins-ld64.symbols + echo "# Automatically generated by configure - do not modify" > $ld64_symbols + grep 'qemu_' "$source_path/plugins/qemu-plugins.symbols" | sed 's/;//g' | \ + sed -E 's/^[[:space:]]*(.*)/_\1/' >> $ld64_symbols + else + error_exit \ + "If \$plugins=yes, either \$ld_dynamic_list or " \ + "\$ld_exported_symbols_list should have been set to 'yes'." + fi fi if test "$tcg_interpreter" = "yes"; then diff --git a/plugins/.gitignore b/plugins/.gitignore new file mode 100644 index 00000000000..7b8aaa1f109 --- /dev/null +++ b/plugins/.gitignore @@ -0,0 +1,2 @@ +qemu-plugins-ld.symbols +qemu-plugins-ld64.symbols diff --git a/plugins/Makefile.objs b/plugins/Makefile.objs index 95baabf3d2f..6f14d91ccb9 100644 --- a/plugins/Makefile.objs +++ b/plugins/Makefile.objs @@ -5,3 +5,17 @@ obj-y += loader.o obj-y += core.o obj-y += api.o + +# Abuse -libs suffix to only link with --dynamic-list/-exported_symbols_list +# when the final binary includes the plugin object. +# +# Note that simply setting LDFLAGS is not enough: we build binaries that +# never link plugin.o, and the linker might fail (at least ld64 does) +# if the symbols in the list are not in the output binary. +ifdef CONFIG_HAS_LD_DYNAMIC_LIST +api.o-libs := -Wl,--dynamic-list=$(BUILD_DIR)/qemu-plugins-ld.symbols +else +ifdef CONFIG_HAS_LD_EXPORTED_SYMBOLS_LIST +api.o-libs := -Wl,-exported_symbols_list,$(BUILD_DIR)/qemu-plugins-ld64.symbols +endif +endif diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols new file mode 100644 index 00000000000..40c0d1abd2f --- /dev/null +++ b/plugins/qemu-plugins.symbols @@ -0,0 +1,38 @@ +{ + qemu_plugin_uninstall; + qemu_plugin_reset; + qemu_plugin_register_vcpu_init_cb; + qemu_plugin_register_vcpu_exit_cb; + qemu_plugin_register_vcpu_idle_cb; + qemu_plugin_register_vcpu_resume_cb; + qemu_plugin_register_vcpu_insn_exec_cb; + qemu_plugin_register_vcpu_insn_exec_inline; + qemu_plugin_register_vcpu_mem_cb; + qemu_plugin_register_vcpu_mem_haddr_cb; + qemu_plugin_register_vcpu_mem_inline; + qemu_plugin_ram_addr_from_host; + qemu_plugin_register_vcpu_tb_trans_cb; + qemu_plugin_register_vcpu_tb_exec_cb; + qemu_plugin_register_vcpu_tb_exec_inline; + qemu_plugin_register_flush_cb; + qemu_plugin_register_vcpu_syscall_cb; + qemu_plugin_register_vcpu_syscall_ret_cb; + qemu_plugin_register_atexit_cb; + qemu_plugin_tb_n_insns; + qemu_plugin_tb_get_insn; + qemu_plugin_tb_vaddr; + qemu_plugin_insn_data; + qemu_plugin_insn_size; + qemu_plugin_insn_vaddr; + qemu_plugin_insn_haddr; + qemu_plugin_mem_size_shift; + qemu_plugin_mem_is_sign_extended; + qemu_plugin_mem_is_big_endian; + qemu_plugin_mem_is_store; + qemu_plugin_get_hwaddr; + qemu_plugin_hwaddr_is_io; + qemu_plugin_hwaddr_to_raddr; + qemu_plugin_vcpu_for_each; + qemu_plugin_n_vcpus; + qemu_plugin_n_max_vcpus; +}; From patchwork Fri Oct 25 06:36:54 2019 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: 177634 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3247772ill; Thu, 24 Oct 2019 23:57:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPVDpYu+2i5HgiqAGFIksiptfX9IUUEkY3qOtSOkq85qnjwYq4rOh66DW/xxeUS1Vaa4/t X-Received: by 2002:a05:6214:4d:: with SMTP id c13mr1729879qvr.116.1571986620532; Thu, 24 Oct 2019 23:57:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986620; cv=none; d=google.com; s=arc-20160816; b=FDz8SPGhfywHodkryKKE6b9PCirsTf20c6NMHvVusB7w4+9s7Wqhj6X6nl5I5m30IX DvTc+jTRuMhXs2w0Wncm4b+WZsbRfErMDreq0kmzTJKrnaycN+5fFAHUny4XG2fTGlBt ve1NPEy00/w4Ew6kg8XDwcOA6V9tiwKpvNxD/WZsOSVspvwN53HvZheAAIdQBWVr8qBU ky/hCCAwS4hmekq6H2yS+7iEGl75Y9gDXlt8LAwk2j1zXAZ3Fz/3HTQ5vOqaDFEr4vF0 pDxW8LwWY+lf2pHnotmVFf1Sh61pY5i3tRVo7yqdOZnVKIiQjulqVYtLak3FtjN6UsqB CUdQ== 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=tNTEbGMtJZXoQB4/p2TTXTubBbnqE0j7BRIuNAJ75D8=; b=SNRLszwqMciKDC/R+1uwmes77Ox2R6Q/66nRd8rj9GaegP5olZo8PZnC2l79WxgrBT A/vMBv5h7dxIruomleG4kpYxYn00wv0BAtvcqOzzhvnqQoYQu1CI76HN+em3ObCrs1hF cIvxQWSmlWY27E4v0j1zyeLZU8FsJ/78nDAyRqFKfKeWcx55iWtrOfL1TIbE57hc/biX xoKpHmT+XGnL4DpzELcoWzWWxf6WNWT1KaubxaNZL2Z3RMkyudwlBa7JMF4jVv9za6qg lfnAFnbZipMcXQEri6GumJk69PDSDhmBBCDmNPeN8MqCs5EwZvAQH1+gGP/ntD/2ESLV eZag== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="jmu3aD/D"; 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 x82si825907qkb.117.2019.10.24.23.57.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:57:00 -0700 (PDT) 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="jmu3aD/D"; 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]:56250 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWt-0003x6-Ho for patch@linaro.org; Fri, 25 Oct 2019 02:56:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35570) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE2-0003KL-H2 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE1-0008RL-95 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:30 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:36915) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE1-0008Qk-2Q for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:29 -0400 Received: by mail-wm1-x330.google.com with SMTP id q130so761849wme.2 for ; Thu, 24 Oct 2019 23:37:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tNTEbGMtJZXoQB4/p2TTXTubBbnqE0j7BRIuNAJ75D8=; b=jmu3aD/DxDoCZf3tNr7epWj855PZx5LkiKtYiQlSEGuyRMtjV5YHDvKnsf+/O8aKsC wiI1LL/eTZ0PlMdaXndXBNK6FkTReJXL+61UJhn1zC28sh4Ejkr2lRoMH5m3rASlcRaX pMD7hAcq4KX72tfVDLYl8aariv7+omEc7QzDK0wFbN1sW1tdvHKIG2otUvuayTksEkHV gbCOd/9UAFYHalA3s3hILbmcjBy2Wd261UwI+RFDLtHJS/lTHY7FX6DZGF5Xm3wnhJdd 0XsE9G1FNSD3W7kH7Dj/ne5LMZrB+NBdCWNPkoHnIQSqN6/DLCKuhDxn2ZWnLJatnPlE zSJA== 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=tNTEbGMtJZXoQB4/p2TTXTubBbnqE0j7BRIuNAJ75D8=; b=ulu9bKO6slWP3m6gRspPcZOIxuEGLYN2LsphtPzCmn10DoyU9MJj0oKZsSXJOfO7xL k6wb9F2AFd6eIGCGxz8+m1NByl+cFQW+TMk4RK4WnseYSKsRohel4msBOk0tGGSiXMiT zdljiIbBihAgVXx5yKYOlN0ILPmE+ftArijscy+b65cJO6fdgFh12QsxZ5kCzx+GfuFZ YEMQdAcv/2+8OXzTY/QSdIXYmWuwo2wAt+0zYDi0vVDphrFcxAGXcDmU3dcdSj4ulraG GKXsmiyuDQZ4husZL8JHAuvDI9BFPr9xhmvgHli/ZMRESDE97vl0tqWoVZODjcvOuEAh MLkw== X-Gm-Message-State: APjAAAWVnHiBrZRcSz+d4UcxiM7LeFIfs4QsO+JsGGh+t/P1t5hfa5+r Ho+9+IELXc0EVHXKofWxyukgBBZZayg= X-Received: by 2002:a1c:7401:: with SMTP id p1mr1766700wmc.144.1571985447568; Thu, 24 Oct 2019 23:37:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v20sm971570wml.26.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C40891FFCD; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 54/73] plugin: expand the plugin_init function to include an info block Date: Fri, 25 Oct 2019 07:36:54 +0100 Message-Id: <20191025063713.23374-55-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This provides a limited amount of info to plugins about the guest system that will allow them to make some additional decisions on setup. Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index c213d1dd19f..784f1dfc3da 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -38,9 +38,27 @@ typedef uint64_t qemu_plugin_id_t; +typedef struct { + /* string describing architecture */ + const char *target_name; + /* is this a full system emulation? */ + bool system_emulation; + union { + /* + * smp_vcpus may change if vCPUs can be hot-plugged, max_vcpus + * is the system-wide limit. + */ + struct { + int smp_vcpus; + int max_vcpus; + } system; + }; +} qemu_info_t; + /** * qemu_plugin_install() - Install a plugin * @id: this plugin's opaque ID + * @info: a block describing some details about the guest * @argc: number of arguments * @argv: array of arguments (@argc elements) * @@ -49,10 +67,14 @@ typedef uint64_t qemu_plugin_id_t; * Note: Calling qemu_plugin_uninstall() from this function is a bug. To raise * an error during install, return !0. * + * Note: @info is only live during the call. Copy any information we + * want to keep. + * * Note: @argv remains valid throughout the lifetime of the loaded plugin. */ -QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, int argc, - char **argv); +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv); /* * Prototypes for the various callback styles we will be registering diff --git a/plugins/loader.c b/plugins/loader.c index eaedff577c3..ce724ed5839 100644 --- a/plugins/loader.c +++ b/plugins/loader.c @@ -28,6 +28,10 @@ #include "hw/core/cpu.h" #include "cpu.h" #include "exec/exec-all.h" +#ifndef CONFIG_USER_ONLY +#include "hw/boards.h" +#endif + #include "plugin.h" /* @@ -58,7 +62,7 @@ QemuOptsList qemu_plugin_opts = { }, }; -typedef int (*qemu_plugin_install_func_t)(qemu_plugin_id_t, int, char **); +typedef int (*qemu_plugin_install_func_t)(qemu_plugin_id_t, const qemu_info_t *, int, char **); extern struct qemu_plugin_state plugin; @@ -145,7 +149,7 @@ static uint64_t xorshift64star(uint64_t x) return x * UINT64_C(2685821657736338717); } -static int plugin_load(struct qemu_plugin_desc *desc) +static int plugin_load(struct qemu_plugin_desc *desc, const qemu_info_t *info) { qemu_plugin_install_func_t install; struct qemu_plugin_ctx *ctx; @@ -193,7 +197,7 @@ static int plugin_load(struct qemu_plugin_desc *desc) } QTAILQ_INSERT_TAIL(&plugin.ctxs, ctx, entry); ctx->installing = true; - rc = install(ctx->id, desc->argc, desc->argv); + rc = install(ctx->id, info, desc->argc, desc->argv); ctx->installing = false; if (rc) { error_report("%s: qemu_plugin_install returned error code %d", @@ -241,11 +245,22 @@ static void plugin_desc_free(struct qemu_plugin_desc *desc) int qemu_plugin_load_list(QemuPluginList *head) { struct qemu_plugin_desc *desc, *next; + g_autofree qemu_info_t *info = g_new0(qemu_info_t, 1); + + info->target_name = TARGET_NAME; +#ifndef CONFIG_USER_ONLY + MachineState *ms = MACHINE(qdev_get_machine()); + info->system_emulation = true; + info->system.smp_vcpus = ms->smp.cpus; + info->system.max_vcpus = ms->smp.max_cpus; +#else + info->system_emulation = false; +#endif QTAILQ_FOREACH_SAFE(desc, head, entry, next) { int err; - err = plugin_load(desc); + err = plugin_load(desc, info); if (err) { return err; } From patchwork Fri Oct 25 06:36:55 2019 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: 177649 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3264200ill; Fri, 25 Oct 2019 00:12:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyJ0S0qp+uklYaf2iNumjTl12bned6/2g4MdQ3MKBBHmCJ0Iz+MN/Uca4a45TpQQ9oTRcxV X-Received: by 2002:a37:6554:: with SMTP id z81mr1519333qkb.9.1571987539338; Fri, 25 Oct 2019 00:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987539; cv=none; d=google.com; s=arc-20160816; b=HG6Q7kHO4ZdKfg7D8RgbuGVSDOk0J1JibyYfU1aVzZ/V91JzFQY2gz/eoIyuiM5iAL dVnvhZJlpD8ETECIXjanCW2OyFWfrdKM/1aCD5tRvj32FUK5zWVKV1VVnFFsckPv1fdx bHGsbNWhCLGpVk+ZERNhcoKwQd2te0s2Apz1+gp3q81jEZx/ZiJqB9pGw57IesXxW581 dwU+4sSBG/3GmuZvx61CHBWkUXA3nV8MqP6WuFkTalw456zhiK/eswO6P8ZRKsLaI5xg yHmTdfp6gmdYH/B+gQUdsHOnq9r87HfAaOiLeatUpHMhZJ4vBwF4dVX5vWg9LSSojp5Q /Pvw== 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=q5qV5/OwW4JapCpipq8SEvEBPISUkxgOpnZmkOYtTHM=; b=PnGj6I9xlhX4ZH+hSqKTPscu6ilzNwjtD9ExbmrS7z/oEpmVj60wkAhqPn9iJGelHz Y4rZet98K9h4DgTEQVG6QbjetmZ/73Z50ubiemndGBxe/2g+db0ekmaWL7ehPqZT0OcD tTVFg6yQJCQmQPj68w9qV1PuB1Nu+zwu1D+X3erql1pAQApalX2IKAvm+D5LT6yPFJY9 k7HGveq7gLnGLhRHQzJhQcAITeybySzja77i2mGndXQQ5Y7JH4O0nlND2MiBc1iLWaXb 0LeWsvYhAKEmCs5Fgm4pezW/ajm2DZomPYR0jqQstkNbX5nDVQ8CqARESPniNPCM3pCK RVxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q2Jxpa0i; 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 cj11si818737qvb.21.2019.10.25.00.12.19 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:12:19 -0700 (PDT) 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=q2Jxpa0i; 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]:56452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtli-00050t-AN for patch@linaro.org; Fri, 25 Oct 2019 03:12:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35620) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE6-0003R0-Rv for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE5-0008TB-CD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:34 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]:46556) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE2-0008Rl-El for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:31 -0400 Received: by mail-wr1-x434.google.com with SMTP id n15so884325wrw.13 for ; Thu, 24 Oct 2019 23:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q5qV5/OwW4JapCpipq8SEvEBPISUkxgOpnZmkOYtTHM=; b=q2Jxpa0ibGd5EvukN0YQg3eLwITE+qOUEgrhxsNxUKANJ4fMKlEdIL9HVRpGkUG4zL TCeOCgbS1XywyZUdHlHuiXQM/8kO5MKZPMHAXWP8gqs+a+pXGCcKXlGYn65QJxqWKUAZ flNGqfu262TyQ2MiZxUdVptMtbN8pz4rXGmqwBgebPoXxcbD8b4YX3i/PA4FB6DQwaQq wYL6spgmC/wR3WvpHTzrAtP0K02QQ9vU0Opltf2JbZd3CjJj1+/eTdpD329b4vATpYtK TehLK6F+84NR7UCVVj3wmYbwE9erP9GwoLvJ3uB7V28yItQWG/tMTsgIINNQi2PCKSOS xiUw== 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=q5qV5/OwW4JapCpipq8SEvEBPISUkxgOpnZmkOYtTHM=; b=FzTxAfJGWWfDPSGxNPTh8P2/ghqdnxDUC+S0/a5TuMBeq7OiBt/U09wmeGP0gUT7yo gMISZvECsRf8SBP4LjcNrkuhvOcYbUKLXPnmrGpfm65Is44TY0q6IbyZVz/DvTwVhpAT YleECsanHIYYYWaSnse2QnAvuxI1N0MO9ycOS4fhEUqTcK5cGc/BvO0u3XDYQRXfXhiL EgwI3Oz1DWCQKjUa1LbXKwzW4KvjbMtGREedXu5p7gOr4YU5bPYrs39B794TksUPdhiz 018bA2OjEPPRzwHQ+k66QnR6U2Lqpm8C9qWzFyM6z+NerJ5m2ykXsLLOxUP+suw5S//t 58lg== X-Gm-Message-State: APjAAAXvARBjlZSPSzHS1y1I0vh+o4B/toS2MuO8/IYMeFnMRs+jRd+H LYNbKVOh0QBnnoQbn0iFNb1oww== X-Received: by 2002:a5d:444b:: with SMTP id x11mr1268199wrr.207.1571985449121; Thu, 24 Oct 2019 23:37:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id u21sm1731116wmu.27.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DDB621FFCE; Fri, 25 Oct 2019 07:37:18 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 55/73] plugin: add qemu_plugin_insn_disas helper Date: Fri, 25 Oct 2019 07:36:55 +0100 Message-Id: <20191025063713.23374-56-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::434 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Give the plugins access to the QEMU dissasembler so they don't have to re-invent the wheel. We generate a warning when there are spare bytes in the decode buffer. This is usually due to the front end loading in more bytes than decoded. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/disas.c b/disas.c index 3e2bfa572b1..3937da61571 100644 --- a/disas.c +++ b/disas.c @@ -418,6 +418,7 @@ static bool cap_disas_monitor(disassemble_info *info, uint64_t pc, int count) # define cap_disas_target(i, p, s) false # define cap_disas_host(i, p, s) false # define cap_disas_monitor(i, p, c) false +# define cap_disas_plugin(i, p, c) false #endif /* CONFIG_CAPSTONE */ /* Disassemble this for me please... (debugging). */ @@ -475,6 +476,115 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code, } } +static __thread GString plugin_disas_output; + +static int plugin_printf(FILE *stream, const char *fmt, ...) +{ + va_list va; + GString *s = &plugin_disas_output; + int initial_len = s->len; + + va_start(va, fmt); + g_string_append_vprintf(s, fmt, va); + va_end(va); + + return s->len - initial_len; +} + +static void plugin_print_address(bfd_vma addr, struct disassemble_info *info) +{ + /* does nothing */ +} + + +#ifdef CONFIG_CAPSTONE +/* Disassemble a single instruction directly into plugin output */ +static +bool cap_disas_plugin(disassemble_info *info, uint64_t pc, size_t size) +{ + uint8_t cap_buf[1024]; + csh handle; + cs_insn *insn; + size_t csize = 0; + int count; + GString *s = &plugin_disas_output; + + if (cap_disas_start(info, &handle) != CS_ERR_OK) { + return false; + } + insn = cap_insn; + + size_t tsize = MIN(sizeof(cap_buf) - csize, size); + const uint8_t *cbuf = cap_buf; + target_read_memory(pc, cap_buf, tsize, info); + + count = cs_disasm(handle, cbuf, size, 0, 1, &insn); + + if (count) { + g_string_printf(s, "%s %s", insn->mnemonic, insn->op_str); + } else { + g_string_printf(s, "cs_disasm failed"); + } + + cs_close(&handle); + return true; +} +#endif + +/* + * We should only be dissembling one instruction at a time here. If + * there is left over it usually indicates the front end has read more + * bytes than it needed. + */ +char *plugin_disas(CPUState *cpu, uint64_t addr, size_t size) +{ + CPUClass *cc = CPU_GET_CLASS(cpu); + int count; + CPUDebug s; + GString *ds = g_string_set_size(&plugin_disas_output, 0); + + g_assert(ds == &plugin_disas_output); + + INIT_DISASSEMBLE_INFO(s.info, NULL, plugin_printf); + + s.cpu = cpu; + s.info.read_memory_func = target_read_memory; + s.info.buffer_vma = addr; + s.info.buffer_length = size; + s.info.print_address_func = plugin_print_address; + s.info.cap_arch = -1; + s.info.cap_mode = 0; + s.info.cap_insn_unit = 4; + s.info.cap_insn_split = 4; + +#ifdef TARGET_WORDS_BIGENDIAN + s.info.endian = BFD_ENDIAN_BIG; +#else + s.info.endian = BFD_ENDIAN_LITTLE; +#endif + + if (cc->disas_set_info) { + cc->disas_set_info(cpu, &s.info); + } + + if (s.info.cap_arch >= 0 && cap_disas_plugin(&s.info, addr, size)) { + return g_strdup(ds->str); + } + + if (s.info.print_insn == NULL) { + s.info.print_insn = print_insn_od_target; + } + + count = s.info.print_insn(addr, &s.info); + + /* The decoder probably read more than it needed it's not critical */ + if (count < size) { + warn_report("%s: %zu bytes left over", __func__, size - count); + } + + return g_strdup(ds->str); +} + /* Disassemble this for me please... (debugging). */ void disas(FILE *out, void *code, unsigned long size) { diff --git a/include/disas/disas.h b/include/disas/disas.h index ba47e9197cd..36c33f6f194 100644 --- a/include/disas/disas.h +++ b/include/disas/disas.h @@ -14,6 +14,8 @@ void target_disas(FILE *out, CPUState *cpu, target_ulong code, void monitor_disas(Monitor *mon, CPUState *cpu, target_ulong pc, int nb_insn, int is_physical); +char *plugin_disas(CPUState *cpu, uint64_t addr, size_t size); + /* Look up symbol for debugging purpose. Returns "" if unknown. */ const char *lookup_symbol(target_ulong orig_addr); #endif diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 784f1dfc3da..ddf267fbfe0 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -351,6 +351,15 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_syscall_ret_cb_t cb); +/** + * qemu_plugin_insn_disas() - return disassembly string for instruction + * @insn: instruction reference + * + * Returns an allocated string containing the disassembly + */ + +char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn); + /** * qemu_plugin_vcpu_for_each() - iterate over the existing vCPU * @id: plugin ID diff --git a/plugins/api.c b/plugins/api.c index 33dac8e790d..5adc4d25a1e 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -39,7 +39,8 @@ #include "cpu.h" #include "sysemu/sysemu.h" #include "tcg/tcg.h" -#include "trace/mem-internal.h" /* mem_info macros */ +#include "exec/exec-all.h" +#include "disas/disas.h" #include "plugin.h" #ifndef CONFIG_USER_ONLY #include "qemu/plugin-memory.h" @@ -212,6 +213,12 @@ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn) return insn->haddr; } +char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn) +{ + CPUState *cpu = current_cpu; + return plugin_disas(cpu, insn->vaddr, insn->data->len); +} + /* * The memory queries allow the plugin to query information about a * memory access. diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 40c0d1abd2f..267ec381b4a 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -25,6 +25,7 @@ qemu_plugin_insn_size; qemu_plugin_insn_vaddr; qemu_plugin_insn_haddr; + qemu_plugin_insn_disas; qemu_plugin_mem_size_shift; qemu_plugin_mem_is_sign_extended; qemu_plugin_mem_is_big_endian; From patchwork Fri Oct 25 06:36:56 2019 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: 177632 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3245233ill; Thu, 24 Oct 2019 23:54:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqxljSM3pZ1qU8zKt3TQrfghDJy/Yn5miLn8UeCdVjC9qPaHotKjDTz6XeXT3iRLN3hnQAe5 X-Received: by 2002:a17:906:3746:: with SMTP id e6mr1874435ejc.170.1571986447023; Thu, 24 Oct 2019 23:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986447; cv=none; d=google.com; s=arc-20160816; b=yuePFANYGuLkgI+/irQpgs5I9B73twSryU7jT5uMI8nspwGqDiXpm7VGbXUh+1osEA YFoKTnVjsvxKW7SZze0xksElbn96t7/7bcCG11gDmcj56/6W67yXhb9+pHX5UvvmmuRH GaQgF4rbl0ykFgA+YEinJLRLjm/GAye3He6+V1l97CvJgQ91KCfKONBEjV9uAJtsdyLN v8VsPpFqo1ulXupyMExrNKZ0Q6Po3jSNvIom1+LKJcnsnSaMTOPmKvMN6LiuJonqoREr ExY9sYUpLHmVDLHm9lpBjKk2TOjYTYu6sb/a1xDtul+esvSSxfHUMF2C7jOV9HfExJRh M7zQ== 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=ejSGmzKi8yOJXrP8xmGu9NmM/5lE3B8zIrb30U/0RJ0=; b=DH0UhXVcaqll2qV9CJLXK9RQUtHhKrLIZDbrU0IrvbOiSh2ATtnf7A9kONkV6zVMDJ 0OWgkWekRH/FG/6qEH5ewTxp2zaS+0R/XI5sdM6Aiy5vWUc8JnyWlM6mNwxkSUFVGu1T olM5fiRKF1ymvLmvF2BMu452x8ASSSPIM9KmMTSR73NRLu7t4NUf4aTkbV9JW2Mf30DB ai1sVLN+fkZZVTZaWmLJxXoPPp/kAfS0gT8cUQ8k5XFmAGkwd6S9QgGEwbiA0T+CBHLk laibvT89GNH42pCI5TzLFofdgbD7x2BK/bHdTd5hYsivmCs8MNJFpUa02BjrhnuxAnTd kXWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Dkaas+Ru; 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 d28si631704edb.10.2019.10.24.23.54.06 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:54:07 -0700 (PDT) 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=Dkaas+Ru; 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]:56096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtU5-00041j-9G for patch@linaro.org; Fri, 25 Oct 2019 02:54:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35622) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE6-0003R1-SE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE5-0008TS-M1 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:34 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:51252) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE5-0008ST-Bm for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:33 -0400 Received: by mail-wm1-x32e.google.com with SMTP id q70so769195wme.1 for ; Thu, 24 Oct 2019 23:37:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ejSGmzKi8yOJXrP8xmGu9NmM/5lE3B8zIrb30U/0RJ0=; b=Dkaas+RuFbYXkql0xawrGQmJ2idIvjDSXnSbERjVKJeq0aeh+XyAS2RQG3qv6/TLwu gCxcdpPMQ5Ii6t+sao3aSsbghL4q6df8V7xFmzIXKIv/BZ3cIFDpP9J1ZHosYCQFJJac qp3DpgDVXp0D/+GGLBukLGnRfOFZ2RRglnZBffIkFRaTZsUroLh/kD5SRc5t1iIAVeoK cWCWhrGRCCWnliT1U7+iMQL5Qjb+x45CPATEcqcolM0VOh9crJ8PsTet0W12dJvtzKpG 6EXabIWFHiRsV6N+dKvAOe8E64xC+XfGwfwW+WcNSzbnm2u/zGPua+8VPIMREne/TfBo q6TQ== 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=ejSGmzKi8yOJXrP8xmGu9NmM/5lE3B8zIrb30U/0RJ0=; b=kyIuHh2f6X8wf7Q8FoBddPn2R+5vqevmMphIoVCb1p+kC973JU5FQJIsyvR6l5Yvaj Xvn/y+DFH/eqYih1urkMDdaqqo+9CP7BhXp6ph2hh0PhGu0zkjByrIVddyIDq2dDwYnl 2nBbnSOcLwVF0WVbfVFD28j3OKxP3F/gyjl30Du38/KO/BX0vbJ1Nn3oHC9K0Hyqagf7 DeKaFK+CMAo3a6I9bMTDLwmdJiAzHiKyMWpUa69ScLoMhgqUSEZF1sy+0TwnVrHkzNhg 7fuqk3f8nLGne9Fz01eaW3U2YavRI8+pfnbn0xBCbh0jdX/aHQmJjtisuZTwVyNpZ0iL Qcyg== X-Gm-Message-State: APjAAAVNCwaxKArh65LY5/uFYDVbxLcGbEBfAgwqyrX4jj27ZxjTdUaS 7V+Ei1yoGksen0ETuB/DmZuYQQ== X-Received: by 2002:a1c:49d5:: with SMTP id w204mr1922093wma.111.1571985450983; Thu, 24 Oct 2019 23:37:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l26sm455009wmg.3.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 045201FFCF; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 56/73] plugin: add qemu_plugin_outs helper Date: Fri, 25 Oct 2019 07:36:56 +0100 Message-Id: <20191025063713.23374-57-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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: Aaron Lindsay , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Having the plugins grab stdout and spew stuff there is a bit ugly and certainly makes the tests look ugly. Provide a hook back into QEMU which can be redirected as needed. Signed-off-by: Alex Bennée Reviewed-by: Aaron Lindsay -- 2.20.1 diff --git a/include/qemu/log.h b/include/qemu/log.h index b097a6cae11..a91105b2adc 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -45,6 +45,7 @@ static inline bool qemu_log_separate(void) /* LOG_TRACE (1 << 15) is defined in log-for-trace.h */ #define CPU_LOG_TB_OP_IND (1 << 16) #define CPU_LOG_TB_FPU (1 << 17) +#define CPU_LOG_PLUGIN (1 << 18) /* Lock output for a series of related logs. Since this is not needed * for a single qemu_log / qemu_log_mask / qemu_log_mask_and_addr, we diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index ddf267fbfe0..a00a7deb461 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -384,4 +384,10 @@ int qemu_plugin_n_vcpus(void); /* returns -1 in user-mode */ int qemu_plugin_n_max_vcpus(void); +/** + * qemu_plugin_outs() - output string via QEMU's logging system + * @string: a string + */ +void qemu_plugin_outs(const char *string); + #endif /* QEMU_PLUGIN_API_H */ diff --git a/plugins/api.c b/plugins/api.c index 5adc4d25a1e..fa1d9f276d3 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -331,3 +331,11 @@ int qemu_plugin_n_max_vcpus(void) return get_ms()->smp.max_cpus; #endif } + +/* + * Plugin output + */ +void qemu_plugin_outs(const char *string) +{ + qemu_log_mask(CPU_LOG_PLUGIN, "%s", string); +} diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 267ec381b4a..4bdb381f48e 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -36,4 +36,5 @@ qemu_plugin_vcpu_for_each; qemu_plugin_n_vcpus; qemu_plugin_n_max_vcpus; + qemu_plugin_outs; }; diff --git a/util/log.c b/util/log.c index 1d1b33f7d9f..1ca13059eef 100644 --- a/util/log.c +++ b/util/log.c @@ -273,6 +273,9 @@ const QEMULogItem qemu_log_items[] = { { CPU_LOG_TB_NOCHAIN, "nochain", "do not chain compiled TBs so that \"exec\" and \"cpu\" show\n" "complete traces" }, +#ifdef CONFIG_PLUGIN + { CPU_LOG_PLUGIN, "plugin", "output from TCG plugins\n"}, +#endif { 0, NULL, NULL }, }; From patchwork Fri Oct 25 06:36:57 2019 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: 177660 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3277242ill; Fri, 25 Oct 2019 00:24:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqz/jZbL5sG4iyAvatJGqoGTfMlTWsm9mv99PSoTv5aMlqKnXTcuq7WNKEqakkDZD1W5rKmr X-Received: by 2002:ac8:5310:: with SMTP id t16mr1674408qtn.258.1571988297185; Fri, 25 Oct 2019 00:24:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988297; cv=none; d=google.com; s=arc-20160816; b=dNYyTDDnt/Ifmhio6QzhAMKX63Cv//gKP5UGwa5epFC8ox7HCB3cchqRWUxa8yQ4kV rAj6hunGJJ1gNwukSJQL74bSt9gIVVC3cTb6u+bdgczo09m+ikz3Hp3Dl5mJutfgazAh YdoXcOej8fPRv2OYI2ru/JBs7w5jyY9Pyyiwmm8xfVwHQW/SZ1hVPTxDP70SkBPALm5i eV4x12jZJ3GsVqMmN9bNWXzdvEvp5cgS9iRnxfRfX2kSlkLglL0C6TcqHpkJ9AJj82RS pv/DyDE7YrrbgcIy/iTtmj3eTrLlGEOn+Asw1oywl/trlK4z+DGinjpYS/cu8VPZ13+r 6jGw== 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=K+n/Y9KbSccr2r/DGSz0DXS7y2h6ZtZ3F8obFCMz1Mk=; b=w5CIF503zoxwy9YjR9vJbwuaYQ7XdW8VnzI1YVIh3UGYNvy80iUIsZ61cN0pQBytC/ o1y4sPJVsdXzlTSbTgC3rFEAwXZG5y90ohr+IrqxlVAr5jsNJEdDYMDRgB5cdYg6cjq+ Ss/eGSJdKca+G0Ewx4vV8h9/2eP6e8yr5Ga+xqBkBe3zKpalj9K1fR5iLvER977PNZya U4qMJG0qpg5g1PMmGKKhyCn7KXwispC/PyyeYDF08R6i5vpSL1Sb6gB3tVUZ+iuGKK6e r635K5q4R1hoq6k+e5QS/Axl8/WVyCPnG/oluUbBbgDpzk2hCJ/NnfEbEHZITZmHEmPg xyCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=miyvIiyn; 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 m28si748775qta.349.2019.10.25.00.24.57 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:24:57 -0700 (PDT) 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=miyvIiyn; 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]:56726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtxw-0002Cj-8L for patch@linaro.org; Fri, 25 Oct 2019 03:24:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37078) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN8-00088T-60 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003HN-Rd for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:54 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:42586) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN4-0003D3-MZ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x436.google.com with SMTP id r1so925634wrs.9 for ; Thu, 24 Oct 2019 23:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K+n/Y9KbSccr2r/DGSz0DXS7y2h6ZtZ3F8obFCMz1Mk=; b=miyvIiynGwz+WCOYGSj8NCPrBieuW4m1B2oZ9XIqGsAZh7/u8EkpIxqlfsWtfyBcdW b7CDLmZgPFMF3nxKbohzZb6Vnu54lszi0+qnf7sw+KFPboOZjEMDmhc5Jp58DPm9L0LF ixKpRhKsKTpPiOl+FBvRj1uKFKbyYIuAK0Czdvd+28irBI3x2y38hDtqnsf0uqteXNnL afrD74r3RNK+t6r5bYS5jDn61YPRVIYqj0QC7vdI1bAEIRKAFHzZOP6gUwyGeP4jGhCL h4lfTWyd/N5+IM6zXDgl5jzrqNOK4sRHWUKZEbmVGaUC+5qj+/MamTYmi8Egp0hb6xyR IY6A== 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=K+n/Y9KbSccr2r/DGSz0DXS7y2h6ZtZ3F8obFCMz1Mk=; b=qmDQTaIZlvEY+219Wc2ji7P2qU7L8mByEELqCpiY8pqLwkDRzk8bgsn/bK95fsdNYP D1w12FkcjnN83ObAAAwIqITXNCY5WM7YNto/KtYuSMIMHVLb/evAMSCj8AoiN1NCxRUn lPf/E3nMKdJxUZOIsmMS9Ct5a3KAAO0mXQ3SGaSf0lfaDN75Fv5pHgnxoGCQ5lwmxLZl tgLy5KCVqmentbPxTWFXlBbpNqixyzZ3F6xSCcMon3EbcFuUqIgRrFdSH4NQ6V5fUTrq D2Ev+GEjUX9qXHRnb6j4i6HsJyo+kbM8D4JTX+Cfoj1DBQ9KOEkDQIEilpCO+ZUJKFnU FEog== X-Gm-Message-State: APjAAAWmk8mYNZVzS6F/t6kTNicgq/FGTyTKupKlBQB1UXmxWzUt5F5V bN7W/YottEZ/PNpX2Ub0kg9QlELrbNE= X-Received: by 2002:a05:6000:343:: with SMTP id e3mr1393355wre.20.1571986006167; Thu, 24 Oct 2019 23:46:46 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e12sm1352654wrs.49.2019.10.24.23.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1B0BB1FFD0; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 57/73] vl: support -plugin option Date: Fri, 25 Oct 2019 07:36:57 +0100 Message-Id: <20191025063713.23374-58-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: Richard Henderson , qemu-devel@nongnu.org, "Emilio G . Cota" , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Llu=C3=ADs_Vilanova?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/qemu-options.hx b/qemu-options.hx index 996b6fba746..fb6df45193f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -4181,6 +4181,23 @@ HXCOMM HX does not support conditional compilation of text. @findex -trace @include qemu-option-trace.texi ETEXI +DEF("plugin", HAS_ARG, QEMU_OPTION_plugin, + "-plugin [file=][,arg=]\n" + " load a plugin\n", + QEMU_ARCH_ALL) +STEXI +@item -plugin file=@var{file}[,arg=@var{string}] +@findex -plugin + +Load a plugin. + +@table @option +@item file=@var{file} +Load the given plugin from a shared library file. +@item arg=@var{string} +Argument string passed to the plugin. (Can be given multiple times.) +@end table +ETEXI HXCOMM Internal use DEF("qtest", HAS_ARG, QEMU_OPTION_qtest, "", QEMU_ARCH_ALL) diff --git a/vl.c b/vl.c index 4489cfb2bb6..8b1b4133e49 100644 --- a/vl.c +++ b/vl.c @@ -110,6 +110,7 @@ int main(int argc, char **argv) #include "trace-root.h" #include "trace/control.h" +#include "qemu/plugin.h" #include "qemu/queue.h" #include "sysemu/arch_init.h" @@ -2854,6 +2855,7 @@ int main(int argc, char **argv, char **envp) bool list_data_dirs = false; char *dir, **dirs; BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); + QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list); os_set_line_buffering(); @@ -2884,6 +2886,7 @@ int main(int argc, char **argv, char **envp) qemu_add_opts(&qemu_global_opts); qemu_add_opts(&qemu_mon_opts); qemu_add_opts(&qemu_trace_opts); + qemu_plugin_add_opts(); qemu_add_opts(&qemu_option_rom_opts); qemu_add_opts(&qemu_machine_opts); qemu_add_opts(&qemu_accel_opts); @@ -3678,6 +3681,9 @@ int main(int argc, char **argv, char **envp) g_free(trace_file); trace_file = trace_opt_parse(optarg); break; + case QEMU_OPTION_plugin: + qemu_plugin_opt_parse(optarg, &plugin_list); + break; case QEMU_OPTION_readconfig: { int ret = qemu_read_config_file(optarg); @@ -3991,6 +3997,11 @@ int main(int argc, char **argv, char **envp) machine_class->default_machine_opts, 0); } + /* process plugin before CPUs are created, but once -smp has been parsed */ + if (qemu_plugin_load_list(&plugin_list)) { + exit(1); + } + qemu_opts_foreach(qemu_find_opts("device"), default_driver_check, NULL, NULL); qemu_opts_foreach(qemu_find_opts("global"), From patchwork Fri Oct 25 06:36:58 2019 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: 177655 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3269342ill; Fri, 25 Oct 2019 00:17:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS5unYjJ8C8d6fnOKs8nS4iDFZ2WtX4h9/uZZVpLbWRdN9NK0PnYvxztqrkea9AKaboiR5 X-Received: by 2002:a0c:9adf:: with SMTP id k31mr1864678qvf.126.1571987834482; Fri, 25 Oct 2019 00:17:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987834; cv=none; d=google.com; s=arc-20160816; b=A5iPftZOU05SV/Mxk3QxOmUvElDKNQSpsw+Q2C9HjQc6B/HU+n6s2Pe+CYllHIX7SZ HETIdn6iXDwSDHmgACPntYU1c1GSpyt5nb4Z4MoCmoNwmtpOwLceOQa8NOBM5Hg2bG1b KXwtdwUcdx5bFVO7Gvs6+IJMNZBO8MLVlZUf+JE4TsRun59BHUVKl1YDrhIIB0s6ZYzq lOqojxKRgFj05A3vzU630yNMIi4exZ6EcCWbAVty1TSswodvBVdwnPXBPgfm6EMnJvhT bo53dfBO9vmVB/RuWDgqw30X2SJE2c0BBaZcKb3Tg+VyMTRRK1qAiscTH/rjkhX7Jrv0 bPLw== 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=iCdf3P82phD9cLVEW6A0PP5pJmmTk2IWDOwxH2phJBw=; b=HE8pH84qGcUGFCQBmSn05D+eDfDtWF4WT5zxDa8IgicCt3WVM7x7XH1t1pOXXoyQ2J Y4ywoorx57lfiSrbGn54+9aNLuRDnSPuwqs81VYWywaneuk39gwbKuQo3yr7Wxa7jtHH wamkcq/PvagNteuNdcDfUEiv9zeKdgSAzgrRN0PzgeUnXN4O6i9VRh3Bk6lHYM4XN4Hi lsI8fBpMTIxTBJ6oMNXCSg1LKu6njs3A4BTU58Tjn7QlNuWGb9rQOs1PSBze+XPYtUtz L9x5yjQIHuMV5r72JRN9fWDRtvpodDDc6Rc5txNu0KV4NhV/YnVBaR96zJPneihUT4hl aKyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="P/uo3G+x"; 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 bx17si829421qvb.80.2019.10.25.00.17.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:17:14 -0700 (PDT) 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="P/uo3G+x"; 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]:56518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtqS-00049z-W4 for patch@linaro.org; Fri, 25 Oct 2019 03:17:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37104) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN8-00089g-U9 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN7-0003IV-KF for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:54 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:54513) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN6-0003Cm-Jf for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wm1-x32c.google.com with SMTP id g7so778259wmk.4 for ; Thu, 24 Oct 2019 23:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iCdf3P82phD9cLVEW6A0PP5pJmmTk2IWDOwxH2phJBw=; b=P/uo3G+xBuax0OH+AqwxRCHg2F6MbPdJClHZ68Q34hwsPmTMKFpQHZMe3gnPWLIZVv 84l4Pgwh0HrepgBrI4AgC+7I6vupapCGWDeTi3AS6azb97RVLEVBmmud5AsBXIn95CAy 1YTd30xobH9CPRYcwZudGLeBhMtzA7ZEIUSquvGdtXn6QdV2iz2sqZjSYeWBuOv/OkUk XfJ2N7PjyAXER01NmDgW9WRrmLZEo0If73AqXSpOv9CuM+UZ+l+sS5B1u6u46Ti1dFCD q14Ek2AkBg3nYvmrMsz42ffBQbW8RAlXWUGDhBKBtkDKjl9+IaEb7PTHkbseK5FJ6+3T TOAw== 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=iCdf3P82phD9cLVEW6A0PP5pJmmTk2IWDOwxH2phJBw=; b=IaxRdgLbmubY/yRavAkTyexwomsnsuIn9L/+9YvUPzKkvPkUPlXKSlMI4AHDfrC5gv T0YU3seLnLvzWbuuxTBEB0dvqrPoxSn5wU46RXHcV2aNYAwPIbKufITtn0M01gCDgPtY Q/T6zTltNLfmW8nH3fNqZBaaQmgoLkUsJkGuV/T/6019n1vbZ2sM4CPF/2yC2jPhcOl7 ls2Ko5WmuKho3B1ZmyYSwiKiAbRhWe+XGYnvUDNrm71yMUmWdFn5pNlKWNNumj1s1opk DNcTitEJZ0W34C3tr0rVmuGgKfeoTMBq3J1eSqyjGONb+ZMxaSUyDzCtVW0vxo94w1mR lx7A== X-Gm-Message-State: APjAAAXuPolUzgIN3CyKa/GKt5p46ERFeODQXlfpsU8gWLELk9TIMSmL Uh9uCLicc/phAuGTfbaeTM74uQ== X-Received: by 2002:a05:600c:2943:: with SMTP id n3mr1804990wmd.11.1571986005504; Thu, 24 Oct 2019 23:46:45 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w22sm1170795wmc.16.2019.10.24.23.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 31ACC1FF91; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 58/73] linux-user: support -plugin option Date: Fri, 25 Oct 2019 07:36:58 +0100 Message-Id: <20191025063713.23374-59-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c 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: Riku Voipio , Richard Henderson , qemu-devel@nongnu.org, Laurent Vivier , "Emilio G . Cota" , =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , =?utf-8?q?Llu=C3=ADs_Vilanova?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Lluís Vilanova Signed-off-by: Lluís Vilanova [ cota: s/instrument/plugin ] Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/linux-user/main.c b/linux-user/main.c index 560d053f724..6ff7851e86f 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -34,6 +34,7 @@ #include "qemu/error-report.h" #include "qemu/help_option.h" #include "qemu/module.h" +#include "qemu/plugin.h" #include "cpu.h" #include "exec/exec-all.h" #include "tcg.h" @@ -398,6 +399,15 @@ static void handle_arg_abi_call0(const char *arg) } #endif +static QemuPluginList plugins = QTAILQ_HEAD_INITIALIZER(plugins); + +#ifdef CONFIG_PLUGIN +static void handle_arg_plugin(const char *arg) +{ + qemu_plugin_opt_parse(arg, &plugins); +} +#endif + struct qemu_argument { const char *argv; const char *env; @@ -449,6 +459,10 @@ static const struct qemu_argument arg_table[] = { "", "Seed for pseudo-random number generator"}, {"trace", "QEMU_TRACE", true, handle_arg_trace, "", "[[enable=]][,events=][,file=]"}, +#ifdef CONFIG_PLUGIN + {"plugin", "QEMU_PLUGIN", true, handle_arg_plugin, + "", "[file=][,arg=]"}, +#endif {"version", "QEMU_VERSION", false, handle_arg_version, "", "display version information and exit"}, #if defined(TARGET_XTENSA) @@ -643,6 +657,7 @@ int main(int argc, char **argv, char **envp) cpu_model = NULL; qemu_add_opts(&qemu_trace_opts); + qemu_plugin_add_opts(); optind = parse_args(argc, argv); @@ -650,6 +665,9 @@ int main(int argc, char **argv, char **envp) exit(1); } trace_init_file(trace_file); + if (qemu_plugin_load_list(&plugins)) { + exit(1); + } /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); From patchwork Fri Oct 25 06:36:59 2019 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: 177635 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3250529ill; Fri, 25 Oct 2019 00:00:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyfCsVTft0t/O7O5MKJm4/wu1dHtOGxyIOLTgTKZS7pcPFdXL5OQcCF3k7Ftr1bMfNC3idq X-Received: by 2002:aa7:d955:: with SMTP id l21mr2174043eds.179.1571986808030; Fri, 25 Oct 2019 00:00:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986808; cv=none; d=google.com; s=arc-20160816; b=C4IdXIEonHRJzqnmqi9jX1WJ9VULs2ioRFjhk7JqwOR/VDhhvDUf608UxWznToOyhi 3JwQvSVDNjlRbPifGtB32Pgyq/7EWGrbGemLUn8xUL4Q5wfEeB+gRtgNomsZoMhCJ7Fu YSzTq/Y29cHJzHS53RmwVZJvRF/Ekd/dZosgjC1eSRIa7ehU3JtfLC8V5tW3YwxN6LRM pqiMsIBQYIzfEPqPQcObOBMpvDMtNdldgRDbeEKiOSKKDjsn271oTxFX3tRV/XZ7sBoX ZdCmHIOTBBqOPVwytbWTp49KiivGtGhaatw8/rIj5z9gMcb84nYBqpXvE336DePGvfXi 8WVQ== 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=J5mwez8/3JgAsIrNmKybl1GLPKvB5P922l8oGG8eRMA=; b=IqbPDimICPdmfoWsH7NPTWy6bNvCqa4HskPd26/o2cyaGAmll6xpPYjdrkAo7ok2C3 oJkWvLGC6tlrnsXBcLZgyE74JTHoS5mn5GIUM/hkTuUadUsyPeawYJRXmoO5dsN1cTRH /z9umubmomc9W4mXwXk2kXzgBmp5ICdAMwsiaYdfPU2e0KP8ULaeQB4ObmEw9zuMrXPc 1Nb/dYMAnpaYQ8i7y0risiv3K15ByP5qGiVx3wbl6xrF7ORZHgksMqnEnuNVZqHaOwGP YOZUDBU8Z952xyNZl3vjgHjmPxP+vtSZd7Fh/TxQJeyfrs4snfXoqktdcyRV20hRxNs4 Xh5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="E9w/5TQU"; 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 qn26si628340ejb.395.2019.10.25.00.00.07 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:00:08 -0700 (PDT) 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="E9w/5TQU"; 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]:56286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtZu-0002VL-1s for patch@linaro.org; Fri, 25 Oct 2019 03:00:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35684) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE9-0003UE-45 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE7-0008UV-60 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:37 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:42521) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE6-0008Ts-VJ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:35 -0400 Received: by mail-wr1-x430.google.com with SMTP id r1so902161wrs.9 for ; Thu, 24 Oct 2019 23:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J5mwez8/3JgAsIrNmKybl1GLPKvB5P922l8oGG8eRMA=; b=E9w/5TQUAp6jdk9+CbKxG5Yl3oW0bD4ZX/SSnleoKdOGiIngdaGCBdMwHBs57YW5U2 fqyjfTmUwGRaXGs5PwUt65uGnxGJfsLGj2LCTW3bxGaPEaQr57trc9jFODJ3FaGEFchS 0zvNJmhx6rx6dpvJ4vNkH44ImH++DkBosSCGfn0XsbMvkKB0nnpulk1OrZZ8VDm2ZotU q6Z6G/pgCrhGxwcDALw3/sIjj3pZAnrigfbSbeLgi1FdCEZQvMTTHsB4O7nnr42VxHXL /J7PCYHt1o/AvwnXgn3qXpNdsA6vmzbPI2655vORAUnlMtacskeNXxQBEa11rIge3DvE NvzA== 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=J5mwez8/3JgAsIrNmKybl1GLPKvB5P922l8oGG8eRMA=; b=rxvK5chselQU4VbG2UeZBn9axGcCTYA5BX8UU7pUiaQ8UrCihsyIyRmz2COFprQoJB P1n8t8AJbIrw5uopQavYfC5AaaAnC8cfn3LVYr8bH1aY2o+XQJxg//8AGVB8aPKZ9HQq DQIxzYKpgc0IXP+fJfLOn5L7ckFiFtOG0pLAfbEJdb3hKKnaFYQqpsJA33tZOGYDXe4P H2r6VPSY8X4PZUovTNu7Ca8EYHfYH4qboazDzGBPy1lXG24S6PV1CaUUZ7HReno5C3Qa zeamQA9dDpJURvLZib24RrhVM8z8WSp6XRL5oOiiU2GAyILCKxe7WLVraFCK5gC4xj90 Rfqw== X-Gm-Message-State: APjAAAUht/FPiVpz3AQIbUFKz2DuxtHnbGwkOmRyA0EwUiT/GFx0iDDH kJqI/nz8Pj8n6Rn7YcrdzQs1XQ== X-Received: by 2002:a5d:4808:: with SMTP id l8mr1268388wrq.118.1571985453718; Thu, 24 Oct 2019 23:37:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h205sm1147080wmf.35.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F65E1FFD1; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 59/73] tests/plugin: add sample plugins Date: Fri, 25 Oct 2019 07:36:59 +0100 Message-Id: <20191025063713.23374-60-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Richard Henderson , "Emilio G. Cota" , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" Pass arguments with -plugin=libfoo.so,arg=bar,arg=baz Signed-off-by: Emilio G. Cota Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/configure b/configure index eabe84af6ed..f77c4dc09a6 100755 --- a/configure +++ b/configure @@ -7903,6 +7903,7 @@ DIRS="$DIRS roms/seabios roms/vgabios" LINKS="Makefile" LINKS="$LINKS tests/tcg/lm32/Makefile po/Makefile" LINKS="$LINKS tests/tcg/Makefile.target tests/fp/Makefile" +LINKS="$LINKS tests/plugin/Makefile" LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" LINKS="$LINKS pc-bios/s390-ccw/Makefile" LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile" diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile new file mode 100644 index 00000000000..f9a3546ea32 --- /dev/null +++ b/tests/plugin/Makefile @@ -0,0 +1,28 @@ +BUILD_DIR := $(CURDIR)/../.. + +include $(BUILD_DIR)/config-host.mak +include $(SRC_PATH)/rules.mak + +$(call set-vpath, $(SRC_PATH)/tests/plugin) + +NAMES := +NAMES += bb +NAMES += empty +NAMES += insn +NAMES += mem + +SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) + +QEMU_CFLAGS += -fPIC +QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu + +all: $(SONAMES) + +lib%.so: %.o + $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) + +clean: + rm -f *.o *.so *.d + rm -Rf .libs + +.PHONY: all clean diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c new file mode 100644 index 00000000000..45e1de5bd68 --- /dev/null +++ b/tests/plugin/bb.c @@ -0,0 +1,64 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include + +#include + +static uint64_t bb_count; +static uint64_t insn_count; +static bool do_inline; + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autofree gchar *out; + out = g_strdup_printf("bb's: %" PRIu64", insns: %" PRIu64 "\n", + bb_count, insn_count); + qemu_plugin_outs(out); +} + +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + unsigned long n_insns = (unsigned long)udata; + + insn_count += n_insns; + bb_count++; +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + unsigned long n_insns = qemu_plugin_tb_n_insns(tb); + + if (do_inline) { + qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, + &bb_count, 1); + qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, + &insn_count, n_insns); + } else { + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, + (void *)n_insns); + } +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + if (argc && strcmp(argv[0], "inline") == 0) { + do_inline = true; + } + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/empty.c b/tests/plugin/empty.c new file mode 100644 index 00000000000..3f60f690278 --- /dev/null +++ b/tests/plugin/empty.c @@ -0,0 +1,30 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include + +#include + +/* + * Empty TB translation callback. + * This allows us to measure the overhead of injecting and then + * removing empty instrumentation. + */ +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ } + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + return 0; +} diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c new file mode 100644 index 00000000000..e5fd07fb64b --- /dev/null +++ b/tests/plugin/insn.c @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include + +#include + +static uint64_t insn_count; +static bool do_inline; + +static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata) +{ + insn_count++; +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + + if (do_inline) { + qemu_plugin_register_vcpu_insn_exec_inline( + insn, QEMU_PLUGIN_INLINE_ADD_U64, &insn_count, 1); + } else { + qemu_plugin_register_vcpu_insn_exec_cb( + insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, NULL); + } + } +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autofree gchar *out; + out = g_strdup_printf("insns: %" PRIu64 "\n", insn_count); + qemu_plugin_outs(out); +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + if (argc && !strcmp(argv[0], "inline")) { + do_inline = true; + } + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/mem.c b/tests/plugin/mem.c new file mode 100644 index 00000000000..d9673889896 --- /dev/null +++ b/tests/plugin/mem.c @@ -0,0 +1,97 @@ +/* + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include + +#include + +static uint64_t mem_count; +static uint64_t io_count; +static bool do_inline; +static bool do_haddr; +static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW; + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) out = g_string_new(""); + + g_string_printf(out, "mem accesses: %" PRIu64 "\n", mem_count); + if (do_haddr) { + g_string_append_printf(out, "io accesses: %" PRIu64 "\n", mem_count); + } + qemu_plugin_outs(out->str); +} + +static void vcpu_mem(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, + uint64_t vaddr, void *udata) +{ + if (do_haddr) { + struct qemu_plugin_hwaddr *hwaddr; + hwaddr = qemu_plugin_get_hwaddr(meminfo, vaddr); + if (qemu_plugin_hwaddr_is_io(hwaddr)) { + io_count++; + } else { + mem_count++; + } + } else { + mem_count++; + } +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + + if (do_inline) { + qemu_plugin_register_vcpu_mem_inline(insn, rw, + QEMU_PLUGIN_INLINE_ADD_U64, + &mem_count, 1); + } else { + qemu_plugin_register_vcpu_mem_cb(insn, vcpu_mem, + QEMU_PLUGIN_CB_NO_REGS, + rw, NULL); + } + } +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + if (argc) { + if (argc >= 3) { + if (!strcmp(argv[2], "haddr")) { + do_haddr = true; + } + } + if (argc >= 2) { + const char *str = argv[1]; + + if (!strcmp(str, "r")) { + rw = QEMU_PLUGIN_MEM_R; + } else if (!strcmp(str, "w")) { + rw = QEMU_PLUGIN_MEM_W; + } + } + if (!strcmp(argv[0], "inline")) { + do_inline = true; + } + } + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} From patchwork Fri Oct 25 06:37:00 2019 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: 177645 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3260108ill; Fri, 25 Oct 2019 00:08:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqzl6wKXRnVOANFqYzYGiUzwkdmGJOBWrrZE9ugMrDoPcjk04UuAc7qPpAqSfTJshWYSpkh2 X-Received: by 2002:a17:906:f2d4:: with SMTP id gz20mr1935998ejb.215.1571987317813; Fri, 25 Oct 2019 00:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987317; cv=none; d=google.com; s=arc-20160816; b=RyjeiQgVhds+TCOvLRuX70P96rAs7Y0ckEZZHKka2y/JaovW4IcwyvjHSCMzx9xPPi nQpkILgy3+SOC1rSfgbgzHt0xo+ccPXQ6WTYMKUr+3/ataGas5/2XFY46F1/ImUMbPAi 8yUtlr4pJ8TN2BVCrbZSdStpASa1ENfbdWGFotq9dAnW9FWUQxFdIuo/krji55fsrCwG AJJo6uTiw6u0SQDhcNrWs0zOK3hUq1FyXhKfDq7Y0109KBoV3fA3sHqADMUfeU4UBlmV jSuTbWVODNQiiqD34BQj7WUffxB7d2tjI0x2fvS9riVYXnOFt0ZFQVz812/rI15timB0 SVxA== 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=QA5G0ge3KbQ5Y8JeR92unhUZGUgp9+560bkXJZMuTD0=; b=dnq69QOHbGJIp89n/eiRKtUjwDZnzxJ0XwivcWRkHMseLBuLZ2hCRnS7GBm4OVN1BV /bTKSeC+lW+L+RDweZ3C/aEkolmoxbjAyD8+1o5BESoTIUixsV+h7oINOHic03sxsO5/ vuNlsk2CSVQSErGInqSTqEgaAIzS2ZcA5FSad+que/FpileE4vVIamwfedxQVKyt2IaA EpC4BWKmP/BbmuiqzbqX1Xx5rlcCB5sl+bxXZ0i+bhvDcP+Wyf26DMT7IuOTh0QTKtxP Vfk05XopJvJ6rru72lBxXhJvCAo9r85JIFo+7p4sHSPsQfLvyz7aFsRbgctwwh+sKBCW wOxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Yo4BbSSX; 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 h18si650882edh.352.2019.10.25.00.08.37 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:08:37 -0700 (PDT) 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=Yo4BbSSX; 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]:56412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNti8-00063u-8S for patch@linaro.org; Fri, 25 Oct 2019 03:08:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37022) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN6-00087Z-OE for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN3-0003FS-NH for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:51308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN1-0003BY-3c for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:47 -0400 Received: by mail-wm1-x32e.google.com with SMTP id q70so791004wme.1 for ; Thu, 24 Oct 2019 23:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QA5G0ge3KbQ5Y8JeR92unhUZGUgp9+560bkXJZMuTD0=; b=Yo4BbSSXTK1PTS4yl4y+dRwdUrZPXgJgxer4b+zLf+3PFiQCDUMvrWBAyIEYJXTlu2 Yn97U9G3aXlOnZOmmW2rDQKtAM43qXJI3bMyTp7FqsAF4tVy6Op5qYk1ERZLzZ+cqBLP uHTdf6AugNRX9cqvFHj8kbvkS9+D5y0G2Fe5PFgVOYmFlM3k16aBY2Rq0uKSl3rtw9vi UUuy9bXgaashurFVGjLoNLYbUzMp25BEb/KlPMgcJdDNv4ErwM3UwZb3MJpAeduS4ocS pLc66O6XLwVD9NWjEf0sEe2o3Yz0vz87jGE8feiqzvur6KF/fP0hGvM8T6rt17OeM/tv 6SSQ== 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=QA5G0ge3KbQ5Y8JeR92unhUZGUgp9+560bkXJZMuTD0=; b=CMaae4myoq9ibI4DbP/2tPo64EKw9l8d7lmbRDXDQPuO1YFYQhtsRkGGRh80lvB56m GLKThIr0e+1ZG1xMZjeV2rgwaw+jjp2oCdeWW6rgQdr0Ei4Cx7n32zCeVZlB344I+/On +rpnOReocP1A0YyUAZZQv2bCFAX+t+TwMXNWhbH9gKV+UPGE/hvGzWzSm7O0bx/IAuTo me3Q4pxamzhAKcadv/1xY6NyN3H26LyoqROIbKlPzaXZn2DZLROKC9ZMgxoMuzsbTWmV wwfOq6vOlAIjXdBC2Nvnyw1fNrgSORspl788ao45Ilmh/oXduXZ7qtbMoqJw8Bpy7I+v decQ== X-Gm-Message-State: APjAAAXhv9CjhoroFEAGwQ/cpaW2jmaH6K3oX2j9l+2hXp1Y7TA9v8zQ F9fUQdY/gdGbu+N+WYvW+NwHag== X-Received: by 2002:a1c:3dc4:: with SMTP id k187mr1802621wma.167.1571986002300; Thu, 24 Oct 2019 23:46:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c8sm1074923wml.44.2019.10.24.23.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 62FE71FFD2; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 60/73] tests/tcg/Makefile.target: fix path to config-host.mak Date: Fri, 25 Oct 2019 07:37:00 +0100 Message-Id: <20191025063713.23374-61-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32e 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , 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" Since moving where the tests are run the path to config-host.mak has been wrong. This doesn't affect much but things like the time fallback for CONFIG_DEBUG_TCG and will also get in the way of checking for PLUGINS support. Fixes: fc76c56d3f4 Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 5a9a6faba4e..84abbd24f34 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -30,7 +30,7 @@ # all: --include ../../config-host.mak +-include ../../../config-host.mak -include ../config-$(TARGET).mak # for including , in command strings From patchwork Fri Oct 25 06:37:01 2019 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: 177663 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3278157ill; Fri, 25 Oct 2019 00:25:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHimkbVHH4WNFtbAUjIcM5N+twS/jX38/aEgk1wkm26OGRVYeixyNL0YiLng2L7tp5S30N X-Received: by 2002:ac8:705c:: with SMTP id y28mr1729257qtm.52.1571988356771; Fri, 25 Oct 2019 00:25:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988356; cv=none; d=google.com; s=arc-20160816; b=ucQJM2ZHXRmjML8En7x9b8/WsMiqgh6Sk6CW9/vlH5UKXzNxXCYV9DZASTM8XPz4Pz jrUoJFS6FJZ0BO12HvU3tS9zgaEdR9N3i4Lmkyl57vv4+4VB8JkFzqqXQpdMSOU8tcvF Idr1LELdd/PgOJizjNvmKDUXW+glroDCrbQ9NYY5NRRUGL9QejCELK1JNV6j6veC+DWP 3goXYSZbgfjqPIPYPIFn8xoD0FJY31PgupLZ+8NETbjp7cmn2EX+qDUobEv20uHsdw34 xySpZzpgunez7YVq6lfT73IyyyzXvYo1j9KSS+7pOFvYXlknSE08x98b88GjXhcgAfNW ZZtw== 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=oU5dDnk/ix9jKreAwN5NeNPxvAcZF9bkPDrfgoNnBe0=; b=AQVAE3kA9qx61lMWwG9Q9hS4W3OwkNtENOFO1UiVai9cXPiBS2a8iUBAaQW4DC2IL5 m1rtB/TebRGveBeUtu+YDb1Tn4hMh1j1KtLHc834CDGvcsjZWyEKj/jWtY0Z2/wv2KwQ UaKwjHeBP7VxKNBUh6Qw4uZwG+BVkHrOZNuIK/2XVjW7wh6PzS/5tcVqDWEdhJb3nrlj pHuR+JwxTRhFhAxZ/16SXLwLdcrMVqudyFmE6un9SGB98z6BaLxXZjNYVW3iRu4/4l6Y OYhDLg3JaDUEo6Gc0R35Z02a9fP9SSey8e/eDaJBVjHMYIyyn8h/jJ2n9FTo/+Kh+SdV 1X2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RUiwI4If; 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 f23si833712qkk.112.2019.10.25.00.25.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:25:56 -0700 (PDT) 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=RUiwI4If; 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]:56746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtyt-0004gw-Vw for patch@linaro.org; Fri, 25 Oct 2019 03:25:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40436) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpy-0004f7-Ul for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpx-0007Dq-Ts for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:42 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:45070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpx-0007DU-O4 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:41 -0400 Received: by mail-wr1-x429.google.com with SMTP id q13so997227wrs.12 for ; Fri, 25 Oct 2019 00:16:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oU5dDnk/ix9jKreAwN5NeNPxvAcZF9bkPDrfgoNnBe0=; b=RUiwI4If+ugx8YioCNYq4bYplKIS0BE1k+l6Z7bxIaM81SMLBfwg0QPbQ8McyCMS0L GJdwN2fsSzyWe8w/iUowOkpixu1QnnO2XEwY1e8CNftoMYefU7ccyXKDJrGHceN77I/s PU1uieyIYjhex6L2uwqr1OJHa5bFJhnurbeJqXkhe3pazdS6twLDetTBGfZ2HBaZDj6a fUR3a/fr216ifNj0YrIpbQ1H8uZVdGNo8pJBUK+EJOWq0LnKUbjyfCUtWFb3aTF2T8vX PyLFkBWe3krBXA9gJ0oZRKyDuA/dpN4HN3yVMeDAM2UoFx4TL0e7XxrHusQRgFaBbdgf 8M+w== 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=oU5dDnk/ix9jKreAwN5NeNPxvAcZF9bkPDrfgoNnBe0=; b=HnZ6ELV1LKGvZ5i6Gg8+zYXuAO5IsgQNqYvmKUA/Rf++jJifakqvvigi9Gj7mwIrec u+qLck8/htBgNvRbkSjyDn7TPjdOoAs7CxOx1zHXcfFgOZgll82NmGfJFYCWDkXBrAAB Ba8ohqA2mtrY4SIHXScCsJ3qtihzOnnO2UaFcQXHmHmuNcn/ITE3vTzoIOssAUbl6Z0X PempyKyXgY6R/+3KJr9JvEinF21D1nTgcBZIdqrm7lE0TdqMnI1FspUpfTOcXnb1m8lm u1mK3dkyas/goic9+vpEsyEvgUbhjif5QBB+sinEt/ChFq+ANhy3IMjWi0C/pBEXV+Ji XgDw== X-Gm-Message-State: APjAAAXkIfexKNTgHzv5PcXUcjE0sCXS84D8qSuQ9LCNDVtXRAE21vo3 z7NTk7zK3UKd0GieJZHvqMh/k1vlRjA= X-Received: by 2002:a5d:49c9:: with SMTP id t9mr1484583wrs.146.1571987800568; Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x205sm1469280wmb.5.2019.10.25.00.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7925C1FFD3; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 61/73] tests/tcg: set QEMU_OPTS for all cris runs Date: Fri, 25 Oct 2019 07:37:01 +0100 Message-Id: <20191025063713.23374-62-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org, "Edgar E. Iglesias" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This will important for ensuring the plugin test variants will also work. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/tcg/cris/Makefile.target b/tests/tcg/cris/Makefile.target index c1173ead422..24c7f2e7616 100644 --- a/tests/tcg/cris/Makefile.target +++ b/tests/tcg/cris/Makefile.target @@ -47,7 +47,7 @@ CRT_FILES = crt.o sys.o $(CC) $(ASFLAGS) $< -o $@ $(LDFLAGS) $(NOSTDFLAGS) $(CRT_FILES) # The default CPU breaks (possibly as it's max?) so force crisv17 -$(CRIS_RUNS): QEMU_OPTS=-cpu crisv17 +QEMU_OPTS=-cpu crisv17 # Additional runners to run under GNU SIM CRIS_RUNS_ON_SIM=$(patsubst %, %-on-sim, $(CRIS_RUNS)) From patchwork Fri Oct 25 06:37:02 2019 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: 177659 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3272841ill; Fri, 25 Oct 2019 00:20:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxc6y5nMh4Re4QSkwgwEeNIi474XoCq5AzYOpv/wCdGIh6+lhacy2U0FibJTgcqucWQ5i23 X-Received: by 2002:ac8:2247:: with SMTP id p7mr1679803qtp.180.1571988035740; Fri, 25 Oct 2019 00:20:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988035; cv=none; d=google.com; s=arc-20160816; b=yQJCCQSG0++bHtMsZBr1u4eM3jA7nhykJ2vzHixx3O0xv5inywjrOLYIkpkZ/SG/Ut RG0mdiEtvQPnZNropaxWI1N2BE48AiLEapJCLBvzYf6HjcMVKwF6tYIabsCfMXirCPTF W9zkTTx9DZatLVpQVCFT5Bpzx2rCcA+9KJCrTC+BJ3zwkYle1UZw82u5D0Zwv7l8FtjJ SmEWLGadv+gVYiU4YIfhaKZtfGm/JMdeI0oruDiEbtRaSs4jHD7/QUmkrpIHSqAKj8Jc dhBfJtzoUi5LRdLclSwd2Txn4lOc5HiPBZEsS/Gusldx1yazPzngjAv4aHdB1wV+S/R8 8/Hg== 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=2XLQtBEPkvpVzS5Ez75TVhX7pL/ZQUgLE51dTOXWFNU=; b=UD6jA3OJlxEL2ZFyz9ZAfn0OQ7SBPQCtuw2TdaI90eoh9LCAuFb/RlzibuqDX8MhTA 9U7ib5DRUwIVQbqognQLDs+0eUqybKhyMi58CM4YfCyGrBrYy74qUeZOCIiBww+O2mGe AT+xXJbIEjEX5LmKGDFzkam8vjHqdCBFDnwE3oLoZABpUUAri4ApA5A8Ul1WN6NEZBoP sXaj6Esuxo7cyd9KM4oWYBSKqwhtGRN0d1rDlGMsb7hX06auJjrtZgwh/RfU3/NlSz6X oOTLEYNXkscG4sOHSFWnnLTQHHuf9ShJFWHqx8nCvrF3HYGAtCCfEkNGbZ86fxzyV3S1 YtTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nyV4MZO3; 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 15si815255qkc.173.2019.10.25.00.20.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:20:35 -0700 (PDT) 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=nyV4MZO3; 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]:56664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtti-0005mw-Lb for patch@linaro.org; Fri, 25 Oct 2019 03:20:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36954) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtMu-0007vv-7D for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtMr-00039A-EF for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:39 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:53000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtMr-00038R-5Z for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:37 -0400 Received: by mail-wm1-x32a.google.com with SMTP id p21so785936wmg.2 for ; Thu, 24 Oct 2019 23:46:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2XLQtBEPkvpVzS5Ez75TVhX7pL/ZQUgLE51dTOXWFNU=; b=nyV4MZO3nNsDVfHLDXfj2Tnr7ibZOA3RmPz13tl9YjAn5eN3nOQ5jptNpTLg8NNExX bl0MOzWrNwBJUNoLmbNcSDLuF9oBbIHJH9s8m/jCtrFTVTv9/SZvrD39TmVvur8FL4Fe B0QIXPGuyUp8uY0uLFKVN+mewOaMzcXQYX6UHgAPwuegwVgQbi4hHkR3ShZSdqQyAtZe +8rqUXf4xBYuqD2NkGoGbhD7JuTUPbaBjV9wcNsv7fplahYn10qnF/IPa0rZPrvlTYXO UUFRq2X560lFidX+vQcSYPghJBRxQBi+hGXGD2164nnYsYestnbWICnyZrdaWnXJO8HQ ceag== 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=2XLQtBEPkvpVzS5Ez75TVhX7pL/ZQUgLE51dTOXWFNU=; b=MU9GBWs97n15kkk0HSoE5o+4h/SHrq7J/144rrwOwAb4jWD2YMQu3McYgEFH05RE3k vdEXMz3VeTot+DzwRFL+fBCxDiues/aWLyRzszwTTQbVLHcjEkuCLJ9AyQsMpxzxTana FLxPJfJJJoqqjNA/PknEd8RPO2S9Ftm28ybh8qaqviRtO7amuCfQLDjeRHWeB35uxyqo 27Y4GREtfvW5W4WqnzBIxd7E7eInH7tE5xojzU8LC2jdyNTwHMHV1w7EIYTsEAUSN/Kw Zt/qNQ1uqW7xiZ9liVbwfwe+qEgz8a0j1CxAr/fn8y1ficjGmQN1qZ5fdV7/7CmCyh49 Noig== X-Gm-Message-State: APjAAAUUywQs/5xrPyPu5RYKdVeKdDhVSSaaaBVIfnqViqZOutYvqlqU +V1EO/570rRu38Wz5FNgaVaMgw== X-Received: by 2002:a7b:cd86:: with SMTP id y6mr1927646wmj.101.1571985995965; Thu, 24 Oct 2019 23:46:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x205sm1393092wmb.5.2019.10.24.23.46.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 909C11FFD4; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 62/73] tests/tcg: move "virtual" tests to EXTRA_TESTS Date: Fri, 25 Oct 2019 07:37:02 +0100 Message-Id: <20191025063713.23374-63-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32a 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: Richard Henderson , "open list:ARM TCG CPUs" , =?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" Otherwise clever expanders like the plugins test get unstuck. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 84abbd24f34..96646130020 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -66,6 +66,8 @@ conditional-diff-out = \ # Tests we are building TESTS= +# additional tests which may re-use existing binaries +EXTRA_TESTS= # Start with a blank slate, the build targets get to add stuff first CFLAGS= @@ -109,7 +111,7 @@ else endif -all: $(TESTS) +all: $(TESTS) $(EXTRA_TESTS) # # Test Runners diff --git a/tests/tcg/aarch64/Makefile.softmmu-target b/tests/tcg/aarch64/Makefile.softmmu-target index b4b39579634..950dbb4bac2 100644 --- a/tests/tcg/aarch64/Makefile.softmmu-target +++ b/tests/tcg/aarch64/Makefile.softmmu-target @@ -52,4 +52,4 @@ run-memory-replay: memory-replay run-memory-record $(QEMU_OPTS) memory, \ "$< on $(TARGET_NAME)") -TESTS+=memory-record memory-replay +EXTRA_TESTS+=memory-record memory-replay From patchwork Fri Oct 25 06:37:03 2019 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: 177695 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3302297ill; Fri, 25 Oct 2019 00:49:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwuNCTPMwwUfhcQFHtO7piLjDgwgky8z6Vt6XAKf/dxLwekIo88EwVoWRUFmu6UtmJzmANJ X-Received: by 2002:a50:e40c:: with SMTP id d12mr2368006edm.256.1571989758014; Fri, 25 Oct 2019 00:49:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989758; cv=none; d=google.com; s=arc-20160816; b=fXL+EvtyyGHE+1llJhFZId7PzRETBlA86lXXaE1ABze1H4yg83Fwm6Ev626segvvOh bk9C4MVBDDqhYWCIEHdA4uzA6E/w0FT/4Qp2lQkzctyrAmSlxx4RhrWvVLrjAVkJjHLp xQZ2aIzHqZnodQ89/b2lhaZ6pdHIGE+V7nR6CKPTHauKm9kJS46GtFnLLj2b89FSuSmM VDWCw5HRW+iA9nXIJr3VcC726F7Akhphxrigwps/yQbALJyQkl31oOBZGXLTxdoGmRWx iOYtXVk1xZtgdnvJPbSDmPDP0N+sDqmmx9uvIWZQ2deJM01uqPQOjWc983edl6tKIq0O ejNQ== 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=IM9AIEWFnWYr+dGlYuXtMUTbYXcPB6llDCtSge/S8fc=; b=pVmxMcGZlJ+LQwXpE5ATU4zy+mA4PvzhgGuuSFbbyXu+3AfUFTdb+mwfV983YQ9EBB A/BPTcgjUBn16JhzMU35f5Ky/N4E9IrmWRgkEkxt6uF6VzhLznny7zobPSxFjsn7ZJiK KktbT8PDK3fZQnCZ4dP4s3+21Lv+4Hjg/SXkSC5De4mj+6eHpuYQLjmfD4frK8J0tKpn tlLmt6Z/xtgvKsR0RXAzspE7yO62qEhxLsoR+cplxV9SWBjIIWsbiiVDnv0gsl6PRKCq i8fblJowoejTFZ/KUzSYtYoqUtL7s6jQSJg0ipaDMO3hedhF93aTSM7D6p9WGercw8tC guCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VIH2oiEp; 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 s46si799895edd.336.2019.10.25.00.49.17 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:49:18 -0700 (PDT) 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=VIH2oiEp; 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]:57124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuLU-0005kC-8n for patch@linaro.org; Fri, 25 Oct 2019 03:49:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38327) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWh-0003iM-Bb for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWf-0007pc-Uc for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:47 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:35240) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWf-0007pE-O8 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:45 -0400 Received: by mail-wr1-x431.google.com with SMTP id l10so983894wrb.2 for ; Thu, 24 Oct 2019 23:56:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IM9AIEWFnWYr+dGlYuXtMUTbYXcPB6llDCtSge/S8fc=; b=VIH2oiEp/wy3YZ5wZoh04MAH5xmvvzMudRNOAUaHimtCDcx0llxOTL/5HpwTAtRRHD idTArzv+gOiRqJ2xR08d+WHnhO7rTKinSPe2jQdsTCyc2zTzqzx5USw5cTxKxpwzXA/C uXyVD1xLDJk0+hmZCGDM1pFVKNPchBhxD4ds7UPXWAZb3f6Wv18BXa9h6lukoZJm5hqy vRruZgf/AuTwpm6vzq1oRfNW+9GwrmKxZrah9WsT1Dw5OB1mc/qCXBHAGbjHs/oVGECD ZXpl+B4Q/0/62YbTPK0mRmdmpywzTE5tKsZ/03+5fcMqUsyxfiPchDCZ4SCbZnnhtBKd mPhQ== 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=IM9AIEWFnWYr+dGlYuXtMUTbYXcPB6llDCtSge/S8fc=; b=HgMh2oeaRrxv5PgPazM57qp/ZR4frYMuLMfCHjIvlaC0S0fWQZMMxcPOXxidqdZMPk tcUGUQScvRwCuY9lyMKkyMuTfxl10GIIM5Ut16X7nX+y6tl9UzEEc2afWAL6uJFgI0x7 xe6qE/vVMaG14sZBq9wTbzJ2VljS98ttgeZkjriII8MVnaawEoNBPfYdHu4heb9SBoZY FmINOGGWetB/jbKLo0szED3YeJJkCHj4poYk1+8kLI7nxJsKMwY1HBh/CzbWdoaHdsUl BFcsXGta651vLBSKNVmnMD393J/gaX9+zDwmtianqLVfe8gpuwUoPqxIwAsG9ML22zTE b0Eg== X-Gm-Message-State: APjAAAWC9mEHfyN9a0bDyhYQFIP8dSmpUL2B8dWSTxRs6RYxr2/IAEfw Q7+RxBjfQsWe0M/hlAVo/LqfWw== X-Received: by 2002:adf:e882:: with SMTP id d2mr1405825wrm.132.1571986604620; Thu, 24 Oct 2019 23:56:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d202sm1278016wmd.47.2019.10.24.23.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:42 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A663A1FF93; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 63/73] tests/tcg: drop test-i386-fprem from TESTS when not SLOW Date: Fri, 25 Oct 2019 07:37:03 +0100 Message-Id: <20191025063713.23374-64-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::431 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 , Richard Henderson , qemu-devel@nongnu.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a very slow running test which we only enable explicitly. However having it in the TESTS lists would confuse additional tests like the plugins test which want to run on all currently enabled tests. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index 08c5736a4d4..43ee2e181e2 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -7,10 +7,8 @@ VPATH += $(I386_SRC) I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c)) ALL_X86_TESTS=$(I386_SRCS:.c=) -I386_TESTS:=$(filter-out test-i386-ssse3, $(ALL_X86_TESTS)) +SKIP_I386_TESTS=test-i386-ssse3 X86_64_TESTS:=$(filter test-i386-ssse3, $(ALL_X86_TESTS)) -# Update TESTS -TESTS=$(MULTIARCH_TESTS) $(I386_TESTS) # # hello-i386 is a barebones app @@ -36,9 +34,12 @@ run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref $(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)") $(call diff-out,test-i386-fprem, test-i386-fprem.ref) else -run-test-i386-fprem: test-i386-fprem - $(call skip-test, $<, "SLOW") +SKIP_I386_TESTS+=test-i386-fprem endif +# Update TESTS +I386_TESTS:=$(filter-out $(SKIP_I386_TESTS), $(ALL_X86_TESTS)) +TESTS=$(MULTIARCH_TESTS) $(I386_TESTS) + # On i386 and x86_64 Linux only supports 4k pages (large pages are a different hack) EXTRA_RUNS+=run-test-mmap-4096 From patchwork Fri Oct 25 06:37:04 2019 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: 177697 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3305549ill; Fri, 25 Oct 2019 00:52:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqxMir8H60JkDpXERNs7CztQeS3L15OVI16KFFk+A4TI9DWNGAGKVG5dIE7ge8V+/znlG3CC X-Received: by 2002:a05:6402:1547:: with SMTP id p7mr2467222edx.28.1571989921365; Fri, 25 Oct 2019 00:52:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989921; cv=none; d=google.com; s=arc-20160816; b=ufZTL5ZFSyov5v3J55Uh17bqUA0xPdP/NEdGAbP3+N+ifRjFFpyP8hKsuo3RK3QrRZ v08V+fgs6yd/zBp+ohiRJeXIbI6A3J52vKntxWkm03KfUGnWc7L7BoWBjf6v8N9zIUet mS8oM7X94Y+1XQz+Okk+ruMdp5gsqvuVf6Sph0DQ9nfpWLhond8Q/S+p9oTd9T0uCfD/ iNJluFkX9VznrTQym+Vuuc8n8E4mSbWQkwnG4Fi5kFpcZAaEIfPIu0xsj8z8LNGQuXny LowEQ4WyLF3rJOfUyYShvSvVUVa5Ztn7ovv3fCnE9PvuYy1MF8HWQv2moa+H12h0tYNa vJ+A== 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=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=TCjygqfCK12Asywrk+PEoQR2oNGScq8qm8g2FJlnFaEm97hqfCM+SVMa/zgm/UsS6O D5vwq95+PTuyBQkRW2y/8yF7uAN30vffG57fdQTB0gTX/2AFlK0wFjAlmFPfSb38YIRA yoocQj9M8UQPiLsoaJGRErxbbvsbHrt57RDE5izQdoFrP8ZQ5+VeYXrewDG8cVA2JF08 m/Xo/43TlIM5EtGQJuiCI65iCcDIcWQ8pYlIo9tCc8jExwQ7/0eLxw1vyrvDSi+aV8MX MbzWgvDlaEPWVCyu9NHkIvLtfmkPKSiG5LyZBnZOEf1B8voBxxrk0GIbO5teH/v0Rij9 +97g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=n3qhAO3k; 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 v10si777385edc.62.2019.10.25.00.52.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:52:01 -0700 (PDT) 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=n3qhAO3k; 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]:57178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuO8-0003vG-3Y for patch@linaro.org; Fri, 25 Oct 2019 03:52:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40336) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpt-0004Vh-OX for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtps-00078I-9J for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:36150) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtps-00077q-2d for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:36 -0400 Received: by mail-wm1-x330.google.com with SMTP id c22so865963wmd.1 for ; Fri, 25 Oct 2019 00:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=n3qhAO3kwLwn+fuVou4I4zvxlFjgYpq5U8GrQ8VznxWHN7kbhSrbm8I/IGcj0qxUH2 9cMkCa3SzI12UABnNvb1eigaJ/T48+MwxeHZ4TygRbdst3HXmWJ2LQg3XslHdEKvQBzR 03DlGt+E6rpIWwL6q2BYhTqZq/lBUGn46FTW8ia7y+oJ2YZQWjRqthOsgMc5uoGjQJKa J1vT2kj39PSLZIflWi/eGTKLzgOcri53dgugNBoEVRHbdR0pdUYsbYe4oxaRESHojxpD rm850s9fmoqylPL/dzJ14gGEpdPAc8C5tubvaJsLtBCmrmmw22bY9xdojiGZilYMLXAU Fk0w== 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=kHDw5giSQUpa5TavdPwJmtfXF3VzRIg0gye452+mQFA=; b=f5UodWGWyXEuJQqh84NwFhRPa4cOSXUnGEUBClidPdtK09kDkn5i2fa9PjfVNOluy+ JqKzH1ExSStaSlxZgsK/FT/qylTUO0YlXhmO8rLHnGQPpp37VNOFxpPhYFKQ3IHknG0n u8s3yN+LGmTHAXtLfRYKCX49CQzKyWfg2TA19fYXcMNx8IlFgC7hnMtFsT6Jw/pN7jvy UvS69fW+ycuQt6VZ3kR/P72ga8KkPS8psQGGYjZWiFaj2HM1TS1nTjKzytarBPr2KFD8 1frrbAAn2bLvT93+LMD7l9VJMstS4nc0tWap7FzPEwsTIPZej9CtVBR7fAN5hVhhmxw/ cJNA== X-Gm-Message-State: APjAAAXlCgO5NZ9i1msEuKMjWdY0zeX9pG85RvfSzfPs9RQ1cpE+tLhs FLwTSost3E24NqOaORrHnHB1UQ== X-Received: by 2002:a1c:2c88:: with SMTP id s130mr2133109wms.66.1571987794791; Fri, 25 Oct 2019 00:16:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a2sm1430092wrv.39.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C10081FFD5; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 64/73] tests/tcg: enable plugin testing Date: Fri, 25 Oct 2019 07:37:04 +0100 Message-Id: <20191025063713.23374-65-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::330 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: Richard Henderson , "open list:ARM TCG CPUs" , =?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" If CONFIG_PLUGINS is enabled then lets enable testing for all our TCG targets. This is a simple smoke test that ensure we don't crash or otherwise barf out by running each plugin against each test. There is a minor knock on effect for additional runners which need specialised QEMU_OPTS which will also need to declare a plugin version of the runner. If this gets onerous we might need to add another helper. Checking the results of the plugins is left for a later exercise. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 09e5b410dca..a2c4c56dbe4 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -1060,6 +1060,15 @@ check-softfloat: "SKIPPED for non-TCG builds") endif +# Plugins +ifeq ($(CONFIG_PLUGIN),y) +.PHONY: plugins +plugins: + $(call quiet-command,\ + $(MAKE) $(SUBDIR_MAKEFLAGS) -C tests/plugin V="$(V)", \ + "BUILD", "plugins") +endif + # Per guest TCG tests BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%, $(TARGET_DIRS)) @@ -1070,7 +1079,7 @@ RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(TARGET_DIRS)) $(foreach PROBE_TARGET,$(TARGET_DIRS), \ $(eval -include $(SRC_PATH)/tests/tcg/Makefile.prereqs)) -build-tcg-tests-%: +build-tcg-tests-%: $(if $(CONFIG_PLUGIN),plugins) $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) \ -f $(SRC_PATH)/tests/tcg/Makefile.qemu \ SRC_PATH=$(SRC_PATH) \ diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 96646130020..3c7421a356e 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -123,11 +123,39 @@ all: $(TESTS) $(EXTRA_TESTS) # RUN_TESTS=$(patsubst %,run-%, $(TESTS)) + +# If plugins exist also include those in the tests +ifeq ($(CONFIG_PLUGIN),y) +PLUGIN_DIR=../../plugin +VPATH+=$(PLUGIN_DIR) +PLUGINS=$(notdir $(wildcard $(PLUGIN_DIR)/*.so)) + +# We need to ensure expand the run-plugin-TEST-with-PLUGIN +# pre-requistes manually here as we can't use stems to handle it. We +# also add some special helpers the run-plugin- rules can use bellow. + +$(foreach p,$(PLUGINS), \ + $(foreach t,$(TESTS),\ + $(eval run-plugin-$(t)-with-$(p): $t $p) \ + $(eval run-plugin-$(t)-with-$(p): TIMEOUT=30) \ + $(eval RUN_TESTS+=run-plugin-$(t)-with-$(p)))) +endif + +strip-plugin = $(wordlist 1, 1, $(subst -with-, ,$1)) +extract-plugin = $(wordlist 2, 2, $(subst -with-, ,$1)) + RUN_TESTS+=$(EXTRA_RUNS) ifdef CONFIG_USER_ONLY run-%: % $(call run-test, $<, $(QEMU) $(QEMU_OPTS) $<, "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -d plugin -D $*.pout \ + $(call strip-plugin,$<), \ + "$* on $(TARGET_NAME)") else run-%: % $(call run-test, $<, \ @@ -135,6 +163,15 @@ run-%: % -chardev file$(COMMA)path=$<.out$(COMMA)id=output \ $(QEMU_OPTS) $<, \ "$< on $(TARGET_NAME)") + +run-plugin-%: + $(call run-test, $@, \ + $(QEMU) -monitor none -display none \ + -chardev file$(COMMA)path=$@.out$(COMMA)id=output \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + -d plugin -D $*.pout \ + $(QEMU_OPTS) $(call strip-plugin,$<), \ + "$* on $(TARGET_NAME)") endif gdb-%: % diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 509f1afa93d..96d2321045a 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -26,4 +26,10 @@ AARCH64_TESTS += semihosting run-semihosting: semihosting $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") +run-plugin-semihosting-with-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<) 2> $<.err, \ + "$< on $(TARGET_NAME) with $*") + TESTS += $(AARCH64_TESTS) diff --git a/tests/tcg/arm/Makefile.softmmu-target b/tests/tcg/arm/Makefile.softmmu-target index 231e9a57b48..3fe237ba391 100644 --- a/tests/tcg/arm/Makefile.softmmu-target +++ b/tests/tcg/arm/Makefile.softmmu-target @@ -23,3 +23,4 @@ LDFLAGS+=-nostdlib -N -static test-armv6m-undef: EXTRA_CFLAGS+=-mcpu=cortex-m0 run-test-armv6m-undef: QEMU_OPTS+=-semihosting -M microbit -kernel +run-plugin-test-armv6m-undef-%: QEMU_OPTS+=-semihosting -M microbit -kernel diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index 3ddff852404..0765f37ff04 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -34,6 +34,12 @@ ARM_TESTS += semihosting run-semihosting: semihosting $(call run-test,$<,$(QEMU) $< 2> $<.err, "$< on $(TARGET_NAME)") +run-plugin-semihosting-with-%: + $(call run-test, $@, $(QEMU) $(QEMU_OPTS) \ + -plugin $(PLUGIN_DIR)/$(call extract-plugin,$@) \ + $(call strip-plugin,$<) 2> $<.err, \ + "$< on $(TARGET_NAME) with $*") + TESTS += $(ARM_TESTS) # On ARM Linux only supports 4k pages From patchwork Fri Oct 25 06:37:05 2019 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: 177633 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3245368ill; Thu, 24 Oct 2019 23:54:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3rNQaV54YCZfdMjdOwFzKc2pBsBBGqbfzLN0HINzVeCkfUdZaPk8udYMMpWvS2aoYHBeR X-Received: by 2002:a17:906:8288:: with SMTP id h8mr1926172ejx.251.1571986454997; Thu, 24 Oct 2019 23:54:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571986454; cv=none; d=google.com; s=arc-20160816; b=GAXivKbfwB0yCquG5Q9V3kgiooT5kj6ZIetZPgQS7uRbwo8mdiigZm55achNoAOAPK amYR4zKh0zNfYgmCQ3ECgsQryxTyolZdyyGo/Rut8LOVH6diZZBUsw2lJyYyAa8gVfQQ OfExECw0SZF4Y1EYh2z22dduLmm1Dwr/JNRy4vbh2S8o2nJ1XBrBSh1MbNjXCNfOcD6U zjzrQO8gm0XRU+o5ppZtQJrQA2i0SypHGnhV+/OHYHARmD2F8Ymio4OAoF+7Y2i8v3f4 ujflJAvzIwHTxLxnSo6V6vJ1uxaJOgpvYSXW8FwKN1IaPDxgzNeP3dqMo8aJ6F03uiR8 B17w== 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=yAGQHjJX6sN9vqBD9CUSIS92quPpG3GGj8bU/lL0Ji4=; b=G7o6DMzmfL/r4epYdOVUKWA07wxZ2gMgl9BNTzJzYGwNctvLw7XhBPlyAZ4tRf7mM9 /ACv4RgzxexEwINlP4dznxhzZ06bk7YGh9L1zxULsk4Kt5NRjlNyIP/7/ETs2af2OQxa 8t8ffJdyswxLYr4IUL5uhW/7qfJeDL0TXSHu+w3yj2EzffKDzlON1/xKCw5dmJebv6Hl 5zNWdVxSTffADMTKEt4GLTS5T3kKAcc4zO6LdL1myHlLHVU6iK+xMVm3bqxbRsDzvM21 VjtCQar8L/CkjI/dHC/j9lT5qC4201O2N4zIDTu3f5dEhLwLkYrcBorV+eaZRWwEZNp4 EsIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nEchem4M; 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 h22si676130edb.346.2019.10.24.23.54.14 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Oct 2019 23:54:14 -0700 (PDT) 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=nEchem4M; 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]:56108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtUD-0004RP-Fj for patch@linaro.org; Fri, 25 Oct 2019 02:54:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35591) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE5-0003Od-CW for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE2-0008Ru-2k for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:31 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:42516) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE1-0008RB-SD for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:30 -0400 Received: by mail-wr1-x42b.google.com with SMTP id r1so901940wrs.9 for ; Thu, 24 Oct 2019 23:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yAGQHjJX6sN9vqBD9CUSIS92quPpG3GGj8bU/lL0Ji4=; b=nEchem4M3/M08Rd9orRMB8+/QD76x8Yhe9aigLpWlxq0bbIj3FYlSHgEFq9fL9MRIJ ZlfwjGZHFl6Vi8nsIqxaDTS/A1M8AitUzMmFgjNCHqEAG8tUayB1I3EyQEsH8OiSZbcY 1pcCuv0CkYcX7b9d3wgrhsTs1PGFeRhslLurY3mAPhFXeKnN4CbKqQtEgS39j5vHhE65 oVLZ29DQrgD6oLPbFXVsvBGu0dVLtDIt0RRKkhezRIfyncF9pZFN2unv+zPriSnn3tK8 FFRUea9mGz1KCfXFxjMLa2r/HDDwBrisHWuJOU6mVWoOYbTj2/dSYr6hYfxEQBnKoilV L9Lg== 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=yAGQHjJX6sN9vqBD9CUSIS92quPpG3GGj8bU/lL0Ji4=; b=BsYOyeiEQxwPmyEyW2l4cpucaW+NoxYyGjvAI08G+tQj3CJJVrSL6nJGeYvpFcnkOS WAw9CVxPVzG8qfHIGS62xLmRAB4nnYnrIR0mBAd0Xuiet2nuMcycJaiG9ffpkkHYE28U OEYkUwPJBmakQ5yy20bxx9gRPdiEuOowUOSDiNuPDf0Ml7pocJRyOmVC0ZHAPOGD1FVb n7S7jio0FVVjS4iAQ9u6Ds4xUcR4aRT5weNVeAOoL7xSNPyLbSpFQ1dN1zYiG1+BtJaw U6+QgnCIuLotci/m1nbrN6ZDUIuFyV6yqnFHlKXVMVR00YAg7dmra7ci8quUGRTk+Ht9 KYYw== X-Gm-Message-State: APjAAAWhnY1z8dW4fAyTOh8/B06zMEbPiwey42UUl+7f3Sp2l/iF1DQw 8mzYUm1vHrft3wlmi7w8jflViw== X-Received: by 2002:a5d:630b:: with SMTP id i11mr1189002wru.87.1571985448546; Thu, 24 Oct 2019 23:37:28 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g10sm1189335wrr.28.2019.10.24.23.37.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D6BB71FFD7; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 65/73] tests/plugin: add a hotblocks plugin Date: Fri, 25 Oct 2019 07:37:05 +0100 Message-Id: <20191025063713.23374-66-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a simple plugin to track which translation blocks are call most often. As we don't have a view of the internals of TCG we can only work by the address of the start of the block so we also need to tracks how often the address is translated. As there will be multiple blocks starting at the same address. We can try and work around this by futzing the value to feed to the hash with the insn count. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index f9a3546ea32..e74940eaac5 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -10,6 +10,7 @@ NAMES += bb NAMES += empty NAMES += insn NAMES += mem +NAMES += hotblocks SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/plugin/hotblocks.c b/tests/plugin/hotblocks.c new file mode 100644 index 00000000000..1bd183849a1 --- /dev/null +++ b/tests/plugin/hotblocks.c @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2019, Alex Bennée + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +static bool do_inline; + +/* Plugins need to take care of their own locking */ +static GMutex lock; +static GHashTable *hotblocks; +static guint64 limit = 20; + +/* + * Counting Structure + * + * The internals of the TCG are not exposed to plugins so we can only + * get the starting PC for each block. We cheat this slightly by + * xor'ing the number of instructions to the hash to help + * differentiate. + */ +typedef struct { + uint64_t start_addr; + uint64_t exec_count; + int trans_count; + unsigned long insns; +} ExecCount; + +static gint cmp_exec_count(gconstpointer a, gconstpointer b) +{ + ExecCount *ea = (ExecCount *) a; + ExecCount *eb = (ExecCount *) b; + return ea->exec_count > eb->exec_count ? -1 : 1; +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report = g_string_new("collected "); + GList *counts, *it; + int i; + + g_mutex_lock(&lock); + g_string_append_printf(report, "%d entries in the hash table\n", + g_hash_table_size(hotblocks)); + counts = g_hash_table_get_values(hotblocks); + it = g_list_sort(counts, cmp_exec_count); + + if (it) { + g_string_append_printf(report, "pc, tcount, icount, ecount\n"); + + for (i = 0; i < limit && it->next; i++, it = it->next) { + ExecCount *rec = (ExecCount *) it->data; + g_string_append_printf(report, "%#016"PRIx64", %d, %ld, %"PRId64"\n", + rec->start_addr, rec->trans_count, + rec->insns, rec->exec_count); + } + + g_list_free(it); + g_mutex_unlock(&lock); + } + + qemu_plugin_outs(report->str); +} + +static void plugin_init(void) +{ + hotblocks = g_hash_table_new(NULL, g_direct_equal); +} + +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + ExecCount *cnt; + uint64_t hash = (uint64_t) udata; + + g_mutex_lock(&lock); + cnt = (ExecCount *) g_hash_table_lookup(hotblocks, (gconstpointer) hash); + /* should always succeed */ + g_assert(cnt); + cnt->exec_count++; + g_mutex_unlock(&lock); +} + +/* + * When do_inline we ask the plugin to increment the counter for us. + * Otherwise a helper is inserted which calls the vcpu_tb_exec + * callback. + */ +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + ExecCount *cnt; + uint64_t pc = qemu_plugin_tb_vaddr(tb); + unsigned long insns = qemu_plugin_tb_n_insns(tb); + uint64_t hash = pc ^ insns; + + g_mutex_lock(&lock); + cnt = (ExecCount *) g_hash_table_lookup(hotblocks, (gconstpointer) hash); + if (cnt) { + cnt->trans_count++; + } else { + cnt = g_new0(ExecCount, 1); + cnt->start_addr = pc; + cnt->trans_count = 1; + cnt->insns = insns; + g_hash_table_insert(hotblocks, (gpointer) hash, (gpointer) cnt); + } + + g_mutex_unlock(&lock); + + if (do_inline) { + qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, + &cnt->exec_count, 1); + } else { + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, + (void *)hash); + } +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + if (argc && strcmp(argv[0], "inline") == 0) { + do_inline = true; + } + + plugin_init(); + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} From patchwork Fri Oct 25 06:37:06 2019 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: 177698 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3305927ill; Fri, 25 Oct 2019 00:52:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwEVGSm32NKtRfs2Y3IbjPwNh9237/izJEnquj9tjp0Fe7l+yJB64bAmsyKFJ1YVA/dbN8 X-Received: by 2002:a05:6402:1454:: with SMTP id d20mr2496814edx.53.1571989939323; Fri, 25 Oct 2019 00:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989939; cv=none; d=google.com; s=arc-20160816; b=t+OaIzRb5CKqDHGatiFznQxazteo89ctrC/86mjYck+og5RNayoU1ITDQ5opYucPJk jTMiqcI2DR3rijdq5Bspp4qn6hF/1sjEPKxWX9oiWorCMLgdC8W6kAJmWWmtNrPAL14Z 5BTn3pyLWcCwYJzmsZpAXXsJRKhL/YAV42cf95HGVtgnePDiuyIP7fhIn+o3pLKQ8S/Q TZD1XuKHr5zD7tVOaq3O96oVWkyhc5bYtJ/5yDfrfqxYaT24GntSnLxgBhWAtGGBL/V4 dDxMQcScwfJl9812YmWmsfuOtEABVFGiEPyyszFG4DiQuxga5gHWQktuK8qIh/SMlgjc CLyg== 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=izcvnlZHMqS1wnwvRoAGn568i0xGsOfYRGzh3VU8ggs=; b=qvPvyD1/N4vf5wK2ZhZH5tq47lcibFwtaWI2bep9vtkGUfmCZ3MLAggN2vy+lV8v+x L4jUQuITTxQMQVuAVgnFlrXckG6JhPUTzYffpZ1hB/bbUzq11YBXLmQwqJ+UCA4mIY76 MDv0XyYeIVyroNjz5YOdyjG7lZO0QonX0l0YDqjy46llgVlwB8MhJw78JkR+j7aFbjYU n2cy1WBxGyLbcubQ9NP3JV8taDo3ZdKExGZw9W2UhicU4tmhKJD5lKrnzBd/IVRX8qhN cgVwo6r27pMo6xTsRpCfRcOFtFWj2sR+oTKGPb+dKUhua8+FM57IqO7cYt6rGivINcr/ pWbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UTy4r7Hb; 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 q15si701626ejj.183.2019.10.25.00.52.18 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:52:19 -0700 (PDT) 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=UTy4r7Hb; 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]:57182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuOP-00044x-U9 for patch@linaro.org; Fri, 25 Oct 2019 03:52:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40371) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtpv-0004ZH-OU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtpt-00079x-QO for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:39 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtpt-00078s-J6 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:37 -0400 Received: by mail-wr1-x436.google.com with SMTP id c2so1006745wrr.10 for ; Fri, 25 Oct 2019 00:16:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=izcvnlZHMqS1wnwvRoAGn568i0xGsOfYRGzh3VU8ggs=; b=UTy4r7Hb1Xz0ZxD1U6F2Nif6vTifO7lOlI8a/vrzSZ4WESlv3QMLhZ7el3YS9Gjs6U NERUe9H0YYGnsZ87p+mhVjjHjETIMlExqhEeFxJtkU3+eD6sNW8VfSSKT/Y95EoZQ+CD BhMjZT9gFeGaYIRNlI+5Azz+vQZVDqfsorjtAwlICfXB9sAVu/lix8JI9Z4/3vb3/6yd 1ZypXJy4y1UD5X0ql675Lt2egMPhlKSCVCGtmueyzrIFBG7tkNv5EmGyBWhkVc59YUSD 1X7YWP9Zm52IAvlIuJeYbMqaHOmUc6iRugBZArWEY0gz23NyWzvckTJ1/ReTyjnP8N8W rHwQ== 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=izcvnlZHMqS1wnwvRoAGn568i0xGsOfYRGzh3VU8ggs=; b=TeWWWNTtzfiRaN1Y6G3keT0ynOll+GLH9Mup/pJHLYgD7S5EJafch7S7cERWNtNxYz PnlSS7n/7d+XLDFFposHs5RKujUEuAB0qAV23UaW17uoi+X7pZtbwcs3HauEcd54x86D Ptb4Pe+N7amZhhgJuptOG0aT9R3h7K6PztyzqrP0CIETRtB9/wlhPla1aP9Tr+mLYQqy j4yUFi7xvhAMXq+YQfO79/L4Wihk8cjxgjpCtFE1qujkEoCovfQKdOW+/KRluqpzJ8OE Jiko4Fqz4httPmZAYefJH8jW7m0Dfs9LgQxR1YDOJMGxHTNOB428m5K3ajL6lWCKa5A9 VZxQ== X-Gm-Message-State: APjAAAWAdSlmsM1VAzx0mlT6tmNjT+Y9xmvE2gwiAtevnHzcDo+BdbI2 MvC1GCip0QcysCwAb9HAi/XY3w== X-Received: by 2002:a5d:5388:: with SMTP id d8mr1455405wrv.92.1571987796251; Fri, 25 Oct 2019 00:16:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k8sm2557850wrg.15.2019.10.25.00.16.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id ECF491FFD8; Fri, 25 Oct 2019 07:37:19 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 66/73] tests/plugin: add instruction execution breakdown Date: Fri, 25 Oct 2019 07:37:06 +0100 Message-Id: <20191025063713.23374-67-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This gives a break down of instruction classes and individual instruction types. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index e74940eaac5..3656429d46b 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -11,6 +11,7 @@ NAMES += empty NAMES += insn NAMES += mem NAMES += hotblocks +NAMES += howvec SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/plugin/howvec.c b/tests/plugin/howvec.c new file mode 100644 index 00000000000..58fa675e348 --- /dev/null +++ b/tests/plugin/howvec.c @@ -0,0 +1,352 @@ +/* + * Copyright (C) 2019, Alex Bennée + * + * How vectorised is this code? + * + * Attempt to measure the amount of vectorisation that has been done + * on some code by counting classes of instruction. + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +typedef enum { + COUNT_CLASS, + COUNT_INDIVIDUAL, + COUNT_NONE +} CountType; + +static int limit = 50; +static bool do_inline; +static bool verbose; + +static GMutex lock; +static GHashTable *insns; + +typedef struct { + const char *class; + const char *opt; + uint32_t mask; + uint32_t pattern; + CountType what; + uint64_t count; +} InsnClassExecCount; + +typedef struct { + char *insn; + uint32_t opcode; + uint64_t count; + InsnClassExecCount *class; +} InsnExecCount; + +/* + * Matchers for classes of instructions, order is important. + * + * Your most precise match must be before looser matches. If no match + * is found in the table we can create an individual entry. + * + * 31..28 27..24 23..20 19..16 15..12 11..8 7..4 3..0 + */ +static InsnClassExecCount aarch64_insn_classes[] = { + /* "Reserved"" */ + { " UDEF", "udef", 0xffff0000, 0x00000000, COUNT_NONE}, + { " SVE", "sve", 0x1e000000, 0x04000000, COUNT_CLASS}, + { "Reserved", "res", 0x1e000000, 0x00000000, COUNT_CLASS}, + /* Data Processing Immediate */ + { " PCrel addr", "pcrel", 0x1f000000, 0x10000000, COUNT_CLASS}, + { " Add/Sub (imm,tags)","asit", 0x1f800000, 0x11800000, COUNT_CLASS}, + { " Add/Sub (imm)", "asi", 0x1f000000, 0x11000000, COUNT_CLASS}, + { " Logical (imm)", "logi", 0x1f800000, 0x12000000, COUNT_CLASS}, + { " Move Wide (imm)", "movwi", 0x1f800000, 0x12800000, COUNT_CLASS}, + { " Bitfield", "bitf", 0x1f800000, 0x13000000, COUNT_CLASS}, + { " Extract", "extr", 0x1f800000, 0x13800000, COUNT_CLASS}, + { "Data Proc Imm", "dpri", 0x1c000000, 0x10000000, COUNT_CLASS}, + /* Branches */ + { " Cond Branch (imm)", "cndb", 0xfe000000, 0x54000000, COUNT_CLASS}, + { " Exception Gen", "excp", 0xff000000, 0xd4000000, COUNT_CLASS}, + { " NOP", "nop", 0xffffffff, 0xd503201f, COUNT_NONE}, + { " Hints", "hint", 0xfffff000, 0xd5032000, COUNT_CLASS}, + { " Barriers", "barr", 0xfffff000, 0xd5033000, COUNT_CLASS}, + { " PSTATE", "psta", 0xfff8f000, 0xd5004000, COUNT_CLASS}, + { " System Insn", "sins", 0xffd80000, 0xd5080000, COUNT_CLASS}, + { " System Reg", "sreg", 0xffd00000, 0xd5100000, COUNT_CLASS}, + { " Branch (reg)", "breg", 0xfe000000, 0xd6000000, COUNT_CLASS}, + { " Branch (imm)", "bimm", 0x7c000000, 0x14000000, COUNT_CLASS}, + { " Cmp & Branch", "cmpb", 0x7e000000, 0x34000000, COUNT_CLASS}, + { " Tst & Branch", "tstb", 0x7e000000, 0x36000000, COUNT_CLASS}, + { "Branches", "branch", 0x1c000000, 0x14000000, COUNT_CLASS}, + /* Loads and Stores */ + { " AdvSimd ldstmult", "advlsm", 0xbfbf0000, 0x0c000000, COUNT_CLASS}, + { " AdvSimd ldstmult++","advlsmp",0xbfb00000, 0x0c800000, COUNT_CLASS}, + { " AdvSimd ldst", "advlss", 0xbf9f0000, 0x0d000000, COUNT_CLASS}, + { " AdvSimd ldst++", "advlssp",0xbf800000, 0x0d800000, COUNT_CLASS}, + { " ldst excl", "ldstx", 0x3f000000, 0x08000000, COUNT_CLASS}, + { " Prefetch", "prfm", 0xff000000, 0xd8000000, COUNT_CLASS}, + { " Load Reg (lit)", "ldlit", 0x1b000000, 0x18000000, COUNT_CLASS}, + { " ldst noalloc pair", "ldstnap",0x3b800000, 0x28000000, COUNT_CLASS}, + { " ldst pair", "ldstp", 0x38000000, 0x28000000, COUNT_CLASS}, + { " ldst reg", "ldstr", 0x3b200000, 0x38000000, COUNT_CLASS}, + { " Atomic ldst", "atomic", 0x3b200c00, 0x38200000, COUNT_CLASS}, + { " ldst reg (reg off)","ldstro", 0x3b200b00, 0x38200800, COUNT_CLASS}, + { " ldst reg (pac)", "ldstpa", 0x3b200200, 0x38200800, COUNT_CLASS}, + { " ldst reg (imm)", "ldsti", 0x3b000000, 0x39000000, COUNT_CLASS}, + { "Loads & Stores", "ldst", 0x0a000000, 0x08000000, COUNT_CLASS}, + /* Data Processing Register */ + { "Data Proc Reg", "dprr", 0x0e000000, 0x0a000000, COUNT_CLASS}, + /* Scalar FP */ + { "Scalar FP ", "fpsimd", 0x0e000000, 0x0e000000, COUNT_CLASS}, + /* Unclassified */ + { "Unclassified", "unclas", 0x00000000, 0x00000000, COUNT_CLASS}, +}; + +static InsnClassExecCount sparc32_insn_classes[] = { + { "Call", "call", 0xc0000000, 0x40000000, COUNT_CLASS}, + { "Branch ICond", "bcc", 0xc1c00000, 0x00800000, COUNT_CLASS}, + { "Branch Fcond", "fbcc", 0xc1c00000, 0x01800000, COUNT_CLASS}, + { "SetHi", "sethi", 0xc1c00000, 0x01000000, COUNT_CLASS}, + { "FPU ALU", "fpu", 0xc1f00000, 0x81a00000, COUNT_CLASS}, + { "ALU", "alu", 0xc0000000, 0x80000000, COUNT_CLASS}, + { "Load/Store", "ldst", 0xc0000000, 0xc0000000, COUNT_CLASS}, + /* Unclassified */ + { "Unclassified", "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL}, +}; + +static InsnClassExecCount sparc64_insn_classes[] = { + { "SetHi & Branches", "op0", 0xc0000000, 0x00000000, COUNT_CLASS}, + { "Call", "op1", 0xc0000000, 0x40000000, COUNT_CLASS}, + { "Arith/Logical/Move", "op2", 0xc0000000, 0x80000000, COUNT_CLASS}, + { "Arith/Logical/Move", "op3", 0xc0000000, 0xc0000000, COUNT_CLASS}, + /* Unclassified */ + { "Unclassified", "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL}, +}; + +/* Default matcher for currently unclassified architectures */ +static InsnClassExecCount default_insn_classes[] = { + { "Unclassified", "unclas", 0x00000000, 0x00000000, COUNT_INDIVIDUAL}, +}; + +typedef struct { + const char *qemu_target; + InsnClassExecCount *table; + int table_sz; +} ClassSelector; + +static ClassSelector class_tables[] = +{ + { "aarch64", aarch64_insn_classes, ARRAY_SIZE(aarch64_insn_classes) }, + { "sparc", sparc32_insn_classes, ARRAY_SIZE(sparc32_insn_classes) }, + { "sparc64", sparc64_insn_classes, ARRAY_SIZE(sparc64_insn_classes) }, + { NULL, default_insn_classes, ARRAY_SIZE(default_insn_classes) }, +}; + +static InsnClassExecCount *class_table; +static int class_table_sz; + +static gint cmp_exec_count(gconstpointer a, gconstpointer b) +{ + InsnExecCount *ea = (InsnExecCount *) a; + InsnExecCount *eb = (InsnExecCount *) b; + return ea->count > eb->count ? -1 : 1; +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report = g_string_new("Instruction Classes:\n"); + int i; + GList *counts; + InsnClassExecCount *class = NULL; + + for (i = 0; i < class_table_sz; i++) { + class = &class_table[i]; + switch (class->what) { + case COUNT_CLASS: + if (class->count || verbose) { + g_string_append_printf(report, "Class: %-24s\t(%ld hits)\n", + class->class, + class->count); + } + break; + case COUNT_INDIVIDUAL: + g_string_append_printf(report, "Class: %-24s\tcounted individually\n", + class->class); + break; + case COUNT_NONE: + g_string_append_printf(report, "Class: %-24s\tnot counted\n", + class->class); + break; + default: + break; + } + } + + counts = g_hash_table_get_values(insns); + if (counts && g_list_next(counts)) { + GList *it; + + g_string_append_printf(report,"Individual Instructions:\n"); + + it = g_list_sort(counts, cmp_exec_count); + + for (i = 0; i < limit && it->next; i++, it = it->next) { + InsnExecCount *rec = (InsnExecCount *) it->data; + g_string_append_printf(report, "Instr: %-24s\t(%ld hits)\t(op=%#08x/%s)\n", + rec->insn, + rec->count, + rec->opcode, + rec->class ? + rec->class->class : "un-categorised"); + } + g_list_free(it); + } + + qemu_plugin_outs(report->str); +} + +static void plugin_init(void) +{ + insns = g_hash_table_new(NULL, g_direct_equal); +} + +static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata) +{ + uint64_t *count = (uint64_t *) udata; + (*count)++; +} + +static uint64_t * find_counter(struct qemu_plugin_insn *insn) +{ + int i; + uint64_t *cnt = NULL; + uint32_t opcode; + InsnClassExecCount *class = NULL; + + /* + * We only match the first 32 bits of the instruction which is + * fine for most RISCs but a bit limiting for CISC architectures. + * They would probably benefit from a more tailored plugin. + * However we can fall back to individual instruction counting. + */ + opcode = *((uint32_t *)qemu_plugin_insn_data(insn)); + + for (i = 0; !cnt && i < class_table_sz; i++) { + class = &class_table[i]; + uint32_t masked_bits = opcode & class->mask; + if (masked_bits == class->pattern) { + break; + } + } + + g_assert(class); + + switch (class->what) { + case COUNT_NONE: + return NULL; + case COUNT_CLASS: + return &class->count; + case COUNT_INDIVIDUAL: + { + InsnExecCount *icount; + + g_mutex_lock(&lock); + icount = (InsnExecCount *) g_hash_table_lookup(insns, + GUINT_TO_POINTER(opcode)); + + if (!icount) { + icount = g_new0(InsnExecCount, 1); + icount->opcode = opcode; + icount->insn = qemu_plugin_insn_disas(insn); + icount->class = class; + + g_hash_table_insert(insns, GUINT_TO_POINTER(opcode), + (gpointer) icount); + } + g_mutex_unlock(&lock); + + return &icount->count; + } + default: + g_assert_not_reached(); + } + + return NULL; +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + uint64_t *cnt; + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + cnt = find_counter(insn); + + if (cnt) { + if (do_inline) { + qemu_plugin_register_vcpu_insn_exec_inline( + insn, QEMU_PLUGIN_INLINE_ADD_U64, cnt, 1); + } else { + qemu_plugin_register_vcpu_insn_exec_cb( + insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, cnt); + } + } + } +} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + /* Select a class table appropriate to the guest architecture */ + for (i = 0; i < ARRAY_SIZE(class_tables); i++) { + ClassSelector *entry = &class_tables[i]; + if (!entry->qemu_target || + strcmp(entry->qemu_target, info->target_name) == 0) { + class_table = entry->table; + class_table_sz = entry->table_sz; + break; + } + } + + for (i = 0; i < argc; i++) { + char *p = argv[i]; + if (strcmp(p, "inline") == 0) { + do_inline = true; + } else if (strcmp(p, "verbose") == 0) { + verbose = true; + } else { + int j; + CountType type = COUNT_INDIVIDUAL; + if (*p == '!') { + type = COUNT_NONE; + p++; + } + for (j = 0; j < class_table_sz; j++) { + if (strcmp(p, class_table[j].opt) == 0) { + class_table[j].what = type; + break; + } + } + } + } + + plugin_init(); + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} From patchwork Fri Oct 25 06:37:07 2019 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: 177681 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3289038ill; Fri, 25 Oct 2019 00:37:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSdMOVmKrfn2q8pypFdwJUDJuw9envGH6d5X/q340PBIDdeS+gYTV4c3TNgqxbZPuASrXo X-Received: by 2002:ac8:7546:: with SMTP id b6mr1723593qtr.104.1571989021200; Fri, 25 Oct 2019 00:37:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571989021; cv=none; d=google.com; s=arc-20160816; b=OkZeTSJvDUzYFOaNN4pekx2iXRV3a45TaHhigy2OC5oyfUKU+U0XKXrG3nTLvfjrCR GQvYAFbbIJd61UuqAMxRqOKhAY9DR2d4P0eR76YL5M3cTRLy60gRvScP8J4rbNVzGou4 glN+7D9bwrsQTz5hZuQ4yslYM2Kp3hoHRyE+DoclLka4QhxgaJcJwCvUOowMy1sO/cu3 NcS5OeS50Q2GI2TNXV/24zEo0LwOy1jteR5GHIWAp7fKu9afTD+GYxjNgh6NMM9vWKKO ue3Og6J+EhHwx5ouShy65uT58R104FGgkGK7z6x74IdLJF/byKnGyJqNGI7JmMauIn03 05xA== 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=pfQAx5RZvYEJHOBZFdvbNXzxHOiZtn/smcq9fr6c6xw=; b=oOM2i4TNskmpzHuYZ9t/lI0IY53hASUgyxAX2GlpnP6j31fUpmyp1PwA4/8W4uMePs lo5hkTy5HN44451RIoZoAVqVWZTT2puSoM3WDLNYeO4dDC8JCCPRt5kvtY9+/fm3Hlfh AL2QDvDGSP5TOXmW6GbGbysVBLock3zsI44tqb975iZ4V4cKrvdq+c7ZlBKN38SEIES9 WoTlGb8Udemk5V1jkPIorpBeOcqBci6FQ8Yf7bItJmjRFudq8lvHsfikgvFCC/JjvexV oMqFiKnsqLuf/z2qISLKFFyxUaTaXrs0gXqrevbwiIbg8UZWRK4a0zS57JzmJvbXHTrE nRpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rQdLN9LL; 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 w63si731524qte.157.2019.10.25.00.37.01 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:37:01 -0700 (PDT) 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=rQdLN9LL; 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]:56930 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu9b-0007tP-UG for patch@linaro.org; Fri, 25 Oct 2019 03:36:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38186) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWZ-0003ML-8C for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWX-0007eG-HA for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:39 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45945) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWX-0007dj-AZ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:37 -0400 Received: by mail-wr1-x436.google.com with SMTP id q13so937125wrs.12 for ; Thu, 24 Oct 2019 23:56:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=pfQAx5RZvYEJHOBZFdvbNXzxHOiZtn/smcq9fr6c6xw=; b=rQdLN9LL7OSVSBNwRt42fhy6eOOZvLF+fTCCcGBq2hqN3SH8cHRn+AyGf8sQ7tmner femniAfqG6UYFI5hOwU8B/1octAeyrCa11tqMsNB0YOmWxgJnTrnU3DF0whJQxEZsTmd 8DufYLTM/q6cPrLDrGkkVrikdMx1anB5BNdRx31/r0wxro9qaWxvL1sh0LO8AtFj+gct +8SgV5biM7hZRDch7AZljkeM168LLob4LUFMXdTcy0QBzkcLcMxJfxQzAGrUnlR1HeuU LUJdU3NM74JKlPoXnFd8NKX999vlUH+K7MFQmsY+1QGZR/zMPrR59qQ62Puv2h2/kPKG yPKQ== 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=pfQAx5RZvYEJHOBZFdvbNXzxHOiZtn/smcq9fr6c6xw=; b=SuOZlfFQ15ks0ujf07U9S5Qx9iUZlIRukbeon1pjN0Av4Q8ICLbXZPzF+0H6HIcDYk ELP6wHwFo0s5sDssX/XTMKVM9ACm1HibBjd3LiRKiftvzop54QgnWBhZhOsoFkUXX94s RHk4uquzYLe2weTWMQgNEO3BcpZ0oI/ERySzgEi8dIGnFFmkaqds9SERp/HbXfX66oie FyMJkVKj9FnXmKjs8VLkKTYPJAib/gWC98m5dzbAwv16vhhoHzznOVbacmOkY6mDkVvv s0EuBPARKHVFeGjLmjG5bX737ZhcPXc3ImKfV5jNHxxfJGqq0yoeDeh9Y4WP06fzyJbg U6EQ== X-Gm-Message-State: APjAAAXP7Ot2okIh9+3R4zD4ZkNyYE+sCxJEmSn//CQBEoOUAkxT5hvf VptmIBP/sdgTgBg89vN3ZCDJ4w== X-Received: by 2002:adf:ea01:: with SMTP id q1mr1300847wrm.240.1571986596106; Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g10sm1244118wrr.28.2019.10.24.23.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:33 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0E7841FFD9; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 67/73] tests/plugin: add hotpages to analyse memory access patterns Date: Fri, 25 Oct 2019 07:37:07 +0100 Message-Id: <20191025063713.23374-68-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::436 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: Richard Henderson , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This plugin gives a summary of access patterns grouped by "pages" and showing read/write patterns by vCPUS. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index 3656429d46b..75467b6db85 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -12,6 +12,7 @@ NAMES += insn NAMES += mem NAMES += hotblocks NAMES += howvec +NAMES += hotpages SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/plugin/hotpages.c b/tests/plugin/hotpages.c new file mode 100644 index 00000000000..77df07a3ccf --- /dev/null +++ b/tests/plugin/hotpages.c @@ -0,0 +1,191 @@ +/* + * Copyright (C) 2019, Alex Bennée + * + * Hot Pages - show which pages saw the most memory accesses. + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static uint64_t page_size = 4096; +static uint64_t page_mask; +static int limit = 50; +static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW; +static bool track_io; + +enum sort_type { + SORT_RW = 0, + SORT_R, + SORT_W, + SORT_A +}; + +static int sort_by = SORT_RW; + +typedef struct { + uint64_t page_address; + int cpu_read; + int cpu_write; + uint64_t reads; + uint64_t writes; +} PageCounters; + +static GMutex lock; +static GHashTable *pages; + +static gint cmp_access_count(gconstpointer a, gconstpointer b) +{ + PageCounters *ea = (PageCounters *) a; + PageCounters *eb = (PageCounters *) b; + int r; + switch (sort_by) { + case SORT_RW: + r = (ea->reads + ea->writes) > (eb->reads + eb->writes) ? -1 : 1; + break; + case SORT_R: + r = ea->reads > eb->reads ? -1 : 1; + break; + case SORT_W: + r = ea->writes > eb->writes ? -1 : 1; + break; + case SORT_A: + r = ea->page_address > eb->page_address ? -1 : 1; + break; + default: + g_assert_not_reached(); + } + return r; +} + + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report = g_string_new("Addr, RCPUs, Reads, WCPUs, Writes\n"); + int i; + GList *counts; + + counts = g_hash_table_get_values(pages); + if (counts && g_list_next(counts)) { + GList *it; + + it = g_list_sort(counts, cmp_access_count); + + for (i = 0; i < limit && it->next; i++, it = it->next) { + PageCounters *rec = (PageCounters *) it->data; + g_string_append_printf(report, + "%#016"PRIx64", 0x%04x, %"PRId64 + ", 0x%04x, %"PRId64"\n", + rec->page_address, + rec->cpu_read, rec->reads, + rec->cpu_write, rec->writes); + } + g_list_free(it); + } + + qemu_plugin_outs(report->str); +} + +static void plugin_init(void) +{ + page_mask = (page_size - 1); + pages = g_hash_table_new(NULL, g_direct_equal); +} + +static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, + uint64_t vaddr, void *udata) +{ + struct qemu_plugin_hwaddr *hwaddr = qemu_plugin_get_hwaddr(meminfo, vaddr); + uint64_t page; + PageCounters *count; + + /* We only get a hwaddr for system emulation */ + if (track_io) { + if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) { + page = vaddr; + } else { + return; + } + } else { + if (hwaddr && !qemu_plugin_hwaddr_is_io(hwaddr)) { + page = (uint64_t) qemu_plugin_hwaddr_device_offset(hwaddr); + } else { + page = vaddr; + } + } + page &= ~page_mask; + + g_mutex_lock(&lock); + count = (PageCounters *) g_hash_table_lookup(pages, GUINT_TO_POINTER(page)); + + if (!count) { + count = g_new0(PageCounters, 1); + count->page_address = page; + g_hash_table_insert(pages, GUINT_TO_POINTER(page), (gpointer) count); + } + if (qemu_plugin_mem_is_store(meminfo)) { + count->writes++; + count->cpu_write |= (1 << cpu_index); + } else { + count->reads++; + count->cpu_read |= (1 << cpu_index); + } + + g_mutex_unlock(&lock); +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + qemu_plugin_register_vcpu_mem_cb(insn, vcpu_haddr, + QEMU_PLUGIN_CB_NO_REGS, + rw, NULL); + } +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + for (i = 0; i < argc; i++) { + char *opt = argv[i]; + if (g_strcmp0(opt, "reads") == 0) { + sort_by = SORT_R; + } else if (g_strcmp0(opt, "writes") == 0) { + sort_by = SORT_W; + } else if (g_strcmp0(opt, "address") == 0) { + sort_by = SORT_A; + } else if (g_strcmp0(opt, "io") == 0) { + track_io = true; + } else if (g_str_has_prefix(opt, "pagesize=")) { + page_size = g_ascii_strtoull(opt + 9, NULL, 10); + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + plugin_init(); + + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} From patchwork Fri Oct 25 06:37:08 2019 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: 177700 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3310063ill; Fri, 25 Oct 2019 00:55:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqynbrdTxudXeQlnzUpl5AFMiFGGjsDNsmryvPj2VfIts3WH7h2uwRf8NRhQDkmjFKDuFJwm X-Received: by 2002:aed:22c8:: with SMTP id q8mr1877903qtc.0.1571990158218; Fri, 25 Oct 2019 00:55:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571990158; cv=none; d=google.com; s=arc-20160816; b=AXoPrdwPkZlkJEuC6FjLh0LbdQwDgasAATcCjtha532pw4TY8fWxVCXqciLEEBxHx4 M0/Fl20qWj/TzqjWiycg+36G4VA6cp7bx61rS7XkelS4EQVWysd+T1RuN2X9gQW+R5iC L9+7ESQxRyq+hA4IrNmZW5DBpN49/l78TXgrscilTy0hP4BLnLDU6UnPyg2YM/bZQ7ZF eoc19/01/9sE9+gphtBRRfwf1mDPOS7VKu4aEcrhe79SebwnPADw62gt/uBHlGQBPHtC Ce4UBW2C1M8eh5Q1SwbMy3ZM6zkSrzgWnRk/gjih8EUO5zxAE8nCkMVtE3n/TTAj+0M+ Qh0g== 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=RBkpe4GEuH6saQwGoDoa7cSKDDeby0g+/F7eldRIZd0=; b=XcB+nb2NbfNKEIdG4hsl1Mr57TFlWoTbwWwsY43wC7w8RwPfdPS6saXD5TbnJJ2HtF AWXjSO4Z6whMlXNpAFNPX9lu7YnMDVGpgVYjhOpf4jlb2jTurg+Mw1K5VqQy5qIYGfTA DZaYqXyG7Q5eOAnvfZ+3xr8mLt5EhdMmVCddPASYhAqo+j1KAvHUmb0ynahFq5fM3mGL PyWy1bhWKLw6bhItXa2M7aSfirUFkyeIdvyy5uNCIybnJ8WWtdZV8dv12kHvZSmHZb4i VsufzTjYUqBkonp+sCaT2yhWSzxDCoM144nJl7ttBRVzrJR9alsUvff20g8GuLsrTyE+ aBpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=sVmfgZgE; 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 p20si902358qkj.281.2019.10.25.00.55.58 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:55:58 -0700 (PDT) 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=sVmfgZgE; 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]:57244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuRx-0004YT-Nj for patch@linaro.org; Fri, 25 Oct 2019 03:55:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40487) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtq1-0004kW-NH for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtq0-0007Fj-Ki for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:45 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:51092) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtq0-0007FJ-Ee for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:16:44 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 11so876866wmk.0 for ; Fri, 25 Oct 2019 00:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RBkpe4GEuH6saQwGoDoa7cSKDDeby0g+/F7eldRIZd0=; b=sVmfgZgEIjmhtj0555OUTriBxgyzaIR5YyC93fJUScvFjHIexkbIJOjXXX7ddc4sLq gNk3RN59zunoy1bkyUIox39OuW6goSwKH6X2ZTcHwwwiBHRAFZuImSFw5qD1W1KprYJK Jj8m+Mi5VIq8TJYTMXdMyJRobm7J7YzooHGVnIC7npQHZ3oyZ3SMKhqkzzdAHgg73g91 o48CEz0l97NnPooeVKIo36fcRko3dtiTu/w2ev0hXgabzGcy8HdXvB8LAEZ+Vg98f9x5 9B1dz2EFotZFIryAeECZh0tJ7wRzy0LiCFdG7s7ki1XZPSnguVxqfZYDrV5W/R1IKYW5 61HQ== 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=RBkpe4GEuH6saQwGoDoa7cSKDDeby0g+/F7eldRIZd0=; b=AOTjafOWWznBTxtQEv0wDkyG3wHAE4JS3Mzgc6ER8tL4RAMUb4S6vxjnL2807mP+Q2 tqFEj+pLH6RFYri2tOuFpcwax0blley3tG/Wk/CQV+Ljn3RnzwGSMYNsuahkUd5wE4R4 dNKSAWfcAwg7wvPNP9alZV9C2zKEsu/MPP7fTOTFMSGbqM7hfQUhLgIcs7XIQrOKH+Tx TwvJZczeSmU7GxeoPABUuRTfB0bjzah2z7U/khS6L3RousPEZF53oTNDe4qbG15perwP E4EChVlB2aZV32nah/4TZRzyoMypBRKUKnwybXP5K50++cPd2z86h+sdPzNeq3SeN0VB 9I7w== X-Gm-Message-State: APjAAAX8GDFjOsMx6r/9tNQ1A7ILXUzmurBA0++m7iW5J5A3uNRQQQqw u81aJRiNTP3qEpFALgsIbtzkbDj0DLA= X-Received: by 2002:a1c:a6c8:: with SMTP id p191mr1847674wme.99.1571987803408; Fri, 25 Oct 2019 00:16:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d11sm1386866wrf.80.2019.10.25.00.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:16:40 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 21BDA1FFDA; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 68/73] accel/stubs: reduce headers from tcg-stub Date: Fri, 25 Oct 2019 07:37:08 +0100 Message-Id: <20191025063713.23374-69-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32f 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: Richard Henderson , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We don't need much for these. However I do wonder why these aren't just null inlines in exec-all.h Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/accel/stubs/tcg-stub.c b/accel/stubs/tcg-stub.c index e2d23edafe0..677191a69cf 100644 --- a/accel/stubs/tcg-stub.c +++ b/accel/stubs/tcg-stub.c @@ -11,7 +11,6 @@ */ #include "qemu/osdep.h" -#include "qemu-common.h" #include "cpu.h" #include "tcg/tcg.h" #include "exec/exec-all.h" From patchwork Fri Oct 25 06:37:09 2019 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: 177665 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3279515ill; Fri, 25 Oct 2019 00:27:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwW9udqawO25upG2psh+g4DIlUhB7ljUPmKLNk02MKqOyaK3jItmlL8cbV+TXtnfYQ7t9Gt X-Received: by 2002:a17:906:4dce:: with SMTP id f14mr2051505ejw.22.1571988441831; Fri, 25 Oct 2019 00:27:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988441; cv=none; d=google.com; s=arc-20160816; b=BeKO4CiiYMj+zfw5WP9QuAx7LPisaRyxU7h9AqUrjQAovQkxUkqZBFQ0yaC/dr+/uE zN7/ZdIqDUnp6WVKBjg9B0s8ndNuHizKN3uAeIWtVgBcdOfpJ1ysvYBuKGcqlCVOOi2c 9QhJE+bNuEnkD3DUaUCtgNHwduSQ8SIGrfzrgTeE4TPBbGidJPWD/YQpCgbG+sDhIGtX OGkiCnMuhAR8pmEyJpuvtl2HJS5Pu4rIjQFHHJNhJ/SLXb/PJCYFlrlZ6Xiz1KkkfJVI uGq7A4r2FDtMTSzsj4ljcsU1GJ8DVabquACQeGLrzHAh54VDjP41P4COvqeqllKqQKv4 zUZg== 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=FswrUErKtSfHmvlrq+iA8uPbY7A+O7qv3ayuySYET1I=; b=tBH78orCuSUrKnxILBVenEXBMJiIHnfabjhNlK7M1azJyjc40mAjOb+yBiNktr7k8Z /bkc+fcdMkwCDStYBM2LTgZdYN2NrFnfjohnZWW9sfqohacQBMOQFZ2ylU8GElP9zuGz 6Xmjx46Ewa9o8nBBguhuhx1dwCzPTFtJZW0u3eaIswju0YwbG7irXquCRuSM2TZSrSMB TaWyEmy/n/TfM9cxzRBIq9SYzDG59IjdM6F2pV4PBcOQyuYytihI25FVz6Xz6x+jHxKU 8pTO128eVQqiheUlv3GRIHaU/8G4PfkkW5BxrZ7k46Vd6US2gg4WX6sZgGVljPcHnwgB +vMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A8Q48hIR; 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 x7si684600ejw.75.2019.10.25.00.27.21 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:27:21 -0700 (PDT) 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=A8Q48hIR; 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]:56768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu0G-0007VR-5U for patch@linaro.org; Fri, 25 Oct 2019 03:27:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37067) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN7-00088P-VI for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN6-0003He-Sm for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:53 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:41067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN4-0003CS-PK for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x430.google.com with SMTP id p4so926877wrm.8 for ; Thu, 24 Oct 2019 23:46:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FswrUErKtSfHmvlrq+iA8uPbY7A+O7qv3ayuySYET1I=; b=A8Q48hIRTduLXAC/SR7pJlUu9kKbd1BunOMPKOHdOHLRVO2BqzRtjzJQ6L0WhOnFg0 E2FWdgJtQ505u0epkV+iKKpgd74TsKOZ5MbiKWWw/IumokDkhJq/3O5Va4bRchVpjZfK TknjY7DRmeXrREqMJ6qeVU3TU8ojujnX8A8MFfamVl2LinKbEgsJFDFKjgDhM7XCirWM OVRDNVA6nrMsHG1aJfTiwe5aDvBhfkgihsJq1bb3hklKNLWiZjXXlT9nR14O7SYBLiFs O5rL+XcFGemEsmcn6kjDjSGHk0VtrRi+QnIz3oAEWQgegtda+fsC79yK8KoOqwrl3ST/ 6vCA== 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=FswrUErKtSfHmvlrq+iA8uPbY7A+O7qv3ayuySYET1I=; b=pK9X67NxmDoCPjAJAVNpxt4e7kGbMAwDlGL1AScVs7nmzX3Q9RmQjYZ+Uhg0OdQn71 A+FHl+/g6JoHYd0PNzAG+G0K/vKH1O7qb9cxf7AOYiSy9LCM5Sf7+GiXoYbqj6cIsVYK CJSBwOkqv7h5Rr0Bn5wVOCHXShsm3f9xMKQ/l4VZkJcAnEFmMiGarQStIWrSo0BwpHKF +MGCkWcTbAmD9nk1q7TfklcAg+7cwpHMsGBbv/92pjGAg36edBHw3L91ntk0clfPfkLJ hUWbXA4RlmskCXXrcffGotWyuECAxwO+MJgMRZyHETPoRLvtzz6npAr+ioYWKHRKfYUu WSUw== X-Gm-Message-State: APjAAAXoN80vA+kmc5J/mm8JmI4Y1Q+BHBFO/UFpP7yjJcmLdKJPgTdb owiyjZVsZ55M4OpZ3Sfv944QZkViSIQ= X-Received: by 2002:adf:ce87:: with SMTP id r7mr1281489wrn.307.1571986004859; Thu, 24 Oct 2019 23:46:44 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q14sm1482743wre.27.2019.10.24.23.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:41 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 353681FFDB; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 69/73] include/exec: wrap cpu_ldst.h in CONFIG_TCG Date: Fri, 25 Oct 2019 07:37:09 +0100 Message-Id: <20191025063713.23374-70-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::430 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: Richard Henderson , Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This gets around a build problem with --disable-tcg. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index eadcf29d0c4..d85e610e85b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -22,7 +22,9 @@ #include "cpu.h" #include "exec/tb-context.h" +#ifdef CONFIG_TCG #include "exec/cpu_ldst.h" +#endif #include "sysemu/cpus.h" /* allow to see translation results - the slowdown should be negligible, so we leave it */ From patchwork Fri Oct 25 06:37:10 2019 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: 177666 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3280725ill; Fri, 25 Oct 2019 00:28:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHLbo7oQDBUUEc5o5BKKLNTRKnZ3F7Qbh6YFvzDABiFq41GAzeJoHn1A9zxgB4PtmMuCIi X-Received: by 2002:a17:906:386:: with SMTP id b6mr2009956eja.148.1571988516912; Fri, 25 Oct 2019 00:28:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571988516; cv=none; d=google.com; s=arc-20160816; b=LlI9VM42aBDomXjE3sf94GaPhVgQIg/sMM7NQRqqPKXmV3Nbovd3HwwP79Lgod87pK ME1Kfa/Ac7eoTKhFtyZl5miYik0OwRx/ABzzfr5s7GEt9kfBkRX9Up4sGRecDIhSiHmL XeotgIKUihJZaFOSW18VuyXbE6xgf7DCEhm9TbecK50ta4hy+eW29YWABnYqfU7v6RIa MNnzkDVkHpj+po149xYonYJa5yjPbMBFYKMXHTwxEDoDbJBVBlamQ1WWuKOWcnR6PXsD MeS8qF1C0u1L59jR/ywueVG4HWHZ4WatJXrrb9vjX5n9NZ7Q3EtUpH34p7VWMVogndKC vRgw== 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=U7WrzD5ojl0k5ckh0pkIszWgrZ0CrHuIRO3XAz8bE3o=; b=yE7kABxTqu40W79cUKyk1TvqhTIZ7lLe1QLebmowQ0l5C5RGFXHfITusYYjDjdSmtd GyX+IxoQyg46eEtkRrsgDsiRbS2wIjgFxuBsWOjact1q4xZ+YBQd89tgfDk99nJr1lqS WMuaiNEQWTjDVnaTsV3tsEMe/nCzjE0bAxi4FBilSuzi8rXTbuSCTMb+osQzJQfZkpOj yUfwxaHUkE8xgTVgWpWndpOkfJYvpt1ehsrYwB26nZE9UGjZOi4GE4HVRRrl1RWGGIx9 XvrN0Y8Agn26vgFmdmoYEGFXIQrVPFun5F/TXDcUmC5w467ztCvbtE6pOwI4fL8aAad0 77iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FhLt131N; 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 e4si878233edc.146.2019.10.25.00.28.36 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:28:36 -0700 (PDT) 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=FhLt131N; 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]:56786 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNu1T-0001Qe-9j for patch@linaro.org; Fri, 25 Oct 2019 03:28:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38306) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtWe-0003bw-VO for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtWd-0007oQ-Th for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:44 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:37976) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtWd-0007np-Nj for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:56:43 -0400 Received: by mail-wr1-x42b.google.com with SMTP id v9so973651wrq.5 for ; Thu, 24 Oct 2019 23:56:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U7WrzD5ojl0k5ckh0pkIszWgrZ0CrHuIRO3XAz8bE3o=; b=FhLt131NSYQMF2mLzA3FpVRzhCGSMmAiBlT4HZ3k4sWZiPyo1XDfzuKOCdxBLs3iqy Nj9toZY/xPDnY0thnxeMjnluzZDiHHPTMwzUwgY8a0YHcx/MKhBjICWSVMF24HU1GZl/ hw0nd1pwWYU6a77GNBqPJrGT4H2fmGEhMl0g6ogTP/pUiilKtUAZx9otnbB2qvok+YmQ G5ca6nem70LLwKu7KrSOo+fmx5bAK/JANyacurKCse4N/OeBLRQXOQOCY8u9Cvtv0o9z fMtFhoyyHw3djlu+lPs/fKKsVt8i7I7xipPCMkn3N1Tfn7JTTx2ZqBfajVhQKW45kxRT jQeQ== 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=U7WrzD5ojl0k5ckh0pkIszWgrZ0CrHuIRO3XAz8bE3o=; b=EefMIUbcWdNWTe4AJI20vcdsdRVZrGJiFq9hSJagwPxNS9VqtpF39ka3Rl4m0TebUt EkHMg/DBi6VGJff9+g0Qz1u+LRCAi/cwI7E0lrMI+5dIzBoqHOJ0hArbxwDze9msLWop kdGC04exb55EV3I0XLqpkIjtakaa0rxsG/pNjeJNFxodGNaDjbunHFCIqZRCYUXqrDDL AJEWSy8oCvfh3iFXzeSgiyEavcQrSlkDi4e7Kp3IHD/faYW5XhAhdZpN0e2rLO+VyrIB aYUUn7abtw1wDyTFLmrBcFtoSqFdy5hCK/ubf+Lt4TrwrK9suYGadZoeD/kZYChf8HCi P3bA== X-Gm-Message-State: APjAAAUixa6REZ1YO0098mXa7JDhT14sOc/6fhWQ0DjR5PLP+s5KcSo7 lGX8pTIJG5QW5il0DDmHC/lgUBwESPU= X-Received: by 2002:a5d:51c2:: with SMTP id n2mr1304422wrv.149.1571986602555; Thu, 24 Oct 2019 23:56:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p1sm1136544wmg.11.2019.10.24.23.56.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:56:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 491F41FFDC; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 70/73] .travis.yml: add --enable-plugins tests Date: Fri, 25 Oct 2019 07:37:10 +0100 Message-Id: <20191025063713.23374-71-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42b 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 , Richard Henderson , =?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" check-tcg will automatically run the plugins against most TCG tests if it is enabled in the build. We exclude sparc64-linux-user for now as there are pending patches that need to be merged fixing it's fork implementation. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index ba3a8d4cfc9..e3f10a93683 100644 --- a/.travis.yml +++ b/.travis.yml @@ -339,6 +339,14 @@ matrix: - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + # Run check-tcg against linux-user (with plugins) + # we skip sparc64-linux-user until it has been fixed somewhat + - env: + - CONFIG="--disable-system --enable-plugins --target-list-exclude=sparc64-linux-user" + - TEST_CMD="make -j3 check-tcg V=1" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + + # Run check-tcg against softmmu targets - env: - CONFIG="--enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" @@ -346,6 +354,13 @@ matrix: - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + # Run check-tcg against softmmu targets (with plugins) + - env: + - CONFIG="--enable-plugins --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" + - TEST_CMD="make -j3 check-tcg V=1" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + + # Release builds # The make-release script expect a QEMU version, so our tag must start with a 'v'. # This is the case when release candidate tags are created. From patchwork Fri Oct 25 06:37:11 2019 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: 177647 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3261042ill; Fri, 25 Oct 2019 00:09:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrtnbizm7aFiwa1ShSJYKNRTm8rS8X3dEgLXSOqhHHCmMkXL3aSiAH5dRtig64CFsjZTsr X-Received: by 2002:a17:906:31c1:: with SMTP id f1mr1927961ejf.242.1571987365214; Fri, 25 Oct 2019 00:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987365; cv=none; d=google.com; s=arc-20160816; b=t0OrrgewVgmWNkdGPrpGtNwtsxQjMnAO4d9Kt0Ao/bgBSocS2HuVTkW7c31CneSHmB lVWdLEAFoczO9DHYH4ZXomE0DbFOlon8keJnk8+Cbc2s+iFxEZPS5JqgfhINrBFMoDa6 VFBRGzsSRSLZNfxHLyiv03K84cZW9AkiZKkzgG0rtzAPdZGFl13sZEAU2veCeZO7Rpev XdlEiZmM4ewC9Kjgge4izMDSW4pBQX/ZUpk4p+UQcKjcSFlj1KhiVEBXYZmjgjvjpgnP GcIqG+SPh1nJPygd70sBVduAX4CU922n7QXj08mAn20uqCfs7qX+ySYTIKt2LQ6uQlG8 CkoQ== 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=4Fxm3k4cHBOBik3KvWndMPIE/3gLAlHObkdSa6YWSiE=; b=0jPuQVEM5ecMHVTp/dH3iGecSZoHoC37jt56OTSSeU0EwS10RZKduewdLXhedejrBV Dbwwc8/j0S2fU8yCWfzd1cOMoIor8uYVUh/7ENfry9yUpZYlvzQOmDOolmZtSnXKmAFn UuT7VJgakUlNJrOCtW38+JMFc7QyCLeYjOcFHB2ocj4X5EgMnNPQ6ThkX0ZiLgJcHYe0 NInKeLC0f0n/xPhf56qnoZnB3bMbZstDDdlKdV3Cueu+wwtpJrfercqajdLOGelBj22y dUpft2YPeNv8Ca8v4mDmqO0DNCRAOVbRS9gy5sE9jFL3pF+M35CebqCgbxUbKmikMXzv DIyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="y//VJHjP"; 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 b9si668308eda.115.2019.10.25.00.09.25 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:09:25 -0700 (PDT) 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="y//VJHjP"; 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]:56424 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtit-0006r7-F9 for patch@linaro.org; Fri, 25 Oct 2019 03:09:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37023) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtN6-00087a-OZ for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtN4-0003Fq-E3 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:43713) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtN1-0003AN-Kc for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:48 -0400 Received: by mail-wr1-x429.google.com with SMTP id c2so918749wrr.10 for ; Thu, 24 Oct 2019 23:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4Fxm3k4cHBOBik3KvWndMPIE/3gLAlHObkdSa6YWSiE=; b=y//VJHjPi8oXoP6/pCX4mtHAdC2aDme2FqibBFdXwCDak2KW5iuftmUI68lfFNlU5P Y0UUxtv0RS+rzCzWbIFkUO17YM4Hspb54IqLYqz4xSKesSBMsAfIT2qddWEW1QphbWQZ hxjUfBUfAGonDKrDhwVis6x4sgqLITPKAUEQuwqPro6rA4zdlF/1zeV8rJuwMXdA/uUM 9kefSIsLm3rFtu51qHmOsGQPr9V+kn3S7NLi3LMeK1UEXM122Uw8ukZYMu7Fce5UiAE/ vjkQsBVPtzaZxEGoBIJg2yxocb3Wg3/4GwJpPP3F6i0gSExt2T75BDcO6fLcmZO5BJjn c3Og== 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=4Fxm3k4cHBOBik3KvWndMPIE/3gLAlHObkdSa6YWSiE=; b=i8e0ccQTmAr+iP/gxtsVsv42mg5Sv5JDScHH1lseQGQVckDgCyrKrheh2E5TEjIHQA LAJYAZoAhCBsqW1P4HIvyYuZNU7BOBW1AgqlwEfbWvLlmOsMHVMw0EZJt92Ur9EQG6jf ZUhRJ4KxB/sm6FcOZNUnCiQmklZT0yUBCDmpCcoCyrohqetZPqI5mSI9BTo3593nyR25 OpyJxuh469xBlpYg9LYjuKKkg1ZAeJk0dvFFetFZQS8YBgYn3mQMAqWwb6tM/LnXLFrN /dme6y/3wCvdmgNjJlvzrIZriT95RpNblAI+cDvqyZDqpBGhyj++NgDirSctfMTkO8J1 5Wlg== X-Gm-Message-State: APjAAAXsrzNrnVHe3CBjlgz09d8znYbF2yC7veoUFBTGRbHjnq18vzlw eoKOWdcf+6nhSt9GwjWwlghU6Q== X-Received: by 2002:a5d:6651:: with SMTP id f17mr1353853wrw.175.1571985999073; Thu, 24 Oct 2019 23:46:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f17sm1136353wrs.66.2019.10.24.23.46.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:36 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5C35C1FFDD; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 71/73] scripts/checkpatch.pl: don't complain about (foo, /* empty */) Date: Fri, 25 Oct 2019 07:37:11 +0100 Message-Id: <20191025063713.23374-72-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::429 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: Aaron Lindsay , =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" It's quite common to have a mini comment inside braces to acknowledge we know it's empty. Expand the inline detection to allow closing braces before the end of line. Signed-off-by: Alex Bennée Reviewed-by: Aaron Lindsay -- 2.20.1 diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index aa9a354a0e7..db67b4da872 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -1639,7 +1639,7 @@ sub process { # Block comment styles # Block comments use /* on a line of its own - if ($rawline !~ m@^\+.*/\*.*\*/[ \t]*$@ && #inline /*...*/ + if ($rawline !~ m@^\+.*/\*.*\*/[ \t)}]*$@ && #inline /*...*/ $rawline =~ m@^\+.*/\*\*?+[ \t]*[^ \t]@) { # /* or /** non-blank WARN("Block comments use a leading /* on a separate line\n" . $herecurr); } From patchwork Fri Oct 25 06:37:12 2019 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: 177644 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3259986ill; Fri, 25 Oct 2019 00:08:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbo3MESRQPU4hoJgD8dPd14thwIFuHSiLmWQ3ADdtCFqB2tqrTCDD+BCTAyDy/3o8ptQ0S X-Received: by 2002:aa7:d958:: with SMTP id l24mr2277782eds.234.1571987310819; Fri, 25 Oct 2019 00:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987310; cv=none; d=google.com; s=arc-20160816; b=Q4K0NLeCigWamDEHCOsTJYoAY6c3AXC56vlDy0kPShdUIAkRliL6QQiT5xsVUSlJ3L VvSEB+n72pl/9KzyPTqZpcFqy9cZvVhvobXxa8WliuqaX8xFNcHMDKMXUzEi6vr59j9P IGv3qV79dCm0MAIB4RvfCZXGw7qFoqL/ws4tB2sjFl5l7X3D7hL7S1RJ8+ItfLNiJvyO WCKoWOE20RrWEj3oUrYo0mogwcwJfnvmWlPKDLEyZWyqAuqzb48MJmS2Rzb3FC7nSipC Pm93KlOMt0jWgNUa4laX0k3DAA6LsPGSgY4Qj3LoNvKGCDPrQL9FXcUUlx3Wf/5OQQWa Fz7g== 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=yxnUmUrN/VmnORaacGEvXlk29KbZqX8IayMFp0qzT/w=; b=mCtST8LgByRqqtJ4QaN6PEk0mGDBLLCBuplkM4JRnY5y20mCXloTY+ERO/ywsaWi97 GifZB6sqtbgRiSlXEp2Xt97NM/NxfAMvKiowQY8pMxdom3gAPhyIaJ55f7cH+JcdlAf5 QO3L5do/IKqs57Bvr+3W9Fsz9ka6+0IsZw1/io2tp2uZHav+6P4PGHWIdv/xRqcPKSQD UdFYqmqLsxArQGKyfBTfLNj87HBSyin6XCN6gLkS31DXuuds3geBSI/m3golo5iuqwJx HeI+WV+Mz5xcj/S2wKGZHCC1G3GL2E/8Ym0vG/XAZz2yADWR7FoeDVM0BDuHFgSoXC5V c+wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=rcfxAIOD; 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 j12si644244eda.406.2019.10.25.00.08.30 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:08:30 -0700 (PDT) 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=rcfxAIOD; 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]:56404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNti1-0005kJ-2j for patch@linaro.org; Fri, 25 Oct 2019 03:08:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35663) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNtE7-0003Sg-U2 for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNtE6-0008UN-VS for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:35 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:33267) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNtE6-0008T0-PU for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:37:34 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 6so3526588wmf.0 for ; Thu, 24 Oct 2019 23:37:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yxnUmUrN/VmnORaacGEvXlk29KbZqX8IayMFp0qzT/w=; b=rcfxAIOD7fXlD4hqTjItQZG2EDF/kUjb+IH1qqUwW66D+X08EM0+jm1vJBcOXRNxA6 PGCT0Nx9u+xeWWumHg0nzqL9r+gLMuYZtp1Up8uxFQhM6oigR6ZzMOPVKyZIwZwWYdf5 fWPbSvu87ge0xfl2uIg+pGYVsYJKGeG8q939hHndRPAwJRn25LGDfP8Kkd5vWcPZLHJo c04Z5l+J5NMLHwKn5DZQmNQmm1B5yqDSbgbqG3nLwEveqBVgVDIRMO9G2PurLq6aBYFm g/PWJRRzyOgHOxNur2noYzc0+uZkHUVQCGb3oAmX3/Pgod7W3bKH2QZskbvv1lOCyobe 6OhQ== 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=yxnUmUrN/VmnORaacGEvXlk29KbZqX8IayMFp0qzT/w=; b=uR05BCWgZFelvW1XumywHB53dxadbDB5XV3jPCFsUGoPjuX1zMpfH/3HPlmlM0/CfF HXwraX5xjYT2HwoEhrrAEUa6wmC3vUn1wJcQOke73/NYGv2xlUImg7eweAU4LBevSl/c vJSSRAuU7IEeJgy/TZL3TE+Zlsscv2WR01fpG0EcSgkiFz5/MQfgLDYXwt96fji1n6yh QsfVEq6Qm17ZeBUBwKCOZZXwHiaTY2Xa5bcdXqOr2FkpayNR98jqTbvlms0h74nX73Td aqClLFhoGX8m/daT3bDYEdbTPfxLJKWH2vFP7dYEB1rIdL5SQT6TaVEDd9KoILRPwA7w 1OFQ== X-Gm-Message-State: APjAAAW7Ynx1hSC0X8kjCYIAZL7hfJi/jNBvVsNcGbctdX2xAR1ChTwA VGjAuTCXihobdWBKVN/pQbtuTw== X-Received: by 2002:a1c:f718:: with SMTP id v24mr1775983wmh.82.1571985452738; Thu, 24 Oct 2019 23:37:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a17sm1408799wrx.84.2019.10.24.23.37.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:37:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 710871FFE0; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 72/73] MAINTAINERS: add me for the TCG plugins code Date: Fri, 25 Oct 2019 07:37:12 +0100 Message-Id: <20191025063713.23374-73-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32b 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée -- 2.20.1 diff --git a/MAINTAINERS b/MAINTAINERS index ed41d7d1b6c..ade2187eae4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2328,6 +2328,12 @@ M: Richard Henderson S: Maintained F: tcg/ +TCG Plugins +M: Alex Bennée +S: Maintained +F: plugins/ +F: tests/plugin + AArch64 TCG target M: Claudio Fontana M: Claudio Fontana From patchwork Fri Oct 25 06:37:13 2019 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: 177701 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3312564ill; Fri, 25 Oct 2019 00:58:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCG+/naQ5l6K+EjfCtv5s1jVjD0FnUVDKliaGWsET/CZAMGnoYMCZS5s/360LqBRRqVj5J X-Received: by 2002:a05:620a:6da:: with SMTP id 26mr1809267qky.184.1571990283754; Fri, 25 Oct 2019 00:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571990283; cv=none; d=google.com; s=arc-20160816; b=djxs5fVAu5+ND6kaK8HMuy4q3rw/DT7vmuT+EkeM1wwxfo9vsusApyxxKw1+sSNdpA lXAxOw7GmC5wc53VDypM4ApRDYLLZVpHXxhxhv6kaGTc0HNb43tip7oFvbScsrAlIw1m mey4xp6bQjfkUvOZ0GusuL7NCyFFBKU25HKEoEJRn2GXOVeEi9+GUoVxP2Y+60X0hzT4 JFzhjd7jWeJMvioHSteCziT/WRGRun8Ua6kKnHEaon8na/Rn+zzsDjtxIrQcC7eHORmd 2CHYK5VrMx6PhlMZUZAS+EVjv/+sNzHbu2gVqv67JpWEXZ0FACVhhk4GlXwh/hgZbSnF pYFQ== 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=8r9gwAqZIg/CQxEo38LJIsJlTEF4FbM9PodERbeO51k=; b=KUIrxYo+Mwo6FvFs9lARIhHZW0R5XLC/32hNNggZnOVfsxJ77kJY1JfYR5GJvw5bdz u/gXvlIdKlwlst9gTJ4/X0cdtICSl/ahrk1h4FKxQ/JVJfuaqN9kC6G85DU6g95q0fTx hf+OzkKghGYpPr066Q6BwAdVCMxTYu816POkxg8GNo4p1uMiKHdTpI12RRTvObxIvIe/ 9d+W3Chrc94P4zqmQ5ak3PtKl9rcmijoJOPMXcpmg/Uh5vIdmnAXCFW2Lv8fXI46vbEH PQFUFO0BWVU7BhehL1gbOgt8qwfeKyLdTj/TbhkC/Zn0F8cI2vT9Y0947EJNHIZ5BLfG Ppfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eKem9Zhz; 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 o188si867612qkf.352.2019.10.25.00.58.03 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:58:03 -0700 (PDT) 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=eKem9Zhz; 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]:57300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuTz-0000J2-8y for patch@linaro.org; Fri, 25 Oct 2019 03:58:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44922) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iNuSb-00062d-6H for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iNuSa-0007ym-0D for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:37 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:54168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iNuSZ-0007xW-Ax for qemu-devel@nongnu.org; Fri, 25 Oct 2019 03:56:35 -0400 Received: by mail-wm1-x333.google.com with SMTP id n7so991228wmc.3 for ; Fri, 25 Oct 2019 00:56:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8r9gwAqZIg/CQxEo38LJIsJlTEF4FbM9PodERbeO51k=; b=eKem9ZhzwZ9ZyGvJROjuVbyUhzv1Yv3eayqG+ldar+nGx6V46PRzqNJATU9bcn1v73 KLA1vFiWvk4YcTeSxfDlRB91KGyXS3nBYXGqbdhQMudYit2Av2Wrv1O3pizdCBnOgUyY WzFeZG97XyzeG/4DZfP+Nz6+wCtU6jLDQxXo9S3OMJU6QmV5XFi2bJA98i5x+wENbAYu EKaaaxziZId4EnRRUZAzG2ij6wOwomqARU98qPB53CKlZHEqQ4NBffpc2GDu05tVOgUk /HKqemYiUqT5oB7qnL7lMAQ27tjeZeV9mqRgAU5qh7ru9jWoP0JHh5/Q5DT9OTK+AF3w b11Q== 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=8r9gwAqZIg/CQxEo38LJIsJlTEF4FbM9PodERbeO51k=; b=EUg2tfcNq5/Q2Y61BGwLLqg3xLYAIju5mUaUTbvCBa+dfpIWi8dx3ggdIkEAiuAGPd /Wdow3sLoz4HWNlznvjMNyRVzQ2D1ZX9ytEPTJsvekjGppwH6Ejmpx3o8OEKo25QF5YL AzYgplICbmvusdqwVZvGDTWX3qDjWFb4oo9qgr1TpOPkbpbMfAwih3+jz6g0IJypvpoh m4++ALWzX3EZHMReL3EVG8Bk4qnqwQOpz3VDZ2kFRxHFK/Dljq49F9GWznRJUIr83MHR nozZGal4CYPEjOIz30m+HTsoylG4uI01UicKUJ6/z9vXTuAmMDTimlzgu+O8iDrdju3N LTqg== X-Gm-Message-State: APjAAAViDKvvjxcVUYSRhOmuLIPB+3kGcDsKMOo/t7k/zG6ZPbKJNhOQ +ZE14ynAFJz86VvdwwBR4CrrpQ== X-Received: by 2002:a7b:c444:: with SMTP id l4mr2173737wmi.49.1571990193536; Fri, 25 Oct 2019 00:56:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n17sm1400839wrt.25.2019.10.25.00.56.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Oct 2019 00:56:32 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 846971FFE2; Fri, 25 Oct 2019 07:37:20 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 73/73] travis.yml: enable linux-gcc-debug-tcg cache Date: Fri, 25 Oct 2019 07:37:13 +0100 Message-Id: <20191025063713.23374-74-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::333 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Create a new cache for the --enable-debug-tcg builds which is separate from the normal debug builds which generate different code. We also enable debug-tcg for the new plugins based builds as we want to ensure any breakage to TCG is picked up by the sanity checks. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé -- 2.20.1 diff --git a/.travis.yml b/.travis.yml index e3f10a93683..34bc8134f5b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -135,7 +135,7 @@ matrix: # TCG debug can be run just on its own and is mostly agnostic to user/softmmu distinctions - env: - CONFIG="--enable-debug-tcg --disable-system" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" - env: @@ -336,29 +336,29 @@ matrix: - env: - CONFIG="--disable-system --enable-debug-tcg" - TEST_CMD="make -j3 check-tcg V=1" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" # Run check-tcg against linux-user (with plugins) # we skip sparc64-linux-user until it has been fixed somewhat - env: - - CONFIG="--disable-system --enable-plugins --target-list-exclude=sparc64-linux-user" + - CONFIG="--disable-system --enable-plugins --enable-debug-tcg --target-list-exclude=sparc64-linux-user" - TEST_CMD="make -j3 check-tcg V=1" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" # Run check-tcg against softmmu targets - env: - CONFIG="--enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - TEST_CMD="make -j3 check-tcg V=1" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" # Run check-tcg against softmmu targets (with plugins) - env: - - CONFIG="--enable-plugins --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" + - CONFIG="--enable-plugins --enable-debug-tcg --target-list=xtensa-softmmu,arm-softmmu,aarch64-softmmu,alpha-softmmu" - TEST_CMD="make -j3 check-tcg V=1" - - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-default" + - CACHE_NAME="${TRAVIS_BRANCH}-linux-gcc-debug-tcg" # Release builds