From nobody Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120131; cv=none; d=zohomail.com; s=zohoarc; b=PF19JR5O5wKkI5Z7dfdpacA4f65Oe2DqWD+prPSKpCXlnwYaI6fcGYhdrF46xz2lJrF/Gto9L6qZcYnkIfmkME6DiRbam7SXICspEbjpVmjsogiz4UybxyesG8ozsZUAbDU3qicVEPs2KmVIWN4GOQmRPkL5YL0uYA4itpZ6Gng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120131; 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=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=Wml7nVLbzd33/mg1PmkOmMsziQQT8Vm2iNLh+MsUGQy1oGPkTZja/ihgJJOUaH7wI06ypib2mYPEZ0XhpMZfFbkG63JtajNR9vU5U53a4slGsY3Dyb3NCOP4IANsBTp5ndLaL2/kREdoS2+JQbRyuKJ2lgBKSRbaEfvvdwf210g= 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+importer2=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 1685120131169796.9772110675251; Fri, 26 May 2023 09:55:31 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahf-0002yI-SO; Fri, 26 May 2023 12:54:11 -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 1q2aha-0002vZ-Qj for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:06 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahZ-0002Fm-2y for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:06 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3f611ccd06eso7185495e9.0 for ; Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v24-20020a1cf718000000b003f60b328417sm5780501wmh.17.2023.05.26.09.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 396C21FFBC; Fri, 26 May 2023 17:54:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120043; x=1687712043; 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=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=TQnAxAayZ/v8EufDD5rMAZOo+wrgQhi/NEuEVxDnwa/rLjw4ef9wF7+e+3IUQfK9CX xdzeyhp2YfsyCNXOw/XiwAvU1ZCpvrK+cQoq+xqpdAgdmIRYYJz3V+0Xo8nx89bk4vvU au1Kx3ttnLgiTCkB+HtN8hzLg9cAgp36d/WnSHyGwD8IZT2pvxICwLymel9bMX10QK4J qty3u8bi40QpxgCAS+rjAH0CvPQVE/1xH4y8NPPdtwsWU42Fw+9zGATwhhb3iNlgINvx zFJEAP5/Fhuc3787ZsayGnC1G7s2Rvm1el2ZSAhU/vRnMIKJzzL1U3q+FR6qDF7OKZe6 ExKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120043; x=1687712043; 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=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=X9Np0y24pHCFyVmAF2p2WJw9g73AXHRB3f7AfvgYDBPunp/knyGZY2bw0hZBP3LF43 15trlR8AZl/UqQDJlxr9t5EA5X3gWYYyHgKBD5m0m/sWghrHnyzy7tV1dKsXI9jYuKQQ UuL0Gl9IEOwT9MDnnLTW2giNP63TZf6cR/ptDUD6g7swYOC2hMfFZMN5OIhqLxqZqygI LnJ5QNtnCajydcF23zXCftsZ0NSWi8jEqKf2MHP2ayoqQleW9vANa7J41ve71347K2L2 vMQUs4t5UwTBTi2rCKp6LSnYH9rJEvX0cVcPCfA5vAnxSj+Th3ZxW/j4wNNS9YdmN8MS Jo1Q== X-Gm-Message-State: AC+VfDwe6bu84XjzGEg0QEW9I1aZkRS42qoAHHjgVzg96XbB5rfI/+TA LcsZ/0Ixi86pol1KjkBUHab7WA== X-Google-Smtp-Source: ACHHUZ7hQ6gED/2dPZVbusmqhKVjpdc5qjlM9qK7O2gL+IKbfMWh4CpixfXBlARCipmW+El9SDTbRA== X-Received: by 2002:a1c:4c0f:0:b0:3f6:13f5:d1ea with SMTP id z15-20020a1c4c0f000000b003f613f5d1eamr1715999wmf.11.1685120043138; Fri, 26 May 2023 09:54:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 01/11] *-user: remove the guest_user_syscall tracepoints Date: Fri, 26 May 2023 17:53:51 +0100 Message-Id: <20230526165401.574474-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120131945100003 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. Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120192; cv=none; d=zohomail.com; s=zohoarc; b=L4c/7kuY9LI81I2ziqIZ89fW4pU/pbkIBcC66qu9GJq503u/Opjeg76kWhnApmYPHJo7Jfkss5s6KewUi89Xx7S0twPPkmoYDMjSDMGpNRkn0mrcWV5NsOGCDjaRDuoR1YKjN4xfcW5cg58smxAD56HO0qYlvVA0s2L2IDY//i4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120192; 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=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=njzpaOSvcaqhSO571bBNEz3GnehNHK1V42ukUknBJEwiSxZK0AJQjKqjwbJ80rOHrhDwOizmQ+3Y2lWCZgt/GR1w84GoNj3nymXlI7fSfbBvuzZhFOJ/mhXfa9EQJXmcQUD/fd0NFV3FGykCavB2HmJFGbRRInwgXVOEn1DQW6E= 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+importer2=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 1685120192310327.56584313411986; Fri, 26 May 2023 09:56:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahf-0002xZ-2U; Fri, 26 May 2023 12:54:11 -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 1q2ahc-0002vj-5T for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahZ-0002Fq-Fj for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:07 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f6042d610fso10801185e9.1 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a18-20020a05600c225200b003f60a446fe5sm5783211wmm.29.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8A09F1FFBD; Fri, 26 May 2023 17:54:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120044; x=1687712044; 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=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=CXaN3nqdxMFNhhzkBhPGUfw0G7gCS/+k+EVEaKFN5dhThaMCxh9jNi7PIQnN6bKZRM jeys/SESP1Pbo675WpyKHSs7V2TUMrhUmrfbxTiugWAfQc9lo0ibzNpJy7iNMs5QTh7o QNIF+Y115cwces+YVxM2E0cxzy1YmQss/0Gn6jaB7r7MB7vQxXFO2u26EY0/gbTnMgKL 5bHOjPUSA+YFIPgOYsj0KjXaeo0pCmuGUZ5k90DkfgikgzoFVc8anW2BG6Z6wqpHY65R 5pABYKQVX+zyoS4Wr6VQWj8hS/899jwuBj6IPAhyboPp/0jOMZli9XoTlns2w7As2Fvn yQFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; 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=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=UDkExkiQvizJXXRczKHA3f0m84vETr8DFmfTn2AdsVqgLHN5B2qu5rhvrsYrWEKDrQ 4261QTHKruZ53s6W9TDkopZHKSQKwSVhuwlqplwM+uVA/fqkhsCC7zgc41GdAeswSN5w 89jqOxIKOVLzdlI1+qwN0cged5n/exFVnN7XO0bkhluBuEp7f5tJL8E850PGSzJuXLzV PJSnJXQM8UqjNPZwPn2cVDWrk3mMmPLVMqoS9ijpCdE6Xdq+QrsdNLJ+hguysEsKC6Ko KKd7fdQ0Sn7y/3qPRsO9+8MEGhlZPi5kmAZhE0jHtS7rHJveV8bnGzhPB6NUp9d0X/Rj vtjw== X-Gm-Message-State: AC+VfDwJ6YwNBWy8Gd+U0W1GRrqn1x9zlE563j3qrdHy9IzEQyAUhhZP h0trVxrh+12YXiuNHzxpQqFDnw== X-Google-Smtp-Source: ACHHUZ6ONuEIQcdQzWu0iAYPaLWQApgh+dBv8YZzzcdfC3rCbwhdYfv7X40vyVuMEk3zahO4fRuY2g== X-Received: by 2002:a05:600c:2308:b0:3f6:1377:8b15 with SMTP id 8-20020a05600c230800b003f613778b15mr1986965wmo.21.1685120043969; Fri, 26 May 2023 09:54:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 02/11] trace-events: remove the remaining vcpu trace events Date: Fri, 26 May 2023 17:53:52 +0100 Message-Id: <20230526165401.574474-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120193796100001 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-3-alex.bennee@linaro.org> --- 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 c0c1e2310a..a10752924b 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -144,5 +144,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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120078; cv=none; d=zohomail.com; s=zohoarc; b=DbREaxGxZUABBhC7L1w6goiJ4bsF8jcMdYdsD1r8uOX+B4fW0BjPUgwyiz4Mf0wWfzImz+6UcKI8qV9h6xTFfW6ng16HpiGgqUeZxedTpAujgJ72WPjiCX1aieHJqFJBhiWEQJFlTUzzHJSpOhqGuAlBuVMK0EwUDH21OMnnDGI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120078; 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=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=G325SL03gM3fgsvFqVn6lcAFtT9Ph6IVB+SvIrOc5hTrdxLUnpHo7K2hEILq3mz7c9+6/oQFtsB8zMf0U5+X0TlChFZcGKrVh7qvYxM4Xf8MJSLQTTBxs4Q7acNV2BEhIouomCHL8VLFBR/yn4Cvjq3KMQ7+FgOSE3pkqtiXQ+Q= 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+importer2=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 168512007887147.73762281855704; Fri, 26 May 2023 09:54:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahg-0002yj-Rb; Fri, 26 May 2023 12:54:12 -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 1q2ahc-0002vk-7a for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -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 1q2ahZ-0002Fx-QK for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f6e72a1464so7299085e9.1 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o8-20020adfcf08000000b00306c5900c10sm5709524wrj.9.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0ED491FFBB; Fri, 26 May 2023 17:54:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120044; x=1687712044; 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=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=x+OvuHceqY7xYU5h7F5YDxxSbWzp3J6STLFEOcVtopLZIv6GuaC2p3O8WgmGL/Bs/8 rSJuyzNHgquFBP8QJZlmOEDQtB5rGN4zZOp/n1TwgQMjyy81EBpi9RiA1ObQn99zrkUY MjjNfVI34ptdEgRGW6GBTzudBWTEFgTGm71Tz4bwhw1aFwsn9LzCoEf1K1jGpcqtE25s fKo5PkQJrToqufEjkxa/VW8KM1wt2EopvpoSOvtRBJImojBUopYC6Aqe0E7WhcgVIMGD nCZPPo4q+S5QCbyK/MD0eLPNP8T/TENssucNOAfOlmLN3FJdPcq0Ih2zqcUG6E8Rbkzd +Xxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; 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=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=NrFWzbXeqKTmgj9SxwLvlj8X8iVf24Dh0TTlyAsaVkG8F4uYJpk74WZmW1/IHMVNFQ GwkI+TxNEqg+qyNtleUmE86b51TvrOiByPWh52s95iPwmJCy7XLBTcO+qXptoH4d+G61 O49wh3seRkhbHlR02+ZPi72QxKml+ky0ZGEVoi0dVYDDSW3fOf6xQqc9rxbftB0AsLZE 7F+gvrkkJxXroKAnilnkhPHUL0gsMxOB4oe6uURKqzond1ae1Gclb8gC3jCtNqQidAih +4ACaM69f+5OFrLas05g99WinluSDo3EfeEBN0WawtLwO4gceoITjimxRoEp1sgsQB3X hZQA== X-Gm-Message-State: AC+VfDwbggvpLoglNi87M991r5YsGKHSfR3qgN/8JqIxECn4O9tS4557 73RmbpIcgehRubyok8TfQ1mWgA== X-Google-Smtp-Source: ACHHUZ4PXDq85fXL9gZfcVujUfStUjpTsjvsJlvzzkjGoVcKLyC1UT0Q97eMH663QquRp7nMrGhzBg== X-Received: by 2002:a5d:630c:0:b0:30a:d7a7:3db4 with SMTP id i12-20020a5d630c000000b0030ad7a73db4mr1595931wru.12.1685120044311; Fri, 26 May 2023 09:54:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 03/11] trace: remove vcpu_id from the TraceEvent structure Date: Fri, 26 May 2023 17:53:53 +0100 Message-Id: <20230526165401.574474-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120079280100003 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120181; cv=none; d=zohomail.com; s=zohoarc; b=AFRZ2pMMdhQZ6EmV2bCscOnGsWpxKCejDgzPhrvulxURQ+0zJXkxzkpsU7wJAgrytAaEu+rTT4v5mhEQGf67VNfQ4ceSAZ0VNHdPVpIDAZ3uSl5TZdrAEZxq3lZgeOUjiKlAd+fca8xvi6Y5dM4oXn8iVbr6HYfq7Mp1he8JhLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120181; 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=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=HwHVeKsS7qILjTazak141fGDAXCL6Bd0UJ6BW8dFn5+j/BhfHjaTZmG5RbYjQYyVn2vA4H0sYNEL1VcpdoOvZkahv9JpCYk4Rwf2GuwfdVuFIIfwHYBY5JGjNUzfbk+n7/hiwDWg6WMh6A3DuVW7TdgmF4Xl3JYDNaAesEX0KXM= 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+importer2=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 1685120181791353.03483537471936; Fri, 26 May 2023 09:56:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahe-0002xJ-RT; Fri, 26 May 2023 12:54:10 -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 1q2ahc-0002vi-5T for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2aha-0002Fz-6d for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:07 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-30a8dc89c33so626406f8f.0 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z11-20020adff1cb000000b003093a412310sm5657661wro.92.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F2A91FFBC; Fri, 26 May 2023 17:54:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120044; x=1687712044; 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=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=oVOr0Z96+QHRcNRpLz0dhfjHtTiUTtIwEv1S9iNF3dMiXKKNWNEHAQmXZfcPtLkSs4 JyMySb6hJgkwrpzb3aH9xe9H+7Su7CVQdaYY1XobboW6Qy1Es2TvzSG8QeySiMOOTfdx nk/AF58eJxzjKHziY8XEREcvbnJgkb7ygKpYkit7dSrdtLZMAyO2gWdlolRkzHqHp9EZ 2+5WCnlDV5EfC/a+n7ionfp7kRFkmGeUdgBHPPVZdnIfrFwsVEXZIfkVLRkurYttrzys 5eCGjeWKm4ZLZ3j/6ERmAnKKeLocBXOqX9FoOXcFuvJB60q6kg7y8Awem6GbXf9C6w2c uxOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; 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=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=VgHsD7M1e13tvRRq8z9um0LugH0WZ2/hJn/edwtyMaWdFKcK68SMoaEtXln5TWTnLv 5rPinxhH88upYauZ22jM0J4MVHzUUUF30xJlM9kdQp2HbohjfUF6b1tmLBWLZWMVUUuW mkLQwizw1WDCCGSmotfyoVeepEIFfuNfeLFoo8Q0wmEmQ2TF8LYR8r3MnDTeHmWXO6Dm pCwsWEjPTi2JBzQW3tf1EoqTorKcwRJfSJ61JqVfuUX5JONQLfFBwqZOGKPhoKAROcMS 3KxcJXzCkXSfLaSz86Ln8LO7TEOqdIK72hy6k5mHv0LbjdT4Cl1chERVlcllADfdt6vj zZTg== X-Gm-Message-State: AC+VfDwwOXCkCnefQfNLdCoBI/HA3emC4Puaye6zSkCvaeiGNBk6I9kY Mq11sfJ84vl9VLQxU064BVgeqg== X-Google-Smtp-Source: ACHHUZ6KBWKapKxFU8P0MpmVEBimzJdG8lkT0qQtKV+ucDkIYu3eCmSpXiOwYBl2WLlHzmza4OYbrg== X-Received: by 2002:a5d:4cc2:0:b0:306:36e7:db27 with SMTP id c2-20020a5d4cc2000000b0030636e7db27mr1909674wrt.16.1685120044687; Fri, 26 May 2023 09:54:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 04/11] scripts/qapi: document the tool that generated the file Date: Fri, 26 May 2023 17:53:54 +0100 Message-Id: <20230526165401.574474-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120182199100003 This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-5-alex.bennee@linaro.org> --- v6 - use Markus' suggestion for prettier wrapping lines - drop un-needed str() --- scripts/qapi/gen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..70bc576a10 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,6 +13,7 @@ =20 from contextlib import contextmanager import os +import sys import re from typing import ( Dict, @@ -162,7 +163,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 %(tool)s DO NOT MODIFY */ =20 /* %(blurb)s @@ -174,6 +175,7 @@ def _top(self) -> str: */ =20 ''', + tool=3Dos.path.basename(sys.argv[0]), blurb=3Dself._blurb, copyright=3Dself._copyright) =20 def _bottom(self) -> str: @@ -195,7 +197,10 @@ 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 ' + + os.path.basename(sys.argv[0]) + + ', DO NOT MODIFY\n\n') =20 =20 @contextmanager --=20 2.39.2 From nobody Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120181; cv=none; d=zohomail.com; s=zohoarc; b=jhA8GnJ4m+4fvCRSxpafNFTqHGfSNPYzl/KdQSxZXJG8aDu5vC2s1UTigLR7U1vkNwz3uf7ygucnk+oSpDBZiTPfTPPSG9mEzX+F8trbkPuQhRCgdb/AB94aqppA9nmR+HimcK8ZeqLYBtB67jy72BwIso41owFF2nEJo8p6tFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120181; 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=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=Fywuj83AAcX5iyis4vMxf7XrbktaBkdFTqVIOvZpBHZeQHVNQ7e/DIjbjgdN+WRYxcPmGDWz8Dtz6f5l8ci+5s0bTqrBpOA2s41caIiRw3xU2Ljh6pzzXkbbXlFc9yhnHjd6PM6NSSNMjBobPiTP4Gj5Zwy+6GiD1P7rVq64k0k= 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+importer2=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 1685120181837594.2302086897997; Fri, 26 May 2023 09:56:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahh-0002za-GR; Fri, 26 May 2023 12:54:14 -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 1q2ahc-0002w7-EE for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:09 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2aha-0002G5-RI for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3095557dd99so931003f8f.1 for ; Fri, 26 May 2023 09:54:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s17-20020a5d69d1000000b00304adbeeabbsm5692586wrw.99.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 852B41FFBE; Fri, 26 May 2023 17:54:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120045; x=1687712045; 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=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=K1vw9RCgs4z+aELg0bmShVXdsWfCWvjhZyTpKZh7/WXV3MdEXNTTJrMhvvl7Lcqn15 XwiHd7kk/RQf9p1Ldvjap6eVETNuGBIsPG25KT4aROms8uzlx7w0RfQT8+qyk+jI46C5 LmJRHgBTE0pD6OVCx1wPm80cD3OB/Eko3HgLtmcmVeSkr4vy8O35fCoDX7vxD4DqF/vV 4a4nYb5ssMtHYCS74WsSMX4KmAdtbI8CrGTS/27bUPByHam4ROzjRf8T6332H9zOXeLd OxSrJm2Sjl7yaUOBXUcSSAZTK8/2rUkHztWVm9eZp0NK7m8OtbxRXGT4Y6zKgTX3ScAb NKBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120045; x=1687712045; 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=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=Xro9KO0fDnvV1tLLIpG1zWTtjExQJqARYhOH5EzpDnU8HrgtwYYrIKc4Aqr9uJaPwN qz3tOb4ym7I4fo/TIvvHA3NA12P5Ykney0kQSHuw3hiSAxxZdwwSv1gdz9AeD4YveMxd 52qYyRytW0/G9BiZpUDbheaQ0CW6/WhlFls+wKvq1evEL8bJEjt7GVMom5cCNxMNJKSW LE+jafj/UYwgZYCkwTbGGZWEsKwrUkbBMNMSG35kwfHh9m4pDIzZ8uawLoU/F28/HEpe z3cW8c5PA5ykU+zaWpW2GlMPw4uS//Hk6P4S3Gr8e2oRrBMhdmixlJlPiUjEL/hYseWw onFw== X-Gm-Message-State: AC+VfDy8SO9ETl7Il1jOLf3R5cS3C+yBAQNs+y1k0Pj8FgdYI7Vul/86 B9R8PWL3B/PW1y0hoNo59Bcgyg== X-Google-Smtp-Source: ACHHUZ6A6z62k1x8OgUEAReHH4Czd6iAthNlBji8V+Gk/77DZ8Nj4X0vkznGFVEUZX+yhcNja628aA== X-Received: by 2002:adf:e644:0:b0:309:3a83:cf43 with SMTP id b4-20020adfe644000000b003093a83cf43mr1898839wrn.27.1685120045507; Fri, 26 May 2023 09:54:05 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 05/11] docs/deprecated: move QMP events bellow QMP command section Date: Fri, 26 May 2023 17:53:55 +0100 Message-Id: <20230526165401.574474-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120182200100004 Also rename the section to make the fact this is part of the management protocol even clearer. Suggested-by: Markus Armbruster Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Stefan Hajnoczi --- docs/about/deprecated.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e934e0a13a..7c45a64363 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -218,6 +218,15 @@ instruction per translated block" mode (which can be s= et on the command line or via the HMP, but not via QMP). The information remains available via the HMP 'info jit' command. =20 +QEMU Machine Protocol (QMP) events +---------------------------------- + +``MEM_UNPLUG_ERROR`` (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. + + Human Monitor Protocol (HMP) commands ------------------------------------- =20 @@ -251,15 +260,6 @@ it. Since all recent x86 hardware from the past >10 ye= ars is capable of the 64-bit x86 extensions, a corresponding 64-bit OS should be used instead. =20 =20 -QEMU API (QAPI) events ----------------------- - -``MEM_UNPLUG_ERROR`` (since 6.2) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. - - System emulator machines ------------------------ =20 --=20 2.39.2 From nobody Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120182; cv=none; d=zohomail.com; s=zohoarc; b=GaT2TqDOSnvYyluCp84frcMk2r43owEH6ggk2mTmk18B7bVa/RkrnP1Mar/N/eZluWMXHQGMKoLnmwygj5Jtno6g4m+WPeN6Ltr+y5DAqnAUFJs3G1Ssf5kLUPqHH1Jn1+UOyvk6kgo2yQtRkFvS44zSuU5U6G/fueHSJCzSAlw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120182; 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=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=UHvRukRnCqruCZ4A7EF4WHJ077LOvg/hSfQ45zArIQvgw1VgKEOBbUn2SHglYyZeBS8z7Th/wveuJNgelsGta9h7cOVnUPXICF+nV9v30PuxQifQKGTxS/1qgEn5qseyewmElYFHHJMu0qBZLc0LoVXS7PfUcSRNwt6jJ6Xn4KA= 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+importer2=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 1685120182935970.3474216276637; Fri, 26 May 2023 09:56:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahh-0002zN-Dy; Fri, 26 May 2023 12:54:13 -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 1q2ahd-0002w8-0c for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:09 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahb-0002G9-7s for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:08 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-30aa1eb95a0so878161f8f.1 for ; Fri, 26 May 2023 09:54:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g14-20020a5d540e000000b00307a86a4bcesm5659872wrv.35.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C8C651FFBF; Fri, 26 May 2023 17:54:03 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120046; x=1687712046; 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=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=JSciatZzZT+/LKY+y2KMXH0kosb+UexjoTuKmWDeQhMg+M8fhDC4D+T2zX3FQMnYt8 4Sefc2oCh5mAc10Aw8zlMMhMuTEP/gKy99sYIQ0UnATZhio4p85UD+CA8tlx+vSHjEdI VXpox2/Qjm6vRGnzWyj9YWZCrGFtZPB8bY+gxXPFlz2SiNsJAxprUAlr0ylHXgjAUa/k vwTFcauy1gn5fbuB4aRlpbPKV+vj+uWMbJMuFEhUwLd8vSjgOcYJKvFx75THaEBml3TR kekYiLQPwbiNsQl0J2w5rpbRTyYwMGXjNRR75B3TK5t06+RGwNv2xdokByb8wmxdsMFf 7/qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120046; x=1687712046; 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=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=HykILAWyjq9PdEvc0ZZ+dfg5uCnS5VxUR7/6uWIWXAwmWC85HEp4LmgtYZh9l9CFfC 6JjT53kDExs7Rm5bKPZASoyCVOSe+/GaF+NbD5PNXk/y9kR/7RRgGo43sT5LHVFIRthC FmGw5/ECx7/1LinXc5fEZPEfdtd5XUw96+ohFWGAYaZPES5Z/qpvEmbzGtyQuPiTgcJK NaT8IUb51dSbfnYqFxF2Zt8AsRh42bMwbxSh0WVXegBln/i+cOSNxdlDQImR6p9flZmj WBj18DDXenKBrKhNtqRF+8SFxzlsPCT3aBcVNn+lqV6GZhcLEAq+CwByVioWAUPuqToe BOfw== X-Gm-Message-State: AC+VfDwXWYqmHMJhNswUS6AI3AX2WqXxnne8ardyANHzdcDDwq+1Fron bDm3b92IdEis7sRZ+VMEKBa5Qw== X-Google-Smtp-Source: ACHHUZ5eceDSZOhMP8OXzX8FmEtpFASs3JOtlPla8NLP2sO/kFtqnu+PwhgZ6fWG9Drt7COSWnUKUQ== X-Received: by 2002:adf:f604:0:b0:30a:9043:8f1d with SMTP id t4-20020adff604000000b0030a90438f1dmr1570311wrp.5.1685120045787; Fri, 26 May 2023 09:54:05 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 06/11] qapi: make the vcpu parameters deprecated for 8.1 Date: Fri, 26 May 2023 17:53:56 +0100 Message-Id: <20230526165401.574474-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120184195100015 I don't think I can remove the parameters directly but certainly mark them as deprecated. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-6-alex.bennee@linaro.org> --- v6 - s/QAPI/QMP/ - /and always false./and always ignored./ --- docs/about/deprecated.rst | 7 +++++++ qapi/trace.json | 40 +++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7c45a64363..0743459862 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -226,6 +226,13 @@ QEMU Machine Protocol (QMP) events =20 Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. =20 +``vcpu`` trace events (since 8.1) +''''''''''''''''''''''''''''''''' + +The ability to instrument QEMU helper functions with vCPU-aware trace +points was removed in 7.0. However QMP still exposed the vcpu +parameter. This argument has now been deprecated and the remaining +remaining trace points that used it are selected just by name. =20 Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/trace.json b/qapi/trace.json index 6bf0af0946..39b752fc88 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -37,13 +37,14 @@ # # @vcpu: Whether this is a per-vCPU event (since 2.7). # -# An event is per-vCPU if it has the "vcpu" property in the -# "trace-events" files. +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } + 'data': {'name': 'str', 'state': 'TraceEventState', + 'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } } =20 ## # @trace-event-get-state: @@ -52,19 +53,15 @@ # # @name: Event name pattern (case-sensitive glob). # -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (since 2.7). # -# Returns: a list of @TraceEventInfo for the matching events -# -# An event is returned if: +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Returns: a list of @TraceEventInfo for the matching events # -# 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 "vcpu" property, an error is returned. +# An event is returned if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -75,7 +72,8 @@ # <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu":= false } ] } ## { 'command': 'trace-event-get-state', - 'data': {'name': 'str', '*vcpu': 'int'}, + 'data': {'name': 'str', + '*vcpu': {'type': 'int', 'features': ['deprecated'] } }, 'returns': ['TraceEventInfo'] } =20 ## @@ -91,15 +89,11 @@ # # @vcpu: The vCPU to act upon (all by default; since 2.7). # -# An event's state is modified if: -# -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, 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. +# An event is enabled if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -111,4 +105,4 @@ ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': 'int'} } + '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } --=20 2.39.2 From nobody Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120078; cv=none; d=zohomail.com; s=zohoarc; b=I0Lv/arlOqtluQVgmUpCLrVZfGataE/CfTjOTbIPKyxrgwnxxzMmJShdLWJS2BkTHhZ6W6p36Jf3ucGAT73FJ+y0UdZqCbm0ggN5zNrQxihv6BULk7uxKklWl//xUrKwEpqswSRFxUAQHEssuzpy8U1WevpkuOxlPTaRRgM+y4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120078; 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=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=m9lhEkZwJwAhzD1OEIIXGBvsaIji5MWkn2Tbcwxd+ieWJqCr1cShMYooqgqGWrHG6FY6m3IR+df1EOLkTHhH6rs2WXV4TBNeuzouAaiMTAQ3QW9Ycu/ygmk855xvEtmQ6e37ThAQejFfEQ6BdrzZqBNSLpN3wz6sCxmpsa/AV68= 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+importer2=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 1685120078858172.7794468990885; Fri, 26 May 2023 09:54:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahl-000315-Ep; Fri, 26 May 2023 12:54:17 -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 1q2ahf-0002xa-2K for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:11 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahc-0002GZ-Mw for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:10 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3093a6311dcso911246f8f.1 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q18-20020adffed2000000b003047dc162f7sm5578183wrs.67.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5BCDD1FFBD; Fri, 26 May 2023 17:54:04 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120047; x=1687712047; 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=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=DlPz1quHbCMHyJ1aJk43DhZ5WSQR0QuAIx2VdGAVdgV2xU/rRduGtQJL1tOjXnORPZ UsX/1stj3qBkTwpYbHh6Gg7bhBCObfUFlBQzBbdQY+Iqj5SktvThfOyggLwrLynOcWQ3 NcQYcj7yFozgfs6lsvEEMIhuPnSWJHklwVJSGxaTZnbTy8Sd0ddokVicvK/0TXSX7ArN xvf6s7ZCX6j+CsU2apz7hPwxeecehEup9PZA8oaPsLnjhckfdFfKiwx6FdHJuizqVdDI hdlLlfOhbbMHytV4lgnJIdp8BZWkq/I1RO569ETLaWQmYsM3zUiMPA696KnPjNhL9aHb ImEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; 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=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=bdGgPui+3DLhkWG6t4td+u+FbEcv1BbvGoJ+fOCexfP0jIRiVIFtig5dhADc6jBOcS Ijxro7zarxPIt5425rKmMap9WRDHPr1jTCrotFZhnqUACydlaPaUkXeyDmSgA00wd/Mk Q55QnikpH0jcyOUzfJjv4OTTQkq1ITtnDYejyFRaxsnwVz3og3pL1ylPDJBuQqPmUHc6 a9veFd7qwxvm+gp2z8heHcxSiHJ3aqUnAao8qsezfDB8GIJZxXube648Hv60UGG5eszT YgCZVs7FXxqDZwl05mS4h+v7gGQautvKcjtJoEnlYarrZpgdNOOUUipV4OarHK4vs8vH wPCA== X-Gm-Message-State: AC+VfDz5KobX2snmnt8ObgesjoIb2SRiBY49iKzvhBZFBIIRqlIK5kae Au7St/TfVGbRJRJrmsWNCyJKJg== X-Google-Smtp-Source: ACHHUZ7/9+VDRFi6EkulRfwi+gK3F+Upgsx4nsE0RRGND/uNzMjNGacaptDQjNR6pf57StwDGnAskw== X-Received: by 2002:adf:cd8e:0:b0:306:3ec8:289d with SMTP id q14-20020adfcd8e000000b003063ec8289dmr2029922wrj.46.1685120047085; Fri, 26 May 2023 09:54:07 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 07/11] trace: remove code that depends on setting vcpu Date: Fri, 26 May 2023 17:53:57 +0100 Message-Id: <20230526165401.574474-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120079354100005 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. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-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 | 108 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++------------------------ trace/trace-hmp-cmds.c | 18 ++----- 9 files changed, 20 insertions(+), 285 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 a10752924b..97f21e476d 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -36,112 +36,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) -{ - QEMU_LOCK_GUARD(&qemu_cpu_list_lock); - - return adding_first_cpu1(); -} - -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..86211fce27 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,10 @@ 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, &local_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +74,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 +81,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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120103; cv=none; d=zohomail.com; s=zohoarc; b=AeI2YNq3Dmr9kBq/qmtdeZQzM9dPc4u2iDJL5zK6zJdRpo6wshrJ6cJeLvZSUK3B+6UQ74pewt2TmIzfXWbL88t8Xn0Wqcn9j9H9hIuhAihz8UY+B7UU+Xgb1HInh0bm30QGc7vZW1z2aeTRmu4IaeCXzRNpHoamxgXmf7IiQKw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120103; 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=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=iVON5ksV+GIpMXLa4brLVQPG4z8Zs/yAwjlfVJAFz9fyojVfiZVOvMe75R90iNRJ6if02RgFz5/mIsYcxOzV5KSTeVRILMf0psdIAO1x//i3Kk6Eg92Mtwhyg+QQwsmk58lXG6u5zTfxVgW2nTsSEm9BG1M8h/qg2EUe9+oP1lY= 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+importer2=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 168512010351684.01091600559641; Fri, 26 May 2023 09:55:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahg-0002ye-FG; Fri, 26 May 2023 12:54:12 -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 1q2ahe-0002wY-20 for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:10 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahc-0002GU-DQ for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:09 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f6094cb2d2so10115635e9.2 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c2-20020adfed82000000b003078a3f3a24sm5647610wro.114.2023.05.26.09.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AF2461FFBB; Fri, 26 May 2023 17:54:04 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120047; x=1687712047; 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=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=D4C4koTjUYtAet6mMiAXC/EwUcUr7Mwj/8TrpFNP50Md5bAKN1BXKz9xtzFn9vt7fm xncUMH8StCJ68u2R88WseY3KL4oopFD015qXkit94oItHpf6wEyBzJ40o3+8N+q10d7k VNc2OsmD81UXu/xzD1guuABYM2I5E+k5ggQirBtBnG1rMaYjRV2OOxLZPIejd9bLqAKF vRXSXOH9ar6U9e8SLJwebHprvcUuhQ2hAIsdZjwRNSanvtqNyKlyxhryRAYIHrSJAdS5 LyuFvDUFt1TlWvHrmUYeqxUOG0TC85hu0CWeu70a7q2zrDnREuXc4xMdHMfxbYojWnuf 5b/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; 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=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=hZhgKKw5eT3YRyc3/ldq7gl6jZU+d7Nz8ON7liwLfWQiKRYAahY2nWVZ1SyE2hTEYP m4gC7gsJf2AhkcVsMiYRyuJj8ftQETcx2O1cAYpJLzfAG2R/0cVDx0FaC9VC7gr3We0H o9u6Ead28FHbI5lj20vsFJUOekqLaYO99vXtipOVsp2qNX+DhSWJ+fUt7UxEtOgQI1ph lT4kdv8ZC3+6viQXFb6jZUYIjPHC5PFCE3DSqJyWarFmGX8KGK2FZTkXji5nRt6uMl2p OK+Q6aH5rpYILvqkG6Q28UoX+sf3kf0hTKvg/A62Af5epOOeOs8+qWUTS9l6utS1a+4o qAhg== X-Gm-Message-State: AC+VfDxrFBmlaTHDsGrpS+XshNYseg5eDwkpDMIvJ0mZREeD/vYXqBpq chvIxvee6xK4JP9bzSjkxayq3A== X-Google-Smtp-Source: ACHHUZ6+mNd5ftIMt/tFtbY+CXghOwlCZkMwRtp0WaVbK8YxlTpJFsmrVlzTNWhvI7YXtTo1CrstIA== X-Received: by 2002:a1c:7216:0:b0:3f6:476:915 with SMTP id n22-20020a1c7216000000b003f604760915mr2003755wmc.6.1685120046854; Fri, 26 May 2023 09:54:06 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 08/11] trace: remove control-vcpu.h Date: Fri, 26 May 2023 17:53:58 +0100 Message-Id: <20230526165401.574474-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120105399100003 Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120181; cv=none; d=zohomail.com; s=zohoarc; b=MUsDNh6V6WbfEdYy3rXcGAtEINZZGNzuNEvofAX4g5hSktjldgWc98zJnAdM5gVKhcR7qAnjELEf/oQ7wP/JAvONMLuLrp10J98PxtmXYV2YJIFGfkl5smqa+JJihkZOn9tbP73xUTAs8TiJhLyv2IECyZD8ZE9cB34r2fAW/IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120181; 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=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=LWU9gZq60sWoXnrgk1h3NUSJ9sTPSyqwW6R8qqeSMFiwK8DCfNPVKVrR//U1NkTKjlXOsp1PVUuoK3Ls63kYegn/bsUtPSqdkYIEj7SEbjUP/o5FPZmb0DvvmxgcMG+zHSzRFQ2IYDY7FinwSElPlKOMPT7lm6jWrrqm+//jA0M= 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+importer2=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 1685120181283422.7777377515056; Fri, 26 May 2023 09:56:21 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahl-00030s-4d; Fri, 26 May 2023 12:54:17 -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 1q2ahf-0002yD-Qy for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:11 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahc-0002Gf-QJ for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:11 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so7038535e9.3 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0ac700b003f4fb5532a1sm5682160wmr.43.2023.05.26.09.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:06 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 11F201FFBC; Fri, 26 May 2023 17:54:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120047; x=1687712047; 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=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=G1ZstibEcg18v8h9VhpbGDwtrbPFarVRqdB5MPlj1XmM9+q4IrOyYGbA+f32+wSpd7 gz9C4AZPLYdB4N9AnGzDbXpi5BR4BrNCTgk0nSKwx8OdqEqGmg6rH/ylGCEKo/d6C6WH 41ECxith+RrVoMhOLGiOBQa4PBa4EEBdeaYCGz91HCo9p5UvAJD9dzfyOF0VdV9LwRZ2 Jvm4CLYqUst6903yvEZnAZFjHAinhkc4ZqE9zvLvlmSnf2UN56w5GJYMu9x9ppXzPUXL QDwE5laBWQkSsR1rmzo+6YwZyLYgBeasL47MvaHf24r/pjNwyorssXxEK1P5bRzxsXlJ uEiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; 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=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=FDwfOZV4FIKYl7guNaWhK7HmzaJIjQY3npYFdotgcFILAuzRTxvSUs8Uon6cHp8TIC +dbomM7pmpRlvhU9/hQTfNMz9mcQIFqAKHhZ5n42mhlsk/e20ai3hv2WJWWKPdSUTusw XULXFwedb5d1wEx8nB/334tweWSAmFHdGv7pDCLhC+ncZRfRpifdkVZnb+uWBgunVUOy dTP1njYN3g9QgSLAZ6euw7vf3116tjfbdog3BRFiUHiZjUGBnq9H1ngG9j2TuHHCBjQB UItPC02YGcZrkOmeVo/EiksFDodhwuvq+bT3o6+lIvXkQ1tjwn/0O9211Romg8GZFyaY shPA== X-Gm-Message-State: AC+VfDwCjiFjGzq/IjqiSuIGPzB5fIv+UZoCpqIT5XwzG5h4Sv2YbtAV C32DjSmXOpNSaNaxWjCzF1Cr1A== X-Google-Smtp-Source: ACHHUZ4dVnsEpa3W+oN98k5t+oUFQt3Y/SCBdl7Ct9Fku5kPbuiAucm2olAsD8ryzcU3dlPDeoESRw== X-Received: by 2002:a1c:f40a:0:b0:3f4:e853:6a1 with SMTP id z10-20020a1cf40a000000b003f4e85306a1mr2206300wma.38.1685120047514; Fri, 26 May 2023 09:54:07 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 09/11] tcg: remove the final vestiges of dstate Date: Fri, 26 May 2023 17:53:59 +0100 Message-Id: <20230526165401.574474-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120181992100001 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 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230524133952.3971948-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 4d2b151986..3b1b57f6ad 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -545,9 +545,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 39150cf8f8..383456d1b3 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -266,7 +266,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: @@ -407,10 +406,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 0e741960da..4a1dce98ff 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 991746f80f..bc1961ea55 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 c87648b99e..bf814b9e81 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 /* @@ -352,7 +347,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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120211; cv=none; d=zohomail.com; s=zohoarc; b=h+sHKzJamoexlu5XPdWPR+B7ihO1sHtShxe40hzlgqtwD48Z4qsIDETVqqedn32jvBWyAeU4pOsk1R+4nZtyT64AgAQEwfz31UK2/iuNDjJfYTZjbXPgbINU2fIGKlZM1VRR/+WdrelEIpVF/LngMPvis9H7GYbUvtnQEiQky+8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120211; 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=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=NoD+gFoobASdJXbaxLkB1642t3hroJskj0QUrSMgPiTyGP+mFNWQaipUzaC+fwwM+7NC/0wYr964qZdsZqZdYeA88W7h2GOCtUwA7fKpUCCmzwFtBDPK0rgCYxRQqIxYWb5gDJV/VHhcBuVbW4rmfs9LR5Vl60ponPLWCHB0nTc= 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+importer2=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 1685120211985426.3428820099756; Fri, 26 May 2023 09:56:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahj-00030D-1g; Fri, 26 May 2023 12:54:15 -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 1q2ahe-0002wX-0F for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:10 -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 1q2ahc-0002Fx-Hj for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:09 -0400 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-3f6e72a1464so7300515e9.1 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x4-20020a5d54c4000000b002c70ce264bfsm5609626wrv.76.2023.05.26.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4948A1FFC0; Fri, 26 May 2023 17:54:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120048; x=1687712048; 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=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=oCwIk+laqcSOtGlRZG7VY8yeKFEWgrFJ4jzEvqD3tRy6CVakzzOQB4NWMBv1dM7LKf xQfUxfjyyozshUu+52cprOvMRRqyAESN7yg3GhYmgJ53B0xxrzy9iW9MkWloi+K49E2Z 0on5l72S6N41dGwb2l+kO/1mmAmN+4I+GVMs/yWKsMOpUO3aYAzOfSVK1RGlUI3HEjTN 4fxl1ppHFu9kHJeuqYAGUfJr8+NNaTy1n2YjPtaukHywWnXjmC4S1l3eYYqRehBfzorb 897B9kAFSBlEVb4LLC3/Pz2Ck6gDryWs7zNbb10ps0K5d/rZirSZWimPoZK/rZ2Opl51 3hHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120048; x=1687712048; 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=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=kmSVVgP3Fqxqra2leKc5eQ8bQK5Ngjdh2ogw8/FSLPqGJj3wdtauwpb7TBx5IyNM0w ons70NNnf64EJ/W8AEBUv8kb/kShURz1+V+9jtuD9Z+76f3ehbO74XK173F9/gtO5O0B XmrSCnsNYtWbqJuPglmvl5vBYRqawrYpjpoud/7rsbIZdQKnwdLCOhB0haLotheADdne QEfwEwh7e7QsPHPrbIc1nQwIrnanzdkD6dy9GbqShv5DqqKr/aPfK+6vcLdc/01iqcxt NCcHkaQXw5kWCy+Ul8tMluUQ0LMMpFcCvwwrCYGeaEyQgGZKDQn/sKU+rogQni8yumOE ievA== X-Gm-Message-State: AC+VfDzCph+rzvSPLmH63PqdA+UZBzmCBSzW0nOTFs4D+OMnzyvSmb5I gogaj1JoBtofnIWDSKZiruuIAw== X-Google-Smtp-Source: ACHHUZ6F5q9SvNedgHzyeqmemDnGRPcRknN0Xj8QLvd7rzWrlB+KP0j2pvGD7a8R0KJJ+BF/60vABQ== X-Received: by 2002:a05:600c:d2:b0:3f6:536:a4b2 with SMTP id u18-20020a05600c00d200b003f60536a4b2mr1892054wmm.27.1685120047859; Fri, 26 May 2023 09:54:07 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 10/11] hw/9pfs: use qemu_xxhash4 Date: Fri, 26 May 2023 17:54:00 +0100 Message-Id: <20230526165401.574474-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120212438100001 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: <20230524133952.3971948-10-alex.bennee@linaro.org> --- 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 Sun May 19 20:06:35 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1685120157; cv=none; d=zohomail.com; s=zohoarc; b=Pktt+XCk7SzzUt4BSeGV8Yy2TXxe9wsTLyUtKeFCHG14+joj+lcR3WIAn1UNaJYPUdSHa9m2Z/ma1eUYyTB3fvpXx2J+f5NNzbr8ABGNBlLj73IHFHwevEsSBwvX9CP2HJURNs/IXXSJFpXPks9NeF7wbrlUyQdXtG3+E0NpWUw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685120157; 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=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=EGWYlPyjPcE651e8kCuprWQ2dhihswuWE7IbAdRnqSQHV++18OdE6NODrEm6l04nTo8suJJrvkHig8LpGCKr8UJaXhT1ot6pQcVCvbqBgrA3H7sB+C9uTKQeGct/PIUD18oRdGom9QcsfPnZl14Quw9e9m0/aKaYWTxY4zaD5Fg= 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+importer2=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 168512015737493.3083284225512; Fri, 26 May 2023 09:55:57 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2ahj-00030Q-JX; Fri, 26 May 2023 12:54:15 -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 1q2ahf-0002yN-Tz for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:11 -0400 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2ahd-0002HD-SB for qemu-devel@nongnu.org; Fri, 26 May 2023 12:54:11 -0400 Received: by mail-wr1-x42b.google.com with SMTP id ffacd0b85a97d-3094910b150so881405f8f.0 for ; Fri, 26 May 2023 09:54:09 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y3-20020a5d4703000000b002f103ca90cdsm5596870wrq.101.2023.05.26.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AC9581FFBE; Fri, 26 May 2023 17:54:05 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685120048; x=1687712048; 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=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=BKqMYFve4oC9kWrhHo97yb6JHOieltWW8FVkqMkpasXBlyGSWtSYrQfwGY6aq7UpKY EI6h3sBCWxz2lVw3mlEboFRiao2mr+X25/SqKluW7MgYutm1h570kK2kcqnPZkBXNXwK 2Kzjpt8DdX+RKjK3fPhsrg/mmLoKLeucm8pkxXQufTth8jfKYXkaQ0A9DlV/wHAKUYLj 9fzkypnNYOQO9o36UJ0M96iu9eiuyFWYnTJ5tLSvxAuvI/gBTTrLPVcLfzUZd6DtLV44 VApTTJfrpwfk7Wav/YxBSpsyHpW07MAZIDqM1lJWTsV26m7WyLQeaTdmYKFEMbcWiC+9 vi5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120048; x=1687712048; 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=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=Ql6J4Rr3XTRb4WDiIu9p8Mn2l7fl9mC6ukSASsv7sxIeAuP+qhCrolrNigw6fyOQSy 2LU0us8u2yEfFP1jSUXdO7b2ncbLuRBmHaA1pM5VFy8yGA3c/uLuhGA6epELNccDP4Nj MmXQ1fa/l5fSCs49mIoR465+f3cGClMxidKu9vHxKSSP9u+HbuLKmFJltLO+pqVFCMPC ghECXcEx1iKrTBlW3bChq1qtq/tcmXRT8hlBseIvf6QR7y5lgaVQITr0tWiAw+N8tGxe i7u0PRppkDZsEPeiVHNiaLE3PWmb8mHEPN6oAYlM5kPX0XWFvwhZN2GoSoG+sOXrzZ5K mOiQ== X-Gm-Message-State: AC+VfDzsms7Ra2QrA30xHRC5DocrWB893weax8d1ylUpJKGqvAqfpzMv RdCYZXEwXPwzovdXPcBKKbYMRg== X-Google-Smtp-Source: ACHHUZ7nkzFnMSE3ejE+ZaP15x+KYRYDhzalJclR9r7tx9Ca05LODw0iBgSRm3zjPKcjcQ02kSubCw== X-Received: by 2002:adf:e7cf:0:b0:309:3ddc:1c90 with SMTP id e15-20020adfe7cf000000b003093ddc1c90mr2298168wrn.30.1685120048614; Fri, 26 May 2023 09:54:08 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Riku Voipio , Markus Armbruster , Kyle Evans , Eduardo Habkost , Warner Losh , Richard Henderson , Marcel Apfelbaum , Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , libvir-list@redhat.com, Christian Schoenebeck , Paolo Bonzini , Michael Roth , Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v6 11/11] accel/tcg: include cs_base in our hash calculations Date: Fri, 26 May 2023 17:54:01 +0100 Message-Id: <20230526165401.574474-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1685120159588100003 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 shows very little difference in the runtime. Before: armhf =E2=9E=9C hyperfine -w 2 -m 20 "./arm-softmmu/qemu-system-arm -cpu cortex-= a15 -machine type=3Dvirt,highmem=3Doff -display none -m 2048 -serial mon:st= dio -netdev user,id=3Dunet,hostfwd=3Dtcp::2222-:22 -device virtio-net-pci,n= etdev=3Dunet -device virtio-scsi-pci -blockdev driver=3Draw,node-name=3Dhd,= discard=3Dunmap,file.driver=3Dhost_device,file.filename=3D/dev/zen-disk/deb= ian-bullseye-armhf -device scsi-hd,drive=3Dhd -smp 4 -kernel /home/alex/lsr= c/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=3DttyAMA0 root= =3D/dev/sda2 systemd.unit=3Dbenchmark.service' -snapshot" Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=3D= virt,highmem=3Doff -display none -m 2048 -serial mon:stdio -netdev user,id= =3Dunet,hostfwd=3Dtcp::2222-:22 -device virtio-net-pci,netdev=3Dunet -devic= e virtio-scsi-pci -blockdev driver=3Draw,node-name=3Dhd,discard=3Dunmap,fil= e.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 system= d.unit=3Dbenchmark.service' -snapshot Time (mean =C2=B1 =CF=83): 24.627 s =C2=B1 2.708 s [User: 34.309 = s, System: 1.797 s] Range (min =E2=80=A6 max): 22.345 s =E2=80=A6 29.864 s 20 runs arm64 =E2=9E=9C hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impde= f=3Don -machine type=3Dvirt,virtualization=3Don,gic-version=3D3 -display no= ne -serial mon:stdio -netdev user,id=3Dunet,hostfwd=3Dtcp::2222-:22,hostfwd= =3Dtcp::1234-:1234 -device virtio-net-pci,netdev=3Dunet -device virtio-scsi= -pci -blockdev driver=3Draw,node-name=3Dhd,discard=3Dunmap,file.driver=3Dho= st_device,file.filename=3D/dev/zen-disk/debian-bullseye-arm64 -device scsi-= hd,drive=3Dhd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/= Image.gz -append 'console=3DttyAMA0 root=3D/dev/sda2 systemd.unit=3Dbenchma= rk-pigz.service' -snapshot" Benchmark 1: 20 Time (mean =C2=B1 =CF=83): 62.559 s =C2=B1 2.917 s [User: 189.115= s, System: 4.089 s] Range (min =E2=80=A6 max): 59.997 s =E2=80=A6 70.153 s 10 runs After: armhf Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=3D= virt,highmem=3Doff -display none -m 2048 -serial mon:stdio -netdev user,id= =3Dunet,hostfwd=3Dtcp::2222-:22 -device virtio-net-pci,netdev=3Dunet -devic= e virtio-scsi-pci -blockdev driver=3Draw,node-name=3Dhd,discard=3Dunmap,fil= e.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 system= d.unit=3Dbenchmark.service' -snapshot Time (mean =C2=B1 =CF=83): 24.223 s =C2=B1 2.151 s [User: 34.284 = s, System: 1.906 s] Range (min =E2=80=A6 max): 22.000 s =E2=80=A6 28.476 s 20 runs arm64 hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=3Don -mac= hine type=3Dvirt,virtualization=3Don,gic-version=3D3 -display none -serial = mon:stdio -netdev user,id=3Dunet,hostfwd=3Dtcp::2222-:22,hostfwd=3Dtcp::123= 4-:1234 -device virtio-net-pci,netdev=3Dunet -device virtio-scsi-pci -block= dev driver=3Draw,node-name=3Dhd,discard=3Dunmap,file.driver=3Dhost_device,f= ile.filename=3D/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=3D= hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -a= ppend 'console=3DttyAMA0 root=3D/dev/sda2 systemd.unit=3Dbenchmark-pigz.ser= vice' -snapshot" Benchmark 1: 20 Time (mean =C2=B1 =CF=83): 62.769 s =C2=B1 1.978 s [User: 188.431= s, System: 5.269 s] Range (min =E2=80=A6 max): 60.285 s =E2=80=A6 66.868 s 10 runs Signed-off-by: Alex Benn=C3=A9e Reviewed-by: Richard Henderson Message-Id: <20230524133952.3971948-11-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 4 ++-- include/qemu/xxhash.h | 23 +++++++++++++++++------ accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 4 ++-- util/qsp.c | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 1d19c69caa..2ba2193731 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -62,9 +62,9 @@ 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, flags2, flags, cf_mask); } =20 #endif diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index c2dcccadbf..0259bbef18 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, uint64_t ef, + 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; @@ -59,6 +59,8 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32= _t f, uint32_t g) uint32_t b =3D ab >> 32; uint32_t c =3D cd; uint32_t d =3D cd >> 32; + uint32_t e =3D ef; + uint32_t f =3D ef >> 32; uint32_t h32; =20 v1 +=3D a * PRIME32_2; @@ -89,6 +91,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 +105,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); } =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); } =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, 0, e, 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, 0, e, f); +} + +static inline uint32_t qemu_xxhash7(uint64_t ab, uint64_t cd, uint64_t ef, + uint32_t g) +{ + return qemu_xxhash8(ab, cd, ef, g, 0); } =20 /* diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4a1dce98ff..60ca9e229e 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 bc1961ea55..892eecda2d 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 */ diff --git a/util/qsp.c b/util/qsp.c index 8562b14a87..2fe3764906 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -144,7 +144,7 @@ uint32_t do_qsp_callsite_hash(const QSPCallSite *callsi= te, uint64_t ab) uint32_t e =3D callsite->line; uint32_t f =3D callsite->type; =20 - return qemu_xxhash6(ab, cd, e, f); + return qemu_xxhash8(ab, cd, 0, e, f); } =20 static inline --=20 2.39.2