From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302036; cv=none; d=zohomail.com; s=zohoarc; b=mKsgAQjn9knLFEHk1RoHr/3Kv99psz8ii9NPWWcDDKuuWcBZvIAWiFR+9zQYFbzNZF56GfwPP+GcNXxyHSaBg0550u3qmJ90xpARTVC6gE/xWvlEwjSdzCwNxEnvYeKBtdkVVAwVYaLs0wTriuCM9fmh6ah5Ns8fHHCbfX3tZD8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302036; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=PwmylO98fPza1KeBnyuNGb07zbktOjohayPxUd8NRjw=; b=ZZFL7HTawZlwlQXBAYZKWEY8LmDv6FnXL6pO1z9G8LJBtnbKBm3HNWxzUNJcU23aGHfG51NfHtOkzaYuVXhZpRZ3H25ntBj1yoo9LZwgVlwBz6B3zbpKAPaSpYAS2cdflkXGijlI9IYxI8WSXl1LIMaGH98IyfO3l49j3d+yrXg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302036575332.43254065817416; Fri, 5 May 2023 08:53:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkd-0003Kh-QN; Fri, 05 May 2023 11:53:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkc-0003Ip-Pn for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:42 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxka-0008D0-Cg for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:41 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-2fc3f1d6f8cso1328984f8f.3 for ; Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x7-20020adfffc7000000b002c7066a6f77sm2785851wrs.31.2023.05.05.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A5A211FFBC; Fri, 5 May 2023 16:53:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PwmylO98fPza1KeBnyuNGb07zbktOjohayPxUd8NRjw=; b=kMqBJ3aSoK2JxBpKeOyv8zl5TZ/s89D8yIWkyV/7Gj8Joy8/7udTywJ/6BuoOtplBE fBh6sFwLEHIASImZpRW/WGILjtDdAJIsN4+Htv8UMDAcubxZavlDAQ4EK9gOr9mbUu4+ OsihSwDk1TiOaTEJhK6uy9yH5nGqmTGPlC7i+ugvDSCJ5ePhZQ3HtupqsAph2/CB2Fsg bx4XakNzfv3I8kt7lXWPHNctkW6IR5kaFnc+FLmjxJyKvHzF6W0tMT8IJdCGIYWtPtEz +sXmV2fAoDpMZI52lA8KEHSlTR7mqIkytAgEJ73NEBosuZyF99mNfpF+HqvYn+KTBDKo Jb/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PwmylO98fPza1KeBnyuNGb07zbktOjohayPxUd8NRjw=; b=RkpTY7Rs7oT8iDsxX+Si/6eZJ7+4emM06QXyZoAPNxLrMrX5Bv47IXGNeiJZfzwZBd xj7RAy2+jKh2RnDlZY4kt/LBP1CiBOsnOTNoTHg5NZrdvlHBceaoLydubABe1SXxbVA4 9kx04NuxZ27X9n9t5FV2KEeBxqi1wvaO04AJ+zeVfvjfuMAr7zlzSJ0WzFRbu7RgyjKX sXnMgd7nS+DI6faOY0iYpeD/k19C+3O0WoIUYdJESUaYujC9dy6K2ovR+eGIbcNXbSl5 IzLmrYW4dswHtzsWUWEPHK/GN33kOViZHuPAasqhVCuxdeoe3MUkEpttGLNtDRgX2vVC p5Fg== X-Gm-Message-State: AC+VfDz9Cfkdz5WkG5k5w0Kj15d1vOjCf+dQzicx6CIFTZgbD/TAw7Ki VGd3Ujv9a26WwsAhgrDXbLg+Eg== X-Google-Smtp-Source: ACHHUZ57QLeaBu8yF4X/f72MbTtMJuOUGY5sy0WbA8TCAV7O8ZXRfERTsRUKjGQ1oER7FvlWM4tVlw== X-Received: by 2002:adf:df0c:0:b0:307:5912:789 with SMTP id y12-20020adfdf0c000000b0030759120789mr1662967wrl.66.1683302018030; Fri, 05 May 2023 08:53:38 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 01/10] *-user: remove the guest_user_syscall tracepoints Date: Fri, 5 May 2023 16:53:27 +0100 Message-Id: <20230505155336.137393-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302037465100001 This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Message-Id: <20230420150009.1675181-2-alex.bennee@linaro.org> Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-2-alex.bennee@linaro.org> --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 2 -- trace-events | 19 ------------------- 3 files changed, 25 deletions(-) diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 90bda7631c..557f881a79 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - trace_guest_user_syscall(cpu, num, - arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); qemu_plugin_vcpu_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); @@ -36,7 +33,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, =20 static inline void record_syscall_return(void *cpu, int num, abi_long ret) { - trace_guest_user_syscall_ret(cpu, num, ret); qemu_plugin_vcpu_syscall_ret(cpu, num, ret); } =20 diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c8f998ecec..b0ae43766f 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, CPUState *cpu =3D env_cpu(cpu_env); abi_long ret; =20 - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6,= arg7, arg8); if (do_strace) { print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); } @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, if (do_strace) { print_freebsd_syscall_ret(num, ret); } - trace_guest_user_syscall_ret(cpu, num, ret); =20 return ret; } diff --git a/trace-events b/trace-events index b6b84b175e..691c3533e4 100644 --- a/trace-events +++ b/trace-events @@ -85,22 +85,3 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) =20 -# include/user/syscall-trace.h - -# @num: System call number. -# @arg*: System call argument value. -# -# Start executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64= _t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64= _t arg8) "num=3D0x%016"PRIx64" arg1=3D0x%016"PRIx64" arg2=3D0x%016"PRIx64" = arg3=3D0x%016"PRIx64" arg4=3D0x%016"PRIx64" arg5=3D0x%016"PRIx64" arg6=3D0x= %016"PRIx64" arg7=3D0x%016"PRIx64" arg8=3D0x%016"PRIx64 - -# @num: System call number. -# @ret: System call result value. -# -# Finish executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=3D0x%016"PRIx= 64" ret=3D0x%016"PRIx64 --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302101; cv=none; d=zohomail.com; s=zohoarc; b=Jot4tZTzuCY7Idc702O/dxN7IpBU6TRBm3V28NZduPnwVhgqMU2G8VVjI6Vr+nGX8+N4VAhE4xQEmOa78Oxr4xOhuI29HahQXpw4vuelfpxOpClwIvJIP8uEY6rs9p0erBLe52WQS3jj8sfy33QQpa8YSgSwEmKYO6GVmHeht24= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302101; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=TsGN9prt8osm9VQZgi8H8LV+4evMbL7nTG0Pg3a7rCfCOxf7d2uxMsXSOtb4ZTvkbJCJcJctddtSDc4nsaxffnRs3gTC3fR8eq/OZKuuHh/lO6J/eNiEbfNBCCvAHWsV0JrHnYev2jbCx5Mw8emZHMFoi6IgfTUTk4fh6gjiEIQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302101173800.7842074981421; Fri, 5 May 2023 08:55:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkg-0003Mj-Or; Fri, 05 May 2023 11:53:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkc-0003Iq-PP for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:42 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxka-0008D1-Cb for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:41 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f315712406so104946965e9.0 for ; Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k12-20020a7bc40c000000b003f175b360e5sm8386081wmi.0.2023.05.05.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C85461FFBD; Fri, 5 May 2023 16:53:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=UwtBDGfT0wbs+Trr1+c1inCCOobVWyJzt1y02qHV6NALVzEY05Co3EOEDcq8NizorT ACZwJRuW3O4KBb7wcrBc5oxOwJdYEggQaSRdTrJ/NSL7V64XY9RHi/6CSh8JLhWW1x9I aWpCkiavVxTlic4xJuP3h6t51yRgzQVXKlSHfLLiSjD4pkIb/ojmqYLhiyapxXMKYQw9 LUtIc0XcR8xsIUfkEv3cyfHeFK6T2foljdtizEjBLYF4VSTex9U6gj0tXLppYpvQnGQ1 A5aPf8Zx/G/MFqKK4YAd3Y11gonRbzi4wCQSpJF0B9gjXzqwN5Bk0eT0grnjR+Kud8eH /A+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302018; x=1685894018; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fP88xWRTq0YOoukl2eZvLZM8OkmfjfHbQrJlI+FEzEo=; b=SSlvPXAYCfvVofc7NRVW+aBqlBo/Vwemho5JAQTaaMFXwjiruAtq7BA57jTvbxt0HQ nnBbBWkXESiLiiiU/3rg+9McH0xlijWUXVmVrGsWIryxVBpi2xHtvP+fy+jFLzC48IpQ K7JD8oWJK1IqcTYrnqr2rgnkvSfE7LNFYR2W75cdFIFxZjETm9b8IuhZg79STrK6aR2/ qUK1BUm60JKPENKYFKUvSArQjAJX4GlVOI8QkQFXltEQRhdf169I/t+rDNr9sFg8G0IG 8ZyXpQA/+MaSEc1YkmiCCVChqM/9SseceXJJZzi/183MzuB1ylU0THuVCSd0AqWBgdaB 8/tQ== X-Gm-Message-State: AC+VfDwdJm4R1SO92pH23JOM07Wo7J+2MmESnFcG9BpwrDDBgVzarWpk GVvJgS0+tvESi8ucJK6bYCtQSQ== X-Google-Smtp-Source: ACHHUZ4tafTL1vYsv+qkCFCePYhNZYkIwV1IJoKpONFqL2fIy1Jelan/J3MUZ/52OkO0UoPgu0ITLQ== X-Received: by 2002:a7b:c398:0:b0:3f2:5be3:cd6b with SMTP id s24-20020a7bc398000000b003f25be3cd6bmr1696914wmj.3.1683302018198; Fri, 05 May 2023 08:53:38 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 02/10] trace-events: remove the remaining vcpu trace events Date: Fri, 5 May 2023 16:53:28 +0100 Message-Id: <20230505155336.137393-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302101659100001 While these are all in helper functions being designated vcpu events complicates the removal of the dynamic vcpu state code. TCG plugins allow you to instrument vcpu_[init|exit|idle]. We rename cpu_reset and make it a normal trace point. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-3-alex.bennee@linaro.org> --- v3 - s/watch/trace/ in commit msg --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" =20 CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); =20 - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } =20 static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index 232c97a4a1..c6132f243f 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -145,5 +145,4 @@ void trace_init_vcpu(CPUState *vcpu) } } } - trace_guest_cpu_enter(vcpu); } diff --git a/trace/control.c b/trace/control.c index 6c77cc6318..d24af91004 100644 --- a/trace/control.c +++ b/trace/control.c @@ -277,8 +277,6 @@ void trace_fini_vcpu(CPUState *vcpu) TraceEventIter iter; TraceEvent *ev; =20 - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { if (trace_event_is_vcpu(ev) && diff --git a/hw/core/trace-events b/hw/core/trace-events index 56da55bd71..2cf085ac66 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -29,3 +29,6 @@ clock_set(const char *clk, uint64_t old, uint64_t new) "'= %s', %"PRIu64"Hz->%"PRI clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t hz, int cb) "'%s',= src=3D'%s', val=3D%"PRIu64"Hz cb=3D%d" clock_set_mul_div(const char *clk, uint32_t oldmul, uint32_t mul, uint32_t= olddiv, uint32_t div) "'%s', mul: %u -> %u, div: %u -> %u" + +# cpu-common.c +cpu_reset(int cpu_index) "%d" diff --git a/trace-events b/trace-events index 691c3533e4..dd318ed1af 100644 --- a/trace-events +++ b/trace-events @@ -54,34 +54,3 @@ qmp_job_resume(void *job) "job %p" qmp_job_complete(void *job) "job %p" qmp_job_finalize(void *job) "job %p" qmp_job_dismiss(void *job) "job %p" - - -### Guest events, keep at bottom - - -## vCPU - -# trace/control-target.c - -# Hot-plug a new virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_enter(void) - -# trace/control.c - -# Hot-unplug a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_exit(void) - -# hw/core/cpu.c - -# Reset the state of a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_reset(void) - --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302085; cv=none; d=zohomail.com; s=zohoarc; b=Jk2Z8sCCpCrU/HCAmTfubTZtjDkuhLpVc+C31fzlrkcXviSRrI+NTqsRp8RJq2utoqOUByBehYYT8qXE+qxQrXhxg7WTVkpHVz1AE53+w1zzZcdNk79zW41ALYFVD0RG0tlINE2gajm20CE7SRXvMrBKwLd5xWonc3kA/5HPkcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302085; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qAFQ031yGy5vt+cv99TuLZYWxa/7CHKpt1ksqvu+PW8=; b=aPsYdpkkruQJe5Kr1LBHO/HaXwYhr2I1hQ4Yby1w8Yyy/LQuGWv/6CklG1/zY1ly2hh83rjou0xBr5LborTPFl/Ok7AdkwzYfGKpf1pLTs/k0IzPPTS1Ae+VES0QMlyWy12yDObZLJlz05+ZoNnO4nKVi2vSODtzgeYCMJrsv/0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16833020854621004.206203683086; Fri, 5 May 2023 08:54:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkk-0003Ow-1w; Fri, 05 May 2023 11:53:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxke-0003L5-Gi for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:44 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkb-0008DC-Ko for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:44 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f1e2555b5aso14088265e9.0 for ; Fri, 05 May 2023 08:53:41 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id 16-20020a05600c021000b003f198dfbbfcsm8388866wmi.19.2023.05.05.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E7B0B1FFBE; Fri, 5 May 2023 16:53:36 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qAFQ031yGy5vt+cv99TuLZYWxa/7CHKpt1ksqvu+PW8=; b=CYgX7BTAhfKfZdpt9UR9Z9dDXlCwcarlJocXGc66T1oDZEOPWKG+geAZdaulnk3A8x nHklGgRmk2c8RzB2QsgPJKcAGgqZJcoN5jfgspzsqR2G+q2GsZQWwhHp+lpdh8FcG3wf XbBm217N9AV3yqe4+6JJDqIP6HkIzq+uG1ekUmdbi2MnS673A+MHhCTsh9CSY7vpGZmN rq+D0V40HogmOfY7HTfbxr9MIcUSaTkwSxDR1rx4/893omsT9weOuNTIGBMQUIVyNFLQ tLt4OotagF99tH2V0yEi7cWJuEtDWrFhkJtdxu2oBqjonW1eUFLnUv5hzFYa1FljToXq YAIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qAFQ031yGy5vt+cv99TuLZYWxa/7CHKpt1ksqvu+PW8=; b=UO5ufPSRwEeUBc9178442XmvH9bZ3ezQKGtpdD/v9+ImntmiD2g0muPtyGVxRUVMSF IqtIpxW8x/rV/hvfxjE59rbracBlJIYiFJVjNSjEmvipKF0JYzLmaV7CZk8Mesy5rLLv 30WR9GJ62nVL6K91UZbjo+GMEedAYMPP71/iY/b4B5G36N5OOHOzmp2G0IzHQZ542747 s9fZ9RD5CRQDS/7uZqIWuobIo9bS7mQ4dcL3E7pHYvJJAI4LeLqogLpvHeoX7mB2Odlt QsRZxnK19wg8F7fp7AZrk7s9/jgbz2IogFN+AQkL60IO33EAyYVoJXsJi7x3ZpXhNVF6 CNJA== X-Gm-Message-State: AC+VfDyuFUC4rJypjYYz898iqqXNlj3vhsE6u7XOwT7PQu7CmlfXYkYt LQSP71Oomt19U41/WQEh6faRQw== X-Google-Smtp-Source: ACHHUZ6vpRrIqRoQN2FvHo6bL1tPbKc1EI+5yqJ3HCTJCAg2dzWJIFwvenh3QapyO1KBZAZhYMajYA== X-Received: by 2002:a7b:c84b:0:b0:3f3:fe82:ee89 with SMTP id c11-20020a7bc84b000000b003f3fe82ee89mr1318469wml.8.1683302019060; Fri, 05 May 2023 08:53:39 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Fri, 5 May 2023 16:53:29 +0100 Message-Id: <20230505155336.137393-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302086811100001 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *e= v) =20 static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } =20 static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id !=3D TRACE_VCPU_EVENT_NONE; + return false; } =20 static inline const char * trace_event_get_name(TraceEvent *ev) diff --git a/trace/event-internal.h b/trace/event-internal.h index f63500b37e..0c24e01b52 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -19,7 +19,6 @@ /** * TraceEvent: * @id: Unique event identifier. - * @vcpu_id: Unique per-vCPU event identifier. * @name: Event name. * @sstate: Static tracing state. * @dstate: Dynamic tracing state @@ -33,7 +32,6 @@ */ typedef struct TraceEvent { uint32_t id; - uint32_t vcpu_id; const char * name; const bool sstate; uint16_t *dstate; diff --git a/trace/control.c b/trace/control.c index d24af91004..5dfb609954 100644 --- a/trace/control.c +++ b/trace/control.c @@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events) size_t i; for (i =3D 0; events[i] !=3D NULL; i++) { events[i]->id =3D next_id++; - if (events[i]->vcpu_id =3D=3D TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id =3D next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups =3D g_renew(TraceEventGroup, event_groups, nevent_groups = + 1); event_groups[nevent_groups].events =3D events; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index c390c1844a..69edf0d588 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -32,19 +32,13 @@ def generate(events, backend, group): out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) =20 for e in events: - if "vcpu" in e.properties: - vcpu_id =3D 0 - else: - vcpu_id =3D "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s =3D {', ' .id =3D 0,', - ' .vcpu_id =3D %(vcpu_id)s,', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s ', '};', event =3D e.api(e.QEMU_EVENT), - vcpu_id =3D vcpu_id, name =3D e.name, sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), dstate =3D e.api(e.QEMU_DSTATE)) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..285d7b03a9 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -74,16 +74,7 @@ def generate(events, backend, group): =20 out('}') =20 - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu =3D next(iter(e.args))[1] - cond =3D "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=3Dtrace_cpu, - id=3De.name.upper()) - else: - cond =3D "true" + cond =3D "true" =20 out('', 'static inline void %(api)s(%(args)s)', --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302136; cv=none; d=zohomail.com; s=zohoarc; b=Vt2/iWNv/KnRyDNJx3DTCsMWggMdjpJUoFjXmbtbRwFcAGgy06fnw6K1zAsIJuQguI8eDHSMGrDfw7cjeImu4z4Sn5W+1eBcREFptUnAJIPsviQUdZsNDUg4B8jvJwP6mhoO93o10WHZFNurwm7qNEt4CtZV87L6duqFYsy1PHQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302136; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Uhx8xf/tUsvgHorzJjHLi5H+bMJr8MaQ/Qyfkil5mMk=; b=mojKk3UZbe1l71cvgXBtt6uvOMsq1ODLE9Lpicd+tUe784gumPP+BO28LExtOpryYGEblbx20P/f5ZIoTPsClDq4x7/pFtcbwjb205ZdVpnb8q2ETMZVpAYlH6mVsyS14pw2ajT5kEl4yLzZxSaxaj1piYqIEjwVk/vp1Z8+dJE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302136630840.1150813960178; Fri, 5 May 2023 08:55:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxke-0003LS-NC; Fri, 05 May 2023 11:53:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkd-0003Jg-8k for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:43 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxka-0008DD-Dw for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:42 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-30771c68a9eso1477720f8f.2 for ; Fri, 05 May 2023 08:53:40 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v1-20020adff681000000b003047297a5e8sm2756925wrp.54.2023.05.05.08.53.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0B3851FFBF; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Uhx8xf/tUsvgHorzJjHLi5H+bMJr8MaQ/Qyfkil5mMk=; b=jxQT7RAnRiG+4jZWepXpJwwqyv1KyR0mYc+xl8K2zGZmMTT2NN1ZlH8jHLiSgONI0c Ouqxu2+vgaAg41DJy+2/lrstpWTiZlgXgDxAJmN27nt4iJydj7zD3DNq7SZlbZXE7Raa PM3Sm8ScRO541hN/9vIlwjSQDG4iyqwN4N/aMYMnFEb4Zxt/8CEUhSkmlg/tKHodPauB 2xkFoXG5NLicCJL4/Nk/hUjF5zlC4EHfWV2NNTOkU+Kwhl098hm5rfDUWoYMtKhm/XvS AZElG/dQzuvIUqv87OI4u/kIh46Rx8m2Poe2wbMebQcACMg7loYxH7yOLY8vKylh2d0Y 5CYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Uhx8xf/tUsvgHorzJjHLi5H+bMJr8MaQ/Qyfkil5mMk=; b=PGPn/aEdoaKbDsAGY0Ur+PMDQAaJhlncI6p9t2Urb6VmjK2Nt02iCFB0yAzs0Ax4He BHlW0rdWqpxODo06OMz1L16mIzwcZx5nUF1m/LP0cZAAWxt3IdHCh7XxM3SLfTytYSBe WfkfrifmRjAk+8h+dWyvRTqYJRJEUuh1NOIy7d26Ui7dTWKsDOVLQ5n3y1uUE2nkHZEh xYI5azvS6WPq/1jW+XVknZvxtrudsKGdQrYLv3+s5O6rv7cc0iqlG+rnR3kLNIouZY6U EGuSjd/NAKlP9tFzj4VHgcOuxLj/stVImDsJZXpEKNkCPWOQUy5XSMnPaA01GVZH4wjC r+oA== X-Gm-Message-State: AC+VfDwpmhCTnRIgTY2vF1BiLlJNpMv0KG2W99KiHWAn/wcnRzLgG5KP 8bAw2KQMQ/P5xcuarbteS2DZVQ== X-Google-Smtp-Source: ACHHUZ6W8k4PVy/as8I8u8Zze+cgI00CESukf0Fi8L7Qqk9fUnFLqdraeChi+jaw5noonBKKXhgr/g== X-Received: by 2002:a5d:4309:0:b0:306:492c:cdd8 with SMTP id h9-20020a5d4309000000b00306492ccdd8mr1596190wrq.15.1683302019226; Fri, 05 May 2023 08:53:39 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 04/10] scripts/qapi: document the tool that generated the file Date: Fri, 5 May 2023 16:53:30 +0100 Message-Id: <20230505155336.137393-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302138718100003 This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-5-alex.bennee@linaro.org> --- scripts/qapi/gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..e724507e1a 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -162,7 +162,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): =20 def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by QAPIGenC, DO NOT MODIFY */ =20 /* %(blurb)s @@ -195,7 +195,7 @@ def _bottom(self) -> str: =20 class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\= n\n' + return super()._top() + '# AUTOMATICALLY GENERATED by QAPIGenTrace= , DO NOT MODIFY\n\n' =20 =20 @contextmanager --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302041; cv=none; d=zohomail.com; s=zohoarc; b=gwWzzySZ2l4XL0DiX+mKmUEv3hRmQVwbJHGipLXRs6x0/+9WI0u/NTQdnbvX5sdUbMmSRq6qrhHTa65l0fezTpEc3gqpEkTRYJmHloEtcVTku/zSRN6f9nNo9bYMqRjjWnOgTLhuIUvycyF7Y+vUZG7YvtHkiol/483UfBebwiI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302041; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v20eKJJJVW047Oo0oTM1wQXqOht2ZgPK9mBl9bJ8pSc=; b=J6Yxjs5RwlVzIMd9uS+u3/z0HbvqT6b7GqmF6cNDg7zZsBUjG3hvSSiZHXRyzFoedRbzeQIChDZCwLH3hGngCiCQJJnjFf+dzT9KBdMlbO9byiKkG5TDGnFHraG8P5NhcsmMVAZNW+8Z5WR8WiROL1VcycsVnCpsEbDsOTWONHU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302041760309.213280227249; Fri, 5 May 2023 08:54:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkk-0003PO-LZ; Fri, 05 May 2023 11:53:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxke-0003LR-LT for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:44 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkc-0008DF-Cm for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:44 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-2f95231618aso1335725f8f.1 for ; Fri, 05 May 2023 08:53:40 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n2-20020a05600c294200b003f17eded97bsm8391476wmd.19.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 236B31FFC0; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v20eKJJJVW047Oo0oTM1wQXqOht2ZgPK9mBl9bJ8pSc=; b=VLlTXE2z8p9t2Sm42UpKGi9VxkBaSZTpMnPl9EnsCEgNHMWALAr1NYn9gVwyac3Wn8 JfydF7+E5vl2ncV3KOjfuHwmH2IZ9dPSTP2RGWK9Y9ZGCP8grvUyy5kwU9ehWM8nRT5Z hv7WjhmQXwzTXBSmgoKTCrBP3wINIVLBni1ywcC1iWh4mk4xrjW0eNl782EJTCPJz2kP 7/lYwbLqrk8v+B8/zX6M25yvXJDVzbziaRyvUjvM8R8wgwmtEdESuBddIG5yfLtS3btu brvtgLXlphhgTZ9xCd929602JuDqeV/CnJ7PqbXHakNb0IznPYuSZNUBrCGaOvVHNiIG B5nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302019; x=1685894019; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v20eKJJJVW047Oo0oTM1wQXqOht2ZgPK9mBl9bJ8pSc=; b=kSkEOUNRDVOU+pspVoPk7HB7u53MuqC7RYfBgQV6gbJJoUT21mL+wfJkNIsMdYpZ6m wPZ3gq+fGXBm6rYUS/fdXzE+qu/aJCuvic1L2+k+RI2qbds1E2fhu4omZE2HNYWKIiZu bE7Rk6IxMy5f5R/am14HHS8vH5HGMbE41SRDrsauOZB1vWIdXOY1aKwoeZWlHIWl0HnP XV42zdMkfC56wvwmrRaO9Qgob/R6zkWd4OrRL21c4dOugRFWEaHcsAOeOb2jhUDI8zJA FUlCRLWkmLv02d3ckwqtbVOQzlRCqHzi5fBWkLFChLiCqbCWe4P1vc3NPu42e/ItZqQU Lckw== X-Gm-Message-State: AC+VfDw8IZlAW1ZJVQCFzg6U+jNrQzdMTgYFaaFAql+quyt9hco6bDOl d0fiK4tm1cAWGQCdsuK5WtAMYw== X-Google-Smtp-Source: ACHHUZ4zNCPyQq7DcRZnTPcpiLKgVNGNqUmqgx+30CR39ciIkuxnGAozXGeWiJaPzeZaEZxIlW7Zhg== X-Received: by 2002:a5d:6711:0:b0:306:39f5:e1a8 with SMTP id o17-20020a5d6711000000b0030639f5e1a8mr1687533wru.14.1683302019526; Fri, 05 May 2023 08:53:39 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Fri, 5 May 2023 16:53:31 +0100 Message-Id: <20230505155336.137393-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302043472100001 I don't think I can remove the parameters directly but certainly mark them as deprecated. Message-Id: <20230420150009.1675181-6-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-6-alex.bennee@linaro.org> --- qapi/trace.json | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/qapi/trace.json b/qapi/trace.json index f425d10764..de6b1681aa 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -33,9 +33,9 @@ # # @name: Event name. # @state: Tracing state. -# @vcpu: Whether this is a per-vCPU event (since 2.7). +# @vcpu: Whether this is a per-vCPU event (deprecated since 8.1). # -# An event is per-vCPU if it has the "vcpu" property in the "trace-events" +# There are no longer any events with the "vcpu" property in the "trace-ev= ents" # files. # # Since: 2.2 @@ -49,19 +49,15 @@ # Query the state of events. # # @name: Event name pattern (case-sensitive glob). -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (deprecated since 8.1). # # Returns: a list of @TraceEventInfo for the matching events # # An event is returned if: # # - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. # -# Therefore, if @vcpu is given, the operation will only match per= -vCPU events, -# returning their state on the specified vCPU. Special case: if @= name is an -# exact match, @vcpu is given and the event does not have the "vc= pu" property, -# an error is returned. +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -84,17 +80,13 @@ # @name: Event name pattern (case-sensitive glob). # @enable: Whether to enable tracing. # @ignore-unavailable: Do not match unavailable events with @name. -# @vcpu: The vCPU to act upon (all by default; since 2.7). +# @vcpu: The vCPU to act upon (deprecated since 8.1). # # An event's state is modified if: # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# - its name matches the @name pattern # -# Therefore, if @vcpu is given, the operation will only match per-vCPU eve= nts, -# setting their state on the specified vCPU. Special case: if @name is an = exact -# match, @vcpu is given and the event does not have the "vcpu" property, an -# error is returned. +# There are no longer and per-vCPU events so specifying it will never matc= h. # # Since: 2.2 # --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302065; cv=none; d=zohomail.com; s=zohoarc; b=Owhu+2/oplOzz3K4OuwSlUpPJ6vRCBFW3cTIBTrcbUWpsuLU/jvVbw8z59Qu4u4Nz/wGjS39vQnsHXb3ZhxaEq7+7ZUnjnV3OilUv7VvpQAq32dtdQTPmPXapddwL8wFBJ81F3vgGJ38Jdsd8Yvbk2pIvXhJW59n4to1ySf0x+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302065; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=vwm6ODnzL49DruhubxW/tH362era7sBWDRPYlZnVub8=; b=kHn9Vbjabsb9xntBbN04SvYx4E6xARQFFfPUNmBAZM/3Y0nEmOhizOGY8B+ukn9JfRvf4fCdc4l5enb0IfB6R1sdZFU5ss5zVMLjSHIbe7rFKNuP9oCIO6rQPBjt4cLDOJHaF6HaGR2QEngoiOc1j18AxvCqg2DnET3lftHx5vE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302065056812.5749148075473; Fri, 5 May 2023 08:54:25 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkl-0003Pm-8e; Fri, 05 May 2023 11:53:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkg-0003Ly-EM for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:46 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkc-0008DN-Aw for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:45 -0400 Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-306dbad5182so1334866f8f.1 for ; Fri, 05 May 2023 08:53:41 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id t14-20020a5d460e000000b003047ae72b14sm2778183wrq.82.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 50F9C1FFC1; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vwm6ODnzL49DruhubxW/tH362era7sBWDRPYlZnVub8=; b=IIE18W69bfYDJRBYSEH0eT4nQ9mcHyuLnV5PK97KgAYrFMkykTKkCJNGzhDfvX33cg 1BskWAQInGzI+YxN6eBzFaJJGuapjdgCUJiDbm9U6OdoODrkCsggvh0k6j+A05I5BMNH UDvDmiwVQKuJ81aGiZug9sO1yoNZge6dXd3Jezhjl7Sr3cyaOsaiaxE4zCYWJ9oNHuHR xzpjMSNAO1jkkVtwZG8C6hMFbs2rBCyNPJ8bwLnvdFiGDWWB90b3m16HLu1QRBuP3pPd u76gC5z7o4FsX9p7XSpzPlDH79ktWgntOFfTlvs6IuOSyDASV/CVMK7bepf3E27fsYRV uLmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vwm6ODnzL49DruhubxW/tH362era7sBWDRPYlZnVub8=; b=BR/2zqd8MnkZskd2xuKY9W/jxyTtZJMxMLMBrJZlhN0mhb7J9Tetmmzm3XzZySiZJL irGGGAy5aW7/MhQ0omnURHjEVMInuGPF0PO2IlVrcap9UHRbDcW4rJG7yMZu4h5Oxl/+ mqDL1QIaQQBGs7qPScDWEhTD44c/TgTew/nS36CDI07C6GMAeoTa97hoU4gwKI4e0NRu vzWYIPXoDsBkCIxCEPP5GkOl5rF3pjfCam0uDaXviRI3loCHn9YoqxRyu93sXj22itOr bPbCMvCrKol5LNJ8A+hlZgprGh25I9kMH+tom+M41NnYgKIgGrbAhD3KB3TmqoAysuBg eSXA== X-Gm-Message-State: AC+VfDyqwgt5fO7SPB4xkhHTToILpmCCKbwgITszXUtNxprEQSlUGHb7 4hpWnaQqijSBIYQIFRhpZDPEXQ== X-Google-Smtp-Source: ACHHUZ7w8+0VCtXQ1tIV5OW5Hz9kLIBgHUWKqgIzmuJvqJUVNJInFzGq80pYVZszStJ55kLSkI4HFg== X-Received: by 2002:adf:f0c2:0:b0:2f9:c2ab:e1de with SMTP id x2-20020adff0c2000000b002f9c2abe1demr1638142wro.14.1683302020623; Fri, 05 May 2023 08:53:40 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 06/10] trace: remove code that depends on setting vcpu Date: Fri, 5 May 2023 16:53:32 +0100 Message-Id: <20230505155336.137393-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302065840100003 Now we no longer have any events that are for vcpus we can start excising the code from the trace control. As the vcpu parameter is encoded as part of QMP we just stub out the has_vcpu/vcpu parameters rather than alter the API. Message-Id: <20230420150009.1675181-7-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-7-alex.bennee@linaro.org> --- trace/control-internal.h | 10 ---- trace/control-vcpu.h | 16 ------ trace/control.h | 48 ----------------- hw/core/cpu-common.c | 2 - stubs/trace-control.c | 13 ----- trace/control-target.c | 110 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++----------------------- trace/trace-hmp-cmds.c | 17 +----- 9 files changed, 19 insertions(+), 287 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 0178121720..8d818d359b 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -25,16 +25,6 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) return ev->id; } =20 -static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) -{ - return 0; -} - -static inline bool trace_event_is_vcpu(TraceEvent *ev) -{ - return false; -} - static inline const char * trace_event_get_name(TraceEvent *ev) { assert(ev !=3D NULL); diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h index 0f98ebe7b5..800fc5a219 100644 --- a/trace/control-vcpu.h +++ b/trace/control-vcpu.h @@ -30,13 +30,6 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ vcpu, _ ## id ## _EVENT.vcpu_id)) =20 -/** - * trace_event_get_vcpu_state_dynamic: - * - * Get the dynamic tracing state of an event for the given vCPU. - */ -static bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, TraceEvent = *ev); - #include "control-internal.h" =20 static inline bool @@ -51,13 +44,4 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *= vcpu, } } =20 -static inline bool trace_event_get_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev) -{ - uint32_t vcpu_id; - assert(trace_event_is_vcpu(ev)); - vcpu_id =3D trace_event_get_vcpu_id(ev); - return trace_event_get_vcpu_state_dynamic_by_vcpu_id(vcpu, vcpu_id); -} - #endif diff --git a/trace/control.h b/trace/control.h index 23b8393b29..dfd209edd8 100644 --- a/trace/control.h +++ b/trace/control.h @@ -89,23 +89,6 @@ static bool trace_event_is_pattern(const char *str); */ static uint32_t trace_event_get_id(TraceEvent *ev); =20 -/** - * trace_event_get_vcpu_id: - * - * Get the per-vCPU identifier of an event. - * - * Special value #TRACE_VCPU_EVENT_NONE means the event is not vCPU-specif= ic - * (does not have the "vcpu" property). - */ -static uint32_t trace_event_get_vcpu_id(TraceEvent *ev); - -/** - * trace_event_is_vcpu: - * - * Whether this is a per-vCPU event. - */ -static bool trace_event_is_vcpu(TraceEvent *ev); - /** * trace_event_get_name: * @@ -172,21 +155,6 @@ static bool trace_event_get_state_dynamic(TraceEvent *= ev); */ void trace_event_set_state_dynamic(TraceEvent *ev, bool state); =20 -/** - * trace_event_set_vcpu_state_dynamic: - * - * Set the dynamic tracing state of an event for the given vCPU. - * - * Pre-condition: trace_event_get_vcpu_state_static(ev) =3D=3D true - * - * Note: Changes for execution-time events with the 'tcg' property will no= t be - * propagated until the next TB is executed (iff executing in TCG mo= de). - */ -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state); - - - /** * trace_init_backends: * @@ -205,22 +173,6 @@ bool trace_init_backends(void); */ void trace_init_file(void); =20 -/** - * trace_init_vcpu: - * @vcpu: Added vCPU. - * - * Set initial dynamic event state for a hot-plugged vCPU. - */ -void trace_init_vcpu(CPUState *vcpu); - -/** - * trace_fini_vcpu: - * @vcpu: Removed vCPU. - * - * Disable dynamic event state for a hot-unplugged vCPU. - */ -void trace_fini_vcpu(CPUState *vcpu); - /** * trace_list_events: * @f: Where to send output. diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 951477a7fd..f4e51c8a1b 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -211,7 +211,6 @@ static void cpu_common_realizefn(DeviceState *dev, Erro= r **errp) } =20 /* NOTE: latest generic point where the cpu is fully realized */ - trace_init_vcpu(cpu); } =20 static void cpu_common_unrealizefn(DeviceState *dev) @@ -219,7 +218,6 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu =3D CPU(dev); =20 /* NOTE: latest generic point before the cpu is fully unrealized */ - trace_fini_vcpu(cpu); cpu_exec_unrealizefn(cpu); } =20 diff --git a/stubs/trace-control.c b/stubs/trace-control.c index 7f856e5c24..b428f34c87 100644 --- a/stubs/trace-control.c +++ b/stubs/trace-control.c @@ -36,16 +36,3 @@ void trace_event_set_state_dynamic(TraceEvent *ev, bool = state) } } } - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - /* should never be called on non-target binaries */ - abort(); -} - -void trace_init_vcpu(CPUState *vcpu) -{ - /* should never be called on non-target binaries */ - abort(); -} diff --git a/trace/control-target.c b/trace/control-target.c index c6132f243f..1ae582af17 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -35,114 +35,22 @@ void trace_event_set_state_dynamic_init(TraceEvent *ev= , bool state) =20 void trace_event_set_state_dynamic(TraceEvent *ev, bool state) { - CPUState *vcpu; assert(trace_event_get_state_static(ev)); - if (trace_event_is_vcpu(ev) && likely(first_cpu !=3D NULL)) { - CPU_FOREACH(vcpu) { - trace_event_set_vcpu_state_dynamic(vcpu, ev, state); - } - } else { - /* - * Without the "vcpu" property, dstate can only be 1 or 0. With it= , we - * haven't instantiated any vCPU yet, so we will set a global state - * instead, and trace_init_vcpu will reconcile it afterwards. - */ - bool state_pre =3D *ev->dstate; - if (state_pre !=3D state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate =3D 1; - } else { - trace_events_enabled_count--; - *ev->dstate =3D 0; - } - } - } -} =20 -static void trace_event_synchronize_vcpu_state_dynamic( - CPUState *vcpu, run_on_cpu_data ignored) -{ - bitmap_copy(vcpu->trace_dstate, vcpu->trace_dstate_delayed, - CPU_TRACE_DSTATE_MAX_EVENTS); - tcg_flush_jmp_cache(vcpu); -} - -void trace_event_set_vcpu_state_dynamic(CPUState *vcpu, - TraceEvent *ev, bool state) -{ - uint32_t vcpu_id; - bool state_pre; - assert(trace_event_get_state_static(ev)); - assert(trace_event_is_vcpu(ev)); - vcpu_id =3D trace_event_get_vcpu_id(ev); - state_pre =3D test_bit(vcpu_id, vcpu->trace_dstate); + /* + * There is no longer a "vcpu" property, dstate can only be 1 or + * 0. With it, we haven't instantiated any vCPU yet, so we will + * set a global state instead, and trace_init_vcpu will reconcile + * it afterwards. + */ + bool state_pre =3D *ev->dstate; if (state_pre !=3D state) { if (state) { trace_events_enabled_count++; - set_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)++; + *ev->dstate =3D 1; } else { trace_events_enabled_count--; - clear_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)--; - } - if (vcpu->created) { - /* - * Delay changes until next TB; we want all TBs to be built fr= om a - * single set of dstate values to ensure consistency of genera= ted - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dyna= mic, - RUN_ON_CPU_NULL); - } else { - trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NU= LL); - } - } -} - -static bool adding_first_cpu1(void) -{ - CPUState *cpu; - size_t count =3D 0; - CPU_FOREACH(cpu) { - count++; - if (count > 1) { - return false; - } - } - return true; -} - -static bool adding_first_cpu(void) -{ - bool res; - cpu_list_lock(); - res =3D adding_first_cpu1(); - cpu_list_unlock(); - return res; -} - -void trace_init_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - trace_event_iter_init_all(&iter); - while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_state_dynamic(ev)) { - if (adding_first_cpu()) { - /* check preconditions */ - assert(*ev->dstate =3D=3D 1); - /* disable early-init state ... */ - *ev->dstate =3D 0; - trace_events_enabled_count--; - /* ... and properly re-enable */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } else { - trace_event_set_vcpu_state_dynamic(vcpu, ev, true); - } + *ev->dstate =3D 0; } } } diff --git a/trace/control.c b/trace/control.c index 5dfb609954..1a48a7e266 100644 --- a/trace/control.c +++ b/trace/control.c @@ -262,22 +262,6 @@ void trace_init_file(void) #endif } =20 -void trace_fini_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - - trace_event_iter_init_all(&iter); - while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (trace_event_is_vcpu(ev) && - trace_event_get_state_static(ev) && - trace_event_get_vcpu_state_dynamic(vcpu, ev)) { - /* must disable to affect the global counter */ - trace_event_set_vcpu_state_dynamic(vcpu, ev, false); - } - } -} - bool trace_init_backends(void) { #ifdef CONFIG_TRACE_SIMPLE diff --git a/trace/qmp.c b/trace/qmp.c index 3b4f4702b4..aa760f1fc4 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -13,20 +13,7 @@ #include "control-vcpu.h" =20 =20 -static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp) -{ - if (has_vcpu) { - CPUState *cpu =3D qemu_get_cpu(vcpu); - if (cpu =3D=3D NULL) { - error_setg(errp, "invalid vCPU index %u", vcpu); - } - return cpu; - } else { - return NULL; - } -} - -static bool check_events(bool has_vcpu, bool ignore_unavailable, bool is_p= attern, +static bool check_events(bool ignore_unavailable, bool is_pattern, const char *name, Error **errp) { if (!is_pattern) { @@ -38,12 +25,6 @@ static bool check_events(bool has_vcpu, bool ignore_unav= ailable, bool is_pattern return false; } =20 - /* error for non-vcpu event */ - if (has_vcpu && !trace_event_is_vcpu(ev)) { - error_setg(errp, "event \"%s\" is not vCPU-specific", name); - return false; - } - /* error for unavailable event */ if (!ignore_unavailable && !trace_event_get_state_static(ev)) { error_setg(errp, "event \"%s\" is disabled", name); @@ -70,22 +51,13 @@ TraceEventInfoList *qmp_trace_event_get_state(const cha= r *name, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err =3D NULL; TraceEventInfoList *events =3D NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern =3D trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu =3D get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return NULL; - } =20 /* Check events */ - if (!check_events(has_vcpu, true, is_pattern, name, errp)) { + if (!check_events(true, is_pattern, name, errp)) { return NULL; } =20 @@ -93,33 +65,17 @@ TraceEventInfoList *qmp_trace_event_get_state(const cha= r *name, trace_event_iter_init_pattern(&iter, name); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { TraceEventInfo *value; - bool is_vcpu =3D trace_event_is_vcpu(ev); - if (has_vcpu && !is_vcpu) { - continue; - } =20 value =3D g_new(TraceEventInfo, 1); - value->vcpu =3D is_vcpu; value->name =3D g_strdup(trace_event_get_name(ev)); =20 if (!trace_event_get_state_static(ev)) { value->state =3D TRACE_EVENT_STATE_UNAVAILABLE; } else { - if (has_vcpu) { - if (is_vcpu) { - if (trace_event_get_vcpu_state_dynamic(cpu, ev)) { - value->state =3D TRACE_EVENT_STATE_ENABLED; - } else { - value->state =3D TRACE_EVENT_STATE_DISABLED; - } - } - /* else: already skipped above */ + if (trace_event_get_state_dynamic(ev)) { + value->state =3D TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state =3D TRACE_EVENT_STATE_ENABLED; - } else { - value->state =3D TRACE_EVENT_STATE_DISABLED; - } + value->state =3D TRACE_EVENT_STATE_DISABLED; } } QAPI_LIST_PREPEND(events, value); @@ -133,21 +89,12 @@ void qmp_trace_event_set_state(const char *name, bool = enable, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err =3D NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern =3D trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu =3D get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return; - } =20 /* Check events */ - if (!check_events(has_vcpu, has_ignore_unavailable && ignore_unavailab= le, + if (!check_events(has_ignore_unavailable && ignore_unavailable, is_pattern, name, errp)) { return; } @@ -155,14 +102,9 @@ void qmp_trace_event_set_state(const char *name, bool = enable, /* Apply changes (all errors checked above) */ trace_event_iter_init_pattern(&iter, name); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { - if (!trace_event_get_state_static(ev) || - (has_vcpu && !trace_event_is_vcpu(ev))) { + if (!trace_event_get_state_static(ev)) { continue; } - if (has_vcpu) { - trace_event_set_vcpu_state_dynamic(cpu, ev, enable); - } else { - trace_event_set_state_dynamic(ev, enable); - } + trace_event_set_state_dynamic(ev, enable); } } diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 792876c34a..1d07672cb2 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,9 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) { const char *tp_name =3D qdict_get_str(qdict, "name"); bool new_state =3D qdict_get_bool(qdict, "option"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); Error *local_err =3D NULL; =20 - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - - qmp_trace_event_set_state(tp_name, new_state, true, true, has_vcpu, vc= pu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, true, true, false, 0, &l= ocal_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +73,6 @@ void hmp_trace_file(Monitor *mon, const QDict *qdict) void hmp_info_trace_events(Monitor *mon, const QDict *qdict) { const char *name =3D qdict_get_try_str(qdict, "name"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err =3D NULL; @@ -89,12 +80,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qd= ict) if (name =3D=3D NULL) { name =3D "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } =20 - events =3D qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events =3D qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302115; cv=none; d=zohomail.com; s=zohoarc; b=IPg6O6BkmFgCp+juye75qfxMuaD1RU01P24rcjbGLK75aV1AlV3vvsOTLkNkmKenWKECt5MW7IvU8W/IMKauTi7H6cFbHSvOLqt6c/uCdfAu6O0aXMicOG//IID1BxmixeZ3i6O+uVPozNr6cZ/f8cUA57RXRrteSEFWth1IT6o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302115; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=/1RBvNRxHMYjEfv4JVTGObYYyuKugl6KdBGJDsp6ges=; b=TFNNLI0dAWlPq6zKEGDKEeHJWEydNYjkdb0PRkjStOru1THajIgwRuNkN+kixxd/c3j/OoVCKr4WEPO9mHQX88uv7+iKm6Qt1R8ruiLhQl60S/BweSpByHN6hwYAh3xdHm2iN+eQXbYJXw9HYp7qf+wip1IA+fwkZ8I0zqC9Fjk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302115372720.3728706598027; Fri, 5 May 2023 08:55:15 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxki-0003Ni-Pt; Fri, 05 May 2023 11:53:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkg-0003Lx-EI for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:46 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkc-0008DM-TJ for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:45 -0400 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-2f58125b957so1830044f8f.3 for ; Fri, 05 May 2023 08:53:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e7-20020adfe387000000b003064088a94fsm2763988wrm.16.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 6C3261FFC2; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/1RBvNRxHMYjEfv4JVTGObYYyuKugl6KdBGJDsp6ges=; b=oiBMe+8We6L9xfrUCZ7fmzVcMqfeRwcfRJg3gYxiAwT9srzPx7jbPPCfUs8+cuwM09 M1JDXPIVWxZR8K9jdQEiZoSNlzI3zSCezOKP/dUtHNrKCdyMLzBL8qFNVYTAhghaC8MD SvpeU0Swn3SJ/j9Sp5drNVhaNiezE98z906r9Wh5tCj9Ef86N5eYbwfIfbncciUg2Qct y/sD+37qa829yu0R2263PhnWAXgn5b/Bb1og8ESWEAd6f/mdAtp0kzqBLYyiw7Y5C77K TlI4mjVXEnWAbn+SvVj+b4ymgJ2WD0jLWcdrsOPDS78oQ5rxnNK6sYE85mlA3El7d5GI tyhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/1RBvNRxHMYjEfv4JVTGObYYyuKugl6KdBGJDsp6ges=; b=QXVs1ocgSno3JEnSJ1ezH+02TGIn4qSXwyAEIXYupUY8q1rNapktddmrKrOrPptP/R jSS4efgJakvEWRAlMyagqthadMfMVaVsj5P5+sDcajsQ1z8QWsS+ZS2BnX3PXnEmnCt2 l1vp5y84ySaX7WER9ywAodzC1MekDq+fMiJ7VYwpM/uO4+ILGnYPEI8QoUBK6hX7WNCq Zw4QryZ9SOXnQ5Fc0JttzkFPfuM8BVNCWw0lb1WyE6PSjXNJ0q+JZPaZiFCoRpbePKNQ 5SleHxjPupGL5+JniiT+YW97Zdxt/D5mSjzcGOkFRb9hXPD7XBtrnt3JtmUKKi8yBwr1 VaYA== X-Gm-Message-State: AC+VfDypXq0hny3ESJTSgsiq/Go8ouD2vqlIGJi6yaZRMrxqlQPdNq7G kmOxvntT7pFPQRYACwQZTKg5VQ== X-Google-Smtp-Source: ACHHUZ6V793N7HvWgwn7mhGBqCAO5el6/oeP9xYQ5LwEiR2tBG+g6kiPnvcmAZ21ZhmYTvDUzjBi3A== X-Received: by 2002:a5d:510a:0:b0:304:79c1:725d with SMTP id s10-20020a5d510a000000b0030479c1725dmr1761366wrt.45.1683302020521; Fri, 05 May 2023 08:53:40 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 07/10] trace: remove control-vcpu.h Date: Fri, 5 May 2023 16:53:33 +0100 Message-Id: <20230505155336.137393-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302117428100003 Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Message-Id: <20230420150009.1675181-8-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-8-alex.bennee@linaro.org> --- trace/control-vcpu.h | 47 ----------------------------------- trace/qmp.c | 2 +- scripts/tracetool/format/h.py | 5 +--- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 trace/control-vcpu.h diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h deleted file mode 100644 index 800fc5a219..0000000000 --- a/trace/control-vcpu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Interface for configuring and controlling the state of tracing events. - * - * Copyright (C) 2011-2016 Llu=C3=ADs Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#ifndef TRACE__CONTROL_VCPU_H -#define TRACE__CONTROL_VCPU_H - -#include "control.h" -#include "event-internal.h" -#include "hw/core/cpu.h" - -/** - * trace_event_get_vcpu_state: - * @vcpu: Target vCPU. - * @id: Event identifier name. - * - * Get the tracing state of an event (both static and dynamic) for the giv= en - * vCPU. - * - * If the event has the disabled property, the check will have no performa= nce - * impact. - */ -#define trace_event_get_vcpu_state(vcpu, id) \ - ((id ##_ENABLED) && \ - trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ - vcpu, _ ## id ## _EVENT.vcpu_id)) - -#include "control-internal.h" - -static inline bool -trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, - uint32_t vcpu_id) -{ - /* it's on fast path, avoid consistency checks (asserts) */ - if (unlikely(trace_events_enabled_count)) { - return test_bit(vcpu_id, vcpu->trace_dstate); - } else { - return false; - } -} - -#endif diff --git a/trace/qmp.c b/trace/qmp.c index aa760f1fc4..3e3971c6a8 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" -#include "control-vcpu.h" +#include "control.h" =20 =20 static bool check_events(bool ignore_unavailable, bool is_pattern, diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 285d7b03a9..ea126b07ea 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -16,10 +16,7 @@ =20 =20 def generate(events, backend, group): - if group =3D=3D "root": - header =3D "trace/control-vcpu.h" - else: - header =3D "trace/control.h" + header =3D "trace/control.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', '', --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302054; cv=none; d=zohomail.com; s=zohoarc; b=hDAU3C17Ix2J/v8omZG+IPmxJrg+VS3XNlCp+DPoKZwKPRqYEmMy46UUDEnbY6lntSHawrW6OUZ3ZEc20G75jLhRhnLJPVc66uMDb0iyNEd9t0ygai6d91xhl7iNBVSEZFHpt3VJ0EFe27b3MhRTcqXjAS5RQXXKcv4hUE0234c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302054; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=zoEEH2SuG2Jc65Yq/EaqjlTvHP7WVTKMHEseOjxo3JE=; b=DpNE5RS9c5U88XH11DRIlTCXNudTh3ntASGMTcJLIm0KEuYQ+dQ0hrt7xqWLESWw8ehvsutnGYfpg8mpFWweauGtLm4vBsVb8OBSZKdM0TsIB6vRmaqPtcsh7yUCZhOMSBQ08M5BuH4rKW/tiPIxvlXs3ezM4Y/7L5Z/0FjTr10= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302054904112.8630693883274; Fri, 5 May 2023 08:54:14 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkh-0003Nk-Sk; Fri, 05 May 2023 11:53:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkg-0003M5-Ev for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:46 -0400 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkd-0008Dv-B6 for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:46 -0400 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f315712406so104948825e9.0 for ; Fri, 05 May 2023 08:53:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k11-20020adff5cb000000b0030649242b72sm2751012wrp.113.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8EDB81FFC3; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302022; x=1685894022; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zoEEH2SuG2Jc65Yq/EaqjlTvHP7WVTKMHEseOjxo3JE=; b=Vq1pgt3cgbVS4TIbhrWIQe1uP9QRp6/PFRLzOumcKivyP7q1hUZtP6CYC05/JOsdzN Hf+CgKDXb1Tc5dR/V1JF6CxtCd0tAQ5e5rbhn1IlOzyxVWapFRoMBRHF9P9lgInc1pp7 j72xtSnC/ovUTf17Yeny2spbi51Wf4O/o9hYSMW8lrJRDozSlc7GUwwhPZh+/uABAbFp VXFCxN52l9CAwJWZ64G+Yk+GtNgWqCed0MzGr569FcPFIVUEbUrLjicpnVJ06GhypYhb 7vmf6414vOe+9V0eBGCVElvLSErHJqyln40G41V3n7QzLOCYPkkYu6lfVy5h2jO4H+HK naRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302022; x=1685894022; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zoEEH2SuG2Jc65Yq/EaqjlTvHP7WVTKMHEseOjxo3JE=; b=D0he69xubj6nevu+bGcdr3QrLLn0aNXmQZ4bLi+V1HQ3bBiNtmrUDfvVkBdjzAgwHT OJaGvb+HgEN9TEA2Hwa2WYS41Qpb1e1F4wB/8M16GS7xq2Le6v6IliX1ih/57Ll0GpQ4 3TOzmAO6BPA/fGqP/mrcMdZ8O2JYNrMlPHAu/N9IhMTbZJ6G7HKl6zH/eMaIB8xjBAJj Hiq+VVVQWaqbpyRgZVWUAY0F3+/GJrv7j5zLNRcyeo0no0lAeR8pa635iIr4yfWyjoaC 3GWzfzT1ROUHjotc1u5gM9MCDcCS5YKKPFavIeQIDdV2UarNUZNEm89/D5+avlxDPF9C oHRQ== X-Gm-Message-State: AC+VfDwJ/B0Bu64mGdA0do6DV6hPM4PhgSJYDk4t5+8s8/iSsTyE/E5u mof0HeNRZylyx1yDiBRf+tmQkg== X-Google-Smtp-Source: ACHHUZ5QNo4zUgiYRyqfRlibc51u00SddyeGcpjJT5CAwsCZX3FgK5XSL1GJwUh5Hli0y2aD8aa4iA== X-Received: by 2002:a5d:5233:0:b0:2f8:1305:dce1 with SMTP id i19-20020a5d5233000000b002f81305dce1mr1796857wra.19.1683302021798; Fri, 05 May 2023 08:53:41 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 08/10] tcg: remove the final vestiges of dstate Date: Fri, 5 May 2023 16:53:34 +0100 Message-Id: <20230505155336.137393-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302055351100001 Now we no longer have dynamic state affecting things we can remove the additional fields in cpu.h and simplify the TB hash calculation. For the benchmark: hyperfine -w 2 -m 20 \ "./arm-softmmu/qemu-system-arm -cpu cortex-a15 \ -machine type=3Dvirt,highmem=3Doff \ -display none -m 2048 \ -serial mon:stdio \ -netdev user,id=3Dunet,hostfwd=3Dtcp::2222-:22 \ -device virtio-net-pci,netdev=3Dunet \ -device virtio-scsi-pci \ -blockdev driver=3Draw,node-name=3Dhd,discard=3Dunmap,file.driver= =3Dhost_device,file.filename=3D/dev/zen-disk/debian-bullseye-armhf \ -device scsi-hd,drive=3Dhd -smp 4 \ -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage \ -append 'console=3DttyAMA0 root=3D/dev/sda2 systemd.unit=3Dbenchmar= k.service' \ -snapshot" It has a marginal effect on runtime, before: Time (mean =C2=B1 =CF=83): 26.279 s =C2=B1 2.438 s [User: 41.113 = s, System: 1.843 s] Range (min =E2=80=A6 max): 24.420 s =E2=80=A6 32.565 s 20 runs after: Time (mean =C2=B1 =CF=83): 24.440 s =C2=B1 2.885 s [User: 34.474 = s, System: 2.028 s] Range (min =E2=80=A6 max): 21.663 s =E2=80=A6 29.937 s 20 runs Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1358 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-9-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 6 +++--- include/exec/exec-all.h | 3 --- include/hw/core/cpu.h | 5 ----- accel/tcg/cpu-exec.c | 7 +------ accel/tcg/tb-maint.c | 5 ++--- accel/tcg/translate-all.c | 6 ------ 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 83dc610e4c..1d19c69caa 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -61,10 +61,10 @@ static inline unsigned int tb_jmp_cache_hash_func(targe= t_ulong pc) #endif /* CONFIG_SOFTMMU */ =20 static inline -uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t fl= ags, - uint32_t cf_mask, uint32_t trace_vcpu_dstate) +uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, + uint32_t flags, uint32_t cf_mask) { - return qemu_xxhash7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); + return qemu_xxhash6(phys_pc, pc, flags, cf_mask); } =20 #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index ecded1f112..3ee76af28b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -548,9 +548,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 =20 - /* Per-vCPU dynamic tracing state used to generate this TB */ - uint32_t trace_vcpu_dstate; - /* * Above fields used for comparing */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 397fd3ac68..4b399643d0 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -262,7 +262,6 @@ typedef void (*run_on_cpu_func)(CPUState *cpu, run_on_c= pu_data data); struct qemu_work_item; =20 #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 =20 /** * CPUState: @@ -403,10 +402,6 @@ struct CPUState { /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; =20 - /* Used for events with 'vcpu' and *without* the 'disabled' properties= */ - DECLARE_BITMAP(trace_dstate_delayed, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(trace_dstate, CPU_TRACE_DSTATE_MAX_EVENTS); - DECLARE_BITMAP(plugin_mask, QEMU_PLUGIN_EV_MAX); =20 #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index bc0e1c3299..973da2a434 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,7 +175,6 @@ struct tb_desc { tb_page_addr_t page_addr0; uint32_t flags; uint32_t cflags; - uint32_t trace_vcpu_dstate; }; =20 static bool tb_lookup_cmp(const void *p, const void *d) @@ -187,7 +186,6 @@ static bool tb_lookup_cmp(const void *p, const void *d) tb_page_addr0(tb) =3D=3D desc->page_addr0 && tb->cs_base =3D=3D desc->cs_base && tb->flags =3D=3D desc->flags && - tb->trace_vcpu_dstate =3D=3D desc->trace_vcpu_dstate && tb_cflags(tb) =3D=3D desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 =3D tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, desc.cs_base =3D cs_base; desc.flags =3D flags; desc.cflags =3D cflags; - desc.trace_vcpu_dstate =3D *cpu->trace_dstate; desc.pc =3D pc; phys_pc =3D get_page_addr_code(desc.env, pc); if (phys_pc =3D=3D -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } desc.page_addr0 =3D phys_pc; h =3D tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags, *cpu->trace_dstate); + flags, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } =20 @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, jc->array[hash].pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, tb->pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index cb1f806f00..432a0cffdb 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -50,7 +50,6 @@ static bool tb_cmp(const void *ap, const void *bp) a->cs_base =3D=3D b->cs_base && a->flags =3D=3D b->flags && (tb_cflags(a) & ~CF_INVALID) =3D=3D (tb_cflags(b) & ~CF_INVALI= D) && - a->trace_vcpu_dstate =3D=3D b->trace_vcpu_dstate && tb_page_addr0(a) =3D=3D tb_page_addr0(b) && tb_page_addr1(a) =3D=3D tb_page_addr1(b)); } @@ -888,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb,= bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc =3D tb_page_addr0(tb); h =3D tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags, tb->trace_vcpu_dstate); + tb->flags, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -969,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb= _page_addr_t phys_pc, =20 /* add in the hash table */ h =3D tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags, tb->trace_vcpu_dstate); + tb->flags, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); =20 /* remove TB from the page(s) if we couldn't insert it */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index 5b13281119..2ea42970e1 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" =20 -/* Make sure all possible CPU event bits fit in tb->trace_vcpu_dstate */ -QEMU_BUILD_BUG_ON(CPU_TRACE_DSTATE_MAX_EVENTS > - sizeof_field(TranslationBlock, trace_vcpu_dstate) - * BITS_PER_BYTE); - TBContext tb_ctx; =20 /* Encode VAL as a signed leb128 sequence at P. @@ -348,7 +343,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base =3D cs_base; tb->flags =3D flags; tb->cflags =3D cflags; - tb->trace_vcpu_dstate =3D *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb =3D tb; --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302082; cv=none; d=zohomail.com; s=zohoarc; b=eqJ/+mHIa8IY1LLWcK8pWerIg696brR38YVImqzd1uFs+P1hkmQreciOuocU5og7C37xW4xyR19q4iATEc+3BOBIjBTeR5Ayx5qI5GChRz6FTGkE69CSpkT2dfDBXppCgUEoH46fikU2LK6ApTW4aKVaRNi1VenOmu68WnI1ve0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302082; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YSUPI0kqOU4QQe2wmlnWCjPR8JbP43bVwIlQhLoBovg=; b=G83g6KWb8ysWJWq96Xx+FIuWnJV//+R5afJSu3FqoZmunezaxYsOowegjpvb4/QDXxNgWHMnHBpkzzEIazt0+8s0nWdsJ63w+XbuoN84LfQf1olU2xcGm+uXy/S6mXjzRXPubqbxhqc0JVUo8km8+p5KMLM3wG6zPHa9Yu2Njhw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168330208209887.9284991690115; Fri, 5 May 2023 08:54:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkj-0003OK-Je; Fri, 05 May 2023 11:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxkg-0003Lz-Eq for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:46 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkd-0008Dn-4M for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:45 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-2f58125b957so1830062f8f.3 for ; Fri, 05 May 2023 08:53:42 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q14-20020a7bce8e000000b003f182a10106sm8404594wmj.8.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A703F1FFC4; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302021; x=1685894021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YSUPI0kqOU4QQe2wmlnWCjPR8JbP43bVwIlQhLoBovg=; b=p+uuu3OdeqKErZ7XJLjeIihTSXE/arxZM29ZZYqimh2KpeO7I8/isig7BR3IRHXfwW nd8PhBkKfjauFwE2ME4um7FpKd9cubO8kYlly1ht40tiPBWn5J9+abLORCBu9/ko+HYP CZjRbBe8jF69plo0ZST+se36gUE/Sgd9VKO5GoWI45ik3pWlFnY0+abqje1gxe4C4w/w ZszX+VVWkJ9yL1W0akhys2Aduu6rMIn9Z1A59/FmuiPkI+OP1aUsvUFMWspz1deRCsfN kyv5UGMkXmtr2JgYeBqroKhrIw04i/VJdUxOns7j/gekaTSZPQcSA1XEUCRAWDPM8hmm nJTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302021; x=1685894021; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YSUPI0kqOU4QQe2wmlnWCjPR8JbP43bVwIlQhLoBovg=; b=Ogy0IyjZYfO22fdTw/xQVkGSW31P3ECqoF8NcPTdZdV8psrAHyLh1XrGrfy3W+pdya Ld/2D8UGCZxCKgNOTIPSVRF45XDHPsh8Oe4E1jL0fei1qWuCrS/0y/MH/vef5FutagwL UqtAZBVZwDG4bddWOQZltChmzymBd+ZsE7mNWwyVks7ds5vnXsRZIPhSZyTX5Jn8roEv 6mMAFXxkKXI2bTJzca7M/mGpyh7Qe+OwCbBMW7LRT1h1ITop5TrRrcnwLKn7nPfhtv04 Mt8nFolsoneFx0MbCZ8e5pF3WjMV8NNayD9VN/sojX18SD0WdZL7RoUffkJYEjaxWFws yX0g== X-Gm-Message-State: AC+VfDzjkrW1enF2RlgU6H+JIazZrhlN8ezLe6HGSNLI0J9LlqLcrjXc 6tAcP1BDARuKsWmBBUghnu3INg== X-Google-Smtp-Source: ACHHUZ681slEDW2QaRL1oLywMlY2y9Xv+ZzMW2X84BdHqdeyOkO9ipofEMzOz1tSge4F3RRF5uuOog== X-Received: by 2002:a05:6000:1088:b0:306:3ec8:289d with SMTP id y8-20020a056000108800b003063ec8289dmr1846940wrw.46.1683302021596; Fri, 05 May 2023 08:53:41 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 09/10] hw/9pfs: use qemu_xxhash4 Date: Fri, 5 May 2023 16:53:35 +0100 Message-Id: <20230505155336.137393-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302083306100003 No need to pass zeros as we have helpers that do that for us. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Christian Schoenebeck Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230503091756.1453057-10-alex.bennee@linaro.org> --- v3 - remove stale comment --- hw/9pfs/9p.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..991645adca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -738,15 +738,14 @@ static VariLenAffix affixForIndex(uint64_t index) return invertAffix(&prefix); /* convert prefix to suffix */ } =20 -/* creative abuse of tb_hash_func7, which is based on xxhash */ static uint32_t qpp_hash(QppEntry e) { - return qemu_xxhash7(e.ino_prefix, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino_prefix, e.dev); } =20 static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } =20 static bool qpd_cmp_func(const void *obj, const void *userp) --=20 2.39.2 From nobody Sat May 18 10:08:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1683302111; cv=none; d=zohomail.com; s=zohoarc; b=CzYXF1IiY/n0JdwWEyrIVDsBdujN6VhAX+N8Kdo8x0ofC4iybQ9HdVJDaXNJLmnGGc3TC2TN1zkIkY7NsKTE+s9VCoNSxTTxRFoouuIaw05Ji9+ZIJ8npqe380asXNOKvDQ7/KsagjLdksFH8loY2ei9YSWhk0LxMuyn5xNnj84= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1683302111; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5v8fvq4VC0aPq5wotViTt43FBb9CbIW+fQM89RxcOGc=; b=NTK8L3KvdBsnyEy3UCi+HTgrK4POiSV4UbAO7g9+sV68LiDy/IAc1kSuiaP7lfy7mzQmJ4Ai7SDX/jpaK4tedG1jLmFXFu4B9pYLSjKM0faOqNLsyBc2ZETFWjm7Gwujupmoe6WewooSvTexLETYWm3k9stmT21PKfS7ubw2SjE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1683302111461756.6505851012002; Fri, 5 May 2023 08:55:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puxkj-0003O7-E6; Fri, 05 May 2023 11:53:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1puxke-0003Ky-93 for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:44 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1puxkb-0008DJ-Ko for qemu-devel@nongnu.org; Fri, 05 May 2023 11:53:43 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f1e2555b5aso14088455e9.0 for ; Fri, 05 May 2023 08:53:41 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id n3-20020a5d4843000000b003047d5b8817sm2771261wrs.80.2023.05.05.08.53.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 08:53:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C6E5E1FFC5; Fri, 5 May 2023 16:53:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5v8fvq4VC0aPq5wotViTt43FBb9CbIW+fQM89RxcOGc=; b=GGxOjGa6F4eAynplYybIhj5pDH0sJRzFcZoqX+dXOGuOmZLYd2l9w0WJq3nG4Haug/ fSWl7cpSKal4D35Fc7ACKxQzbaSqNf1g00+4kC4ZScGzw0FPTRGBkJ8oP7bqJ28u4Py6 lEvP0UF/3OA2JBz7H8D07NUfaZxuBSSkjZTaFqm+tISYw/cFB91RoLufWDx+xzCys1ub NB/Sr8x/SWx/VmVstWWhdWau4xWgf7PDo3i0ajRz2HMOZHShuzYOWwH3yKgX3veHjOTZ pyi7EFlsMX7vpa7/MlKX8mQQxoH9tcLsQxXSSoAImOrVW7o1+7yKDeCCudQ1u08Or5B1 ilCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683302020; x=1685894020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5v8fvq4VC0aPq5wotViTt43FBb9CbIW+fQM89RxcOGc=; b=ZHX+TZLX7AZIc1MWONPrvPJvBqeEgJPhpKSSBrT8/+rLQZbP27m1yRlmDPvvs5J3mQ fyqt+mjcFLB+kJly/39UAGa3i3rr4nIZ5R/Hotkr5VfkKN/KaDkv0rxTDefPMTuI+sA9 4zmfUapdHaSrAbdgOlQhP8Wvym1Krm4TkT4xODYFfSXJO5/B4zawfMJ0o9+aLSBeyfN1 R30U2vZS/Ims3WKC7eKsKLrSpLGEIHvIjlvKR+0dFTxhucuQWgJ7IiZPs1lGeAY9g1bd jsMKlWgom6PDZUHGR6PzbMG/G/1woRg9SkNy/hiOYQWAipuK7IVNaC5FQMPVR4yZmEcy uw5Q== X-Gm-Message-State: AC+VfDwdX6BjkskQQG5fDZRpoVzdPHDi8jvWY199DnvfE5BSaSfhZ4ad ZICZRBlI1FG+GRMVwU413kufWA== X-Google-Smtp-Source: ACHHUZ6xGq5Dk53wmPhrkDC5VvoepgUEsOYEj7UZ3LEbgmx24U3DhkAIpvNEoJIVqcOG/OmpBT7Hqg== X-Received: by 2002:a05:600c:21d0:b0:3f1:8aaa:c20c with SMTP id x16-20020a05600c21d000b003f18aaac20cmr1549221wmj.7.1683302020267; Fri, 05 May 2023 08:53:40 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Marcel Apfelbaum , Christian Schoenebeck , Michael Roth , Eric Blake , Paolo Bonzini , Greg Kurz , Eduardo Habkost , Yanan Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Kyle Evans , Warner Losh , Richard Henderson , Markus Armbruster , Riku Voipio , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v3 10/10] accel/tcg: include cs_base in our hash calculations Date: Fri, 5 May 2023 16:53:36 +0100 Message-Id: <20230505155336.137393-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505155336.137393-1-alex.bennee@linaro.org> References: <20230505155336.137393-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1683302113409100002 We weren't using cs_base in the hash calculations before. Since the arm front end moved a chunk of flags in a378206a20 (target/arm: Move mode specific TB flags to tb->cs_base) they comprise of an important part of the execution state. Widen the tb_hash_func to include cs_base and expand to qemu_xxhash8() to accommodate it. My initial benchmark run on armhf shows very little difference in the runtime. Before: Time (mean =C2=B1 =CF=83): 24.440 s =C2=B1 2.885 s [User: 34.474 = s, System: 2.028 s] Range (min =E2=80=A6 max): 21.663 s =E2=80=A6 29.937 s 20 runs After: Time (mean =C2=B1 =CF=83): 24.348 s =C2=B1 2.717 s [User: 34.668 = s, System: 1.859 s] Range (min =E2=80=A6 max): 21.830 s =E2=80=A6 30.093 s 20 runs Signed-off-by: Alex Benn=C3=A9e --- accel/tcg/tb-hash.h | 5 +++-- include/qemu/xxhash.h | 21 +++++++++++++++------ accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 4 ++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 1d19c69caa..8cbafb5494 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -62,9 +62,10 @@ static inline unsigned int tb_jmp_cache_hash_func(target= _ulong pc) =20 static inline uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, - uint32_t flags, uint32_t cf_mask) + uint32_t flags, uint64_t flags2, uint32_t cf_mask) { - return qemu_xxhash6(phys_pc, pc, flags, cf_mask); + return qemu_xxhash8(phys_pc, pc, flags, + flags2 & 0xffff, flags2 >> 32, cf_mask); } =20 #endif diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index c2dcccadbf..cd7054f07e 100644 --- a/include/qemu/xxhash.h +++ b/include/qemu/xxhash.h @@ -48,8 +48,8 @@ * xxhash32, customized for input variables that are not guaranteed to be * contiguous in memory. */ -static inline uint32_t -qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) +static inline uint32_t qemu_xxhash8(uint64_t ab, uint64_t cd, uint32_t e, + uint32_t f, uint32_t g, uint32_t h) { uint32_t v1 =3D QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; uint32_t v2 =3D QEMU_XXHASH_SEED + PRIME32_2; @@ -89,6 +89,9 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32= _t f, uint32_t g) h32 +=3D g * PRIME32_3; h32 =3D rol32(h32, 17) * PRIME32_4; =20 + h32 +=3D h * PRIME32_3; + h32 =3D rol32(h32, 17) * PRIME32_4; + h32 ^=3D h32 >> 15; h32 *=3D PRIME32_2; h32 ^=3D h32 >> 13; @@ -100,23 +103,29 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, ui= nt32_t f, uint32_t g) =20 static inline uint32_t qemu_xxhash2(uint64_t ab) { - return qemu_xxhash7(ab, 0, 0, 0, 0); + return qemu_xxhash8(ab, 0, 0, 0, 0, 0); } =20 static inline uint32_t qemu_xxhash4(uint64_t ab, uint64_t cd) { - return qemu_xxhash7(ab, cd, 0, 0, 0); + return qemu_xxhash8(ab, cd, 0, 0, 0, 0); } =20 static inline uint32_t qemu_xxhash5(uint64_t ab, uint64_t cd, uint32_t e) { - return qemu_xxhash7(ab, cd, e, 0, 0); + return qemu_xxhash8(ab, cd, e, 0, 0, 0); } =20 static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f) { - return qemu_xxhash7(ab, cd, e, f, 0); + return qemu_xxhash8(ab, cd, e, f, 0, 0); +} + +static inline uint32_t qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, + uint32_t f, uint32_t g) +{ + return qemu_xxhash8(ab, cd, e, f, g, 0); } =20 /* diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 973da2a434..8d67198e56 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -233,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } desc.page_addr0 =3D phys_pc; h =3D tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags); + flags, cs_base, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } =20 diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 432a0cffdb..52d17815e4 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -887,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb,= bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc =3D tb_page_addr0(tb); h =3D tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags); + tb->flags, tb->cs_base, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -968,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb= _page_addr_t phys_pc, =20 /* add in the hash table */ h =3D tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags); + tb->flags, tb->cs_base, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); =20 /* remove TB from the page(s) if we couldn't insert it */ --=20 2.39.2