From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846226; cv=none; d=zohomail.com; s=zohoarc; b=j0FbHyeljG0OV5bNllGRHE+D1jfZYfQKqnIn/GDQntALxQ2V5jvBRtk5RAUwoLE9r9t97tsp43idnLXtX9UZ9idww25AL6eVl1I2ZtNmNq0DjAJXMf5WpxQtKRGTqflJOH6Uik1w7fgWLBSvVf9cg0mrxaj9kWgpYJsavuaY8uw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846226; 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=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=Bf12IeNorjrY0LinUZU4XqvazA4QGLLaPd0ML9CFhf+rJOad0qMqzxOspXxxif+q6dvr0Y/+A8P+Lz17dSHKO88sDEFLE0g6yS8inQgZ8rFog3GTfD/0b9yxeyRwZHHOBCH3trJqZ8Ha/+Wbq5lA1oZxaiuo98n5YrZukSHenU0= 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=fail 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 1684846226956253.92275327288792; Tue, 23 May 2023 05:50:26 -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-546-7080bhWrM96d0K7HhGj45Q-1; Tue, 23 May 2023 08:50:21 -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 7FE76280AA20; Tue, 23 May 2023 12:50:18 +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 698CB9D7B; Tue, 23 May 2023 12:50:18 +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 15A7F19452C5; Tue, 23 May 2023 12:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 21B351946A44 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 170EF40D1B64; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0F8F140D1B60 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E01F8185A78E for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-3cmvtiYaNDOgTJdYiwHIrQ-1; Tue, 23 May 2023 08:50:03 -0400 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f42d937d2eso46738705e9.2 for ; Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v16-20020a1cf710000000b003f4fe09aa43sm14973884wmh.8.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0AE011FFBC; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846225; 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=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=hJP1g4Rtx+eAGP7rc4Vl7Ab6OUpf/srtAIUiQzxmXNKfJloCqjVL9OPAbirxOoXLJVC9DB zY3UBYeUeuFMOUD8MgOZE9S4EvFtRCAte1Qc4bUiMhXGYE4ZkBpQXfX57bD6wVxyQdQ91Y 0AYi5S4y3Kmv7d3m2mShv/IdR5/NDU8= X-MC-Unique: 7080bhWrM96d0K7HhGj45Q-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 3cmvtiYaNDOgTJdYiwHIrQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=A3sLFMC4eyo3fxWT/KyQ8nkSp9/dnxDIujeWXjaf9vWiTqsQJPePNDIwcD/gMklBJO +6F1RQp/VOtvIyg58cGk/rrFyWdwDfupe2moY2SIProsxQFZcDb3DGKS3EnTtu3oTvFa GbcoceheaKKqNb2tbhKchdnezzLy2t6mGw7vjxfURkPkzZD8S5xAe2i5Ygz5MWL2Z/v2 Ocmss3Ar1ig5VdA00gbGHTmT1QUin+whVDhS5m3VqSL4rrtZvUQcio3+5gln6xPM6gYT IQDizlQ4bR+g4lfz40l9ZhbT79bcd+SgDSoUPhPCoZB57gOhkXwh2540S8RbDlRjDB6q Xlgg== X-Gm-Message-State: AC+VfDy94q4Jt/ppPIK1wSSbUVEdyxYqY8FTU0A2DoB8S4WmyC3LQDZw WxK+jv00kzfmMTRcjVUlwDzLfA== X-Google-Smtp-Source: ACHHUZ6gAWwrycvnrr6jeLur/D4YiFDzFM+fCe5BW8KakFuZ9hEulFAqfbs/yAt1uYXRcg7lalDWug== X-Received: by 2002:a05:600c:3797:b0:3f4:2819:7777 with SMTP id o23-20020a05600c379700b003f428197777mr10079447wmr.38.1684846201838; Tue, 23 May 2023 05:50:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 01/10] *-user: remove the guest_user_syscall tracepoints Date: Tue, 23 May 2023 13:49:51 +0100 Message-Id: <20230523125000.3674739-2-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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 , =?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 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: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846228362100003 This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Message-Id: <20230420150009.1675181-2-alex.bennee@linaro.org> Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-2-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-2-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 2 -- trace-events | 19 ------------------- 3 files changed, 25 deletions(-) diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 90bda7631c..557f881a79 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8) { - trace_guest_user_syscall(cpu, num, - arg1, arg2, arg3, arg4, - arg5, arg6, arg7, arg8); qemu_plugin_vcpu_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); @@ -36,7 +33,6 @@ static inline void record_syscall_start(void *cpu, int nu= m, =20 static inline void record_syscall_return(void *cpu, int num, abi_long ret) { - trace_guest_user_syscall_ret(cpu, num, ret); qemu_plugin_vcpu_syscall_ret(cpu, num, ret); } =20 diff --git a/bsd-user/freebsd/os-syscall.c b/bsd-user/freebsd/os-syscall.c index c8f998ecec..b0ae43766f 100644 --- a/bsd-user/freebsd/os-syscall.c +++ b/bsd-user/freebsd/os-syscall.c @@ -531,7 +531,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, CPUState *cpu =3D env_cpu(cpu_env); abi_long ret; =20 - trace_guest_user_syscall(cpu, num, arg1, arg2, arg3, arg4, arg5, arg6,= arg7, arg8); if (do_strace) { print_freebsd_syscall(num, arg1, arg2, arg3, arg4, arg5, arg6); } @@ -541,7 +540,6 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi= _long arg1, if (do_strace) { print_freebsd_syscall_ret(num, ret); } - trace_guest_user_syscall_ret(cpu, num, ret); =20 return ret; } diff --git a/trace-events b/trace-events index b6b84b175e..691c3533e4 100644 --- a/trace-events +++ b/trace-events @@ -85,22 +85,3 @@ vcpu guest_cpu_exit(void) # Targets: all vcpu guest_cpu_reset(void) =20 -# include/user/syscall-trace.h - -# @num: System call number. -# @arg*: System call argument value. -# -# Start executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall(uint64_t num, uint64_t arg1, uint64_t arg2, uint64= _t arg3, uint64_t arg4, uint64_t arg5, uint64_t arg6, uint64_t arg7, uint64= _t arg8) "num=3D0x%016"PRIx64" arg1=3D0x%016"PRIx64" arg2=3D0x%016"PRIx64" = arg3=3D0x%016"PRIx64" arg4=3D0x%016"PRIx64" arg5=3D0x%016"PRIx64" arg6=3D0x= %016"PRIx64" arg7=3D0x%016"PRIx64" arg8=3D0x%016"PRIx64 - -# @num: System call number. -# @ret: System call result value. -# -# Finish executing a guest system call in syscall emulation mode. -# -# Mode: user -# Targets: TCG(all) -vcpu guest_user_syscall_ret(uint64_t num, uint64_t ret) "num=3D0x%016"PRIx= 64" ret=3D0x%016"PRIx64 --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846215; cv=none; d=zohomail.com; s=zohoarc; b=G3TZfu/+28M/9o2eljli2Cufy9cnXGEUGPNdyuZSZxfFCMesX7wQOjLWXqV6DyusrMzC52qfPOm3DJ7CMFOssuQiudnjDh4yVP9hCPi68QRG27qdDOKAHW3IW92pvzBu2cJVx5ub2fGmKcVP8xv15txiG8t0wobbeQxeKA/3rVQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846215; 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=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=du0BgCXXRbkns/hhl+EN4gCsyflQiboZdfMsOTAXhG28kMZ5AgpsCtKjFLDCSy3WQysEHQG3kUuemJCBuGMDXu7KQm+UIfeFaknSJrCn10+FnBg6PkUgBvYNSy4J8gEbJYTqAHpjtxtKeZPvSvrbpewg20/a3DqVbQDS992CAqA= 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=fail 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 1684846215465435.60431297849493; Tue, 23 May 2023 05:50:15 -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-448-KMWSaiwANveXzM9y6wWD-g-1; Tue, 23 May 2023 08:50:09 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 498DE811762; Tue, 23 May 2023 12:50: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 3336B2029F6E; Tue, 23 May 2023 12:50: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 F187819465A8; Tue, 23 May 2023 12:50:06 +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 865D319465A0 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6462A9D7B; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5C9E69D73 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3E4818039B7 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589-zQERWOB1MIils6lzsZrnAQ-1; Tue, 23 May 2023 08:50:03 -0400 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f60e730c4bso3269575e9.1 for ; Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id m7-20020a5d56c7000000b0030630120e56sm10943460wrw.57.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:01 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2BF7D1FFBD; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846214; 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=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=hCJKP5yZLJ1b330Eyi623AQSWQd9nqT0PvLyfP9g8Fl8QNRC4E0BRbFc376HgKa6Psl/6A XrKX7CKTtm4sbRasg5gE9rKdbpomZjrhzcYDHCKSV5wDxen99MlAwy5bP7orPI6ELWSEXW 5Ft/KQded5yk5s9xfoTB3KwjVL8LUhM= X-MC-Unique: KMWSaiwANveXzM9y6wWD-g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: zQERWOB1MIils6lzsZrnAQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=Q+vmxF1DAZQxcYTLt2l9TY4/LNVbgg6sSkTr8KxCDWTwcHNhSNKPFZ41GTX6gk9V6R 4PwBNX1f8rLm17Tzx2FOu+u51ObJf9rOkVU2IeoN7LvlieW34+ymwYKoa9kS+P3k4jst vLPzOKFtdZdtz7w8iAi6QShJGniwALoWmXQweAqNbj2899yVh1Ur+6yN5S2mwI11j16S ymS588QqEfF995EMpn7GTgLMg5bPPXvehdZKnoet/A+L7vmP8CZDtzvnPFBsvErRsut0 RIzFepnE6UxuC6H0/wakuInApHsX+OFcgDBzXbMj0ZUJ2Kl7qc6uLB1lxVCuWYs0idaQ CVgw== X-Gm-Message-State: AC+VfDzTNQ2weR9q2G1zQsTcI5YclDwT9EhpCFL1q8/6cI9NQYLEM/Ed 4gQT/R2OW6Xw1VMvY6IOwynPUQ== X-Google-Smtp-Source: ACHHUZ4sgX3oqPR75I1pHYMd6vCkpFXPLSeQhyOWH4IMQp3FUOJokcRxZhQ+BiNydPTi2kn7X9DtSQ== X-Received: by 2002:a1c:f614:0:b0:3f5:d0b8:4a53 with SMTP id w20-20020a1cf614000000b003f5d0b84a53mr10552864wmc.34.1684846201991; Tue, 23 May 2023 05:50:01 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 02/10] trace-events: remove the remaining vcpu trace events Date: Tue, 23 May 2023 13:49:52 +0100 Message-Id: <20230523125000.3674739-3-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846216336100001 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 Message-Id: <20230503091756.1453057-3-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-3-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" =20 CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); =20 - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } =20 static void cpu_common_reset_hold(Object *obj) diff --git a/trace/control-target.c b/trace/control-target.c index c0c1e2310a..a10752924b 100644 --- a/trace/control-target.c +++ b/trace/control-target.c @@ -144,5 +144,4 @@ void trace_init_vcpu(CPUState *vcpu) } } } - trace_guest_cpu_enter(vcpu); } diff --git a/trace/control.c b/trace/control.c index 6c77cc6318..d24af91004 100644 --- a/trace/control.c +++ b/trace/control.c @@ -277,8 +277,6 @@ void trace_fini_vcpu(CPUState *vcpu) TraceEventIter iter; TraceEvent *ev; =20 - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev =3D trace_event_iter_next(&iter)) !=3D NULL) { if (trace_event_is_vcpu(ev) && diff --git a/hw/core/trace-events b/hw/core/trace-events index 56da55bd71..2cf085ac66 100644 --- a/hw/core/trace-events +++ b/hw/core/trace-events @@ -29,3 +29,6 @@ clock_set(const char *clk, uint64_t old, uint64_t new) "'= %s', %"PRIu64"Hz->%"PRI clock_propagate(const char *clk) "'%s'" clock_update(const char *clk, const char *src, uint64_t hz, int cb) "'%s',= src=3D'%s', val=3D%"PRIu64"Hz cb=3D%d" clock_set_mul_div(const char *clk, uint32_t oldmul, uint32_t mul, uint32_t= olddiv, uint32_t div) "'%s', mul: %u -> %u, div: %u -> %u" + +# cpu-common.c +cpu_reset(int cpu_index) "%d" diff --git a/trace-events b/trace-events index 691c3533e4..dd318ed1af 100644 --- a/trace-events +++ b/trace-events @@ -54,34 +54,3 @@ qmp_job_resume(void *job) "job %p" qmp_job_complete(void *job) "job %p" qmp_job_finalize(void *job) "job %p" qmp_job_dismiss(void *job) "job %p" - - -### Guest events, keep at bottom - - -## vCPU - -# trace/control-target.c - -# Hot-plug a new virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_enter(void) - -# trace/control.c - -# Hot-unplug a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_exit(void) - -# hw/core/cpu.c - -# Reset the state of a virtual (guest) CPU -# -# Mode: user, softmmu -# Targets: all -vcpu guest_cpu_reset(void) - --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846217; cv=none; d=zohomail.com; s=zohoarc; b=LnbaWc2p25yeHnO5T6HL8chXr4XXzdGc2k69Zvsoci1m2qWkMwOTHHb2hxhHObSQ3ldxSzucXKaS22/bchYYilw7ZrEaNKn2as9prPb55za8cNuNYdybHVh/mcZzqH8SRCP3bPEFOx+xzVt28B2M9ATRjJWpv5lQFoAZSmfyTlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846217; 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=F9BiWzhII5nBPAZEsKdL2AlbO+U++qCrVxAC9xrSYp8xKQSU9pdmG4bRsL1PbhIMrGdx34xHbypcHpMMOABAaEWc8cdzu/MVaRhuEUCJpNIf3/QD9TdCehHE5pN1Sy57Z8L9pw6g16ccFXSfT0Dw99Qawsc6FAevdJhx8nOYdQs= 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=fail 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 1684846217673200.78485600023396; Tue, 23 May 2023 05:50:17 -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-6-oWq2ZEKUP2G-93d8P_Qj3A-1; Tue, 23 May 2023 08:50:15 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 99F0A280AA2B; Tue, 23 May 2023 12:50:12 +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 85BB0140EBB8; Tue, 23 May 2023 12:50:12 +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 3C0BB19459F1; Tue, 23 May 2023 12:50:07 +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 BC5CC19465A0 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id AFF6A140E95D; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7F50140E961 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8C16F800159 for ; Tue, 23 May 2023 12:50:05 +0000 (UTC) Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-654-rBkdjLcYPwqiOoAe0tRqjw-1; Tue, 23 May 2023 08:50:03 -0400 Received: by mail-wr1-f46.google.com with SMTP id ffacd0b85a97d-3093d10442aso4721046f8f.1 for ; Tue, 23 May 2023 05:50:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o10-20020a5d670a000000b0030903371ef9sm11095816wru.22.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4D5901FFBE; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846216; 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=PU6Yn4QjRQddkHztMwe8wkfYsX4W0kqCDNYIAjV9xqiZ5fFUGHNCTeHiI2Wtlwxh/R5knH vRbjQuCLelB6RtplVylR6fDwTA2ChYyiwIwcX150hMZQgHtVAf9AWVGRXkDBPFLJshRNge PVWtqvmlG3xrkYs30x8keeLoypy11NQ= X-MC-Unique: oWq2ZEKUP2G-93d8P_Qj3A-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: rBkdjLcYPwqiOoAe0tRqjw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846202; x=1687438202; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=NWcJZenKEW/GBCCXG60oQL09xVJrWYgsgNfs9RItfqDY844GrEcfszeQWuuR298GMp yG0fZiumaZB3fvhYQ7PsxJk6TmjzQS9RdjpCWNV6/9wCEJUOB664XikbUB7oiNtx9cSZ JnoJfQIejcc9Z/TGHWdvyFMF1kSXhcSmTNBZ4uqNak+wMFk37hSxaaL5QJPvrFfyCg/w Nl2ulyj5c3+PwvNrGlv0YtEFa8vMP9/mVPvWwkwOWVGLsXzqi/JLQObXWgPjWZI9U8af 4qpS+gnm4LibNFui6N/+u4QmUr2xItNaeQKmSerQQuzB1jPqz3iwww1/ukZ3i4dFDkXH pifQ== X-Gm-Message-State: AC+VfDzHEha2Ly3LH4tPCt2WSYliXQb6xOFxnewx0bLN6lceqH4kj7YF Hp+kPx8MFxGb7D5OwdeuC6nyLw== X-Google-Smtp-Source: ACHHUZ45U8OvvNOz2Ld2KzJ1XasJQ1L2EQpTRa+LrHLqF6A3iGynVuABtzgpP8CYkVwc6Qw11aKLWA== X-Received: by 2002:a5d:4fcc:0:b0:306:31e0:958 with SMTP id h12-20020a5d4fcc000000b0030631e00958mr9243256wrw.15.1684846202750; Tue, 23 May 2023 05:50:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 03/10] trace: remove vcpu_id from the TraceEvent structure Date: Tue, 23 May 2023 13:49:53 +0100 Message-Id: <20230523125000.3674739-4-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846219059100001 This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Message-Id: <20230420150009.1675181-4-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-4-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-4-alex.bennee@linaro.org> --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *e= v) =20 static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } =20 static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id !=3D TRACE_VCPU_EVENT_NONE; + return false; } =20 static inline const char * trace_event_get_name(TraceEvent *ev) diff --git a/trace/event-internal.h b/trace/event-internal.h index f63500b37e..0c24e01b52 100644 --- a/trace/event-internal.h +++ b/trace/event-internal.h @@ -19,7 +19,6 @@ /** * TraceEvent: * @id: Unique event identifier. - * @vcpu_id: Unique per-vCPU event identifier. * @name: Event name. * @sstate: Static tracing state. * @dstate: Dynamic tracing state @@ -33,7 +32,6 @@ */ typedef struct TraceEvent { uint32_t id; - uint32_t vcpu_id; const char * name; const bool sstate; uint16_t *dstate; diff --git a/trace/control.c b/trace/control.c index d24af91004..5dfb609954 100644 --- a/trace/control.c +++ b/trace/control.c @@ -68,16 +68,6 @@ void trace_event_register_group(TraceEvent **events) size_t i; for (i =3D 0; events[i] !=3D NULL; i++) { events[i]->id =3D next_id++; - if (events[i]->vcpu_id =3D=3D TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id =3D next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups =3D g_renew(TraceEventGroup, event_groups, nevent_groups = + 1); event_groups[nevent_groups].events =3D events; diff --git a/scripts/tracetool/format/c.py b/scripts/tracetool/format/c.py index c390c1844a..69edf0d588 100644 --- a/scripts/tracetool/format/c.py +++ b/scripts/tracetool/format/c.py @@ -32,19 +32,13 @@ def generate(events, backend, group): out('uint16_t %s;' % e.api(e.QEMU_DSTATE)) =20 for e in events: - if "vcpu" in e.properties: - vcpu_id =3D 0 - else: - vcpu_id =3D "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s =3D {', ' .id =3D 0,', - ' .vcpu_id =3D %(vcpu_id)s,', ' .name =3D \"%(name)s\",', ' .sstate =3D %(sstate)s,', ' .dstate =3D &%(dstate)s ', '};', event =3D e.api(e.QEMU_EVENT), - vcpu_id =3D vcpu_id, name =3D e.name, sstate =3D "TRACE_%s_ENABLED" % e.name.upper(), dstate =3D e.api(e.QEMU_DSTATE)) diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index e94f0be7da..285d7b03a9 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -74,16 +74,7 @@ def generate(events, backend, group): =20 out('}') =20 - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu =3D next(iter(e.args))[1] - cond =3D "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=3Dtrace_cpu, - id=3De.name.upper()) - else: - cond =3D "true" + cond =3D "true" =20 out('', 'static inline void %(api)s(%(args)s)', --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846231; cv=none; d=zohomail.com; s=zohoarc; b=IK0RLywzQHacie7WN47jfiMJnAGKt2euHuI4s2IlsYxCA/Kjqti3bwhPZLdarIkI3lNkz9xvuEa90wwvI34OHXRA0GpE/uQa4d8zoK52EE8uGU+t7bsVhJXWxYH9CnpD2lmPyLP8+hKOpsd/jVR/cDQ3MGnKPHlmiPvjk9WM9C0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846231; 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=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=VnjbAMny7rN88u0MFOXvJ6aCjSoFTByAsVyjhTndGJNhcajYTmtVonyTHBTFgCcXzKm6VkMfkg3zIq26eeIihWs45Y1wwGSOzxslyETpGPNz4hJDU4fduKlwfaeWs+o3/Tdey0X+8WXDIQQ1n0F+AmryBegS2b0uJXgXlQWHCc4= 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=fail 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 1684846231518319.14367372053994; Tue, 23 May 2023 05:50:31 -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-97-5i3__enFNdGA7LQyipo2Qw-1; Tue, 23 May 2023 08:50:27 -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 6D38B3847092; Tue, 23 May 2023 12:50:24 +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 55D7640D1CF; Tue, 23 May 2023 12:50:24 +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 96CF31946A44; Tue, 23 May 2023 12:50:18 +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 9BD6E19465BA for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7BDA040CFD46; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 749FF40CFD45 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 58E9685A5B5 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-399-1HtIdUq4Mly0ZdlTJEwA6w-1; Tue, 23 May 2023 08:50:04 -0400 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-3f6094cb2d2so10376575e9.2 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q3-20020adff783000000b002e61e002943sm10960332wrp.116.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 657EA1FFBF; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846230; 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=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=Z2N19Btsu3TpdQVZC7sh4RcT9fqeQyfHZ1PkRCCc87I6UK4Hpi2Kxu0YgcEGGEm7XjpCM3 xCGcvQWDu7Peg9QIxZm+2h96bMzujZvYoVvF+FBn5nddSuyUEcUpLW1+sS/5gf5/K/1Bb/ zYkFRpd7DnHtWYrlkQMRHDK7ey0So6s= X-MC-Unique: 5i3__enFNdGA7LQyipo2Qw-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: 1HtIdUq4Mly0ZdlTJEwA6w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=UYFSQ6b8M4tGnYjg5mIkxz7tIW+spuTXOlWzJ47LfsBJ1OfQ3Rgna+hGMWwvdaQMoA xcbmKmMq2323PpMqr9j+wzUDK6MlYtTqET7DxO5mhtiYmOSUwiSS0WqP81ZaYsDZrXZx xZy8JjFhDkJG0GUtMfpxewmZQ/7fQcpAOLDKCm6EoR9qsdvy/n7SpbKKUU59KpgHyLI/ WyUCyw30nJI4pQRhoeERh2dUlhHUhZmi8oyoGfcqL1IB0DL0scGPrpWv43Uejig/U4EX oNiDWrIwtXa8LnUWEQIzgVznzfImUh/XLQYvrJsFX2HZ+6Sagp1ICQ579PASr5Oj8bNG 7ImA== X-Gm-Message-State: AC+VfDyikXjuESjGzuLXawEdU1T+yQGygpNN/VLObdRymShcW1LF01VC ymXfAS0sPvUI+W3jEGbdm+o+zA== X-Google-Smtp-Source: ACHHUZ7ctykBYCeyKMDAV1FOk1+7S+X29GIaMZ90CvXQEcbpmo2eDOHQ9sfMf4obVORH68Q2M+6Lzg== X-Received: by 2002:a5d:62d0:0:b0:309:51c5:3bf6 with SMTP id o16-20020a5d62d0000000b0030951c53bf6mr10999718wrv.23.1684846203460; Tue, 23 May 2023 05:50:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 04/10] scripts/qapi: document the tool that generated the file Date: Tue, 23 May 2023 13:49:54 +0100 Message-Id: <20230523125000.3674739-5-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 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: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846232361100003 This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-5-alex.bennee@linaro.org> --- v4 - expand out os.path.basename(sys.argv[0]) --- scripts/qapi/gen.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..2ea27ef31c 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=3Dstr(os.path.basename(sys.argv[0])), blurb=3Dself._blurb, copyright=3Dself._copyright) =20 def _bottom(self) -> str: @@ -195,7 +197,9 @@ 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 ' + f"{os.path.basename(sys.argv[0])}, DO NOT MODIFY\n\n" ) =20 =20 @contextmanager --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846221; cv=none; d=zohomail.com; s=zohoarc; b=CUl7DELfVnODS7ZBZL0FhUXS6aGByg4LFjHr2roPeexIp5ZXWzGzplUFiRMAtW/+Xj3LAaD5v8VXZYrUXN7ImP5s4pqdGyDRvWhH4GwUnCBVFLnWwtfMroiqUwdYpdlIkXNT2vsEGgtRalhlBYWyN6vP3S5CtLBPv99+EB6kVpE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846221; 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=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=TLQeq1/1oYbt2aay10E1HNV/8K9TsYk2E9X1BE2uJ5F3PMAEDHqm7srF0xJzUpAyJQzvwpBMqR8cFlRNhj/CFHcDv9FCBvtuclJgaqWY8fCCihz3OUVeYY+nLeUGUryx7t3VfipM0VflroXp0xSFdXHrt/GRACnvFLCiR7GkMS4= 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=fail 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 1684846221076352.74563540172835; Tue, 23 May 2023 05:50:21 -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-641--N2FFE4YNSet6DCrT7lnxA-1; Tue, 23 May 2023 08:50:15 -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 D7E39803C82; Tue, 23 May 2023 12:50:12 +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 BEADD40CFD4A; Tue, 23 May 2023 12:50:12 +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 9DD841946A41; Tue, 23 May 2023 12:50:12 +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 A5C0419465A8 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 94ECC2166B25; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8CB3D2166B27 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70AB085828C for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-589--QLqBAE_MTOncSuelbqQAg-2; Tue, 23 May 2023 08:50:04 -0400 Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-3f60444238cso23905445e9.3 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z12-20020a5d640c000000b00307c8d6b4a0sm10995580wru.26.2023.05.23.05.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 7EFB21FFC0; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846220; 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=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=LKa0yViXxm3nKpaTJEQY0bsa/YeK2nklzfxgPSKg8VFB1gATK/jdotXa4FnX+VtT+dXlDQ YM5dXOlXbtwkzCDV0msoy6s+y4iCYSvLP4rH7k9FqOn3MbDOYk6qgr3ysp4ldwzM1B9kau owH/qXHVP6dJUc5aW+RqcTr8zHiuFzw= X-MC-Unique: -N2FFE4YNSet6DCrT7lnxA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: -QLqBAE_MTOncSuelbqQAg-2 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=VBk+AN2x9AlDRNLfg3JXEpArnK4dwtholVl73ByODlFg5CMTAVEhlCuDs42qQz+6VP PtXVhuqHaISPBRw8NNILThTSpgvSIzeGeEpkWGsS4QJNsY/GREDzZhiviEaT8mfUDPXB ZFNwcKVw+Uu2u0kJ1kDau8fIbOpP6tmh4jGfdVB+hTm753RqkJGChba2ajmoED1eMSji HmrSOKBZkAMeyzTClsMjBR1LAkDo1V6Zk7IUP1xiRDGVx86GK/DwaNcInLhSnNeSjStN AvA8HGWdbYNBgy6HHpCofaR0+3LbkpuWNqQM1PVYpXwJwh2Y2yWYVY9vXavAIgc+OBUw Pezg== X-Gm-Message-State: AC+VfDwRN19wbXlMGdi3s/GgEVSD5JImtgnXmFzRkEdLI3l7gn+PDo+E yfj9thzFgieAXCJvQJlBcLsF2g== X-Google-Smtp-Source: ACHHUZ5Pwrb2dCfBCiTML5D8Zroll25PTxfJRBwjg1Iy90s+3BMF0o6iVSHkgYuOH9wd1Cyh/OC/pA== X-Received: by 2002:a5d:45c4:0:b0:309:3ddc:1c8d with SMTP id b4-20020a5d45c4000000b003093ddc1c8dmr8660172wrs.70.1684846203637; Tue, 23 May 2023 05:50:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 05/10] qapi: make the vcpu parameters deprecated for 8.1 Date: Tue, 23 May 2023 13:49:55 +0100 Message-Id: <20230523125000.3674739-6-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 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: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846223058100001 I don't think I can remove the parameters directly but certainly mark them as deprecated. Message-Id: <20230420150009.1675181-6-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-6-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-6-alex.bennee@linaro.org> --- v4 - used @deprecated in json - added note to deprecated.rst --- docs/about/deprecated.rst | 9 +++++++++ qapi/trace.json | 38 ++++++++++++++++++-------------------- 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e934e0a13a..e44cde057f 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -254,6 +254,15 @@ it. Since all recent x86 hardware from the past >10 ye= ars is capable of the QEMU API (QAPI) events ---------------------- =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 the QAPI still exposed the vcpu +parameter. This argument has now been deprecated and the remaining +used trace points converted to plain trace points selected just by +name. + ``MEM_UNPLUG_ERROR`` (since 6.2) '''''''''''''''''''''''''''''''''''''''''''''''''''''''' =20 diff --git a/qapi/trace.json b/qapi/trace.json index 6bf0af0946..aac58e875b 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 false. # # 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,17 @@ # # @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 false. # # 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. +# - its name matches the @name pattern +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -75,7 +74,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 +91,13 @@ # # @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 false. # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# An event's state is modified if: # -# 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. +# - its name matches the @name pattern +# There are no longer any per-vCPU events # # Since: 2.2 # @@ -111,4 +109,4 @@ ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': 'int'} } + '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } --=20 2.39.2 From nobody Wed Apr 24 16:53:12 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846286; cv=none; d=zohomail.com; s=zohoarc; b=CamIot7uDy6ATVXddbjZDX4OWz55fOtIjtOSyEsXHFbyv68NeCN9WfzzRlq3CmrL47g6tTuUo1Xn/oeNMYxKQmuN/rIz27xnKZcw6JO3e7VLd/ZLb20JHjc/YnUF6QP061pEwgdEqeGd9/DFUeEVyr0QFoTHUzEOUZQnghzixck= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846286; 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=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=GBKQ+2THgzr52kxDX1JrFMOS2r4+2iDgsw/spYLbpmRUPy61VXIM4jiwJgHOXNsG/VA9uhaL/6E/+Me8zK0MlKqooT6+rtZnRHmR2aacHZPIvirUweTdAWg0ir4DR/RvVHsd/fjbePHsT9IvRFnP+YP+kFVAAlg6Qy1PuXi6QQQ= 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 1684846286770170.2410150670015; Tue, 23 May 2023 05:51:26 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTW-0007kQ-W4; Tue, 23 May 2023 08:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RTJ-0007aw-Uu for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:38 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005LU-M2 for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:35 -0400 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-3f60e730bf2so3197025e9.1 for ; Tue, 23 May 2023 05:50:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y11-20020adfd08b000000b002fae7408544sm8875672wrh.108.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AC99B1FFC1; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1684846205; x=1687438205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=m2Ay31MkZ89gbFGEDNbljK85TztuW4/742lD0QhZHKfW01CEFVzipl5Ic9Bk2GZJEB 3O+DLIiL4l10b3P5OElsAY7LUtTBvO+BuQ6xM+HvVVV7Nqe+uBTgvkDR1r+Qm1RZ/fiH 7pRyi53M/wm8UOyL8QmBzSdF/o0s3nAxJT7A2822rnPNU/ThPeOgsS/k3xxnZfk1EQ0f NiVttzJJj9PRn50xK/DWBXH/VLs+KeHXjaBucGWpHI1/HsHRm/7qshig/KCUywZmH9CH 8/2l/TDLOgEHWnlQug2zytCcFYugCwY0/K+G5Ud8pjxpna6hpiYoky/zxlRAgMeA65o7 c0vQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846205; x=1687438205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hfEBcaH7nHVbR9/kVEtwz57fQNKQfXGJzuARtAmZ4qk=; b=IIeY9j+4+O5M/DQldE7/XuZqzqU4BaWGVXtteTpOrjFZCRNyO/epd8LZrpBrUyc2Fn SOiYfGQ3VPIfg4U61+Lp2aEj36jjH/0//6Lc/b0EqLo4Js/J1Mp0NXjAhWiJVPdX4Axs f9GtHlrBnuSGRR0OTOthPGQKubQeVlxVs9FeFC8E1wIK+p398k5jldDddh6ZzTzxIm3F 6rk5Gv+Y5D4+jSH+HAlG2MEjC/JQpFpearGC8I7YrbHBxPxmSa10GwhLvdrqx8r0UC+l upZW9n9X5U6cMYr2lD/PmT5LSb0J29KW2qQwxXa5E1/XHl0FyLmKfx3rJe6/Z97E+p0x wWpA== X-Gm-Message-State: AC+VfDwZJHAoj6t63BRv6J/lfuafvEMKGOX3RHgXECvGMbbwRuL+Eylv YjUunoqnJH0q6uSPQ1ajFT3kHA== X-Google-Smtp-Source: ACHHUZ7Nj+w3cMgsojQP5Z7Kt2KMD55dA68Zm5YROk8ajtscJHDy7wX3ZKapxPjljcWZT/6tbvgYuA== X-Received: by 2002:adf:df81:0:b0:306:2f91:302e with SMTP id z1-20020adfdf81000000b003062f91302emr12455082wrl.21.1684846204835; Tue, 23 May 2023 05:50:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Greg Kurz , Michael Roth , Marcel Apfelbaum , Warner Losh , Eduardo Habkost , Markus Armbruster , Christian Schoenebeck , Paolo Bonzini , Richard Henderson , Kyle Evans , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Riku Voipio , Eric Blake , libvir-list@redhat.com, Yanan Wang , =?UTF-8?q?Alex=20Benn=C3=A9e?= Subject: [PATCH v4 06/10] trace: remove code that depends on setting vcpu Date: Tue, 23 May 2023 13:49:56 +0100 Message-Id: <20230523125000.3674739-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846287831100001 Now we no longer have any events that are for vcpus we can start excising the code from the trace control. As the vcpu parameter is encoded as part of QMP we just stub out the has_vcpu/vcpu parameters rather than alter the API. Message-Id: <20230420150009.1675181-7-alex.bennee@linaro.org> Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-7-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-7-alex.bennee@linaro.org> --- trace/control-internal.h | 10 ---- trace/control-vcpu.h | 16 ------ trace/control.h | 48 ----------------- hw/core/cpu-common.c | 2 - stubs/trace-control.c | 13 ----- trace/control-target.c | 108 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++------------------------ trace/trace-hmp-cmds.c | 17 +----- 9 files changed, 19 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..1d07672cb2 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,9 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) { const char *tp_name =3D qdict_get_str(qdict, "name"); bool new_state =3D qdict_get_bool(qdict, "option"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); Error *local_err =3D NULL; =20 - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - - qmp_trace_event_set_state(tp_name, new_state, true, true, has_vcpu, vc= pu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, true, true, false, 0, &l= ocal_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +73,6 @@ void hmp_trace_file(Monitor *mon, const QDict *qdict) void hmp_info_trace_events(Monitor *mon, const QDict *qdict) { const char *name =3D qdict_get_try_str(qdict, "name"); - bool has_vcpu =3D qdict_haskey(qdict, "vcpu"); - int vcpu =3D qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err =3D NULL; @@ -89,12 +80,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qd= ict) if (name =3D=3D NULL) { name =3D "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } =20 - events =3D qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events =3D qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846224; cv=none; d=zohomail.com; s=zohoarc; b=JjZ1mwCDkXe5jrgAu1oajX0uSl1RfdgPoO44byoWoaq2Q0JphBntaVpCDu6BHZMTztAlRjz/Hy+/EJVUIeLGqGT6edaOGDBei89Pv+dvZIvaCk68di61usq3O/GufZfjIWKqKSgMfzE/Hy/OfBl1awC1rZDdcAe6cYOqVMHvCag= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846224; 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=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=Oc/JUd7a1tYvlWkfCvVRmmjeuqfvJ8511H+kKchC8pKjWKqOpLAGJUkNXxEj+epyyNdpfw1gCpoXnuoEGvNYRoxXf8JPH6EIoV/tB+Ufk2pRkepFc6S1gRwTUqYJd6Vbb84mfHwxxRVbAisq519wEwwiQPkJa6Sw8iLD2UASZ8E= 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=fail 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 1684846224327226.40305241819976; Tue, 23 May 2023 05:50:24 -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-161-uwCycPrkNx6rcdXuErMTFA-1; Tue, 23 May 2023 08:50:21 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE39D1859171; Tue, 23 May 2023 12:50:18 +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 B86E7492B0A; Tue, 23 May 2023 12:50:18 +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 2AB8119452D3; Tue, 23 May 2023 12:50:13 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BA34019465BB for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 9C77940D1B60; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 951BC40D1B63 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B1BC85828C for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-512-XzYO6e5rNu65nTSr8Mr_Pg-1; Tue, 23 May 2023 08:50:05 -0400 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-309d3e8777cso2544031f8f.0 for ; Tue, 23 May 2023 05:50:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z16-20020a5d4d10000000b002f6176cc6desm11008898wrt.110.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C8D6C1FFBB; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846223; 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=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=Qkw0zG9/b4I0XAI5A8HqfyuR8+oZRb2uPF0/wFkk7KOcFGGoO/wEvF0eoOV7fX84jxNSJy 7F+dHcjoIr6dujX3tCPmHWzkM+zn4/RcrXNbE4FdIMnLT7QqglRwVGjR/rs166YDoJkETI 3zmvJaPPuA0TO/8eRgulgiS/WQKTBWo= X-MC-Unique: uwCycPrkNx6rcdXuErMTFA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: XzYO6e5rNu65nTSr8Mr_Pg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846204; x=1687438204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=fPw6uONF4nn+KWGc8QbaFgUEMeA+Hmo0apL0Jq98eHeBmh8PqK2e4IXJziN5JEmiJH HEGDuP958SDQH9z6YOniEKRKHM+/j+CFzUaJ2WhUXczsuV6eN83git3hNkjIRQPvps1p U1Z3J2BQMz2uzKw+GYyiqfkvivMie2VeJ9r9qyVibE+yaIOrDpbZCyepYnSFLsLusQ4t uP7rMC9lmUoSgmykeQrI98KqElEMvCk94UZyfPjUtl6qlSGo0mSfnQhHgPDQhokxR3xJ d91s15lFiPioB27cPohnbp0M5RqHlGPlDrImvJB0aAtLlAhpkORJhJlyeUV/93NL1F2M zQ1Q== X-Gm-Message-State: AC+VfDwjl6PMBbgQJ+ZZjYT9lbVIQE83YUTK22JIzHM9GcEsenUm8NK5 169KrSnXyyU8U0ILmMZ/ABm+tQ== X-Google-Smtp-Source: ACHHUZ710PVnIQzWn0bKv4BfhMNSTFs+B2uATZKKtcyifek24dgl4yDvXtWCc8K78t/p/RVDqLcKYQ== X-Received: by 2002:a5d:4585:0:b0:30a:a165:f95 with SMTP id p5-20020a5d4585000000b0030aa1650f95mr1450124wrq.19.1684846204645; Tue, 23 May 2023 05:50:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 07/10] trace: remove control-vcpu.h Date: Tue, 23 May 2023 13:49:57 +0100 Message-Id: <20230523125000.3674739-8-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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 , =?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 Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846225063100003 Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Message-Id: <20230420150009.1675181-8-alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Message-Id: <20230503091756.1453057-8-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-8-alex.bennee@linaro.org> --- trace/control-vcpu.h | 47 ----------------------------------- trace/qmp.c | 2 +- scripts/tracetool/format/h.py | 5 +--- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 trace/control-vcpu.h diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h deleted file mode 100644 index 800fc5a219..0000000000 --- a/trace/control-vcpu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Interface for configuring and controlling the state of tracing events. - * - * Copyright (C) 2011-2016 Llu=C3=ADs Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#ifndef TRACE__CONTROL_VCPU_H -#define TRACE__CONTROL_VCPU_H - -#include "control.h" -#include "event-internal.h" -#include "hw/core/cpu.h" - -/** - * trace_event_get_vcpu_state: - * @vcpu: Target vCPU. - * @id: Event identifier name. - * - * Get the tracing state of an event (both static and dynamic) for the giv= en - * vCPU. - * - * If the event has the disabled property, the check will have no performa= nce - * impact. - */ -#define trace_event_get_vcpu_state(vcpu, id) \ - ((id ##_ENABLED) && \ - trace_event_get_vcpu_state_dynamic_by_vcpu_id( \ - vcpu, _ ## id ## _EVENT.vcpu_id)) - -#include "control-internal.h" - -static inline bool -trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, - uint32_t vcpu_id) -{ - /* it's on fast path, avoid consistency checks (asserts) */ - if (unlikely(trace_events_enabled_count)) { - return test_bit(vcpu_id, vcpu->trace_dstate); - } else { - return false; - } -} - -#endif diff --git a/trace/qmp.c b/trace/qmp.c index aa760f1fc4..3e3971c6a8 100644 --- a/trace/qmp.c +++ b/trace/qmp.c @@ -10,7 +10,7 @@ #include "qemu/osdep.h" #include "qapi/error.h" #include "qapi/qapi-commands-trace.h" -#include "control-vcpu.h" +#include "control.h" =20 =20 static bool check_events(bool ignore_unavailable, bool is_pattern, diff --git a/scripts/tracetool/format/h.py b/scripts/tracetool/format/h.py index 285d7b03a9..ea126b07ea 100644 --- a/scripts/tracetool/format/h.py +++ b/scripts/tracetool/format/h.py @@ -16,10 +16,7 @@ =20 =20 def generate(events, backend, group): - if group =3D=3D "root": - header =3D "trace/control-vcpu.h" - else: - header =3D "trace/control.h" + header =3D "trace/control.h" =20 out('/* This file is autogenerated by tracetool, do not edit. */', '', --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846242; cv=none; d=zohomail.com; s=zohoarc; b=HsRNR1P/tNNkIVGpArc9nfAtP2Ynp73qrDIGu4nkRPDVeAy/mMgeHuIzoSiztlayCnDL+mPWygJyH71VROnl88RSeUZReFa9In5XBaCfOKNX/g+EBfNXpbfnzNnuNzoGEdPHFX5OOFFBgaLxMqW9VI5rTC6D6nDvbjDvx3IHctc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846242; 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=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=i0rKMEuSE8R4F7M2sLoMUIJjEV35Vx3/j4bZsUjRyE3LsNISCM9cQC8mPit2IskQw1OYB+pVY0ieSXbYl+l9EfDsgNSjBQFGAPRFjMJtyndMVnXpMe+LwuV+3Y9JaHinPlKNDS1099OmdR2uzMDW/7SFn80bbLTSdvBhs+OF03Q= 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=fail 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 1684846242370509.0368215077831; Tue, 23 May 2023 05:50:42 -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-534-5wUK0785PeWnRZ-zrLhaHA-1; Tue, 23 May 2023 08:50:37 -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 0E3813C11C72; Tue, 23 May 2023 12:50:35 +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 EC92FC1ED9F; Tue, 23 May 2023 12:50:34 +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 1CB8719451E5; Tue, 23 May 2023 12:50:19 +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 C1CA919452C4 for ; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8F0CF40CFD48; Tue, 23 May 2023 12:50:12 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 879C340CFD47 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4B9618030D6 for ; Tue, 23 May 2023 12:50:07 +0000 (UTC) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-557-nIujsWknPEebzop3VBytYg-1; Tue, 23 May 2023 08:50:05 -0400 Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-307a8386946so4852802f8f.2 for ; Tue, 23 May 2023 05:50:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id b9-20020a5d4b89000000b00304b5b2f5ffsm10972020wrt.53.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id EC4971FFBC; Tue, 23 May 2023 13:50:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846240; 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=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=gR6qes9CxULFkYwuroIF/T/e+Ro7HCqTDqzdtMV2Kltke3MUV6+QykVeV63D8lJlZizfQm HGYYj/v+aNvBI4a1ybOlL1/LMUy5fU1rXQ/c7ipnqq7nnUSDARJJHeFHu2uQMklxlBppQf XpgvZbA8pzwpR51mkAdB18pzCyGxdo0= X-MC-Unique: 5wUK0785PeWnRZ-zrLhaHA-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: nIujsWknPEebzop3VBytYg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846204; x=1687438204; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=k3eU/SQlm0TeK9WhFArCMzxyW+d8gS0NLVhyjx0W8rmeE/PPT6Rdpfg1GrZVTOPrO1 KATo7QE4G9gg9aEAoeK2aRbn3rb5QBCm+lj/yzBncEH6g8d3ikcVPkR1vMIgdcn0zsTu aWsgDK2WMRaqltgmetcORsCqKAvcGvbyBrLa5trrcM84hXim190oZDXJa8cBNlvlAV0O uW9KeLj96OAGgZwa3EBkPupvQtH1FG9/U3xmsHdTKCTexJsjj8OiYLBfDcJoYRZrS/rg KsP8fXu6vrszmfQ+vFcPLqFm2mmf4IZUuLx/hFKj17SmOK0EjaMGu5wUsDJBBdV62c3n 21ng== X-Gm-Message-State: AC+VfDzXSMochIYbhJYEcR4VC+MhkR4WtSKVpAAtOsTh0mvPvlQPrGp3 y5utiTFAw3OhY6oZmj0601kkjQ== X-Google-Smtp-Source: ACHHUZ6jI2GeNd4WFB8+qar8XNhvj2/55kkix99DAIIf/n8YydMU/KUXPY4/llZDA05k/t/eG9mFDQ== X-Received: by 2002:adf:df8e:0:b0:2ef:b19f:b24c with SMTP id z14-20020adfdf8e000000b002efb19fb24cmr9489808wrl.0.1684846204473; Tue, 23 May 2023 05:50:04 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 08/10] tcg: remove the final vestiges of dstate Date: Tue, 23 May 2023 13:49:58 +0100 Message-Id: <20230523125000.3674739-9-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 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: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846244137100001 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: <20230505155336.137393-9-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 6 +++--- include/exec/exec-all.h | 3 --- include/hw/core/cpu.h | 5 ----- accel/tcg/cpu-exec.c | 7 +------ accel/tcg/tb-maint.c | 5 ++--- accel/tcg/translate-all.c | 6 ------ 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 83dc610e4c..1d19c69caa 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -61,10 +61,10 @@ static inline unsigned int tb_jmp_cache_hash_func(targe= t_ulong pc) #endif /* CONFIG_SOFTMMU */ =20 static inline -uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, uint32_t fl= ags, - uint32_t cf_mask, uint32_t trace_vcpu_dstate) +uint32_t tb_hash_func(tb_page_addr_t phys_pc, target_ulong pc, + uint32_t flags, uint32_t cf_mask) { - return qemu_xxhash7(phys_pc, pc, flags, cf_mask, trace_vcpu_dstate); + return qemu_xxhash6(phys_pc, pc, flags, cf_mask); } =20 #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index ecded1f112..3ee76af28b 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -548,9 +548,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 =20 - /* Per-vCPU dynamic tracing state used to generate this TB */ - uint32_t trace_vcpu_dstate; - /* * Above fields used for comparing */ diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index 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 bc0e1c3299..973da2a434 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,7 +175,6 @@ struct tb_desc { tb_page_addr_t page_addr0; uint32_t flags; uint32_t cflags; - uint32_t trace_vcpu_dstate; }; =20 static bool tb_lookup_cmp(const void *p, const void *d) @@ -187,7 +186,6 @@ static bool tb_lookup_cmp(const void *p, const void *d) tb_page_addr0(tb) =3D=3D desc->page_addr0 && tb->cs_base =3D=3D desc->cs_base && tb->flags =3D=3D desc->flags && - tb->trace_vcpu_dstate =3D=3D desc->trace_vcpu_dstate && tb_cflags(tb) =3D=3D desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 =3D tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, desc.cs_base =3D cs_base; desc.flags =3D flags; desc.cflags =3D cflags; - desc.trace_vcpu_dstate =3D *cpu->trace_dstate; desc.pc =3D pc; phys_pc =3D get_page_addr_code(desc.env, pc); if (phys_pc =3D=3D -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } desc.page_addr0 =3D phys_pc; h =3D tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags, *cpu->trace_dstate); + flags, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } =20 @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, jc->array[hash].pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu= , target_ulong pc, tb->pc =3D=3D pc && tb->cs_base =3D=3D cs_base && tb->flags =3D=3D flags && - tb->trace_vcpu_dstate =3D=3D *cpu->trace_dstate && tb_cflags(tb) =3D=3D cflags)) { return tb; } diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index 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 353849ca6d..6958ebecf6 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" =20 -/* Make sure all possible CPU event bits fit in tb->trace_vcpu_dstate */ -QEMU_BUILD_BUG_ON(CPU_TRACE_DSTATE_MAX_EVENTS > - sizeof_field(TranslationBlock, trace_vcpu_dstate) - * BITS_PER_BYTE); - TBContext tb_ctx; =20 /* @@ -352,7 +347,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base =3D cs_base; tb->flags =3D flags; tb->cflags =3D cflags; - tb->trace_vcpu_dstate =3D *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb =3D tb; --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846226; cv=none; d=zohomail.com; s=zohoarc; b=JPq7pimw5hVwn11kZuz4j9FRnCER5SqSqDcJud/v7UMVC8DqRP6SCoVcxox7JzOqfhO03/PTzPwt5o3T/l5erFvjgP1Taxz2brw1D9mtMvkwSWADYd8R7ZelvHShn4HawS5Ye752tAcZqbxvX7GUwDNIrPQV6aMm3X8kArWCmpQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846226; 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=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=QJIOOIUPCqrjEHSewL5zMKvJjpqP7uwgbtcU5ZfyFwgxm1FVQTFGktD+3m0/VvQPK58vrjP6vaJdTMifdySNpjvTL7EoGYSe8KdYg1gZYAjxTHiJgVlWaQoKfmDosUb/36VxKmIzlrfaBAO7YQaeC8OKkJtpxVlLRK04ewOw/lU= 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=fail 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 1684846226425457.38562038393854; Tue, 23 May 2023 05:50:26 -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-141-dldExJELPTSi16lm4Nfe4g-1; Tue, 23 May 2023 08:50:21 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79CF58030CD; Tue, 23 May 2023 12:50:18 +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 644EB140E95D; Tue, 23 May 2023 12:50:18 +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 E05F719465B3; Tue, 23 May 2023 12:50:12 +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 BE82919465A0 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B158E2029F6E; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A941E20296C8 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8D397185A795 for ; Tue, 23 May 2023 12:50:06 +0000 (UTC) Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-274-VjZAolb8PeW8H9gy0aUrJQ-1; Tue, 23 May 2023 08:50:04 -0400 Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-3078a3f3b5fso7298000f8f.0 for ; Tue, 23 May 2023 05:50:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s3-20020a5d4243000000b002cea9d931e6sm10972862wrr.78.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0FACF1FFC2; Tue, 23 May 2023 13:50:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846225; 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=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=irV842Vmn8lJM8zx3X+apEBQ0Sr5eZazQj0gkFFYdpHiTe1o4ubTG5zJ+aJ9hFpXnvMXfn xEA9XBwjvB6jgj1gkiw8JmsVSr8sHS236wlYD5IZcxnc76TM6MbxAbnScBYSaw8HSJaHRu XHNt5Q7Cf+Vd1A0qZhTezU0us4C88cE= X-MC-Unique: dldExJELPTSi16lm4Nfe4g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: VjZAolb8PeW8H9gy0aUrJQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846203; x=1687438203; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=LLBK5BFwPo7WaC33J/6ibsWCLS7DzrhlBnRQzFv5u0Jbuax/rDQJukrkUA8qpe9qLc s1/bRsTxcoHUk1HetnnRN0NwFkffnyEJc98MZ6N5zVxPBJ8wUAyKQPNf7TISm00hoq+G hH9WdoagNksbd93W6LlrttiwSDFaO9tXYPEQbg50AGTUG8GpPJF1Vp5DtS9eyoefM1vY GIwRX/GUvLFdwLFVPpJ5+3WAUXUG3ZRW6qC3yOamHNj3+uEmXTRqcQn9aTunbVYae01B tfnbOE2fkcaO0uYZVDlSYHTnLZZr2SL1GIBqlzy4oFwprxFx3FqeI0dATDo5ptMirQu8 dPAA== X-Gm-Message-State: AC+VfDwKJSw2AXpLlBJXYHvyN4A3BglLkGn3R8+cSPE/qM901PWB69oN DP5REeYsORWtzJyxmy2ryPWi8g== X-Google-Smtp-Source: ACHHUZ4XAznovqbdL4ofYv9FPd+H5uvyDjjJaACFBaiR6IadmiO26F8yjGk+Zlny3Iinj750sF6osA== X-Received: by 2002:a5d:40c2:0:b0:309:839:be3e with SMTP id b2-20020a5d40c2000000b003090839be3emr9870522wrq.33.1684846203793; Tue, 23 May 2023 05:50:03 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 09/10] hw/9pfs: use qemu_xxhash4 Date: Tue, 23 May 2023 13:49:59 +0100 Message-Id: <20230523125000.3674739-10-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846228037100001 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 Message-Id: <20230503091756.1453057-10-alex.bennee@linaro.org> Signed-off-by: Alex Benn=C3=A9e Message-Id: <20230505155336.137393-10-alex.bennee@linaro.org> --- hw/9pfs/9p.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..991645adca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -738,15 +738,14 @@ static VariLenAffix affixForIndex(uint64_t index) return invertAffix(&prefix); /* convert prefix to suffix */ } =20 -/* creative abuse of tb_hash_func7, which is based on xxhash */ static uint32_t qpp_hash(QppEntry e) { - return qemu_xxhash7(e.ino_prefix, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino_prefix, e.dev); } =20 static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } =20 static bool qpd_cmp_func(const void *obj, const void *userp) --=20 2.39.2 From nobody Wed Apr 24 16:53:12 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=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846229; cv=none; d=zohomail.com; s=zohoarc; b=h6/J8Ep/FII59J3RrLp90qOZF1+Dl2izKztAJcv0aa6eVWF7d3oTJ/oEk3EcRABBzDboXR7SQYW8xlrS21Dj8XLvs8UnEGrZi6kPkGkd9xt21iptxsgk4I0CpciSsYdKk3DrYkIFw4ZV05gJs4YL5ujqLOjFNCtfKv8bxqcFbmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846229; 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=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=SZbA5B9ldmOcExXBr2Pv49XW9xcLuJNItyvpe8sWr20Pmz+U0cDNN1uIl/GevZhJgYafo9JdNSjkWICSORgmG0bod1++eriOmq/j94MvvgB8hUprgIDJOevnNqMf9Bw6fJDi42vd5SSLExn/dF4JMXS6TE+KQOXbMcRsH0x1Yb0= 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=fail 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 1684846229946188.47690876912282; Tue, 23 May 2023 05:50:29 -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-634-t6KOaixKPtqq2V6NuPQx2g-1; Tue, 23 May 2023 08:50:23 -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 5955280A0A2; Tue, 23 May 2023 12:50:19 +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 437DA9D73; Tue, 23 May 2023 12:50:19 +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 6CAFF19451C7; Tue, 23 May 2023 12:50:18 +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 3043719465A8 for ; Tue, 23 May 2023 12:50:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0491E9D7A; Tue, 23 May 2023 12:50:09 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F0DE89D73 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D1837185A797 for ; Tue, 23 May 2023 12:50:08 +0000 (UTC) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-TtcaZvm1M7uswK4vcXtJJA-1; Tue, 23 May 2023 08:50:06 -0400 Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-307a8386946so4852821f8f.2 for ; Tue, 23 May 2023 05:50:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id e5-20020a5d4e85000000b003047dc162f7sm10966703wru.67.2023.05.23.05.50.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 May 2023 05:50:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 321C21FFBD; Tue, 23 May 2023 13:50:02 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684846228; 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=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=Q6AeoWn1SG3GhdrXtljAOOFgWY5LeiIEK7AZyxZ7IOeTwOIgBndZXguqrkU5hnvpka/vIC 0YX2xqMVHHC6iBrX6QH9z4mp7RPmRHaDAjrZl0eZLxKGYadJzhfo8jHbGyrfvVHCotYIa2 ZRBziA8SFlKcTdzmavRpBgfo7J1SNSY= X-MC-Unique: t6KOaixKPtqq2V6NuPQx2g-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: TtcaZvm1M7uswK4vcXtJJA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684846205; x=1687438205; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=JPJOMA/VaL4K0Ux6yFV0tsHURDucDm8kS0el3Po53S/kRU3+AipyuyD+fg6Kv7ruhK ZLEOR8xNK4MS4i5D7yW8g0FFwgxd1i9gYBN8L27hE/uIIXbuyYHOIlrb53KRzbLnzZ/1 xO54jK7pi0VBNVBZIYu/dJ4hjbqwvTDrNP07Smd/0IFkG1fjrE6jNT2MHIFklR/rHEqA MWmLkfpnKtoJm8Yefe+rO2pC6GgSgQ/1gqPBGpw8dSZ5c9DtcSnZbcVlmOj0DVjapBN7 kEKxW8wJbrShOcMUOpQOMuUGDS0+aSQ4l9v6Z14VbNq6JIDZmOoUMv2KnfW/ZjBrqt+o oEcQ== X-Gm-Message-State: AC+VfDzEZFmEAm5Pc2Ho9ek6f4UyRL83N5wwPjNAURQV1t4FWMOjjPik r9uw3ag0GuYE9iDfhGC2SveVBA== X-Google-Smtp-Source: ACHHUZ6l5SHA1aAUbFSmXMPr1V8btEduBBjeEJp1+A1V4UrX7l3OUohKmgoaFx/uzMDTpQcqnuI/Qw== X-Received: by 2002:a5d:58e3:0:b0:309:22ba:dcdc with SMTP id f3-20020a5d58e3000000b0030922badcdcmr10746334wrd.42.1684846205732; Tue, 23 May 2023 05:50:05 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v4 10/10] accel/tcg: include cs_base in our hash calculations Date: Tue, 23 May 2023 13:50:00 +0100 Message-Id: <20230523125000.3674739-11-alex.bennee@linaro.org> In-Reply-To: <20230523125000.3674739-1-alex.bennee@linaro.org> References: <20230523125000.3674739-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false 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 , =?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 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: linaro.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684846231395100001 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 --- v4 - use an additional 64 bit argument, shuffle qsp usage --- 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..8a5ad1f1f3 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, e, 0, 0); } =20 static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f) { - return qemu_xxhash7(ab, cd, e, f, 0); + return qemu_xxhash8(ab, cd, e, f, 0); +} + +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 973da2a434..8d67198e56 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -233,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu= , target_ulong pc, } desc.page_addr0 =3D phys_pc; h =3D tb_hash_func(phys_pc, (cflags & CF_PCREL ? 0 : pc), - flags, cflags); + flags, cs_base, cflags); return qht_lookup_custom(&tb_ctx.htable, &desc, h, tb_lookup_cmp); } =20 diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c index bc1961ea55..892eecda2d 100644 --- a/accel/tcg/tb-maint.c +++ b/accel/tcg/tb-maint.c @@ -887,7 +887,7 @@ static void do_tb_phys_invalidate(TranslationBlock *tb,= bool rm_from_page_list) /* remove the TB from the hash list */ phys_pc =3D tb_page_addr0(tb); h =3D tb_hash_func(phys_pc, (orig_cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, orig_cflags); + tb->flags, tb->cs_base, orig_cflags); if (!qht_remove(&tb_ctx.htable, tb, h)) { return; } @@ -968,7 +968,7 @@ TranslationBlock *tb_link_page(TranslationBlock *tb, tb= _page_addr_t phys_pc, =20 /* add in the hash table */ h =3D tb_hash_func(phys_pc, (tb->cflags & CF_PCREL ? 0 : tb->pc), - tb->flags, tb->cflags); + tb->flags, tb->cs_base, tb->cflags); qht_insert(&tb_ctx.htable, tb, h, &existing_tb); =20 /* remove TB from the page(s) if we couldn't insert it */ diff --git a/util/qsp.c b/util/qsp.c index 8562b14a87..2fe3764906 100644 --- a/util/qsp.c +++ b/util/qsp.c @@ -144,7 +144,7 @@ uint32_t do_qsp_callsite_hash(const QSPCallSite *callsi= te, uint64_t ab) uint32_t e =3D callsite->line; uint32_t f =3D callsite->type; =20 - return qemu_xxhash6(ab, cd, e, f); + return qemu_xxhash8(ab, cd, 0, e, f); } =20 static inline --=20 2.39.2