From nobody Sun May 19 13:51:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846306; cv=none; d=zohomail.com; s=zohoarc; b=Hzz0S1UjP/mEerKmJ2928FOurMkZFIQTDgvVn21uq/9bOgdc9W3hx4JX/j1fI/Q+H31oXHmKgFwp/A6MSdofcNAmbmXiFEWYVAZMDhp/wBMN7OgWa4DCQA/L1l9GspTdAeXFnSZMh3Mkb4au0GaLdHkS33tujux3j2UuzUlxaJw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846306; 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=L2Qm+fME8zN0nvn0AiIArv7y/mZQOF6s8mD9Q86aM4miARBzzt+XCn/6rXAodeQbG7GoA6FnXDr58WJ/C6jCehUrAluTrGIMjErYNe5BUVCsL222HRXFIFWahHKjt3faV09pAIQJeywXaBnFpNRFGQGL19v/jDkI6DVnbNMGTA0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 168484630647543.86202616802393; Tue, 23 May 2023 05:51:46 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTG-0007ZK-D8; Tue, 23 May 2023 08:50:34 -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 1q1RTF-0007ZB-Iu for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:33 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-00058i-PA for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:33 -0400 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f6077660c6so13723885e9.0 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=linaro.org; s=google; t=1684846202; x=1687438202; 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=wquG6em70tm69qFH0/HLZzEpZaZNtHpQCT4NEow+nqk=; b=U5hUDlGJ68D8xRrxDFsRzJeAHSjsWlN/UaL3FREBsvaoE2ssQX4NkyAN+y+1d4Qlnv ANmOi55pSOi5+E+BzOFFDaKb6CVTkT4GNIpkgoekfHJXlWZ4nx7ZnTQX7UzsVL6LfOEt WZbVeYmQ0xcSkjKdXDu5/XyCVGFQlAmOg8hexnXkVq4h8dElVOIBDZ88ig3aTRlULDSK ZtdQ9uuFQkPE+NBaqBz2LvhT0GflGWMsW9p37SImQLXEErVx2FEkDSW90pp+f1ZiTP4b dbJOjHhjOAiqOvaMG8aEViDZpN45m7O4OVu8gJjE9uy8DOGbPtt2CMznmRrbFLSevQ7l JAJg== 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=PDD7hoSpQLmazLmoATvL3Bxuyj2fBNwjuO4+I+I/EY9SXNH1VBiEQoGBz4pFyV8Asf 73ihoINe9yZMbjd5CD+Yb1E5D+w785ec75PxwWGg5Qb3MHuNZxJ19dcpY+oR6OdFtUfS Mb+bwSPfB8QwN0gS3iH4z4Tmw/s7EA/gWI1IjARiFiPqXYa51AtFzz7VNOGjSkEZcYOd yxSm/3BSa4VJxbwEU69DOtUQxI4YosTRvY9w3HWDKcq3VnHYSmgaO8+u5waN4CFnzjo+ 6cZoXJ4N6zlpv/7gcHN+tH6aVZmN315bI/cHSc3pkEkL+8ewMlmbMFQlzTwhTPwSJsGX 05aQ== X-Gm-Message-State: AC+VfDzDRPwsniQjfhCiW+WJ0xV2v7wA0UqWQGQDDuVZdxhzmbXZkFIf 7vP2n+YSAH/BBgRFiNAJff13AhFA51/GnGQtH8YOJA== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846307817100002 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 Sun May 19 13:51:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846316; cv=none; d=zohomail.com; s=zohoarc; b=PpGTQo08nmxq9htwhCoAihooQWOFBx/G46h8sWerND2UfcCiNQ8ZYm5YM0HMgMf3+4G1oS4LH3cHlQ7YITtMY7pNHmm2YkZLU3K8fHTcGYSPfpfhJGn3qmNap1pAT0Q/JBSP3OuqWBqI9lfmAaok0ay+B2s3KMIeQaqguTtqnQE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846316; 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=AfiyynafYqH9rg1P253f3pqUcgqyyJboT0uy3KG4mPVe5m814lxmeRFqMRKoUbsTskiJTT99BXvdytmTWSe6+BQtHRKK2xL0gluUZkJqJasZQ+E++sCWWdY0K/kjEVKgwpLC2Vfdma6WwoJeCmTGa25lVEq3K2SAXMfh7TiPZhM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846316973951.3669127356353; Tue, 23 May 2023 05:51:56 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTL-0007dv-50; Tue, 23 May 2023 08:50:39 -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-0007at-TN for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:38 -0400 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-00059e-Pa for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:35 -0400 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3f608074b50so16432015e9.0 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 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=linaro.org; s=google; t=1684846202; x=1687438202; 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=JqWNsbArYu1VYA7jPglcF2LkuoAj2XAQgpWQZ9CCyOA=; b=w47vTED2VaVJyJNYqiWWQ4Q7YIKGBblmcpZx2SgGoPuaNXsRcMewQlkNFveWFIp2lN Oi7S+H2PesqDcvStuVV7VxCQm1FIt1lrfynWb24MT3u08MlR2WNxZHXA/m1HmDHbCOMM sey0EZszOdAZwZd28DFKc3ELvZPEm+NyUbtH59uA6MizbTUU2naeFl/FSRjrloA8DLxW 9UQ+cWMwOFUEessSfM8AJmqAVAVY2wslBFH5Me/6x0QLTdUm099GM39+uq44doGkFcoQ tYbT4epI76TxeIFB0O+P/cUPo9O/27w36E4F/b86DafeiiuUpyac40/2lbNgXKGbkPy8 bF1g== 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=R/bgO/QTt3rAC2IXfDZ2PsAQL8WVA6ZNonUQv9+ASr3F6sbqiNUo5u3o7/Jttz62B6 /86iKnPd/moalhOrW3ZeqqQU1P8XTTBm+1FH+M2IlJuzvYoUxmyL+Z0RxAIw+VgbbO5W sc8yjHnlmFTOPm4mG2vHGpxuqmKbBfWQ6GFRFV/1EeuAc8trtI76czOQPqTZi1kBjYDI LT5//v8Q5TklqOGiNLpmexIiHw1KaA11z1YYUkAP/W0fQtK9cn4KnpBpzXu800HNXnCE Wpt9lJcb/47Iu/28RTvGajjLme/QrqRl/Ar0hEU8im/f9JRFsOQXeII9NymaQNN4UCLS mOig== X-Gm-Message-State: AC+VfDy29JIl1wX4IGzYSOWMtkc7zxZniIHbrfP3F/BNQVtxKcFvH97z NXxpnKlRs34d/r8FmfCvthLTgA== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846317825100001 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 Sun May 19 13:51:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846360; cv=none; d=zohomail.com; s=zohoarc; b=cdTJv2bIoVMH/ZQ//YqnmnZ10+j3OqgdirhLbT20Xe1fKvcoPafRDrgasCL4Jep3b8vsmwaifEzkHnAQ2zgvNDwASimk4OppsTFRrfpuq5q+TqRkUqcZrRK+qiPL0Tt5YKG6/9D23w7an3w8t6m+pZEli/dSlLAxPCzJWqjQKOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846360; 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=NzsIp772dRtVMkHBXGiAoXS3y6w6BMo/CZUtdAH5t31/DTCWEG9hEpFiLANj2n8aafTo+Jhe9EQxs+pMnHFivoioOmxcUYgNy8EV8ZeFR48aQ0Z0w9U4orPhap690e4BnHog1KHUQElnbHkYo1BetCLvxDpUG147FaVvRWknv8U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846360455546.0964615568795; Tue, 23 May 2023 05:52:40 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTK-0007as-43; Tue, 23 May 2023 08:50:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RTH-0007Zw-F6 for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:35 -0400 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005E5-PN for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:34 -0400 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-307d20548adso4725652f8f.0 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=linaro.org; s=google; t=1684846202; x=1687438202; 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=HZeDeOs74kMpCl0WPu+Un7MjTxZvQ9FLsLjn90uKHOo=; b=hJMLN2pPeF2qDpkHu4OJ/82/cFb0I27siniqKzPkJvB37mhnmcErqFEAnAwJJyaFTq JUNp2ilUjuriYKWHtbSONhLVMOhdVqJiH9gjrtlqDZY4VV/nI4zRH4L9ElDjAqRio1Yd gVZiJKvLMoMgtYzrkPpJYPU7XCvkKQnmuFvD/Hh8YQDwY9zZ3N83rsKwNc27+9cNDEVj 4jdACUigKeOzITlb9PUHTVsmkuZ2SI9XD86uUpCXhsi8Ku/TNC/frus3hHTMXnwLGOtP iqS/ZV3kOUBSCyDKJH9MgMebMgCwTR+fztvgVFaJgXdLX0IhxDKYLYx1spv3gcZ2tRqD 56aw== 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=RA0SMrDrH638k+kbTdU3aUAmqGDssE/AsQASV4h2dvTn889KqwlXEYZ/6L7k9ohSEB bPgMu40/ZwO0xw1c0fHmV89SR8XjhD81rVfVg7bGE6Bo5a3ILKgl1KUt2qRdFUzLb9dN 2rIeX2QFHP7z5bdHDCMPEOhuomfO6WIPNulELD7kkFbwPD/goU6FvJ41x08RA1sySlj+ MlvtAGIez2hDq/ZPEIgXcMtDynT7GxQ9uf+lcOgz/AdCWTY6pu2fchE1hq95aYJZAhvU U2HmPPpKkl3248SuePNDbVSUWk55gYfeeKovA6tsR3++qQxEKKteK2Q/byh3eZ502kpz 41BA== X-Gm-Message-State: AC+VfDxKJJtgrBGeNsbzOoRDXb8VPkkA+Xb+Rj3PzOQuCZtaoA3UPtvX egrTh9uGQbR8B+ECpFcWcbOhZA== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846361021100001 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 Sun May 19 13:51:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846302; cv=none; d=zohomail.com; s=zohoarc; b=FVStL+s2EGxMrQIC5L4sFTMgY3YuiE/XmAPKjxG3ajeWSt4y+4QonPuXQNKyhUw8ryaeUl6C0oBPRe7jbZPwIx+u7aR9Heqbmper8YqWFvQ8gZH7X3wgukcrpmeRWslacBm1BfbVL8GINQRYFcObsd6TUISbw/i9YN2RvKkF8ow= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846302; 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=Hb0vRaX/v+2A1yURqCTpwjE8up3Er2tJanzaVM5MAnMWdFSY5nrbLBAcJAG95EVS+7Hv6F6+26P8RO80eKLVLuH1hKIa8a9V+zp69gwGAeU4Aj9uCurXJCKpI1VRew0i/TtpTQz0v9s6a27j/k4VMCNwPeVdmUTQtV20VMhj3t8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846302442591.8523720068243; Tue, 23 May 2023 05:51:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTL-0007e7-Vu; Tue, 23 May 2023 08:50:40 -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-0007au-Uu for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:38 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RTA-0005Hw-RB for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:36 -0400 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-3078d1c8828so7066315f8f.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 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=linaro.org; s=google; t=1684846203; x=1687438203; 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=00n5aVndIwSHvOX6LssWty7GpzeSEYjdv0l8Fp9wGrU=; b=dbLOXqQ8igxdE1saSzV5UX9w8GscLnkydyd4eiwJ+sq8YgejDwaINj9JS/pMX78Ivs 3D+zcjE0pidQ9z7QjF4X3Y4S5CmYj1bqBNi8XrEc3sha1Qzop8XIMuNTowOvT2BfoIwd jNzfJvTOK2Cobs949x/054z2rVMjaIM74bmQcl2NGiMPnwjKKcF92Shqgf+gWpPlYxwG POlfJ1v7zToofyp2xzu8pySQLkV/hH6g4xrmHOUWmWTtuBp+Zi2jTRwSAFB5M4kttfxp 1+L/8ieAqNY5Ci7hpsF+Bx0Ihh9hMKtnViTqBR2Y3XWRBwuXT7OqnDd47noE0jc2W9pe LaBw== 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=Fzpb0u6kzHlNxb0xrbbztiOM4bKulE507BId+EDDHio5aMDiVog4jJgMeQJIEdqGuf f0HUlCO9R+Juz54CC7KeQAAmmJqFG6LwBWiUqtALKmrCrjLaI0Ss4cz0Fc6UIiEIE0Z7 qXaAG39mH4ul9IKuVqt8DW96twveHc8FG5P7SPczMDGCZmLTVPfo0nozhmrMMEJ63mr8 fbQugSlDh67sn3nXBRTDUSrgJVmftzCKwpNe7GU7Y1kn0HvaIpQuGMSogg9Zlh8wUb9i 1JuxyTp7sB7Hp22+8DAT0oNL1bi7R2IH3ENoCKG2PMwbG1s28Or+MfHrD/NQDSbaXtEO X0Ow== X-Gm-Message-State: AC+VfDxlW/Apj1/JmDle/Iy0AdXpG2/PKjf1V5aSb+GsI49ugj1tFvZA eTkRcYSyyVnhjLgVbxk1JANdqA== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846303823100001 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 Sun May 19 13:51:28 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846296; cv=none; d=zohomail.com; s=zohoarc; b=Q8I6IHjz/gHPiP8V8apMwkE4Sb6NminFLfchcrlGxb+rquT5xKE86bjfVSxODeY7WhgY7NauOSF38Fr1b1vA6U9gqbNIIWA2QtFKzPPXS6Q8+miH7FbmTccLvVdRatZnay5w7Y68au188rpjS7Onk+LNHXXxOWtcJ4YBR12/4Ik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846296; 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=I5iheejJBYC3g4WzzhcboTKnntglDrhqc5fXUHbEL6RqRGa09FzlovxhKsGvwCjTog7Xlqe9mm9N6lGkb9oKu/CvTsy9Fa8OeeDxSeYY6h9DW8Ig9AOkNr56ZNtKxZsWw4sYYB+GEU1GLb2OIkSS5EG6x4Tskgjbt/7WOuaOl2Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846296129753.5982667462351; Tue, 23 May 2023 05:51:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTI-0007aR-CH; Tue, 23 May 2023 08:50:36 -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 1q1RTH-0007Zv-FH for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:35 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005JK-Oo for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:34 -0400 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-3090d3e9c92so7279430f8f.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 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=linaro.org; s=google; t=1684846203; x=1687438203; 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=HT3f4xlRu6XVFJkMQtmY/b219drXYZCMSK1yobPtGSc=; b=VEnn+TtFjS209pYt4om9ePQA+TTPEwY4kDZixKmPGWC/m1um9m3ikj0tna3TrhrPlA EmpjlCAyPkCd/7crq8lF/SJ/YAkqUKFetDx65Hi4tcpiigU1Kq9harm1uwed4ZS9SrV8 jIomNhXveCUdj1Ap7NdlZEjLDWxVldvGMNCqppDP5ZUdKzt9LBKuKG4UY39fdMp66RK8 /JOx9Mqist8SWWpuSF76L2n29sOmcpw3GU6Ht81Aq+uwMDU2VYSVuzCxcLeVvAUh/JLI LXM9TFFzRHfK+6TpfXG5YOJ6akkKC6VHOamOvooCjRPuVBySzYDtvhGOzgiwTf66dIFL Qe6A== 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=I389/sBtTNYdFRBdmvGRC+aPd6YiAp8EskzmEKh5dU+ks5SlLTJSQr1z0aA3MY4BqI ZotLuPtAHaBv2280DYB9JqCifDsGPvgrz+0Cu7qU5z3K9TMlDMX4x3POH5U8rrzfAUmH 6v3vzNNIi2bAn5SroEArZzQDKfcQGch5mVj0Reza/DK16awsHgksNE0b+35fNlMnHYQv 2A75QyYCGsAoarcH7Dalk5lhf3xWYuYEK2nDHYD+I31hRA/1QJ/RdTg7C280xB+xtdK8 KaX4Tn4v31iIc0HemVuUKTJEMqN75uzEul563tLCkXqtBQrBnysTHKa2NlXWjwmbk6zX owcQ== X-Gm-Message-State: AC+VfDyA2HK2x2MdRjw0jhMry24yt9mYuN9iLhamnVZLYeOH2NcPncdp GOIQq62i0ovJ+QGNAOMUkKddKw== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846297901100003 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> Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- 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 Sun May 19 13:51:29 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846286; cv=none; d=zohomail.com; s=zohoarc; b=OEEKcOh2jFj402Vi6iO/VUQP479/nAB2lMPTjXk63HEMJEkC/igoXDtSK5KjqE8tgo+kwTM9b3kXbIoyuPOa+qAA2wtQUZnh3u29rgmNJmEpHwEclsm6VocucPr1+aSPwVtB+tJvQaLYNBfk5yl2ZEOuxyjOOVe+IW9vDF2hWWs= 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=k5fi+PCBPrLr1Epi+kC9pkRJBhiX9qdTOyGrri+0r9qYov9RDcHBuvGJqnsCcZwG6IfcBAwQ6rRe66rDfaoN6onjWOeI7K/AGiU2QAdzQ+TYbMJW4JnbSj7Ylgb0Kv+Ju14zKEtRCuPrUr0xfmy6XNrRbHoVgLA7XlQPW0cy0zI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846286893413.5186931559207; 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+importer2=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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846288341100003 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 Sun May 19 13:51:29 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846319; cv=none; d=zohomail.com; s=zohoarc; b=Digla98nafC6VyMA0WJzzmEoMpA5afLZvo8SMfqQnyxUKVMAkJe7CL4Pjk8XF3J3Bp9czvNx/dPYDFYgAAZMdV4pWm6MJMcmf19/rjO9SuRNjApuVJIQrvqXKeo/IjmmUq8ZNa4VNc+BumQQddP3/yeEBL80O/r1dNsaPt8Q5ik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846319; 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=nSQbDCupp16Fh06hx6jjEdBJDX0Q6DN2VG5BywB41ELXJsaERuMRZfaLfprW18B4McLL8OmeqVbbkLV/1PVTJH+PPV0q4gaJXivHNTGkZG51Fw4tYJGHZw99UBekHf0VaDNraIUQpZXmbZexFgV0K/gnUl4ppfVzU48D79TecF4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846319607390.4192479733658; Tue, 23 May 2023 05:51:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTQ-0007hn-U6; Tue, 23 May 2023 08:50:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q1RTJ-0007ax-V0 for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:38 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005LK-P6 for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:36 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-309d3e8777cso2544030f8f.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=linaro.org; s=google; t=1684846204; x=1687438204; 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=K01VdPgPYNekowAJXeG2Q1UEkTaMboRdvQpIKYeYNGo=; b=BvVvpGYUHIhKyhaoahKO8dY/q9m04n9ZLTMDQabZX/cHAeOStO+OLvCsQF64+aKN2L 55UVHv9gwmG135gVmPHwc32YaFKzC8pgk/w4PU627gRcNjE+9DJjekwKE+WvFt6395K9 gNl6jtoxOBGXNH0k80bty7ACRokZdluMxl4ydPCy98BbzjSXg5kaIk+arPeskrQ34ACv Ctx3AS1Kt6puc1KIvOCWJSXI0btOPxjbYI9+hG9vD2o8ihdXNIhF9HtX6jyLA0z6c+tC sUirQ7WDgwcIFGh99Iw3o6moFU3A/qN0/sZGVD+utIdSKun+BGYwzlb37nR9aG174QSZ 1v+Q== 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=b9TbbPkPZsmtKDgkEUBZs056GFl6W4lzDOFaPotUfAL0qxk6nQGIKhVrgREMhbMN52 CKoe5PRZ0e2WVgz+9ryCt0rl1BnMreGkkye2+sQh1yV+WNmaVdmb0hrLCzjM9e8BxIsh wxMbZfb3NG7kAX76E6bqa0tR+lc4LI2qBkBkR3n+5BQxZlWY/4CDmZxI3qycA0XrKuYP hjvAvrPtycBTlPZWi4AvReRuSREx+SLeaRpNiZVn0kN2nw917XywH28f32z73k5vR375 8dWZy2y8Wlp2Z7cYk0ebx+zjsMklm0x50tlsiJT43w1OnHHEJcLPkG/pn4Va+rIZwkjS jw7Q== X-Gm-Message-State: AC+VfDyBddOvuyUearhKq136BTx6oTdO5qqUOqJ2unMolP0+p+B1xNLS nWRXQ86oa+NLyMHLeTLFumFa8A== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846320552100001 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 Sun May 19 13:51:29 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846296; cv=none; d=zohomail.com; s=zohoarc; b=GIm+dZCmjokKsxIQrpu6VSwnu86fp8vzgDlQNdk/H7+tAQx056hLNc1dWqsRzckdkcqYyJJLhsT2FHdUrkYLKX3HyNfcoK3lEyRGu8DtxPqO+su7tid1m3CvMKDSlQSnjh/QvpfjMnb78Z+jOnRfPjOl1W/f/tP0aHqhk0TRo7g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846296; 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=Ad9FaDr8QptVdoonZAQGXutDk0oc0nWC06nAaP6nJJhB7JHgmIgyoC3fhRqijctuJFrCE8EE0mVUvg49SaDIPwYU76uQZ6QMl1w5V0/M5DCljCSf6fH3BGeH3PZ7VdeOBoMdrC/r92YoL2y6cPIsCv+ehJjhHZEwpcsuVYHgQO0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846296194474.289624517585; Tue, 23 May 2023 05:51:36 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTL-0007e8-Vp; Tue, 23 May 2023 08:50:40 -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-0007b0-VH for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:38 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005LH-PL for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:36 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-30aa45f4b6cso116083f8f.3 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=linaro.org; s=google; t=1684846204; x=1687438204; 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=BxB/Jk3rz9uYn22zcwIqwe/KU52z/KOUdf0z+HqWPgI=; b=yO+c4UJT7G1DWEJPqtqwrXPdaWP6QoNhCDnKZSzKdwIedp/DzBmNWNIZ6IvdArs/N1 bSH6Rb7EVuhdei1bny3yu2velmuNEjp0T1Mcnw1WIzWmL3HB2+m0KWCNORctAHyLmG9O z62RaAuiWqMjixsFmowU/rPZ/+NUKyNHbYu7ax5/0tCUwZoMpWkD0xFjKlomgMpFD6Ck Ynt2SMGjkdU4RlEotWqToCETR17IUKuXE5CRtBDWYCzdzT9OMOekGT6jjvgxDG5SYlq4 eNO+BLCx5dFz3R99Vt7luFmmxtgqVqRQpI1ydkAvcPFmyv1JKOWGxFuFDCyvafAf4bHk b9Sg== 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=MICNMKko3E4gFa1RqLHpaqYrWMDwXA4ycwFvdYd/8/1j/qPO9LUcFTapF40LmwIj/q 50DcnWWD6Fr6EJlhmUVtxNBVD8g+TdTvQpWxD939tTfzEyQNT0TeUMSfO8523IZeRpz4 ZiuntQbq69BIRNihvM2JVuxooLJqYTIHYMMz6mJ3+tiG4zp0b7xIAdOGFQuSEoVZHiRw rkmAQPxah4d3aCYikGaE2GDvE+PQeWAabvkK4PivsDYhXgtzgmA6tpxbCbKERUXJ6PYD BWbH9F4o1FV8K7I1VJlj793yf73Xbc/WWszpwhF8amLjVfLhylWBUNe58OEMxGTvRml4 0P0Q== X-Gm-Message-State: AC+VfDyZYFqNnT10+rtekmhNOCPY6NYwznvYh3Aq4i173VvvEe2YBdZq mimg8BvksZuAtWVKej6NqsBTRw== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846297926100004 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 Sun May 19 13:51:29 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846262; cv=none; d=zohomail.com; s=zohoarc; b=avYe/QtiziEkwwh3m7CKi7s5787GGgtOkL5TJIpTHsxr+syFrrFXlVzyR68P0yssBOjs6H19Xv2MOUbNQZ/UkhzHZtrFFkLVfwGmjfrjYMlC8eRU9tFHAzKuOUIcLsA3vDz7rXIAwXt4bRgFyYcC0sZ/ceinqrp4PxNQktn9WFc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846262; 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=E/nql5HmqQGKVxpSHmlLQ0tvfab8NAdKR83L2GXTh1hJ9S5etVZQ3dW0OXriYJ+hDEO5sJg2+SeqwvGDyfHlRWubwXkA9XAdx+dUDRNxSHZ79miu4aUFRkM3io97igA5AKiCMKoxt4yWGqEQh2OXUnwVxNalo/fGShF53peSMMw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846262062825.4351515683975; Tue, 23 May 2023 05:51:02 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTJ-0007aW-Gf; Tue, 23 May 2023 08:50:37 -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 1q1RTH-0007Zu-Dw for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:35 -0400 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT4-0005Js-Gf for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:34 -0400 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3093a6311dcso7291396f8f.1 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 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=linaro.org; s=google; t=1684846203; x=1687438203; 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=O6c49RYzHWdVq3P3yg8J3+/TKBPogcBQppAeDcgAsBA=; b=Qz3tdzyoS9ILyQlJtfPKfKH/yxDz5t4bp3sPiRWtHlM/yevCT1Z1ZSF/LcnIo+BGjK Vat6061KSGbQbG3JQhjJjne7lE9iSlZtetSUBYdMICJTW22ZugQxiNCTFTnhZIK02Z7y bD3HGiaL5TZBUbifpaB+dacZQncVVoE73g8Y5qtC6MpGf3d+5DZRFYTLKcw+qP5j/tt2 IjttZlSguuVBULlJ1/480YdX4hKnjIypCVqwc0ylpGdLIBdXsVDXX45IYWxjAyefuAHO Tz2uqdRlbqPVYTAKCkyqcPBSXe5I20kvvIaLhQJ5Q9Xr/BfYTizbfCIH9fLaXDv6s89d 54MA== 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=Cg23NBzIoQJhu3Ltlzd6nR5ydFsKu/y+vU0+vaRyP7a+xYUjv7/We/tKZQU31nTxQY zhxmB9TZCjTf/MTBGHn9SLlwb26640s1Jnmi1RCz55m8flnOXDYOIsKnjQr6glWaNjCi ap9qEc3UD4qYLQhPW7Z3ARFJG8NAN/nhPd5hjQ08RggFad8Zye/KUg+Mw84INQ9E4wNw WmBlkvUf1niMEJHjxE8lCXdRgRcaQfXmj6cNrZQb0Scqsyy61JHpYnAIGkTJuOdoWINm /mF7LZHFdALOdXnQVn86AigDWkfGvarUjE661biiyk8dW/LdboqiNYPRtPNq2QR9DREJ bijw== X-Gm-Message-State: AC+VfDwgosU6/fxFqwqVTR0KmG9yaDdofHnQCzR3TD07v2du9xUqx00P eBRvOw0NTkHrg7O/CgAEZfkUVg== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846263631100003 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 Sun May 19 13:51:29 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1684846267; cv=none; d=zohomail.com; s=zohoarc; b=jN5uJ6YIOBoxmcoc8z/vqxoIdglzDQyuDke3tPebP7gl+jEq2239lWUaU0+F7gI8LTxGK0P4N1+P1U80DMuz10bqhdZnGIu1KYBlLjZ7AJ3RcfthsgMhqc8mAmsV2JsPv5VtpgC9MOYTwOBWUUQjaSlnOFikboRPNunfTYp+RcU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684846267; 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=lQ5JvVzKO27SFkXcwd+ZTgnQesto44zwk8lt+ARDdKbAAXgs4udw85hvmG/zscplJhLysgo9m5cLsYaKV70TkMZhwjwNxWyWoEzNxf9PYqYfJ9QpYQ87ywZevP6QbHuHsrsYvk3cEn3ovPZEbDdhQU2R+yLzpNG1xFoC7oV4EWs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684846267485272.05214525189433; Tue, 23 May 2023 05:51:07 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1RTH-0007Zf-3e; Tue, 23 May 2023 08:50:35 -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 1q1RTE-0007Z3-Va for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:33 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q1RT9-0005Lu-Ow for qemu-devel@nongnu.org; Tue, 23 May 2023 08:50:31 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-307d58b3efbso4856981f8f.0 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=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=m4ka5Szv0DTbXfL92FfwWOXkHpQ6TgzA/lOFc8Q4SWI=; b=JznBAUlDfm9x4yov70Xj8MQ0YKNweOFCAVxuqyYaZ9K1YzJEAT2dVg5bJBI2vE120G tYks6QhrtyAOvysw+j+t3TIh6bvX7l43oI13K1FAA5bdesFrKy3PhlkWOPp2kOv9Cc3e /UwAH5gDvn/uamZkpJs5BP2tSEiQFevv1VitMBqLtcDtIcprpXExIDnhOGaWwtL24hDo 3KX0uBS9mRvZhXPSmF3x5+gKBeN3uZRsGl0WyfonELY0d1kQEtrxDEUrUtcbUAMnk6TK z4R3Jlucf2kFbYIy93Xuml4rHdvtV6QphAYHCKvLwwiI/cjx8eaNCF8NoeyTC7X3hEtP amXQ== 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=GanMfz0kdSjP538X3sopshTu6f7umkHIon1iMRu1rpMoPlRhqpvJ7M6A5LKZTE11SX G/nJFV1wc58NaVB35R04fHYbxuYCQgOOVSU8qjuqgcp499+5iMQR8SRTEp750//FgVh4 ajGDg7MCzOJ2d9vnv9cKoL6rnLeOR96vlLYFdg9wS9JYI6no+ZhWe46t8RTslNw8elaH j5kvSi0S/+zX8/5ZPg5TnE1oN4QRY20c1en4DKLuegDIH+j7abKzE0uh54YsoYo80wtE KmFRfa6oziLXXPCPZyNZKG13euAF+dabFUWd5enHhkPeyG2e7Bu+CqUF0U4hJL1K+a6N uSsg== X-Gm-Message-State: AC+VfDwgd/SeG+Ek/AWcYzky+FfLDiHJab4Vs+QV678aQPQC4ueEHwu6 rtxnZv2pzpWPAtMWXJjQJvEkVQ== 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 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 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> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1684846268549100003 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