From patchwork Mon Jul 13 20:04:05 2020 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: 235485 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3136513ilg; Mon, 13 Jul 2020 13:04:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaD/SX0qRING9go5t35nluApOnYLcPWfS7062/zqFsHuzlgCmeytIj7F+RPhfww40BTIYc X-Received: by 2002:a25:f20d:: with SMTP id i13mr2610404ybe.366.1594670678542; Mon, 13 Jul 2020 13:04:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670678; cv=none; d=google.com; s=arc-20160816; b=T6uVyqt7BtwTL+Zx8Rt0VlkhBPqAU3sm05wfSUX5+7vF6+lrb1/vmD2NmUO0Cq1wWN dMaKM+J/f3m8K2HcjFKfnOPTKp971bsujmHHr8eZW2Tr6Gapg8ToCrNaCGYBEx6hGHnn FfErtfXmX3MJoiZq9irput33RwDFR9dnn/ZUrbia9p63xVzaOrjJgp384vvEYfe3vSwb TSeS8TlzF0EAPc83o4NSSKnpgQCFNdUPmsKYvv/iqKlTOcjJy8MENj/JKOgz2hxUCQIU hBqkcq8eRgxmH1A/QNUc4LNDTZtpyQ9Hl3LkRik3Ogou+wILTAeXwNjsoAzjI4RMP9mX dlsg== 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=0GDUfAsY7oBRDehZI0s+LxQK3zPfLdSNXvvRvB9ltNY=; b=hrlX7QVwlSISRt05atByMDCeOTShy4HOOKXCMeAnv880Wr0n0SLss8MJgAf9KtrG8C VMiHtS7jvz9fEsY9CmMHw38na3v+7vwS5CqG8tQEWrUl9X40No64weH0JcRywfoQZRG6 jUMu6v2jmqEY6I3vpD+MoPbuFRkF+2vQpBfu25rW21I0IFbUQ8xv7EKdAA6vYcogFH5L vHCvv69P+OhkAowpfqpd57OAfuxL4bXnPEBY7Eolw4NOIgKBoJgXNj+ma3xtnBmpPVM3 eaiA94+UzNukV0AqdoX/ErVrSp8inh+Y5y4GeTJrfH/hGMJuh/IZMtNraOa+GEP4z2kj rYLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=yw5nL6g3; 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 p16si15029663yba.199.2020.07.13.13.04.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:04:38 -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=yw5nL6g3; 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]:37380 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4go-00080z-0M for patch@linaro.org; Mon, 13 Jul 2020 16:04:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4ga-0007wO-JI for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:24 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:54760) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gY-0006GW-Pk for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:24 -0400 Received: by mail-wm1-x343.google.com with SMTP id o8so1127115wmh.4 for ; Mon, 13 Jul 2020 13:04: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=0GDUfAsY7oBRDehZI0s+LxQK3zPfLdSNXvvRvB9ltNY=; b=yw5nL6g3+qlDT1vGZe3O7nVEHuN/ORByMYZCWmIxWlV5hRsbZdkpgasJF+EHpfT/U3 eFZ7fOM3c+cQMGQly6hlnOL41wG9Zh3u5LH/e5PqJma5RxhBuq5UClbPl8Rpxuu9akMO miavOMoDFULXNlHf+y35Msxy7oQQt2WtMDyArCW6l1e8bm8dUSvw26pXFOc6B53slPZd dcr5c4jytxONTFdDd4y+TVWWpJi66HcBXgwIddm7K5yqEBxv4I+xuH8I1kIMOrJb49ud 75+cQJ+vr6iXyeqiwU64stFveQ8q5rKK5hiM6caYy2gos9lhmblwS3EXJyZvh8U2U0av UcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0GDUfAsY7oBRDehZI0s+LxQK3zPfLdSNXvvRvB9ltNY=; b=RFP8FwTG2AE1cKdt67caE8lgOFYD1Ko5qu/AUuNNhrRJ2oVP860sFVGDWvwvinzXGn dZzGO5+oYU6ZqWhHqAy6iHwg9SdFf5ixGv18mNqLQNJ2d8udYLqnAkWHb/oBrmWmN8aH NfyJzUHBI5ZHLlHN306cgCcEVy2fZODIBmFHx0bgEIAtgO8YUFtxN88KCgWj91EHQDQe XypsqoL9t5JkAODCL/y2C10DhexVgadXopAme1qAiVZkCQ+kiWcB3P32rxSgaBUPr7zk nGF9Ocp1qWYFZhduFi/9TXTRW1hOHktnlPYd4cmJXgi8/yxpHOQu0fdhghaJnmCD23aO pq1Q== X-Gm-Message-State: AOAM533SEIOeXlUzjvQCiULA+YoLCe3Hm01RuvXUp1d+rb5GayHFQ6j0 KDiy1vc8SFHwlkFwxuzcqctsUQ== X-Received: by 2002:a1c:e18a:: with SMTP id y132mr1017817wmg.27.1594670661440; Mon, 13 Jul 2020 13:04:21 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 133sm1010756wme.5.2020.07.13.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AD1E61FF87; Mon, 13 Jul 2020 21:04:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 01/11] configure: remove all dependencies on a (re)configure Date: Mon, 13 Jul 2020 21:04:05 +0100 Message-Id: <20200713200415.26214-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::343; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" The previous code was brittle and missed cases such as the mipn32 variants which for some reason has the 64 bit syscalls. This leads to a number of binary targets having deps lines like: all.clang-sanitizer/mipsn32el-linux-user/linux-user/signal.d 140: /home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h \ 455:/home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h: all.clang-sanitizer/mipsn32el-linux-user/linux-user/syscall.d 146: /home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h \ 485:/home/alex/lsrc/qemu.git/linux-user/mips64/syscall_nr.h: which in turn would trigger the re-generation of syscall_nr.h in the source tree (thanks to generic %/syscall_nr.h rules). The previous code attempts to clean it out but misses edge cases but fails. After spending a day trying to understand how this was happening I'm unconvinced that there are not other such breakages possible with this "caching". As we add more auto-generated code to the build it is likely to trip up again. Apply a hammer to the problem. Fixes: 91e5998f18 (which fixes 5f29856b852d and 4d6a835dea47) Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- configure | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 2.20.1 Reviewed-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index bc3b9ad931..e1de2f5b24 100755 --- a/configure +++ b/configure @@ -1955,23 +1955,20 @@ EOF exit 0 fi -# Remove old dependency files to make sure that they get properly regenerated -rm -f */config-devices.mak.d - # Remove syscall_nr.h to be sure they will be regenerated in the build # directory, not in the source directory for arch in alpha hppa m68k xtensa sh4 microblaze arm ppc s390x sparc sparc64 \ i386 x86_64 mips mips64 ; do # remove the file if it has been generated in the source directory rm -f "${source_path}/linux-user/${arch}/syscall_nr.h" - # remove the dependency files - for target in ${arch}*-linux-user ; do - test -d "${target}" && find "${target}" -type f -name "*.d" \ - -exec grep -q "${source_path}/linux-user/${arch}/syscall_nr.h" {} \; \ - -print | while read file ; do rm "${file}" "${file%.d}.o" ; done - done done +# Clean out all old dependency files. As more files are generated we +# run the risk of old dependencies triggering generation in the wrong +# places. Previous brittle attempts to be surgical tend to miss edge +# cases leading to wasted time and much confusion. +find -type f -name "*.d" -exec rm -f {} \; + if test -z "$python" then error_exit "Python not found. Use --python=/path/to/python" From patchwork Mon Jul 13 20:04:06 2020 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: 235490 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3137855ilg; Mon, 13 Jul 2020 13:06:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLy84lVS29bT1wt9N0F7m1nWKSuYYeEZ+WJCxPsKoAonsynm08I8K4Yozh83kyfwJX7aO9 X-Received: by 2002:a25:bd4d:: with SMTP id p13mr2697417ybm.139.1594670793016; Mon, 13 Jul 2020 13:06:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670793; cv=none; d=google.com; s=arc-20160816; b=HMFPc9i9RRUTwwaVe59CYJVmw4QdU80DNIFLmFV5HJQ8b9IkAppwdJOToRjo3cDJQw H/b/aBpBcnDxAHbdAFFUSyUxLXaVfwPWcpCRT8knDdBgYABGjjWtlJHEkxS5eyxlzb0i /TlzkW/OoId8+lfgBR93SfZC0ekn6ibxR4HXKh34JE57vcvhj6fzl0aftxkVD1hSJuBU yWYfDsD4wVO1BCpoGEgmmq6ASsvnxWA20wY/3IdWhGi/zwEHOfhQsTYmISQHQAl8/Rs1 pyTfkyEk7zSPfJJx8vR/OZzq1BOFQD0Ir+5Wn1xv2AZ4dax0NM4sNg1HXcz2GVVeD/5O dFFw== 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=IfI68+hGedk3QHICFsR2P3eF65wa15xU34V8+iox5Mc=; b=GDT+XJrvAytQc30PZbTFNNL6+AG9XnDYoJCvRRTqOHO0pf5FFmACVvvRRTaEvyUnd7 Q85BnbGY3sI5CafTclfYciHT5gZInWArHDXWYIElIvkVaGXcYEo8gkmJoSrKzbAMtxV9 U5jEJkUX3jFiQ8lrACbUiYfHUVFC5yjjfng9diOl9gKVKCpNrvhZskoRt1ekRMfW7Hrq yqa+53hTuh4phzQyKYlxdomdsKeyPhqxZS2D5MJ4Ut56/bLZIhmXJ6Ubr3Nzbc0B1NSY 19pVvUiA3EVyfdV7bmjtWIExqS2lgNueYysjmnLPXYAPlAEM9bKWCpyCYUBOnDvANBmW pf1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Fk7BignJ; 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 186si15143736ybb.269.2020.07.13.13.06.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:06: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=Fk7BignJ; 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]:45268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4ie-0002qT-GS for patch@linaro.org; Mon, 13 Jul 2020 16:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59404) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gZ-0007v8-OZ for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:23 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:52614) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gX-0006GI-Vl for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:23 -0400 Received: by mail-wm1-x32e.google.com with SMTP id q15so1134726wmj.2 for ; Mon, 13 Jul 2020 13:04: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=IfI68+hGedk3QHICFsR2P3eF65wa15xU34V8+iox5Mc=; b=Fk7BignJC4e2MO5V34Np7ijOb2FvQ4tc3ItjokhW1S+X1rbUwRrf3sijfTT0Ta4IDH JJRGXrI90GE46IdXyWc+AiCfd/efrULGeAaRqk8Tkqxkcznq2t4u/ng/CRFMd5tpZmf/ sQk3YeEKaDmYzX7bOd+BO2dB7mVGWQg49nQVoQhKKwyiH7bHyyrEaxODfD2JWWg+6mFT 2zz3jgI2mForK6vK33+b8T/hgWwm+dN3I74Jduqlf168FOwGzQqBxtU4WUBRDcPITkow YnKDI/C1d3TxAvqSKqvTCTOHKiJ+Y90CO03Tof9pgP0hLtWrrkqaCU+oqyKEiKu2ApqY fZBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IfI68+hGedk3QHICFsR2P3eF65wa15xU34V8+iox5Mc=; b=O6YOxmtfoRcU43POlstb3MoWS8HHSbJPUvRJE3+B+6ufQbJHq8lfyjZYrea6lb0Ead rroSfQrno0jClFp1nmJwsq8MTIr9XfpsZHgfRlFiZgcWTm3fRdXmK8Ull5Z/x0N9Vzd/ LWENxNCcHBD5q766jmg6tQ8s/casie06GZRvR4fuQEWmJZYCjndWblxrB5UyisgPXVnj Hrm1UW1aOqdG2kgMsJwRyZS9I+6fKR0C1eaekdLP6UYMcztI6LmqEdAdtA44xpBEL9Y5 UZAB5lLqCPyXXJ3Lfe7+ZEi352NkQsdk/qGjirnTITEh8FBfTVkIXx+Xbo99HT390fpL rHtA== X-Gm-Message-State: AOAM533b1oQnvMMgmB9Yuzh29sXmpOnY4mXYH9PPEpdZ1UqdcPdreZqN 4MzI2AyILOrmPYyppFCRb7YqHQ== X-Received: by 2002:a1c:1bc6:: with SMTP id b189mr1005398wmb.166.1594670660274; Mon, 13 Jul 2020 13:04:20 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id n125sm887378wme.30.2020.07.13.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C2B7D1FF8C; Mon, 13 Jul 2020 21:04:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 02/11] tests/docker: Remove the libssh workaround from the ubuntu 20.04 image Date: Mon, 13 Jul 2020 21:04:06 +0100 Message-Id: <20200713200415.26214-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-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-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=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 , berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Thomas Huth The libssh problem only exists in Ubuntu 18.04 - we can enable it in 20.04 again. Signed-off-by: Thomas Huth Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20200713185237.9419-1-thuth@redhat.com> --- tests/docker/dockerfiles/ubuntu2004.docker | 3 --- 1 file changed, 3 deletions(-) -- 2.20.1 diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker index f7aac840bf..8d10934a2a 100644 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -65,9 +65,6 @@ RUN apt-get update && \ RUN dpkg -l $PACKAGES | sort > /packages.txt ENV FEATURES clang tsan pyyaml sdl2 -# https://bugs.launchpad.net/qemu/+bug/1838763 -ENV QEMU_CONFIGURE_OPTS --disable-libssh - # Apply patch https://reviews.llvm.org/D75820 # This is required for TSan in clang-10 to compile with QEMU. RUN sed -i 's/^const/static const/g' /usr/lib/llvm-10/lib/clang/10.0.0/include/sanitizer/tsan_interface.h From patchwork Mon Jul 13 20:04:07 2020 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: 235492 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3138719ilg; Mon, 13 Jul 2020 13:07:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvdaJmCuGtQZVuBO6GAnRj+NBEOIcXliQysd5+HMfXUP0E2MnH+ABmvG6OGu7MuEBAlbjQ X-Received: by 2002:a25:cc12:: with SMTP id l18mr2488546ybf.480.1594670876417; Mon, 13 Jul 2020 13:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670876; cv=none; d=google.com; s=arc-20160816; b=M+UpbktOBye9K4L2f5N3Fx3FlTLHVgrEOKNYDQeiMd4nhIM3R/jkqx+PG4LLdQwzOK hPzBajHIDLq5OpNAmKuijFQFOWvRfT4cdBVt7z0qB7Db0nkKtdxiw34Zb52U5BZs5eiD ZrjcEbEkATGB8nrr8YC6yU+xOODJsFCsUOotKNa5KXocs8gTDQVs+1u3OiquJDBU8lTB ryNzHD3Iupg8vxpEcyls//q9YMLnYVQqg/XEO0Az9ecjvtOC+pEle4Zr5w//KYPd7vrL iKFrQ4yllww7kCPeZ7CWNtbYOwxl0xnt5+047ot6Fyrv4+VQ3l32OAP7PPBDXHMPRe4L zT+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=zYmy6YbAdYCCn5X7N7JnznTD44q8kk8nDaLydetiUF4=; b=q/cnR6kT8xkW7VNNURsnGz/kViLXEn8rNqAY/0U9wVo79oV8Aqj1Hsyp9c79EbrANi i8OUuB06JoRZPIW1SjojQo+yApj+X+pd8mn9HxvK5I9RmwhiGBPRBuSX00dENs+yZpew OdEwvADhtV8ZdjaLh5XML0C8dN7Rl5zxGKvttN0+qJIbhik6BNCZQY/5Ok/XJH2/vJ20 7kn8AU/U8qXHC2zHWxRs8ASQdR7oHI8mkZUqv4qpEj9oWreZoMYVU+g9Yehlotb1cMEc 5Afl/c41y3GVrdOSuEyETs/PShHS9yj1ka6JGNo1hrQsm5TdU8PTp+if/h1S+XXyTWU8 BACQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=iRoIvctJ; 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 i3si15923021ybq.145.2020.07.13.13.07.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:07: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=iRoIvctJ; 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]:51836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4jz-0005RB-Tv for patch@linaro.org; Mon, 13 Jul 2020 16:07:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gb-0007zx-Qe for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:25 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:50452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4ga-0006Gg-6W for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:25 -0400 Received: by mail-wm1-x344.google.com with SMTP id l17so1153429wmj.0 for ; Mon, 13 Jul 2020 13:04: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=zYmy6YbAdYCCn5X7N7JnznTD44q8kk8nDaLydetiUF4=; b=iRoIvctJRweIWyuMWsjAtE8+JehMQIOHYYgkXVVIUgeOajqBilO/1mv4VT3kLduKqH Rdg5OhIxUXu7LbK67T5qfGAPbc2BUbtDrNnS0g5Axfio4PVe3bsdDRes7jHLLZzXXm/z iIwMbORvDonXZlZqGuI3boDjSOFy/TfKyTFhpeEjqXOBFm3V4aoU4EvfHqGD2/4uCnNu i53jSVpmZRtkTVQEqACbZGjXNMoO0NUCDuV2sfHuMjOcGd6UK+WfBAudmxK6PM1CzSE5 RMC3OgP6rcORKhr3QL0sia9O8g+pg9ih25NnHtU4zlCEir5cR3mcs2+k+6c+OgHOqhE+ sDHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zYmy6YbAdYCCn5X7N7JnznTD44q8kk8nDaLydetiUF4=; b=HNqmLK5dHVdgpgJtIVE1zXsqWdj3j/UAtVUqro/3EibFBXt8iH1Gjv1i41JCGd0/cc 0JQvlTLt2W6FnXvpzW+2gPcC7FeRqL9W4cgTUo6bndBOzUo4xQr2DyK2FrM+Oaa6bs0i KAzgN+npg6dzn6DCU+A2i0HfblM4ZpZdpspGjkMRyM6xVRhDYgsUn+r3sDY7InccoOzH heCOPWA5aOKi7JYrCvPTlXt9/swTj9sL4O3a9SXzlHuM7miC3vVuOeFGs1rrzRE9WtII gFnV+0Ro8eOrwR562iczceVelI5foC3mcZqItTFTqz/rDIoSXFqvjxIrczNluOULO4rs akTA== X-Gm-Message-State: AOAM5334BpKciG5PG37g1NI5H919uEpnFBDadrtn0j3xmfijB8IWH+PM oBD8ZcOX21rQf0Q8b+/44/ZBQw== X-Received: by 2002:a1c:a557:: with SMTP id o84mr1071156wme.42.1594670662723; Mon, 13 Jul 2020 13:04:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id w16sm30261370wrg.95.2020.07.13.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D86141FF8F; Mon, 13 Jul 2020 21:04:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 03/11] docker.py: fix fetching of FROM layers Date: Mon, 13 Jul 2020 21:04:07 +0100 Message-Id: <20200713200415.26214-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This worked on a system that was already bootstrapped because the stage 2 images already existed even if they wouldn't be used. What we should have pulled down was the FROM line containers first because building on gitlab doesn't have the advantage of using our build system to build the pre-requisite bits. We still pull the image we want to build just in case we can use the cached data. Signed-off-by: Alex Bennée Reviewed-by: Daniel P. Berrangé Tested-by: Philippe Mathieu-Daudé --- tests/docker/docker.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) -- 2.20.1 diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 2d67bbd15a..c9f20d8d09 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -306,14 +306,18 @@ class Docker(object): checksum = _text_checksum(_dockerfile_preprocess(dockerfile)) if registry is not None: - # see if we can fetch a cache copy, may fail... - pull_args = ["pull", "%s/%s" % (registry, tag)] - if self._do(pull_args, quiet=quiet) == 0: + sources = re.findall("FROM qemu\/(.*)", dockerfile) + # Fetch any cache layers we can, may fail + for s in sources: + pull_args = ["pull", "%s/qemu/%s" % (registry, s)] + if self._do(pull_args, quiet=quiet) != 0: + registry = None + break + # Make substitutions + if registry is not None: dockerfile = dockerfile.replace("FROM qemu/", "FROM %s/qemu/" % (registry)) - else: - registry = None tmp_df = tempfile.NamedTemporaryFile(mode="w+t", encoding='utf-8', @@ -339,6 +343,8 @@ class Docker(object): build_args += ["--build-arg", "BUILDKIT_INLINE_CACHE=1"] if registry is not None: + pull_args = ["pull", "%s/%s" % (registry, tag)] + self._do(pull_args, quiet=quiet) cache = "%s/%s" % (registry, tag) build_args += ["--cache-from", cache] build_args += argv From patchwork Mon Jul 13 20:04:08 2020 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: 235488 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3136832ilg; Mon, 13 Jul 2020 13:05:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGrrVbJSfi3dYHJWZ5zU+PMUcz/LxXFHgsyGpeVUp3Rma0icTu83TVN5nWHQVWT1Wp/0Iz X-Received: by 2002:a5b:301:: with SMTP id j1mr2575031ybp.281.1594670703047; Mon, 13 Jul 2020 13:05:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670703; cv=none; d=google.com; s=arc-20160816; b=HZxK7ynFBEu6ON7SlkpyNPk9OVulinX3dLlTz/ppcQQ2M6Ps3O9J1mIeWaq0nX7zqr Ov+ZjhojBVWY/kNtoBaacuFWe+TbvLkako37N1gdBmU4jxbWNlBEh5tR/iYCC9iSzXx5 7BTNd7jBZ9MXgiFX75AzZPzq0LjYJm+rRsJKqGQiiwcdk+HhqOSue0Oy7pjw4Ek6LgEf LPV4d/ZF8hdUjguYwTqlE2JsVlpRt5qnb0Pii/nLAB2LaskGdZf7gi8sBZI+X2GjwI4b fw7gpfROav6wxSZniVHbJLMYWYL6Q4zN4O5r4rM7KSUqsWNlwnKMUqIh2xabIw4+nw0m G17A== 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=iJReQOIYVR+hDlxB+L3VcS6ZiNXB7LvJkcVb9PUtdRA=; b=mfkQyTbgK2dVvCCuOLlAiXDgSVG7YcWz2Y0nZxrWY7bhmywmsP8ad4TGzQzFCmQlOw +ATKE90deEa0Ran8kkIN5h2BvZkvagQl9DPic/uZNU+8zbASq6kZbyQ3DtEXypK/yDo6 TIQ6MzwPrLON1if3SfqVJkfajgy74rBL4RLIiOtnOl+G+wG0CJMqfCugPiXhjqgdDG3C pvFRm5KHElM6bIN0MEL2iAxHTUC7pFfv8JdvXtFzC3PAp/YtsNA3eoLTHfxja5p0VImW b586NcDvMHGD7ShOYONi5mlTI+x5iBgNol92gpSVXL6T+aGZsnoh7qBDoC6j79hsRqWt gFuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=egGZei3p; 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 66si12894555ybb.352.2020.07.13.13.05.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:05: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=egGZei3p; 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]:37234 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4hC-0007vL-H8 for patch@linaro.org; Mon, 13 Jul 2020 16:05:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gY-0007uP-Cw for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:22 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:40987) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gW-0006G5-MA for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:22 -0400 Received: by mail-wr1-x444.google.com with SMTP id z15so18130872wrl.8 for ; Mon, 13 Jul 2020 13:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=iJReQOIYVR+hDlxB+L3VcS6ZiNXB7LvJkcVb9PUtdRA=; b=egGZei3pgMwO3u2LoCla+Sc+Qr4psViwJ6QQ5M+pGiBhZjK5OmcgmK4l+Gdzxikwm1 r5hdDPXotD9BVIXVtclv/ukGs4K/78CISsJBh6FU93L+T0MMoECrmHqAuzwb/3lCBwyv 14Hy0xk1GfAD6PVjK3OYr8FpsBvVxwRUTeUCmsrLR38rgaCZCI9iR1VcJFM6d7F/O5Uh r4HS06oTJHTnbVaZq6RsMrpNzxz7ZSA8d7KPCCodTGqqaJaSy75qTnSGILeKHcRhf895 tTGPUGymuEC1kP7ZTfx2VIHN7HT/ceBzccSau531exREEN/ktk0mnQh07Fbn8JbCkj6F CCSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iJReQOIYVR+hDlxB+L3VcS6ZiNXB7LvJkcVb9PUtdRA=; b=KzcK4OE2JC9g4RpbiMWGtB21930eiM/qmBULXnhBL5RgRPKi+03ElRMUTwevo2L4ZB e0u/mtbsPI0BnUtNltpUZXl1e7HYK4HjeVy/Akb+7PBHvBjVo2MCZyFdN2Fomj+m+IF7 Oz6Ge++pvMk/8MZitai4fb7O4TdkZwfXrXzc0Xelwd+x1/5+dBC7MhvRKSyeyH0JoV3i 0fKF3cHTIfKW0ucW7d8fIT4fQXz9slUMeZ2GXSsDNcDWLJltZo/AToxugH0Vdpkzctmy tlm2I4t6b6JJXXaY7RnKhXlQJvBzcXVA8B2vB8DWutV9ve2UCAbzTOC/AY0feNYvGekH izwQ== X-Gm-Message-State: AOAM531aY5E7eHOnNcuJuIF/Q/lCRcgscuSxCxKbQrp7fKOPtKMydI31 D593YpUD6kOswzOB7u+3yb02gg== X-Received: by 2002:a05:6000:11cc:: with SMTP id i12mr1193551wrx.224.1594670659382; Mon, 13 Jul 2020 13:04:19 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g13sm26056579wro.84.2020.07.13.13.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:16 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EEDC81FF90; Mon, 13 Jul 2020 21:04:15 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 04/11] fpu/softfloat: fix up float16 nan recognition Date: Mon, 13 Jul 2020 21:04:08 +0100 Message-Id: <20200713200415.26214-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, Peter Maydell , berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn?= =?utf-8?b?w6ll?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, LIU Zhiwei , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: LIU Zhiwei Signed-off-by: LIU Zhiwei Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20200712234521.3972-2-zhiwei_liu@c-sky.com> --- fpu/softfloat-specialize.inc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/fpu/softfloat-specialize.inc.c b/fpu/softfloat-specialize.inc.c index 44f5b661f8..034d18199c 100644 --- a/fpu/softfloat-specialize.inc.c +++ b/fpu/softfloat-specialize.inc.c @@ -254,7 +254,7 @@ bool float16_is_quiet_nan(float16 a_, float_status *status) if (snan_bit_is_one(status)) { return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF); } else { - return ((a & ~0x8000) >= 0x7C80); + return ((a >> 9) & 0x3F) == 0x3F; } #endif } @@ -271,7 +271,7 @@ bool float16_is_signaling_nan(float16 a_, float_status *status) #else uint16_t a = float16_val(a_); if (snan_bit_is_one(status)) { - return ((a & ~0x8000) >= 0x7C80); + return ((a >> 9) & 0x3F) == 0x3F; } else { return (((a >> 9) & 0x3F) == 0x3E) && (a & 0x1FF); } From patchwork Mon Jul 13 20:04:09 2020 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: 235493 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3138767ilg; Mon, 13 Jul 2020 13:08:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSithAZ1MnvsYNAu1MKw0GelrPlcPkO2dnixNC63qurne8V+GAzXeIkPsKeMfbuGUEEEYp X-Received: by 2002:a25:c8a:: with SMTP id 132mr2910063ybm.227.1594670880252; Mon, 13 Jul 2020 13:08:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670880; cv=none; d=google.com; s=arc-20160816; b=RrxHzy5AH4gPDjkM5wQJb3U2k9RJL8I6c1/M3xuQln8GxqrY1re6Nlu/1qi8+qbwGP huFEb/3GdBwA9KCDQrpG0nUliokAXofcDH0LafnzGZuQlA2/NaUr2Pxara5pdvYnJM79 eol8BxqABzzMmiKaHUv0TvOjUBrpMesMqt7BYUp5P8jTswjkOqXVsJmy/BXY9sUQNoyO QO7UbtvRtMfaXup4NoXcv5PIW7iVhyRW2scDZMPYmaj716iziisXh5BozKPIlR8Ukd/E F8FBt88lO/zlfw3gUYZb/h3/rIsGtgVzBc0PYrtT8/jJi/m0fq3avxmY1Wq4mTTxtuD+ d60g== 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=qFhIz7yTIzhv4ZECtrkYR3FRhbXI50/mJD1JravnOmY=; b=LUG9TW0xWr7GihlXY3o5E+1yFi7oGi9d0uDLp0snu6FEcMBQ6vsXDmEl0UmIppYsvc WdIwxTXOwmzgPVGBHnDhLE+Da5T6ClIbG9baC6yx6/n2VBm42iCa4jZIBDvBwwyVkK8h f1vZqEx86Qd5BYNGmwXLa5IW/u8738WELW/HGakQbWy9dp5LulMsOXcpSWmKG0QkpshG 6JfJrT7uVWWA/NLlWY0BBTLWO/rirqKpA10kaVHTdyQo6oKaUAwzRXMHRASQXrODsTAO yY0gj48YzayEUR416AJY0lTMguoJrkfaXb/JRkeLHJH/HHT6Zla+bRwmwQeUsttRlJwt Nxaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="cKldk/6O"; 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 w14si20468899ybt.100.2020.07.13.13.08.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:08:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="cKldk/6O"; 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]:52114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4k3-0005Xf-NA for patch@linaro.org; Mon, 13 Jul 2020 16:07:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4ge-000879-Va for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:29 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:37542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gd-0006IX-8A for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:28 -0400 Received: by mail-wm1-x32a.google.com with SMTP id o2so1076464wmh.2 for ; Mon, 13 Jul 2020 13:04:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qFhIz7yTIzhv4ZECtrkYR3FRhbXI50/mJD1JravnOmY=; b=cKldk/6OJ9BpdVjh3uNLWqHfBSd6Niir92rdbxswNP6nDmR9QnWrzBg9GDexEHeGbp cuwBOZN4l9ZDGb3IVGDYL/DQ/1iLT2/4JF71A4Dlno12IOXOO5E2XiNZWLCSw8f5ba68 lN1EtjT25fdp1Sahr+Sdwl/Igx+0hYbZ8bxxj7OQhB+zPNdzyjzRMA2nLBVgiJsqfq+b SQS2Rfc1kEOyHFQsGhHyhIOWH872mQD8sZnaVhraomgGYlh1AJ6MdHmf960SeLhQVIVF 399lbJ41szLAMILnEI+scbxvptUXbp//E35HmT+7TFXymW4vb9uMOD+7Slno7gf5RGhE xZFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qFhIz7yTIzhv4ZECtrkYR3FRhbXI50/mJD1JravnOmY=; b=RKeOyAmNoTgUvPfTvPcjlsoOlVbZhpmHa8eeY9kGo0WcIK1fMaq8ZSbBx/SAKAVT2p 3NdInwXfFA5fFsNsKri4en9yAMtZSH0sxyI2hpc4XceJDd8kSehv+lQcLLBu7JHFgUzt Lj1TdKChc/xVOybfXDt6T35sN/v0+CxMCHft1ixlJ8OCXQ+x+QX/jCqKIy0tRTsTuyy9 uDjj4KEmnc1EQF/cAtCwx3hWeNoGrzp+fbur38he8DCzn62cGV9OcLq9R8dbD7+pgus9 xfr/nVoIG7sjit/y5QihaC0TCys8LDio9Ldr8/xN59F2IQzVNR1LcLo/YQatcHLUm4BR mC0w== X-Gm-Message-State: AOAM532s9IcQx5weRzBrqhu3KsTcXudXHmoCcbYJnadHrBREocIcKkw0 xe4ePEGIxSh6YiqgGChbLWe68w== X-Received: by 2002:a05:600c:2f88:: with SMTP id t8mr1030337wmn.186.1594670665891; Mon, 13 Jul 2020 13:04:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f17sm1010645wme.14.2020.07.13.13.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 1254D1FF91; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 05/11] tests/plugins: don't unconditionally add -Wpsabi Date: Mon, 13 Jul 2020 21:04:09 +0100 Message-Id: <20200713200415.26214-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-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-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Not all compilers support the -Wpsabi (clang-9 in my case). To handle this gracefully we pare back the shared build machinery so the Makefile is relatively "standalone". We still take advantage of config-host.mak as configure has done a bunch of probing for us but that is it. Fixes: bac8d222a Signed-off-by: Alex Bennée --- v2 - separate from main build system and check probe --- configure | 3 +++ tests/plugin/Makefile | 22 ++++++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Thomas Huth diff --git a/configure b/configure index e1de2f5b24..08eaa99d19 100755 --- a/configure +++ b/configure @@ -7112,6 +7112,9 @@ echo "GIT_UPDATE=$git_update" >> $config_host_mak echo "ARCH=$ARCH" >> $config_host_mak +echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak +echo "GLIB_LDFLAGS=$glib_ldflags" >> $config_host_mak + if test "$default_devices" = "yes" ; then echo "CONFIG_MINIKCONF_MODE=--defconfig" >> $config_host_mak else diff --git a/tests/plugin/Makefile b/tests/plugin/Makefile index 3a50451428..e9348fde4a 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -1,9 +1,16 @@ +# -*- Mode: makefile -*- +# +# This Makefile example is fairly independent from the main makefile +# so users can take and adapt it for their build. We only really +# include config-host.mak so we don't have to repeat probing for +# cflags that the main configure has already done for us. +# + BUILD_DIR := $(CURDIR)/../.. include $(BUILD_DIR)/config-host.mak -include $(SRC_PATH)/rules.mak -$(call set-vpath, $(SRC_PATH)/tests/plugin) +VPATH += $(SRC_PATH)/tests/plugin NAMES := NAMES += bb @@ -17,11 +24,18 @@ NAMES += lockstep SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) -QEMU_CFLAGS += -fPIC -Wpsabi -QEMU_CFLAGS += -I$(SRC_PATH)/include/qemu +# The main QEMU uses Glib extensively so it's perfectly fine to use it +# in plugins (which many example do). +CFLAGS = $(GLIB_CFLAGS) +CFLAGS += -fPIC +CFLAGS += $(if $(findstring no-psabi,$(QEMU_CFLAGS)),-Wpsabi) +CFLAGS += -I$(SRC_PATH)/include/qemu all: $(SONAMES) +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + lib%.so: %.o $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDLIBS) From patchwork Mon Jul 13 20:04:10 2020 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: 235491 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3137888ilg; Mon, 13 Jul 2020 13:06:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztaxiZmKA5oSDzlzZHd4AYvW/vmYooqWx6Dr/2FTjzBhgdto3BBNPNoyW5V6cHTsbkez+U X-Received: by 2002:a25:cb8a:: with SMTP id b132mr2755884ybg.370.1594670795949; Mon, 13 Jul 2020 13:06:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670795; cv=none; d=google.com; s=arc-20160816; b=fTOyjoCGNt153IAyhQqQWAZ6Y1BTmuBtTGwcnQT/R4beDR9HhlOoijrKhsfi2d/kXb eRom5inv1sTIEHmJl61/y2g/sjy5t8pbCMvE7ft2Y9g2tAKYiWfHpJ6qIKUO9deh5pz1 plQPhJ+da7rRX9/TbTQYt7/u6CGywimIKITqqDw7iSoKEr3E/YRynXiFfDDWF+kU6YbT kM8oclDJr50MR9TJnUILmH18GhLRfWQM4JpwuWjBvLLkjghO/lLJkUdYCdcH8mfbqnya gAqpUiE0DX4u4qVEvSHZoEKvoZQ3mB5RX8JTD9zO4ExGQfL7l8OWqaXzEwmDzrfCxIxk 31sw== 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=kb87PAc0ILcvwPMRDtx1z2EyoH/JKtctRlrd2cWmYmY=; b=e9sUPveAmLI3in2wDvosduZaQLRpq335sHnnl7HSVhIXpM2rOfL3CMl1JA4m96BoVd Ecwpf2Z8f++sVi1voLq9+6fjfBUemMJ8YTbUNDW68dzYK7o7sQX7RBFQGagWSZ3GR5// 154pQPxXIZwtaOKuVzux8Wl4nZDZSMFMiTt1FEFzNxnMixZEnKkxByXRpoS8j5VbREVA D7GsOq6clG5m1YEpt3Dx4P23Xz6z2WwQV3wXBw9H4ap//YP+i+DCzmJsBW5kna3AzNyF OiMBYagIUoNKjByzYf6tYGlTIlGcfC3kUZfAEum5EtC/jTsul/fpnirOmxTdubRO3KyH rOkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R7KFLfXv; 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 q2si15898599ybb.75.2020.07.13.13.06.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:06:35 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=R7KFLfXv; 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]:45624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4ih-0002yl-D6 for patch@linaro.org; Mon, 13 Jul 2020 16:06:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4ge-000856-2L for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:28 -0400 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:44885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gc-0006IH-3A for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:27 -0400 Received: by mail-wr1-x444.google.com with SMTP id b6so18142398wrs.11 for ; Mon, 13 Jul 2020 13:04:25 -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=kb87PAc0ILcvwPMRDtx1z2EyoH/JKtctRlrd2cWmYmY=; b=R7KFLfXvss6QA1s0lF4F3JbssBLto2qMYIIrmbreQJg1sgVQjo8itdImO5QxDT8A4k nnARnsGWE5+oopWZMkD0YIUkdckB9oFrA2G3o9DDVQe1Q5+kcRN82vYTaFLkQz9UCmDz vXA2eukaqhUEsffy5XUmju1jdRKnSVM1U5r+Db56u75Ws+IFIGdxWDJzf9XYxWGsbN7t PiHWwUpGmI/39h01NM7SaGZwjcLPyRhwOIabQmgfzW3AaqegWEqaWWqVUTGSCChw0qxV k68wV2Qluqy1OhnlEPfUvAKTTlBpquyLcNoriRz5HsbWrPCAiaDmDLua/vqh9KMRUPH+ 6g5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kb87PAc0ILcvwPMRDtx1z2EyoH/JKtctRlrd2cWmYmY=; b=A+b9V702TiLZUZUh7HEm7FVA9/MccOA58uY1TBPno88ByfmpwvFuYFLzqA1XQ1RHoz ZnIVqPJI3NRg+8qdnE9GsbR9Kmgf4Lp9VThEqpOYNL5cxQ0dI6I8KR6fQgxjb3tTmBx/ NSU4BvRaPu/TlZ6AceT3uFSylZ2UDBJcpaO/BLVSUMxitObDPv+EbbW7PI4kOepbDYW5 8ftT+GzjAStoGH5puubIsMNOtLed1XKKMjviFeut+yGRR05pCusa7gjClH53IZQF914y CbH0w2uul8imac+ey+T2wqEbiqYhrpaUJ3zlKipA5Pm0qCzdoCSHf0CBtQ9K3qQYk5KP VT9w== X-Gm-Message-State: AOAM5319JFOfoP6Vgs3m917mseimHaScoQrWpzmlRy6lw+VYMWeGFzF/ TQODAzB9u747yTlwrjQotAkcSA== X-Received: by 2002:adf:ff90:: with SMTP id j16mr1183783wrr.364.1594670664723; Mon, 13 Jul 2020 13:04:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id k131sm874059wmb.36.2020.07.13.13.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:22 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2C8A01FF92; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 06/11] cputlb: ensure we save the IOTLB data in case of reset Date: Mon, 13 Jul 2020 21:04:10 +0100 Message-Id: <20200713200415.26214-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::444; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x444.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, Paolo Bonzini , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, Eduardo Habkost , aurelien@aurel32.net, Richard Henderson Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Any write to a device might cause a re-arrangement of memory triggering a TLB flush and potential re-size of the TLB invalidating previous entries. This would cause users of qemu_plugin_get_hwaddr() to see the warning: invalid use of qemu_plugin_get_hwaddr because of the failed tlb_lookup which should always succeed. To prevent this we save the IOTLB data in case it is later needed by a plugin doing a lookup. Signed-off-by: Alex Bennée --- v2 - save the entry instead of re-running the tlb_fill. v3 - don't abuse TLS, use CPUState to store data - just use g_free_rcu() to avoid ugliness - verify addr matches before returning data - ws fix v4 - don't both with RCU, just store it in CPUState - clean-up #ifdef'ery - checkpatch --- include/hw/core/cpu.h | 16 ++++++++++++++++ include/qemu/typedefs.h | 1 + accel/tcg/cputlb.c | 38 +++++++++++++++++++++++++++++++++++--- 3 files changed, 52 insertions(+), 3 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Emilio G. Cota diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 5542577d2b..8f145733ce 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -259,6 +259,18 @@ struct CPUWatchpoint { QTAILQ_ENTRY(CPUWatchpoint) entry; }; +#ifdef CONFIG_PLUGIN +/* + * For plugins we sometime need to save the resolved iotlb data before + * the memory regions get moved around by io_writex. + */ +typedef struct SavedIOTLB { + hwaddr addr; + MemoryRegionSection *section; + hwaddr mr_offset; +} SavedIOTLB; +#endif + struct KVMState; struct kvm_run; @@ -417,7 +429,11 @@ struct CPUState { DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX); +#ifdef CONFIG_PLUGIN GArray *plugin_mem_cbs; + /* saved iotlb data from io_writex */ + SavedIOTLB saved_iotlb; +#endif /* TODO Move common fields from CPUArchState here. */ int cpu_index; diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 15f5047bf1..427027a970 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -116,6 +116,7 @@ typedef struct QObject QObject; typedef struct QString QString; typedef struct RAMBlock RAMBlock; typedef struct Range Range; +typedef struct SavedIOTLB SavedIOTLB; typedef struct SHPCDevice SHPCDevice; typedef struct SSIBus SSIBus; typedef struct VirtIODevice VirtIODevice; diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c index 1e815357c7..d370aedb47 100644 --- a/accel/tcg/cputlb.c +++ b/accel/tcg/cputlb.c @@ -1073,6 +1073,24 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, return val; } +/* + * Save a potentially trashed IOTLB entry for later lookup by plugin. + * + * We also need to track the thread storage address because the RCU + * cleanup that runs when we leave the critical region (the current + * execution) is actually in a different thread. + */ +static void save_iotlb_data(CPUState *cs, hwaddr addr, + MemoryRegionSection *section, hwaddr mr_offset) +{ +#ifdef CONFIG_PLUGIN + SavedIOTLB *saved = &cs->saved_iotlb; + saved->addr = addr; + saved->section = section; + saved->mr_offset = mr_offset; +#endif +} + static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, int mmu_idx, uint64_t val, target_ulong addr, uintptr_t retaddr, MemOp op) @@ -1092,6 +1110,12 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, } cpu->mem_io_pc = retaddr; + /* + * The memory_region_dispatch may trigger a flush/resize + * so for plugins we save the iotlb_data just in case. + */ + save_iotlb_data(cpu, iotlbentry->addr, section, mr_offset); + if (mr->global_locking && !qemu_mutex_iothread_locked()) { qemu_mutex_lock_iothread(); locked = true; @@ -1381,8 +1405,11 @@ void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr, * in the softmmu lookup code (or helper). We don't handle re-fills or * checking the victim table. This is purely informational. * - * This should never fail as the memory access being instrumented - * should have just filled the TLB. + * This almost never fails as the memory access being instrumented + * should have just filled the TLB. The one corner case is io_writex + * which can cause TLB flushes and potential resizing of the TLBs + * loosing the information we need. In those cases we need to recover + * data from a copy of the io_tlb entry. */ bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, @@ -1406,8 +1433,13 @@ bool tlb_plugin_lookup(CPUState *cpu, target_ulong addr, int mmu_idx, data->v.ram.hostaddr = addr + tlbe->addend; } return true; + } else { + SavedIOTLB *saved = &cpu->saved_iotlb; + data->is_io = true; + data->v.io.section = saved->section; + data->v.io.offset = saved->mr_offset; + return true; } - return false; } #endif From patchwork Mon Jul 13 20:04:11 2020 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: 235496 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3139665ilg; Mon, 13 Jul 2020 13:09:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtWCDj86v/BSdgl5Io/fpsOfaAPCgGUb3IQ6AHAa8DkB+a5F7RjX2ruFKJdt73idfkkJwv X-Received: by 2002:a25:8503:: with SMTP id w3mr2552692ybk.2.1594670958336; Mon, 13 Jul 2020 13:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670958; cv=none; d=google.com; s=arc-20160816; b=nrigI1VSIVRLbRPcezOK+nYbm8+u7cU+kDRRwBDnnviq1TpdeTt0ObcnVELySHsyBS VCqUyraR/XivwQn0bpKX34IXA/Ite71O29RAbtCWBYeJiS+m0SNK7cSMvIjF4HGtf6LX jpdWz31bRu80gEQvOEDr31SftfvwSB6ZWZClBw2wyw8fVpFW8EFTR+/4g6UR1XT9U//x 5BvmQPczRVEueb5OdHLrX7yMlRGHXmtc4wEuu+yrAFuoMZqYLnJDzU5g8dceLBZzEsh0 QVmUZDvA3WoEp0wgFB72JMACYn1n2qEMJ/X1c5KeHaDaoGvHfp0hu8IjWSSZH6LNDjk2 ehww== 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=RFloOI9RdqsuY1jzWY/LdnGW0qTS1vaDIDIUNvMdMkw=; b=UNpTuCoZ6Y5TAftAIip52EfCTKgQGMx2F12I7Y01Mv1Xnn6NQT2TSu9kQ19lM73Dhy 8YdnMSOyoYyJhBBvWUaRDRU42VO+DUeh2sSyc82VGoKRzm/e9R+LIkxRtapfZLx6PL3f CnQgn/gpRNdzclnAQx/8J7kynp/ScLv5b6PZc7yATdEK2iht7UiGXC5iGtQ4k0fH2zMt j5DB43wZsPOQR8NIQ8cg8umNZembC1FJw1C1wwjq9EMQ6SOwRIGDGoOqW+4dMG123ylK nGEE7ecVwcXkEOrZmk92F+nT2E/YHuwk9jsaqcKyd+kDMY8bECAYITf+yLM6eyRUDg0d DIFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zOKKinMl; 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 i1si14860975yba.461.2020.07.13.13.09.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:09:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zOKKinMl; 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]:58690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4lJ-00089p-SD for patch@linaro.org; Mon, 13 Jul 2020 16:09:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gj-0008Gz-De for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:33 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:44885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gh-0006JN-GR for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:33 -0400 Received: by mail-wr1-x442.google.com with SMTP id b6so18142756wrs.11 for ; Mon, 13 Jul 2020 13:04: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=RFloOI9RdqsuY1jzWY/LdnGW0qTS1vaDIDIUNvMdMkw=; b=zOKKinMl8Lc4tl+khcrq25otS5ClYMFza+X8Eb8n8PJ7hQDMp7qLKWT7XBzuLwUnTi VjmNAJQVQ8lV8KViFJt6Ozwz01fq/4O5j/ugnJOlgWRuWS2rLAvFgb/A1HQBF55RbRcZ GQvBF03MeCYdYuHLlSkW1GWLRGzaW/2xHlEzOxRnbI10ygzyNKxJW+TeXWZ60yztPJnx PwSYc/3A956kxyXldFVqJWJqmrfib28ef2fVWm+uiDaIOkbqTL/AdGRXizdlqrJpddv4 8IBew9zVF+kF5eibGXk6wzK6t67zqOdaQAphN8pyy3GT1vKQ8SeZRAq3HKPkeAvi7x7Q 3fsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RFloOI9RdqsuY1jzWY/LdnGW0qTS1vaDIDIUNvMdMkw=; b=HG6Ikq8ZHO+Vs/UYJ+j5HrrgIrKtr5bcVaHYHL5opYNB0HC+Vl3/y687JOH4QL8qlJ aV8kCd713EdH8aey2O1ugM5ZUZcBXiGkTwdZEP+tL6fcpT5+ZRg1FBkmbrujJ0p9Gv2c ay/dgyfdFldNDke89p23gXvB5Q+bbOGPSRqHy8ChzMiUuEg3y2LGSpTNYyxAd61ilBL9 ji/X7rTz4W2m8QeviiRJDr7zx5czlIS4tPnmrH1FWgRLSaZduxcx0i5IvVIE0qbsXLyn S4IICrwi/W/uPCDnFYr2lvEbkLOIMIKUtznB1LRrCh9kHpnQc/7xLOCCLBSDElPFNsdx e0pg== X-Gm-Message-State: AOAM530B8xazTi8iIvKMPlNruyh3RmR5jbCY1gx3KpP794VWJj5b3gOc SR4wTHNED6L0wMV77Rkm+CAuwg== X-Received: by 2002:a5d:6107:: with SMTP id v7mr1188315wrt.174.1594670670106; Mon, 13 Jul 2020 13:04:30 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id 190sm939618wmb.15.2020.07.13.13.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 43CCF1FF93; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 07/11] plugins: expand the bb plugin to be thread safe and track per-cpu Date: Mon, 13 Jul 2020 21:04:11 +0100 Message-Id: <20200713200415.26214-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::442; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x442.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, Dave Bort , kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" While there isn't any easy way to make the inline counts thread safe we can ensure the callback based ones are. While we are at it we can reduce introduce a new option ("idle") to dump a report of the current bb and insn count each time a vCPU enters the idle state. Signed-off-by: Alex Bennée Reviewed-by: Robert Foley Cc: Dave Bort --- v2 - fixup for non-inline linux-user case - minor cleanup and re-factor v3 - checkpatch --- tests/plugin/bb.c | 97 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 13 deletions(-) -- 2.20.1 diff --git a/tests/plugin/bb.c b/tests/plugin/bb.c index df19fd359d..e4cc7fdd6e 100644 --- a/tests/plugin/bb.c +++ b/tests/plugin/bb.c @@ -16,24 +16,67 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; -static uint64_t bb_count; -static uint64_t insn_count; +typedef struct { + GMutex lock; + int index; + uint64_t bb_count; + uint64_t insn_count; +} CPUCount; + +/* Used by the inline & linux-user counts */ static bool do_inline; +static CPUCount inline_count; + +/* Dump running CPU total on idle? */ +static bool idle_report; +static GPtrArray *counts; +static int max_cpus; + +static void gen_one_cpu_report(CPUCount *count, GString *report) +{ + if (count->bb_count) { + g_string_append_printf(report, "CPU%d: " + "bb's: %" PRIu64", insns: %" PRIu64 "\n", + count->index, + count->bb_count, count->insn_count); + } +} static void plugin_exit(qemu_plugin_id_t id, void *p) { - g_autofree gchar *out = g_strdup_printf( - "bb's: %" PRIu64", insns: %" PRIu64 "\n", - bb_count, insn_count); - qemu_plugin_outs(out); + g_autoptr(GString) report = g_string_new(""); + + if (do_inline || !max_cpus) { + g_string_printf(report, "bb's: %" PRIu64", insns: %" PRIu64 "\n", + inline_count.bb_count, inline_count.insn_count); + } else { + g_ptr_array_foreach(counts, (GFunc) gen_one_cpu_report, report); + } + qemu_plugin_outs(report->str); +} + +static void vcpu_idle(qemu_plugin_id_t id, unsigned int cpu_index) +{ + CPUCount *count = g_ptr_array_index(counts, cpu_index); + g_autoptr(GString) report = g_string_new(""); + gen_one_cpu_report(count, report); + + if (report->len > 0) { + g_string_prepend(report, "Idling "); + qemu_plugin_outs(report->str); + } } static void vcpu_tb_exec(unsigned int cpu_index, void *udata) { - unsigned long n_insns = (unsigned long)udata; + CPUCount *count = max_cpus ? + g_ptr_array_index(counts, cpu_index) : &inline_count; - insn_count += n_insns; - bb_count++; + unsigned long n_insns = (unsigned long)udata; + g_mutex_lock(&count->lock); + count->insn_count += n_insns; + count->bb_count++; + g_mutex_unlock(&count->lock); } static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) @@ -42,9 +85,10 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) if (do_inline) { qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, - &bb_count, 1); + &inline_count.bb_count, 1); qemu_plugin_register_vcpu_tb_exec_inline(tb, QEMU_PLUGIN_INLINE_ADD_U64, - &insn_count, n_insns); + &inline_count.insn_count, + n_insns); } else { qemu_plugin_register_vcpu_tb_exec_cb(tb, vcpu_tb_exec, QEMU_PLUGIN_CB_NO_REGS, @@ -56,8 +100,35 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv) { - if (argc && strcmp(argv[0], "inline") == 0) { - do_inline = true; + int i; + + for (i = 0; i < argc; i++) { + char *opt = argv[i]; + if (g_strcmp0(opt, "inline") == 0) { + do_inline = true; + } else if (g_strcmp0(opt, "idle") == 0) { + idle_report = true; + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + if (info->system_emulation && !do_inline) { + max_cpus = info->system.max_vcpus; + counts = g_ptr_array_new(); + for (i = 0; i < max_cpus; i++) { + CPUCount *count = g_new0(CPUCount, 1); + g_mutex_init(&count->lock); + count->index = i; + g_ptr_array_add(counts, count); + } + } else if (!do_inline) { + g_mutex_init(&inline_count.lock); + } + + if (idle_report) { + qemu_plugin_register_vcpu_idle_cb(id, vcpu_idle); } qemu_plugin_register_vcpu_tb_trans_cb(id, vcpu_tb_trans); From patchwork Mon Jul 13 20:04:12 2020 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: 235489 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3137646ilg; Mon, 13 Jul 2020 13:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwR4+RpgOWoYDtk8rxbpjJmVtIsaYEq7IsfSu6CkYdes6M2+Kbfu8/zZQY3aUGWOGFfq1Nw X-Received: by 2002:a25:b5c8:: with SMTP id d8mr2653229ybg.115.1594670775264; Mon, 13 Jul 2020 13:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670775; cv=none; d=google.com; s=arc-20160816; b=bNJ0jac4Lle1SMbWOIG00HLyw6sdHpTs75WfRpjvtRcRRQq5vG2m6Lnm3mHpA40QA6 WihcUoxR0Ei8TE2zPSXwPSko2cSz6uRJrtedN6rV01FKeEF8Yc4x86cHxnGzOCaphyJV 0Z5w+CRKaPQPfZe3ENLO/MNsMcLcoFujy3EVzZlIh5IgUTbpG0dXqz2YXb4pAR3BZXYE zvCp5dDBrC7H1MlcIaSdOi1UL0bLNCVLE3oGjlqce1Nkb5woX/gV3S1xWi9p6HYU2Y8M tzGKLaiDsXKMWAio4D4co5RDHQWj2lAvg8JfOHfjuczXoBbTU8gBUtEeIu1gfpMhYYHY VMGA== 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=q6cYMqIkyzOX02PZCCZFUIzSlg7qzIM3UYcqhB9l+V0=; b=aPVFo2Nhy1nQ5hm5kzcbwmvYlFNehgPVeV25ciwQiU7wmFZp058mcoA9e5Vtl7/loP LhrFx7ZECcHnZ658kYiadJoyryDIrECtlf/G+dX+0bHkw4pGNrPB8kgdvQKRCfBWBIhE QgTbY/KJ9JkYrh0TGHqP+RuF3xn+oWx6ABN2BuPxH1pKCK2QVRHJp2ehuEbBtAE3BxqB bFE/vW3KBuCtA+wawzAKGkWB9vO1bSlYM2yy/qZGgA5jo42N5r/Bv6YRmJykCbNd1B36 G/AZrOW8fC/xBOK4OV3bySzDEaS9p+oldJxwFCfZ2eJDAy1Dx2E/iOOoIdpmtdBxQKrE 3/GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Dm/LzKWT"; 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 b74si14184152yba.101.2020.07.13.13.06.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Dm/LzKWT"; 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]:45768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4iM-00032C-KH for patch@linaro.org; Mon, 13 Jul 2020 16:06:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gf-00088E-Tf for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:29 -0400 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]:44885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4ge-0006Io-AA for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:29 -0400 Received: by mail-wr1-x443.google.com with SMTP id b6so18142536wrs.11 for ; Mon, 13 Jul 2020 13:04: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=q6cYMqIkyzOX02PZCCZFUIzSlg7qzIM3UYcqhB9l+V0=; b=Dm/LzKWTHcv4R9bX/1f7jVEdJXV6pp0jm5BwwyhZOws8gjhr5pfomQ0gaFV+No/ks5 nlJ1Q8vxM7P/HvAgRv1RMGZkD82bAAAJq6qc6kPVnE2paZ584WNIymAoiWSkHKCQwfNy +okgcVwZxMwB89UVZJ01m3inQ1TDHIog4pTOuuQFJRLx+QqfZ+JAgWfMS17V8J0216Hh z6gGF13YhgFw/uDVNknA3UWpT5Vgl+on4LED/1B7qugbmx2vgawTPzoE4HMzUe6cSjFt PPedllNzn3LcSFIyYMmAak6/YF93OwFM6TLW5JurFx80Snac9lxZ07IfIi2zt85UkMPB +maQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=q6cYMqIkyzOX02PZCCZFUIzSlg7qzIM3UYcqhB9l+V0=; b=rSle5sisCTU7XKlvm0Qxzi3v2Bzl4CRKcEv6GKhhNBeaQzsajvDJhYhaKYbkJS3Oq3 VdNeX4o9FZwhwRNBlK2JUIIfjl/2FeiNa/xYoXa6CBK2VgrsuwUg7hW/SkLeWXTia9ks FQ5l8LxE26KC8XjoaG6CMrSBxgVic+zsc/8Dmst80W6lOEhpDHfNjjhyY0LDi9jEBtFd n6VLkU5s3RU5Afst64bxicXM6nlvgkw27HSvz48absftptKcs/cr9jJwLNw1qB7zMv/v w1GKk8S/cUCtZvU6rJzsIP97DUHbaTMEgRLNNqPkEvl0fNg5czKjzKlMJKXZU3JrN9ev p8lg== X-Gm-Message-State: AOAM530m6ztQx42qUrf1e6+25aYGHQGrcUM+GrZMtl0U+TH7qig2BNji 0NKP9FNRe6tK6BMRIBFPjbNXeg== X-Received: by 2002:adf:cf0a:: with SMTP id o10mr1212492wrj.14.1594670666857; Mon, 13 Jul 2020 13:04:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s8sm24970176wru.38.2020.07.13.13.04.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 59E921FF96; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 08/11] docs/devel: fix grammar in multi-thread-tcg Date: Mon, 13 Jul 2020 21:04:12 +0100 Message-Id: <20200713200415.26214-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::443; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x443.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Review comment came just too late ;-) Signed-off-by: Alex Bennée --- docs/devel/multi-thread-tcg.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé diff --git a/docs/devel/multi-thread-tcg.rst b/docs/devel/multi-thread-tcg.rst index 42158b77c7..21483870db 100644 --- a/docs/devel/multi-thread-tcg.rst +++ b/docs/devel/multi-thread-tcg.rst @@ -107,7 +107,7 @@ including: - debugging operations (breakpoint insertion/removal) - some CPU helper functions - - linux-user spawning it's first thread + - linux-user spawning its first thread This is done with the async_safe_run_on_cpu() mechanism to ensure all vCPUs are quiescent when changes are being made to shared global From patchwork Mon Jul 13 20:04:13 2020 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: 235494 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3138808ilg; Mon, 13 Jul 2020 13:08:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSNSwfBdsEMheywqfxlKUev+qrYC+5aR8yaKwV3ccNSj9ibFtf8TB3KHB7qxBZH5sMFDgs X-Received: by 2002:a25:74cd:: with SMTP id p196mr2561748ybc.47.1594670882359; Mon, 13 Jul 2020 13:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670882; cv=none; d=google.com; s=arc-20160816; b=YBsmzJUJQuC/3qmMytkYBgBGlS5xxTbcO/Di30afq+SJMyDH0iwmed0rl1YaHocqWl 8ZjCiCClgreT+RYMuUSb4NAj/cjv1DAfy65pParpmfaMge2S1urPDSzioAcg8BeYnwEU IJxInX7pj01eqVaCGe6fyfFMUFGD+QQVTrTByJt3XbA1IrUPBVnhjQkPfvgCU5iEew9Y kcTPHPjN17mdCfDSONhJXutrH243Flp+9ZrVaC56w5l+7/IcIqdHBjep2x2VuCYkybrs qmv9aHGytcWsoJQ1Ffs7H4feZJ4sPiiwc9h/tSTrt1FXcXbq+i31KbQWX73Nx02pYsy7 6qyw== 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=VUrwUV80rymMTitCKofJuTKzmFLE1QgsXWLHHkxkAO0=; b=TkSZczA0uHq76BlnGhT7zBrz6gAaPe3AHydNqbyFXK3z1lIOQDn0uJcs8SkPxxaOYe QLkUWEXCcZHOX2Xy7cBs9iNx4nLghGfOecMGgUjm5OjQgxxwxHBJOiWLeqQZvY89vDnc 3o3WA+IAB9xyuX7YBh+JnWfbpqyzxJdizBdhylGxXrFZf4WyZOx9QKXkah6x9T8cbzrG fhMQe8L4dwLVSWVKIlilG4TbCqgveIbnTMNA4IOaC7mlhQaj9djJrDJvGX24tn1BDkKe +jHXW35iVZC4+9E6jzcdOKTA7lu44PNCu90LYXYXOXHAEBfmqkOSTn2cur1uXmBLweau lrEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=v3kHQID1; 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 p66si13194161ybg.455.2020.07.13.13.08.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:08: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=v3kHQID1; 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]:52336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4k5-0005d2-RY for patch@linaro.org; Mon, 13 Jul 2020 16:08:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gi-0008DC-2T for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:32 -0400 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:38705) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gg-0006JE-Bs for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:31 -0400 Received: by mail-wm1-x342.google.com with SMTP id f18so1072171wml.3 for ; Mon, 13 Jul 2020 13:04:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VUrwUV80rymMTitCKofJuTKzmFLE1QgsXWLHHkxkAO0=; b=v3kHQID186Zb0rR2a71SzKHJMUiOt3xJpXHR8c6ygLWqa6vdNG1rnOojXPNBO1O89f 7jKGC/4IoNP9ZWdLWLWFJkky9QiPlCzAgfvf5gM8nfaC+dbEfkCQJVWWgF+vi+fO2yj3 KReYQa+04R/an/VJyVz1TmGFkc5cCpRW63NcEsPjkv/4K37P9sRuMurf2jTshytTyo9k FrAZ3vnQXmNn868AlQafCGuKJvDt1uzOMrdaOjmSYgDz+J4lDAwnVo5V3ALJNIvc2+Zt zOTFb4wjxEYtuavM+uenFk1WkyeXHeiFo8s2fR0DOfXzbjaEFu6rSiU82dXzMYD70lQT sjbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VUrwUV80rymMTitCKofJuTKzmFLE1QgsXWLHHkxkAO0=; b=GNwDMzaVRx34zrwahzzKs1lMI2kX7sOtXDeh5CODP/lz8veyaOjDI1NjNrT01ZH5Qu P6pYVJP1gVAb2H9bwiObYeHPkf4Go0DR/3WvveukmI7Hg+AP4asPn3tLkfHnY1Bw8Nsn rlwKOKozVci6GhLD6fivquzBUEHeaX6vDvq5e+Y82FFU+3fBe5+IS9+qJPs5oUwzrLVu zCfIoBn73g3SfVbdEY1uzO7LnMWJA2sLJ4WTtYB4UBWnHFZ3C42Z2MUxQJ/wonUv1F7/ IYVtepxlcv2quIAw7MBF0vwwo1oedh/jmZeZ8jHblj0oF3OKRJ/mn2XZjPu1OxbulQ9d 1e3g== X-Gm-Message-State: AOAM531xu+FtzCW4gv72rBTRJ5SrLkG0ZRxicFLCxqTD1PP1mbWEUE1n VacJfnOr1E7E8SJDaCeaGTG+4w== X-Received: by 2002:a7b:c194:: with SMTP id y20mr1066343wmi.83.1594670669046; Mon, 13 Jul 2020 13:04:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id h23sm872362wmb.3.2020.07.13.13.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 713781FF98; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 09/11] hw/virtio/pci: include vdev name in registered PCI sections Date: Mon, 13 Jul 2020 21:04:13 +0100 Message-Id: <20200713200415.26214-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::342; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x342.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, "Michael S . Tsirkin" , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" When viewing/debugging memory regions it is sometimes hard to figure out which PCI device something belongs to. Make the names unique by including the vdev name in the name string. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael S. Tsirkin --- v2 - swap ()'s for an extra - --- hw/virtio/virtio-pci.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) -- 2.20.1 diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 8554cf2a03..215e680c71 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -1406,7 +1406,8 @@ static void virtio_pci_device_write(void *opaque, hwaddr addr, } } -static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) +static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy, + const char *vdev_name) { static const MemoryRegionOps common_ops = { .read = virtio_pci_common_read, @@ -1453,36 +1454,41 @@ static void virtio_pci_modern_regions_init(VirtIOPCIProxy *proxy) }, .endianness = DEVICE_LITTLE_ENDIAN, }; + g_autoptr(GString) name = g_string_new(NULL); - + g_string_printf(name, "virtio-pci-common-%s", vdev_name); memory_region_init_io(&proxy->common.mr, OBJECT(proxy), &common_ops, proxy, - "virtio-pci-common", + name->str, proxy->common.size); + g_string_printf(name, "virtio-pci-isr-%s", vdev_name); memory_region_init_io(&proxy->isr.mr, OBJECT(proxy), &isr_ops, proxy, - "virtio-pci-isr", + name->str, proxy->isr.size); + g_string_printf(name, "virtio-pci-device-%s", vdev_name); memory_region_init_io(&proxy->device.mr, OBJECT(proxy), &device_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-device", + name->str, proxy->device.size); + g_string_printf(name, "virtio-pci-notify-%s", vdev_name); memory_region_init_io(&proxy->notify.mr, OBJECT(proxy), ¬ify_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-notify", + name->str, proxy->notify.size); + g_string_printf(name, "virtio-pci-notify-pio-%s", vdev_name); memory_region_init_io(&proxy->notify_pio.mr, OBJECT(proxy), ¬ify_pio_ops, virtio_bus_get_device(&proxy->bus), - "virtio-pci-notify-pio", + name->str, proxy->notify_pio.size); } @@ -1623,7 +1629,7 @@ static void virtio_pci_device_plugged(DeviceState *d, Error **errp) struct virtio_pci_cfg_cap *cfg_mask; - virtio_pci_modern_regions_init(proxy); + virtio_pci_modern_regions_init(proxy, vdev->name); virtio_pci_modern_mem_region_map(proxy, &proxy->common, &cap); virtio_pci_modern_mem_region_map(proxy, &proxy->isr, &cap); From patchwork Mon Jul 13 20:04:14 2020 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: 235486 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3136570ilg; Mon, 13 Jul 2020 13:04:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3VbltG5kU5YxtembhsDdMAjuARxw9d8EQqCTVpaujVEWMmOgaHmbrsZ7D1Uv1mVxOsFJa X-Received: by 2002:a5b:7c4:: with SMTP id t4mr2808141ybq.67.1594670684502; Mon, 13 Jul 2020 13:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670684; cv=none; d=google.com; s=arc-20160816; b=IgsWJqWG8y4uJQOXWtMopXI5ncnhZIKyUe3fSiqC+1EZcv7vDIEhgQLl7/wHFRTva3 U/mpHdWPpqSlfuc47wHkUR4X+r3bcAJ6HTlAdNuHhGeGS+5iBYEnsumGa0SQ1m7grkQi eH40O/d1hby7hg2IYDXmzrI7PwZ4jLO5F22SY77mmpiATIxtkA4tXcHsBh4RLg2O+e6z 5kxkJmuWGI13R7ykkXj30THtqdy8yl519u3hRmMwzqpUhgJ1Zao7y5QFCF85IgGZNgOp J/R46I+cyTDCkh43zSZNggVoEtDltJiJlEvsaolCjDyG8ZBxP8ZK2o7QJysI1TPVT4e3 MjWA== 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=WVJRm9yMA7V6UraKTz4oUpniy0kUGIO9MjLG/c6LBA4=; b=VuUYiT/8lzIeDA+UsXwNb8zrHOQ2li3OeK5M8qOZDVY8Ib0nBUKr/Z+eKOjk3GS8eq tSRcHi0vTqiFws36Nh2JMnJ9x/mvbVkbErObLBMmBrc8G6HtaJb0qNLpEgFtzc0vosEv +D95KLypp67liFd8dAJ7mj9PN4wHMmciek6+F73PeOmAtZtnNhqWld/2/MPRl6Bbib44 GFWX1C+gp4ig8fQSKfyzIHjATnCV8M86XQGbAAvOXWT0pWTxPVHLnurxx3MBxzEAiblO VNLlyEZp5naFaUbLWLMrC+w5udJCOdvGAcePDZuFSo1xSypMq8wrAkpOv1Bezqo+6gjW gmZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=brV9IPLq; 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 k13si3489419ybj.3.2020.07.13.13.04.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=brV9IPLq; 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]:37878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4gu-0008Dq-15 for patch@linaro.org; Mon, 13 Jul 2020 16:04:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59530) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gh-0008Al-0Y for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:31 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:36789) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gf-0006J4-5z for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:30 -0400 Received: by mail-wr1-x432.google.com with SMTP id k6so18141908wrn.3 for ; Mon, 13 Jul 2020 13:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WVJRm9yMA7V6UraKTz4oUpniy0kUGIO9MjLG/c6LBA4=; b=brV9IPLqyHOY39GAGvoiqQuEIULY6Qz2VDd5AMTfpE6Y2UX8M1sFYtiL7vQueonLBn XOzcaMlCmpE1l3nmzYzmBQJI7fjS4LXhPkpX+grlJAdRAUYXEzVgnsx+SQ9gRnzI8Pja yL86EcL3+h/C4sYALSzZRJtKD4QGi4YIFp2rXYUeNoHK4LCOLt+csBlOjl619Q9Q8mo4 LRHQUFX+wUDtQQSSmyBp7iGkXvC55tu8IrHhWVtp3gBvsXP4nM6lrwYtpvRjlEgpe604 X1aiueqArJdVvuxQ/cw/0SlCJ1insY33GyGv6+wuAIseRjmG9vhidUFQSzdB5YMsTVuh iyPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WVJRm9yMA7V6UraKTz4oUpniy0kUGIO9MjLG/c6LBA4=; b=cjVcWHtRT1BdCgxJTQVpCHdKJzwBQS/3vjRyKRZNCLKOkaaCXRlUhx0Au+nhbkm3+m JADjC/X95EYK/SPsXDb6X6HySgxwFy5Ia7iKM2/Y+3INll58l1/gn59QrzEs314xEf0j CseCalwRC6z7Av94on5T+r7QJUGldYvWeChltitft65xFmsukBvHBQmEnAIpUlGOccBN HAXfB0rzLFKfOSorU8nCjVDBNTUE8FWu4hO8VaU9s7I0Jg3mdH7n6B8Ff6kFxWMzNLrf 0DfGpv03nsM2EB0+256P7XNwkqfuAswlhC+Hyteti20Vh73AgfztTEmXAArOtAgdvQIK SlBw== X-Gm-Message-State: AOAM533nRlJ8JmsJIFbRnTIR4wbLYrDX6rAfKrOT2d+Uy/c8Hd1Akrj9 xXbZSde/Av7PAxZFlgmGbjcwNw== X-Received: by 2002:adf:e482:: with SMTP id i2mr1157195wrm.75.1594670667812; Mon, 13 Jul 2020 13:04:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q7sm25941773wrs.27.2020.07.13.13.04.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8869F1FF99; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 10/11] plugins: add API to return a name for a IO device Date: Mon, 13 Jul 2020 21:04:14 +0100 Message-Id: <20200713200415.26214-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, Clement Deschamps , aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This may well end up being anonymous but it should always be unique. Signed-off-by: Alex Bennée [r-b provisional given change to g_intern_string] Reviewed-by: Clement Deschamps Reviewed-by: Emilio G. Cota --- v3 - return a non-freeable const g_intern_string() - checkpatch cleanups --- include/qemu/qemu-plugin.h | 6 ++++++ plugins/api.c | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index bab8b0d4b3..c98c18d6b0 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -335,6 +335,12 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr); +/* + * Returns a string representing the device. The string is valid for + * the lifetime of the plugin. + */ +const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h); + typedef void (*qemu_plugin_vcpu_mem_cb_t)(unsigned int vcpu_index, qemu_plugin_meminfo_t info, uint64_t vaddr, diff --git a/plugins/api.c b/plugins/api.c index bbdc5a4eb4..4304e63f0c 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -303,6 +303,26 @@ uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr return 0; } +const char *qemu_plugin_hwaddr_device_name(const struct qemu_plugin_hwaddr *h) +{ +#ifdef CONFIG_SOFTMMU + if (h && h->is_io) { + MemoryRegionSection *mrs = h->v.io.section; + if (!mrs->mr->name) { + unsigned long maddr = 0xffffffff & (uintptr_t) mrs->mr; + g_autofree char *temp = g_strdup_printf("anon%08lx", maddr); + return g_intern_string(temp); + } else { + return g_intern_string(mrs->mr->name); + } + } else { + return g_intern_string("RAM"); + } +#else + return g_intern_string("Invalid"); +#endif +} + /* * Queries to the number and potential maximum number of vCPUs there * will be. This helps the plugin dimension per-vcpu arrays. From patchwork Mon Jul 13 20:04:15 2020 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: 235495 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3139628ilg; Mon, 13 Jul 2020 13:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAMvpeWSM7L/WJWtnblC//NG0mCASm+TkMzWFJiUxUJb/t0W60/nO61kaiXkcS44K1+17M X-Received: by 2002:a5b:f03:: with SMTP id x3mr2778683ybr.32.1594670954999; Mon, 13 Jul 2020 13:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594670954; cv=none; d=google.com; s=arc-20160816; b=D9Al810cVHqErCxPppyqdlb414k1kSWyVGJMN5hGFY7CftDA3qE5G3s6pQM652MjHk el8tKdxRuAxCNDdQURdap+meF8/z8ecrAAoq+tqoS2HEGcw4qhiGjGjxNx8d1pV2ubpt RR99ZphOZsTlMfQdwau0dE3H3AVc6u+X2y6tqKXIfwY1WNfxssPmbdAaQaOkgn7C3w7X K0sqVBfO0WdeG+NJvNw6qzryZAyUM6ZLhdoRt+XEujtB53A9GmhUg7VncQWmNjsECAO5 S/CsmHLx9o3H9lHnJJ1bgyV6aZeG4sW7RGauCDnvdO6nAPPlrUH1CF2TJsgBQACL2TrF It/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Pdf6aU3FyC9r3Nn2r3fEZmyoTvKCMt4IaqLuhhG9jq4=; b=fRh5VGdY/2GKCdD4tdh5/1lX+MnAMe3MHf/ZWDRnGr9ZtZp/iT4l7iuXV2ZdaqGaM4 TYbqVoQrxniV5OqOLGTdCanZJ+Y7bpD/t0BAZSDJ9fHtvATCYFQyh072FaM+G5bOA+vH 0oXlphZI33c7T4qr0oktMI7rZ9XpEnanN6lIcY+rvI3cZtQh1PHtbcjzATlfY31HVNdG T8Y6BLwZnNFfr8sysLISoF4tn/+MXoJabJ7RVfLrMngDU0aWEEA8hwIwphyHm5kFZLMX UhBOuGGQhGh+ef4xuPF+rKgUJ5DZdvzWifZqHMd4Cs95TOGzSUtTsbcEoiIHfQc/09Jc zWRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qMuu8NUF; 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 n140si15627644yba.205.2020.07.13.13.09.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jul 2020 13:09:14 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qMuu8NUF; 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]:58436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jv4lG-00083c-78 for patch@linaro.org; Mon, 13 Jul 2020 16:09:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jv4gl-0008Lf-Gq for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:35 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:36918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jv4gj-0006Ji-3P for qemu-devel@nongnu.org; Mon, 13 Jul 2020 16:04:35 -0400 Received: by mail-wr1-x42e.google.com with SMTP id a6so18135546wrm.4 for ; Mon, 13 Jul 2020 13:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Pdf6aU3FyC9r3Nn2r3fEZmyoTvKCMt4IaqLuhhG9jq4=; b=qMuu8NUF/b5XQzGj6rgCcShJ7YZW8kcH5Cws6JU6MI7d+6hvHv2O8wUnQxD18xN6Ib /GUBwiTEa4mi60XToVO4xC4Vv528IZZWbNckDvFA+EAeTtPf8lNWOU18vdJ9uR2ddDer 9MtAnIARhKWhMJSXUSOlWGNCfqok2+OPyzZ0xwUH0d3l6mjambBEH34WyN/HOBZxjtCS TBY8Vk9tCA3A0DsJ5p3hsMOYAdA3zhejqb+xWlM1Kz5nr/yaFyAJndYCrov4ZNZL84b3 4WVfMvz8Qbw9uBgPv08fMSe2/8/ZjihGHZJaVVw++tRYhUx5PKEzlAeWu4Z1535PuLXO zRrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Pdf6aU3FyC9r3Nn2r3fEZmyoTvKCMt4IaqLuhhG9jq4=; b=MbVnJqJd6DP0ycZbtdSEiarivYN+Zfu6flCygS76VaNET7bd187quK0+EJpMGOQNW3 hYkOfKlY/XGmFcdV/JMgkxbXSzvhq65n95Ub2NSWphLYRDFLtEnJ23OLBdPu5tw8gTQA OE8ctp0kVxnwHmsKd9eXSKp6GM9wh6X51oU3/NJ8Qb8vYLlfycNVBxXnCN2HAo+YmFP8 jbwN+syBNKdRI76nklr12K+DJLndf0p23L0X0rH/CinmFxRBLi5pDGHpDwFAYJ2fI/9x nivcAp7BGFIM/HkHHtb1ss7JtWrqUz2thSybKrOdOfGvXRVN8coB1PQfOC4Pu+5tTvmp i4gw== X-Gm-Message-State: AOAM533ZZzLU/YVjMqp/ccpe9OxBVCyW5HMjGKTmHFqrK9Fs0CgzT1fZ kdwmpnnjHzE+KLnHtkWpLrYaGA== X-Received: by 2002:adf:d0d0:: with SMTP id z16mr1230452wrh.95.1594670671470; Mon, 13 Jul 2020 13:04:31 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id d81sm1348870wmc.0.2020.07.13.13.04.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 13:04:23 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A391A1FF9A; Mon, 13 Jul 2020 21:04:16 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 11/11] plugins: new hwprofile plugin Date: Mon, 13 Jul 2020 21:04:15 +0100 Message-Id: <20200713200415.26214-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200713200415.26214-1-alex.bennee@linaro.org> References: <20200713200415.26214-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-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=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, berrange@redhat.com, robert.foley@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, robhenry@microsoft.com, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , aaron@os.amperecomputing.com, cota@braap.org, kuhn.chenqun@huawei.com, peter.puhov@linaro.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" This is a plugin intended to help with profiling access to various bits of system hardware. It only really makes sense for system emulation. It takes advantage of the recently exposed helper API that allows us to see the device name (memory region name) associated with a device. You can specify arg=read or arg=write to limit the tracking to just reads or writes (by default it does both). The pattern option: -plugin ./tests/plugin/libhwprofile.so,arg=pattern will allow you to see the access pattern to devices, eg: gic_cpu @ 0xffffffc010040000 off:00000000, 8, 1, 8, 1 off:00000000, 4, 1, 4, 1 off:00000000, 2, 1, 2, 1 off:00000000, 1, 1, 1, 1 The source option: -plugin ./tests/plugin/libhwprofile.so,arg=source will track the virtual source address of the instruction making the access: pl011 @ 0xffffffc010031000 pc:ffffffc0104c785c, 1, 4, 0, 0 pc:ffffffc0104c7898, 1, 4, 0, 0 pc:ffffffc010512bcc, 2, 1867, 0, 0 You cannot mix source and pattern. Finally the match option allow you to limit the tracking to just the devices you care about. Signed-off-by: Alex Bennée Reviewed-by: Robert Foley Tested-by: Robert Foley --- v2 - use 64 bit cpu masks - warn if we will exceed cpu mask capability - don't run in linux-user mode - skip in check-tcg for linux-user test v3 - update device name API - re-factor and clean-up - add source tracking - use direct hash for source/pattern - add match function - expand the commit message - checkpatch cleanups --- tests/plugin/hwprofile.c | 305 ++++++++++++++++++++++++++++++++++++++ tests/plugin/Makefile | 1 + tests/tcg/Makefile.target | 12 +- 3 files changed, 316 insertions(+), 2 deletions(-) create mode 100644 tests/plugin/hwprofile.c -- 2.20.1 diff --git a/tests/plugin/hwprofile.c b/tests/plugin/hwprofile.c new file mode 100644 index 0000000000..6dac1d5f85 --- /dev/null +++ b/tests/plugin/hwprofile.c @@ -0,0 +1,305 @@ +/* + * Copyright (C) 2020, Alex Bennée + * + * HW Profile - breakdown access patterns for IO to devices + * + * 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; + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +typedef struct { + uint64_t cpu_read; + uint64_t cpu_write; + uint64_t reads; + uint64_t writes; +} IOCounts; + +typedef struct { + uint64_t off_or_pc; + IOCounts counts; +} IOLocationCounts; + +typedef struct { + const char *name; + uint64_t base; + IOCounts totals; + GHashTable *detail; +} DeviceCounts; + +static GMutex lock; +static GHashTable *devices; + +/* track the access pattern to a piece of HW */ +static bool pattern; +/* track the source address of access to HW */ +static bool source; +/* track only matched regions of HW */ +static bool check_match; +static gchar **matches; + +static enum qemu_plugin_mem_rw rw = QEMU_PLUGIN_MEM_RW; + +static inline bool track_reads(void) +{ + return rw == QEMU_PLUGIN_MEM_RW || rw == QEMU_PLUGIN_MEM_R; +} + +static inline bool track_writes(void) +{ + return rw == QEMU_PLUGIN_MEM_RW || rw == QEMU_PLUGIN_MEM_W; +} + +static void plugin_init(void) +{ + devices = g_hash_table_new(NULL, NULL); +} + +static gint sort_cmp(gconstpointer a, gconstpointer b) +{ + DeviceCounts *ea = (DeviceCounts *) a; + DeviceCounts *eb = (DeviceCounts *) b; + return ea->totals.reads + ea->totals.writes > + eb->totals.reads + eb->totals.writes ? -1 : 1; +} + +static gint sort_loc(gconstpointer a, gconstpointer b) +{ + IOLocationCounts *ea = (IOLocationCounts *) a; + IOLocationCounts *eb = (IOLocationCounts *) b; + return ea->off_or_pc > eb->off_or_pc; +} + +static void fmt_iocount_record(GString *s, IOCounts *rec) +{ + if (track_reads()) { + g_string_append_printf(s, ", %"PRIx64", %"PRId64, + rec->cpu_read, rec->reads); + } + if (track_writes()) { + g_string_append_printf(s, ", %"PRIx64", %"PRId64, + rec->cpu_write, rec->writes); + } +} + +static void fmt_dev_record(GString *s, DeviceCounts *rec) +{ + g_string_append_printf(s, "%s, 0x%"PRIx64, + rec->name, rec->base); + fmt_iocount_record(s, &rec->totals); + g_string_append_c(s, '\n'); +} + +static void plugin_exit(qemu_plugin_id_t id, void *p) +{ + g_autoptr(GString) report = g_string_new(""); + GList *counts; + + if (!(pattern || source)) { + g_string_printf(report, "Device, Address"); + if (track_reads()) { + g_string_append_printf(report, ", RCPUs, Reads"); + } + if (track_writes()) { + g_string_append_printf(report, ", WCPUs, Writes"); + } + g_string_append_c(report, '\n'); + } + + counts = g_hash_table_get_values(devices); + if (counts && g_list_next(counts)) { + GList *it; + + it = g_list_sort(counts, sort_cmp); + + while (it) { + DeviceCounts *rec = (DeviceCounts *) it->data; + if (rec->detail) { + GList *accesses = g_hash_table_get_values(rec->detail); + GList *io_it = g_list_sort(accesses, sort_loc); + const char *prefix = pattern ? "off" : "pc"; + g_string_append_printf(report, "%s @ 0x%"PRIx64"\n", + rec->name, rec->base); + while (io_it) { + IOLocationCounts *loc = (IOLocationCounts *) io_it->data; + g_string_append_printf(report, " %s:%08"PRIx64, + prefix, loc->off_or_pc); + fmt_iocount_record(report, &loc->counts); + g_string_append_c(report, '\n'); + io_it = io_it->next; + } + } else { + fmt_dev_record(report, rec); + } + it = it->next; + }; + g_list_free(it); + } + + qemu_plugin_outs(report->str); +} + +static DeviceCounts *new_count(const char *name, uint64_t base) +{ + DeviceCounts *count = g_new0(DeviceCounts, 1); + count->name = name; + count->base = base; + if (pattern || source) { + count->detail = g_hash_table_new(NULL, NULL); + } + g_hash_table_insert(devices, (gpointer) name, count); + return count; +} + +static IOLocationCounts *new_location(GHashTable *table, uint64_t off_or_pc) +{ + IOLocationCounts *loc = g_new0(IOLocationCounts, 1); + loc->off_or_pc = off_or_pc; + g_hash_table_insert(table, (gpointer) off_or_pc, loc); + return loc; +} + +static void hwprofile_match_hit(DeviceCounts *rec, uint64_t off) +{ + g_autoptr(GString) report = g_string_new("hwprofile: match @ offset"); + g_string_append_printf(report, "%"PRIx64", previous hits\n", off); + fmt_dev_record(report, rec); + qemu_plugin_outs(report->str); +} + +static void inc_count(IOCounts *count, bool is_write, unsigned int cpu_index) +{ + if (is_write) { + count->writes++; + count->cpu_write |= (1 << cpu_index); + } else { + count->reads++; + count->cpu_read |= (1 << cpu_index); + } +} + +static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, + uint64_t vaddr, void *udata) +{ + struct qemu_plugin_hwaddr *hwaddr = qemu_plugin_get_hwaddr(meminfo, vaddr); + + if (!hwaddr || !qemu_plugin_hwaddr_is_io(hwaddr)) { + return; + } else { + const char *name = qemu_plugin_hwaddr_device_name(hwaddr); + uint64_t off = qemu_plugin_hwaddr_device_offset(hwaddr); + bool is_write = qemu_plugin_mem_is_store(meminfo); + DeviceCounts *counts; + + g_mutex_lock(&lock); + counts = (DeviceCounts *) g_hash_table_lookup(devices, name); + + if (!counts) { + uint64_t base = vaddr - off; + counts = new_count(name, base); + } + + if (check_match) { + if (g_strv_contains((const char * const *)matches, counts->name)) { + hwprofile_match_hit(counts, off); + inc_count(&counts->totals, is_write, cpu_index); + } + } else { + inc_count(&counts->totals, is_write, cpu_index); + } + + /* either track offsets or source of access */ + if (source) { + off = (uint64_t) udata; + } + + if (pattern || source) { + IOLocationCounts *io_count = g_hash_table_lookup(counts->detail, + (gpointer) off); + if (!io_count) { + io_count = new_location(counts->detail, off); + } + inc_count(&io_count->counts, is_write, cpu_index); + } + + g_mutex_unlock(&lock); + } +} + +static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb) +{ + size_t n = qemu_plugin_tb_n_insns(tb); + size_t i; + + for (i = 0; i < n; i++) { + struct qemu_plugin_insn *insn = qemu_plugin_tb_get_insn(tb, i); + gpointer udata = (gpointer) (source ? qemu_plugin_insn_vaddr(insn) : 0); + qemu_plugin_register_vcpu_mem_cb(insn, vcpu_haddr, + QEMU_PLUGIN_CB_NO_REGS, + rw, udata); + } +} + +QEMU_PLUGIN_EXPORT +int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, + int argc, char **argv) +{ + int i; + + for (i = 0; i < argc; i++) { + char *opt = argv[i]; + if (g_strcmp0(opt, "read") == 0) { + rw = QEMU_PLUGIN_MEM_R; + } else if (g_strcmp0(opt, "write") == 0) { + rw = QEMU_PLUGIN_MEM_W; + } else if (g_strcmp0(opt, "pattern") == 0) { + pattern = true; + } else if (g_strcmp0(opt, "source") == 0) { + source = true; + } else if (g_str_has_prefix(opt, "match")) { + gchar **parts = g_strsplit(opt, "=", 2); + check_match = true; + matches = g_strsplit(parts[1], ",", -1); + g_strfreev(parts); + } else { + fprintf(stderr, "option parsing failed: %s\n", opt); + return -1; + } + } + + if (source && pattern) { + fprintf(stderr, "can only currently track either source or pattern.\n"); + return -1; + } + + if (!info->system_emulation) { + fprintf(stderr, "hwprofile: plugin only useful for system emulation\n"); + return -1; + } + + /* Just warn about overflow */ + if (info->system.smp_vcpus > 64 || + info->system.max_vcpus > 64) { + fprintf(stderr, "hwprofile: can only track up to 64 CPUs\n"); + } + + 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/tests/plugin/Makefile b/tests/plugin/Makefile index e9348fde4a..e9d1947751 100644 --- a/tests/plugin/Makefile +++ b/tests/plugin/Makefile @@ -21,6 +21,7 @@ NAMES += hotblocks NAMES += howvec NAMES += hotpages NAMES += lockstep +NAMES += hwprofile SONAMES := $(addsuffix .so,$(addprefix lib,$(NAMES))) diff --git a/tests/tcg/Makefile.target b/tests/tcg/Makefile.target index 4b2b696fce..bc595b0588 100644 --- a/tests/tcg/Makefile.target +++ b/tests/tcg/Makefile.target @@ -129,8 +129,16 @@ ifeq ($(CONFIG_PLUGIN),y) PLUGIN_SRC=$(SRC_PATH)/tests/plugin PLUGIN_LIB=../../plugin VPATH+=$(PLUGIN_LIB) -PLUGINS=$(filter-out liblockstep.so,\ - $(patsubst %.c, lib%.so, $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))) + +# Some plugins aren't testable automatically +SKIP_PLUGINS=liblockstep.so +ifdef CONFIG_USER_ONLY +SKIP_PLUGINS+=libhwprofile.so +endif + +PLUGINS=$(filter-out $(SKIP_PLUGINS),\ + $(patsubst %.c, lib%.so, \ + $(notdir $(wildcard $(PLUGIN_SRC)/*.c)))) # We need to ensure expand the run-plugin-TEST-with-PLUGIN # pre-requistes manually here as we can't use stems to handle it. We