From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632064; cv=none; d=zohomail.com; s=zohoarc; b=D1RSHyZAaOVOrgC7Z5QMHWskslRvIQW+Aqzj/a814YaLrlhqHcTEjsnhy/jsZL+GY2z7V+9GHHXmikqF/i+ukOeMj7Yk/brIGe3q/PHmZkM0Habtjv0WIQUJSBxVAvz2N/9CuVLLtSy+rOANIbzsKOtFwEV0w5aNj7ir/pLjStE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632064; 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=lBQXTlVHI0XajC/IcilAyjpiqM2BywFex0dWI0WCr9c=; b=nAIuLhhzaBEjDFLv9Wpva4VaZiGaPIG9627XmzI1ak0dD9oc2DSDBEhTvLlHCrFfaiADiDwr+ORfbbg+06SWeiyy16MvQNGBUTWCJuxVfyfBsBLqQ0ZlH5qkRnxYndqKR2KvAGndg5/9imZfxj82AGfTSBqvwgeqINBB+7htqHg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632064727862.4341124707303; Thu, 1 Jun 2023 08:07:44 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-119-sytuNQmkM2Cu0Rc_fHsQ4w-1; Thu, 01 Jun 2023 11:07:26 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AA220185A7AA; Thu, 1 Jun 2023 15:07:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 84CBA9E78; Thu, 1 Jun 2023 15:07:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 251B619465BC; Thu, 1 Jun 2023 15:07:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3C3B81946595 for ; Thu, 1 Jun 2023 15:06:54 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 242CC492B0B; Thu, 1 Jun 2023 15:06:54 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91CA8492B0A; Thu, 1 Jun 2023 15:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632063; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=lBQXTlVHI0XajC/IcilAyjpiqM2BywFex0dWI0WCr9c=; b=OWbBLuizfe/8KQAy5rsshwnDM/cuo29uAMO72HGTosnAuY5tSBzbTptMMPxeDIbo8UQLt0 z3wHDLHlY+ZgD3VmB4x4+fZO8aOMNCUf/aqgEp8Q23/2Jg5Gl7o/4KI9mJjdk/g9yJE/qD VYGEySZxbNuKWAergDqn1g7t3fdnDFU= X-MC-Unique: sytuNQmkM2Cu0Rc_fHsQ4w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 01/11] *-user: remove the guest_user_syscall tracepoints Date: Thu, 1 Jun 2023 11:06:39 -0400 Message-Id: <20230601150649.1591095-2-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632083752100005 From: Alex Benn=C3=A9e 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: 20230526165401.574474-2-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-2-alex.bennee@linaro.org> [Remove unused variable in do_freebsd_syscall() reported by Richard Henderson. --Stefan] Signed-off-by: Stefan Hajnoczi --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 3 --- trace-events | 19 ------------------- 3 files changed, 26 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..de36c4b71c 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -528,10 +528,8 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, ab= i_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - 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 +539,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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632033; cv=none; d=zohomail.com; s=zohoarc; b=C9a/Ehq/RBleA1MbGYX4L1y14cDzmGzcyifEdXuS+81rg//0c+uuz6w1NwzgsKmD8J0MXvg0tKwFgwyGlu1GSAcjvcJLrtcpYIY/JMhoxRsgQ3gjvgtBdmMg6z7CJ/yo9jcAEAuS1r91CgUqwONrH241eDvrVWq01yKgImeeJC4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632033; 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=rxCD5rDF+n6gslp/qcSJG+BYddChTkonQBMOIDMr/v0=; b=G5Zma/Axrq5TDf6FI2Eo4D3PxlJK6oz33DsMIKs4uNuMUHrKYlJ9qBS6YaOwyszXStvkk2CoSOJi0geLpRd+clKUm9l1Ms3wkKZngSjapR3Q11aLk3o12UW2ZNq3EHprnxjXCX4PtXle/1QLb426R+6NzSLfK28Wslhi8RJrH/Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632033090114.27821132611734; Thu, 1 Jun 2023 08:07:13 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-287-jGvvEEjHMp29E7fnP_93ZA-1; Thu, 01 Jun 2023 11:07:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B8658582B7; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id F283D112132C; Thu, 1 Jun 2023 15:07:01 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 602351946F03; Thu, 1 Jun 2023 15:07:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 406B419465A3 for ; Thu, 1 Jun 2023 15:06:56 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 3D2A12029F6D; Thu, 1 Jun 2023 15:06:56 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7EDD20296C6; Thu, 1 Jun 2023 15:06:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632032; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rxCD5rDF+n6gslp/qcSJG+BYddChTkonQBMOIDMr/v0=; b=RHazbmQ9UQdrrFmE9/FnH7aHpmXBW3BKLCVJ6PCsh2ztcXAjcx6hCc+XdnDG5KdRjHcDfG IjYUuNnbfHfJGDEv500MV3u0yeiATP9n6ChtYsNABEkuAXHQsch95WfbHghwhInkRjADS6 hmd2zXSKMZXfXW17G84zXB3AZRJS9yQ= X-MC-Unique: jGvvEEjHMp29E7fnP_93ZA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 02/11] trace-events: remove the remaining vcpu trace events Date: Thu, 1 Jun 2023 11:06:40 -0400 Message-Id: <20230601150649.1591095-3-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632059381100007 From: Alex Benn=C3=A9e 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: 20230526165401.574474-3-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-3-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632098; cv=none; d=zohomail.com; s=zohoarc; b=oAbg6y8Fq/IpvgQz35S8zubz7+6F6bWxKIvsqo/7aW+V4bbaZjC+fwG4CoQQVV+M97fMxsiczHGKK6nhegP1G6WwlO7/dCGP4gw0uimbaoo8F9Sm/mLFL6RiIB/AtB/LQ95PGCzXxT0bSrPwxzBECvxeZsWNJS7IAwzgX5/2MUk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632098; 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=oi+seq7KnOXSMael//8077PMVV9G55+tWTDGQkzuYPg=; b=VXwOQeKqpeF32QT5OVzWI2ctfJMypp4pJAal8v9CU6V8ce3/jkdCKnX76h46OtHoAN2wf62NlqvGBF3M0Vj3rKwtjk+nmALGGbPa8LvSMUCSAfjTYcpyIPi9178py8Gir6nOy8zKLPmLJYGx5HWOA2aYn36KdMJq44aBVHfkUp0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632098290936.7959968020987; Thu, 1 Jun 2023 08:08:18 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-203-ziXDPKD6N3WNow2GnxZiHw-1; Thu, 01 Jun 2023 11:07:30 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7E53D8041B8; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 695F2112132D; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id A06C01946F10; Thu, 1 Jun 2023 15:07:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3E8DD19465A2 for ; Thu, 1 Jun 2023 15:06:58 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0DBD514171BD; Thu, 1 Jun 2023 15:06:58 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 87A9714171BB; Thu, 1 Jun 2023 15:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632097; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oi+seq7KnOXSMael//8077PMVV9G55+tWTDGQkzuYPg=; b=J4waX76PExp7E3MmWJiPXmEYtjLmpMpKaehOilesn+ZWroQuMMgbuNnyCjU+K2dbBu0oNW tCzIdZiCFmaOH+aEQV99u4Q1gpSanmBTrJyClfGvceDtHKz1E9LfPWVd0bUTx5MSqjQm4r 6tDM7D3POlAJ5RjBgQqxcVnlacU2STc= X-MC-Unique: ziXDPKD6N3WNow2GnxZiHw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 03/11] trace: remove vcpu_id from the TraceEvent structure Date: Thu, 1 Jun 2023 11:06:41 -0400 Message-Id: <20230601150649.1591095-4-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632119177100003 From: Alex Benn=C3=A9e 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: 20230526165401.574474-4-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632034; cv=none; d=zohomail.com; s=zohoarc; b=aodMtgqpZBmo8yYUSSMR3UEp//8kdYwahZa7t935eH8t0uEsP8rtgDE6w4AlZjkiCWq61+o1FaTd/QE27zgIYW+y+JIlJk/Lxhr//aszG902ULb/duAQuIetdjx6P4iwLPq5F8So4oao/F6acHyk6NPJ+GETWhK4WV6d8sKhCoc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632034; 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=jmwIuqbKSBmYUUYZl+TDEkyLmw0sm6/vkiGhVfu4wao=; b=Qym8dFZcYYx2BbvTMqFIt03vZY4P7SVGvhhvjn/CcVpi+8XG9j/ZtKbZARr4Q0VbvbWEkiOFDcxeEkfJDbR0y9ps/zQm976WA3zaCFNqjvuA289xnVod2iwEnu42M3SgYv3OdIdOPcU1EZPxSE0wuTSUzNJR9WgxCDmbWkcsdkU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632034017154.79497398849196; Thu, 1 Jun 2023 08:07:14 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-_Wm0giB8NtKkO5CkC1Lv2w-1; Thu, 01 Jun 2023 11:07:06 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CBDA13823A23; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id B7D4FC359E2; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E077619465A0; Thu, 1 Jun 2023 15:07:01 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CB0A19465BA for ; Thu, 1 Jun 2023 15:07:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EDCCF112132C; Thu, 1 Jun 2023 15:06:59 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67608112132D; Thu, 1 Jun 2023 15:06:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632032; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jmwIuqbKSBmYUUYZl+TDEkyLmw0sm6/vkiGhVfu4wao=; b=PWj55ARHTnlKhlIT/AO/XiXKjr4NDtHQ/jtoU58VdD0My7wc5fLludekn7GsqarYy2zU0l cTBb1EnV5cKZoaOqdYErrZ0NjkT92TGEUjjqZv9/B2saBliVxfAfg5y4i9Df5xXlx2yVfQ MSyhyuuJIbjnKy/FBDfk8auq7x+jt2U= X-MC-Unique: _Wm0giB8NtKkO5CkC1Lv2w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 04/11] scripts/qapi: document the tool that generated the file Date: Thu, 1 Jun 2023 11:06:42 -0400 Message-Id: <20230601150649.1591095-5-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632067883100001 From: Alex Benn=C3=A9e 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: 20230526165401.574474-5-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-5-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632126; cv=none; d=zohomail.com; s=zohoarc; b=CooBkec/UmsZkBwTuHRBN/8OkNQay5L0G8xBo3pqZF8qPNYg/DAEN5Nw9a3g1kh9T6VIyzDSnDrgmI0sa/Xwc30b0B7gRYMfdxhsgR6gDydKhCDYeDQQ2VH5iE0aN6GX6PxCRQnOwBmU0DxUxtAO//WpFHH3F3q43EvMuexIAZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632126; 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=wKrE0cU6y/KvEa0jIUQsGcMo+tubjSZxaQI6tRZgCYg=; b=NcHt0tsHU7NkrC08rahJu/WcHmE3LNudjDur1NFyUbADGxxt2ax2jK3yH9bDIjivl5kWzi9EEE2KtMUoHNndT+by344EWLNJERmi26EYaiO7F+dQz7swoAIKmeU5aXl5KFkAAy8E+7WpVfMbxgKnQa9WknDpdgeETcBhEVZul+g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1685632126252846.6610622616553; Thu, 1 Jun 2023 08:08:46 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-444-djRBx83wPIOpQUZiXE1M9w-1; Thu, 01 Jun 2023 11:08:27 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CE06185A7A7; Thu, 1 Jun 2023 15:07:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0629340D1B60; Thu, 1 Jun 2023 15:07:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E0D6519465A0; Thu, 1 Jun 2023 15:07:04 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CB76194658C for ; Thu, 1 Jun 2023 15:07:04 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F39B89E71; Thu, 1 Jun 2023 15:07:03 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 704B59E63; Thu, 1 Jun 2023 15:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632125; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=wKrE0cU6y/KvEa0jIUQsGcMo+tubjSZxaQI6tRZgCYg=; b=a7VaPBZAamO4uD6qDckkgR6xDiF82YHrW4DEbTTvWxvkgsG7+SvWOXEgtD/m7Kg5cP43ta 6roBbxFirvw1ksPnD89IByi+ZoTcARVa9J8U+saajFDLCYv9xgN38fccIY6M6eJP3SThZ8 6wKQPvZ9wj/kYviIA92XRSvU5jCA85Y= X-MC-Unique: djRBx83wPIOpQUZiXE1M9w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 05/11] docs/deprecated: move QMP events bellow QMP command section Date: Thu, 1 Jun 2023 11:06:43 -0400 Message-Id: <20230601150649.1591095-6-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632127883100001 From: Alex Benn=C3=A9e 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 Message-id: 20230526165401.574474-6-alex.bennee@linaro.org Signed-off-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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632285; cv=none; d=zohomail.com; s=zohoarc; b=DCC1UFdivwbRapiOa3LVf763b5zC4lWuwbdaCafoUBDyYqFkbamaySt4LFh1g+oDRF/WCOzLP/ryY7zg1VR5ZREcXtg3UDiIClG468rKQEtdiKumuQFB7WQzKTIm8jTafa2MI217IwuX9UGRUej0Az7QEjrf6M4os0tl2+iGDn4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632285; 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=98jvU+feCca0uj4rnXF3/XaM0gWQFkEqAbMLDmu3sSg=; b=ZXeDIwZwKb+rkcuqw3LnSzIR7lB9/etBfL9Ze21QP7zcj5KEAQPaN1DGDCD8FepG66mwBB0NQNN87CNu7Whp2D6GfozH6HunCKMGLK3ShJagRJZOHnlMv+s0IeXSCkyxEAMeDQxJ37fLFKSIzkJojj7tw+3zzQQqNrykJKHZC+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632285702816.4919542054399; Thu, 1 Jun 2023 08:11:25 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-359-DALo5Bh8MxG1jmb5pG8F0w-1; Thu, 01 Jun 2023 11:10:16 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 77C808032E4; Thu, 1 Jun 2023 15:07:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62F1740102B; Thu, 1 Jun 2023 15:07:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 466AD1946595; Thu, 1 Jun 2023 15:07:07 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0E8BA194658C for ; Thu, 1 Jun 2023 15:07:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E2F95400F0C; Thu, 1 Jun 2023 15:07:05 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 567E3492B00; Thu, 1 Jun 2023 15:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632284; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=98jvU+feCca0uj4rnXF3/XaM0gWQFkEqAbMLDmu3sSg=; b=NEmQWHlcWaStW9KNoKWkmuLF7TeZte7uC8qO5+jAr8s+wEmSrPoPVPNcgDfi0ZUlBWkf6h VGgXzJG2LATFVjfAZ/UOW+BLTZ/1G/+zpKf2QsQxpW5kej65hCOWFfhY46/EDW+l2M4U5+ QZT9OZlBrPtnboT3v87ja4w1BCcHbpQ= X-MC-Unique: DALo5Bh8MxG1jmb5pG8F0w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 06/11] qapi: make the vcpu parameters deprecated for 8.1 Date: Thu, 1 Jun 2023 11:06:44 -0400 Message-Id: <20230601150649.1591095-7-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632287389100001 From: Alex Benn=C3=A9e 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: 20230526165401.574474-7-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-6-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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). +# +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # # Returns: a list of @TraceEventInfo for the matching events # -# An event is returned if: -# -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. -# -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, returning their state on the specified vCPU. Special case: -# if @name is an exact match, @vcpu is given and the event does not -# have the "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: +# 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. -# -# 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632081; cv=none; d=zohomail.com; s=zohoarc; b=B6qWBaOmKLVDpVPC3oPGa8zu1/lNT99sX9pinBpGvzExPaKbIv9NqkvNYFMwBgCye/Z5g8gs7BBwAF6R1013mSaa1LnJfqL+efMx8txQhGOVuF4hM7k8PZonn3xiCUS614tDZyhI8RDKoAu9focMIWdb0FpFHjPHyDDMkw3dX5s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632081; 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=65mEc0ocrW5/8QQ1+7JK5LehvTYH7uTMyUHkd4H2rps=; b=n6UldSE0sb/F6V6XS7PDu+tOjkKHi6Y9XW+vL43xLLza6pR4dvLxs6PMoUk0QgKD1TUkIISPvlUt1jMpegpF5DEEcB6ZIMgveRwaQ4Xk/i/+CRxRkp8jovjcbyNme5TqjH8DWpoa32QtMZjZWP+BZ4JgbiZw+zhJrI+BNvRrKi4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685632081930780.5054292801246; Thu, 1 Jun 2023 08:08:01 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4jtq-0007je-Pa; Thu, 01 Jun 2023 11:07:38 -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 1q4jtm-0007cH-Lv for qemu-devel@nongnu.org; Thu, 01 Jun 2023 11:07:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4jtf-0007rl-4y for qemu-devel@nongnu.org; Thu, 01 Jun 2023 11:07:30 -0400 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-22-Iwqd9HabP2yswBD8mhIF5Q-1; Thu, 01 Jun 2023 11:07:21 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2590F18A65D1; Thu, 1 Jun 2023 15:07:08 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 714DE112132C; Thu, 1 Jun 2023 15:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632046; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=65mEc0ocrW5/8QQ1+7JK5LehvTYH7uTMyUHkd4H2rps=; b=RZG/ftDwW0bpsF9Fi8dbj6qsZb6TuJOZElRyiq8FBsubqU+mQqqSe3JnHF9M8JTpA6hDpW QFVqmDAsTBQQk0RtH59bTfnMGvHgOGnQ0b45OnJzOBOTDyEJZsY30t3DSRrmLznOEJqYMt so0ic0DJICnlWjHYs2IROh8RoJaQGj8= X-MC-Unique: Iwqd9HabP2yswBD8mhIF5Q-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Christian Schoenebeck , Yanan Wang , Paolo Bonzini , Warner Losh , Michael Roth , Markus Armbruster , Marcel Apfelbaum , Richard Henderson , Kyle Evans , Eduardo Habkost , Riku Voipio , Greg Kurz , Richard Henderson , Stefan Hajnoczi , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL v2 07/11] trace: remove code that depends on setting vcpu Date: Thu, 1 Jun 2023 11:06:45 -0400 Message-Id: <20230601150649.1591095-8-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.166, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632082783100002 From: Alex Benn=C3=A9e 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: 20230526165401.574474-8-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-7-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632051; cv=none; d=zohomail.com; s=zohoarc; b=GtBmd+f/K9A+WUCGJNkEdt4gi6NXnARMsDLYl0aw5kiVcw+iUAel8TF6ysyMrqoOq4x0onWAMOj7pci4fcI3/HlVbP9ogyJZPta5Mt4xqllUk1VQn/n/UrcmDei40n4B+LK3T4NbFbPgJda13qUYzRveCeiB+iHO8ssXdjnd4k4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632051; 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=l0mUomyf/Ox+xXMSaQ9IpuFfwKhp3csXMu7acYo6q+8=; b=TJN0xy+aum90cXYy0rmiD+y888wLqZNfyHWWU5NciSOSAXs4Qn5Oj4Y51LgyPstRaLGczQuqb5LUJBn0P4F/RjxCG+x24eqQ922Iynd3S78YxThKbp6wIe2w+BwVHXBaudFnYF2zvUjaUv/46EkG5NTXwOJTyICeWdNlDVOFjWc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 168563205197371.75563540084204; Thu, 1 Jun 2023 08:07:31 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-168-o6AZp9YcNVWn5S5Sx-8Ofg-1; Thu, 01 Jun 2023 11:07:25 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 62DD5803499; Thu, 1 Jun 2023 15:07:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4E79B492B00; Thu, 1 Jun 2023 15:07:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 412F019465A2; Thu, 1 Jun 2023 15:07:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 09E7E194658C for ; Thu, 1 Jun 2023 15:07:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EDD4E40CFD47; Thu, 1 Jun 2023 15:07:09 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CBF840CFD45; Thu, 1 Jun 2023 15:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632051; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l0mUomyf/Ox+xXMSaQ9IpuFfwKhp3csXMu7acYo6q+8=; b=fFwcgZV8/qMwqRbaYTL+D+J3eEoa88gNRmOpcDPQBr1GI10zy4XQpwLuccuGIH8Ycp7d/O q5w65OeznKR9OsnVkv+MK6MLk9KyKInGuB1hBunnev1li5f678f1Y0GBflq57ZeIA/n833 OAWo8zV9pS1WtPOLQtqtrT+LnI3Wr0M= X-MC-Unique: o6AZp9YcNVWn5S5Sx-8Ofg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 08/11] trace: remove control-vcpu.h Date: Thu, 1 Jun 2023 11:06:46 -0400 Message-Id: <20230601150649.1591095-9-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632076783100001 From: Alex Benn=C3=A9e 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: 20230526165401.574474-9-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-8-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632084; cv=none; d=zohomail.com; s=zohoarc; b=GtgLdCe6R8VSwPf3YlgrmKvtRXkEZKV3CCAgBfWBmNyltxlqFw/nEUkkvvn5u7MrqJV734KNd510NLcEZUPS+SLnr8EgqgAVZf9RZyMPQUWOBZ4CUGwaJJTT82C3Naoa5rkwZefXfih+qspE1c4oWL2TPpeSHeaSGrVTH5LwJRs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632084; 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=NqICW3GcmnO+a60Iohk8Y/M3AMHkcsRUs3FxixMsIy0=; b=ieDS9/o0pW0VlIMm/CEo0eVdilNEv7RENM1taDwzM3h/lMvyAbgdf5Vh88NfoO91d8FdLt0OEc80121dZ+sZ0wlU6h1ALAEZ+YT3a1wclnEgqUqkqAAbp1b7N9KIFT9QMIF+ZLDoS4TCQNckHIG+c/Xc3CglNbLu3FP7lpjtWls= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1685632084042223.4957715896811; Thu, 1 Jun 2023 08:08:04 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q4juB-0008I8-NN; Thu, 01 Jun 2023 11:07:59 -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 1q4ju3-0007tz-Uj for qemu-devel@nongnu.org; Thu, 01 Jun 2023 11:07:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q4ju1-0007vE-Te for qemu-devel@nongnu.org; Thu, 01 Jun 2023 11:07:51 -0400 Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-645-cq5L6lQPO7avoc1vqC13hw-1; Thu, 01 Jun 2023 11:07:26 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDDFB3825BA3; Thu, 1 Jun 2023 15:07:11 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 404FD40C6CDD; Thu, 1 Jun 2023 15:07:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NqICW3GcmnO+a60Iohk8Y/M3AMHkcsRUs3FxixMsIy0=; b=bzQZcqDCoDhX3V9IoqjWSweElV8lWozLu4D6TWm+tVX6DgK8z44OIwSarUbgI7VaB+wfsQ FioP/sj2IXSTCDgi2lAr0tzAl5UiABZJtKOR+4UL+tOLisQvd9lr1BeG0xbPkkjbiSlrU4 jfK8iI1RR1YXhPF9JZkKnqRSVyros/I= X-MC-Unique: cq5L6lQPO7avoc1vqC13hw-1 From: Stefan Hajnoczi To: qemu-devel@nongnu.org Cc: Christian Schoenebeck , Yanan Wang , Paolo Bonzini , Warner Losh , Michael Roth , Markus Armbruster , Marcel Apfelbaum , Richard Henderson , Kyle Evans , Eduardo Habkost , Riku Voipio , Greg Kurz , Richard Henderson , Stefan Hajnoczi , libvir-list@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Eric Blake , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PULL v2 09/11] tcg: remove the final vestiges of dstate Date: Thu, 1 Jun 2023 11:06:47 -0400 Message-Id: <20230601150649.1591095-10-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=stefanha@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -22 X-Spam_score: -2.3 X-Spam_bar: -- X-Spam_report: (-2.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.166, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632084846100009 From: Alex Benn=C3=A9e 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: 20230526165401.574474-10-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-9-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632099; cv=none; d=zohomail.com; s=zohoarc; b=WPFrcRyRd+M7hSBX4uzCL4tStkSns1zcUlXkJXDZKH2Iee7Xve9XJ7mFxjsvERHSuFujhgsTTEBIvG+3Xn4ZdYWXvrrvlAVSThMtU8Jri9o9lGdyCyFNm5NDiH4+MuVNAF2LtwZKpeCS2XFdsR7w4A/1f7GsrPvRljAoTD8wn5I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632099; 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=c+XyfxTZMzK3ja4GbAtJLCIzXpCGwY8IXwOAZg5IFGI=; b=OTRD+ab9AXnR/8xUtbcnsC9GPQYZbYms+2oyLe4FVYQekMYK6lnKSZaBUw2FiUcQhriW6ULJMST8qF/XFYKJicuHFAKvoIVki+PIcbHbPxdxk3en2NnjreTbOz0dIDooDGfF4ulzAazQUkF8imOkI10fHPMMJDqfBcJBx1dPMaU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 168563209965333.317305558310295; Thu, 1 Jun 2023 08:08:19 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-163-MtRwFGyEPeST9zEDMZp6hg-1; Thu, 01 Jun 2023 11:07:28 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EDC6338288AB; Thu, 1 Jun 2023 15:07:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id D58162166B27; Thu, 1 Jun 2023 15:07:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C70551946595; Thu, 1 Jun 2023 15:07:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C264C194658C for ; Thu, 1 Jun 2023 15:07:13 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B3F7C2166B2A; Thu, 1 Jun 2023 15:07:13 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3510B2166B25; Thu, 1 Jun 2023 15:07:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632098; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=c+XyfxTZMzK3ja4GbAtJLCIzXpCGwY8IXwOAZg5IFGI=; b=FIQYuaI3ljfo+vtsI4G8IaVO/Tybiv8M7ZQEJV95P9q16yq3DUdou3hfYRGrT+UQA8T1EF N9BcrPNTPC2+DODPVEbyK8DrwqcF7OebrU7p4w5F47n0yWeMdn+VaFka8SbT9EyEzmfCA2 uKGHQ0yWSJgJVBggHw49CnT8JljMQcA= X-MC-Unique: MtRwFGyEPeST9zEDMZp6hg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 10/11] hw/9pfs: use qemu_xxhash4 Date: Thu, 1 Jun 2023 11:06:48 -0400 Message-Id: <20230601150649.1591095-11-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632120876100005 From: Alex Benn=C3=A9e 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: 20230526165401.574474-11-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-10-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1 From nobody Fri May 3 20:15:59 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1685632057; cv=none; d=zohomail.com; s=zohoarc; b=Ulyljy20y/d6KUS9SdFgJXcBsV/AEcKRiwas+tFaEzJNqltUQqTeh0qkzC54quCY7gn4+vPtAvjm7WdeIzqaVZdj8lorvMdmtdszT/6xJaqtbSflaTiAVPwJqATO+jCQEPCq28hbB8xm8kwc0t0k48kOHRqlJfuJHKidMlsHPhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1685632057; 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=l0bRHaw6a/XCO9x1BsFkywdp6jnak01uQbrcuI2sOX0=; b=Sz4Qir/sqzjdKBPQI5VkWn6XoEDGFtziIi2I39Mz+9u2sBOdYzt+M/sudI9+qo++x6kUATlMFZr1SviOdYtmiK4DzoFwDkbl1rgQCFglsc+h1f7t1z4TIBgV3F4U7WjIbRygsObFVxPWRtPmuaczH8i4FZii5apYmd0lokJ3xUo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1685632057344687.4704630441931; Thu, 1 Jun 2023 08:07:37 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-353-Jw3ban2RO3eAsaVQE4aHRA-1; Thu, 01 Jun 2023 11:07:23 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A46B29324BA; Thu, 1 Jun 2023 15:07:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 469ED40CFD46; Thu, 1 Jun 2023 15:07:17 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1877D1946595; Thu, 1 Jun 2023 15:07:17 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9E64D1946595 for ; Thu, 1 Jun 2023 15:07:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8CE5340CFD4A; Thu, 1 Jun 2023 15:07:15 +0000 (UTC) Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 10F5440CFD46; Thu, 1 Jun 2023 15:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685632056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=l0bRHaw6a/XCO9x1BsFkywdp6jnak01uQbrcuI2sOX0=; b=dY90qCbyi6vinq5h4FzcZqdrQhxf3OaNLFjOCn6iytcL8/Aay9kK3gfKSKeYiYcjMFKjHl i3A0IhPuQz9FVCErRzO7eZXi96Hu6dYEZ7+syHgICn6nqJEY1u/9is6/Nl8IO6v0lidveQ OLwPSVlPGJPcfkWUkzzCS7w7L6zJO3M= X-MC-Unique: Jw3ban2RO3eAsaVQE4aHRA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 11/11] accel/tcg: include cs_base in our hash calculations Date: Thu, 1 Jun 2023 11:06:49 -0400 Message-Id: <20230601150649.1591095-12-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Stefan Hajnoczi , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1685632082743100001 From: Alex Benn=C3=A9e 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: 20230526165401.574474-12-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-11-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- 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.40.1