From patchwork Wed May 5 09:22:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 431157 Delivered-To: patch@linaro.org Received: by 2002:a02:c901:0:0:0:0:0 with SMTP id t1csp331482jao; Wed, 5 May 2021 02:33:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIs1+yescCtnH47A6XmYuLqGOxgIqT7kuOc2SQbz8Rnxzl3M33PDLGc+kS4Ocfnj3LN8zw X-Received: by 2002:a6b:d918:: with SMTP id r24mr13560662ioc.25.1620207206662; Wed, 05 May 2021 02:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620207206; cv=none; d=google.com; s=arc-20160816; b=RmX0emaiUeDVLRLdroi4GzEpriY0fRHEkDebiY29L5lszLJQGlXlD2PqcOTiXc5N5F ti3J+55HNZ6H4qYAiyBM6F089Syn/0UNEZA6urk2vuW4GRgG99sCrrLwPKB5QDL2IsEv kCuOmFGu6mTyAWPWXttlM+JGXkLWsTXa17O+FHOGT22Oq/75Wgl5xt6tBUU4vO9cUXhN SdLDjTOnhni7mv4GB9MbzdVK70Dw8KXY3M1D/CpvETDfmxPEvSPAIbpi6sODlI9ix3XD PEei3KAFDqnXYJKZPKLznaE+XXAkUc390KpgVpixycC68z5QJ+q6/KXpS1puWU4YCR+c iuvw== 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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=oI3r+FYkuucW+bFIASkrq5n2mSfnYpFJTCXNhdZjnZaduHE9nN7ZCWtAVGCVe8OOHt oMr5E0Fc2Uotr09vUAd4D83xnvBTBkiIz6dKta9dAkNOJYmwEJR2r3jwrd2wcVUGR4dW AWO3nCYC6JrZvPRI+KIOikB0+9hnAMBiD0jEI6JjptruUxmhjsNQLVkA9YvBLggWy3P9 zOLWqqEuONWa5LQD83Ke8b8994HE2MUWFldRL210s/pB1A8Z+C/MH1cV6PzqMBhBTSwT YJ7YdYLC9hq6sql7r3K9/YfZzaQUce4+ovUkNg9Tc426TlJ+Lrc2WfmOacnGYCKUgxCd XzJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qeP7/ybC"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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 b14si22030445ilv.52.2021.05.05.02.33.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 05 May 2021 02:33:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="qeP7/ybC"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as 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]:54084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leDuI-0001my-6B for patch@linaro.org; Wed, 05 May 2021 05:33:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leDka-0000wN-Hw for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:25 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:34579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leDkQ-0005C0-TA for qemu-devel@nongnu.org; Wed, 05 May 2021 05:23:23 -0400 Received: by mail-wr1-x429.google.com with SMTP id t18so1038793wry.1 for ; Wed, 05 May 2021 02:23:14 -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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=qeP7/ybCYH1wzVDrDLRBnkTBwAV04Hs70pHEaHj7uqrFgdmecAOZZgFtVowmwGqM9P UlvWuwqkBshA89X+17IsKvfQiPJjXI4KZUl++XtkewE9VkKTe8ocmz4hRHP0mRbK7rbD Y69i+VX0scN5CUHPCa0mbRZLbv0ArjwKwu99QL9qij1fstlVr10CaUO5G68fwpAXcIsy PPwCq0JxQfshDEytFtygdMl/2pm/yrdeIaOOEX3lcq40grZWQsdnDHdtImJpafDsp3Bs T9IX02L6ZL6qcaHmqcVmF0KIPMV84RF5d61qlWWFiZ6v3/qcCaP9YDuT9rU6vuMKctoP o2Hg== 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=+Rw6OGQrVJGw3XC/foHAisgB3VI31AwIvMNzYonwovA=; b=OH60UETXE8Md1/r2KWfbBP4hRzieJVDyROIt6oThejKsjpwiXWIw+Rd3Yqcv4amdUS iEfaEOFw5rdbUUqbHeLrVGYiU/nk6cFaE7h/io9Z9Cu/1wPanYm4FSvjhhGzLb2l8Zu6 Hgu/c2P6sq/+HNQQPD5v6pafOmYyLSLhFnlE4HYp6slYPVqvVI05pJRnEEhZ6VxZ+AM9 t8O+v5CvIIKfa5j54KAaQTXwQH5jXVMcX7wUOtWILb7wiF1CIQCgKmWyH84sHAi+y8G6 e4X6O021TRg7GvX8REzyYtWWLCJ7FxXVHlk/1RPpiXDCoe/XzvJFMOSX/pShs5xTAoiF bo0g== X-Gm-Message-State: AOAM531c4Uzygn6YRklwZHzL0eW/vkJsc2eqhZqaecLMc2IRFgNCowAi Cbqfoj4IPQoF/GPLQ9EIzZ5Ziw== X-Received: by 2002:adf:8046:: with SMTP id 64mr36246315wrk.176.1620206593179; Wed, 05 May 2021 02:23:13 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id b10sm5999462wrr.27.2021.05.05.02.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 May 2021 02:23:08 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5BC2A1FF92; Wed, 5 May 2021 10:23:00 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v1 6/7] scripts/tracetool: don't barf validating TCG types Date: Wed, 5 May 2021 10:22:58 +0100 Message-Id: <20210505092259.8202-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210505092259.8202-1-alex.bennee@linaro.org> References: <20210505092259.8202-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= , minyihh@uci.edu, robhenry@microsoft.com, vilanova@imperial.ac.uk, mahmoudabdalghany@outlook.com, aaron@os.amperecomputing.com, cota@braap.org, stefanha@redhat.com, mohamad.gebai@gmail.com, kuhn.chenqun@huawei.com, matheus.ferst@eldorado.org.br Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" TCG types will be transformed into the appropriate host types later on in the tool. For example adding the following trace point: tcg goto_ptr(TCGv_ptr ptr) "", "ptr=%p" would trigger: ValueError: Error at /home/alex/lsrc/qemu.git/./trace-events:149: Argument type 'TCGv_ptr' is not allowed. Only standard C types and fixed size integer types should be used. struct, union, and other complex pointer types should be declared as 'void *' Rather than expand ALLOWED_TYPES just directly handle TCGv types in validate_type. Fixes: 73ff061032 ("trace: only permit standard C types and fixed size integer types") Signed-off-by: Alex Bennée Cc: Matheus Ferst Message-Id: <20210406165307.5993-1-alex.bennee@linaro.org> --- v2 - do workaround directly in validate_type --- scripts/tracetool/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.20.1 diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 5bc94d95cf..ce5fd23191 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -87,10 +87,9 @@ def out(*lines, **kwargs): "ssize_t", "uintptr_t", "ptrdiff_t", - # Magic substitution is done by tracetool - "TCGv", ] + def validate_type(name): bits = name.split(" ") for bit in bits: @@ -99,6 +98,10 @@ def validate_type(name): continue if bit == "const": continue + # Magic substitution of TCGv types will be done later + # using tracetool.transform.TCG_2_HOST + if bit.startswith("TCGv") and bit != "TCGv_vec": + continue if bit not in ALLOWED_TYPES: raise ValueError("Argument type '%s' is not allowed. " "Only standard C types and fixed size integer "