From patchwork Tue Oct 26 10:22:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516180 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp137274imj; Tue, 26 Oct 2021 03:24:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9XTK/w1d1GpV1YmGEwr19fOxGuYG1s2H4tYfESi2JP+uhYNZ7kty3ZvUdQzqW1481EnR2 X-Received: by 2002:a05:6830:1da7:: with SMTP id z7mr19075766oti.242.1635243845068; Tue, 26 Oct 2021 03:24:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635243845; cv=none; d=google.com; s=arc-20160816; b=0/D++GUMXGrT7APZgrthRQr1w9CWGvpr53lrJCegRq4CvdnvRPwsvtnzPZlyBQ7G8+ tsXoVFJcAImDjyCeQOubVdrBV3OY8w51jybcrhNBpBMdaTmCrJJKjSZmpWebnxyb6E6s Qaj6IxW2v/M496C/R/nOvR8AghDejMVCgAtnFcTHT3ddBnWSBv9uBxQMEeqbSq2p9Np8 BJbSfNJZQ786GXx75WWb8333Kz2LyLJU7COGg+ppGfJxcwyt5YY476jX9xMZfMdlHe9R 2YS6wXEsYM2atG0SOSyiqly3etaZEaCKC/MOZkvSBMQmuB8ELuNRPuEmip3t1wkeJG8W Npog== 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=ngRXN6C0rFj50pv5HlX9iEwqM22NePpMgE0oGy9fjwo=; b=sp3wQFbTapc7u2LJSWISGw/92a073bF53Nox5wUN2u/tbbN7S6F/6jK+Mev6UX2lbY 7UtN78UZA+ebLpRKzVGpbYh51vTWz16gZswxRTTQ/G04E5JNnfhIuNcbR3riQw8gGH7z 4JkahtMiYjZYKNOzPOdK+ggiBQ2yJZXNhOi6TW8T7RnXQJy6upGXKzqvrdNCIrkBskkq KfeGIPYtOqqN1MWbfz0pj7ngzya/frMPQ1I/MLBx93QkXqZOV+89nAGbX/akl7NN/ZID H4kUUSnNBgdba8BKoGIGf/3szTDysrtasgh8ft818FuDmkROs4F5KcppXlKOVlV1tqp6 CCVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="ynw7J+s/"; 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 l6si23535836otn.52.2021.10.26.03.24.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:24: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="ynw7J+s/"; 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]:58328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJci-0000sZ-Ep for patch@linaro.org; Tue, 26 Oct 2021 06:24:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbT-0000r5-EK for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:47 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]:34780) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbK-0007PN-Lz for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:45 -0400 Received: by mail-wm1-x336.google.com with SMTP id o4-20020a1c7504000000b0032cab7473caso831547wmc.1 for ; Tue, 26 Oct 2021 03:22: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=ngRXN6C0rFj50pv5HlX9iEwqM22NePpMgE0oGy9fjwo=; b=ynw7J+s/qjycEQ4hsT4/u55OlWBDoKM+fwuB38nj7JT6Ed7tK4XDbTZOayvKISXkHb hAmI7oc9hu6dKBJId1aH8X4wUZru9X9rt7nAXi+H0/VmMjOm0obOMWIp2DWv620HWbPz aDiNCRTtssJJv+GfdH6Whcohzw6om/JnfDMTg52zZNn38boc8YyQLeGCgmsk7XXrXGbn FgTrz7hMYJ98b2B3zjF1tGPAlFY8Yr7vgw9GH5PNy75dANNCj0M1HfaEYCa3L6fAiArC L+9de58HXUVWA8jF6uHaNBTmZ2JXoYirndvDorG3JgK4UkWEXanmfw2BlCpZuEXma0si RMTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ngRXN6C0rFj50pv5HlX9iEwqM22NePpMgE0oGy9fjwo=; b=dYnHRC0OeUB+LluAzB42PBxNwjipIEBLSHXXV21T0Jqptlkwj16oS7L1qKkOW6hWqB He6aaLhWTDbJf2gPnbMZW/u6UiMueD370iIAM8j6dvhjf7GVydrnQgtBuEBVfps17i+n RlPkA6J6iqGGiZAv2IDbbEqrazMZHmw7jAqDUWTtdAMbwwmfk4g9Mgvv9RJFq8jRrWcG 4RvwNhTlFWpn/jnvepriIGVCJHV5aPunoK6lufAfQXlQtYy4qAC8wL8imjzh9q2R3Tlh Ps9grrQlIpPuSb9lJJ+xvqPZgJ8+E+ouOCeJe6XH6CVg7MUWDJZFd8wD3DvE21+dBidC lF3A== X-Gm-Message-State: AOAM532qT3U8rXTy5qnrFOIFfibHWyQLZjVznzHuEUxSkAgpPpvCKZuP 97xuVqH0iFGAgsLYervriDx+LQ== X-Received: by 2002:a05:600c:209:: with SMTP id 9mr955040wmi.143.1635243756742; Tue, 26 Oct 2021 03:22:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l1sm9363051wrb.73.2021.10.26.03.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D2F231FF98; Tue, 26 Oct 2021 11:22:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 01/28] tests/docker: Use apt build-dep in debian10 Date: Tue, 26 Oct 2021 11:22:07 +0100 Message-Id: <20211026102234.3961636-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Replace the complex apt-get subshell with apt build-dep. Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-2-richard.henderson@linaro.org> --- tests/docker/dockerfiles/debian10.docker | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) -- 2.30.2 diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker index b414af1b9f..d3bbb90c64 100644 --- a/tests/docker/dockerfiles/debian10.docker +++ b/tests/docker/dockerfiles/debian10.docker @@ -14,7 +14,8 @@ RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.lis # Install common build utilities RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ + DEBIAN_FRONTEND=noninteractive \ + apt install -yy eatmydata && \ DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ bc \ @@ -33,5 +34,7 @@ RUN apt update && \ psmisc \ python3 \ python3-sphinx \ - python3-sphinx-rtd-theme \ - $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) + python3-sphinx-rtd-theme + +RUN DEBIAN_FRONTEND=noninteractive eatmydata \ + apt build-dep -yy qemu From patchwork Tue Oct 26 10:22:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516181 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp137289imj; Tue, 26 Oct 2021 03:24:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjUxCkOG8cQcofzgl0IqU9XyQlVTxLe6786f6Mo8oymimPJ6ucRQyjxJgcABzZZ+BbnfqT X-Received: by 2002:a54:4e1d:: with SMTP id a29mr16244951oiy.39.1635243846653; Tue, 26 Oct 2021 03:24:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635243846; cv=none; d=google.com; s=arc-20160816; b=jMI80m91H5l7SPkqHsdUZiBsCOblGkiyp0Hfs4QAlMeg0IKSOUIae+JkUgUmUJNgjy DCbHF3gpwrtlZfGBIN3Mlx5WTbt0MSCfM4j6R4qsbHj/HRVkRp2oLi2Ks6YHn7tDGqK0 gnPnKBbxKMizyoWJEXf9MxD00L8m8EZssHb09y3Bbz0Y+wG13XkwnfaKU4BodyFZKJyj o5Q0lprN5wMrTxTy9foknswpV2oad4AM3ujte5XvI952Ihj7IdggZbh8w9xEL6igfY+j udwfUT2BRWmXVSbJBiCk3oCM771rjYGCI6iDDfDI9WTeyJ/G0UXtF368rTyCEjuxUIG9 ei3g== 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=YuaBu1rOwjU9MDwY7+fh2xhLZTl7FZqKtWIuPxT1DVk=; b=FehiYpSvgfEZ0CFNbTD98gg6OISlVn1E3XE99jtOM7gtTjXOUgaHBtWcaOcdHJVxo2 vTp3xYw4qRqO6jpmAB+4YC22j55mUcr7Dlmx1uNP+/z8E+RYtmbZ4+Dk1t84xTReDxoe 69h2u4ozEdZ1DcFmPm4BWdLreZkAMKd5pR72G2T8i1kF3TRaksNiXBFGrWojM32Z4fnG TDXO/jHf3BTmoh1xqc3l/cf3g2WqjPWWZBaVia8jnpwbfVwsey0NvrZ+Vc0+vbwIdtA1 KHI6I2FZ1EYtSfufMrlHlt5lONZ+eBAyeRz4uG0RZWXgatd1NIMRHIsw1pSAk4Lp+hmA ffHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=NSXQdQlu; 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 p7si9283861oiv.266.2021.10.26.03.24.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:24: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=NSXQdQlu; 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]:58470 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJck-0000xx-0z for patch@linaro.org; Tue, 26 Oct 2021 06:24:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbV-0000s8-Q8 for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:49 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:40833) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbN-0007Pc-1G for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:49 -0400 Received: by mail-wr1-x430.google.com with SMTP id e4so18238847wrc.7 for ; Tue, 26 Oct 2021 03:22: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=YuaBu1rOwjU9MDwY7+fh2xhLZTl7FZqKtWIuPxT1DVk=; b=NSXQdQluZUUYRYtkJZgwvJrfYfbzeATcU4Y+uDdiIWxdAg80PFHirKgNdrVjWGGgi2 wFXsOQfbhZ0N6++K0mUx90EQrh798vUncVBF451leG2PyO4N+fBNVrDtIFHlOViZrwnk QIfn6DSKnwKZHJiYZaRN/ULOt4pKKQGbd8/A1G1a1Dt2FHqrUE8kjbewkw+/WM4Z3bmU aUBQugzzKVr1UJINVnDMP7UFb2VYwu2+7AMhIJaDZAWnPvOyJzc/9GRkDgYbGewoQE5l n6UZxTyGq7zshljzOK0dJ2onDbZkiiZVUwNkNWGPd+gxF5KvrG0ABQLAvobEHcJcUhaS ZvLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YuaBu1rOwjU9MDwY7+fh2xhLZTl7FZqKtWIuPxT1DVk=; b=X85Keuh76nNKQmY7NdwGnRKOnx5erO2cBxn9tlgPpqSVNHV/NxuWMerassYJiSc1e2 7uaBVhPCxZVBrhinohMChd75rW/TSJKz8keOhuKWIon1SQL097wycOBqe9u4PL1Rx+31 hSQL/rH9H0pz/beKovkwzhQNliE8A0y55GIn5R2+ILDKYzwrh+cLwGJ08qR63aZHiV26 aOncUZzgjRX/J423FCGIFV+PW6WCmETT6kyF437txYVEsKqj9cUgDtbtBujNKKn3eVde oOp4kj3APWaKjc88u7RF4TEvYnpa3Kvyr9b4c2PBebVc5VmyUf+FthU7BEAyUzy0Ss2/ TC6g== X-Gm-Message-State: AOAM533Q8pmSIS6UFOZLFC3/L1k91S2JypMMny3Y3EWRcRXeq75uqvYk GASrg/WBDcVrj23KjKkJBnUYww== X-Received: by 2002:adf:fe0b:: with SMTP id n11mr31374500wrr.371.1635243759671; Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q123sm183504wma.20.2021.10.26.03.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:35 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DFBD71FF99; Tue, 26 Oct 2021 11:22:34 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 02/28] tests/docker: Simplify debian-all-test-cross Date: Tue, 26 Oct 2021 11:22:08 +0100 Message-Id: <20211026102234.3961636-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -1 X-Spam_score: -0.2 X-Spam_bar: / X-Spam_report: (-0.2 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson The base debian10 image contains enough to build qemu; we do not need to repeat that within the new image. Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-3-richard.henderson@linaro.org> --- tests/docker/dockerfiles/debian-all-test-cross.docker | 5 ----- 1 file changed, 5 deletions(-) -- 2.30.2 diff --git a/tests/docker/dockerfiles/debian-all-test-cross.docker b/tests/docker/dockerfiles/debian-all-test-cross.docker index dedcea58b4..b185b7c15a 100644 --- a/tests/docker/dockerfiles/debian-all-test-cross.docker +++ b/tests/docker/dockerfiles/debian-all-test-cross.docker @@ -8,11 +8,6 @@ # FROM qemu/debian10 -# What we need to build QEMU itself -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt build-dep -yy qemu - # Add the foreign architecture we want and install dependencies RUN DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ From patchwork Tue Oct 26 10:22:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516188 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp143049imj; Tue, 26 Oct 2021 03:31:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9oWMPlhH+DDA0ex5HuEKtYWvgpTwYZBRLxUP2BfKAXwsHg+KzUMnsoRfy3LiUOD7TIsjy X-Received: by 2002:a4a:1147:: with SMTP id 68mr16325827ooc.5.1635244284174; Tue, 26 Oct 2021 03:31:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244284; cv=none; d=google.com; s=arc-20160816; b=exwohv+Kg/EAg3rjveeny/bPbGQ4sLw0wqlMFZWhq2pIkD5CuFEnkrTDH9yvuolw20 tNa0OXhlhSXOoEdCetysdqedOlrSg5QkbOmrdzK5uP3n0qUCFXg/t81FWTiWI51OL7w6 2V1ci6YQ3YpbzTBdGMuPHAflAf1Kk5FQ7dqNJTYSct4E7oNNYGwvbW+jUdzXRP+T9KTJ 1Q+LrnWZWl+ElecVB/wHvVBzNqbWPc68Sbn2Ko9vqoemBtSzrBjwvN451EBfwU7eZMr1 gTg1bLMjmcSk+8h3U2gR8lR/7mdG8xjMEa9+29AHEQjp66D2QvLZAnqPNXRTd1lh0pMY EwpQ== 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=iByIIAISngwwr4+RyxI8s9n0gUVPPkaN8MixOVXxCXM=; b=qZQYShNThLoiywijmKcaAdy3SBcvzP5s/MDFNDM2UJ9qwkf5Hn5joT2vualEXayyLP 1y2mf9fWGGZDxH+3i/Vaz4IRRnQ2y93UGbhUgg1jGLz45lHlWEdi1dBwNjq6qzwKtIGI sedObYMOoloNXcRqKohL4/hiTCvWd/y5Yo+xW7BLTHad4C9lThp8YkUpTyM9L0iZfmEL WaN+H8p5MMHB5KhsoxGFL6FphPtGfCb24xNOEqksOsVMsz/uY7YJkrn5XdgUyDGaJUC2 MCuczGlm94uGzD1xmFuKBfkZ5SD21WPep4EOyGbCNpL9HOledyYTQYC/gJLuzZeTPZ+q mb6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uxBoSLxt; 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 x35si20644282otr.95.2021.10.26.03.31.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:31: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=uxBoSLxt; 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]:45894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJjn-0003Is-Bo for patch@linaro.org; Tue, 26 Oct 2021 06:31:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51376) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbZ-0000wr-MG for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:42790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbQ-0007Pt-4D for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: by mail-wm1-x330.google.com with SMTP id b82-20020a1c8055000000b0032ccc728d63so355308wmd.1 for ; Tue, 26 Oct 2021 03:22: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=iByIIAISngwwr4+RyxI8s9n0gUVPPkaN8MixOVXxCXM=; b=uxBoSLxt8i/WFneUYytm1WBv2MJDXOZSyaF7ckLpYWnp3RK+OdbJhw9Psh6+ERKzcx YI7OSmS6Xrvif2gl3GLJcji1Y6peh3aolT1B8FEY+ww5CFQoH/4+f3sxWaz6kcma25pk oFGl0uZqmg1GT+eP44vkF4sQNC69C/MZn2rtIFoyH4wS4JawVLAQ/p7Ju1Q1WRIVSPmk xH6cOxlr0urm/CMw7655J+x/fvEORC4sneEqSfOVyxSoffewSDZkk5rIpNO6x/hwATRk zX3wm5hiLk0gn5d6b9XmLyB+6XJpZ7z/h2rAlDS97oXEMjmxee4+jd8uynNzNt4FbdlI 6kQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iByIIAISngwwr4+RyxI8s9n0gUVPPkaN8MixOVXxCXM=; b=di90Lu8tMqONNYetjPmLM98RCh9QpvlmyuB7CFY6dojfs+qilyT9KGJq7J5OoiMrbu GziLxH0c7bqDughJziEhL4YYNu6SRgCa4MHf8LsxbHhRXj6PWHJcaMXQ4d1S1vyPi7ZT cFnP5WqraB0UrsCc8vHkHXbQMPIi+IJFUCCFPRmyaOOcEtjsz5/CwB8Ubj3NkkuA4HF3 u5iPexQptNdsd8HEPGnH8x0xrhKiROZqnt5t4dRnfpu0lM7njU0NagEPaP2Zrcy4KXV7 m5rkhOT1H2lOl2JqyPAaBbT73rb/kY3owXaYRdUCuvHl1wNCTj/lBGB67W93155L0dSY j+fg== X-Gm-Message-State: AOAM531tlGj6jTxqWprvtcop2ahB6zXzxGx7uoAtQWcITsqFNANhMkhz lGmxAxu9zvDgbPEB7YQbVCYcsQ== X-Received: by 2002:a7b:c94e:: with SMTP id i14mr9565753wml.178.1635243762379; Tue, 26 Oct 2021 03:22:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b15sm173626wmj.22.2021.10.26.03.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0AA9D1FF9A; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 03/28] tests/docker: Update debian-hexagon-cross to a newer toolchain Date: Tue, 26 Oct 2021 11:22:09 +0100 Message-Id: <20211026102234.3961636-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Brian Cain , Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Brian Cain , Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Brian Cain The new dockerfile uses a complete toolchain built by CodeLinaro. Remove the special casing that was necessary when the dockerfile built the toolchain from source. Suggested-by: Brian Cain Signed-off-by: Richard Henderson [AJB: fix MAINTAINERS] Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-4-richard.henderson@linaro.org> squash! tests/docker: Update debian-hexagon-cross to a newer toolchain --- MAINTAINERS | 1 - tests/docker/Makefile.include | 24 +-- .../dockerfiles/debian-hexagon-cross.docker | 45 +----- .../build-toolchain.sh | 141 ------------------ 4 files changed, 9 insertions(+), 202 deletions(-) delete mode 100755 tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh -- 2.30.2 diff --git a/MAINTAINERS b/MAINTAINERS index 894dc43105..5423ae0cd4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -199,7 +199,6 @@ F: tests/tcg/hexagon/ F: disas/hexagon.c F: configs/targets/hexagon-linux-user/default.mak F: docker/dockerfiles/debian-hexagon-cross.docker -F: docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh HPPA (PA-RISC) TCG CPUs M: Richard Henderson diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index b9d4094c2e..d223100dff 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -148,33 +148,11 @@ docker-image-debian-sparc64-cross: docker-image-debian10 # The native build should never use the registry docker-image-debian-native: DOCKER_REGISTRY= - -# -# The build rule for hexagon-cross is special in so far for most of -# the time we don't want to build it. While dockers caching does avoid -# this most of the time sometimes we want to force the issue. -# -docker-image-debian-hexagon-cross: $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker - $(if $(NOCACHE), \ - $(call quiet-command, \ - $(DOCKER_SCRIPT) build -t qemu/debian-hexagon-cross -f $< \ - $(if $V,,--quiet) --no-cache \ - --registry $(DOCKER_REGISTRY) --extra-files \ - $(DOCKER_FILES_DIR)/debian-hexagon-cross.docker.d/build-toolchain.sh, \ - "BUILD", "debian-hexagon-cross"), \ - $(call quiet-command, \ - $(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \ - qemu/debian-hexagon-cross $(DOCKER_REGISTRY), \ - "FETCH", "debian-hexagon-cross") \ - $(call quiet-command, \ - $(DOCKER_SCRIPT) update $(if $V,,--quiet) \ - qemu/debian-hexagon-cross --add-current-user, \ - "PREPARE", "debian-hexagon-cross")) - # Specialist build images, sometimes very limited tools docker-image-debian-tricore-cross: docker-image-debian10 docker-image-debian-all-test-cross: docker-image-debian10 docker-image-debian-arm64-test-cross: docker-image-debian11 +docker-image-debian-hexagon-cross: docker-image-debian10 docker-image-debian-powerpc-test-cross: docker-image-debian11 # These images may be good enough for building tests but not for test builds diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker b/tests/docker/dockerfiles/debian-hexagon-cross.docker index d5dc299dc1..f3d7110814 100644 --- a/tests/docker/dockerfiles/debian-hexagon-cross.docker +++ b/tests/docker/dockerfiles/debian-hexagon-cross.docker @@ -1,45 +1,16 @@ # # Docker Hexagon cross-compiler target # -# This docker target is used for building hexagon tests. As it also -# needs to be able to build QEMU itself in CI we include it's -# build-deps. It is also a "stand-alone" image so as not to be -# triggered by re-builds on other base images given it takes a long -# time to build. -# FROM qemu/debian10 -# Install common build utilities -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ +RUN DEBIAN_FRONTEND=noninteractive eatmydata \ apt install -y --no-install-recommends \ - bison \ - cmake \ - flex \ - lld \ - rsync \ - wget - -ENV TOOLCHAIN_INSTALL /usr/local -ENV ROOTFS /usr/local - -ENV LLVM_URL https://github.com/llvm/llvm-project/archive/bfcd21876adc3498065e4da92799f613e730d475.tar.gz -ENV MUSL_URL https://github.com/quic/musl/archive/aff74b395fbf59cd7e93b3691905aa1af6c0778c.tar.gz -ENV LINUX_URL https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.6.18.tar.xz - -ADD build-toolchain.sh /root/hexagon-toolchain/build-toolchain.sh + curl \ + xz-utils -RUN cd /root/hexagon-toolchain && ./build-toolchain.sh +RUN curl -#SL https://codelinaro.jfrog.io/artifactory/codelinaro-toolchain-for-hexagon/v2021.09.10/clang+llvm-Sept-2021-cross-hexagon-unknown-linux-musl.tar.xz \ + | tar -xJC /opt -FROM debian:buster-slim -# Duplicate deb line as deb-src -RUN cat /etc/apt/sources.list | sed "s/^deb\ /deb-src /" >> /etc/apt/sources.list -# Install QEMU build deps for use in CI -RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ - DEBIAN_FRONTEND=noninteractive eatmydata apt install -yy git ninja-build && \ - DEBIAN_FRONTEND=noninteractive eatmydata \ - apt build-dep -yy --arch-only qemu -COPY --from=0 /usr/local /usr/local -ENV PATH $PATH:/usr/local/bin/ +ENV PATH $PATH:/opt/clang+llvm-Sept-2021-cross-hexagon-unknown-linux-musl/x86_64-linux-gnu/bin +ENV DEF_TARGET_LIST hexagon-linux-user +ENV QEMU_CONFIGURE_OPTS --disable-docs --disable-tools --cross-cc-hexagon=hexagon-unknown-linux-musl-clang diff --git a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh deleted file mode 100755 index 19b1c9f83e..0000000000 --- a/tests/docker/dockerfiles/debian-hexagon-cross.docker.d/build-toolchain.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/bin/bash - -set -e - -BASE=$(readlink -f ${PWD}) - -TOOLCHAIN_INSTALL=$(readlink -f "$TOOLCHAIN_INSTALL") -ROOTFS=$(readlink -f "$ROOTFS") - -TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin -HEX_SYSROOT=${TOOLCHAIN_INSTALL}/hexagon-unknown-linux-musl -HEX_TOOLS_TARGET_BASE=${HEX_SYSROOT}/usr - -function cdp() { - DIR="$1" - mkdir -p "$DIR" - cd "$DIR" -} - -function fetch() { - DIR="$1" - URL="$2" - TEMP="$(readlink -f "$PWD/tmp.tar.gz")" - wget --quiet "$URL" -O "$TEMP" - cdp "$DIR" - tar xaf "$TEMP" --strip-components=1 - rm "$TEMP" - cd - -} - -build_llvm_clang() { - fetch "$BASE/llvm-project" "$LLVM_URL" - cdp "$BASE/build-llvm" - - cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=${TOOLCHAIN_INSTALL} \ - -DLLVM_ENABLE_LLD=ON \ - -DLLVM_TARGETS_TO_BUILD="Hexagon" \ - -DLLVM_ENABLE_PROJECTS="clang;lld" \ - "$BASE/llvm-project/llvm" - ninja all install - cd ${TOOLCHAIN_BIN} - ln -sf clang hexagon-unknown-linux-musl-clang - ln -sf clang++ hexagon-unknown-linux-musl-clang++ - ln -sf llvm-ar hexagon-unknown-linux-musl-ar - ln -sf llvm-objdump hexagon-unknown-linux-musl-objdump - ln -sf llvm-objcopy hexagon-unknown-linux-musl-objcopy - ln -sf llvm-readelf hexagon-unknown-linux-musl-readelf - ln -sf llvm-ranlib hexagon-unknown-linux-musl-ranlib - - # workaround for now: - cat < hexagon-unknown-linux-musl.cfg --G0 --sysroot=${HEX_SYSROOT} -EOF -} - -build_clang_rt() { - cdp "$BASE/build-clang_rt" - cmake -G Ninja \ - -DCMAKE_BUILD_TYPE=Release \ - -DLLVM_CONFIG_PATH="$BASE/build-llvm/bin/llvm-config" \ - -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic --target=hexagon-unknown-linux-musl " \ - -DCMAKE_SYSTEM_NAME=Linux \ - -DCMAKE_C_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \ - -DCMAKE_ASM_COMPILER="${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang" \ - -DCMAKE_INSTALL_PREFIX=${HEX_TOOLS_TARGET_BASE} \ - -DCMAKE_CROSSCOMPILING=ON \ - -DCMAKE_C_COMPILER_FORCED=ON \ - -DCMAKE_CXX_COMPILER_FORCED=ON \ - -DCOMPILER_RT_BUILD_BUILTINS=ON \ - -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \ - -DCMAKE_SIZEOF_VOID_P=4 \ - -DCOMPILER_RT_OS_DIR= \ - -DCAN_TARGET_hexagon=1 \ - -DCAN_TARGET_x86_64=0 \ - -DCOMPILER_RT_SUPPORTED_ARCH=hexagon \ - -DLLVM_ENABLE_PROJECTS="compiler-rt" \ - "$BASE/llvm-project/compiler-rt" - ninja install-compiler-rt -} - -build_musl_headers() { - fetch "$BASE/musl" "$MUSL_URL" - cd "$BASE/musl" - make clean - CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \ - CROSS_COMPILE=hexagon-unknown-linux-musl \ - LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \ - CROSS_CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \ - ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE} - PATH=${TOOLCHAIN_BIN}:$PATH make CROSS_COMPILE= install-headers - - cd ${HEX_SYSROOT}/.. - ln -sf hexagon-unknown-linux-musl hexagon -} - -build_kernel_headers() { - fetch "$BASE/linux" "$LINUX_URL" - mkdir -p "$BASE/build-linux" - cd "$BASE/linux" - make O=../build-linux ARCH=hexagon \ - KBUILD_CFLAGS_KERNEL="-mlong-calls" \ - CC=${TOOLCHAIN_BIN}/hexagon-unknown-linux-musl-clang \ - LD=${TOOLCHAIN_BIN}/ld.lld \ - KBUILD_VERBOSE=1 comet_defconfig - make mrproper - - cd "$BASE/build-linux" - make \ - ARCH=hexagon \ - CC=${TOOLCHAIN_BIN}/clang \ - INSTALL_HDR_PATH=${HEX_TOOLS_TARGET_BASE} \ - V=1 \ - headers_install -} - -build_musl() { - cd "$BASE/musl" - make clean - CROSS_COMPILE=hexagon-unknown-linux-musl- \ - AR=llvm-ar \ - RANLIB=llvm-ranlib \ - STRIP=llvm-strip \ - CC=clang \ - LIBCC=${HEX_TOOLS_TARGET_BASE}/lib/libclang_rt.builtins-hexagon.a \ - CFLAGS="-G0 -O0 -mv65 -fno-builtin -fno-rounding-math --target=hexagon-unknown-linux-musl" \ - ./configure --target=hexagon --prefix=${HEX_TOOLS_TARGET_BASE} - PATH=${TOOLCHAIN_BIN}/:$PATH make CROSS_COMPILE= install - cd ${HEX_TOOLS_TARGET_BASE}/lib - ln -sf libc.so ld-musl-hexagon.so - ln -sf ld-musl-hexagon.so ld-musl-hexagon.so.1 - cdp ${HEX_TOOLS_TARGET_BASE}/../lib - ln -sf ../usr/lib/ld-musl-hexagon.so.1 -} - -build_llvm_clang -build_kernel_headers -build_musl_headers -build_clang_rt -build_musl From patchwork Tue Oct 26 10:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516179 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp137260imj; Tue, 26 Oct 2021 03:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvjef78SlVCToZ/hz9LUj7A+wCAQh3u3TZCyM162K7MESqD16p680xwegKXiBPKf7zU+n+ X-Received: by 2002:a05:6808:10ca:: with SMTP id s10mr16098217ois.62.1635243843888; Tue, 26 Oct 2021 03:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635243843; cv=none; d=google.com; s=arc-20160816; b=viOiKtZwR4KZJjQ7gARaBrXhBetbgZK5rZKf68ky22q2qxE3YN880gBsoHwgi5UirN QJRDTRxaI/6Dg9NzvyQ/rkil2HjORiKwqrQFetcco7P6QihyczvwZUk5dG0xXNEhzQ64 XVDdGG4H3HxqwFjd7gHw//vjOKy382HfZNno2bHnqXofER5fDIJrvSPCkQRAybQKMQox JFKRygnD5idn/Hc0Gv1eEaIyAQV63oRtgQjIXo7yL6DQ+OaK5iViFupi+CMLMYdab+SF s/pZPvTnqRsLenaIr1JQCW1GqRIH5X3/TcBUlxI0/RuD0pqGU92rmApRQBK3/3b3thWc xthA== 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=i/ilTMHjD7pndzO8L34GGfxe3eBn4K4fjkK0HYYsKOc=; b=XKU3c6dEy8xeOLbj/0MT/fjYg242A+/iEd3ZogeRxWSSVfW3jHnJCrfO+RYfm+V+IY bS2C9VstaBAtwrCYhH4a8wLAjHTxH6+GD+d5SpnGDL+CQT2ozh+eEk33nt8QNG45F32G hGYRe3162J2Gyy0KQov91vY/dpVtCpctjQHr7rG+PLRrTxLa1mvs65A1oXypb05rB3I1 CLUGROmpNqq4h9wGzl1wQCpbtEbfMnjKX5USXg7dWobccP32GTkUGxNElxGzEPqM+x/k lpu5ZRdIhsKxFPwvtVoQD+kxPBMIOkCO3ilcLL9+KNl9cPYSm7ckbyBYEUnUCe3oh0KI HXJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FT3wVJa2; 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 r6si831153ots.68.2021.10.26.03.24.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:24: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=FT3wVJa2; 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]:58294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJch-0000rM-7K for patch@linaro.org; Tue, 26 Oct 2021 06:24:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbT-0000qx-0Q for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:47 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:43545) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbN-0007Ph-TK for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:45 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 67-20020a1c1946000000b0030d4c90fa87so1657854wmz.2 for ; Tue, 26 Oct 2021 03:22: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=i/ilTMHjD7pndzO8L34GGfxe3eBn4K4fjkK0HYYsKOc=; b=FT3wVJa2m05ivtVIwRu7CvttpM4wdn448xDTxzqgfVn5OgTXfesDn+gMtTnGrrvXNt 0bAcmpGxOciv8LR5sTfvkV4niYdOCY7K2cUt4PkwIP/eGo/HDFFZpfGjVaBO0bVzb5PC lG7mwmHtmoZYQ11uQsKKxwW0ENKRjw65TBP5lWda51+ZtkLLozGCRbh+ULXadhn8GQYG +wk/SSNR9cXDILSeiloJ4wdnBkl++u23P92oWT5DqXV7i4qMbo73j4o7jhfMHelpmo7D OCEV6Z4hCNq5apGVlgVSPHhf63eCVzCASiE9I6tYv3CsUojEl96g+WP2Js+dTHj747OT WRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=i/ilTMHjD7pndzO8L34GGfxe3eBn4K4fjkK0HYYsKOc=; b=7vHYL9fU9jPGKeqoraJxi4HFKdUkF6aPkyPXU/oPtzuSBiPrFfV9tgW2+sMs97zfld vvAlZpirMt55aUeNhwLbPTa+wjESJ4Gz5YES21aH7qiGOO+XaubmPLQf22FxYjScUABh OBsWWwYT+W/h1M355RjhxNu9Civd5EiraQ442XRCHJsK2d+WX9P6Zv1TwGmDtvNOaGq6 c6mQSg315J0EFOU2rEZfEbZ4kIRChdCM95jYUXblKze5V0cPhMS3k9H43oyoqwz7lx6c dogeTF/ID44dma3/b3Mii8OHR0DF0wqBQcuyjz3RxRyjN5fDaEXft8lWwdDOiKgrmOqh h4cw== X-Gm-Message-State: AOAM532jQKud/i+DPaa6s7cz9iVS4SAzskEA1YHUk2gRnTnOIxnjD/AL aEPYuNBLwuvnc+WrA53fDQYAuQ== X-Received: by 2002:a05:600c:2f81:: with SMTP id t1mr11841116wmn.56.1635243760466; Tue, 26 Oct 2021 03:22:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o10sm176035wmr.31.2021.10.26.03.22.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1B74E1FF9B; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 04/28] gitlab-ci: Remove special casing for hexagon testing Date: Tue, 26 Oct 2021 11:22:10 +0100 Message-Id: <20211026102234.3961636-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Now that the hexagon container is using a pre-built toolchain, we do not need to make the build optional. Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-5-richard.henderson@linaro.org> --- .gitlab-ci.d/buildtest.yml | 4 ---- .gitlab-ci.d/container-cross.yml | 27 +++------------------------ 2 files changed, 3 insertions(+), 28 deletions(-) -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo diff --git a/.gitlab-ci.d/buildtest.yml b/.gitlab-ci.d/buildtest.yml index 5c378e35f9..27b9b6be6b 100644 --- a/.gitlab-ci.d/buildtest.yml +++ b/.gitlab-ci.d/buildtest.yml @@ -249,14 +249,10 @@ build-user-static: CONFIGURE_ARGS: --disable-tools --disable-system --static MAKE_CHECK_ARGS: check-tcg -# Because the hexagon cross-compiler takes so long to build we don't rely -# on the CI system to build it and hence this job has an optional dependency -# declared. The image is manually uploaded. build-user-hexagon: extends: .native_build_job_template needs: job: hexagon-cross-container - optional: true variables: IMAGE: debian-hexagon-cross TARGETS: hexagon-linux-user diff --git a/.gitlab-ci.d/container-cross.yml b/.gitlab-ci.d/container-cross.yml index a3b5b90552..ed7a849a69 100644 --- a/.gitlab-ci.d/container-cross.yml +++ b/.gitlab-ci.d/container-cross.yml @@ -47,33 +47,12 @@ armhf-debian-cross-container: variables: NAME: debian-armhf-cross -# We never want to build hexagon in the CI system and by default we -# always want to refer to the master registry where it lives. hexagon-cross-container: - image: docker:stable - stage: containers - rules: - - if: '$CI_PROJECT_NAMESPACE == "qemu-project"' - when: never - - when: always + extends: .container_job_template + stage: containers-layer2 + needs: ['amd64-debian10-container'] variables: NAME: debian-hexagon-cross - GIT_DEPTH: 1 - services: - - docker:dind - before_script: - - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest" - - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest" - - docker info - - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" - script: - - echo "TAG:$TAG" - - echo "COMMON_TAG:$COMMON_TAG" - - docker pull $COMMON_TAG - - docker tag $COMMON_TAG $TAG - - docker push "$TAG" - after_script: - - docker logout hppa-debian-cross-container: extends: .container_job_template From patchwork Tue Oct 26 10:22:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516189 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp144846imj; Tue, 26 Oct 2021 03:33:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqRKt6V8BjY4wYXDJ9vsTOmbvxYktx02Kt6KuSgURpV2FGYj5p/yya7XOum1ZsXO2X/pVK X-Received: by 2002:a05:6808:b02:: with SMTP id s2mr17049314oij.19.1635244405281; Tue, 26 Oct 2021 03:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244405; cv=none; d=google.com; s=arc-20160816; b=FwA2eaoVGu7Ty51MsfrA/w+RKgVCg5+qQi9v6DVu90qoW0hNZBe8nzAHQakTMhXBjE n60fY+1xWQTHySW/B1zy0jdbG5h98RrhPt3ta9gPfu72OPB5E1Vr43C5laWM+0pUNiiV 2cJUYBBjkrLbhwM50LmwaHxXi2AaneF3H4rIbrFln8g560pE5AjUFVh0C2jsZFIc/UOW i/ZfkxurtGQJmJ/Bx9XCUFzFMTQEy1MKR/+kcatdnFEUt8HTWSVYzI2zgjFuTJ55/QnE cDi9rcY3Sd+WE4bxncB3V4Uaj32d1AzmJS3ogLfhpfpe+QPuhjRD2O8zz/ViS683uSMr ZeBA== 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=ACIp9F0Nh15Gaf/v0m8OCT5cDDHld1MVNF1OSbxE2lw=; b=Pne/WNtI8gkEmiPeRswwp8zGfbfjV1pJ7KzMOAxiYm0wP+C9en9HdbuhRh8G2rXdXm QI0RM0iiEekbYeeLXYgD3o8lBMVbk6iQ8x8l9mOmBGslRqZvPYJr2FOHKnZ6p14rfCXP 7lg0iL2Vtb7pVxnFtea04VFhDoYexy7xx+kVu85soa4W0lnKXkOoK3Vd6WSAH2LYf7jq mN6WfhLmJYzpK54iCit2ShC8fvKLuB0Fom58Go1jDjYcVVC3x2G6oOZ+2Ic9Rd/KmlRT rPXKbzRfTLWRlkRN7xqRQElWT3LmOBYXTz2rEDYvIHmaJTPVN9tsxoneE6/weJRZVj6F 8U6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=TnHV42rk; 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 c20si37562482ots.335.2021.10.26.03.33.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:33: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=TnHV42rk; 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]:51534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJlj-0007AE-NF for patch@linaro.org; Tue, 26 Oct 2021 06:33:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51374) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbZ-0000wc-Iy for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:42941) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbU-0007QI-2P for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: by mail-wr1-x42d.google.com with SMTP id v17so16956343wrv.9 for ; Tue, 26 Oct 2021 03:22: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=ACIp9F0Nh15Gaf/v0m8OCT5cDDHld1MVNF1OSbxE2lw=; b=TnHV42rk3YnbDKaEiurIXtpRjjO7pME//+BwInVmNSIMygImu/FMbZt9tFolFv3ecN 2yeg2faoVf9AMRwWyzdOhiHrm3iwvS1yMD+GZTbxV45XQhDiVKUt8zGGxdoeMUOMlwNi 1VfLiQJq2KpMw3Acd1Hz8Rtan/eX7Wo4FFHqiaYkLk1LoPfE9uVf2tvmYpa9LNSYZEis hlhsypu4Vt1FKDs5i0f66ITI4eulR3YqJ6CSCOaSGu4EszkrvTgPYJKvjvM93bK44qy7 HGitCtKt+nsAbOs+t4nvA/WsAirjzI+zo7QeS7keldk6WEMHLUP17rVKxCl67MPB8TP7 SeEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ACIp9F0Nh15Gaf/v0m8OCT5cDDHld1MVNF1OSbxE2lw=; b=Ya3b2OF+smrMXSFhZlJ2YATxKVftVRSgQXPB3jOyFITxFXitOdufyQBiLZ3r0IvXeM OYfJKBGXhZoRArt19qTf3kwNXAw6E4CRUJDY3ScCl1gxv9GJhXVWAqgKs8aeDuIuhdDN awPcC1yuwUfK0G6lXUPKP1imn1msYMXc4pFt09pL2xi+c08n/oB4eO44LFGlG0AwuX/B gm5eyVvH0Om7YRFfYIS+ktd2WUHE7gKcSAO9UIUKWRkLcYmzWS1/dqtGv/+VOBHDvzRD 7GdMEs1qNMwIDsACkPMNNGCmXMfFZS8/QqbJ6Tb+LycJ7jk0JX3E5xsKot9ktsfMX7vW eDDg== X-Gm-Message-State: AOAM5323ENeGrt9Qq19cDw7CalPYOS54MmR1e+iJUQ8n+3KYfZZrSTem FvJRARw/V0iroCOPcLai4ODOVA== X-Received: by 2002:adf:ba87:: with SMTP id p7mr30450592wrg.282.1635243765136; Tue, 26 Oct 2021 03:22:45 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y5sm9120250wrd.75.2021.10.26.03.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3A5F01FF9C; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 05/28] tests/docker: Add debian-nios2-cross image Date: Tue, 26 Oct 2021 11:22:11 +0100 Message-Id: <20211026102234.3961636-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Marek Vasut , Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Chris Wulff , Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Build the entire cross tool chain from source. For this reason, default to caching. Signed-off-by: Richard Henderson [AJB: honour NOUSER in cached fetch and build, update MAINTAINERS] Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-6-richard.henderson@linaro.org> --- MAINTAINERS | 1 + tests/docker/Makefile.include | 25 ++++++ .../debian-nios2-cross.d/build-toolchain.sh | 87 +++++++++++++++++++ .../dockerfiles/debian-toolchain.docker | 36 ++++++++ 4 files changed, 149 insertions(+) create mode 100755 tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh create mode 100644 tests/docker/dockerfiles/debian-toolchain.docker -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo diff --git a/MAINTAINERS b/MAINTAINERS index 5423ae0cd4..aa515bd313 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -256,6 +256,7 @@ F: target/nios2/ F: hw/nios2/ F: disas/nios2.c F: configs/devices/nios2-softmmu/default.mak +F: tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh OpenRISC TCG CPUs M: Stafford Horne diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index d223100dff..24ed5c1f1d 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -148,11 +148,35 @@ docker-image-debian-sparc64-cross: docker-image-debian10 # The native build should never use the registry docker-image-debian-native: DOCKER_REGISTRY= +debian-toolchain-run = \ + $(if $(NOCACHE), \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) build -t qemu/$1 -f $< \ + $(if $V,,--quiet) --no-cache \ + --registry $(DOCKER_REGISTRY) --extra-files \ + $(DOCKER_FILES_DIR)/$1.d/build-toolchain.sh, \ + "BUILD", $1), \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \ + qemu/$1 $(DOCKER_REGISTRY), \ + "FETCH", $1) \ + $(call quiet-command, \ + $(DOCKER_SCRIPT) update $(if $V,,--quiet) \ + qemu/$1 \ + $(if $(NOUSER),,--add-current-user) \ + "PREPARE", $1)) +debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1)) + +docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \ + $(DOCKER_FILES_DIR)/debian-nios2-cross.d/build-toolchain.sh + $(call debian-toolchain, $@) + # Specialist build images, sometimes very limited tools docker-image-debian-tricore-cross: docker-image-debian10 docker-image-debian-all-test-cross: docker-image-debian10 docker-image-debian-arm64-test-cross: docker-image-debian11 docker-image-debian-hexagon-cross: docker-image-debian10 +docker-image-debian-nios2-cross: docker-image-debian10 docker-image-debian-powerpc-test-cross: docker-image-debian11 # These images may be good enough for building tests but not for test builds @@ -161,6 +185,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross DOCKER_PARTIAL_IMAGES += debian-hppa-cross DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross +DOCKER_PARTIAL_IMAGES += debian-nios2-cross DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross DOCKER_PARTIAL_IMAGES += debian-tricore-cross DOCKER_PARTIAL_IMAGES += debian-xtensa-cross diff --git a/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh new file mode 100755 index 0000000000..ba3c9d8aff --- /dev/null +++ b/tests/docker/dockerfiles/debian-nios2-cross.d/build-toolchain.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +set -e + +TARGET=nios2-linux-gnu +LINUX_ARCH=nios2 + +J=$(expr $(nproc) / 2) +TOOLCHAIN_INSTALL=/usr/local +TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin +CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root + +export PATH=${TOOLCHAIN_BIN}:$PATH + +# +# Grab all of the source for the toolchain bootstrap. +# + +wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz +wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz +wget https://ftp.gnu.org/gnu/glibc/glibc-2.34.tar.xz +wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.70.tar.xz + +tar axf binutils-2.37.tar.xz +tar axf gcc-11.2.0.tar.xz +tar axf glibc-2.34.tar.xz +tar axf linux-5.10.70.tar.xz + +mv binutils-2.37 src-binu +mv gcc-11.2.0 src-gcc +mv glibc-2.34 src-glibc +mv linux-5.10.70 src-linux + +mkdir -p bld-hdr bld-binu bld-gcc bld-glibc +mkdir -p ${CROSS_SYSROOT}/usr/include + +# +# Install kernel and glibc headers +# + +cd src-linux +make headers_install ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_SYSROOT}/usr +cd .. + +cd bld-hdr +../src-glibc/configure --prefix=/usr --host=${TARGET} +make install-headers DESTDIR=${CROSS_SYSROOT} +touch ${CROSS_SYSROOT}/usr/include/gnu/stubs.h +cd .. + +# +# Build binutils +# + +cd bld-binu +../src-binu/configure --disable-werror \ + --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} +make -j${J} +make install +cd .. + +# +# Build gcc, without shared libraries, because we do not yet +# have a shared libc against which to link. +# + +cd bld-gcc +../src-gcc/configure --disable-werror --disable-shared \ + --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \ + --enable-languages=c --disable-libssp --disable-libsanitizer \ + --disable-libatomic --disable-libgomp --disable-libquadmath +make -j${J} +make install +cd .. + +# +# Build glibc +# There are a few random things that use c++ but we didn't build that +# cross-compiler. We can get away without them. Disable CXX so that +# glibc doesn't try to use the host c++ compiler. +# + +cd bld-glibc +CXX=false ../src-glibc/configure --prefix=/usr --host=${TARGET} +make -j${j} +make install DESTDIR=${CROSS_SYSROOT} +cd .. diff --git a/tests/docker/dockerfiles/debian-toolchain.docker b/tests/docker/dockerfiles/debian-toolchain.docker new file mode 100644 index 0000000000..738d808aa6 --- /dev/null +++ b/tests/docker/dockerfiles/debian-toolchain.docker @@ -0,0 +1,36 @@ +# +# Docker toolchain cross-compiler +# +# This dockerfile is used for building a cross-compiler toolchain. +# The script for building the toolchain is supplied via extra-files. +# +FROM qemu/debian10 + +# Install build utilities for building gcc and glibc. +# ??? The build-dep isn't working, missing a number of +# minimal build dependiencies, e.g. libmpc. + +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -yy eatmydata && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt install -y --no-install-recommends \ + bison \ + flex \ + gawk \ + libmpc-dev \ + libmpfr-dev \ + rsync \ + texinfo \ + wget && \ + DEBIAN_FRONTEND=noninteractive eatmydata \ + apt build-dep -yy --arch-only gcc glibc + +ADD build-toolchain.sh /root/build-toolchain.sh + +RUN cd /root && ./build-toolchain.sh + +# Throw away the extra toolchain build deps, the downloaded source, +# and the build trees by restoring the original debian10 image, +# then copying the built toolchain from stage 0. +FROM qemu/debian10 +COPY --from=0 /usr/local /usr/local From patchwork Tue Oct 26 10:22:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516184 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp140364imj; Tue, 26 Oct 2021 03:28:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9cEoBUyI7P9mJepM0Rfix2gSuNNdjElZtspmu+jGytq6da9YvmWP7v5Zgmy7DRxeYDI9i X-Received: by 2002:a05:6808:bd3:: with SMTP id o19mr17173906oik.42.1635244084435; Tue, 26 Oct 2021 03:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244084; cv=none; d=google.com; s=arc-20160816; b=OUNFRUHYVTlFpnqjXCNVeDQPoYWfhFGo4hCrQsfj+kNXpe1FQtvvueI7Dv9J6THVvJ ylL3bzK3Csffs32FOpyl0UPUTuZ3W8xCCLcroRYkubVqUJ8oWAEOgvIR0xefosBkaiuu A2aay0fZEAlqpzByDqsoFrZyBmKmDgegP0ECpYrgq4qPMELxQ7wkJN71n5lTrYXxRzdX Ige5G96DPHd8Xv5OavVsz3uWVR0AkzcHVWNXh3zQ6kk74kTvQr3sHyLzfhHpraudM+L6 kU26Llt8sXKSdwi7VfewmBh6a477k6Ufzt1SpE4E7qUnP2GGCu6xiRqVpI0KQy1LJ4DD MQTg== 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=H8yD/2gRGBDxLd6pT5M2UUlZ2PMMN65AXJnb6WpCya4=; b=umEAZQQsFrrrPcdEzRNvkpvPfp7RnZHLOWUSLu1cvJqMkPs30jmIThoBh7tVhg61zJ 5ybcNTRaEQdk0Z2m8cX337VjxnRZmFKIGwYXkuSNbA2WTFdwic8l+Wh9Wh2ecKNcw8WN I9yknEGoDuJzTEdE0qw0j8UVyRzQbPgVgeEeFc1SJ9TZNqKZwPLf86vSRWHoFnpVwFmY yWFR4c93e47wKvuYMZ7P++gaHTCsHLc868Ma9uRnm301F9uZxtTBAKAxxprSS663IwFc 7AQNDIZ6POUVXg4qle5kszHrVThzv5yIIm36vEjt4kbbN7F3zCpElGPiof05aupE85v8 3uoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q9p5aiWE; 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 l17si23048687otj.153.2021.10.26.03.28.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:28: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=q9p5aiWE; 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]:36754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJgZ-0005aI-NM for patch@linaro.org; Tue, 26 Oct 2021 06:28:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51344) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbX-0000t8-7f for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:51 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:37550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbT-0007QM-FB for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:50 -0400 Received: by mail-wr1-x42d.google.com with SMTP id e12so18260641wra.4 for ; Tue, 26 Oct 2021 03:22: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=H8yD/2gRGBDxLd6pT5M2UUlZ2PMMN65AXJnb6WpCya4=; b=q9p5aiWEeO8GgwOHDOBKf61FnA+Yvx/YztWHB63erB6vfPmrHfONPQIEMV4OrqNtG3 /JpJ20oRYe4zWzVyNrF5T0y0y1hxVYHfpZF3gHIwFAnJUc48lsf/dy6UEpz065hTV0gA rruR9jDT8D/LTMFcVfvNiT4HSumT4mqND8dYxZsdyHIqiF0U/q/r1Jt6ksC7AqD7AoV0 2NsOxtMico1qMo0XyzLgardgF5O9vwNgCxlwB/k265jsjHBqHG7pfkYI4dlqNP1DVWvH U1g9/H46XF7hWZrckDzaQhn9M0i32Va91GN3IqtWzyqwm/I51egfUZBf5i9/ymDMCMJU YsAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H8yD/2gRGBDxLd6pT5M2UUlZ2PMMN65AXJnb6WpCya4=; b=8Pf215gmfbjYx7dGqZNZfWJMLX4CrpSx2a/g57Jd9+e5xIzhNdTzqMI2NzuhX7JWJG vS2cqLeXHQ+HMPAa+ZmgNrfs6zjNYo82ZIJ6ZJh1ca3Tp3jrMAqIHJiUSQmbUlMaSrbq 14JfR/TbJFeCI/h/iCLVjNf+UKlKMWSU5fz+6i38CTv08Yg9K/pABj+9x9K996e6NPdO 1qArvKvQBFeVWooAHO6XuAOziO5rKpPJWisIwR0y8F7SCzawNu21M2216sbycytwKv3u dlHW33XOwYgoSAoyn/K2EP7iSUJ36b8vacs0dq+ds+EnSB00eYTRPolen3ZRrqqZSETX kL/Q== X-Gm-Message-State: AOAM530IZJdFxPWPnN5B38CbXx7kLZ71IfqoZUvr3/Lhe3u9oYT3pZ70 MajjR0F0WbXDbEDf9rB7EpOZ6g== X-Received: by 2002:adf:d1ce:: with SMTP id b14mr17641635wrd.42.1635243766119; Tue, 26 Oct 2021 03:22:46 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o10sm176108wmr.31.2021.10.26.03.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4EDAB1FF9D; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 06/28] tests/docker: Add debian-microblaze-cross image Date: Tue, 26 Oct 2021 11:22:12 +0100 Message-Id: <20211026102234.3961636-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, "Edgar E. Iglesias" , kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Build the entire cross tool chain from source. For this reason, default to caching. Signed-off-by: Richard Henderson [AJB: Update MAINTAINERS] Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-7-richard.henderson@linaro.org> --- MAINTAINERS | 1 + tests/docker/Makefile.include | 6 ++ .../build-toolchain.sh | 88 +++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100755 tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo diff --git a/MAINTAINERS b/MAINTAINERS index aa515bd313..108fcb799b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -221,6 +221,7 @@ S: Maintained F: target/microblaze/ F: hw/microblaze/ F: disas/microblaze.c +F: tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh MIPS TCG CPUs M: Philippe Mathieu-Daudé diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index 24ed5c1f1d..e943ac33b0 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -167,6 +167,10 @@ debian-toolchain-run = \ "PREPARE", $1)) debian-toolchain = $(call debian-toolchain-run,$(patsubst docker-image-%,%,$1)) +docker-image-debian-microblaze-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \ + $(DOCKER_FILES_DIR)/debian-microblaze-cross.d/build-toolchain.sh + $(call debian-toolchain, $@) + docker-image-debian-nios2-cross: $(DOCKER_FILES_DIR)/debian-toolchain.docker \ $(DOCKER_FILES_DIR)/debian-nios2-cross.d/build-toolchain.sh $(call debian-toolchain, $@) @@ -176,6 +180,7 @@ docker-image-debian-tricore-cross: docker-image-debian10 docker-image-debian-all-test-cross: docker-image-debian10 docker-image-debian-arm64-test-cross: docker-image-debian11 docker-image-debian-hexagon-cross: docker-image-debian10 +docker-image-debian-microblaze-cross: docker-image-debian10 docker-image-debian-nios2-cross: docker-image-debian10 docker-image-debian-powerpc-test-cross: docker-image-debian11 @@ -185,6 +190,7 @@ DOCKER_PARTIAL_IMAGES += debian-arm64-test-cross DOCKER_PARTIAL_IMAGES += debian-powerpc-test-cross DOCKER_PARTIAL_IMAGES += debian-hppa-cross DOCKER_PARTIAL_IMAGES += debian-m68k-cross debian-mips64-cross +DOCKER_PARTIAL_IMAGES += debian-microblaze-cross DOCKER_PARTIAL_IMAGES += debian-nios2-cross DOCKER_PARTIAL_IMAGES += debian-sh4-cross debian-sparc64-cross DOCKER_PARTIAL_IMAGES += debian-tricore-cross diff --git a/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh new file mode 100755 index 0000000000..23ec0aa9a7 --- /dev/null +++ b/tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +set -e + +TARGET=microblaze-linux-musl +LINUX_ARCH=microblaze + +J=$(expr $(nproc) / 2) +TOOLCHAIN_INSTALL=/usr/local +TOOLCHAIN_BIN=${TOOLCHAIN_INSTALL}/bin +CROSS_SYSROOT=${TOOLCHAIN_INSTALL}/$TARGET/sys-root + +export PATH=${TOOLCHAIN_BIN}:$PATH + +# +# Grab all of the source for the toolchain bootstrap. +# + +wget https://ftp.gnu.org/gnu/binutils/binutils-2.37.tar.xz +wget https://ftp.gnu.org/gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz +wget https://www.musl-libc.org/releases/musl-1.2.2.tar.gz +wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.70.tar.xz + +tar axf binutils-2.37.tar.xz +tar axf gcc-11.2.0.tar.xz +tar axf musl-1.2.2.tar.gz +tar axf linux-5.10.70.tar.xz + +mv binutils-2.37 src-binu +mv gcc-11.2.0 src-gcc +mv musl-1.2.2 src-musl +mv linux-5.10.70 src-linux + +mkdir -p bld-hdr bld-binu bld-gcc bld-musl +mkdir -p ${CROSS_SYSROOT}/usr/include + +# +# Install kernel headers +# + +cd src-linux +make headers_install ARCH=${LINUX_ARCH} INSTALL_HDR_PATH=${CROSS_SYSROOT}/usr +cd .. + +# +# Build binutils +# + +cd bld-binu +../src-binu/configure --disable-werror \ + --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} +make -j${J} +make install +cd .. + +# +# Build gcc, just the compiler so far. +# + +cd bld-gcc +../src-gcc/configure --disable-werror --disable-shared \ + --prefix=${TOOLCHAIN_INSTALL} --with-sysroot --target=${TARGET} \ + --enable-languages=c --disable-libssp --disable-libsanitizer \ + --disable-libatomic --disable-libgomp --disable-libquadmath +make -j${J} all-gcc +make install-gcc +cd .. + +# +# Build musl. +# We won't go through the extra step of building shared libraries +# because we don't actually use them in QEMU docker testing. +# + +cd bld-musl +../src-musl/configure --prefix=/usr --host=${TARGET} --disable-shared +make -j${j} +make install DESTDIR=${CROSS_SYSROOT} +cd .. + +# +# Go back and build the compiler runtime +# + +cd bld-gcc +make -j${j} +make install +cd .. From patchwork Tue Oct 26 10:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516183 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp140357imj; Tue, 26 Oct 2021 03:28:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt+/FFfwYyxX6MUj7Lt9rj6LsNidQpU5moiBEbb7tKWwNZP2ir7NadQ1nmZcgPTFQ1qc1d X-Received: by 2002:a05:6808:1802:: with SMTP id bh2mr16320754oib.142.1635244083476; Tue, 26 Oct 2021 03:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244083; cv=none; d=google.com; s=arc-20160816; b=S8D+aZJg32WzrmGIbZhpT1HUO2YNIVner078bmrChcM1hmTVMmyoNivOs43Ei9ZAe8 Dq76Z7rSglGO5vwZI/vv55gbkKHGEP8dMcWRZjRGPpTolYO8m6jqkHnv1y/DfjEx9szQ yFzg3Gt0mQTf3yLm4OCVGk7E404tp4xh+KdG9ZzGXAft09R4PBKyUNR7zsjqMD3vlcpI ekyGhdFjGt9gTrqeJjuGUc6W5htkR/6CmLM4JvfDPJVZ2GR0BZSDM2IMHZEP/HnNzHn8 9IYUF+8HTWdc/zPLC4sDkTbWjytcslY47tmR3UOOIYJHEV1kuBpur92ZJAlWlZiiZnbY xJMw== 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=Vk2fYQyC8qTaGZS/T1cDqpDUV8Xm6hpS74KdoWzwKII=; b=j9FOcPtIKRuEp+eepT3+3bq2rMwspSb3E5BJ3ng5L2MhFqbwHFiZLG0IaeGU3kW2Ka y+8JTzvoDiLHHfquup8d3ZX1BKf3PVRYpUXmcO/x4iKDBdsuEsdFJXGU72QGEtJBow2o GCeT79ur9j5GI5mQfCuHnAghSOc60q+BpnPbAklBIgQLLHflAiOTGpIXfTrIBCWbnd7D cjt52rL0jriDDo6e+InkBZJab7zQRAlN+6O5fAwDtAxHRPACOpkMKR9HsOuBFAcElaDU ZZHA7ogQrVtZXHfYBbYc0yZM59DhFGFXabZLVuxoxZ1wvMJqawoyJHT67zQJAec9YEgr 4AHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=cBFgGEn3; 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 s12si30250408otv.264.2021.10.26.03.28.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:28: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=cBFgGEn3; 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]:36632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJgY-0005Uk-Qx for patch@linaro.org; Tue, 26 Oct 2021 06:28:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51352) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbX-0000tk-MA for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:51 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:33396) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbV-0007Qj-LQ for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:51 -0400 Received: by mail-wr1-x42e.google.com with SMTP id m22so14926958wrb.0 for ; Tue, 26 Oct 2021 03:22:49 -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=Vk2fYQyC8qTaGZS/T1cDqpDUV8Xm6hpS74KdoWzwKII=; b=cBFgGEn3mqQD7hzSW+eLulT7POqmtqqLsED2BCFNVEVgvGD4k2wVYKo8MfQXjbiVly nQ7FvVhfgSqVI1TZM9fi0NIueyG4rUkm7g/hmOkRKNiQh5traHM5fV850Ak3R2jCu+kp GziBgfx4MIG83P29+CZmlSXsZoYs8iS+35lvdtz1uz+o+GhLfp+rzYWV1w2yFMWqRPW4 coziBu81vYRHVe96nOs6wHkx03qzZ+e1VqGDBfEHy3AY3PkH1obHD4DukkXffGsv4gfb iqTNU6fuAPmKWnryKqQMCkIRlOv9PhCcMQwJdm4aL0BRshRHO6IqIHIhcHxEXUwh28e3 bl0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Vk2fYQyC8qTaGZS/T1cDqpDUV8Xm6hpS74KdoWzwKII=; b=tvqW2cybPO4krvanCMd9lFv/z3+s76+kmQ0SekOEwd4kSz/HYE9HZNTvCgpMBDjAHK 2LDOD3R8xZw9jDz5DFeS0mar8yN9jkml2CAXFiD900YCk5+A6JysmPqUKB0BZBYAJHw9 nHtwT5zUUCK3edvD9gtqEBcgfXRmVIsi05RPhjYRaO1qK7fpo6f4ukJfNR8BHc1sT4SO lDLfknovxmBCpy+yULB8cZVrd4MAQA20g+G6kXS5CJxNSjE+UJ6SjPCNsr1IZ9vt9ZYC wsWJp/p2C3kEVTuLvjjxxMzTA0Ik6Ciwppbh4JVPmUv94SiTlW7jL+8QVl0p0CyDpptQ +VoQ== X-Gm-Message-State: AOAM530t1S1dEkOSEfPvxRIWlz8C/Alfv4vdY+iAAm5sY/1Pxr+HEfn5 82MbJKC76TJFayKM2Y/TqKqw1g== X-Received: by 2002:adf:ce09:: with SMTP id p9mr30993478wrn.363.1635243768087; Tue, 26 Oct 2021 03:22:48 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id y5sm9120292wrd.75.2021.10.26.03.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6629B1FF9E; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 07/28] tests/tcg: Enable container_cross_cc for microblaze Date: Tue, 26 Oct 2021 11:22:13 +0100 Message-Id: <20211026102234.3961636-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20211014224435.2539547-8-richard.henderson@linaro.org> --- tests/tcg/configure.sh | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 1f985ccfc0..149eeb15ff 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -55,6 +55,7 @@ fi : ${cross_cc_i386="i686-linux-gnu-gcc"} : ${cross_cc_cflags_i386="-m32"} : ${cross_cc_m68k="m68k-linux-gnu-gcc"} +: $(cross_cc_microblaze="microblaze-linux-musl-gcc") : $(cross_cc_mips64el="mips64el-linux-gnuabi64-gcc") : $(cross_cc_mips64="mips64-linux-gnuabi64-gcc") : $(cross_cc_mipsel="mipsel-linux-gnu-gcc") @@ -133,6 +134,11 @@ for target in $target_list; do container_image=debian-m68k-cross container_cross_cc=m68k-linux-gnu-gcc ;; + microblaze-*) + container_hosts=x86_64 + container_image=debian-microblaze-cross + container_cross_cc=microblaze-linux-musl-gcc + ;; mips64el-*) container_hosts=x86_64 container_image=debian-mips64el-cross From patchwork Tue Oct 26 10:22:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516190 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp144870imj; Tue, 26 Oct 2021 03:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwl6F8IP3MsC//15Qk2Ac7K9JDPlrFOoUNZZkvjdRX9fvC1LYN+U+sfjd14ctWPC/uREZ/0 X-Received: by 2002:a54:401a:: with SMTP id x26mr16796266oie.117.1635244406542; Tue, 26 Oct 2021 03:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244406; cv=none; d=google.com; s=arc-20160816; b=DebcIw6pSvPn1dX96XONMBffBPAihJT9jZcyVOjL13RDr1GXfiqptmHsFoRff3wf+t A2MQP9wtXIj7B+wMFtUmUUXnjVxbGvOL/svoSpG/EborX4J41I+I4kIuZCNkzCa9pS+g w0vcEkm0zwjDal6mctBYbCTq3/xz+1Z1dVv9S87mto2IQp7pgiIqlRNg9H+06T3Lmr+c fju1bzA1Z4L6MNBol1qYdZ6EWQeShIhrnEoTmCUGkrMOt0fhRGw9BM6ckYq4HOKPO+ba mX/5MrMtGQWcjmhnHDyAwGCyOqJWMluT3dx8tCfG2dwVVOCr8O9BXeEcbqVKfAdAf2UL TZdg== 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=+GXjIZSWU/U5ppISCei450OTir4ISL2+HnT7Ict5FVI=; b=Pr8jvcyy/2OgLeJNZKudYy8p0MhO+hyD/i8F9QHrYTSXhktgzsuhi/XFuxy1D8bfd0 hA+gLd27BFPmEGiwFJZCATdCb4WAoxPQ7J6hXE+9X9D2bUaAJBd9iK6EanUZX0vOFa4D /Woom3c32impnMcRJ+AM7NHpX5O1Ppj1MZuvPTQ/m028+xzJDUuHFwTuG3jZAoz+C2wb wi0d6TK1qRUOu9ODcBmCl8+UftSjCiXjCNsG9BHrrk67ltFICZK5+V+wXgT3TImmKvNz P5pf3eHqChk+mbW26rIGv/KWqgxgJIVMykt8uFV1X0sKJgpw8w7TEGA9/1vmxT72r29M UWyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=V+ARYHhZ; 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 c25si11366793otl.61.2021.10.26.03.33.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:33:26 -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=V+ARYHhZ; 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]:51604 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJll-0007DA-R3 for patch@linaro.org; Tue, 26 Oct 2021 06:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbh-0001Ey-6s for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:23:01 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:38466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbR-0007Q6-9a for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:23:00 -0400 Received: by mail-wr1-x429.google.com with SMTP id u18so14882458wrg.5 for ; Tue, 26 Oct 2021 03:22: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=+GXjIZSWU/U5ppISCei450OTir4ISL2+HnT7Ict5FVI=; b=V+ARYHhZuk+nUviwxbxR5ioKkQD+LxwZReV/UJX0qjXx3f8Rp2dYx945jPtKY7E1Ns pHVfJJw1MS4clU0rnAIH4/ya7WzF14s0FIOfSTT8uYEVzUkr3wcXQsmc6eVDwDCDHOWt x7iZ6jgZ47dLGa6t7G2TZuUFGk2cqgakjRbZVCJuFZPiC0s8Z8gnlHDeYuTF7N8wI9Yy O1zUqNVhqniZ2sfKvbXbSwHir0oyuFJhRMxi+vzRvbjhx8x4XLZ2u45H8U/JoxI872eb CEpxM6kCxGr4HEl2KekDQkqbbOzdMvjkvYKwRsWWvV3kwMaO2SXoJ2Rb7tzDqwlSeBdb vYCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+GXjIZSWU/U5ppISCei450OTir4ISL2+HnT7Ict5FVI=; b=sVzXd4tAFd7ygKLpyeXZujuvbpWlnn4gkR7jjFf2m6d0NDgaSVMqIA5IBiEhS+5BTu i8QezaxXCyeEqnWAyFobrhQuHMylcgl7Cf8RrLrz1eLmtZeM1W9hnd2a0r/s2QfFw8s9 cuvpCH3seZ6D2pe46KYDU43jEhIh7aQQ5T25KBkuXwzQJMOZJE6n4EjfcNvJM1Ceux12 Qr8BL2DhHZBr4p+gRx+ZbwHZRvoWgSdCjPzHYUzPxdq9aSrMhtOlOd7cK0tC++Ubg7eP bJvwtXTAFTXjf1MAVcz1Wty8GjQB5ewKgHGLiF8AdFkkvhv/7C9aqHTHgc46xgJ3xo2q mxOA== X-Gm-Message-State: AOAM532CIWH3rnBLWCpRU/+zsr8gsbQIxuiPJH4VAeHlv8aIK9U85d8m MJiw8M8sIZWMyOyul6TbD5QQhQ== X-Received: by 2002:adf:e489:: with SMTP id i9mr2385125wrm.22.1635243763258; Tue, 26 Oct 2021 03:22:43 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n68sm183053wmn.13.2021.10.26.03.22.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7C0991FF9F; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 08/28] tests/tcg: Fix some targets default cross compiler path Date: Tue, 26 Oct 2021 11:22:14 +0100 Message-Id: <20211026102234.3961636-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé We do not want a shell command substitution, but a parameter substitution (with assignment). Replace $() -> ${}, otherwise the expanded command return an empty string and the $cross_cc variable is not set. Fixes: 634ef789f8e ("tests/tcg: add more default compilers to configure.sh") Signed-off-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20211023164329.328137-1-f4bug@amsat.org> --- tests/tcg/configure.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.30.2 Reviewed-by: Richard Henderson diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 149eeb15ff..0d3ac839ee 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -46,7 +46,7 @@ fi : ${cross_cc_aarch64="aarch64-linux-gnu-gcc"} : ${cross_cc_aarch64_be="$cross_cc_aarch64"} : ${cross_cc_cflags_aarch64_be="-mbig-endian"} -: $(cross_cc_alpha="alpha-linux-gnu-gcc") +: ${cross_cc_alpha="alpha-linux-gnu-gcc"} : ${cross_cc_arm="arm-linux-gnueabihf-gcc"} : ${cross_cc_cflags_armeb="-mbig-endian"} : ${cross_cc_hexagon="hexagon-unknown-linux-musl-clang"} @@ -56,17 +56,17 @@ fi : ${cross_cc_cflags_i386="-m32"} : ${cross_cc_m68k="m68k-linux-gnu-gcc"} : $(cross_cc_microblaze="microblaze-linux-musl-gcc") -: $(cross_cc_mips64el="mips64el-linux-gnuabi64-gcc") -: $(cross_cc_mips64="mips64-linux-gnuabi64-gcc") -: $(cross_cc_mipsel="mipsel-linux-gnu-gcc") -: $(cross_cc_mips="mips-linux-gnu-gcc") +: ${cross_cc_mips64el="mips64el-linux-gnuabi64-gcc"} +: ${cross_cc_mips64="mips64-linux-gnuabi64-gcc"} +: ${cross_cc_mipsel="mipsel-linux-gnu-gcc"} +: ${cross_cc_mips="mips-linux-gnu-gcc"} : ${cross_cc_ppc="powerpc-linux-gnu-gcc"} : ${cross_cc_cflags_ppc="-m32"} : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"} : ${cross_cc_ppc64le="powerpc64le-linux-gnu-gcc"} -: $(cross_cc_riscv64="riscv64-linux-gnu-gcc") +: ${cross_cc_riscv64="riscv64-linux-gnu-gcc"} : ${cross_cc_s390x="s390x-linux-gnu-gcc"} -: $(cross_cc_sh4="sh4-linux-gnu-gcc") +: ${cross_cc_sh4="sh4-linux-gnu-gcc"} : ${cross_cc_cflags_sparc="-m32 -mv8plus -mcpu=ultrasparc"} : ${cross_cc_sparc64="sparc64-linux-gnu-gcc"} : ${cross_cc_cflags_sparc64="-m64 -mcpu=ultrasparc"} From patchwork Tue Oct 26 10:22:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516185 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp141896imj; Tue, 26 Oct 2021 03:30:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7uAS8rV16IyIOEexTO2Ed0GoYIRZCiN1aIwQaEEOI+75TKc2Bf+11GMjurLAL+pd+cJhP X-Received: by 2002:a05:6808:3027:: with SMTP id ay39mr18919143oib.39.1635244201613; Tue, 26 Oct 2021 03:30:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244201; cv=none; d=google.com; s=arc-20160816; b=HtIUZbkrjK/Oog4l99m6bS6W/RpUiaPcb4/sdGjNJn6/lf1rnLcZHZyNtl9h3Ej6gT LiK+EJPdskPXV1CeIq2P50kI5ZuvvzjlypweGw0Bb25/hFKHuZ8wtyxA4ELmmxl3QJKn teqyWTOEGo8sHLU2bg4lYt+fHO25sLRsLGDJ74O92SenGVsZvJ+peQ61JRals2BtEa+5 eNVB0RKnaYA1ARul6+W9AnRNIDEsWGKG/NIPZs2FF4CMqupyIQlRC//2192iTnUHWOgl k4BeOm2duF1oWmfIuk3QKAWDZqivuVPWFhT/b6e+1dG6gpsy2HVCHnVtDJXP8Xo4VRbr Bpsg== 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=pQ3BdzkSMgKgR2yCwD+Jc0cjVeoWcI6lFMea0A48Un4=; b=mv3/gZ4oABiNcGhnogaOCt1JPvoCGhLUc+h1uA1l/e4RhSNkmk+61H7feNE7Xnk5lk 4BvgFhg2Is1u+9h10/tiv9Dg6c16oT5MvR2vVanOpB8oiewpYqfVhcYmF95/OSqoaJQf FHWedwpyeWVOiQf0DExoZ0nPKUoQEuPCz3K1S+CyMiuFBWMtAG3eo6vc68oY+AdijKus McoJvlmopKGeVIGyFoCklMVrYNQXOMlr95hb3c1UA8NCF8gVgO/mhjkVO5LTy/fe+s1v Uado+hFHKKTARf0n3mf0Ku+oE44Vo1Mv/r101KEKslv1ClKFX16UiW130Q1n3TktaMMD WOAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pSTV3+NN; 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 bb15si17768844oib.161.2021.10.26.03.30.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:30: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=pSTV3+NN; 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]:43086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJiS-0001QX-Uv for patch@linaro.org; Tue, 26 Oct 2021 06:30:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbc-00011t-0x for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:56 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:53239) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJba-0007Rv-Ff for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:55 -0400 Received: by mail-wm1-x32e.google.com with SMTP id m42so13566293wms.2 for ; Tue, 26 Oct 2021 03:22:54 -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=pQ3BdzkSMgKgR2yCwD+Jc0cjVeoWcI6lFMea0A48Un4=; b=pSTV3+NNeRHm9tnmF2HuuYNYvclG2QKKBD0egEjxFgQU4HhlMXGAbHgztCrSgyhcaH a55uzxWIWDqCWW9cAcdmqHQtzdK64KLE7OvDpJCS5tT28RSSToDTvILeRcDPpyoL1oi3 f36lAayL9fDqkbjZ88pOiLmHLdMiDDe9PrfSzsupiTmTFAzWSlPe8MvT2XkMSkzGK6xK Y4x+E6oJy8q3AYwXcVLurRcLnF4I0M6eQR/PMfXznH4Ft/eEH9ySJ6SFMbSfsVDgoxa6 gqxCOHhQ9RJRFl+ZVRAD7oRmup+OiWE85LqAhyUk6SDEk2zhxbJFWKPHjncwj8Yn+skr Xu2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=pQ3BdzkSMgKgR2yCwD+Jc0cjVeoWcI6lFMea0A48Un4=; b=Q2JdUb2eP+ngHmenVGS/85ohlnDYZhY8xARpjyCGH7tmYbHvvM+IDZeZ+m+LxWlJSX gUHJ0MsedivDfZA9aqx38SZcX0yv4bKw7wYc3aB9satgmzbYsuPm7vXRX6HNpILjojFP ZJVkEpdcLhQKlqvusNdkUf7sMjE5es/q90gIBFtSH/3Xr7+IBTrg2OnvfF+RvjqzIpet Y7TyS8Lw8JJyUYzO0/QnyEKpfA6pL2k/90XCoaaFLAnEgD8cy584VujRUt8IjQnh6C9g 3RxAQ1m+sctYiF7YmRoJsVY4uELdTZ3pdyqttkUBPqi7vuy0nwyO46Drzy+Z3xmUJ6Qu ya5A== X-Gm-Message-State: AOAM531xfdRv1zd4h97cDg+A5rMHbaWLyvxDAA8ms8nCR9mUvfpEYWg+ gO8Qn4i5rxhkJk/bEoCdJdtqJA== X-Received: by 2002:a7b:c955:: with SMTP id i21mr4263332wml.53.1635243773138; Tue, 26 Oct 2021 03:22:53 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o20sm171536wmq.47.2021.10.26.03.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 882111FFA5; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 09/28] tests/docker: split PARTIAL into PARTIAL and VIRTUAL images Date: Tue, 26 Oct 2021 11:22:15 +0100 Message-Id: <20211026102234.3961636-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is mostly to ensure we don't include the toolchain and bootstrap builds in DOCKER_IMAGES which is useful when verifying all images still build. Signed-off-by: Alex Bennée --- tests/docker/Makefile.include | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) -- 2.30.2 Reviewed-by: Richard Henderson Reviewed-by: Willian Rampazzo diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index e943ac33b0..5bbbaceed1 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -11,8 +11,10 @@ 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) -DOCKER_PARTIAL_IMAGES := debian10 debian11 debian-bootstrap empty -DOCKER_IMAGES := $(sort $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker)))) +DOCKER_PARTIAL_IMAGES := debian10 debian11 +# we don't directly build virtual images (they are used to build other images) +DOCKER_VIRTUAL_IMAGES := debian-bootstrap debian-toolchain empty +DOCKER_IMAGES := $(sort $(filter-out $(DOCKER_VIRTUAL_IMAGES), $(notdir $(basename $(wildcard $(DOCKER_FILES_DIR)/*.docker))))) DOCKER_TARGETS := $(patsubst %,docker-image-%,$(DOCKER_IMAGES)) # Use a global constant ccache directory to speed up repetitive builds DOCKER_CCACHE_DIR := $$HOME/.cache/qemu-docker-ccache @@ -204,7 +206,7 @@ DOCKER_PARTIAL_IMAGES += fedora-cris-cross # packages. # Expand all the pre-requistes for each docker image and test combination -$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES),$(DOCKER_IMAGES)), \ +$(foreach i,$(filter-out $(DOCKER_PARTIAL_IMAGES) $(DOCKER_VIRTUAL_IMAGES),$(DOCKER_IMAGES)), \ $(foreach t,$(DOCKER_TESTS), \ $(eval .PHONY: docker-$t@$i) \ $(eval docker-$t@$i: docker-image-$i docker-run-$t@$i) \ From patchwork Tue Oct 26 10:22:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516193 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp147405imj; Tue, 26 Oct 2021 03:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyhWwNeViJlYqPmtzAeTyUiaoVCwcgTbjxZFR8rHoaVJSfaE5yD6VxKuEKM/bcU6j3ws9k X-Received: by 2002:a05:6830:11ca:: with SMTP id v10mr18263303otq.188.1635244586230; Tue, 26 Oct 2021 03:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244586; cv=none; d=google.com; s=arc-20160816; b=wGGKJlPbgrlyQHSZnMTQCr2mvejb/y9YPuZnu+pSlXv7MBfShRajbKZy4j4Kbh6asH Ch4oUbKZftCtzROk3UtvD9h9YQGkOUvui2h39xtZwqmmzfjBwfWKaxBFqlP6qcpO30dl bABtEVNYwAFmuJBXCUCafrT/Zp1QIoKiQ2j+NQ7zujj7wjCLETTIqkDu06Shc8rjJUhP 5Qd6HqHavC9n3P10gRsK/smd/ySGyG0o/Q9bTf2OUCzwAmEQpp6OObJSKecGBlezy/UT dB1c0+WeFj+KW2uk1W2QfekpBJV0psf47cJK/LKmxJATWOB9PJ38Au3v07wEqmmHtlCS S/5A== 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=+nzfSAkBBnW95G1HHY0jfzp30Kl0kRtuu1gHbOZwLl8=; b=hAj5Y/YOBuTol5NhHeQQANnSXyGN5A0yXawlZDo4G2zOYxnKFYVOnkFNFYxya9qc3d b9Se5imr/eoDJqkCKiXPvLONd/Sp7fGiVah7wDW7MAlOsTLc+UAsUMgMf7dbMAgjh3vp efkQ4roikCLGEghvMr66vggeCtDdzoHDDGDaaVW/8GTrJFVn2qAR3SY+Wz0iaNAlB6uc tl6V+dFGVJgSPvk5BBhuW83w1FEREXcVvJ43uBbrbpqgftJfc2KrE7c2WsMow/OvcNgK RJNtQBA2EeTdK3DJ+wTEVLD5E7eIAWmn3WHTlm7JfhPo8f3ohSKYyE5+q0TGXOsshnaj YglA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=LsiI3iGn; 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 q2si9272112oiv.98.2021.10.26.03.36.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:36:26 -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=LsiI3iGn; 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]:60130 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJof-0004UY-IG for patch@linaro.org; Tue, 26 Oct 2021 06:36:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbZ-0000x2-Os for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:46032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbX-0007R9-Up for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:53 -0400 Received: by mail-wr1-x42c.google.com with SMTP id o14so1004785wra.12 for ; Tue, 26 Oct 2021 03:22:51 -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=+nzfSAkBBnW95G1HHY0jfzp30Kl0kRtuu1gHbOZwLl8=; b=LsiI3iGnLoQmxDgb98ObsxOE52D4KcgVrmTaUzWCuho+OZiQII6FOMWKumju8VUsog yx/av0zwf8llGLsTLsErNzXhX+QVB9aSEdWfaYSSeBsxk+FpQ/fJo5ky8uYR5PdsFVNf ZsyFcC49mXwa6Fmwl0z/IwNG4l+OBaSgvrwq7qFAYg2zjp0gAgP9NtSxsGKmZcOqe6sH f1KefDaKyUvnkuy17iSMKyVNAnPWN1ZjdpOd6ABXHSEPAFfnZjszeXqPxjywYeL/p0Le ozm533dzgE6WA/biR6GQmvIG7EFv11CbZZAwDGiKPG8oP26fwrY8yCpMSprqSjywyKS3 IiTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+nzfSAkBBnW95G1HHY0jfzp30Kl0kRtuu1gHbOZwLl8=; b=e5E9tgYQqnN+QyCmqa392/GPldbg10DB9tEXYtrKU3M0bCtMtvyZjkQ/3HW6XMXoHI il0T+GYk1B2bDiLtfhEfxsG7CfyEVGDjn5IKEx0CPIKkHfsqNFHckLvu6Mj85fRWrwJy 7shFgX6vjW+dzyDMmxv6IG1X/pGOq/qA0D+EPinhwWah/1IPr+/knd4SO1z2v1Hyckzh Qfe+zsWk0ZtB0KnpEoOwWS3SEp5uTcaVkB9YBcl8tlGnO23mV8cnvB7dPD9kpi9kp/Ms aeMqYEkn8wMl5UDwW8WZl2P1zurpeV2KqFl3XlYPG9LL1usbbC/+CV8NrU/KWxgX6wLR MXeg== X-Gm-Message-State: AOAM531dGpsMu3Gb6DWZzuoO+vhyMl/sLOQ9tmBQXgQoiPuhnBLkQ9RC Fep74EMXivxAFQrvnhLvuaaiHQ== X-Received: by 2002:a5d:64c9:: with SMTP id f9mr12533839wri.416.1635243770557; Tue, 26 Oct 2021 03:22:50 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id m35sm1683375wms.2.2021.10.26.03.22.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A0C071FFA6; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 10/28] tests/docker: allow non-unique userid Date: Tue, 26 Oct 2021 11:22:16 +0100 Message-Id: <20211026102234.3961636-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, Thomas Huth , minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Willian Rampazzo , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Wainer dos Santos Moschetta , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a bit of a band-aid against hand-built images that have been accidentally polluted by a user build. All images pulled from the registry shouldn't have the user defined. Signed-off-by: Alex Bennée --- tests/docker/docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 78dd13171e..5eadf0bb7b 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -336,7 +336,7 @@ def build_image(self, tag, docker_dir, dockerfile, uid = os.getuid() uname = getpwuid(uid).pw_name tmp_df.write("\n") - tmp_df.write("RUN id %s 2>/dev/null || useradd -u %d -U %s" % + tmp_df.write("RUN id %s 2>/dev/null || useradd -o -u %d -U %s" % (uname, uid, uname)) tmp_df.write("\n") @@ -590,7 +590,7 @@ def run(self, args, argv): uid = os.getuid() uname = getpwuid(uid).pw_name df.write("\n") - df.write("RUN id %s 2>/dev/null || useradd -u %d -U %s" % + df.write("RUN id %s 2>/dev/null || useradd -o -u %d -U %s" % (uname, uid, uname)) df_bytes = BytesIO(bytes(df.getvalue(), "UTF-8")) From patchwork Tue Oct 26 10:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516186 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp141922imj; Tue, 26 Oct 2021 03:30:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxN2bnnivT0AZzf8s8y2N/iGrzngfIxjXwi81rfHPGKep9OCJzRnsrjf8aYBaL4lEyEd87H X-Received: by 2002:a9d:53c4:: with SMTP id i4mr18148974oth.176.1635244203219; Tue, 26 Oct 2021 03:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244203; cv=none; d=google.com; s=arc-20160816; b=dP/45VhxAxRqQKx5rZs+ifnAI8mjf19eWZkP/8hxr+7FfYVvteBxoM0OsQ/4TsK9hj 9bnO8e9rWQ8Mz7RqnsY3QtZhom4Jp7/39YorRgNNDsiiNPENNrgcqrWKisRLc4dxrP5H Dyt5wBAxe4nCTvkw8CCs/7D8kDsmS5m/TTjO0Lq4hZZ3LCrFAYl2H4pFmILFMBVgCtEN onS0zqeJvRfVXS6YG37pr6R0L+SryvN3J9h5m1Ug3YgHBSb97c0VdUthcT4V3sy/9UOi nO+jBoW+uyYhfOR1OCmE/BWhCQMbGfaN7E5VwZ7o1PDejT8bwulKDE7+xdg2EACd+IrO IraQ== 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=V4F6dTXCtxB2YfTwcmr2qdGp59H8NrXj+DIueaarNm8=; b=wlnah2TrLCUrbp4LuNOBoR9mecjeuGVjfIufKd3tvqE3i6TWeGzZZGZYUlvT986pnj 2LTqvJwE/JuCj28bqv/GIG8LtE7qnMbeRJVAzm/1C2IZ/ugIIjquHFV3R4TMSjPjyOD3 HdQ8ldDVI/kb8A8PqvZGZYl0FrURchF7sxHyCllHreO41A8hcg0WOlpurLUfByAPM+03 nt8ut9JYH5MSLq0/9QflHb/76L1X6gcGlnNJsMCzq6oZRyZwq1cZnWWQhSjqTXO87Ze7 +znQwLiUt0lUPIzFq76dtkALBaFLLBDg2z0m6KsfYReT9ZrkGwu/z9sYXvLZ9CIoqSZV mAiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lDBfBtBX; 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 r82si18542794oif.142.2021.10.26.03.30.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:30: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=lDBfBtBX; 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]:43134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJiU-0001SP-Dk for patch@linaro.org; Tue, 26 Oct 2021 06:30:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbY-0000uV-EU for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:52 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]:41691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbW-0007Qy-Tw for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:52 -0400 Received: by mail-wm1-x330.google.com with SMTP id 136-20020a1c008e000000b0032ccae3b331so1004038wma.0 for ; Tue, 26 Oct 2021 03:22:50 -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=V4F6dTXCtxB2YfTwcmr2qdGp59H8NrXj+DIueaarNm8=; b=lDBfBtBXvrT9bZFoMDrRBkCnePQNF5uMrvVmiwTgIYEHbSUphvAXAjoQx5H/pJ9hnc 0NbOJmYfczp3zxHB4veVwp5L4WxLe8H36bU1JTzCEPkZ7EIlOdqvo0JQcaKSbeXfBfKM ErhHkvZ+X9qJuvCJnbvcQIcerNH5D/zfNq7VEWv9G1cBg2Be0aqgzMkg1DC9oWeV7PR2 H3e6382qpH8vNzy22nHUr+6pTj4JJZYNM3nFpUeEBNecTvFSY4BEfElU8bvw5FWso5mk UrCOk1iN+f6t80hcykU1U6OuWwflcFZkF5yZ+TAdCMcBsNzH4Xab3bJm0S9gAfDYrpm+ z6bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=V4F6dTXCtxB2YfTwcmr2qdGp59H8NrXj+DIueaarNm8=; b=HoqJ0eoJwRFcWPyvjCWCblW5mC+RsgEYbmIkvth62JAMrNtZhF7+Wov2MRWHuN+/0G w9rDgxaJzzmuiSUGR4TLst9STDIW9sWS6jZF/8BA4DUBFpDHkcMI/QbeXwv6haSkoZIe 9CjRTsJVtj//GRF/XEhqlssnyqu7S66ESRlYf644ozVWYG+sQsbAGvS9yy+CgzY7vv/g a0zo/D3Mr1FfdqH1B+XMaoTyEDqBNm7r4oi3mVjs5fPoMNgj/oArqkO9AJB6krbbsaxv 7TI5O14S2H1IJuy4PGvK6yvscbn3+HSSKv8iy0dkxg77bSgvf+kKx+r4Doqv0lVLofeF Gj8w== X-Gm-Message-State: AOAM532sPEJQkPPPIIo9vTiI6TEvb/pMDfSSpYRR21dBRRgioWOGwI5e lnJlSInLuDllwTadTPxQ4ty3gsd63E3SWA== X-Received: by 2002:a05:600c:1d11:: with SMTP id l17mr12949722wms.44.1635243769709; Tue, 26 Oct 2021 03:22:49 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h2sm7652008wrv.54.2021.10.26.03.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BC1581FFA9; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 11/28] tests/tcg: enable debian-nios2-cross for test building Date: Tue, 26 Oct 2021 11:22:17 +0100 Message-Id: <20211026102234.3961636-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, "Edgar E. Iglesias" , f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have a nios2 test image we can start using it to build tests. However signal handling in nios2 is still broken so we disable the signals and linux-test tests that trigger the bug. Signed-off-by: Alex Bennée --- MAINTAINERS | 1 + tests/tcg/configure.sh | 6 ++++++ tests/tcg/nios2/Makefile.target | 11 +++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/tcg/nios2/Makefile.target -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson diff --git a/MAINTAINERS b/MAINTAINERS index 108fcb799b..87d67f19ce 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -222,6 +222,7 @@ F: target/microblaze/ F: hw/microblaze/ F: disas/microblaze.c F: tests/docker/dockerfiles/debian-microblaze-cross.d/build-toolchain.sh +F: tests/tcg/nios2/Makefile.target MIPS TCG CPUs M: Philippe Mathieu-Daudé diff --git a/tests/tcg/configure.sh b/tests/tcg/configure.sh index 0d3ac839ee..34f6dbbc20 100755 --- a/tests/tcg/configure.sh +++ b/tests/tcg/configure.sh @@ -60,6 +60,7 @@ fi : ${cross_cc_mips64="mips64-linux-gnuabi64-gcc"} : ${cross_cc_mipsel="mipsel-linux-gnu-gcc"} : ${cross_cc_mips="mips-linux-gnu-gcc"} +: ${cross_cc_nios2="nios2-linux-gnu-gcc"} : ${cross_cc_ppc="powerpc-linux-gnu-gcc"} : ${cross_cc_cflags_ppc="-m32"} : ${cross_cc_ppc64="powerpc64-linux-gnu-gcc"} @@ -159,6 +160,11 @@ for target in $target_list; do container_image=debian-mips-cross container_cross_cc=mips-linux-gnu-gcc ;; + nios2-*) + container_hosts=x86_64 + container_image=debian-nios2-cross + container_cross_cc=nios2-linux-gnu-gcc + ;; ppc-*|ppc64abi32-*) container_hosts=x86_64 container_image=debian-powerpc-test-cross diff --git a/tests/tcg/nios2/Makefile.target b/tests/tcg/nios2/Makefile.target new file mode 100644 index 0000000000..b38e2352b7 --- /dev/null +++ b/tests/tcg/nios2/Makefile.target @@ -0,0 +1,11 @@ +# nios2 specific test tweaks + +# Currently nios2 signal handling is broken +run-signals: signals + $(call skip-test, $<, "BROKEN") +run-plugin-signals-with-%: + $(call skip-test, $<, "BROKEN") +run-linux-test: linux-test + $(call skip-test, $<, "BROKEN") +run-plugin-linux-test-with-%: + $(call skip-test, $<, "BROKEN") From patchwork Tue Oct 26 10:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516192 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp145379imj; Tue, 26 Oct 2021 03:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmAFFinJyW54GkRh8GvLM0sJoYafyJnueX9AGl73TkF0ZfqqUh1GXQIwvvEca50QByCOt0 X-Received: by 2002:a9d:17c4:: with SMTP id j62mr17815151otj.225.1635244442681; Tue, 26 Oct 2021 03:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244442; cv=none; d=google.com; s=arc-20160816; b=chZ/sFjJrJhXIzfz8ShOWUtpPV5Y6IFLzz5MA3eP5ej5UBeQnMpX7AUyJVNYv1SvWk yqFMzR5/Qt0lyAiYfcq+No3uGrELGV43cEyd+IRY5rC3AtTqJEObjlEJXquriRbSESkz gvksfU0n06v0oItxJYIJIKj3oL363aDAPRb9WT2q7ddKazPKEk0VjBAHO2rXDQ5XJMkS SWHFYeQHAywrjy4quGIoQRt1MzMePHHz0mHSTkRuiGnooP2WWct9+aCf9Z3lqEPgVEE1 QL6JUokAAipCJd1SyI4/ViVDxDMs65sS0LKIky+yqGHrRMoCVNAA9/86atb1oKPXcCaV LqBw== 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=oZR6/Tiw8Q+UAG2d4njIYEaAK7iRYsQbROUxHKy6lVM=; b=O94Oj1KFVP6pqafeyx+wPiix1VYB69O16XixRMOY0byDhQXUZWCm4tk5OXo0C30S9g c6BN+yTwbz1sqp/sJAJjkBeG8YBjAlg5y4yqkcdvpjKi37X90sj3thZyLa9qw5bRimdO znfAji1374gMWbwr0oEZma6VJOFizjUOtF/ul3ecL011F3KLnHsad63ubyvHrU9c/SeN cBPevr6pmAmvjyP/boTM7vGV+XtiHqoj2BAyeN+KwRLdu+h5Um135KQluSSBx4Br9XKI 2Hv+3IoZdY4wCl/0MbtAN4uvEp360LvyAaveNFxdPo2aaH3XNER/4NBHmMMe0H3Q8YvK mgbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=l70xVdjt; 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 p7si9313961oiv.266.2021.10.26.03.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:34: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=l70xVdjt; 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]:54562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJmM-0000oL-0k for patch@linaro.org; Tue, 26 Oct 2021 06:34:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51402) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbb-00010k-87 for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:55 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:43980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbZ-0007Rh-Nd for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:55 -0400 Received: by mail-wr1-x433.google.com with SMTP id p14so12283311wrd.10 for ; Tue, 26 Oct 2021 03:22:53 -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=oZR6/Tiw8Q+UAG2d4njIYEaAK7iRYsQbROUxHKy6lVM=; b=l70xVdjtyc0rliTfYnKbZnf0ROUfznKJ3+EedS+02rsEyyfMEnCO54tv+2rVyOrD8y fK60+Qe9mDsyLq3gpDmqiBnkIz3fYAgP7lAPeraIqqBaPxEj8qP9fCaMG4i5h1o8r/Yj 63xfoxcXRjsqU/I/GwTLEWpheY8Slikeoz96e2kSpDbJr+KCBU91vO1ohnpN2UvitIWh hP0+sXexcruB/W9bbo8ehHG/RM7MOOIGWXl+BJrfC5zU7S5IrWp/mVVEbMFh/hOaEH6N N3dJzNSDwZKOaRyWCEzJ2Xs5QKghBXg5P9Q6Py9tiU/Ge/zMTd1LZihK2/zeYPqTKtoI wCRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=oZR6/Tiw8Q+UAG2d4njIYEaAK7iRYsQbROUxHKy6lVM=; b=n8t83CLsGQzqYLKeVFgLIxBdvrjZgUOC1isFHPGHNP8aJYPBXXsa5jKcOWfuefCaNR ueIQ+wolq7p3MmRe4ej5Gf1Ffv0eo0be+a22Bon/TFf26ofW3O2SoBuJWFXl3i53/zkJ cFh0GGtfSzvlty/tKewtx5p0+lH9+vV1gObVVM19eignlhHfmPE+H6FbfWwMjN7PuDy9 vASWKn0VhY26kkoVswdK5CGXspT/3QbMoogPLq6uui4RB89ohCDUGNtoWEKOSXsjro7F FUMGBmJI4cqP5bwJ+e3F6lsmVa5DOh4pk439I97xriQ5JcVEhj+6ixa8rkDtqQjYsAPg M84Q== X-Gm-Message-State: AOAM531ofRXsuSCrr/jL6d0AU/0NSL9/AQo3anjU6ZwOctmDcDWL2Md2 5HUmgAAYK10wPgqn7cFNGs2n5A== X-Received: by 2002:a05:6000:1107:: with SMTP id z7mr16770053wrw.370.1635243772231; Tue, 26 Oct 2021 03:22:52 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id l2sm212833wmc.3.2021.10.26.03.22.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:48 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D2FB71FFAA; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 12/28] ebpf: really include it only in system emulators Date: Tue, 26 Oct 2021 11:22:18 +0100 Message-Id: <20211026102234.3961636-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Paolo Bonzini eBPF libraries are being included in user emulators, which is useless and also breaks --static compilation if a shared library for libbpf is present in the system. Reported-by: Alex Bennée Signed-off-by: Paolo Bonzini Signed-off-by: Alex Bennée Message-Id: <20211012162252.263933-1-pbonzini@redhat.com> --- meson.build | 2 -- 1 file changed, 2 deletions(-) -- 2.30.2 Reviewed-by: Richard Henderson diff --git a/meson.build b/meson.build index 2c5b53cbe2..bc520b579c 100644 --- a/meson.build +++ b/meson.build @@ -2610,8 +2610,6 @@ subdir('bsd-user') subdir('linux-user') subdir('ebpf') -common_ss.add(libbpf) - specific_ss.add_all(when: 'CONFIG_BSD_USER', if_true: bsd_user_ss) linux_user_ss.add(files('thunk.c')) From patchwork Tue Oct 26 10:22:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516191 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp145035imj; Tue, 26 Oct 2021 03:33:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuIuZEfP5422t7A/Jcvt2iTamDi5sNuf5jwv6c7sMMn2reTnnzDPHFHtuRGI84gJCTisiB X-Received: by 2002:a9d:5541:: with SMTP id h1mr6488964oti.229.1635244419133; Tue, 26 Oct 2021 03:33:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244419; cv=none; d=google.com; s=arc-20160816; b=oITwhKzYh0vpGvq2BJ5VEYx+x2RZ+cKRxpwv89oDYc6c0CkWGX+NeQ1+smcRqb+3FH W5CXv9cMUWzsNsSFNPMbsGFCl1QKO+8zqUcBlE5IgFXVgiwq9jkzVpS9OXOfR7Xpasyt FLO+L/trKyr37iwTg8MxxeJ5Dh4bsJSnqxSKdmTB/4NAhjYWPeA+YNGY7Dvem7EUdKCA eBVGZqIc9s10lva0yhavGaoOyjJuoICKdVmmRyi7r5aDhMbmWNeRVKcjFVt3ih+dLGYe M2vkhrsRiiYTqNLwRZamLkhyn22XVjd9hfkmN1O8M+CTK/JJJxrtvUhipuN3ly5MWyW6 R+wQ== 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=IWjl9w4dID69sKeC7KjvTFMgg0FURy0JhRq2ek25mvM=; b=qfO7qZR+i08IYnumL5EHgq7CzMxQAwLHEaKviqU4vhBd1q3cJrg8nKQf0+NMurSuFU NGmDmxoy6NXbKLR1cyZUeOhm/CVHOM2qeGY5ppzJk3znNLnMwmGsgvyxT3cnHDzWPjPe ObaQaEuhBvo1ETSy/MNgoQhNwPyqAyo9dk3yx0UnUdd133vEWN05nnuvf+y0cdfDqX9p FhYSRObpLYxfnoL+dT23yDrR4v7UbGR3MALM2fnygg+/OPsrNJtoy4BiPNkJFSNYqtwr 9jtSCdRc28DBrX6EGuCAmUWmR3ReQEj8W4ya0z5PPyjTszk5iibSMfPhZLeDFe4Kz78Z mr4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Iuj37Joq; 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 g10si23829706oiy.200.2021.10.26.03.33.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:33: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=Iuj37Joq; 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]:52532 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJly-0007rv-Ds for patch@linaro.org; Tue, 26 Oct 2021 06:33:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi1-000245-Kv for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:33 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:41550) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhz-0004gG-QK for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:33 -0400 Received: by mail-wr1-x42e.google.com with SMTP id d3so14149625wrh.8 for ; Tue, 26 Oct 2021 03:29: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=IWjl9w4dID69sKeC7KjvTFMgg0FURy0JhRq2ek25mvM=; b=Iuj37JoqoPeHkFb+bSOa/3uF8dQdtrCn5V4MFgXZc5xIlJtc4Tn8wGD7n65IYvNecX 3ty3W2j3KnUgTVSWeZlNArmV8Lwblqy6YTxYmnXb8fschAE3ZIOZqoVfefmBBioEcapZ dmP6I5UC2MEC76fbj+RPAUArwFd0guBEMp1RABhJYR/WhKSE6mALliJcWdKS3/qmoBYy JwUzt2ZWUDcJ6pkwqpT0i6VxKPWFdVwRRQSFOprdZRRbYXhESWsDsGaoItq7LNJQy9rQ TduFzQWup2EoA86NxICPnG4WNwNFto+Zx0k+lJ+7sDLOwKcsTKdJd4RbYc/n7BxV2hTZ kLsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IWjl9w4dID69sKeC7KjvTFMgg0FURy0JhRq2ek25mvM=; b=QqJqxAm9sb1cahTiH+U1NKvFk0Nhl0WhkDsTofKvxP7PSCA4hyxFaCCBtWRoKzc4+9 o9ul4PbApESE/lA4IOwImTbKyfEzSrv/oGqYIpbeBJ3ceS0AvOKUSG9ac/phZKS+VBDN XNr3gyMK5YX2L46Ffy+Wzkbckldm9NwPBvEkdF+Fwx1+M+UjtP4168HCQdkdXlA7EY3F ggcGPgnzFXGKGBYk/gY21eSm/PtDAgqTBblYv8d4hts/wkINfVwioYOqnVJKlO4CFKu2 nwgPdT81OqA2c7/LxjhALUE1FknNizDpvpUvGLXMdyrq8cUzNQVFYoRMHPz5koE+Bb+s jVpQ== X-Gm-Message-State: AOAM533NibYaPShEQ78vdA3a6fumT05URcXZDhew3SmlvNQZ9Uv+FTI9 7l8hrHMs2TOahBE02H/njmTPWA== X-Received: by 2002:adf:f9c6:: with SMTP id w6mr30877350wrr.415.1635244169553; Tue, 26 Oct 2021 03:29:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e9sm18858787wrn.2.2021.10.26.03.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DE9781FFAB; Tue, 26 Oct 2021 11:22:35 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 13/28] plugins/cache: freed heap-allocated mutexes Date: Tue, 26 Oct 2021 11:22:19 +0100 Message-Id: <20211026102234.3961636-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210810134844.166490-2-ma.mandourr@gmail.com> --- contrib/plugins/cache.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.30.2 Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index a1e03ca882..a255e26e25 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -614,6 +614,9 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) caches_free(dcaches); caches_free(icaches); + g_free(dcache_locks); + g_free(icache_locks); + g_hash_table_destroy(miss_ht); } From patchwork Tue Oct 26 10:22:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516203 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp159310imj; Tue, 26 Oct 2021 03:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwEF/JKGyPkktHTci8B3MrbA6oF6FUvrWptyLr3MTX/Ow0KJobLqi9ADkYv/G+eg4dkeMF X-Received: by 2002:a4a:dc1a:: with SMTP id p26mr16573783oov.6.1635245516917; Tue, 26 Oct 2021 03:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245516; cv=none; d=google.com; s=arc-20160816; b=onUEhgwNOKiQ9fy40WwKwAlkhTJ1bFXng3P16W4Blq8K/Ej1xoJGyxoDZtwgQDemBw eEeNhTMBALlmOp3ER2Mxe7vrrw/UxSFggrpJjZtgUYj852knaZMtyA9yDAKD/1y4JuWV nZkskVdr1tCI29OPEDdpNAnR7I/Vr733SAcnr7B3c3m0xErOpoqoDiLdbxg+4E4xymLb 6bwsxz3/Q/LEn5LigTnU5jPHZ4k2XAao+pem5luYh6fUejfD1v4tm/63cXprsyxQVwDy vZMsEiBrN64L2Pfd9IRDbNYHEwozoCAel0b7/zcGxJn3c1btZVYMjZsN4L8dt1zWR8y8 1EcQ== 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=BG7xjNl/WZDOgDJsFtxwjLFHea+QsZj1hn1YKXkh+fI=; b=TO8kvFyDw5CzSNVlaLs61AEMCCsjPqanch9+nTViq7zuHqTNTlSHqfDdGYsxCg4sXD XuG0nWWfCcFMu6Lh6qFB367mznAw8KipbR+5/7+0rTVCYKKqAcnVQzSzpJn0+xdWvMeT MJF55X/nExnLxGVgYMbQxvhwUKM0B1sPP22seYOgE4nguzhx5KySbKBmYdlr3ojfAt1J KLo6swZDFRZPbGKLTZpnIKZqpWUp8g1gOKaH8fgzOTmASwd2xvSAPW4V0Y5HpnsPFmDP AiCZF0lZZuaD4QERejtvKECmTQ/YepBrMSuGX1Atx7W+UAMFgkcpqPXGNMg2pO/L/KeH 1/eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=WL6k8CNb; 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 i24si24114040oto.300.2021.10.26.03.51.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:51: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=WL6k8CNb; 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]:47664 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK3g-0000Hl-3E for patch@linaro.org; Tue, 26 Oct 2021 06:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52910) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi5-0002Gb-7J for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:37 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:39663) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi2-0004gZ-LR for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:36 -0400 Received: by mail-wm1-x32e.google.com with SMTP id y205-20020a1c7dd6000000b0032cc8c2800fso1657412wmc.4 for ; Tue, 26 Oct 2021 03:29: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=BG7xjNl/WZDOgDJsFtxwjLFHea+QsZj1hn1YKXkh+fI=; b=WL6k8CNbVDcXgtv+FTsd+Iw/qzI1m0SidJCwZ7Uc6qpJ3yF9U9XmvTsbfFEZAF1LrY hSOIR6NYUrvh/avo6BH3MpU9yJ8rG2iiigeqHYRhff/3Gkw0VrxLInNjTUQhSWeRSGtR DRKRA1B3U5uwLCQzwc6r3x9V6+XKT02XkmRFxU0WzHoiXndDEhR0R/wlRxz+FjqswkeL KX6L8JrlD3OEKshtfcik3VGs/Nf2a1BFp/baptx008PHFk+W56t+PfxcPxWLngK/QZwI Thaxcs7hF1l46tvjY3T1G6Q/r2lAtNIdUC1onetAsKjNkn2e6I85K3tYN1zz3dS5ZCik KcLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BG7xjNl/WZDOgDJsFtxwjLFHea+QsZj1hn1YKXkh+fI=; b=h7Q2gzaDTlOfnMyeOq1ie0kjTaFZD+BxHDZyatPO2IJf8tlJBhMRfenoU35Q33R+bp AVVu6bIrsv+KeejM2wVt6wcfkEAzZU3ZX3mEoqM5C1hh1oWdWI+TNZUwrDTbUj5GqQar EHKi0SAVoA8PS75WZGUWXonyBquYlXFlThobqsX5JAOdXj7oWkpuzp1DLwQfrgHOuVDl 1Oxc7rcT/3Tk18La7c5fkKkRQfcfqi65KP5FhkMUZoumPyNcaTDSUuwi3TlmsZNvFxMw rqc/AP3UW9Y7OSlc9EHw0te0UZczTq5MxUSVGpVWfFV2RsKrixnVg45E3AZzfhcwiw7p CsfQ== X-Gm-Message-State: AOAM533HRV47SuzaIgEv6aRukWNcT72kxfawsKjkBw9f1IYeEPksaUVK RBTgPkT96OBVCDvd1VT3MYH+BA== X-Received: by 2002:a1c:194:: with SMTP id 142mr13426588wmb.93.1635244173220; Tue, 26 Oct 2021 03:29:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k17sm18459866wrq.7.2021.10.26.03.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0638A1FFAC; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 14/28] plugins/cache: implement unified L2 cache emulation Date: Tue, 26 Oct 2021 11:22:20 +0100 Message-Id: <20211026102234.3961636-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour This adds an implementation of a simple L2 configuration, in which a unified L2 cache (stores both blocks of instructions and data) is maintained for each core separately, with no inter-core interaction taken in account. The L2 cache is used as a backup for L1 and is only accessed if the wanted block does not exist in L1. In terms of multi-threaded user-space emulation, the same approximation of L1 is done, a static number of caches is maintained, and each and every memory access initiated by a thread will have to go through one of the available caches. An atomic increment is used to maintain the number of L2 misses per instruction. The default cache parameters of L2 caches is: 2MB cache size 16-way associativity 64-byte blocks Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210810134844.166490-3-ma.mandourr@gmail.com> --- contrib/plugins/cache.c | 256 +++++++++++++++++++++++++++------------- 1 file changed, 175 insertions(+), 81 deletions(-) -- 2.30.2 diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index a255e26e25..908c967a09 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -82,8 +82,9 @@ typedef struct { char *disas_str; const char *symbol; uint64_t addr; - uint64_t dmisses; - uint64_t imisses; + uint64_t l1_dmisses; + uint64_t l1_imisses; + uint64_t l2_misses; } InsnData; void (*update_hit)(Cache *cache, int set, int blk); @@ -93,15 +94,20 @@ void (*metadata_init)(Cache *cache); void (*metadata_destroy)(Cache *cache); static int cores; -static Cache **dcaches, **icaches; +static Cache **l1_dcaches, **l1_icaches; +static Cache **l2_ucaches; -static GMutex *dcache_locks; -static GMutex *icache_locks; +static GMutex *l1_dcache_locks; +static GMutex *l1_icache_locks; +static GMutex *l2_ucache_locks; -static uint64_t all_dmem_accesses; -static uint64_t all_imem_accesses; -static uint64_t all_imisses; -static uint64_t all_dmisses; +static uint64_t l1_dmem_accesses; +static uint64_t l1_imem_accesses; +static uint64_t l1_imisses; +static uint64_t l1_dmisses; + +static uint64_t l2_mem_accesses; +static uint64_t l2_misses; static int pow_of_two(int num) { @@ -382,6 +388,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info, struct qemu_plugin_hwaddr *hwaddr; int cache_idx; InsnData *insn; + bool hit_in_l1; hwaddr = qemu_plugin_get_hwaddr(info, vaddr); if (hwaddr && qemu_plugin_hwaddr_is_io(hwaddr)) { @@ -391,14 +398,29 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info, effective_addr = hwaddr ? qemu_plugin_hwaddr_phys_addr(hwaddr) : vaddr; cache_idx = vcpu_index % cores; - g_mutex_lock(&dcache_locks[cache_idx]); - if (!access_cache(dcaches[cache_idx], effective_addr)) { + g_mutex_lock(&l1_dcache_locks[cache_idx]); + hit_in_l1 = access_cache(l1_dcaches[cache_idx], effective_addr); + if (!hit_in_l1) { + insn = (InsnData *) userdata; + __atomic_fetch_add(&insn->l1_dmisses, 1, __ATOMIC_SEQ_CST); + l1_dcaches[cache_idx]->misses++; + } + l1_dcaches[cache_idx]->accesses++; + g_mutex_unlock(&l1_dcache_locks[cache_idx]); + + if (hit_in_l1) { + /* No need to access L2 */ + return; + } + + g_mutex_lock(&l2_ucache_locks[cache_idx]); + if (!access_cache(l2_ucaches[cache_idx], effective_addr)) { insn = (InsnData *) userdata; - __atomic_fetch_add(&insn->dmisses, 1, __ATOMIC_SEQ_CST); - dcaches[cache_idx]->misses++; + __atomic_fetch_add(&insn->l2_misses, 1, __ATOMIC_SEQ_CST); + l2_ucaches[cache_idx]->misses++; } - dcaches[cache_idx]->accesses++; - g_mutex_unlock(&dcache_locks[cache_idx]); + l2_ucaches[cache_idx]->accesses++; + g_mutex_unlock(&l2_ucache_locks[cache_idx]); } static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata) @@ -406,18 +428,34 @@ static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata) uint64_t insn_addr; InsnData *insn; int cache_idx; + bool hit_in_l1; insn_addr = ((InsnData *) userdata)->addr; cache_idx = vcpu_index % cores; - g_mutex_lock(&icache_locks[cache_idx]); - if (!access_cache(icaches[cache_idx], insn_addr)) { + g_mutex_lock(&l1_icache_locks[cache_idx]); + hit_in_l1 = access_cache(l1_icaches[cache_idx], insn_addr); + if (!hit_in_l1) { + insn = (InsnData *) userdata; + __atomic_fetch_add(&insn->l1_imisses, 1, __ATOMIC_SEQ_CST); + l1_icaches[cache_idx]->misses++; + } + l1_icaches[cache_idx]->accesses++; + g_mutex_unlock(&l1_icache_locks[cache_idx]); + + if (hit_in_l1) { + /* No need to access L2 */ + return; + } + + g_mutex_lock(&l2_ucache_locks[cache_idx]); + if (!access_cache(l2_ucaches[cache_idx], insn_addr)) { insn = (InsnData *) userdata; - __atomic_fetch_add(&insn->imisses, 1, __ATOMIC_SEQ_CST); - icaches[cache_idx]->misses++; + __atomic_fetch_add(&insn->l2_misses, 1, __ATOMIC_SEQ_CST); + l2_ucaches[cache_idx]->misses++; } - icaches[cache_idx]->accesses++; - g_mutex_unlock(&icache_locks[cache_idx]); + l2_ucaches[cache_idx]->accesses++; + g_mutex_unlock(&l2_ucache_locks[cache_idx]); } static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) @@ -493,30 +531,28 @@ static void caches_free(Cache **caches) } } -static int dcmp(gconstpointer a, gconstpointer b) -{ - InsnData *insn_a = (InsnData *) a; - InsnData *insn_b = (InsnData *) b; - - return insn_a->dmisses < insn_b->dmisses ? 1 : -1; -} - -static void append_stats_line(GString *line, uint64_t daccess, uint64_t dmisses, - uint64_t iaccess, uint64_t imisses) +static void append_stats_line(GString *line, uint64_t l1_daccess, + uint64_t l1_dmisses, uint64_t l1_iaccess, + uint64_t l1_imisses, uint64_t l2_access, + uint64_t l2_misses) { - double dmiss_rate, imiss_rate; + double l1_dmiss_rate, l1_imiss_rate, l2_miss_rate; - dmiss_rate = ((double) dmisses) / (daccess) * 100.0; - imiss_rate = ((double) imisses) / (iaccess) * 100.0; + l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; + l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; + l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; g_string_append_printf(line, "%-14lu %-12lu %9.4lf%% %-14lu %-12lu" - " %9.4lf%%\n", - daccess, - dmisses, - daccess ? dmiss_rate : 0.0, - iaccess, - imisses, - iaccess ? imiss_rate : 0.0); + " %9.4lf%% %-12lu %-11lu %10.4lf%%\n", + l1_daccess, + l1_dmisses, + l1_daccess ? l1_dmiss_rate : 0.0, + l1_iaccess, + l1_imisses, + l1_iaccess ? l1_imiss_rate : 0.0, + l2_access, + l2_misses, + l2_access ? l2_miss_rate : 0.0); } static void sum_stats(void) @@ -525,43 +561,66 @@ static void sum_stats(void) g_assert(cores > 1); for (i = 0; i < cores; i++) { - all_imisses += icaches[i]->misses; - all_dmisses += dcaches[i]->misses; - all_imem_accesses += icaches[i]->accesses; - all_dmem_accesses += dcaches[i]->accesses; + l1_imisses += l1_icaches[i]->misses; + l1_dmisses += l1_dcaches[i]->misses; + l1_imem_accesses += l1_icaches[i]->accesses; + l1_dmem_accesses += l1_dcaches[i]->accesses; + + l2_misses += l2_ucaches[i]->misses; + l2_mem_accesses += l2_ucaches[i]->accesses; } } +static int dcmp(gconstpointer a, gconstpointer b) +{ + InsnData *insn_a = (InsnData *) a; + InsnData *insn_b = (InsnData *) b; + + return insn_a->l1_dmisses < insn_b->l1_dmisses ? 1 : -1; +} + static int icmp(gconstpointer a, gconstpointer b) { InsnData *insn_a = (InsnData *) a; InsnData *insn_b = (InsnData *) b; - return insn_a->imisses < insn_b->imisses ? 1 : -1; + return insn_a->l1_imisses < insn_b->l1_imisses ? 1 : -1; +} + +static int l2_cmp(gconstpointer a, gconstpointer b) +{ + InsnData *insn_a = (InsnData *) a; + InsnData *insn_b = (InsnData *) b; + + return insn_a->l2_misses < insn_b->l2_misses ? 1 : -1; } static void log_stats(void) { int i; - Cache *icache, *dcache; + Cache *icache, *dcache, *l2_cache; g_autoptr(GString) rep = g_string_new("core #, data accesses, data misses," " dmiss rate, insn accesses," - " insn misses, imiss rate\n"); + " insn misses, imiss rate," + " l2 accesses, l2 misses," + " l2 miss rate\n"); for (i = 0; i < cores; i++) { g_string_append_printf(rep, "%-8d", i); - dcache = dcaches[i]; - icache = icaches[i]; + dcache = l1_dcaches[i]; + icache = l1_icaches[i]; + l2_cache = l2_ucaches[i]; append_stats_line(rep, dcache->accesses, dcache->misses, - icache->accesses, icache->misses); + icache->accesses, icache->misses, l2_cache->accesses, + l2_cache->misses); } if (cores > 1) { sum_stats(); g_string_append_printf(rep, "%-8s", "sum"); - append_stats_line(rep, all_dmem_accesses, all_dmisses, - all_imem_accesses, all_imisses); + append_stats_line(rep, l1_dmem_accesses, l1_dmisses, + l1_imem_accesses, l1_imisses, l2_mem_accesses, l2_misses); } g_string_append(rep, "\n"); @@ -585,7 +644,7 @@ static void log_top_insns(void) if (insn->symbol) { g_string_append_printf(rep, " (%s)", insn->symbol); } - g_string_append_printf(rep, ", %ld, %s\n", insn->dmisses, + g_string_append_printf(rep, ", %ld, %s\n", insn->l1_dmisses, insn->disas_str); } @@ -598,7 +657,20 @@ static void log_top_insns(void) if (insn->symbol) { g_string_append_printf(rep, " (%s)", insn->symbol); } - g_string_append_printf(rep, ", %ld, %s\n", insn->imisses, + g_string_append_printf(rep, ", %ld, %s\n", insn->l1_imisses, + insn->disas_str); + } + + miss_insns = g_list_sort(miss_insns, l2_cmp); + g_string_append_printf(rep, "%s", "\naddress, L2 misses, instruction\n"); + + for (curr = miss_insns, i = 0; curr && i < limit; i++, curr = curr->next) { + insn = (InsnData *) curr->data; + g_string_append_printf(rep, "0x%" PRIx64, insn->addr); + if (insn->symbol) { + g_string_append_printf(rep, " (%s)", insn->symbol); + } + g_string_append_printf(rep, ", %ld, %s\n", insn->l2_misses, insn->disas_str); } @@ -611,11 +683,13 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) log_stats(); log_top_insns(); - caches_free(dcaches); - caches_free(icaches); + caches_free(l1_dcaches); + caches_free(l1_icaches); + caches_free(l2_ucaches); - g_free(dcache_locks); - g_free(icache_locks); + g_free(l1_dcache_locks); + g_free(l1_icache_locks); + g_free(l2_ucache_locks); g_hash_table_destroy(miss_ht); } @@ -647,19 +721,24 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { int i; - int iassoc, iblksize, icachesize; - int dassoc, dblksize, dcachesize; + int l1_iassoc, l1_iblksize, l1_icachesize; + int l1_dassoc, l1_dblksize, l1_dcachesize; + int l2_assoc, l2_blksize, l2_cachesize; limit = 32; sys = info->system_emulation; - dassoc = 8; - dblksize = 64; - dcachesize = dblksize * dassoc * 32; + l1_dassoc = 8; + l1_dblksize = 64; + l1_dcachesize = l1_dblksize * l1_dassoc * 32; + + l1_iassoc = 8; + l1_iblksize = 64; + l1_icachesize = l1_iblksize * l1_iassoc * 32; - iassoc = 8; - iblksize = 64; - icachesize = iblksize * iassoc * 32; + l2_assoc = 16; + l2_blksize = 64; + l2_cachesize = l2_assoc * l2_blksize * 2048; policy = LRU; @@ -668,21 +747,27 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, for (i = 0; i < argc; i++) { char *opt = argv[i]; if (g_str_has_prefix(opt, "iblksize=")) { - iblksize = g_ascii_strtoll(opt + 9, NULL, 10); + l1_iblksize = g_ascii_strtoll(opt + 9, NULL, 10); } else if (g_str_has_prefix(opt, "iassoc=")) { - iassoc = g_ascii_strtoll(opt + 7, NULL, 10); + l1_iassoc = g_ascii_strtoll(opt + 7, NULL, 10); } else if (g_str_has_prefix(opt, "icachesize=")) { - icachesize = g_ascii_strtoll(opt + 11, NULL, 10); + l1_icachesize = g_ascii_strtoll(opt + 11, NULL, 10); } else if (g_str_has_prefix(opt, "dblksize=")) { - dblksize = g_ascii_strtoll(opt + 9, NULL, 10); + l1_dblksize = g_ascii_strtoll(opt + 9, NULL, 10); } else if (g_str_has_prefix(opt, "dassoc=")) { - dassoc = g_ascii_strtoll(opt + 7, NULL, 10); + l1_dassoc = g_ascii_strtoll(opt + 7, NULL, 10); } else if (g_str_has_prefix(opt, "dcachesize=")) { - dcachesize = g_ascii_strtoll(opt + 11, NULL, 10); + l1_dcachesize = g_ascii_strtoll(opt + 11, NULL, 10); } else if (g_str_has_prefix(opt, "limit=")) { limit = g_ascii_strtoll(opt + 6, NULL, 10); } else if (g_str_has_prefix(opt, "cores=")) { cores = g_ascii_strtoll(opt + 6, NULL, 10); + } else if (g_str_has_prefix(opt, "l2cachesize=")) { + l2_cachesize = g_ascii_strtoll(opt + 6, NULL, 10); + } else if (g_str_has_prefix(opt, "l2blksize=")) { + l2_blksize = g_ascii_strtoll(opt + 6, NULL, 10); + } else if (g_str_has_prefix(opt, "l2assoc=")) { + l2_assoc = g_ascii_strtoll(opt + 6, NULL, 10); } else if (g_str_has_prefix(opt, "evict=")) { gchar *p = opt + 6; if (g_strcmp0(p, "rand") == 0) { @@ -703,24 +788,33 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, policy_init(); - dcaches = caches_init(dblksize, dassoc, dcachesize); - if (!dcaches) { - const char *err = cache_config_error(dblksize, dassoc, dcachesize); + l1_dcaches = caches_init(l1_dblksize, l1_dassoc, l1_dcachesize); + if (!l1_dcaches) { + const char *err = cache_config_error(l1_dblksize, l1_dassoc, l1_dcachesize); fprintf(stderr, "dcache cannot be constructed from given parameters\n"); fprintf(stderr, "%s\n", err); return -1; } - icaches = caches_init(iblksize, iassoc, icachesize); - if (!icaches) { - const char *err = cache_config_error(iblksize, iassoc, icachesize); + l1_icaches = caches_init(l1_iblksize, l1_iassoc, l1_icachesize); + if (!l1_icaches) { + const char *err = cache_config_error(l1_iblksize, l1_iassoc, l1_icachesize); fprintf(stderr, "icache cannot be constructed from given parameters\n"); fprintf(stderr, "%s\n", err); return -1; } - dcache_locks = g_new0(GMutex, cores); - icache_locks = g_new0(GMutex, cores); + l2_ucaches = caches_init(l2_blksize, l2_assoc, l2_cachesize); + if (!l2_ucaches) { + const char *err = cache_config_error(l2_blksize, l2_assoc, l2_cachesize); + fprintf(stderr, "L2 cache cannot be constructed from given parameters\n"); + fprintf(stderr, "%s\n", err); + return -1; + } + + l1_dcache_locks = g_new0(GMutex, cores); + l1_icache_locks = g_new0(GMutex, cores); + l2_ucache_locks = g_new0(GMutex, cores); qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); From patchwork Tue Oct 26 10:22:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516202 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp157010imj; Tue, 26 Oct 2021 03:48:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPAtL1F1fGYP4PreFv15B8W4EJqbFLRP+mokCk1P9IURAmg7XjdzbZEj3RCD3BddJOy8jA X-Received: by 2002:a05:6808:148e:: with SMTP id e14mr27384640oiw.172.1635245332045; Tue, 26 Oct 2021 03:48:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245332; cv=none; d=google.com; s=arc-20160816; b=xt62/vdRhDuQLeQ6Btz/Oab+lRSr0JsJmrXdkiWj0hkprKyvXvB+vIKJNPk4zhT1Tr ewAoQ+22r8jExMbFTSamun/UoBwboPofOBvGcZDIXT6X40ylrQo7+NLfnk/lfx+R+dYr G5c/q4Vz7lB89codgluTYQb6dwBhM69uNba90LsZYka4tdsZ3jw79C4jpEYsucTWUpfd KZalBTe5BLn7arNzmj/vccTtaFOUYU6keMHv9+TxrXqSj9ceJCj6rqBRXnPdraEy7kXO nES+8F7ioRNJsT16AopmYMDtOTBEmtdov3UN6JipWUXxOmCCNxjRwTx91vhyr7OL37DB Yk5A== 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=86ZYZZNhGDhe4VIPYrvOMI4ML6p9Tw/V+rOGjZWWBFM=; b=DPfqO99g9g2UqpMDExFWDAj6149Y2xlp48lSubLEorTjFaroy1kj1EqzA9KTm/rW1i UA6fY+sODXpiZahnmUH4t/IJJmT4UoQTB2o7oeDzHWVDQqxz+z1yXwa6gdR92tENps0a bi7ApRMbJN+Z7nxXIkSFd6O803i9nDov+qY6Av7v8pmfvA+kMaaDTlcOdfMvo6L69ska CjTC/ZA93KlKUzY0UFcZr2WIT3KGBWRrT4Wm0tbTJ3FImFeMXj3d4TTyHYQl51nQpc49 bVvnhKGMXA+3cpPPXh4A75CdLocZ7GSkXhm5oVE1uCRP1vLRd6HMNKvZscVTvANReljn 2d0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RVKMExMk; 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 i23si27619309otf.234.2021.10.26.03.48.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:48:52 -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=RVKMExMk; 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]:39174 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK0h-0002zi-Ad for patch@linaro.org; Tue, 26 Oct 2021 06:48:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJhx-0001sX-Nr for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:29 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:38544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhw-0004fx-1d for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:29 -0400 Received: by mail-wr1-x429.google.com with SMTP id u18so14915690wrg.5 for ; Tue, 26 Oct 2021 03:29: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=86ZYZZNhGDhe4VIPYrvOMI4ML6p9Tw/V+rOGjZWWBFM=; b=RVKMExMkXgDv+7oNGqbJ5SfrExL7PTysrl1Y6BoGcNE3VplwfTKxZlF8LL5901JbIc bJkHnnaFYSYmFEpIt0ej5+JjN6YESlwp2MP16YP/BNpM9dsiNObkQpc0t/DX6KOw0PN/ gkDzJ16+Er3QWtBbHjV0Gig4S54YJiuWSkbdSfbjMaNTu1PAkQDURQESEScqeiaXkd7W FfwAz/oUmM3/OFtEyp9xVkd0Hp9rp7hI67TyoW36fqsLFSjSt2yqd4y2mCMqjtX29fDc 1pkLnAsS2beeOOvUzep8JHP/fp4mI3Wpkflchgt1TCxIPNtg/3/4hm6gyyNTBcS/TQ6e XcVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=86ZYZZNhGDhe4VIPYrvOMI4ML6p9Tw/V+rOGjZWWBFM=; b=RMaWo39wi3ORGY+auG6wzSkykc9y+ajoZ2Tf74+kgikIBKVIcK2Jqh4LAhToH0QlMU VCM1G4HK10dXp3HzBs+Wz/iPeGxw8SRSR9iGf4m8H2IacYmr7SqfqBBNvD6Aa2F4IRKD Djt/Dz88hoWN3foAykqwjedxlib6ZHBBJvBW0ls9g3WxG+FeZuCo7sNpc+HGWkyaWQJ8 3bC8Xg8qRG5VAzFJLJ2p4EoPBu9iKzDNFdj7PCKMcmX1WH38rJp41cB3M+HsrW/+Fcl0 N7pKlHmPH7C+H+6MWCjd9o5ovdXIwrQzd00zFFlB80AX67qNaVUx9Ihz63Z64L4Tph/L mhtA== X-Gm-Message-State: AOAM5336i/jPxDkVC5g5zN5fIb1yer+HA7rwYeKL/2OagrlGvb0OiW2D +S7mhnYnWcM4Ro9VwZhRTSkRRg== X-Received: by 2002:a5d:4742:: with SMTP id o2mr29174076wrs.151.1635244166793; Tue, 26 Oct 2021 03:29:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j20sm173158wmp.27.2021.10.26.03.29.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 154581FFAE; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 15/28] plugins/cache: split command line arguments into name and value Date: Tue, 26 Oct 2021 11:22:21 +0100 Message-Id: <20211026102234.3961636-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour This way of handling args is more lenient and sets a better framework to parse boolean command line arguments. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210810134844.166490-4-ma.mandourr@gmail.com> --- contrib/plugins/cache.c | 57 ++++++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 27 deletions(-) -- 2.30.2 diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index 908c967a09..ff325beb9f 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -11,6 +11,8 @@ #include +#define STRTOLL(x) g_ascii_strtoll(x, NULL, 10) + QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW; @@ -746,35 +748,36 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, for (i = 0; i < argc; i++) { char *opt = argv[i]; - if (g_str_has_prefix(opt, "iblksize=")) { - l1_iblksize = g_ascii_strtoll(opt + 9, NULL, 10); - } else if (g_str_has_prefix(opt, "iassoc=")) { - l1_iassoc = g_ascii_strtoll(opt + 7, NULL, 10); - } else if (g_str_has_prefix(opt, "icachesize=")) { - l1_icachesize = g_ascii_strtoll(opt + 11, NULL, 10); - } else if (g_str_has_prefix(opt, "dblksize=")) { - l1_dblksize = g_ascii_strtoll(opt + 9, NULL, 10); - } else if (g_str_has_prefix(opt, "dassoc=")) { - l1_dassoc = g_ascii_strtoll(opt + 7, NULL, 10); - } else if (g_str_has_prefix(opt, "dcachesize=")) { - l1_dcachesize = g_ascii_strtoll(opt + 11, NULL, 10); - } else if (g_str_has_prefix(opt, "limit=")) { - limit = g_ascii_strtoll(opt + 6, NULL, 10); - } else if (g_str_has_prefix(opt, "cores=")) { - cores = g_ascii_strtoll(opt + 6, NULL, 10); - } else if (g_str_has_prefix(opt, "l2cachesize=")) { - l2_cachesize = g_ascii_strtoll(opt + 6, NULL, 10); - } else if (g_str_has_prefix(opt, "l2blksize=")) { - l2_blksize = g_ascii_strtoll(opt + 6, NULL, 10); - } else if (g_str_has_prefix(opt, "l2assoc=")) { - l2_assoc = g_ascii_strtoll(opt + 6, NULL, 10); - } else if (g_str_has_prefix(opt, "evict=")) { - gchar *p = opt + 6; - if (g_strcmp0(p, "rand") == 0) { + g_autofree char **tokens = g_strsplit(opt, "=", 2); + + if (g_strcmp0(tokens[0], "iblksize") == 0) { + l1_iblksize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "iassoc") == 0) { + l1_iassoc = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "icachesize") == 0) { + l1_icachesize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "dblksize") == 0) { + l1_dblksize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "dassoc") == 0) { + l1_dassoc = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "dcachesize") == 0) { + l1_dcachesize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "limit") == 0) { + limit = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "cores") == 0) { + cores = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "l2cachesize") == 0) { + l2_cachesize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "l2blksize") == 0) { + l2_blksize = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "l2assoc") == 0) { + l2_assoc = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "evict") == 0) { + if (g_strcmp0(tokens[1], "rand") == 0) { policy = RAND; - } else if (g_strcmp0(p, "lru") == 0) { + } else if (g_strcmp0(tokens[1], "lru") == 0) { policy = LRU; - } else if (g_strcmp0(p, "fifo") == 0) { + } else if (g_strcmp0(tokens[1], "fifo") == 0) { policy = FIFO; } else { fprintf(stderr, "invalid eviction policy: %s\n", opt); From patchwork Tue Oct 26 10:22:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516205 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp161250imj; Tue, 26 Oct 2021 03:54:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/n/d9fsU/MmUKL5y0WlYOB2cW3xgYAwDBcJ0YmZdk4hjzYZ4hkK+ESGrIJoMyvYvwD9tA X-Received: by 2002:aca:5b56:: with SMTP id p83mr17176972oib.119.1635245685768; Tue, 26 Oct 2021 03:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245685; cv=none; d=google.com; s=arc-20160816; b=U4gfQpjwENObfTj23nqdE7QKKwdQOd2/uiZa1ADk11gA1xZ3F3eK8mbIfKgYKWn8FB DC2HDw2DwpuT5W4xnmk12juAzkktwh8ATEDcy6+JXm2vo3higlJDeW2VqdDsfI9364Br a7BMstQ5bvhmZpKhEwR3AmvsFakdCqXjuwRSI739xflHkLGXH7kfNgx+NE2dZdMy3hsP xAfQeABq67F1ZOuZD3e4JKxEKxLKKKQ1Rs4N7mCrrFiExlJmw6nAcdTpfha2IumZX7Ck xG3c+aK1uo3aV7cCAq6cVO1tZDglg0qG34i1g7SLyOV70JChzOYP6p/HZSqKreDLLV0G PbHg== 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=0q0oTsrrcyyz232kRXErRNjiegCmvWxDxzkNa3qvjnk=; b=IerbALVzlbtQz/bybDQzxMNU0V0CQq59uWgkO8MYwP94T7Xb4V2QS/F1HUqrExxJhZ pUnbyDP9bXrDoXKDESKrPf2vWDVf73qejfqO0VXPsmmJW4Y2LG+TfHiBzmsSu0LBxIop RLQ/tnMD9yTZVTyHty5QV14pi/rQHU2ujev4q6oIUF4SqdYyN/XjZr6RZVlNigAZRSB5 njnoOA02Kyg2r45s6wGqmGGfZcJP7tU+LRkg6bJG2FnNU/D6bb/3Nfx3ABg3EJB9qBtO mFlAyk/DzFp4Rh4dSoYzhqnag9yN9t6IA1x1XTRdGrNONn0XYTi/XPltB705OACgXKnQ 9c8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Xgg8NmXS; 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 y188si20762285ooa.21.2021.10.26.03.54.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:54: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=Xgg8NmXS; 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]:55668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK6P-0005d1-2g for patch@linaro.org; Tue, 26 Oct 2021 06:54:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi9-0002Xb-AO for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:41 -0400 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]:41556) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi7-0004hC-42 for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:41 -0400 Received: by mail-wr1-x433.google.com with SMTP id d3so14150250wrh.8 for ; Tue, 26 Oct 2021 03:29: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=0q0oTsrrcyyz232kRXErRNjiegCmvWxDxzkNa3qvjnk=; b=Xgg8NmXSYGz+QJasmBIhndPgV2KCyZ1WvJeJPF2k1L9TVCOFS0l2RuZUCfFV/Uchjs eurfX7Ud4TSm5lefv/jCL7psVeLXStQJPI/pwqjp+89vHjLrGtPyUknpJLxSvBJqSM5A ixfNWRlUjLwsfc2CVCoqpjidzdbZl2KjeNeJ3GWP93iRoHSm9yGUTzWkr3GjTKET1mcu hgSOyU9Yl0pUz/J88xtWb5xpkVT+vh0lfl5fh23DwsuWlTlSrXXNLBiKSFz7dY2zZ6jt Vxwg/wvWOfR3ecrSDXtAac26NJaMB8Di9fOr0zjPN9QvnPc2FDa58lNGMvki9YBOuGNM Sbkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0q0oTsrrcyyz232kRXErRNjiegCmvWxDxzkNa3qvjnk=; b=EZnW++tfzu07PNiwE8XxDIeWLv1eZnFwzQvmyvwEwh/FvSoG3JNWsYdNedQE4dFSaB lBtFWwUVFH6NQJSSkJqOPV8NKL6GVv3px8mfGfUxhrSUhMAW/7h2wE6cE40m3C7xHfwm kzbI1UB6+8t4wbIxt7PDf91XFVC15nyXNBsBM3VcS09Pzq9NXVb2gApv5rqkpOBJqkQD ElKytXwswZYfSDyWKXh3MHrydGfBbnhLv7UkK1Y7LD1QBmkEfZypZyhqmO5emJ+uO5Ki 0Y2T/YKGDWOldSGEzvJpO4/tmbQbHxtZi1Mkt5MX9nSRRtW/M6kbAgYl/7Ndh0AHG+eb Kq4A== X-Gm-Message-State: AOAM5308ocQmJITExKg+u+4HRVASWc87yjsdatliFT+MKlVKTgkLJ3VK KZEUKkUqZf/JxkNMQZjSit+QZA== X-Received: by 2002:adf:f210:: with SMTP id p16mr25681160wro.61.1635244177779; Tue, 26 Oct 2021 03:29:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id x2sm204553wmj.3.2021.10.26.03.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2D06B1FFAF; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 16/28] plugins/cache: make L2 emulation optional through args Date: Tue, 26 Oct 2021 11:22:22 +0100 Message-Id: <20211026102234.3961636-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::433; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour By default L2 is not enabled and is enabled by either using the newly-introduced "l2" boolean argument, or by setting any of the L2 cache parameters using args. On specifying "l2=on", the default cache configuration is used. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210810134844.166490-5-ma.mandourr@gmail.com> --- contrib/plugins/cache.c | 76 +++++++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 22 deletions(-) -- 2.30.2 diff --git a/contrib/plugins/cache.c b/contrib/plugins/cache.c index ff325beb9f..b9226e7c40 100644 --- a/contrib/plugins/cache.c +++ b/contrib/plugins/cache.c @@ -97,6 +97,8 @@ void (*metadata_destroy)(Cache *cache); static int cores; static Cache **l1_dcaches, **l1_icaches; + +static bool use_l2; static Cache **l2_ucaches; static GMutex *l1_dcache_locks; @@ -410,7 +412,7 @@ static void vcpu_mem_access(unsigned int vcpu_index, qemu_plugin_meminfo_t info, l1_dcaches[cache_idx]->accesses++; g_mutex_unlock(&l1_dcache_locks[cache_idx]); - if (hit_in_l1) { + if (hit_in_l1 || !use_l2) { /* No need to access L2 */ return; } @@ -445,7 +447,7 @@ static void vcpu_insn_exec(unsigned int vcpu_index, void *userdata) l1_icaches[cache_idx]->accesses++; g_mutex_unlock(&l1_icache_locks[cache_idx]); - if (hit_in_l1) { + if (hit_in_l1 || !use_l2) { /* No need to access L2 */ return; } @@ -542,19 +544,25 @@ static void append_stats_line(GString *line, uint64_t l1_daccess, l1_dmiss_rate = ((double) l1_dmisses) / (l1_daccess) * 100.0; l1_imiss_rate = ((double) l1_imisses) / (l1_iaccess) * 100.0; - l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; g_string_append_printf(line, "%-14lu %-12lu %9.4lf%% %-14lu %-12lu" - " %9.4lf%% %-12lu %-11lu %10.4lf%%\n", + " %9.4lf%%", l1_daccess, l1_dmisses, l1_daccess ? l1_dmiss_rate : 0.0, l1_iaccess, l1_imisses, - l1_iaccess ? l1_imiss_rate : 0.0, - l2_access, - l2_misses, - l2_access ? l2_miss_rate : 0.0); + l1_iaccess ? l1_imiss_rate : 0.0); + + if (use_l2) { + l2_miss_rate = ((double) l2_misses) / (l2_access) * 100.0; + g_string_append_printf(line, " %-12lu %-11lu %10.4lf%%", + l2_access, + l2_misses, + l2_access ? l2_miss_rate : 0.0); + } + + g_string_append(line, "\n"); } static void sum_stats(void) @@ -568,8 +576,10 @@ static void sum_stats(void) l1_imem_accesses += l1_icaches[i]->accesses; l1_dmem_accesses += l1_dcaches[i]->accesses; - l2_misses += l2_ucaches[i]->misses; - l2_mem_accesses += l2_ucaches[i]->accesses; + if (use_l2) { + l2_misses += l2_ucaches[i]->misses; + l2_mem_accesses += l2_ucaches[i]->accesses; + } } } @@ -604,25 +614,31 @@ static void log_stats(void) g_autoptr(GString) rep = g_string_new("core #, data accesses, data misses," " dmiss rate, insn accesses," - " insn misses, imiss rate," - " l2 accesses, l2 misses," - " l2 miss rate\n"); + " insn misses, imiss rate"); + + if (use_l2) { + g_string_append(rep, ", l2 accesses, l2 misses, l2 miss rate"); + } + + g_string_append(rep, "\n"); for (i = 0; i < cores; i++) { g_string_append_printf(rep, "%-8d", i); dcache = l1_dcaches[i]; icache = l1_icaches[i]; - l2_cache = l2_ucaches[i]; + l2_cache = use_l2 ? l2_ucaches[i] : NULL; append_stats_line(rep, dcache->accesses, dcache->misses, - icache->accesses, icache->misses, l2_cache->accesses, - l2_cache->misses); + icache->accesses, icache->misses, + l2_cache ? l2_cache->accesses : 0, + l2_cache ? l2_cache->misses : 0); } if (cores > 1) { sum_stats(); g_string_append_printf(rep, "%-8s", "sum"); append_stats_line(rep, l1_dmem_accesses, l1_dmisses, - l1_imem_accesses, l1_imisses, l2_mem_accesses, l2_misses); + l1_imem_accesses, l1_imisses, + l2_cache ? l2_mem_accesses : 0, l2_cache ? l2_misses : 0); } g_string_append(rep, "\n"); @@ -663,6 +679,10 @@ static void log_top_insns(void) insn->disas_str); } + if (!use_l2) { + goto finish; + } + miss_insns = g_list_sort(miss_insns, l2_cmp); g_string_append_printf(rep, "%s", "\naddress, L2 misses, instruction\n"); @@ -676,6 +696,7 @@ static void log_top_insns(void) insn->disas_str); } +finish: qemu_plugin_outs(rep->str); g_list_free(miss_insns); } @@ -687,11 +708,14 @@ static void plugin_exit(qemu_plugin_id_t id, void *p) caches_free(l1_dcaches); caches_free(l1_icaches); - caches_free(l2_ucaches); g_free(l1_dcache_locks); g_free(l1_icache_locks); - g_free(l2_ucache_locks); + + if (use_l2) { + caches_free(l2_ucaches); + g_free(l2_ucache_locks); + } g_hash_table_destroy(miss_ht); } @@ -767,11 +791,19 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, } else if (g_strcmp0(tokens[0], "cores") == 0) { cores = STRTOLL(tokens[1]); } else if (g_strcmp0(tokens[0], "l2cachesize") == 0) { + use_l2 = true; l2_cachesize = STRTOLL(tokens[1]); } else if (g_strcmp0(tokens[0], "l2blksize") == 0) { + use_l2 = true; l2_blksize = STRTOLL(tokens[1]); } else if (g_strcmp0(tokens[0], "l2assoc") == 0) { + use_l2 = true; l2_assoc = STRTOLL(tokens[1]); + } else if (g_strcmp0(tokens[0], "l2") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &use_l2)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } } else if (g_strcmp0(tokens[0], "evict") == 0) { if (g_strcmp0(tokens[1], "rand") == 0) { policy = RAND; @@ -807,8 +839,8 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, return -1; } - l2_ucaches = caches_init(l2_blksize, l2_assoc, l2_cachesize); - if (!l2_ucaches) { + l2_ucaches = use_l2 ? caches_init(l2_blksize, l2_assoc, l2_cachesize) : NULL; + if (!l2_ucaches && use_l2) { const char *err = cache_config_error(l2_blksize, l2_assoc, l2_cachesize); fprintf(stderr, "L2 cache cannot be constructed from given parameters\n"); fprintf(stderr, "%s\n", err); @@ -817,7 +849,7 @@ int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, l1_dcache_locks = g_new0(GMutex, cores); l1_icache_locks = g_new0(GMutex, cores); - l2_ucache_locks = g_new0(GMutex, cores); + l2_ucache_locks = use_l2 ? g_new0(GMutex, cores) : NULL; qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); From patchwork Tue Oct 26 10:22:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516199 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp153897imj; Tue, 26 Oct 2021 03:44:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzELbBuAfsL8cjf5QRT9/G5LqIWLk7hwx26e/qxR3ZO4vOMnUqGr/l5haeEMPQUFKHA+ZQB X-Received: by 2002:aca:3e09:: with SMTP id l9mr28029790oia.131.1635245073441; Tue, 26 Oct 2021 03:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245073; cv=none; d=google.com; s=arc-20160816; b=Xk4EzpK9XcjkCuMc2SAwuR+iB6Ye45oVEu9MT9rVCndUhlvfWUoJbuyQusAvg2gwpA s5IykRrSyCbx8rhPgWvN8BhRRPsGFmn02hKUhTDp4IOleINNl3U6px5ix96VllpZfiXY RM8MqAGf+j1pNk+WRH87OYF75Q78nqHZPKQJTkHSpXdRFSDmo/9mgLgF3kW98fnKqR/r w1le4X+C4sO6ScSyIFyFu8HLgZObgWzEeC45NENXCL34xKNYXfN5pgnCoK67eZJIKrRG PUiXcSjNR5XVgqskx8fZlnMi/nfBUeXKXhWPI+1I3vuVIwgP/nZgHFurEZ3iUQ73/wQj G3WA== 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=ZF9xj7LRpua4qvObxupnGeTarhtcAbiVRP+gp+HlrD4=; b=PkGOqP6f0Dhx6BLNx20zrOuXgz2JGNFP11HCBXqR0UoRVwzVqFNBbLDGDd+iXM4iL+ 7kzz3U0zcAD/IVJ634MjQ+qb0bByUrDSC80TVuIA9Q+LXLDHnbP3pXKt0h5ttlaPHdBD aq2jzHw+CkIDCF/+chzYWWBxYKdbT/9V/3LUtCuhwGycGkS5O/mdmBK6G+XfaooSc6mQ TM+H6Ya7URyg6icjFusHsl7Rc0Jhhnxoy3o226mTmrH9VC78YrzWmbc33WKAIAwS9L1f EZqJ8UCClPTOEVoRW9AS3KWJzOSpHiMKlCe7X9u222U2kDzxNcxfOvVmrt9x6wigUwR3 mPew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eydXQZrz; 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 q2si9294736oiv.98.2021.10.26.03.44.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:44: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=eydXQZrz; 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]:58910 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJwW-0005ex-Qt for patch@linaro.org; Tue, 26 Oct 2021 06:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJhs-0001bH-HM for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:24 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:34802) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhq-0004ed-HX for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:24 -0400 Received: by mail-wm1-x334.google.com with SMTP id o4-20020a1c7504000000b0032cab7473caso841650wmc.1 for ; Tue, 26 Oct 2021 03:29: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=ZF9xj7LRpua4qvObxupnGeTarhtcAbiVRP+gp+HlrD4=; b=eydXQZrz4h0OloANw1N5zRAeJrW2xpS/n0ZKQJxy5KiKQQrJON+QkTZx6oGMHzxvHM ctXHDmzwdb8AgplQAbN4qu4vrvUm0GBmHdTWe6DOyyhtjO2nYCAk5DT1LFykpD4OCOpL WozTDKhR/rpsn8kxQMAxiF9vS61UGDqQUSXva39iMFbTXMSB5PanGpMVanEU7+WZ8Bbv Gpqr70hy5Z2+BDeDsm8YRP6/xr6ZF3GydfxOBLRYu2+pF/fX+x/lQYmL9Ul7cRMon6Lc lWO67VQes74bO13bB649GomV7fAg6KCYZkeB537Dd+8AoZz1we2lWLpiahDoQABlnmS9 nKaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZF9xj7LRpua4qvObxupnGeTarhtcAbiVRP+gp+HlrD4=; b=QMZ+D+gOVuD1RJs7QkEUae64nQulqqx8YBU6G/FnDAo612dhqLRHYCnIZKG+H+cmYu Q9V2mzt9ovfqRr6vz8CIMv1jKfQ99aYQSMABKACIzkFtoleG9pgyneFApe3yqm8LPk3X FDh4sPGR7hG2dJeFfSum8Osm8eFp5bu8dfySvPBrFP7Mrf6jlGWUSob7sN8i+FHmSYMu IZ9IPea0231zhFOYLujSeb9hWSMtQN2klu2c7FaACv3sWH20c2ZMJa+Xy3hNdBuA+63q M3m+tjRYQGGe+E84Lm6Z7TPCyv0M1HuGTMfG3/mAUHi4zT1ZLJdN+eat63DvjIcEgI1p Hnlg== X-Gm-Message-State: AOAM530Kn3wfAJCUmzi2HF9Yu+AvhCNu0D+EYFRyCEO+pf7bs2GsmNfy kvPEYw5NBmyURWCqLCiFDCg0qQ== X-Received: by 2002:a05:600c:ad8:: with SMTP id c24mr147615wmr.82.1635244160004; Tue, 26 Oct 2021 03:29:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t3sm642268wrq.66.2021.10.26.03.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:18 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3BB5B1FFB1; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 17/28] docs/tcg-plugins: add L2 arguments to cache docs Date: Tue, 26 Oct 2021 11:22:23 +0100 Message-Id: <20211026102234.3961636-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Mahmoud Mandour cache plugin now allows optional L2 per-core cache emulation that can be configured through plugin arguments, this commit adds this functionality to the docs. While I'm at it, I editted the bullet point for cache plugin to say: contrib/plugins/cache.c instead of contrib/plugins/cache to match other plugins. Signed-off-by: Mahmoud Mandour Signed-off-by: Alex Bennée Message-Id: <20210810134844.166490-6-ma.mandourr@gmail.com> --- docs/devel/tcg-plugins.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 842ae01a4c..59a7d838be 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -361,8 +361,9 @@ which will output an execution trace following this structure:: - contrib/plugins/cache.c -Cache modelling plugin that measures the performance of a given cache -configuration when a given working set is run:: +Cache modelling plugin that measures the performance of a given L1 cache +configuration, and optionally a unified L2 per-core cache when a given working +set is run:: qemu-x86_64 -plugin ./contrib/plugins/libcache.so \ -d plugin -D cache.log ./tests/tcg/x86_64-linux-user/float_convs @@ -420,3 +421,18 @@ The plugin has a number of arguments, all of them are optional: Sets the number of cores for which we maintain separate icache and dcache. (default: for linux-user, N = 1, for full system emulation: N = cores available to guest) + + * l2=on + + Simulates a unified L2 cache (stores blocks for both instructions and data) + using the default L2 configuration (cache size = 2MB, associativity = 16-way, + block size = 64B). + + * l2cachesize=N + * l2blksize=B + * l2assoc=A + + L2 cache configuration arguments. They specify the cache size, block size, and + associativity of the L2 cache, respectively. Setting any of the L2 + configuration arguments implies ``l2=on``. + (default: N = 2097152 (2MB), B = 64, A = 16) From patchwork Tue Oct 26 10:22:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516197 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp151966imj; Tue, 26 Oct 2021 03:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMFr2+VIboy7RC8S0+7CTPufXKme2iaEt3tXbuxVvI3mhQFmNgv5g7daaU9Pbx7McetLbV X-Received: by 2002:a05:6830:3096:: with SMTP id f22mr19380288ots.195.1635244930331; Tue, 26 Oct 2021 03:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244930; cv=none; d=google.com; s=arc-20160816; b=KVMaodQ6XMO/hePb2XPe3g0QL/40yzh4XqfKx/kgheO7AWbu6dVfeb/wiwrijILucN /aL/4eY8itPsbnZuilzpj/j6QuTeg9uu7oro4oP1Zx2x48zIrQzd8s2PSFFpMyPfxJBW 8SMJHVlvXAw4wlF3SzNsWD+CTwAoKtfvuJnnAfcmMcCkKfVIQRBWZwhiR7qvFHUc1puS U0EVexUhwvLZ4SRt8F0pYP0HIPGWZPY+SdSZw6vm+rKem6HtfRHPxNZZT3CP8S56F2RV RBJQiKyLX4BUEqR8FEWnIj7ECM13zGhFNIxYKcOvFJiMU5RWUWjYUe+cN4JAzyjQHJRa e92A== 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=5nc1aRJ5hwFpLdq28mQ7T73wF2chGMJXK8KdXx7nbm4=; b=mEXHUPVKDouhCckArQZoRxmzXHrcwE6AI2Rjpc8xOeg2QCZDYTucEtxpaiNUul1yaA IYsboSHSHnC7GkZZLmj+fniV1jDdtVLkH3DUUakPqsTuSKQ4cnDQiI2fy3Xt0bOSX59s bBjiKmDNb0Ze7G2CCk7lZ0aCxtmaZexUMlAJ9XZChIv3ln4Ims1jnFyf+R15dw0kk8x3 Pg2tOsAG+KpoqErTbFoLgahzavuJpYXPrA/3zW5nBvVvOLuZ0LRRCaHxk2M3KEvkhUkd 2T2gul5sCAVh9RnMsOUCgs34n0UBdTkZjrFKFDjoUReat76V+nSts3KFfAkT+zW1/DkG b8CA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WTw/9Ghr"; 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 j7si20866368otn.220.2021.10.26.03.42.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:42: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="WTw/9Ghr"; 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]:49984 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJuD-0008DW-M5 for patch@linaro.org; Tue, 26 Oct 2021 06:42:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52802) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJht-0001cy-4q for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:25 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:35377) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhr-0004ei-5w for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:24 -0400 Received: by mail-wr1-x429.google.com with SMTP id s19so18199012wra.2 for ; Tue, 26 Oct 2021 03:29: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=5nc1aRJ5hwFpLdq28mQ7T73wF2chGMJXK8KdXx7nbm4=; b=WTw/9GhrCRU008VX3ZeBULgs4FLDr0tQX3qyUZFuvnhJO8OWfG7m2BgxqwRUshlrBC hG9ZSsnDi3hWBbFArqGhMqbYlRUuT6jy6j+U62Q7BgKTv8IRE6y8kDTyeXYAhdpfKcvn gcJ/pnlThmZ8VfzwqveH3hJu7Nmn5X4LQpTGy2Sl9g2XvRW0zzVYQjXYxZwBq97oGglq VpeXdegI4SN+iC6LtotV21lm5L8wa8cj0FJriSzVoNs8wYIN3f6TP/YKLU7ejLGXNS2R ++uBl6K7bX3nCuM+PJdVaTGMlvmxpEHT31d4dH2rhy+MtmwbwkyfS64h/RzVWuf/3pO5 c7fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5nc1aRJ5hwFpLdq28mQ7T73wF2chGMJXK8KdXx7nbm4=; b=13/zltZDMYTmfGmR8Cy5Gdj+1Rcw3ucMVIC8BX/q7D/ot+h7SRahkc2Nu8LB/Q/aQc yEOjsMSz8g4iQOC20Awbl7l8Dj5xIJ2pw9xhBq/Tei1BSLH/NAbN7OiJvsMY9k/xG2DH qbybrl55tbmEgqfOQgouGnr0HOa41cQv0/Mu38KOAmDxMUzY2NZNKDO20O+sZ4Ich1Sm ZvQlARvGQCXAMK0RZdcOMYVeNTgo7F/ErPppLXUKo22wJFjAjcQDcbdpGsPfvu/+TMNj 5o3pVv3PEUBhfTwm06EL3oPu7LJTW3CwL2PyInjUDiQAGdXT9uqRjn5jsvmjYElcuSNx Z0kw== X-Gm-Message-State: AOAM533ZJqosdlcfdwne5kYSHYACf+jfl4xWKJfslIpNuasjR5vRnPhB YVIddu8BYrpmKYt+Oc5FSKvf4A== X-Received: by 2002:adf:ee8b:: with SMTP id b11mr30370106wro.349.1635244160710; Tue, 26 Oct 2021 03:29:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j10sm4370643wrx.94.2021.10.26.03.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:19 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 56A781FFB3; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 18/28] chardev: don't exit() straight away on C-a x Date: Tue, 26 Oct 2021 11:22:24 +0100 Message-Id: <20211026102234.3961636-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, =?utf-8?q?Lukas_J=C3=BCnger?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While there are a number of uses in the code-base of the exit(0) pattern it gets in the way of clean exit which can do all of it's house-keeping. In particular it was reported that you can crash plugins this way because TCG can still be running on other threads when the atexit callback is called. Use qmp_quit() instead which takes care of some housekeeping before triggering the shutdown. Signed-off-by: Alex Bennée Reported-by: Lukas Jünger Reviewed-by: Marc-André Lureau Message-Id: <20211018140226.838137-1-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé Acked-by: Paolo Bonzini Message-Id: <20211019092901.1519570-1-alex.bennee@linaro.org> --- chardev/char-mux.c | 3 ++- stubs/qmp-quit.c | 8 ++++++++ stubs/meson.build | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 stubs/qmp-quit.c -- 2.30.2 diff --git a/chardev/char-mux.c b/chardev/char-mux.c index ada0c6866f..ee2d47b20d 100644 --- a/chardev/char-mux.c +++ b/chardev/char-mux.c @@ -28,6 +28,7 @@ #include "qemu/option.h" #include "chardev/char.h" #include "sysemu/block-backend.h" +#include "qapi/qapi-commands-control.h" #include "chardev-internal.h" /* MUX driver for serial I/O splitting */ @@ -157,7 +158,7 @@ static int mux_proc_byte(Chardev *chr, MuxChardev *d, int ch) { const char *term = "QEMU: Terminated\n\r"; qemu_chr_write_all(chr, (uint8_t *)term, strlen(term)); - exit(0); + qmp_quit(NULL); break; } case 's': diff --git a/stubs/qmp-quit.c b/stubs/qmp-quit.c new file mode 100644 index 0000000000..a3ff47f7bd --- /dev/null +++ b/stubs/qmp-quit.c @@ -0,0 +1,8 @@ +#include "qemu/osdep.h" +#include "qapi/qapi-commands-control.h" +#include "qapi/qmp/dispatch.h" + +void qmp_quit(Error **errp) +{ + g_assert_not_reached(); +} diff --git a/stubs/meson.build b/stubs/meson.build index f6aa3aa94f..71469c1d50 100644 --- a/stubs/meson.build +++ b/stubs/meson.build @@ -31,6 +31,7 @@ stub_ss.add(files('pci-bus.c')) stub_ss.add(files('qemu-timer-notify-cb.c')) stub_ss.add(files('qmp_memory_device.c')) stub_ss.add(files('qmp-command-available.c')) +stub_ss.add(files('qmp-quit.c')) stub_ss.add(files('qtest.c')) stub_ss.add(files('ram-block.c')) stub_ss.add(files('ramfb.c')) From patchwork Tue Oct 26 10:22:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516198 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp153850imj; Tue, 26 Oct 2021 03:44:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrjEAo5KnmdtQ9jGOIVf9rsduiJPMM6R0z77buuK5BTJH2HsrTBiSu56NK5OhUhkyYWETn X-Received: by 2002:a05:6808:a1b:: with SMTP id n27mr9425977oij.4.1635245070201; Tue, 26 Oct 2021 03:44:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245070; cv=none; d=google.com; s=arc-20160816; b=ok3sqbgrHMLmgDi8JLgi0jELU8Xzx1lWVdfVMzTry2QHYCabLZ+xjQLBUR612p5pWN gVxOe3mBpfVN3AQmkI+nNUuunnst1rLkShIxSay8aG9V3+cGow5Qr2iIEJm92DcqEzip y9+Ke6wJBTKws2wUdVViZ/tnV4KP6jAbsvzkaIbHuNohQSPpIlikqAuK21uzTMSkautC hcffsTggQLsARP9pwkqfR1HuWNpESIN5yM/lxVmoi3fwMgpQLIvA1SV3aOyZ4CcuyQLm LQiaoUeu4coIfUD983iC8Z0S/BHAJKsQ+oFKryfNXr88FO5jsKACRgxAMMzNRPHBzrwJ 52PA== 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=TKAhaqUZkEkOPDX3ZodBC29pmC1lvQH92Rx59LD9Vfk=; b=V8bLdJsixc6/wDweLJ1srjIrl2254TBjhnb5/S8N93RTHR3Shs5CV+SR1dMCOSGC/a BTkXtFQJrlOqF7EN6lxlXN8/rKITBXt2SW28EOz+L5VynoPpNB3TlEQGPDvrQd12uhDt xjA4ZCrEKjMcJ/i1Pnk+Je3welLqh24BKVxbgg0mhFm1iQ/NcH1mjLlmUBTybSVGDgYY aauInsyHQsmGMB7WRm8Tq1mqBzVpDmYLwNylSMJ6oCqQQflYfRc70/sfkKJi2vabSfBm YZ9Kpg7xX8MuybUXycBgbKqXpCMK/+zFLWq21uZHnzHkYHj4mTKUimXYXU3XTENidCYq OsPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=V780SdvD; 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 bh10si30529560oib.124.2021.10.26.03.44.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:44: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=V780SdvD; 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]:58670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJwT-0005Vn-IC for patch@linaro.org; Tue, 26 Oct 2021 06:44:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52816) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJhu-0001fl-1Q for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:26 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:38543) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhr-0004fE-PS for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:25 -0400 Received: by mail-wr1-x429.google.com with SMTP id u18so14915337wrg.5 for ; Tue, 26 Oct 2021 03:29: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=TKAhaqUZkEkOPDX3ZodBC29pmC1lvQH92Rx59LD9Vfk=; b=V780SdvD2otuCojzNNz2PylO+FLSUN28n/QsWX9Zc3l7O8i8u3PEzePNtWvebpDLDw HrTgKtQGmDcfURjJEOJ2XlbrSdUyJMGHhr24dtgfHI4eUo9cCFb5C39M0NwzW+yZHVxM plNDDbGaCSuiXXZ14Nuio9/63TopXwGK29gZseznus6Fi/Uov216gZ0rJJmhOO1qeqER HIhfIftF6suXWKibniHjbDiFOAqo+I4bCmIBGf7ZX5gw1YCnclQbW1nu0xkF0LMosimu 4MELXE0IkYGElA4giaw/3uY7UKU6KjLZd/eRUmSTg+COFi7cryOrku1pE+XVSiC0jm7A eGZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TKAhaqUZkEkOPDX3ZodBC29pmC1lvQH92Rx59LD9Vfk=; b=lslRuAsFCf5JW1SZsiXB+wUFn81pC603PtcTmj1Q1SZ+xIP1EVxPbR5pbQiNhAP7r7 9FWGKAXLVpC3y/v0YG1hmQOnPqdDWMS8WcQZJ+xN+y2Y3VZHQ17nN1Cq3ExgD1IjneYv osRJHJbPCVgmPBcp7B90vamT99Tl/5xmA6tJkoWbMk1TPsFzq3u27f/f5QB1AJ1EMP3r urRO/2hMkTcX9eJhJeYyfpey80EnId9E5EhaMOsLHvjAM0TVwUfLhWDuExxTRlmfD489 IDTQs598QD6hvt23ABMZGY4ZYdZbOzZz5O6S1Aal1ude3YhPLK9yyPQ+THR2K1d1O01N bV/g== X-Gm-Message-State: AOAM530YWApPQhRT2bThQsQxt2ncGtrXbt8aV72cM3WTgKuL58NaP5YG LTmzHjnMI7c2QBrokP7nceX1pQ== X-Received: by 2002:a05:6000:11ce:: with SMTP id i14mr14442031wrx.102.1635244162466; Tue, 26 Oct 2021 03:29:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 3sm200368wms.5.2021.10.26.03.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:19 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 63ED31FFB4; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 19/28] tests/plugins: extend the insn plugin to track opcode sizes Date: Tue, 26 Oct 2021 11:22:25 +0100 Message-Id: <20211026102234.3961636-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is mostly a convenience feature for identifying frontends that do multiple repeat loads so I can test changes to the instruction tracking interface. Signed-off-by: Alex Bennée --- tests/plugin/insn.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/tests/plugin/insn.c b/tests/plugin/insn.c index 0f6a1938c1..d229fdc001 100644 --- a/tests/plugin/insn.c +++ b/tests/plugin/insn.c @@ -18,6 +18,8 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; static uint64_t insn_count; static bool do_inline; +static bool do_size; +static GArray *sizes; static void vcpu_insn_exec_before(unsigned int cpu_index, void *udata) { @@ -49,13 +51,35 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) insn, vcpu_insn_exec_before, QEMU_PLUGIN_CB_NO_REGS, GUINT_TO_POINTER(vaddr)); } + + if (do_size) { + size_t sz = qemu_plugin_insn_size(insn); + if (sz > sizes->len) { + g_array_set_size(sizes, sz); + } + unsigned long *cnt = &g_array_index(sizes, unsigned long, sz); + (*cnt)++; + } } } static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out = g_strdup_printf("insns: %" PRIu64 "\n", insn_count); - qemu_plugin_outs(out); + g_autoptr(GString) out = g_string_new(NULL); + + if (do_size) { + int i; + for (i = 0; i <= sizes->len; i++) { + unsigned long *cnt = &g_array_index(sizes, unsigned long, i); + if (*cnt) { + g_string_append_printf(out, + "len %d bytes: %ld insns\n", i, *cnt); + } + } + } else { + g_string_append_printf(out, "insns: %" PRIu64 "\n", insn_count); + } + qemu_plugin_outs(out->str); } QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, @@ -70,12 +94,21 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, fprintf(stderr, "boolean argument parsing failed: %s\n", opt); return -1; } + } else if (g_strcmp0(tokens[0], "sizes") == 0) { + if (!qemu_plugin_bool_parse(tokens[0], tokens[1], &do_size)) { + fprintf(stderr, "boolean argument parsing failed: %s\n", opt); + return -1; + } } else { fprintf(stderr, "option parsing failed: %s\n", opt); return -1; } } + if (do_size) { + sizes = g_array_new(true, true, sizeof(unsigned long)); + } + qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); return 0; From patchwork Tue Oct 26 10:22:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516207 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp165606imj; Tue, 26 Oct 2021 04:00:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWVeDWieFdJyYlFB/wwDiciLV7p1h3/bhZEfaVEFYeDzVctEyjQihPuYjMh9rLGSkuXyXY X-Received: by 2002:a9d:17cd:: with SMTP id j71mr19359339otj.169.1635246039740; Tue, 26 Oct 2021 04:00:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635246039; cv=none; d=google.com; s=arc-20160816; b=UujzFd7xZqsbLQqr8TVRfE9ly2HYncRoEaVps302jR/vvmIzCEUHr+z9WHnMZFvRWk Ah2lko9z5IScqRWiYVNDNO+eDdHYBVAjmGlSmi1j8opJ69iQR31KdSiW5Vb23M5VCSUb b/wSsU4NT1h81uv1Q5BUOp0VVesWpiiX2GOsrYQD2vH9fhMn+rygJyua6NpFxOeiJw3s 5mJmsjKZQt0kjHq0SzpjIheB1Pnu/2BMpP9DOIqg5r0mTbxH/N+T9QwhVFJS6yFoB+bl RgYPNuZ7f7ZwiSVeXD2XVgLn2dUdBLKp/TRzl8iKmBmTbMV5klNisvgBw/hogCrHUm4g rMiA== 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=IQrJ14mdqhvYV5+ImzRfNnyvnL5jhONPouFr5OP3Q0g=; b=Um4I2RrTVEqDQLV+UzHmEUaggbKahZqUyYhxC1vC2nm29zHlQVAFQ9OO0EAWde5/pj N+Pgj848uBXy4W8u9Ftn67YhhR3MvIzvC5DZ2R6pcOVSO16eL/skHMp71zxx5ZvRNDDM 38/wIG771ejmeIwHqDYiL/21x+E2NkNO7YvjSgdIuey99TGQKuUh2hpeVRg8HPXDCtTB s7udBqeWCzeIgyfdqJsIS677Bx+ra9TbeZw1kqL20+6mDWJJ9khipyzjsne4Fv0a5FIr M4Mt+W0UAFYxP630v97XBAx9sc0CxdDXmO8CJ9oQj3UPXKN7woN73Duvpr2zxzvzMX+R hK3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=RTbbwTtF; 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 m7si17296198otn.123.2021.10.26.04.00.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 04:00: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=RTbbwTtF; 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]:33990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfKC6-0001pZ-Ry for patch@linaro.org; Tue, 26 Oct 2021 07:00:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52958) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi9-0002ZZ-No for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:41 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:39659) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi7-0004hG-MX for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:41 -0400 Received: by mail-wm1-x329.google.com with SMTP id y205-20020a1c7dd6000000b0032cc8c2800fso1657666wmc.4 for ; Tue, 26 Oct 2021 03:29: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=IQrJ14mdqhvYV5+ImzRfNnyvnL5jhONPouFr5OP3Q0g=; b=RTbbwTtFpfHshnfXcSscNDh1eDMdOy5eZ5ZGj/Sf5DGdw/dKHxnpW4ulX0VuG0hVgj 8ECZIH2ye5Q0xKlAPOr20KU580CKgFZKAMHqDUDlH4DObaorvOxG40YEp7U3rRg7KJjl FEeKJFkONVwtVqkBt+yqykB51E1948RgVP9Rcth5dlwzEd5ftGSWfHbZlig5wRKRTCma 8cS/VrVjNQ0FRHX5InoAcCBizxxuUqGaRUlDoQo6rgDNiYLutPmDnFkiPYTqnS2lFZNs 7oJ9Ou9YJMv6LxAzpq/yJG/1CKSEBwJ+Tkh2VeNLAQ1SyxruGx5K5jVaxqOZDP0s02I0 N9Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IQrJ14mdqhvYV5+ImzRfNnyvnL5jhONPouFr5OP3Q0g=; b=QrIzt81x4rIHngOqgtgewFoMmuSWiTT6u2EDcz5VH1zyUdURsdCG+cXFkG9Q2I7QCk AiL3h55iAcmV9jQWKuebuSZPdpMhaL0zWb1Zd9QI1IDQxYIjh81HrrH0JVc/IkRRsrT6 twT2nrRndgl1k2VS4MUuJCDGHUF7n7sMPoPiueR9CSgYvVZsoN4FPTQQ7eE0QcmBeNiT nr2pXGInKjqQA4N2epCDRfc9bBA6R5FNUuIRVWLWj5c+dJGh8Vf6eUuifY5H4B6lXpDG 6c+ctC6wcJGvRZ0ngdDGm6O+2aWbc3rfPdsQfAQx/Yd8TGZuiwPi+h3Xj2bqhf+Guc+c e5bw== X-Gm-Message-State: AOAM532ELl8yPFLMIjYoaEYHjSSZ53jXyLbYS5bb71j52JipY5lY6eVK ig2jLbUzxqvAx3qVtKC8unBzGw== X-Received: by 2002:a05:600c:21c5:: with SMTP id x5mr18646500wmj.27.1635244178354; Tue, 26 Oct 2021 03:29:38 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q14sm9155325wrv.55.2021.10.26.03.29.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 817FE1FFB5; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 20/28] plugins: try and make plugin_insn_append more ergonomic Date: Tue, 26 Oct 2021 11:22:26 +0100 Message-Id: <20211026102234.3961636-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Currently we make the assumption that the guest frontend loads all op code bytes sequentially. This mostly holds up for regular fixed encodings but some architectures like s390x like to re-read the instruction which causes weirdness to occur. Rather than changing the frontends make the plugin API a little more ergonomic and able to handle the re-read case. Stuff will still get strange if we read ahead of the opcode but so far no front ends have done that and this patch asserts the case so we can catch it early if they do. Signed-off-by: Alex Bennée Suggested-by: Richard Henderson --- include/exec/plugin-gen.h | 12 ++++++++++-- include/qemu/plugin.h | 7 +++++-- accel/tcg/plugin-gen.c | 3 +-- accel/tcg/translator.c | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-) -- 2.30.2 Reviewed-by: Richard Henderson diff --git a/include/exec/plugin-gen.h b/include/exec/plugin-gen.h index b1b72b5d90..f92f169739 100644 --- a/include/exec/plugin-gen.h +++ b/include/exec/plugin-gen.h @@ -27,13 +27,21 @@ 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) +static inline void plugin_insn_append(abi_ptr pc, const void *from, size_t size) { struct qemu_plugin_insn *insn = tcg_ctx->plugin_insn; + abi_ptr off; if (insn == NULL) { return; } + off = pc - insn->vaddr; + if (off < insn->data->len) { + g_byte_array_set_size(insn->data, off); + } else if (off > insn->data->len) { + /* we have an unexpected gap */ + g_assert_not_reached(); + } insn->data = g_byte_array_append(insn->data, from, size); } @@ -62,7 +70,7 @@ 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) +static inline void plugin_insn_append(abi_ptr pc, const void *from, size_t size) { } #endif /* CONFIG_PLUGIN */ diff --git a/include/qemu/plugin.h b/include/qemu/plugin.h index b3172b147f..145f8a221a 100644 --- a/include/qemu/plugin.h +++ b/include/qemu/plugin.h @@ -163,10 +163,12 @@ struct qemu_plugin_tb { /** * qemu_plugin_tb_insn_get(): get next plugin record for translation. - * + * @tb: the internal tb context + * @pc: address of instruction */ static inline -struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb) +struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb, + uint64_t pc) { struct qemu_plugin_insn *insn; int i, j; @@ -179,6 +181,7 @@ struct qemu_plugin_insn *qemu_plugin_tb_insn_get(struct qemu_plugin_tb *tb) g_byte_array_set_size(insn->data, 0); insn->calls_helpers = false; insn->mem_helper = false; + insn->vaddr = pc; for (i = 0; i < PLUGIN_N_CB_TYPES; i++) { for (j = 0; j < PLUGIN_N_CB_SUBTYPES; j++) { diff --git a/accel/tcg/plugin-gen.c b/accel/tcg/plugin-gen.c index 61be64b78c..22d95fe1c3 100644 --- a/accel/tcg/plugin-gen.c +++ b/accel/tcg/plugin-gen.c @@ -876,9 +876,8 @@ 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); + pinsn = qemu_plugin_tb_insn_get(ptb, db->pc_next); tcg_ctx->plugin_insn = pinsn; - pinsn->vaddr = db->pc_next; plugin_gen_empty_callback(PLUGIN_GEN_FROM_INSN); /* diff --git a/accel/tcg/translator.c b/accel/tcg/translator.c index 390bd9db0a..f06c314266 100644 --- a/accel/tcg/translator.c +++ b/accel/tcg/translator.c @@ -169,7 +169,7 @@ static inline void translator_maybe_page_protect(DisasContextBase *dcbase, if (do_swap) { \ ret = swap_fn(ret); \ } \ - plugin_insn_append(&ret, sizeof(ret)); \ + plugin_insn_append(pc, &ret, sizeof(ret)); \ return ret; \ } From patchwork Tue Oct 26 10:22:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516200 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp155404imj; Tue, 26 Oct 2021 03:46:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKDH8/QdhoCvLKgE8FlWMCHlZCj7rO2wCJkBNN+TW38KJNz12O0AsipDuXYt0geeUYaYh6 X-Received: by 2002:a9d:7109:: with SMTP id n9mr18265901otj.24.1635245203512; Tue, 26 Oct 2021 03:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245203; cv=none; d=google.com; s=arc-20160816; b=USABypiRTaI/IzCfwmW32KgF0Pdu/Gyr25BdUIkKFt4HuJXuk9ubZxbYP1+6YNTFuI mirKFR/dtAxeuqeFP86vhSzhSdpxrrowgz2NAPO6puzUNcoIz3uwA03UYZWHlhdxVvTP WBrwuXlSqRMOeL6ppPenheuK9NyBP+BCRO9pvx+BxgIdstXoC0IAPoOorMG0cwEDxdKQ 66QHjbSJ7+q/QqEVNQXLYjdjLQs+6WsRdnLK/vC7fDww6AYR7ew9SDzP6Ivvw6bTyDVG Kp75KCnWB3ICk5yJARwRVqWtgdASOyb7CRAwGHhLb9qObUph5xNuJD/KGY89S01c3Sw/ xGqg== 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=vX3anCL7p/sqIpPM9TjWKfgkBjpmlyBhYjlGB6uRLsk=; b=LGr7ati7YvjGzorYB5kSZDFd97Im+ktwL2gB1hIQ7J6wXID7lAsQzjYSL3hYHnWZ54 vWxXpLOwwOEkZ25Hlf/AbELZnlfug+09XLvC/UHV5keQez8u3x+jX8Yp68yaGBmCorg7 uqJX/2B99uW2A3uD/HGpzKGKEzggrUApdrhE5mml31JgeL/jJxcSzk8d/o71bJa9Ur2i p8/5u84L6U0rLYaiuOQD+KytraQmiHodPNmZS/XTChD2xPzDsWMfN2YXDfCxIrQY2gD3 3JTTkLrUJy7Dv3RdeN14aLj7FbZoYOwntZTKHob4p/Um2seLBebHOVrQr/4PN0X1T3Q/ IM/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qVJnSN5D; 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 y20si21050566oog.71.2021.10.26.03.46.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:46:43 -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=qVJnSN5D; 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]:33514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJyc-0007Xc-Q3 for patch@linaro.org; Tue, 26 Oct 2021 06:46:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55066) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJra-0005wi-OP for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:39:26 -0400 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:33578) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJrW-0006V3-BL for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:39:25 -0400 Received: by mail-lj1-x234.google.com with SMTP id d13so14116555ljg.0 for ; Tue, 26 Oct 2021 03:39: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=vX3anCL7p/sqIpPM9TjWKfgkBjpmlyBhYjlGB6uRLsk=; b=qVJnSN5DJNo++fpnFHeu5Uoe1o/CE8BzmFpMkIyu7ECVPbDrQlhvB4ytpzECzqD4lB mejM7rfjcVjPMawX9atW8uMjfhOLYRyp0o6qRikOoFTIqA4NkKAwnJwbo+Sad8FCq0BN EnJX7FipgFdqRGzKMDHgIAoy5oL+tLYDrsec8I4QFpOsumNQraZkHwny/B8zbX+jQNOf wG8CemtNJYbNF78UaIcY5vARYOX0j2Opt5zBSsEpkMbPW+Esna1OH8rZrU7eYmkooNz9 N0Th0kPrgV7ZqjDalLsIGWWyCqBj96I2wBpivP4M8pHOks/LQmbnk+MhY11ADHd28BPY RVhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vX3anCL7p/sqIpPM9TjWKfgkBjpmlyBhYjlGB6uRLsk=; b=lhfjy579Gl6rqq0r87qhy4RpWfkepaR2NGe6wyvyECGv/x2JVZhJykqUi1XCbQlqjp Lzgu0fmu2Gw+0Y6yheJG76zlu915v8HQBKrbVXUw8AbqAa8rBGhOJ1g30/mWsCtSfEWe 1u37cE/laYBem8GjOA2QDSIiHuGbhCbTtFH6Lp1QOeoTI6r8I2E/wGR7LvhCbBcXNobH mT/gUTdq7ab37hLplvWXylF8VdfNjumRgC750bzlFAe89oe5uOXr8jX/+VnjaolcFPKW c3nt4YeCCjq7Z2cUB6BGhCV25ReRjbYrNxz+N54XQCA9BOFcRs97KxqRdsy33V7dJdpm eHKQ== X-Gm-Message-State: AOAM531qOSWU31/G7DDBpnRP+Q6TyrtM1xzpn5H3Xt1RDUByMs+cU624 183WCgYZnTqG9r2ErdILietIrw== X-Received: by 2002:a2e:b88f:: with SMTP id r15mr25556345ljp.474.1635244760373; Tue, 26 Oct 2021 03:39:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e7sm713149lfr.294.2021.10.26.03.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:39:19 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A2B8F1FFB7; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 21/28] docs: remove references to TCG tracing Date: Tue, 26 Oct 2021 11:22:27 +0100 Message-Id: <20211026102234.3961636-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Luis Vilanova , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Users wanting this sort of functionality should turn to TCG plugins instead. Signed-off-by: Alex Bennée Cc: Luis Vilanova Cc: Stefan Hajnoczi Reviewed-by: Richard Henderson --- docs/about/removed-features.rst | 13 +++++ docs/devel/tracing.rst | 85 --------------------------------- 2 files changed, 13 insertions(+), 85 deletions(-) -- 2.30.2 diff --git a/docs/about/removed-features.rst b/docs/about/removed-features.rst index 9d0d90c90d..641aa22112 100644 --- a/docs/about/removed-features.rst +++ b/docs/about/removed-features.rst @@ -594,6 +594,19 @@ the upstream Linux kernel in 2018, and it has also been dropped from glibc, so there is no new Linux development taking place with this architecture. For running the old binaries, you can use older versions of QEMU. +TCG introspection features +-------------------------- + +TCG trace-events (since 6.2) +'''''''''''''''''''''''''''' + +The ability to add new TCG trace points had bit rotted and as the +feature can be replicated with TCG plugins it was removed. If +any user is currently using this feature and needs help with +converting to using TCG plugins they should contact the qemu-devel +mailing list. + + System emulator devices ----------------------- diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index ba83954899..ef67bc9d70 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -411,88 +411,3 @@ disabled, this check will have no performance impact. return ptr; } -"tcg" ------ - -Guest code generated by TCG can be traced by defining an event with the "tcg" -event property. Internally, this property generates two events: -"_trans" to trace the event at translation time, and -"_exec" to trace the event at execution time. - -Instead of using these two events, you should instead use the function -"trace__tcg" during translation (TCG code generation). This function -will automatically call "trace__trans", and will generate the -necessary TCG code to call "trace__exec" during guest code execution. - -Events with the "tcg" property can be declared in the "trace-events" file with a -mix of native and TCG types, and "trace__tcg" will gracefully forward -them to the "_trans" and "_exec" events. Since TCG values -are not known at translation time, these are ignored by the "_trans" -event. Because of this, the entry in the "trace-events" file needs two printing -formats (separated by a comma):: - - tcg foo(uint8_t a1, TCGv_i32 a2) "a1=%d", "a1=%d a2=%d" - -For example:: - - #include "trace-tcg.h" - - void some_disassembly_func (...) - { - uint8_t a1 = ...; - TCGv_i32 a2 = ...; - trace_foo_tcg(a1, a2); - } - -This will immediately call:: - - void trace_foo_trans(uint8_t a1); - -and will generate the TCG code to call:: - - void trace_foo(uint8_t a1, uint32_t a2); - -"vcpu" ------- - -Identifies events that trace vCPU-specific information. It implicitly adds a -"CPUState*" argument, and extends the tracing print format to show the vCPU -information. If used together with the "tcg" property, it adds a second -"TCGv_env" argument that must point to the per-target global TCG register that -points to the vCPU when guest code is executed (usually the "cpu_env" variable). - -The "tcg" and "vcpu" properties are currently only honored in the root -./trace-events file. - -The following example events:: - - foo(uint32_t a) "a=%x" - vcpu bar(uint32_t a) "a=%x" - tcg vcpu baz(uint32_t a) "a=%x", "a=%x" - -Can be used as:: - - #include "trace-tcg.h" - - CPUArchState *env; - TCGv_ptr cpu_env; - - void some_disassembly_func(...) - { - /* trace emitted at this point */ - trace_foo(0xd1); - /* trace emitted at this point */ - trace_bar(env_cpu(env), 0xd2); - /* trace emitted at this point (env) and when guest code is executed (cpu_env) */ - trace_baz_tcg(env_cpu(env), cpu_env, 0xd3); - } - -If the translating vCPU has address 0xc1 and code is later executed by vCPU -0xc2, this would be an example output:: - - // at guest code translation - foo a=0xd1 - bar cpu=0xc1 a=0xd2 - baz_trans cpu=0xc1 a=0xd3 - // at guest code execution - baz_exec cpu=0xc2 a=0xd3 From patchwork Tue Oct 26 10:22:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516206 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp161317imj; Tue, 26 Oct 2021 03:54:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw+qZ47HfzOepk+ERQHhMqh97NnsxQxQQ6hJ9HX2PaHHtMzTjqPvykN8szbo+P50z1r3jC X-Received: by 2002:a05:6830:349a:: with SMTP id c26mr19643719otu.206.1635245692473; Tue, 26 Oct 2021 03:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245692; cv=none; d=google.com; s=arc-20160816; b=Wtx1mMIe3+oR9P3gZ0oXw/tb7SkMNwyrrCAFD+k2us77cDL+8cm4AdSBmEVyVhWUWp KDgvz8269+1K0YKC0GfSFsjdLi8qyub84s86rNeoAK9pajXF3kRAtUAUFE8zDm2bqgyq lzEwHVlNCde4RMQZzMNElKQgch8RYjXR1QZXJrB7VsbBx57lTxEm6dSor8wcFFHTcUzs RNQzckEkwgDC7aLnN+94MphsAhQ5yiqWyccnfC0fd90FQPP3E6Q0yIIeGW3gwGMH83xH phhXOu/QDkUKGEIj+BtLTRg2iSCziqFHVbqIYI/EyRTDGDcWIXCXU6OMY0i0uulDw66u zJ1w== 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=TBVxZ6Q/g+qUmFR+s8MXbIY8mtSx45SwwXl5Me8/rtw=; b=n1l2bHIcg5q1HzCS+SvuA7ffEfPJVMK92x1D6QAWAY3Q9cadFdKm8RG7JJ59+mg8F3 kSUd3B9JHuAVXxZhjWtfM/e2SpwJKJdMB5QFWGpO0gi+3R9Z3i/8vH48s9yKqKTKxO8u La8QJN5VM4kHCL1SL5o+ith2zViGO3iU1tPev5y/p9woXJyJ/vFLRMn67XXGppRI6hLX TD77PO8eMn8Tkrf9xI0MqgL2BRD3FiAXWnHsu3Qx9Sg/dyVGro+6fZ0xr2GCPYjANVRO CM7H73dRgZhhW1xp7m1ysGWGfHldXvlwFR+M0K3XB/KGHEYVE1J/CD8BsL1KtsXsjqHv hlug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=q5AMTefP; 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 j7si1976261otq.156.2021.10.26.03.54.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:54:52 -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=q5AMTefP; 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]:55746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK6V-0005g3-Nj for patch@linaro.org; Tue, 26 Oct 2021 06:54:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52928) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi7-0002Na-0R for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:39 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:42517) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi4-0004gl-JH for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:38 -0400 Received: by mail-wr1-x436.google.com with SMTP id v17so16989640wrv.9 for ; Tue, 26 Oct 2021 03:29: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=TBVxZ6Q/g+qUmFR+s8MXbIY8mtSx45SwwXl5Me8/rtw=; b=q5AMTefPruO6m+dcOkWpRuChjOw/ygChfDqN5mMyoVDEmFeURJwTuZ125y9tCHPRU/ rQIlgzHK3CaKjGi/zQ+M3+8XYQNl/IpmBxuzNMZr/E67U+YtVHQmD5JvXL3PdFyZLp+y bxk6Ais4euUJlDzPunOS6X22WcZ+L9dAsTaO8JHgxb0YYxPLOLoYBJcG6Bz6nO+72pOn baZ1VJqTuXygx17xkIZP44FXJE5ixpInWpWQGVo+AyQqYEbnnvcKa1wK4Z0j42rAo7qq DbNl1gh7mFEqWxMPepnXOQtxK5F2q8wI/2AnOZO+2EsTxYPee8/84/wuRJgDMWXIjULv 3/Pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TBVxZ6Q/g+qUmFR+s8MXbIY8mtSx45SwwXl5Me8/rtw=; b=SRa6JCaRca1xyNsFpVHKRgbCrOqmBRuMDuA85xYixxuRIrQojfGVutwAxTjksWc10u GlnWPLXyrobIrrnaVAjcxIWt/+b4vCsbgTaZ9VhyhhTuNRTM6yye5wVDQs/Capb4zNy0 xNZ2ll5ElfYvLHrNYOaYMt7KYQASpTyn1x1GZLmp8+n0FbW75VM3l9AM8sZDkhYRgpm0 UCIMoEFteZPJRJbkGSUhEefVO07NLfKQgG43gBcocjkS4bRZtkjX/CPG6LMQvlCYGFLF BNt3RlrTxcQwVf31gsg9n3WL0klBwL2U3a8yKSPuJOG36YJa2DDCg2B7RL5r4eHbB/rl SBUg== X-Gm-Message-State: AOAM530RL6LGuYpgff9W+zfjxdaTNlCwfAZeBKYHpGFt+4JIAeByZXs0 HCnryvDyb4D1x3n8RZAPE8/9vA== X-Received: by 2002:adf:b353:: with SMTP id k19mr30792588wrd.325.1635244174990; Tue, 26 Oct 2021 03:29:34 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 13sm6168796wrz.38.2021.10.26.03.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BDA191FFB8; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 22/28] tracing: remove TCG memory access tracing Date: Tue, 26 Oct 2021 11:22:28 +0100 Message-Id: <20211026102234.3961636-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Riku Voipio , Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Luis Vilanova , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" If you really want to trace all memory operations TCG plugins gives you a more flexible interface for doing so. Signed-off-by: Alex Bennée Cc: Luis Vilanova Cc: Stefan Hajnoczi Reviewed-by: Richard Henderson --- accel/tcg/atomic_template.h | 12 ------------ accel/tcg/cputlb.c | 2 -- accel/tcg/user-exec.c | 15 +-------------- tcg/tcg-op.c | 5 ----- accel/tcg/atomic_common.c.inc | 20 -------------------- trace-events | 14 -------------- 6 files changed, 1 insertion(+), 67 deletions(-) -- 2.30.2 diff --git a/accel/tcg/atomic_template.h b/accel/tcg/atomic_template.h index 2d917b6b1f..fc165031e8 100644 --- a/accel/tcg/atomic_template.h +++ b/accel/tcg/atomic_template.h @@ -77,7 +77,6 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, PAGE_READ | PAGE_WRITE, retaddr); DATA_TYPE ret; - atomic_trace_rmw_pre(env, addr, oi); #if DATA_SIZE == 16 ret = atomic16_cmpxchg(haddr, cmpv, newv); #else @@ -97,7 +96,6 @@ ABI_TYPE ATOMIC_NAME(ld)(CPUArchState *env, target_ulong addr, PAGE_READ, retaddr); DATA_TYPE val; - atomic_trace_ld_pre(env, addr, oi); val = atomic16_read(haddr); ATOMIC_MMU_CLEANUP; atomic_trace_ld_post(env, addr, oi); @@ -110,7 +108,6 @@ void ATOMIC_NAME(st)(CPUArchState *env, target_ulong addr, ABI_TYPE val, DATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, PAGE_WRITE, retaddr); - atomic_trace_st_pre(env, addr, oi); atomic16_set(haddr, val); ATOMIC_MMU_CLEANUP; atomic_trace_st_post(env, addr, oi); @@ -124,7 +121,6 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE val, PAGE_READ | PAGE_WRITE, retaddr); DATA_TYPE ret; - atomic_trace_rmw_pre(env, addr, oi); ret = qatomic_xchg__nocheck(haddr, val); ATOMIC_MMU_CLEANUP; atomic_trace_rmw_post(env, addr, oi); @@ -138,7 +134,6 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ DATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, \ PAGE_READ | PAGE_WRITE, retaddr); \ DATA_TYPE ret; \ - atomic_trace_rmw_pre(env, addr, oi); \ ret = qatomic_##X(haddr, val); \ ATOMIC_MMU_CLEANUP; \ atomic_trace_rmw_post(env, addr, oi); \ @@ -171,7 +166,6 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ XDATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, \ PAGE_READ | PAGE_WRITE, retaddr); \ XDATA_TYPE cmp, old, new, val = xval; \ - atomic_trace_rmw_pre(env, addr, oi); \ smp_mb(); \ cmp = qatomic_read__nocheck(haddr); \ do { \ @@ -216,7 +210,6 @@ ABI_TYPE ATOMIC_NAME(cmpxchg)(CPUArchState *env, target_ulong addr, PAGE_READ | PAGE_WRITE, retaddr); DATA_TYPE ret; - atomic_trace_rmw_pre(env, addr, oi); #if DATA_SIZE == 16 ret = atomic16_cmpxchg(haddr, BSWAP(cmpv), BSWAP(newv)); #else @@ -236,7 +229,6 @@ ABI_TYPE ATOMIC_NAME(ld)(CPUArchState *env, target_ulong addr, PAGE_READ, retaddr); DATA_TYPE val; - atomic_trace_ld_pre(env, addr, oi); val = atomic16_read(haddr); ATOMIC_MMU_CLEANUP; atomic_trace_ld_post(env, addr, oi); @@ -249,7 +241,6 @@ void ATOMIC_NAME(st)(CPUArchState *env, target_ulong addr, ABI_TYPE val, DATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, PAGE_WRITE, retaddr); - atomic_trace_st_pre(env, addr, oi); val = BSWAP(val); atomic16_set(haddr, val); ATOMIC_MMU_CLEANUP; @@ -264,7 +255,6 @@ ABI_TYPE ATOMIC_NAME(xchg)(CPUArchState *env, target_ulong addr, ABI_TYPE val, PAGE_READ | PAGE_WRITE, retaddr); ABI_TYPE ret; - atomic_trace_rmw_pre(env, addr, oi); ret = qatomic_xchg__nocheck(haddr, BSWAP(val)); ATOMIC_MMU_CLEANUP; atomic_trace_rmw_post(env, addr, oi); @@ -278,7 +268,6 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ DATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, \ PAGE_READ | PAGE_WRITE, retaddr); \ DATA_TYPE ret; \ - atomic_trace_rmw_pre(env, addr, oi); \ ret = qatomic_##X(haddr, BSWAP(val)); \ ATOMIC_MMU_CLEANUP; \ atomic_trace_rmw_post(env, addr, oi); \ @@ -308,7 +297,6 @@ ABI_TYPE ATOMIC_NAME(X)(CPUArchState *env, target_ulong addr, \ XDATA_TYPE *haddr = atomic_mmu_lookup(env, addr, oi, DATA_SIZE, \ PAGE_READ | PAGE_WRITE, retaddr); \ XDATA_TYPE ldo, ldn, old, new, val = xval; \ - atomic_trace_rmw_pre(env, addr, oi); \ smp_mb(); \ ldn = qatomic_read__nocheck(haddr); \ do { \ diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index b69a953447..6899e4fe72 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -2140,7 +2140,6 @@ static inline uint64_t cpu_load_helper(CPUArchState *env, abi_ptr addr, { uint64_t ret; - trace_guest_ld_before_exec(env_cpu(env), addr, oi); ret = full_load(env, addr, oi, retaddr); qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_R); return ret; @@ -2487,7 +2486,6 @@ static inline void cpu_store_helper(CPUArchState *env, target_ulong addr, uint64_t val, MemOpIdx oi, uintptr_t ra, FullStoreHelper *full_store) { - trace_guest_st_before_exec(env_cpu(env), addr, oi); full_store(env, addr, val, oi, ra); qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_W); } diff --git a/accel/tcg/user-exec.c b/accel/tcg/user-exec.c index e6bb29b42d..7e10634580 100644 --- a/accel/tcg/user-exec.c +++ b/accel/tcg/user-exec.c @@ -920,7 +920,6 @@ uint8_t cpu_ldb_mmu(CPUArchState *env, abi_ptr addr, uint8_t ret; validate_memop(oi, MO_UB); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = ldub_p(haddr); clear_helper_retaddr(); @@ -935,7 +934,6 @@ uint16_t cpu_ldw_be_mmu(CPUArchState *env, abi_ptr addr, uint16_t ret; validate_memop(oi, MO_BEUW); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = lduw_be_p(haddr); clear_helper_retaddr(); @@ -950,7 +948,6 @@ uint32_t cpu_ldl_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t ret; validate_memop(oi, MO_BEUL); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = ldl_be_p(haddr); clear_helper_retaddr(); @@ -965,7 +962,7 @@ uint64_t cpu_ldq_be_mmu(CPUArchState *env, abi_ptr addr, uint64_t ret; validate_memop(oi, MO_BEQ); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); + haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = ldq_be_p(haddr); clear_helper_retaddr(); @@ -980,7 +977,6 @@ uint16_t cpu_ldw_le_mmu(CPUArchState *env, abi_ptr addr, uint16_t ret; validate_memop(oi, MO_LEUW); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = lduw_le_p(haddr); clear_helper_retaddr(); @@ -995,7 +991,6 @@ uint32_t cpu_ldl_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t ret; validate_memop(oi, MO_LEUL); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = ldl_le_p(haddr); clear_helper_retaddr(); @@ -1010,7 +1005,6 @@ uint64_t cpu_ldq_le_mmu(CPUArchState *env, abi_ptr addr, uint64_t ret; validate_memop(oi, MO_LEQ); - trace_guest_ld_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_LOAD); ret = ldq_le_p(haddr); clear_helper_retaddr(); @@ -1024,7 +1018,6 @@ void cpu_stb_mmu(CPUArchState *env, abi_ptr addr, uint8_t val, void *haddr; validate_memop(oi, MO_UB); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stb_p(haddr, val); clear_helper_retaddr(); @@ -1037,7 +1030,6 @@ void cpu_stw_be_mmu(CPUArchState *env, abi_ptr addr, uint16_t val, void *haddr; validate_memop(oi, MO_BEUW); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stw_be_p(haddr, val); clear_helper_retaddr(); @@ -1050,7 +1042,6 @@ void cpu_stl_be_mmu(CPUArchState *env, abi_ptr addr, uint32_t val, void *haddr; validate_memop(oi, MO_BEUL); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stl_be_p(haddr, val); clear_helper_retaddr(); @@ -1063,7 +1054,6 @@ void cpu_stq_be_mmu(CPUArchState *env, abi_ptr addr, uint64_t val, void *haddr; validate_memop(oi, MO_BEQ); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stq_be_p(haddr, val); clear_helper_retaddr(); @@ -1076,7 +1066,6 @@ void cpu_stw_le_mmu(CPUArchState *env, abi_ptr addr, uint16_t val, void *haddr; validate_memop(oi, MO_LEUW); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stw_le_p(haddr, val); clear_helper_retaddr(); @@ -1089,7 +1078,6 @@ void cpu_stl_le_mmu(CPUArchState *env, abi_ptr addr, uint32_t val, void *haddr; validate_memop(oi, MO_LEUL); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stl_le_p(haddr, val); clear_helper_retaddr(); @@ -1102,7 +1090,6 @@ void cpu_stq_le_mmu(CPUArchState *env, abi_ptr addr, uint64_t val, void *haddr; validate_memop(oi, MO_LEQ); - trace_guest_st_before_exec(env_cpu(env), addr, oi); haddr = cpu_mmu_lookup(env, addr, oi, ra, MMU_DATA_STORE); stq_le_p(haddr, val); clear_helper_retaddr(); diff --git a/tcg/tcg-op.c b/tcg/tcg-op.c index 61b492d89f..65e1c94c2d 100644 --- a/tcg/tcg-op.c +++ b/tcg/tcg-op.c @@ -27,7 +27,6 @@ #include "tcg/tcg.h" #include "tcg/tcg-op.h" #include "tcg/tcg-mo.h" -#include "trace-tcg.h" #include "exec/plugin-gen.h" /* Reduce the number of ifdefs below. This assumes that all uses of @@ -2877,7 +2876,6 @@ 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); oi = make_memop_idx(memop, idx); - trace_guest_ld_before_tcg(tcg_ctx->cpu, cpu_env, addr, oi); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -2916,7 +2914,6 @@ 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); oi = make_memop_idx(memop, idx); - trace_guest_st_before_tcg(tcg_ctx->cpu, cpu_env, addr, oi); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i32(); @@ -2965,7 +2962,6 @@ 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); oi = make_memop_idx(memop, idx); - trace_guest_ld_before_tcg(tcg_ctx->cpu, cpu_env, addr, oi); orig_memop = memop; if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { @@ -3013,7 +3009,6 @@ 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); oi = make_memop_idx(memop, idx); - trace_guest_st_before_tcg(tcg_ctx->cpu, cpu_env, addr, oi); if (!TCG_TARGET_HAS_MEMORY_BSWAP && (memop & MO_BSWAP)) { swap = tcg_temp_new_i64(); diff --git a/accel/tcg/atomic_common.c.inc b/accel/tcg/atomic_common.c.inc index 1df1f243e9..6602d7689f 100644 --- a/accel/tcg/atomic_common.c.inc +++ b/accel/tcg/atomic_common.c.inc @@ -13,14 +13,6 @@ * See the COPYING file in the top-level directory. */ -static void atomic_trace_rmw_pre(CPUArchState *env, target_ulong addr, - MemOpIdx oi) -{ - CPUState *cpu = env_cpu(env); - - trace_guest_rmw_before_exec(cpu, addr, oi); -} - static void atomic_trace_rmw_post(CPUArchState *env, target_ulong addr, MemOpIdx oi) { @@ -28,24 +20,12 @@ static void atomic_trace_rmw_post(CPUArchState *env, target_ulong addr, } #if HAVE_ATOMIC128 -static void atomic_trace_ld_pre(CPUArchState *env, target_ulong addr, - MemOpIdx oi) -{ - trace_guest_ld_before_exec(env_cpu(env), addr, oi); -} - static void atomic_trace_ld_post(CPUArchState *env, target_ulong addr, MemOpIdx oi) { qemu_plugin_vcpu_mem_cb(env_cpu(env), addr, oi, QEMU_PLUGIN_MEM_R); } -static void atomic_trace_st_pre(CPUArchState *env, target_ulong addr, - MemOpIdx oi) -{ - trace_guest_st_before_exec(env_cpu(env), addr, oi); -} - static void atomic_trace_st_post(CPUArchState *env, target_ulong addr, MemOpIdx oi) { diff --git a/trace-events b/trace-events index a637a61eba..bc71006675 100644 --- a/trace-events +++ b/trace-events @@ -117,20 +117,6 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) -# tcg/tcg-op.c - -# @vaddr: Access' virtual address. -# @memopidx: Access' information (see below). -# -# Start virtual memory access (before any potential access violation). -# Does not include memory accesses performed by devices. -# -# Mode: user, softmmu -# Targets: TCG(all) -vcpu tcg guest_ld_before(TCGv vaddr, uint32_t memopidx) "info=%d", "vaddr=0x%016"PRIx64" memopidx=0x%x" -vcpu tcg guest_st_before(TCGv vaddr, uint32_t memopidx) "info=%d", "vaddr=0x%016"PRIx64" memopidx=0x%x" -vcpu tcg guest_rmw_before(TCGv vaddr, uint32_t memopidx) "info=%d", "vaddr=0x%016"PRIx64" memopidx=0x%x" - # include/user/syscall-trace.h # @num: System call number. From patchwork Tue Oct 26 10:22:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516201 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp156997imj; Tue, 26 Oct 2021 03:48:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5yQ5igd3dvigosTugy/4YIXjCoFyL22+AIlZYgdMgr0VAgPzOfbhmFY0Dwws220HvEPSO X-Received: by 2002:a05:6830:2649:: with SMTP id f9mr18057584otu.13.1635245330871; Tue, 26 Oct 2021 03:48:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245330; cv=none; d=google.com; s=arc-20160816; b=jCS6D6ga4Py6LUL6aK7MM+7nGSiL+9pPc1IB6Xnw9tVMg0315RsR0oqpsdPzGBMR/q uOvGfSqluiyHqMTZj1IL331jNhI4oOjX5/DMjQ5ninNZBoeecnbN5RgYLkVc7SxAfgcR 5TFanF0gVT2w6h/uZ3LEpGdezPsDSAj3n/FXzn02kL5NlvFP9qgGNG2CVGLcmUcKivtO AG2zY+9OYxgBzXxCpb08pnM1vDdcF+mAswLLGhZGCeS1KM02jcP7XhkuvdFzu4zLhEza iuRwFBegOD99QANhar3RP5jaVfgBJxtk+wi+xUBZtduipQuYLWlbKSdIfmB0ajIelkly Mb8Q== 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=NuonZsDU5COcIiEjm2vWe6QiJRH6ZRkN+cgKnmHcCFM=; b=SuoPD60TN28AGhEq8N9PunNmD3uRLT7f5+POEqYGpfRultck8X/1ht0pWnvRr/6CkI ptr7fZyBYPtJSFiqj0XIiHQEjf2Smvx3hQEn8WB9CLUyCy3KvwzhpRGO0ZbAEWsy6J+Y RSvRb4BrqMYuP9CjQrFB6JnJp2Y5JAiYTMdZm+sQE1fziYlq1XNinIVAxnjELCQTXcu5 PufBEAmxqY4cUkHYQN6vFCOA0vpgHvRBa2oTo2RXaby4v3la/jH8lpeW+sOWdw0vWuDi W0fy0yJ7XQ9St3iKRPpE19zoy8vwTQo0x9DYAtXGV+Uox9tVZa4wdB1rSW6mgoKt5jkX xN2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=n5TC6hti; 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 bj33si27404120oib.203.2021.10.26.03.48.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:48:50 -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=n5TC6hti; 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]:39432 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK0g-0003Cd-8V for patch@linaro.org; Tue, 26 Oct 2021 06:48:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi3-00027W-2S for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:35 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:39830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi0-0004gI-2k for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id z14so17136758wrg.6 for ; Tue, 26 Oct 2021 03:29: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=NuonZsDU5COcIiEjm2vWe6QiJRH6ZRkN+cgKnmHcCFM=; b=n5TC6htiIzDtAXJZqFxxy5nZuz9rPBK09zAAvF/b5WndQgOcT6vkoRxkvkxlytBUbZ Hyw9CCvZMNFKjnMq/zsKsDss2gzSyc8vmxY3he1z23j8XlySQOkhh7IB0Jxl/0ux75eh 2cesVd0glPSXnk/Y4R/3hsjMsyVybLx/P7w7NFZV6w8MPpNEoL1Iab+Jpn5WJDVOvW6e AguXuO61brPBnHUjizL1tuJdmp6skxaSyJOUTEWZLVQePsS1WatzfBATXYjqIEYp63h+ WuTKUn2YzeR3DBkRuw48cKRWB5qPXavQDdQcfH5VmnjD5akiZ8eT2Qg845UTObhdM9W0 03Ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NuonZsDU5COcIiEjm2vWe6QiJRH6ZRkN+cgKnmHcCFM=; b=hfCpPhN38JPILWWoXL6WSi3n1DfTN7I4H+EiFVRFsU/ILozty8wvvIFO3aE4rHThSs EnXbTxdE8LWT8CeX41IsiEqbd4ORdaH3+hqJtLXstCvMqb1HoGcsCMWKg9a4mDa2SWbL YihJjIVDEGaItt4e9C1NvcNEHRQGqSOsQ+WVgXb1gsJ5H6v1kxHWcCAAz/bLnbNQJxay fsp/rW+jeLX5WRTl4lqijRStzuTHnl3gJSnAiWGFpnZSAtFDU4NrFw3cX+hF4807UFtD rQWJxoyhpFywDYWqW3eSEo/0svUsZ0yim6sDm+0N1rlCXO9MW/BfUxSijSStUE/Zn4Mf 6U6g== X-Gm-Message-State: AOAM533KPPsgGlDbmHRfUFIuTkUWXs4yr2Tu3xmb80zhy/kNJ6c4VqVZ xSLdX9YwzJyhEjr1OOj6fnmeIQ== X-Received: by 2002:adf:8bc4:: with SMTP id w4mr16633998wra.36.1635244170474; Tue, 26 Oct 2021 03:29:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b6sm3728416wrd.85.2021.10.26.03.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D5AAA1FFBA; Tue, 26 Oct 2021 11:22:36 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 23/28] tracing: remove the trace-tcg includes from the build Date: Tue, 26 Oct 2021 11:22:29 +0100 Message-Id: <20211026102234.3961636-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Luis Vilanova , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Cc: Luis Vilanova Cc: Stefan Hajnoczi --- include/trace-tcg.h | 6 ------ trace/meson.build | 1 - 2 files changed, 7 deletions(-) delete mode 100644 include/trace-tcg.h -- 2.30.2 Reviewed-by: Richard Henderson diff --git a/include/trace-tcg.h b/include/trace-tcg.h deleted file mode 100644 index da68608c85..0000000000 --- a/include/trace-tcg.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef TRACE_TCG_H -#define TRACE_TCG_H - -#include "trace/generated-tcg-tracers.h" - -#endif /* TRACE_TCG_H */ diff --git a/trace/meson.build b/trace/meson.build index 573dd699c6..e279e33d4d 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -62,7 +62,6 @@ trace_events_all = custom_target('trace-events-all', install_dir: qemu_datadir) foreach d : [ - ['generated-tcg-tracers.h', 'tcg-h'], ['generated-helpers.c', 'tcg-helper-c'], ['generated-helpers.h', 'tcg-helper-h'], ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'], From patchwork Tue Oct 26 10:22:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516204 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp159311imj; Tue, 26 Oct 2021 03:51:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxE+GDUYHg4fFqhh46aU2WFrCrN7rxlUkHFxuKVIN/VFXq8GH0Z8dbD0/Zfb0sARFkmvYLu X-Received: by 2002:a9d:63c3:: with SMTP id e3mr19127359otl.220.1635245516920; Tue, 26 Oct 2021 03:51:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635245516; cv=none; d=google.com; s=arc-20160816; b=0dE76VGAN797Jzkanq/t3R3/68fiKB6KOPuFYq+TOGyanQpFvpGyiCXI2xJEZrXBbe +o4BKaQIaBQ21jOSePqFtmJ9cb9+I1hlDGNWtRNRm9nJ+LEwuY3Y0Ty15sTMHnRvxsuf xxEbjcXCsEg/O0rXcdDDL+Z1kJYS7kphzhWcHFbtEhS/7bHHO3u/0qMg3S9g1T15UXL9 oCeHiTCY4YlhOYm88c7M2gR34OB5gcO1vZrFyDRb9XbhlvSNBOTzxOoYM42pCgZ8ufaz KZCXzIvMsVd3cXoSHZYj+Ba6I1kPYWyEYPl6G492p1uygJ1jvuMwNrqjulDsFnWzAzjt cM9Q== 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=mfvi3zQvp0Bx9XkjqmXqkV6VpYWDPd6qtWW0BZ1iRco=; b=WgiLrCLVT7FDh3eIssmKr6yHEGaaYROZtW4YYrQnVU5hXhz1Eevb6WEoMCMDbS6pAD IA6sQOnh9rnqs//CMRXnoxBfMmzJtaNFex2qvKeybv3iLSWUeDkLd5c4xIYTyxUvNTn3 NHeaZcMMGj1y5FYBg40bmaT2JFup6DktGSKlkrfGO280aRFZ+w0m/Iv9VIgx2+/D2u3e aYW/C+oPtAAJdVGqwPT948jMS/hMrxoKDPp68v7dsc22Y3twuhHOE05uII/MiGdKqJ5/ 4mIk+NE50fG3JvjjIbfIOHmlXqDscZ0dUrGCjNUTXEYuHYUtLUSG5AlfL4DJQ6xJDr/v vlGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OwKGetvS; 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 38si25301302otd.341.2021.10.26.03.51.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:51: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=OwKGetvS; 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]:47832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfK3g-0000Pm-4n for patch@linaro.org; Tue, 26 Oct 2021 06:51:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52900) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi4-0002D7-Dv for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:36 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]:38548) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi1-0004gO-PB for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:36 -0400 Received: by mail-wr1-x42c.google.com with SMTP id u18so14916189wrg.5 for ; Tue, 26 Oct 2021 03:29: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=mfvi3zQvp0Bx9XkjqmXqkV6VpYWDPd6qtWW0BZ1iRco=; b=OwKGetvSMwGZY4JlWigMZ+Q/yuM+4mpQbDMZDm9pxsvY9/+P/BwI0+wJ6PwVDstWsB V96oMJvme3dCQmmEZXIcy4HZvhw4Hl2Th9joht8ACRd20Wlig2sythfvCa3zSv5/iiZw 7am0qVlE+fe/FynK26ZXDPdPwOgpvM6+ErlrAvc2Hntmc2Zy1n3qGRg0Qghj6F8nS7he PGXxn+EsLpHOU+01zOl1T4phYCyNv0pOeUsDhX2j33kbnNN2rwxe/bGWIpGf2D/B0F1K KbtragELUKecGbitJcGhT0tU0huG58S8jPp+3P7GxWKqCgcPBTPlNUKPR6T0ONtbZJoy RZ1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mfvi3zQvp0Bx9XkjqmXqkV6VpYWDPd6qtWW0BZ1iRco=; b=nkq5buEGqkRFkMoXX9nrc8T4FsEPz+r3GIWlBEPEdlDWFS5sP6L5+5tpyIxkdV+15z 4YfSjmuRJJMsfP+j0E6tQ8SKcquTf2tXa6+ewTjAwnslAnVsVDKhVUKbyudEF6YGXT25 gIrPZP5yxacklm3/Hmc2p1B2/02N/qvViW/1JBfZLPtKDfGTH23VXTFgrQ0K9N2Rl23f +WqCkU215vFAMDfa507seO2f6Gxn/4kqOmLnEEKzQg2bAv0O08R9J70SEwZdxwK2SwO4 sSpsdniI1sJn4vOtyQQ7/kO2cQP89gb3fCan1kMkmp25s3kIMHRd7AzUC1TU2xySl/OM IYhg== X-Gm-Message-State: AOAM533ECbv+MfJnxKpKUns5E7L4YYTfdLSWD94ZWyuvs48kLuZIy7/G 23Ekj/bodApIz5CBV1LAjeI1Sw== X-Received: by 2002:adf:e310:: with SMTP id b16mr31015852wrj.309.1635244172349; Tue, 26 Oct 2021 03:29:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d1sm19111354wrr.72.2021.10.26.03.29.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0ACC41FF98; Tue, 26 Oct 2021 11:22:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 24/28] tracing: excise the tcg related from tracetool Date: Tue, 26 Oct 2021 11:22:30 +0100 Message-Id: <20211026102234.3961636-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, Richard Henderson , f4bug@amsat.org, robhenry@microsoft.com, Luis Vilanova , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now we have no TCG trace events and no longer handle them in the code we can remove the handling from the tracetool to generate them. vcpu tracing is still available although the existing syscall event is an exercise in redundancy (plugins and -strace can also get the information). Signed-off-by: Alex Bennée Cc: Luis Vilanova Cc: Stefan Hajnoczi Reviewed-by: Richard Henderson --- meson.build | 4 - include/exec/helper-gen.h | 2 - include/exec/helper-proto.h | 1 - include/exec/helper-tcg.h | 1 - scripts/tracetool/__init__.py | 41 +-------- scripts/tracetool/format/tcg_h.py | 83 ------------------- scripts/tracetool/format/tcg_helper_c.py | 79 ------------------ scripts/tracetool/format/tcg_helper_h.py | 48 ----------- .../tracetool/format/tcg_helper_wrapper_h.py | 70 ---------------- scripts/tracetool/vcpu.py | 14 +--- trace/meson.build | 13 --- 11 files changed, 4 insertions(+), 352 deletions(-) delete mode 100644 scripts/tracetool/format/tcg_h.py delete mode 100644 scripts/tracetool/format/tcg_helper_c.py delete mode 100644 scripts/tracetool/format/tcg_helper_h.py delete mode 100644 scripts/tracetool/format/tcg_helper_wrapper_h.py -- 2.30.2 diff --git a/meson.build b/meson.build index bc520b579c..c2d0d064cd 100644 --- a/meson.build +++ b/meson.build @@ -2304,19 +2304,15 @@ tracetool_depends = files( 'scripts/tracetool/backend/simple.py', 'scripts/tracetool/backend/syslog.py', 'scripts/tracetool/backend/ust.py', - 'scripts/tracetool/format/tcg_h.py', 'scripts/tracetool/format/ust_events_c.py', 'scripts/tracetool/format/ust_events_h.py', 'scripts/tracetool/format/__init__.py', 'scripts/tracetool/format/d.py', - 'scripts/tracetool/format/tcg_helper_c.py', 'scripts/tracetool/format/simpletrace_stap.py', 'scripts/tracetool/format/c.py', 'scripts/tracetool/format/h.py', - 'scripts/tracetool/format/tcg_helper_h.py', 'scripts/tracetool/format/log_stap.py', 'scripts/tracetool/format/stap.py', - 'scripts/tracetool/format/tcg_helper_wrapper_h.py', 'scripts/tracetool/__init__.py', 'scripts/tracetool/transform.py', 'scripts/tracetool/vcpu.py' diff --git a/include/exec/helper-gen.h b/include/exec/helper-gen.h index 1c2e7a8ed3..7b6ca975ef 100644 --- a/include/exec/helper-gen.h +++ b/include/exec/helper-gen.h @@ -79,8 +79,6 @@ static inline void glue(gen_helper_, name)(dh_retvar_decl(ret) \ } #include "helper.h" -#include "trace/generated-helpers.h" -#include "trace/generated-helpers-wrappers.h" #include "accel/tcg/tcg-runtime.h" #include "accel/tcg/plugin-helpers.h" diff --git a/include/exec/helper-proto.h b/include/exec/helper-proto.h index ba100793a7..c4b1bda632 100644 --- a/include/exec/helper-proto.h +++ b/include/exec/helper-proto.h @@ -38,7 +38,6 @@ dh_ctype(ret) HELPER(name) (dh_ctype(t1), dh_ctype(t2), dh_ctype(t3), \ #define IN_HELPER_PROTO #include "helper.h" -#include "trace/generated-helpers.h" #include "accel/tcg/tcg-runtime.h" #include "accel/tcg/plugin-helpers.h" diff --git a/include/exec/helper-tcg.h b/include/exec/helper-tcg.h index 16cd318b83..3933258f1a 100644 --- a/include/exec/helper-tcg.h +++ b/include/exec/helper-tcg.h @@ -59,7 +59,6 @@ | dh_typemask(t5, 5) | dh_typemask(t6, 6) | dh_typemask(t7, 7) }, #include "helper.h" -#include "trace/generated-helpers.h" #include "accel/tcg/tcg-runtime.h" #include "accel/tcg/plugin-helpers.h" diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 5bc94d95cf..5393c7fc5c 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -87,8 +87,6 @@ def out(*lines, **kwargs): "ssize_t", "uintptr_t", "ptrdiff_t", - # Magic substitution is done by tracetool - "TCGv", ] def validate_type(name): @@ -232,7 +230,7 @@ class Event(object): "(?:(?:(?P\".+),)?\s*(?P\".+))?" "\s*") - _VALID_PROPS = set(["disable", "tcg", "tcg-trans", "tcg-exec", "vcpu"]) + _VALID_PROPS = set(["disable", "vcpu"]) def __init__(self, name, props, fmt, args, lineno, filename, orig=None, event_trans=None, event_exec=None): @@ -321,15 +319,6 @@ def build(line_str, lineno, filename): fmt = [fmt_trans, fmt] args = Arguments.build(groups["args"]) - if "tcg-trans" in props: - raise ValueError("Invalid property 'tcg-trans'") - if "tcg-exec" in props: - raise ValueError("Invalid property 'tcg-exec'") - if "tcg" not in props and not isinstance(fmt, str): - raise ValueError("Only events with 'tcg' property can have two format strings") - if "tcg" in props and isinstance(fmt, str): - raise ValueError("Events with 'tcg' property must have two format strings") - event = Event(name, props, fmt, args, lineno, filename) # add implicit arguments when using the 'vcpu' property @@ -409,33 +398,7 @@ def read_events(fobj, fname): e.args = (arg0,) + e.args[1:] raise - # transform TCG-enabled events - if "tcg" not in event.properties: - events.append(event) - else: - event_trans = event.copy() - event_trans.name += "_trans" - event_trans.properties += ["tcg-trans"] - event_trans.fmt = event.fmt[0] - # ignore TCG arguments - args_trans = [] - for atrans, aorig in zip( - event_trans.transform(tracetool.transform.TCG_2_HOST).args, - event.args): - if atrans == aorig: - args_trans.append(atrans) - event_trans.args = Arguments(args_trans) - - event_exec = event.copy() - event_exec.name += "_exec" - event_exec.properties += ["tcg-exec"] - event_exec.fmt = event.fmt[1] - event_exec.args = event_exec.args.transform(tracetool.transform.TCG_2_HOST) - - new_event = [event_trans, event_exec] - event.event_trans, event.event_exec = new_event - - events.extend(new_event) + events.append(event) return events diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format/tcg_h.py deleted file mode 100644 index 4d84440aff..0000000000 --- a/scripts/tracetool/format/tcg_h.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -Generate .h file for TCG code generation. -""" - -__author__ = "Lluís Vilanova " -__copyright__ = "Copyright 2012-2017, Lluís Vilanova " -__license__ = "GPL version 2 or (at your option) any later version" - -__maintainer__ = "Stefan Hajnoczi" -__email__ = "stefanha@redhat.com" - - -from tracetool import out, Arguments -import tracetool.vcpu - - -def vcpu_transform_args(args): - assert len(args) == 1 - return Arguments([ - args, - # NOTE: this name must be kept in sync with the one in "tcg_h" - # NOTE: Current helper code uses TCGv_env (CPUArchState*) - ("TCGv_env", "__tcg_" + args.names()[0]), - ]) - - -def generate(events, backend, group): - if group == "root": - header = "trace/trace-root.h" - else: - header = "trace.h" - - out('/* This file is autogenerated by tracetool, do not edit. */', - '/* You must include this file after the inclusion of helper.h */', - '', - '#ifndef TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(), - '#define TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(), - '', - '#include "exec/helper-proto.h"', - '#include "%s"' % header, - '', - ) - - for e in events: - # just keep one of them - if "tcg-exec" not in e.properties: - continue - - out('static inline void %(name_tcg)s(%(args)s)', - '{', - name_tcg=e.original.api(e.QEMU_TRACE_TCG), - args=tracetool.vcpu.transform_args("tcg_h", e.original)) - - if "disable" not in e.properties: - args_trans = e.original.event_trans.args - args_exec = tracetool.vcpu.transform_args( - "tcg_helper_c", e.original.event_exec, "wrapper") - if "vcpu" in e.properties: - trace_cpu = e.args.names()[0] - cond = "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=trace_cpu, - id=e.original.event_exec.name.upper()) - else: - cond = "true" - - out(' %(name_trans)s(%(argnames_trans)s);', - ' if (%(cond)s) {', - ' gen_helper_%(name_exec)s(%(argnames_exec)s);', - ' }', - name_trans=e.original.event_trans.api(e.QEMU_TRACE), - name_exec=e.original.event_exec.api(e.QEMU_TRACE), - argnames_trans=", ".join(args_trans.names()), - argnames_exec=", ".join(args_exec.names()), - cond=cond) - - out('}') - - out('', - '#endif /* TRACE_%s_GENERATED_TCG_TRACERS_H */' % group.upper()) diff --git a/scripts/tracetool/format/tcg_helper_c.py b/scripts/tracetool/format/tcg_helper_c.py deleted file mode 100644 index 72576e67d1..0000000000 --- a/scripts/tracetool/format/tcg_helper_c.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -Generate trace/generated-helpers.c. -""" - -__author__ = "Lluís Vilanova " -__copyright__ = "Copyright 2012-2017, Lluís Vilanova " -__license__ = "GPL version 2 or (at your option) any later version" - -__maintainer__ = "Stefan Hajnoczi" -__email__ = "stefanha@redhat.com" - - -from tracetool import Arguments, out -from tracetool.transform import * -import tracetool.vcpu - - -def vcpu_transform_args(args, mode): - assert len(args) == 1 - # NOTE: this name must be kept in sync with the one in "tcg_h" - args = Arguments([(args.types()[0], "__tcg_" + args.names()[0])]) - if mode == "code": - return Arguments([ - # Does cast from helper requirements to tracing types - ("CPUState *", "env_cpu(%s)" % args.names()[0]), - ]) - else: - args = Arguments([ - # NOTE: Current helper code uses TCGv_env (CPUArchState*) - ("CPUArchState *", args.names()[0]), - ]) - if mode == "header": - return args - elif mode == "wrapper": - return args.transform(HOST_2_TCG) - else: - assert False - - -def generate(events, backend, group): - if group == "root": - header = "trace/trace-root.h" - else: - header = "trace.h" - - events = [e for e in events - if "disable" not in e.properties] - - out('/* This file is autogenerated by tracetool, do not edit. */', - '', - '#include "qemu/osdep.h"', - '#include "cpu.h"', - '#include "exec/helper-proto.h"', - '#include "%s"' % header, - '', - ) - - for e in events: - if "tcg-exec" not in e.properties: - continue - - e_args_api = tracetool.vcpu.transform_args( - "tcg_helper_c", e.original, "header").transform( - HOST_2_TCG_COMPAT, TCG_2_TCG_HELPER_DEF) - e_args_call = tracetool.vcpu.transform_args( - "tcg_helper_c", e, "code") - - out('void %(name_tcg)s(%(args_api)s)', - '{', - # NOTE: the check was already performed at TCG-generation time - ' %(name)s(%(args_call)s);', - '}', - name_tcg="helper_%s_proxy" % e.api(), - name=e.api(e.QEMU_TRACE_NOCHECK), - args_api=e_args_api, - args_call=", ".join(e_args_call.casted()), - ) diff --git a/scripts/tracetool/format/tcg_helper_h.py b/scripts/tracetool/format/tcg_helper_h.py deleted file mode 100644 index 08554fbc85..0000000000 --- a/scripts/tracetool/format/tcg_helper_h.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -Generate trace/generated-helpers.h. -""" - -__author__ = "Lluís Vilanova " -__copyright__ = "Copyright 2012-2016, Lluís Vilanova " -__license__ = "GPL version 2 or (at your option) any later version" - -__maintainer__ = "Stefan Hajnoczi" -__email__ = "stefanha@redhat.com" - - -from tracetool import out -from tracetool.transform import * -import tracetool.vcpu - - -def generate(events, backend, group): - events = [e for e in events - if "disable" not in e.properties] - - out('/* This file is autogenerated by tracetool, do not edit. */', - '', - ) - - for e in events: - if "tcg-exec" not in e.properties: - continue - - # TCG helper proxy declaration - fmt = "DEF_HELPER_FLAGS_%(argc)d(%(name)s, %(flags)svoid%(types)s)" - e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "header") - args = e_args.transform(HOST_2_TCG_COMPAT, HOST_2_TCG, - TCG_2_TCG_HELPER_DECL) - types = ", ".join(args.types()) - if types != "": - types = ", " + types - - flags = "TCG_CALL_NO_RWG, " - - out(fmt, - flags=flags, - argc=len(args), - name=e.api() + "_proxy", - types=types, - ) diff --git a/scripts/tracetool/format/tcg_helper_wrapper_h.py b/scripts/tracetool/format/tcg_helper_wrapper_h.py deleted file mode 100644 index 0c5a9797d1..0000000000 --- a/scripts/tracetool/format/tcg_helper_wrapper_h.py +++ /dev/null @@ -1,70 +0,0 @@ -# -*- coding: utf-8 -*- - -""" -Generate trace/generated-helpers-wrappers.h. -""" - -__author__ = "Lluís Vilanova " -__copyright__ = "Copyright 2012-2016, Lluís Vilanova " -__license__ = "GPL version 2 or (at your option) any later version" - -__maintainer__ = "Stefan Hajnoczi" -__email__ = "stefanha@redhat.com" - - -from tracetool import out -from tracetool.transform import * -import tracetool.vcpu - - -def generate(events, backend, group): - events = [e for e in events - if "disable" not in e.properties] - - out('/* This file is autogenerated by tracetool, do not edit. */', - '', - '#define tcg_temp_new_nop(v) (v)', - '#define tcg_temp_free_nop(v)', - '', - ) - - for e in events: - if "tcg-exec" not in e.properties: - continue - - # tracetool.generate always transforms types to host - e_args = tracetool.vcpu.transform_args("tcg_helper_c", e.original, "wrapper") - - # mixed-type to TCG helper bridge - args_tcg_compat = e_args.transform(HOST_2_TCG_COMPAT) - - code_new = [ - "%(tcg_type)s __%(name)s = %(tcg_func)s(%(name)s);" % - {"tcg_type": transform_type(type_, HOST_2_TCG), - "tcg_func": transform_type(type_, HOST_2_TCG_TMP_NEW), - "name": name} - for (type_, name) in args_tcg_compat - ] - - code_free = [ - "%(tcg_func)s(__%(name)s);" % - {"tcg_func": transform_type(type_, HOST_2_TCG_TMP_FREE), - "name": name} - for (type_, name) in args_tcg_compat - ] - - gen_name = "gen_helper_" + e.api() - - out('static inline void %(name)s(%(args)s)', - '{', - ' %(code_new)s', - ' %(proxy_name)s(%(tmp_names)s);', - ' %(code_free)s', - '}', - name=gen_name, - args=e_args, - proxy_name=gen_name + "_proxy", - code_new="\n ".join(code_new), - code_free="\n ".join(code_free), - tmp_names=", ".join(["__%s" % name for _, name in e_args]), - ) diff --git a/scripts/tracetool/vcpu.py b/scripts/tracetool/vcpu.py index 868b4cb04c..d232cb1d06 100644 --- a/scripts/tracetool/vcpu.py +++ b/scripts/tracetool/vcpu.py @@ -19,19 +19,9 @@ def transform_event(event): """Transform event to comply with the 'vcpu' property (if present).""" if "vcpu" in event.properties: - # events with 'tcg-trans' and 'tcg-exec' are auto-generated from - # already-patched events - assert "tcg-trans" not in event.properties - assert "tcg-exec" not in event.properties - event.args = Arguments([("void *", "__cpu"), event.args]) - if "tcg" in event.properties: - fmt = "\"cpu=%p \"" - event.fmt = [fmt + event.fmt[0], - fmt + event.fmt[1]] - else: - fmt = "\"cpu=%p \"" - event.fmt = fmt + event.fmt + fmt = "\"cpu=%p \"" + event.fmt = fmt + event.fmt return event diff --git a/trace/meson.build b/trace/meson.build index e279e33d4d..298926036a 100644 --- a/trace/meson.build +++ b/trace/meson.build @@ -61,19 +61,6 @@ trace_events_all = custom_target('trace-events-all', install: true, install_dir: qemu_datadir) -foreach d : [ - ['generated-helpers.c', 'tcg-helper-c'], - ['generated-helpers.h', 'tcg-helper-h'], - ['generated-helpers-wrappers.h', 'tcg-helper-wrapper-h'], -] - gen = custom_target(d[0], - output: d[0], - input: meson.project_source_root() / 'trace-events', - command: [ tracetool, '--group=root', '--format=@0@'.format(d[1]), '@INPUT@', '@OUTPUT@' ], - depend_files: tracetool_depends) - specific_ss.add(when: 'CONFIG_TCG', if_true: gen) -endforeach - if 'ust' in get_option('trace_backends') trace_ust_all_h = custom_target('trace-ust-all.h', output: 'trace-ust-all.h', From patchwork Tue Oct 26 10:22:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516195 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp147931imj; Tue, 26 Oct 2021 03:37:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweLlygfazPj6dAFZQhrqWi5Q7VJH6v3qH5iQB9hGq8pdM7Y+6tdQFfX/VHn9WdnlePwJ34 X-Received: by 2002:aca:1219:: with SMTP id 25mr305344ois.149.1635244625527; Tue, 26 Oct 2021 03:37:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244625; cv=none; d=google.com; s=arc-20160816; b=QKnV9Fzptr/GXxyrNAJ5zP/mOyTSnej0vMtdydmIECIjaQXX6Ft12uhl7S4yV2NnkH C/F+YTl7MrmxnFgjvgKPL7Rrsu3CewNlPEUyCKlaqp52YLTZ9vX3FySeUbno4WwwnztN 7+uKW1XbDzklnLBvpxMW8khbqrYVcLqiB/2T3pWMmeTzCat1vEWIs4SufKod98ZtunWr Nv9haaoDlih8NEESlz/t1tRqttDm54yD3sqzAJXXJDAKf9KGPWN0kvTptv/G0mz1kc3o 78UsokZBd8gNA0QWKFam9eSWRVBDhSSS+y4rJRk4pN8DCYX7O6vUp1Q3YFQ+b7pk0Gdw bOHg== 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=nAdmbpsGRI7IIKYGmTuV2CO734xKeZibs75jIXQLIvc=; b=QRAXUIbbHViihsSA/K1jBDc25/Ws163zFC0B1oATiDaA5jIXgJQnpsJ+V3Su27+E3A iHURfi/cjsswOPwjJYV6zAn57IKzqjbMi2+9hJixDHJX9m86B0dSCBV2ca3RDwiOFKZz f/5VVvJjz24NuRrfvG2e19N3NzyId01cxWk4RcRF3Cv7EJjUOQQOKZU8aLH0ImayRrdi 1htqSp1KNxmWN5ubPOAxY3vh1iPtw8tiQe/00x4Ytt8JZ94chGRGW/ZfFYD1EGFHV2dp KwXk13hmip+lrwNxRpN04NFDH+61klbKH3+jDM20hJAwp1BlJ+J+DOROelrncfnu3Kjf blFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=uAisMZJQ; 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 bq3si28439699oib.152.2021.10.26.03.37.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:37: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=uAisMZJQ; 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]:34876 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJpH-0006Y1-OK for patch@linaro.org; Tue, 26 Oct 2021 06:37:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJbf-0001AF-14 for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:59 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]:36544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJbd-0007So-8Z for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:22:58 -0400 Received: by mail-wr1-x42b.google.com with SMTP id i9so2433509wrc.3 for ; Tue, 26 Oct 2021 03:22:56 -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=nAdmbpsGRI7IIKYGmTuV2CO734xKeZibs75jIXQLIvc=; b=uAisMZJQ2TAlgHbNEkmuPsJ3fcUv/gugiWHuZ8C6F0oRW+grAj6xNXLlzc3Rpwu6Dq klbgdrgkIRkKIAWI/obEZyN1+bSbSjgTqe1kxVRfsjhZOvj4v8MG9VGaO3nN2NSkmBLV HbHmviekIrK8hqZdSrZy6aq6axHfLjnuXfFsxp9F8pxBO7YExEYG6RyUReegBoUeEnx1 jkSywOnZDlcdIwNjtm6rXmVzNlgZbcUQL8cett90cTawEUgR179NBOLcJwKKN4JFFwo8 d0dMUevNW8Q1yZvfANN8GCahvlKDVfiVhfkpZiIl/EhQ7uNQ2Fg1+d9Tj9OsoKi+b1cA VjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nAdmbpsGRI7IIKYGmTuV2CO734xKeZibs75jIXQLIvc=; b=jQNLVfr4DaWMPIqMvVYIq6YXqecIpA6I35U+jHhvASiRVdCcT57gGneD3fep3PUEXJ zouP8E0Rs7KKUZPwB2YjSq0SLUQbUpqLJ/Czf1CUD5hN94zld1bYi8ar8gOfwyaiUeOS yWgFtg897LnNe67MhlGUdUzJUG/prZVLhkWlDPm55ESu7WUHNaugizAy+oXCs9CmehPF MQCrbFuLTIh1+6OEcsOY/wI1Mrs80GZjkI4LBJ+NAFAXJcXLyTcp1GSujCtAxkkGAblB sDzYmh8gy2fnkH1RgBde8uMt6lkAHflHs5JZTXinX9AIBukMZK+k6moS5o0ROvZ6wYWy mZpQ== X-Gm-Message-State: AOAM533kK9qoc7UZNIJKl78ec3siwU+OEaOpAuq2gkSU8Cmc+oNGUbBD EI//QYe+XrdSEhFqA1N4TYDfhg== X-Received: by 2002:adf:a413:: with SMTP id d19mr31502352wra.246.1635243775913; Tue, 26 Oct 2021 03:22:55 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id p21sm196958wmc.11.2021.10.26.03.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:22:54 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 21E8B1FFBB; Tue, 26 Oct 2021 11:22:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 25/28] plugins: add helper functions for coverage plugins Date: Tue, 26 Oct 2021 11:22:31 +0100 Message-Id: <20211026102234.3961636-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Ivanov Arkady , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Ivanov Arkady Which provide information about: - start_code. - end_code. - entry. - path to the executable binary. Signed-off-by: Ivanov Arkady Message-Id: <163491883461.304355.8210754161847179432.stgit@pc-System-Product-Name> [AJB: reword title, better descriptions, defaults, rm export, fix include] Signed-off-by: Alex Bennée --- include/qemu/qemu-plugin.h | 34 ++++++++++++++++++++++++++ plugins/api.c | 46 ++++++++++++++++++++++++++++++++++++ plugins/qemu-plugins.symbols | 4 ++++ 3 files changed, 84 insertions(+) -- 2.30.2 diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 5f1017201f..535ddbf0ae 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -590,4 +590,38 @@ void qemu_plugin_outs(const char *string); */ bool qemu_plugin_bool_parse(const char *name, const char *val, bool *ret); +/** + * qemu_plugin_path_to_binary() - path to binary file being executed + * + * Return a string representing the path to the binary. For user-mode + * this is the main executable. For system emulation we currently + * return NULL. The user should g_free() the string once no longer + * needed. + */ +const char *qemu_plugin_path_to_binary(void); + +/** + * qemu_plugin_start_code() - returns start of text segment + * + * Returns the nominal start address of the main text segment in + * user-mode. Currently returns 0 for system emulation. + */ +uint64_t qemu_plugin_start_code(void); + +/** + * qemu_plugin_end_code() - returns end of text segment + * + * Returns the nominal end address of the main text segment in + * user-mode. Currently returns 0 for system emulation. + */ +uint64_t qemu_plugin_end_code(void); + +/** + * qemu_plugin_entry_code() - returns start address for module + * + * Returns the nominal entry address of the main text segment in + * user-mode. Currently returns 0 for system emulation. + */ +uint64_t qemu_plugin_entry_code(void); + #endif /* QEMU_PLUGIN_API_H */ diff --git a/plugins/api.c b/plugins/api.c index b143b09ce9..e6a2c9dde3 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -44,6 +44,9 @@ #ifndef CONFIG_USER_ONLY #include "qemu/plugin-memory.h" #include "hw/boards.h" +#else +#include "qemu.h" +#include "loader.h" #endif /* Uninstall and Reset handlers */ @@ -391,3 +394,46 @@ bool qemu_plugin_bool_parse(const char *name, const char *value, bool *ret) { return name && value && qapi_bool_parse(name, value, ret, NULL); } + +/* + * Binary path, start and end locations + */ +const char *qemu_plugin_path_to_binary(void) +{ + char *path = NULL; +#ifdef CONFIG_USER_ONLY + TaskState *ts = (TaskState *) current_cpu->opaque; + path = g_strdup(ts->bprm->filename); +#endif + return path; +} + +uint64_t qemu_plugin_start_code(void) +{ + uint64_t start = 0; +#ifdef CONFIG_USER_ONLY + TaskState *ts = (TaskState *) current_cpu->opaque; + start = ts->info->start_code; +#endif + return start; +} + +uint64_t qemu_plugin_end_code(void) +{ + uint64_t end = 0; +#ifdef CONFIG_USER_ONLY + TaskState *ts = (TaskState *) current_cpu->opaque; + end = ts->info->end_code; +#endif + return end; +} + +uint64_t qemu_plugin_entry_code(void) +{ + uint64_t entry = 0; +#ifdef CONFIG_USER_ONLY + TaskState *ts = (TaskState *) current_cpu->opaque; + entry = ts->info->entry; +#endif + return entry; +} diff --git a/plugins/qemu-plugins.symbols b/plugins/qemu-plugins.symbols index 4834756ba3..71f6c90549 100644 --- a/plugins/qemu-plugins.symbols +++ b/plugins/qemu-plugins.symbols @@ -1,5 +1,7 @@ { qemu_plugin_bool_parse; + qemu_plugin_end_code; + qemu_plugin_entry_code; qemu_plugin_get_hwaddr; qemu_plugin_hwaddr_device_name; qemu_plugin_hwaddr_is_io; @@ -17,6 +19,7 @@ qemu_plugin_n_max_vcpus; qemu_plugin_n_vcpus; qemu_plugin_outs; + qemu_plugin_path_to_binary; qemu_plugin_register_atexit_cb; qemu_plugin_register_flush_cb; qemu_plugin_register_vcpu_exit_cb; @@ -33,6 +36,7 @@ qemu_plugin_register_vcpu_tb_exec_inline; qemu_plugin_register_vcpu_tb_trans_cb; qemu_plugin_reset; + qemu_plugin_start_code; qemu_plugin_tb_get_insn; qemu_plugin_tb_n_insns; qemu_plugin_tb_vaddr; From patchwork Tue Oct 26 10:22:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516196 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp151701imj; Tue, 26 Oct 2021 03:41:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvvoPSw7mXja7qQv4gOU9ifx1vFwTK9i6AAfBy0IqMfKm+M0OyUyzJtamjHiY2pvM0Svm+ X-Received: by 2002:a05:6808:124b:: with SMTP id o11mr26707057oiv.1.1635244913856; Tue, 26 Oct 2021 03:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244913; cv=none; d=google.com; s=arc-20160816; b=qELM8AVXa1q1S9D2ASn8JzUIhTdyI2mKIOBdyTaVY9gJP+nFRilgdzReWLW7Tn3QIY nmcEkUPsQxJY5Zc1SIUg9sxrENxzCIHLqLXQ7FWq9kRpzTcrybgH4AmYvf1vmVF/chQS KGLQPfneQnMVCxHUyRomKWCSKbO4Qcnrn8sF1GW/+E0YuzgCbcX6zZ2zeOiVlt12SoLU njP7Ohr01zC2+FldMPaUb9wN9GPq6H6R3oNQf6IxXf3HGU1LLvoJ1v2LdHNrCsxb2kh4 alfwqJtL/4vpL8aOWiP3GqgCkNz2tOF4TRRmqgnbWWboIK61RYQHc1o+iAL95FZ42KoN bKAQ== 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=okvwrtf08W8uarrzKrlBybF3KpHoBrIYOL+cAd6cfzU=; b=pNtbAWXwZL6nAHZnehCg6pLHir/dSVFzwvDEIn8mVoAqUY4gacrpdPJ07r1ZrGgKyZ EWnvwbwB3AV2oJr4kMjZ8pesQYT6ich2vW5ZWkcUWIz5e4Mx4SWImA+MsEjoJKc2Ev5M 6/iaDpvyTWsrn8SFFPiItvgCS6C+rejrjRvMa/Mx/FEPgdaznV1cNasWIKx/1kpEnSA5 96pK47vG7oghv2ITCrjcYOCAjUV4GbJkRf0PfX5e4QHgiI3zcmu5ZArEgQZJMWko7ycC 6KD8ajcG8K23FbdyuxcThspc5j0SRAQGKyDTuzlCnTeqRGHC/rmEQdZ6W/ll7r2Tmy4d 4hvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BOynbW+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 bd10si33012308oib.282.2021.10.26.03.41.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:41: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=BOynbW+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]:48666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJtx-0007Jv-5b for patch@linaro.org; Tue, 26 Oct 2021 06:41:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJhu-0001i0-IE for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:26 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]:42836) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhs-0004fL-Kv for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:26 -0400 Received: by mail-wm1-x32b.google.com with SMTP id b82-20020a1c8055000000b0032ccc728d63so376385wmd.1 for ; Tue, 26 Oct 2021 03:29: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=okvwrtf08W8uarrzKrlBybF3KpHoBrIYOL+cAd6cfzU=; b=BOynbW+GsXxu9VhXl9s03GXdghsmfqm+gD1jshUy90EthV19NGWGRulsuAonBvjnZK 8WoWzE8S8/zAkSdc64Q530pbtmyhF/T0uKb5mX71jtvb9g3+5TH0d9ORG1++DWNyEVsR qYI1zoc+4TwMxAL7CWkPMLziuXR3joa+bpEyKA+ewe+ryuwg49na5PnFdbivYGYO6a2Y VJaFr66HQ+lM8zn3OjoRzrRz9u+MZCvKIwq9CdXOo45291SxZzUo3Zu0na0jx60272OZ t4HAWN1Lcj3tprMeuXy/Kvp7CFTWFzoVYNaPwc+RAAjbmTXUDEuzQ3PJu/PVpkKOFDZq yJsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=okvwrtf08W8uarrzKrlBybF3KpHoBrIYOL+cAd6cfzU=; b=F/eMP590Ad/g9OzxzX1fsJrBathTfAt2aJ3ocyjdAKIv9a9EaoHeElXSx6f1HYs0dj WqSX31VQUQJR/wwl4bBCALMSh4tsIGsRFola5lrNKyB67Qe/gPpmnN/+5a7fe57qsYba x+kiQFOVcPpQg63wuTfpCzG7Byxol75L0iCwEgxCpO8XgEDnptD2tzwJn0QZ04kHcaoV Gd3YLNcyK5uSwtTTXrp2rE0/A3r7TBmm72dh5Lbb4EoKIlOAmAEI5BmxZjLx6/RZmX3O 9ctvnB3BIOgJb65tkcJ63MSABzHBCp0m3ZjTvAXmQ66SGMgW9oDjXyzeXgjyRpsOLN1I qLWQ== X-Gm-Message-State: AOAM533//JoMtyVJbIFXvIfF16v7x7vnxgXk2L+fIxeJ0DiiqVtFCqh4 i+vBJiSMuwwoY8p90IZalzsbmA== X-Received: by 2002:a1c:7f4a:: with SMTP id a71mr19988887wmd.177.1635244163219; Tue, 26 Oct 2021 03:29:23 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o10sm192309wmr.31.2021.10.26.03.29.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:19 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3DCE71FFBC; Tue, 26 Oct 2021 11:22:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 26/28] contrib/plugins: add a drcov plugin Date: Tue, 26 Oct 2021 11:22:32 +0100 Message-Id: <20211026102234.3961636-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, Ivanov Arkady , mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, Alexandre Iooss , =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Ivanov Arkady This patch adds the ability to generate files in drcov format. Primary goal this script is to have coverage logfiles thatwork in Lighthouse. Signed-off-by: Ivanov Arkady Message-Id: <163491884553.304355.13246023070235438959.stgit@pc-System-Product-Name> [AJB: use g_ptr_array instead of slist] Signed-off-by: Alex Bennée --- contrib/plugins/drcov.c | 163 +++++++++++++++++++++++++++++++++++++++ contrib/plugins/Makefile | 1 + 2 files changed, 164 insertions(+) create mode 100644 contrib/plugins/drcov.c -- 2.30.2 diff --git a/contrib/plugins/drcov.c b/contrib/plugins/drcov.c new file mode 100644 index 0000000000..b4a855adaf --- /dev/null +++ b/contrib/plugins/drcov.c @@ -0,0 +1,163 @@ +/* + * Copyright (C) 2021, Ivanov Arkady + * + * Drcov - a DynamoRIO-based tool that collects coverage information + * from a binary. Primary goal this script is to have coverage log + * files that work in Lighthouse. + * + * 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 + +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +static char header[] = "DRCOV VERSION: 2\n" + "DRCOV FLAVOR: drcov-64\n" + "Module Table: version 2, count 1\n" + "Columns: id, base, end, entry, path\n"; + +static FILE *fp; +static const char *file_name = "file.drcov.trace"; +static GMutex lock; + +typedef struct { + uint32_t start; + uint16_t size; + uint16_t mod_id; + bool exec; +} bb_entry_t; + +/* Translated blocks */ +static GPtrArray *blocks; + +static void printf_header(unsigned long count) +{ + fprintf(fp, "%s", header); + const char *path = qemu_plugin_path_to_binary(); + uint64_t start_code = qemu_plugin_start_code(); + uint64_t end_code = qemu_plugin_end_code(); + uint64_t entry = qemu_plugin_entry_code(); + fprintf(fp, "0, 0x%lx, 0x%lx, 0x%lx, %s\n", + start_code, end_code, entry, path); + fprintf(fp, "BB Table: %ld bbs\n", count); +} + +static void printf_char_array32(uint32_t data) +{ + const uint8_t *bytes = (const uint8_t *)(&data); + fwrite(bytes, sizeof(char), sizeof(data), fp); +} + +static void printf_char_array16(uint16_t data) +{ + const uint8_t *bytes = (const uint8_t *)(&data); + fwrite(bytes, sizeof(char), sizeof(data), fp); +} + + +static void printf_el(gpointer data, gpointer user_data) +{ + bb_entry_t *bb = (bb_entry_t *)data; + if (bb->exec) { + printf_char_array32(bb->start); + printf_char_array16(bb->size); + printf_char_array16(bb->mod_id); + } + g_free(bb); +} + +static void count_block(gpointer data, gpointer user_data) +{ + unsigned long *count = (unsigned long *) user_data; + bb_entry_t *bb = (bb_entry_t *)data; + if (bb->exec) { + *count = *count + 1; + } +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + unsigned long count = 0; + g_mutex_lock(&lock); + g_ptr_array_foreach(blocks, count_block, &count); + + /* Print function */ + printf_header(count); + g_ptr_array_foreach(blocks, printf_el, NULL); + + /* Clear */ + g_ptr_array_free(blocks, true); + + fclose(fp); + + g_mutex_unlock(&lock); +} + +static void plugin_init(void) +{ + fp = fopen(file_name, "wb"); + blocks = g_ptr_array_sized_new(128); +} + +static void vcpu_tb_exec(unsigned int cpu_index, void *udata) +{ + bb_entry_t *bb = (bb_entry_t *) udata; + + g_mutex_lock(&lock); + bb->exec = true; + g_mutex_unlock(&lock); +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + uint64_t pc = qemu_plugin_tb_vaddr(tb); + size_t n = qemu_plugin_tb_n_insns(tb); + + g_mutex_lock(&lock); + + bb_entry_t *bb = g_new0(bb_entry_t, 1); + for (int i = 0; i < n; i++) { + bb->size += qemu_plugin_insn_size(qemu_plugin_tb_get_insn(tb, i)); + } + + bb->start = pc; + bb->mod_id = 0; + bb->exec = false; + g_ptr_array_add(blocks, bb); + + g_mutex_unlock(&lock); + qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, + QEMU_PLUGIN_CB_NO_REGS, + (void *)bb); + +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + for (int i = 0; i < argc; i++) { + g_autofree char **tokens = g_strsplit(argv[i], "=", 2); + if (g_strcmp0(tokens[0], "filename") == 0) { + file_name = g_strdup(tokens[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; +} diff --git a/contrib/plugins/Makefile b/contrib/plugins/Makefile index 54ac5ccd9f..df3499f4f2 100644 --- a/contrib/plugins/Makefile +++ b/contrib/plugins/Makefile @@ -20,6 +20,7 @@ NAMES += howvec NAMES += lockstep NAMES += hwprofile NAMES += cache +NAMES += drcov SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) From patchwork Tue Oct 26 10:22:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516194 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp147563imj; Tue, 26 Oct 2021 03:36:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3QPLPack1Dme1pYx88ROlc+CFzopITB99pfEkBZjkw4oHY5LYtorDKGlkR+pULUuLa5n1 X-Received: by 2002:a9d:12d1:: with SMTP id g75mr18867504otg.301.1635244597802; Tue, 26 Oct 2021 03:36:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244597; cv=none; d=google.com; s=arc-20160816; b=G3tzKmt9cqDZXNz/vIBPAt4fhg2XUqEO6iUFcCpCMjpddThKPiGEIt2WYSIQzzs2+1 7cxEVe1IL4BchHCkbqBiMsl4j+IQn/d1HNEfATDf1lIR29W/0y1uIL1L/IZgP6JFUAuW AQTSbgIdpXHiyMINQrUVlJs5DJGxm98iTWojIj/vzpLKKmGIenKXntzKmImyVW4+klua 86sO2yXdttttL7N9lbrgYpZVmgr0yPfftmP//Ih3XhlB1KkNhduG+kTLmm8nQL0eFiBd QjLYU+36Er7UxSJQQfye0F0Iz0/AIBw4NzCpCE3/optaAIO2q/ew9CtjvDRz3WsDzW3k Hflg== 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=VUz4ckBv/GqIzKgsmaqHJwpXTQ79XI8nAJO1iVIQRSo=; b=n8hBl/R+wHU+KuVaMAQ0v3sIooo9e+zOkZJ+TOnwWiRCAhUC7RC92Wrx1EfkpTLnX5 bVOdQMSggAgm3R7Teh9502WbVhaQMRlVRGim16QuG6OmL1ZkVRyVH1aGmXU3QfPqivHd IixM+pu1nPVcWTa4cK6A4ie3uWy5AHY3MDL5VqX7hRxx0iIMVBkSv29v0GiOkg2Trta4 CorQ+h17Ato1LHbga9ddbP7e1wPXyS5sx/UVzNtLr6r6FS21bAswwFbzmVgIu7yL1yC+ WjvuUwugc/wHQ+Pksu6VRZb6oJBb+JRDSy3zvNGZP/WRY9Vo7mhAo2M8L4R2C7thHpYf J1fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="H/L+fXrO"; 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 o20si1468856oiw.6.2021.10.26.03.36.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03:36: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="H/L+fXrO"; 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]:60934 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJor-00052w-0r for patch@linaro.org; Tue, 26 Oct 2021 06:36:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJi7-0002PH-D0 for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:39 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:46865) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJi5-0004go-1B for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:39 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 83-20020a1c0456000000b0032cb02544aaso1673071wme.5 for ; Tue, 26 Oct 2021 03:29: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=VUz4ckBv/GqIzKgsmaqHJwpXTQ79XI8nAJO1iVIQRSo=; b=H/L+fXrOYjTZHjYt5DYE2zhmJTOC88xZhr1LkFTrOqR+igpEMDxYM1N/LOzx7zf1Jp xKr6h3ZtNnM/IgAlx0DURoMg8XaOnzPIcHDje+xBwoVO7p2B0/ue9uFze0gBSzIyO1JX T8WrE5heK0bOfUHD2SBbmj1g4O+Y50ThlTZcNmqWRD5Np1rXj5AJd1iUXJa4HDx5zxUu t8R8xvxNM2H9mpT0irPIWgRQSwBHI6bEsQMWy19OcvK83oaDZf+i2wFFFpKC5e3A/7BQ FJadg7p6J7QaV1NRPZxw6PiV+j92bZizDSFz9iBPZHO8BC16Cs4KNDSmPXS666/D3dxi Vt5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VUz4ckBv/GqIzKgsmaqHJwpXTQ79XI8nAJO1iVIQRSo=; b=4gA3+KknPPMsoG46jHCY3p7VKtRsH5jjrrXnl/XxI4SfL0vLCz8SGQZw4ih+20RpUx 6L3x7lhW3U8wYYPAq+dgjnmvlOAK1pU8Nx08+IgsXl0VAYD03z/MfQM3jKUZD7Ov58FU wgA9jEGK9nuATeAmwKe5PLlMOuvBt80Ld9bHKOWtM6pMngK0NoenB8W/v3UaHT1aZmlg YHvuG19f0JEm1VkITDw3ZgD5iuEoank+UlcZs0IvzKqBc/g/8hes37Yyd+CTSWRwuLbo TmXmNvrKxJg7ujffdhv2tF+UzJPJgpp8NSW0TTcRJ7JQtsLxpYFVRV40SgiNnh15rrtV sdPw== X-Gm-Message-State: AOAM53265nLC0eL4o37M6DOquP8MHOjNwPdcuahj8NF0B5Z+XTCJaHvA Y9fAtdd4rc85GTX3rRUoSEy1xUuE4h+FQw== X-Received: by 2002:a05:600c:1c88:: with SMTP id k8mr26361662wms.169.1635244175670; Tue, 26 Oct 2021 03:29:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k17sm18459965wrq.7.2021.10.26.03.29.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4BC231FFBD; Tue, 26 Oct 2021 11:22:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 27/28] tests/tcg: remove duplicate EXTRA_RUNS Date: Tue, 26 Oct 2021 11:22:33 +0100 Message-Id: <20211026102234.3961636-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" We set it bellow outside the #if leg. Signed-off-by: Alex Bennée --- tests/tcg/multiarch/Makefile.target | 2 -- 1 file changed, 2 deletions(-) -- 2.30.2 Reviewed-by: Philippe Mathieu-Daudé diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index 6ccb592aac..c0d9e638e9 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -61,8 +61,6 @@ run-gdbstub-sha1: sha1 --bin $< --test $(MULTIARCH_SRC)/gdbstub/sha1.py, \ "basic gdbstub support") -EXTRA_RUNS += run-gdbstub-sha1 - run-gdbstub-qxfer-auxv-read: sha1 $(call run-test, $@, $(GDB_SCRIPT) \ --gdb $(HAVE_GDB_BIN) \ From patchwork Tue Oct 26 10:22:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 516187 Delivered-To: patch@linaro.org Received: by 2002:ac0:c404:0:0:0:0:0 with SMTP id t4csp142635imj; Tue, 26 Oct 2021 03:30:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0etXTTwL13fz73VZrS7x6YWoE7QD28Qda/e/R0eO6lPVafIVFzt2OkNzCsrzABD/I32QK X-Received: by 2002:a9d:6ada:: with SMTP id m26mr18818458otq.373.1635244257979; Tue, 26 Oct 2021 03:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635244257; cv=none; d=google.com; s=arc-20160816; b=emsDKQfhIabAnIaqEi2/fNiZ5CZHDyA2WzCCMVgxmk8kwy14eIzjtKOrORTzWN/kgC rglP97TmAz9Ew1XOHpFBNoK7qBtmUJg2yEh9CIuui0+WMFvLunOYr/JmlINOV2/wBgSI wyc7vRNIYPEryJU0aZtHRK73UxKxNZgvzFaRAdVx19CtJTkDtGyyNV654MnGyzvSn6p4 v+lrk4iKqPuw9lrm6M9uBRkHTP3+KT4aVzJABtE59dJuQLV/3JYJ3YsBuu4gjc3iVjVx pBypvMuHKBqR8Z45fCfD2TtmRJEoy9bswJRzIhaN641mJC9gvLYxbJn6cUwWXk0sU6DY fMxg== 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=539DaXe9WhjsfyEZD4DL2StoJEh/zF/3E9mokdi44u0=; b=mEhOdyXG18cBxxWx4Sw9QPSu8JgD7NeCDU95lEdP8HwtoJsXaESHaKWMc1bPIzAYvK gIaWlz/sIhWeAWkV4EXs/H4Rkd+ODsBQKf121Fc0kq64Gkh9dEreqQGA8GaecJK55ihw gxiMuIJWQJtDA+dGy4T86kqeNHbojkTGPOsMhFQCz4FfpgDH70kK7Akdj4MdMAk9Pv/+ CkKMWYz6AmsDCAQVzh9Uojkgl4vrX5TyB/6XWpCaZE3HRZTFHKLsz65heAs92Dpb9oUW rLQECoHvG3tlF37lmV2AD0W/Jf9X9pjIAwo3tIjlwnfotFGkE/fFKW4OVGmi3r8cpsyE W6hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=wBMhY9fE; 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 c15si5065884oou.4.2021.10.26.03.30.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Oct 2021 03: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=wBMhY9fE; 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]:43858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mfJjN-0001wm-4j for patch@linaro.org; Tue, 26 Oct 2021 06:30:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mfJhx-0001sC-Jn for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:29 -0400 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]:35600) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mfJhv-0004fu-SS for qemu-devel@nongnu.org; Tue, 26 Oct 2021 06:29:29 -0400 Received: by mail-lj1-x22c.google.com with SMTP id o26so19022818ljj.2 for ; Tue, 26 Oct 2021 03:29: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=539DaXe9WhjsfyEZD4DL2StoJEh/zF/3E9mokdi44u0=; b=wBMhY9fEvuVi8g6YCAMcagne8/QVWu1UmuuMdbLTNftBzT/Z0j0SkW5u071WdpnW8a 0OIhwpu3zHYOp+1iIY3l7i4bvCPLS1uGkRXcLdg9+K+KobweF+1WPHd4KMwmubIGM9tU gBxHHHew9xdJCMqZtW4aY6M6KVSqVxB/xlWykbGN6QbBjcSAj6W8YzPiXl92pQnOycrT 8E7z7+i3BzLoGakkkjvop1GQWVLpLkF8vMm5tr/fUY3F7Gl23nA+4OTzUdBUM4tJ7O2u k7GowkhQjf1k3pFlwqOkFqKjTotg5nbtpOJDp0rWj4LmYHDBnDfr/dY6tcxn3U4oLPjs 4ZWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=539DaXe9WhjsfyEZD4DL2StoJEh/zF/3E9mokdi44u0=; b=S5eyaK52naoyR6nkGWk06kvZLY9WAcdITW98/qbJUR0bHOB40fTHnqkZzNIj78g0ub 3ngBr4G9hVP4sXPS0m0USQT5ceRvZI8d7TDlChmmWc4swGrvwyXi9kkIfKBNMvYHWmkF TRIFnSJnOQGAqy93PFlMZo1U4VMDSp8ddw41QmcR3+DD8mVIeGyzV2OXaQCPBjF5U/iW ITKDLXu2/c0z8zwJRcH+JRHR54lX6AzeqPbfmhSkos4pDwrKk+n5fQmf0wAE27TZ8GOS AFnljjBgXyxR6JoJgyP7ErFU5a2aSMzFvIBSuNR+cOMK8xrRB36PHNpGkbmhxWdkzvno z5OQ== X-Gm-Message-State: AOAM530YxcEjxkqlkqDWxRA9RUid7it0sfJiNAelKGExxz85f3SHwT7c lqYjXR/ledJHk2rZUEYVU2XN9A== X-Received: by 2002:a2e:9f15:: with SMTP id u21mr24840169ljk.312.1635244166008; Tue, 26 Oct 2021 03:29:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k39sm1140292lfv.284.2021.10.26.03.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 03:29:24 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 67D4D1FFBE; Tue, 26 Oct 2021 11:22:37 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 28/28] gdbstub: Switch to the thread receiving a signal Date: Tue, 26 Oct 2021 11:22:34 +0100 Message-Id: <20211026102234.3961636-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211026102234.3961636-1-alex.bennee@linaro.org> References: <20211026102234.3961636-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::22c; envelope-from=alex.bennee@linaro.org; helo=mail-lj1-x22c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, minyihh@uci.edu, berrange@redhat.com, kuhn.chenqun@huawei.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , f4bug@amsat.org, robhenry@microsoft.com, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, Pavel Labath , stefanha@redhat.com, crosa@redhat.com, pbonzini@redhat.com, ma.mandourr@gmail.com, =?utf-8?q?Alex_Benn=C3=A9?= =?utf-8?q?e?= , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Pavel Labath Respond with Txxthread:yyyy; instead of a plain Sxx to indicate which thread received the signal. Otherwise, the debugger will associate it with the main one. Also automatically select this thread, as that is what gdb expects. Signed-off-by: Pavel Labath Message-Id: <20211019174953.36560-1-pavel@labath.sk> Signed-off-by: Alex Bennée --- gdbstub.c | 8 ++- tests/tcg/multiarch/Makefile.target | 10 +++- .../gdbstub/test-thread-breakpoint.py | 60 +++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py -- 2.30.2 Reviewed-by: Richard Henderson diff --git a/gdbstub.c b/gdbstub.c index 36b85aa50e..23baaef40e 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -3138,8 +3138,12 @@ gdb_handlesig(CPUState *cpu, int sig) tb_flush(cpu); if (sig != 0) { - snprintf(buf, sizeof(buf), "S%02x", target_signal_to_gdb(sig)); - put_packet(buf); + gdb_set_stop_cpu(cpu); + g_string_printf(gdbserver_state.str_buf, + "T%02xthread:", target_signal_to_gdb(sig)); + gdb_append_thread_id(cpu, gdbserver_state.str_buf); + g_string_append_c(gdbserver_state.str_buf, ';'); + put_strbuf(); } /* put_packet() might have detected that the peer terminated the connection. */ diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index c0d9e638e9..b962ed8236 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -68,11 +68,19 @@ run-gdbstub-qxfer-auxv-read: sha1 --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-qxfer-auxv-read.py, \ "basic gdbstub qXfer:auxv:read support") +run-gdbstub-thread-breakpoint: testthread + $(call run-test, $@, $(GDB_SCRIPT) \ + --gdb $(HAVE_GDB_BIN) \ + --qemu $(QEMU) --qargs "$(QEMU_OPTS)" \ + --bin $< --test $(MULTIARCH_SRC)/gdbstub/test-thread-breakpoint.py, \ + "hitting a breakpoint on non-main thread") + else run-gdbstub-%: $(call skip-test, "gdbstub test $*", "need working gdb") endif -EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read +EXTRA_RUNS += run-gdbstub-sha1 run-gdbstub-qxfer-auxv-read \ + run-gdbstub-thread-breakpoint # ARM Compatible Semi Hosting Tests # diff --git a/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py new file mode 100644 index 0000000000..798d508bc7 --- /dev/null +++ b/tests/tcg/multiarch/gdbstub/test-thread-breakpoint.py @@ -0,0 +1,60 @@ +from __future__ import print_function +# +# Test auxiliary vector is loaded via gdbstub +# +# This is launched via tests/guest-debug/run-test.py +# + +import gdb +import sys + +failcount = 0 + +def report(cond, msg): + "Report success/fail of test" + if cond: + print ("PASS: %s" % (msg)) + else: + print ("FAIL: %s" % (msg)) + global failcount + failcount += 1 + +def run_test(): + "Run through the tests one by one" + + sym, ok = gdb.lookup_symbol("thread1_func") + gdb.execute("b thread1_func") + gdb.execute("c") + + frame = gdb.selected_frame() + report(str(frame.function()) == "thread1_func", "break @ %s"%frame) + +# +# This runs as the script it sourced (via -x, via run-test.py) +# +try: + inferior = gdb.selected_inferior() + arch = inferior.architecture() + print("ATTACHED: %s" % arch.name()) +except (gdb.error, AttributeError): + print("SKIPPING (not connected)", file=sys.stderr) + exit(0) + +if gdb.parse_and_eval('$pc') == 0: + print("SKIP: PC not set") + exit(0) + +try: + # These are not very useful in scripts + gdb.execute("set pagination off") + gdb.execute("set confirm off") + + # Run the actual tests + run_test() +except (gdb.error): + print ("GDB Exception: %s" % (sys.exc_info()[0])) + failcount += 1 + pass + +print("All tests complete: %d failures" % failcount) +exit(failcount)