From patchwork Fri May 26 16:53:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685925 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025195wrt; Fri, 26 May 2023 09:54:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5lnFoXaTSRzx6xQ4iwzd6E8o5KzwhOl5gtxBjObpKGvySbc3tAs1alUMgrPBrBJdu5oNjO X-Received: by 2002:ac8:5989:0:b0:3f6:bf18:3d82 with SMTP id e9-20020ac85989000000b003f6bf183d82mr2104831qte.15.1685120061360; Fri, 26 May 2023 09:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120061; cv=none; d=google.com; s=arc-20160816; b=1BDMUoIuN0RGg29nZSCHegiD9XYabtWvqlkkWoCZAXaRZ5aP8tRcTiVZneZF9OgJZi hQytnditLtVpZKuzGDE5H06qwF9joR/BNxHdVxds+RZk7TrvFGuO8CAyJQPdGre+DXyU cCSKdxlV7njfBTtk3O/ot8oZdW/ktbB4mT7BYBpFto8WQ3m4ETHayTSnhFWC6tnQfH+d v25Y/D37J+NWKAxtOIQYPNtV4V6t9bXSLb8jU6LICX4XLgybHJA0lsOcvNjhtWYfv0fI tLqMgjTHsKbbqs5FQ0FCjn5G6AyXzXzJbjlsn24fw1OqEmfERigwRTKgaMW2LuLsbdF6 mFhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=kkNeOrwP9h/c6xGOUEsjMdiY0pbjxJt5I/i1imPp0+FxM6NGpS5CK92VQXJ5sjp0N+ 2xVvU7zUYHxQGxvaLtgbqPwvSGOdd8j3/xOtOjkiKaDoo5HYPKJRDSeXzJSMitTIWtPC nEX7FprJ4rYwI7oEEbtnsByz80WQ7yzTFIwiIrmEfBBNsEx8k5rcvxHjO+zPJ9snFHhX 6vRtVQ6jrIyRfdp8cXsbuk4dAb04ZI8Mbln3b09U3Vixug7/M/vgObpF7pUcPcUirH4q iXgkYOu0PrpvT3UqUsR4WX44rjl8OZsJO8nfOVA3pZlRIh+J9PuxCkDAQqX4hGFYQnEi S1MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PdT59P+i; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id e21-20020ac84e55000000b003ef4198357csi1545617qtw.744.2023.05.26.09.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PdT59P+i; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120061; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=PdT59P+ikIAgil2RKklRJ7M4AWZUf8dZ/sUUrULrhk8paopRpC/FiFNvElUTHIjvGpHN9k 8gqI2PEQ4qV7euBiDVUev9USUU0cd375rDdpdqN8U+EZNwW2vo61Ljyqy61quzZcSrEvkq loxL2zyJyGszd1NqYarrR0zpTlUunZ0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-265-KjtVD1IENW6HePKZKYf71w-1; Fri, 26 May 2023 12:54:13 -0400 X-MC-Unique: KjtVD1IENW6HePKZKYf71w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 54BED800141; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E528C154D3; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 04D1A19465B2; Fri, 26 May 2023 16:54:09 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 700891946A41 for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 63023492B0B; Fri, 26 May 2023 16:54:07 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BD25492B0A for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 415EA800B2A for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-L6OAzHrvOOO8pC0JZtuo9A-1; Fri, 26 May 2023 12:54:04 -0400 X-MC-Unique: L6OAzHrvOOO8pC0JZtuo9A-1 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f6e1394060so7036675e9.3 for ; Fri, 26 May 2023 09:54:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120043; x=1687712043; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0JSph40thfd9YqqHizrdfQZmv5A6L4soqJWF31SYGqc=; b=Y8YPbiRw2zZRbce9MedwAHT/P+1jxW0Bz45UwhyKCdronmrYdHbhK43aMdkiXDlVQs TFwXkTJ9QDpsOM0cTU9+3hLiRvFs2YGUChClSpeV6fMvW2lTYKrUHbU6x86wkBMlaCkR 7po143i6UHQ2yDySU4u9ZI6EeBRUNft4CvvkXTGezFnUEBWcoqXL+VqYy8PUlrlwsyn9 UPSWsa+FQdJ3fE6O19bB7d38P61NOXrDhFybkAmR66hh+oSCb68YKzQCyz7AvNg/ECCX DOu6MXYk/wCaXe+VtNVtpBGgWSy2X8lSCkd1TYF2kzt0iGkDyfqvO9VhZrxv2maAgoay NHWw== X-Gm-Message-State: AC+VfDyN4UHR3AeVzbPQnPlYMgGBIV2fbloJsNcYlDMKxBjPsatun6wS 4gcKr3UDMGBZE3hgBtl/axIgUQ== X-Received: by 2002:a1c:4c0f:0:b0:3f6:13f5:d1ea with SMTP id z15-20020a1c4c0f000000b003f613f5d1eamr1715999wmf.11.1685120043138; Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v24-20020a1cf718000000b003f60b328417sm5780501wmh.17.2023.05.26.09.54.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:02 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 396C21FFBC; Fri, 26 May 2023 17:54:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 01/11] *-user: remove the guest_user_syscall tracepoints Date: Fri, 26 May 2023 17:53:51 +0100 Message-Id: <20230526165401.574474-2-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This is pure duplication now. Both bsd-user and linux-user have builtin strace support and we can also track syscalls via the plugins system. Reviewed-by: Warner Losh Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-2-alex.bennee@linaro.org> --- include/user/syscall-trace.h | 4 ---- bsd-user/freebsd/os-syscall.c | 2 -- trace-events | 19 ------------------- 3 files changed, 25 deletions(-) diff --git a/include/user/syscall-trace.h b/include/user/syscall-trace.h index 90bda7631c..557f881a79 100644 --- a/include/user/syscall-trace.h +++ b/include/user/syscall-trace.h @@ -26,9 +26,6 @@ static inline void record_syscall_start(void *cpu, int num, 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 num, 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); } 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 = env_cpu(cpu_env); abi_long ret; - 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); 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) -# 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=0x%016"PRIx64" arg1=0x%016"PRIx64" arg2=0x%016"PRIx64" arg3=0x%016"PRIx64" arg4=0x%016"PRIx64" arg5=0x%016"PRIx64" arg6=0x%016"PRIx64" arg7=0x%016"PRIx64" arg8=0x%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=0x%016"PRIx64" ret=0x%016"PRIx64 From patchwork Fri May 26 16:53:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685930 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025240wrt; Fri, 26 May 2023 09:54:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5D5WpNXOp52uhXMLSS9xxNXs54at+udDwSlBh80UFy5WDB9uVp+uf3cISZ7sgiewBRgkki X-Received: by 2002:a17:907:7e87:b0:971:484:6392 with SMTP id qb7-20020a1709077e8700b0097104846392mr2602566ejc.38.1685120066593; Fri, 26 May 2023 09:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120066; cv=none; d=google.com; s=arc-20160816; b=koc6ugR1KCRJeEvQUITahoBrCjdOzX1D3fLuEXH1q2x0u3z+yIW29lD58nEnn0OXqr CDuuR8XGfRSzxtO4DJ9TPGm70rZIiIsFMmEmQD2wYsv/IJ+KjNOY3YkzLcaR0m+hYbT0 hfMJQ4vj9HJIk4s0aCe28jNFCyWHirIFyGrPm8OuNeKNtaOwUmRH3xLthaHMmNZPvY9n BLjM2n7xv9rH2vR8B+9dmltvxTUtc6LYlo3u4jSu9lpVTbXnAtV8vtgMeYHP3MPJcuJ5 hJiHiDs7a5CyVr8D0taYJdrtKMPMIk/2W7/EMnzeOL/ntIOqzKA/bhh19ImlrvFGjM6V E3Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=s2HfGMhz/e8ZbNGOUnZOTvJcdFEx25eZFrk99ccd679pDHWcXay0kCJ4Rc5o/13WSl SmYQnRTqxqSO5dMmwexp1TUt1sIagZMmnyaZZWDVmLjvalzeuFU3TIDqKTX+6FdLetQp vRPfEsVEPc1me3SxGFXG5UjLuWUY/RdjZipTEegrel7I+VdMvHfxX52XetSFzvYzpOsK 6ndk6Pp6FHfB3eyBf0YRByeiyHd8y05b+go8gygzqMEOk6V7wvHRPtw1mV9oyEeLZhU4 /XsqSg7cyMoU/o0otj0p6voyJ4ztFnwtWhGncPj29FSeebDeVcrFl/UY9TMu8Ntp19NW vo/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXuvkXtY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id pg6-20020a170907204600b0095727b08140si1594216ejb.239.2023.05.26.09.54.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gXuvkXtY; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120065; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=gXuvkXtYoDDCZSNJsvSH7TGoiLd+cqgiFbAQDk3GXpf3xJXH7vObrv6NUIBvvaDoN6beLM S4iHjNarIgkKiGMr0IfPROK94u6la7Wfk1pnxdjfkF2X7fYo+MqbtfqTbWR7IU19GN+nYG 1AniT90l8+TpjGie1/UCNJMMSNmLcWM= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-652-COH-vik6OVm4KGKCaRywXg-1; Fri, 26 May 2023 12:54:18 -0400 X-MC-Unique: COH-vik6OVm4KGKCaRywXg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5B5731C08DBA; Fri, 26 May 2023 16:54:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44BFD140E963; Fri, 26 May 2023 16:54:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D891619465B3; Fri, 26 May 2023 16:54:11 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1B85519465BC for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 0F29B40CFD46; Fri, 26 May 2023 16:54:09 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0747B40CFD45 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DF797811E98 for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-UmXzGBcAPvqk0Qx_ATFz6A-1; Fri, 26 May 2023 12:54:05 -0400 X-MC-Unique: UmXzGBcAPvqk0Qx_ATFz6A-1 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f6da07feb2so10944945e9.0 for ; Fri, 26 May 2023 09:54:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GWrBsFMGiSuanAAhdh6yQ0xzGyZ5a0S2x2yI+CVJb+k=; b=TDDH9L+HuDSQ+VDFqjomUb4jtxcsMwq/PnkiksDQHJpv8bGvxlIQMhZw3+vyAgKflD 1iZ6lC984ORhgzHdRs/Lg5oB2QeDRPpAH35hm3V/HOHon5bGGymnnTNHqp+wxKI7irp3 5YQtYMgoNDI07JIifmp4ZhyPKcVUnKSITo8kgVtl+hQlGk6vFMJyQj2TcTcqnKIqAAfo vPmQvrnYr2DJSNvSVJsX59qCOeXRYTdZ6IdDS2Qs7rgTmJyWdiXsNRFVBcQZhhHJS+Qr /k1cecR+qK/RfVZQHVDKKCmiZDyI18KJHoF19130Fi3g9uH/tcQpLzmQmW0WDWcs8ENp 2z9g== X-Gm-Message-State: AC+VfDyailcj7e1422CUlRTQxyRZa0UGOKLqUjbIYtD/Xdd1ksAh5GZ1 jnbLMCU2LZneF8qEKu7mQTb5RQ== X-Received: by 2002:a05:600c:2308:b0:3f6:1377:8b15 with SMTP id 8-20020a05600c230800b003f613778b15mr1986965wmo.21.1685120043969; Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id a18-20020a05600c225200b003f60a446fe5sm5783211wmm.29.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8A09F1FFBD; Fri, 26 May 2023 17:54:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 02/11] trace-events: remove the remaining vcpu trace events Date: Fri, 26 May 2023 17:53:52 +0100 Message-Id: <20230526165401.574474-3-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org While these are all in helper functions being designated vcpu events complicates the removal of the dynamic vcpu state code. TCG plugins allow you to instrument vcpu_[init|exit|idle]. We rename cpu_reset and make it a normal trace point. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-3-alex.bennee@linaro.org> --- hw/core/cpu-common.c | 4 ++-- trace/control-target.c | 1 - trace/control.c | 2 -- hw/core/trace-events | 3 +++ trace-events | 31 ------------------------------- 5 files changed, 5 insertions(+), 36 deletions(-) diff --git a/hw/core/cpu-common.c b/hw/core/cpu-common.c index 5ccc3837b6..951477a7fd 100644 --- a/hw/core/cpu-common.c +++ b/hw/core/cpu-common.c @@ -32,7 +32,7 @@ #include "sysemu/tcg.h" #include "hw/boards.h" #include "hw/qdev-properties.h" -#include "trace/trace-root.h" +#include "trace.h" #include "qemu/plugin.h" CPUState *cpu_by_arch_id(int64_t id) @@ -113,7 +113,7 @@ void cpu_reset(CPUState *cpu) { device_cold_reset(DEVICE(cpu)); - trace_guest_cpu_reset(cpu); + trace_cpu_reset(cpu->cpu_index); } 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; - trace_guest_cpu_exit(vcpu); - trace_event_iter_init_all(&iter); while ((ev = trace_event_iter_next(&iter)) != 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='%s', val=%"PRIu64"Hz cb=%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) - From patchwork Fri May 26 16:53:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685922 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025149wrt; Fri, 26 May 2023 09:54:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4KsL4BbDtP0pOPpZdkGXIyxXokWM0fqJHf5AA2O/ehOF8c9VHPFj0Qzdvgl+68qW8p3ooc X-Received: by 2002:a05:6214:e4c:b0:626:cbe:3c6d with SMTP id o12-20020a0562140e4c00b006260cbe3c6dmr1394920qvc.22.1685120056375; Fri, 26 May 2023 09:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120056; cv=none; d=google.com; s=arc-20160816; b=pqtzQGSXeqZLAzc+ZvmCfhXpvtFM/j07EAqOP8TFpT8UTPDmkBmZ+ZD8C/+XoNG1ye K4U6Xc887XOGKqvpLIPD3jVX3K2AI/9XSUBc0y+syeDFFYdxSO0FQNb6EQHVLOsatnI9 JpP6nsGxU8XP9SofVEHEn7e03oci1XVERJgNTX49vL0XAwZKibiXM9fes1nPu1bQqoyH THOj/KYTyVJwjYldCe0BlOl8Ohf1n/jdKL+wH5Z3p+7/CaouBbs9NflTJOJ4F2kaaieI 6W0I98fAltKhc8zTiWJUgHVflMUxicGp3Lvwixg8Gqre/KpOKMyeZzRs+wIk3wZLaF3S ts9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=ABkojwpARYlVR1qLoHqO7rvYhy8YrF4Dfh1hHVJXXgU+1qD4qPZDApZoai2PxQTtoJ 5UNmMx7uDOAhAF8sh2iRNGgUMCdzHZFyfGSCvKvlzILQaL9OY0+9C8n9yS7jDAXZQJMy /lqAyyIb3xBDpml5yj/9M3Oa6XJWh8bqZcFJ70i+wcDRAHj3WlT40po8piMAXkdI9NFc aGYlks+m9eHlW5qo77+MMKugVz0JKVIgSJMjcDpsFAH++XmL31SCbmi/is07q4jxkvGJ JEEIwssZj6JRHRJpIxXD4QmZ0M9SQd7x4HbJit27hnhE352//LZmthsY+p7+Q82AeCuq xrVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fvBw9WCH; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id f11-20020a0562141d2b00b005e8828d61c5si1574002qvd.517.2023.05.26.09.54.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fvBw9WCH; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120055; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=fvBw9WCHkxueTOXMX4Whyx/n2WCHiqyjcA4QUjhF1B7QkD4IhUkUqosXLB/mdi4lY8TYa5 RUxwxLhaUQv1SCEIPMzKZ7IZCcDUvkpgmg0gBy6E0I8oyIaUBmGQaNSZr83ClEIvDd3BGU AP8CDy4xmLlfhK0s9iyyGoIMrbZToek= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-303-fwLtZAKtMlSNeFEtVqzBcA-1; Fri, 26 May 2023 12:54:12 -0400 X-MC-Unique: fwLtZAKtMlSNeFEtVqzBcA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A90E63C1411C; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94BC140CFD45; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 461F21946A46; Fri, 26 May 2023 16:54:09 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BBF2B1946A41 for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id ABF9AC154D3; Fri, 26 May 2023 16:54:07 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A3B5FC154D1 for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 67EE3101A53B for ; Fri, 26 May 2023 16:54:07 +0000 (UTC) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-98-9subThkpN9Ofa4AxXTy3rQ-1; Fri, 26 May 2023 12:54:05 -0400 X-MC-Unique: 9subThkpN9Ofa4AxXTy3rQ-1 Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-30addbb1b14so294844f8f.2 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qF6P+UabTb5zcsOWvNlJLYRb6FGcez1HPmoDCjERVyo=; b=hRVZS9nKrZdJ+lT2LoyUJYkO1eTd8UamuguL1BQSAGW5ou350w3qQi5jL6Ffoj2GrM D4RwMmqb5DdMHy6Yzv/fkc4uYzLHh88+PTnRoYpUyCR+L5b9DutFyxHAGT8dMNGhl4ch Y5EeGfeb0+g8ENsaydyBzAAlul2Ip6lIUPBbUIjEhcPZ18drvM8Jlq7Z0m9Verumc0O9 PigZcIhxN9uR5GXI4iwNo2GCEqx0Ll37O5+KwLSeCxcr0eF0y+3pQVgvVVcIiM/8l2Sx +NrrdEvzJI38nVy/U2/B0PHNy+RIWfis7qfIIAdndUGLPyehcvOl59IsXG7/iRcrMpkJ 1iSw== X-Gm-Message-State: AC+VfDy4QmYfh59KDJw9WSyL3pMnq8uA4M2NrfGtl4kERusYeP3yt8vs kFoh4DyXLFCzO7mu8zpuTT2IeQ== X-Received: by 2002:a5d:630c:0:b0:30a:d7a7:3db4 with SMTP id i12-20020a5d630c000000b0030ad7a73db4mr1595931wru.12.1685120044311; Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id o8-20020adfcf08000000b00306c5900c10sm5709524wrj.9.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 0ED491FFBB; Fri, 26 May 2023 17:54:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 03/11] trace: remove vcpu_id from the TraceEvent structure Date: Fri, 26 May 2023 17:53:53 +0100 Message-Id: <20230526165401.574474-4-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This does involve temporarily stubbing out some helper functions before we excise the rest of the code. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-4-alex.bennee@linaro.org> --- trace/control-internal.h | 4 ++-- trace/event-internal.h | 2 -- trace/control.c | 10 ---------- scripts/tracetool/format/c.py | 6 ------ scripts/tracetool/format/h.py | 11 +---------- 5 files changed, 3 insertions(+), 30 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 8b2b50a7cf..0178121720 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -27,12 +27,12 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) static inline uint32_t trace_event_get_vcpu_id(TraceEvent *ev) { - return ev->vcpu_id; + return 0; } static inline bool trace_event_is_vcpu(TraceEvent *ev) { - return ev->vcpu_id != TRACE_VCPU_EVENT_NONE; + return false; } 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 = 0; events[i] != NULL; i++) { events[i]->id = next_id++; - if (events[i]->vcpu_id == TRACE_VCPU_EVENT_NONE) { - continue; - } - - if (likely(next_vcpu_id < CPU_TRACE_DSTATE_MAX_EVENTS)) { - events[i]->vcpu_id = next_vcpu_id++; - } else { - warn_report("too many vcpu trace events; dropping '%s'", - events[i]->name); - } } event_groups = g_renew(TraceEventGroup, event_groups, nevent_groups + 1); event_groups[nevent_groups].events = 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)) for e in events: - if "vcpu" in e.properties: - vcpu_id = 0 - else: - vcpu_id = "TRACE_VCPU_EVENT_NONE" out('TraceEvent %(event)s = {', ' .id = 0,', - ' .vcpu_id = %(vcpu_id)s,', ' .name = \"%(name)s\",', ' .sstate = %(sstate)s,', ' .dstate = &%(dstate)s ', '};', event = e.api(e.QEMU_EVENT), - vcpu_id = vcpu_id, name = e.name, sstate = "TRACE_%s_ENABLED" % e.name.upper(), dstate = 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): out('}') - # tracer wrapper with checks (per-vCPU tracing) - if "vcpu" in e.properties: - trace_cpu = next(iter(e.args))[1] - cond = "trace_event_get_vcpu_state(%(cpu)s,"\ - " TRACE_%(id)s)"\ - % dict( - cpu=trace_cpu, - id=e.name.upper()) - else: - cond = "true" + cond = "true" out('', 'static inline void %(api)s(%(args)s)', From patchwork Fri May 26 16:53:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685931 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025303wrt; Fri, 26 May 2023 09:54:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zy3ShxnbL6OxpHvSP3XbpgQ+Rnujbzccnk1aNyVsxhZWMJqTiAyHulE7/+DT3lR7LHLR2 X-Received: by 2002:ad4:5be2:0:b0:5e9:752:766b with SMTP id k2-20020ad45be2000000b005e90752766bmr2085535qvc.47.1685120073875; Fri, 26 May 2023 09:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120073; cv=none; d=google.com; s=arc-20160816; b=Baf2sElYVpsQzX+1v6psu8V1zp9EfkVlfxMzWCmLrzbot5fxPQEA/TU9oF+fDB9oR4 Fo5sCkbCt0Kpu4XtU6Qr941PgEJwd7M0cK9wUg5xTwzGti8IhFo8P6RaXLpU+qs9Fxlu I+j8qvPs3vrfxSFdHs1Z08ljFQU8TvkIUAevJ3ODJc9PlR5kxlfFkdEPkMNib28TDSVE yNtvoRB4JvJ2YTC3FCZpwHM7yPZjl8UrfXvO1erd+GU7VWrqreMNW8bHwS5IpOXraDia BqRZO5a+30RYl0NUs7ZMf+82EpEEhbeIRZo/ok2pPY5ruJsnc4E2NiOYQsLCdtC0gMR7 eM1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=MpjehxOWZKGAOPa0JGF/EUr1/0ejckNI+EEFa+Rs9pPRi9OmI5vEPYnNWocyzJ2ztm 4DipCvcWDBt5VfJUx3KW/nnn1hpOPGWLFhpz/2tS56VFMo6J35lhLiaRxCeuxR81+zmg ObLHbZzn32Tqbhe10IOlkvXLcGSIS62EI2QlnsmNJjVF1tpo99opcLssgsApc4IVgTj9 PFkxdhyZWS4DRf8dZJxA1UkViM9JB1MCtCfgKHYJXFLoJyuLkzklpO+EeHwEIacL44ut UkFJJzN5MOnZm0EriIwVtPd3yeh1rCuuOzjQ+wMW04kuoujtw+/6zqBfKB6tVJyGFU38 7czg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXVSnS05; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id gy13-20020a056214242d00b0061656d6cb4esi1550521qvb.344.2023.05.26.09.54.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:33 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXVSnS05; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120073; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=SXVSnS05UL3yht4VRCpz//BYxG1HRbCg+OmPxNH6/PuqBDWa7CClHkSk7r+xwPCi7Eea0J xfZnE3j81nXX94+kGw4OnDdb6xSxKtHiYSIatpXHjduai062TfMTlVLZFS6jrQuv9sAX+h bHIdUQb7S4mxeRnqAr7iqxXp5CNUd3U= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-38-h1usxL8zNDK794Ir3d-m_g-1; Fri, 26 May 2023 12:54:26 -0400 X-MC-Unique: h1usxL8zNDK794Ir3d-m_g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DF633C17C62; Fri, 26 May 2023 16:54:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BF2D40CFD45; Fri, 26 May 2023 16:54:24 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2811919465A4; Fri, 26 May 2023 16:54:24 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 10FBE19465A8 for ; Fri, 26 May 2023 16:54:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F293A9D7A; Fri, 26 May 2023 16:54:22 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB0239E60 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F0E71C08DC1 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-340-nRc5NZfWOEi7X999n5bNXA-1; Fri, 26 May 2023 12:54:05 -0400 X-MC-Unique: nRc5NZfWOEi7X999n5bNXA-1 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-30adb83aa69so487490f8f.2 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=R+Hk2GHoWhOtQlcGA7c+0wlOYrHt+A4cuvfTPDhPVBd7E4kWCwnADpDBpgY+6SpEYE fRIYM//c7Bwzibi1fO3QgbIuJrNRuNiptuh1boijt3fBbdeQqhDkpPzZnxtL/AvsnmEK wW2VZ0vY0nrir8NX8Iul/SfiFfNgFewDVOz+5dmTtmAMRDpPaPh3oioeadjKyXsOcZbm pVFSu8Cre3Nm1zounW/hXqR0MRBHnoeTi6IJ6Vk4deuWWGVLIyvm2RZWgKHPh98bEziP X3UfPOlgWLkB2myVopYyCYh//Kg8vWUFLi1ejYtTHqCcj1E4mkaBeBOs1BCvhGFU2N1Y huQA== X-Gm-Message-State: AC+VfDzHOzsw2xSLHGffAGocRkTW8DclcJgbGwLSJT3Pm1NwJINghcgj GGK6ZAbEQj1Ehv9G5881NawESA== X-Received: by 2002:a5d:4cc2:0:b0:306:36e7:db27 with SMTP id c2-20020a5d4cc2000000b0030636e7db27mr1909674wrt.16.1685120044687; Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z11-20020adff1cb000000b003093a412310sm5657661wro.92.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F2A91FFBC; Fri, 26 May 2023 17:54:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 04/11] scripts/qapi: document the tool that generated the file Date: Fri, 26 May 2023 17:53:54 +0100 Message-Id: <20230526165401.574474-5-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-5-alex.bennee@linaro.org> --- v6 - use Markus' suggestion for prettier wrapping lines - drop un-needed str() --- scripts/qapi/gen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..70bc576a10 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,6 +13,7 @@ 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): def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by %(tool)s DO NOT MODIFY */ /* %(blurb)s @@ -174,6 +175,7 @@ def _top(self) -> str: */ ''', + tool=os.path.basename(sys.argv[0]), blurb=self._blurb, copyright=self._copyright) def _bottom(self) -> str: @@ -195,7 +197,10 @@ def _bottom(self) -> str: class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n' + return (super()._top() + + '# AUTOMATICALLY GENERATED by ' + + os.path.basename(sys.argv[0]) + + ', DO NOT MODIFY\n\n') @contextmanager From patchwork Fri May 26 16:53:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685932 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025495wrt; Fri, 26 May 2023 09:55:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5sXw2ijHTw3ASrpmLZWYhaPeUwRd+lZlxkgY0O559WIJJq0nnuTPBrP0ldxDN9WThLNZl1 X-Received: by 2002:a05:622a:1047:b0:3f6:b95e:f700 with SMTP id f7-20020a05622a104700b003f6b95ef700mr2519262qte.57.1685120105551; Fri, 26 May 2023 09:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120105; cv=none; d=google.com; s=arc-20160816; b=SkDsDrpdU3k3qoQKMYlpJ9EgfZ1p8L6sFi6bEj4m3Nj3/sfDoKe/ONgv/Tl+QoLJU6 p12xbm55FVAVaoqtqwTmvn0dbQwO3EK9JpeuRVjB4PQP7hxE7hbhO2maWmI9arPJHKVX a8em1CK+pZporcJZEhX8dOB0q08eheEQ/E8Pwid+qp5bbNmMHLbhSQvu7rRad1xA3S2y cgdaCLdTY/UWEa+k67UPYzRcM5rcQ60sV3AuwyImaQ/Q45zsS+I9V8yQ+oh8xIxJaUIY LwxaQnBeIiMGhBGjO5bkOAJ25SIq8neQ9OseHstorQU8Xb27ULNp06XY2eJlXwOlJ72G ao0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=qen8PJ7HX6+kqHdXrzEfuAuZpsPqEbZpMZbxo+QkaQMueQVl5DOv2xkDKSwl/t7wnD JUUKbesn+qNfIl8VVi0Ii7BIDO7JwhPaFAdOXg+J53O22hcV+npRRmMHgKqE2W7E3PaI v/lMNKrukjZBXsMFURn8dcqWTdizqS9eaLkCm8ISlKI3HzfocLLqaO0ODDXoD3Jj9Y2e n6gwvgpCYDSU588rrXbi0v/iogShO6+Ij1iugmECD/FrDf8NoNdkvk2Xq92qtdYAJgZH jkTPRAm8H1vDgkSEC/1BA4DQ2tsMx9xORomNb4VJa4DCK4MImCUATkUeD32u2RTlt2+N 7Pkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBiuvaGz; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id r6-20020a05622a034600b003f4de457b80si1525457qtw.317.2023.05.26.09.55.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=EBiuvaGz; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120105; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=EBiuvaGzLRXyXK4Xbp3EQrt642XMv/iLlA/bxiLHRNz+247EVL6pm1SPu6l93b+vWv50Sm Jka+98QeLhcXAAQEUzCCkGIKIFazSpEdEzvIPf2J86NkOHtFxn1O7ka+TgTXlYq5/2745D sM1AwC2SrGmKNmaNyDJ9z4Gi9D80178= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-8F3URt9sMoCNUG-GW58u4A-1; Fri, 26 May 2023 12:54:12 -0400 X-MC-Unique: 8F3URt9sMoCNUG-GW58u4A-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0F585382C97C; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9E6FC154D1; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 67B3B19452C3; Fri, 26 May 2023 16:54:09 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E1B3419465A0 for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id D435B400E117; Fri, 26 May 2023 16:54:08 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC89F40C6CCF for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A85DB811E94 for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-194-U9RwAl8SN4eHcA7u3c4n2Q-1; Fri, 26 May 2023 12:54:06 -0400 X-MC-Unique: U9RwAl8SN4eHcA7u3c4n2Q-1 Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-30a1fdde3d6so937255f8f.0 for ; Fri, 26 May 2023 09:54:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120045; x=1687712045; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NY+/D6uwmW9rrz2yvSXdT57IZ1FuZiPWd8jiwfrxi4Q=; b=Cgov7jNQLxZuU0bT7pTkUPOuGnmnjaEDAdwHKu3cb95e00CTsIJm1JexBHEL7bpd3+ m8HCe5pKzu8FLFK1k1cuo2o4h5zRudWDf1ExOfZrLsg0nYv8jGdATKCOuZsd7NM79kDr mMbsR9atCKM7UbzTiqoATdmpwoZoeEToguH0DPtSg9Dc0IOHuL90cDlMscn1YM55paaj ES0FGehPn4ebJxRG8A6ksmbwuOy+pygv1a1maN0WNuTpumK3bLXinB1XfAoCY1hxuUuS 0pCBn+YNTxkQygyf3II5jkCgGmbzTOyOkTibLFphIBk07O4cE0O7dkXDrI/p1yXOb9V3 DoQA== X-Gm-Message-State: AC+VfDw0s7YAfSR0aUflJJY7UzteacB9gXW1Q+7Faph0mO6lvhcKQF9M OJrtpq9DdAPssR2Wla29J7fUUA== X-Received: by 2002:adf:e644:0:b0:309:3a83:cf43 with SMTP id b4-20020adfe644000000b003093a83cf43mr1898839wrn.27.1685120045507; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id s17-20020a5d69d1000000b00304adbeeabbsm5692586wrw.99.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 852B41FFBE; Fri, 26 May 2023 17:54:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 05/11] docs/deprecated: move QMP events bellow QMP command section Date: Fri, 26 May 2023 17:53:55 +0100 Message-Id: <20230526165401.574474-6-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Also rename the section to make the fact this is part of the management protocol even clearer. Suggested-by: Markus Armbruster Signed-off-by: Alex Bennée Reviewed-by: Eric Blake --- docs/about/deprecated.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index e934e0a13a..7c45a64363 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -218,6 +218,15 @@ instruction per translated block" mode (which can be set on the command line or via the HMP, but not via QMP). The information remains available via the HMP 'info jit' command. +QEMU Machine Protocol (QMP) events +---------------------------------- + +``MEM_UNPLUG_ERROR`` (since 6.2) +'''''''''''''''''''''''''''''''''''''''''''''''''''''''' + +Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. + + Human Monitor Protocol (HMP) commands ------------------------------------- @@ -251,15 +260,6 @@ it. Since all recent x86 hardware from the past >10 years is capable of the 64-bit x86 extensions, a corresponding 64-bit OS should be used instead. -QEMU API (QAPI) events ----------------------- - -``MEM_UNPLUG_ERROR`` (since 6.2) -'''''''''''''''''''''''''''''''''''''''''''''''''''''''' - -Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. - - System emulator machines ------------------------ From patchwork Fri May 26 16:53:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685928 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025213wrt; Fri, 26 May 2023 09:54:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4N5ma858tBZsLhB6pOYbDfDT99m6JjMzJMr1GmpXiaa07G4lFhXwwqz4malo07u7JWbGsJ X-Received: by 2002:a05:6214:400e:b0:616:859a:471a with SMTP id kd14-20020a056214400e00b00616859a471amr4807511qvb.17.1685120062736; Fri, 26 May 2023 09:54:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120062; cv=none; d=google.com; s=arc-20160816; b=pRQZ1gv7pzLRvU7oK1ju2ON5qGRG5D1pZH7Qa0CGHTLz6SzbORa9T8A1Uk4b7Dlu0l /vsZkSlqg0htskClslwfiPVljCY4i8MPvWNsJN8xo2/5VkV55GcvpNQ7BkjpntbThm5S sf8TAWY+KdBN5GOjishoOCdlKc8jYSXZ9R3HPg65wdiD/SwWIGU4RndZ/0OpwakTa3Z/ cYx+jqeRcS0hFic/JjH4zylcFkfgLeyJO7fqj0SecUJA4vRXcZbOYIvk22RZsVn6bnBD Mp1SfY5TIfggb9eeMciym/Mz9MJB+SglTyY9gn2Q9G2Ah9V3qSIoZAQMBUyDcDPlhndm 9EJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=xesPWKy3hAzj693VVOZ7ZoHI1hOm3EI36x+jcSpwPViaAigymx9bZrWrhzd4Qm/y+h 18yul6AKs1Q//byqiNqDlo7mrAww1tDyYSQKRoexv6Wo7rbK3/blFZ4ey7RzJTG8xCe5 +AMowPQAd/b17dXEtXaTjGccmNXUiEsSmB7LHIoR6iItt7UgQUW7Y48E1g0ifDsKmfvP BNFKGkuw/j774VfNPYQtWCs/DqouowNBTP98KWSMswazTQn1baOjuC9Lu1Sj+TrOYprf Hx6yxLoQYzU6JmG2aNGxa55eLUOVzUfxOci+Eh77zOkcxLQ1SxROGfU22h9P0PGjdqjj H57A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dfQgn282; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id jv6-20020a05621429e600b005ef8c578589si1548501qvb.297.2023.05.26.09.54.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:22 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dfQgn282; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120062; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=dfQgn2822UOOk6TkdShQnyTYpoFUeFNz2KzSTFjs0EKwC2fwzTiSIqVf0659BZGdIS6H9M UKods/w+a4apyUMeyKd/j5kcRi/65uVKww9lP4JFAYtGihArlgDyTZDaQNWcvps5PXK9zu 4Wq9WfNT2rNOnfdiBiKsYdTicxf2U1c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-94-yn-mVDWeMziCCAsbKky0BA-1; Fri, 26 May 2023 12:54:17 -0400 X-MC-Unique: yn-mVDWeMziCCAsbKky0BA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B5811185A7A7; Fri, 26 May 2023 16:54:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A20BD492B0A; Fri, 26 May 2023 16:54:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 93A2B19465A4; Fri, 26 May 2023 16:54:11 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 15E3A19465B7 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E9858492B0B; Fri, 26 May 2023 16:54:08 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1985492B0A for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C6E7B101A52C for ; Fri, 26 May 2023 16:54:08 +0000 (UTC) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-_aoNqsATPhCF-5Xo8zaOyw-1; Fri, 26 May 2023 12:54:07 -0400 X-MC-Unique: _aoNqsATPhCF-5Xo8zaOyw-1 Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-30959c0dfd6so868657f8f.3 for ; Fri, 26 May 2023 09:54:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120046; x=1687712046; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hQ4C0OH2eXL3stB8nBityndanYvrzr6EMyO8JmAb43Q=; b=IqhmlyXs5iZn+qJn+cy6kn86wuPz/DiB42zv0tChNnN4Bq/jh3ymYuY/ianOIRVgLu F3cnKxk0JIeXkfaC2bXrVZPPWo4q+g2dkoF1qt5Za2pVK7ZQeGoPI39LDd3vX9DJYOdr Ddok0ZNrR1mC3sy0ovUOukuvJbqyRkRi17NC/vgoZD77bqzH9Sb3BkO8X3XYW4TfM45g cciIo7Isc3xuNAIaYeU5okqAU6ahlI8uY6Zkeyh+BNj+s13G5ZsOLf0FWaSKxLeViozi I3KHg6hYjljzkzIQCH4NkbPKE3q9ncpepIPS8QBkVWCTVfQZqVG0nTA6MkF4IGN7+Bh1 HM/w== X-Gm-Message-State: AC+VfDxCtCvr6Vd9jGrFQhoI6to16YwO/YQ+a8qqnk50mj/DFqTtay2D FD42M3z2PI0mNeu7gDpD4sxz1w== X-Received: by 2002:adf:f604:0:b0:30a:9043:8f1d with SMTP id t4-20020adff604000000b0030a90438f1dmr1570311wrp.5.1685120045787; Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id g14-20020a5d540e000000b00307a86a4bcesm5659872wrv.35.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C8C651FFBF; Fri, 26 May 2023 17:54:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 06/11] qapi: make the vcpu parameters deprecated for 8.1 Date: Fri, 26 May 2023 17:53:56 +0100 Message-Id: <20230526165401.574474-7-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org I don't think I can remove the parameters directly but certainly mark them as deprecated. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-6-alex.bennee@linaro.org> --- v6 - s/QAPI/QMP/ - /and always false./and always ignored./ --- docs/about/deprecated.rst | 7 +++++++ qapi/trace.json | 40 +++++++++++++++++---------------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index 7c45a64363..0743459862 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -226,6 +226,13 @@ QEMU Machine Protocol (QMP) events Use the more generic event ``DEVICE_UNPLUG_GUEST_ERROR`` instead. +``vcpu`` trace events (since 8.1) +''''''''''''''''''''''''''''''''' + +The ability to instrument QEMU helper functions with vCPU-aware trace +points was removed in 7.0. However QMP still exposed the vcpu +parameter. This argument has now been deprecated and the remaining +remaining trace points that used it are selected just by name. Human Monitor Protocol (HMP) commands ------------------------------------- diff --git a/qapi/trace.json b/qapi/trace.json index 6bf0af0946..39b752fc88 100644 --- a/qapi/trace.json +++ b/qapi/trace.json @@ -37,13 +37,14 @@ # # @vcpu: Whether this is a per-vCPU event (since 2.7). # -# An event is per-vCPU if it has the "vcpu" property in the -# "trace-events" files. +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # # Since: 2.2 ## { 'struct': 'TraceEventInfo', - 'data': {'name': 'str', 'state': 'TraceEventState', 'vcpu': 'bool'} } + 'data': {'name': 'str', 'state': 'TraceEventState', + 'vcpu': { 'type': 'bool', 'features': ['deprecated'] } } } ## # @trace-event-get-state: @@ -52,19 +53,15 @@ # # @name: Event name pattern (case-sensitive glob). # -# @vcpu: The vCPU to query (any by default; since 2.7). +# @vcpu: The vCPU to query (since 2.7). # -# Returns: a list of @TraceEventInfo for the matching events -# -# An event is returned if: +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Returns: a list of @TraceEventInfo for the matching events # -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, returning their state on the specified vCPU. Special case: -# if @name is an exact match, @vcpu is given and the event does not -# have the "vcpu" property, an error is returned. +# An event is returned if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -75,7 +72,8 @@ # <- { "return": [ { "name": "qemu_memalign", "state": "disabled", "vcpu": false } ] } ## { 'command': 'trace-event-get-state', - 'data': {'name': 'str', '*vcpu': 'int'}, + 'data': {'name': 'str', + '*vcpu': {'type': 'int', 'features': ['deprecated'] } }, 'returns': ['TraceEventInfo'] } ## @@ -91,15 +89,11 @@ # # @vcpu: The vCPU to act upon (all by default; since 2.7). # -# An event's state is modified if: -# -# - its name matches the @name pattern, and -# - if @vcpu is given, the event has the "vcpu" property. +# Features: +# @deprecated: Member @vcpu is deprecated, and always ignored. # -# Therefore, if @vcpu is given, the operation will only match per-vCPU -# events, setting their state on the specified vCPU. Special case: if -# @name is an exact match, @vcpu is given and the event does not have -# the "vcpu" property, an error is returned. +# An event is enabled if its name matches the @name pattern +# (There are no longer any per-vCPU events). # # Since: 2.2 # @@ -111,4 +105,4 @@ ## { 'command': 'trace-event-set-state', 'data': {'name': 'str', 'enable': 'bool', '*ignore-unavailable': 'bool', - '*vcpu': 'int'} } + '*vcpu': {'type': 'int', 'features': ['deprecated'] } } } From patchwork Fri May 26 16:53:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685927 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025201wrt; Fri, 26 May 2023 09:54:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44Zud0ctZRyQxnTULv9EvqniiDkvdO8O5KMlLxP1z/S/H4TiTzapgVo6rVqKJbHMyfDnVL X-Received: by 2002:a05:6214:f0c:b0:625:aa48:fb71 with SMTP id gw12-20020a0562140f0c00b00625aa48fb71mr3230674qvb.59.1685120061966; Fri, 26 May 2023 09:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120061; cv=none; d=google.com; s=arc-20160816; b=tbJ6I/p6UyejBbVJSyCetpxM0gy8KVLCX65K6BKlVAQ6Kzcn/X86CAgW+nCGZUt6Vo 8rRJhS0/Yicbv9w22C82/ZgCFHWKxn2xBxGYHBFkaZNie9g4vv3SCg1MJlgmyzJLCuyt savJglDJlED6blf1MM9zei6pFwbXV3epLOaj91TbyoroxD6MYRzKQOOgz8sud5+fbnRr Wr9aB30iYiq2wSfsGNJnarbasu8ZHiQUrcZuQuUPFTD4o8ZMQuNBq0v53PcgYFC2VsBW dmGYca20vhpaV8kw2fWr+qkQhDtmo70ARFbYalWMPyZ7VOY8YseOrdOtes5/tx1SnmgT t3kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=y/qqdws9YCyzuPRbVuOlkH4cagxubcnZ+PxwQtnIq6gsgmEbAY2MOWYRpQyfh1nScR qJQaabrRqxGV4iHFzcTpJPF+O1O6G0AjXbzOTK9YbORjLXMoSuSINYCNqYmpoRyPhXxR aLyPUYJvQoUi/zmP+DI0SIS//Rbaz2lFjkOWMpVecQPaksz2iMSVMg1v8DghWEnKnVW6 6ilo72u83EvM2moKXRzlyy0lDVq9rDnurgy22e0GIc7A82b88N9UQ+7yDhcDqSjkF4hG /iO5Wmaca7AXIDa1AicI03D/0NeEXIIpJ9op/TZmKRLCXtMXsHtnTlATcg7gSn1KMeKl XqeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fASwp5/k"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id 3-20020a05621420c300b005eee45e4fe9si1565795qve.140.2023.05.26.09.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="fASwp5/k"; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120061; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=fASwp5/kDbmgKlMOfw9Nj0b9IUuWpoNoFQ2RFrucgSvjTmonC43ZuQY/fAv98X4r72HEhk cwOOy7ox1EGM8gJFddfnV1ZbgAZYaNjSnSuYMXDe4D/I6ux/B4BauJ8YTLHUA6gs2Za2+G dS100aNM9fPEFcQR7so2tzfM/n1WXsY= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-19-LoU_GrVhMGeIl9W3cUm5XQ-1; Fri, 26 May 2023 12:54:19 -0400 X-MC-Unique: LoU_GrVhMGeIl9W3cUm5XQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5BAAD382C998; Fri, 26 May 2023 16:54:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45CC7492B0A; Fri, 26 May 2023 16:54:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 05BD619452C5; Fri, 26 May 2023 16:54:13 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id AFD511946A42 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 96C0440CFD48; Fri, 26 May 2023 16:54:10 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F2EA40CFD45 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 70FDB85828D for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-110-CaHTCCzLNsiOSDEZPIizWw-1; Fri, 26 May 2023 12:54:08 -0400 X-MC-Unique: CaHTCCzLNsiOSDEZPIizWw-1 Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-30a95ec7744so902465f8f.3 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3qgsN4w6AIkE7OcQlghBZXzSqdUnp6/ExqaL1Iy/vfA=; b=bm+jO0XeCMYpY57wDD0jrKpa5v5u1NI8Jz7iaDKZoWibT4Ew3FaUsOEaTOr3LV12jH VHaP04+R65Qitye9OkZOLtFsJK8+JafGNib69rU/5t4f9zq+9LdYHQUfAvV2UFFUCMHl jRWfP0diWZm6T9Ba4YCQLsa0VomQrTT+X/gC10AwBwCOIcfQlYTrLKtsKMilw9lYcZIi 1/zg11qgEkPqCLA3Z2UJz/LL3mkkZIN3HNyG/P4A5WHT49osUVs+wVvzbl2r9I2nGpWN GcJPwPJnheQJ5NTezEYosOgMbmPVL1zLz9srq6d8oHtNW4sI5hqfT4/yLD3ItfBHbA7D /hAg== X-Gm-Message-State: AC+VfDzZF2Ydwx5KdCfNle0Clm4vYFMqrxa2QyAaIdbZ9Q+JIbiCT0E8 9jWAvmkVn/E+pC6zSWyxaiePqg== X-Received: by 2002:adf:cd8e:0:b0:306:3ec8:289d with SMTP id q14-20020adfcd8e000000b003063ec8289dmr2029922wrj.46.1685120047085; Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id q18-20020adffed2000000b003047dc162f7sm5578183wrs.67.2023.05.26.09.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5BCDD1FFBD; Fri, 26 May 2023 17:54:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 07/11] trace: remove code that depends on setting vcpu Date: Fri, 26 May 2023 17:53:57 +0100 Message-Id: <20230526165401.574474-8-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Now we no longer have any events that are for vcpus we can start excising the code from the trace control. As the vcpu parameter is encoded as part of QMP we just stub out the has_vcpu/vcpu parameters rather than alter the API. Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-7-alex.bennee@linaro.org> --- trace/control-internal.h | 10 ---- trace/control-vcpu.h | 16 ------ trace/control.h | 48 ----------------- hw/core/cpu-common.c | 2 - stubs/trace-control.c | 13 ----- trace/control-target.c | 108 ++++----------------------------------- trace/control.c | 16 ------ trace/qmp.c | 74 +++------------------------ trace/trace-hmp-cmds.c | 18 ++----- 9 files changed, 20 insertions(+), 285 deletions(-) diff --git a/trace/control-internal.h b/trace/control-internal.h index 0178121720..8d818d359b 100644 --- a/trace/control-internal.h +++ b/trace/control-internal.h @@ -25,16 +25,6 @@ static inline uint32_t trace_event_get_id(TraceEvent *ev) return ev->id; } -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 != 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)) -/** - * 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" static inline bool @@ -51,13 +44,4 @@ trace_event_get_vcpu_state_dynamic_by_vcpu_id(CPUState *vcpu, } } -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 = 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); -/** - * 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-specific - * (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); -/** - * 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) == true - * - * Note: Changes for execution-time events with the 'tcg' property will not be - * propagated until the next TB is executed (iff executing in TCG mode). - */ -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); -/** - * 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, Error **errp) } /* NOTE: latest generic point where the cpu is fully realized */ - trace_init_vcpu(cpu); } static void cpu_common_unrealizefn(DeviceState *dev) @@ -219,7 +218,6 @@ static void cpu_common_unrealizefn(DeviceState *dev) CPUState *cpu = CPU(dev); /* NOTE: latest generic point before the cpu is fully unrealized */ - trace_fini_vcpu(cpu); cpu_exec_unrealizefn(cpu); } 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) 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 != 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 = *ev->dstate; - if (state_pre != state) { - if (state) { - trace_events_enabled_count++; - *ev->dstate = 1; - } else { - trace_events_enabled_count--; - *ev->dstate = 0; - } - } - } -} -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 = trace_event_get_vcpu_id(ev); - state_pre = 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 = *ev->dstate; if (state_pre != state) { if (state) { trace_events_enabled_count++; - set_bit(vcpu_id, vcpu->trace_dstate_delayed); - (*ev->dstate)++; + *ev->dstate = 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 from a - * single set of dstate values to ensure consistency of generated - * tracing code. - */ - async_run_on_cpu(vcpu, trace_event_synchronize_vcpu_state_dynamic, - RUN_ON_CPU_NULL); - } else { - trace_event_synchronize_vcpu_state_dynamic(vcpu, RUN_ON_CPU_NULL); - } - } -} - -static bool adding_first_cpu1(void) -{ - CPUState *cpu; - size_t count = 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 = trace_event_iter_next(&iter)) != 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 == 1); - /* disable early-init state ... */ - *ev->dstate = 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 = 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 } -void trace_fini_vcpu(CPUState *vcpu) -{ - TraceEventIter iter; - TraceEvent *ev; - - trace_event_iter_init_all(&iter); - while ((ev = trace_event_iter_next(&iter)) != 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" -static CPUState *get_cpu(bool has_vcpu, int vcpu, Error **errp) -{ - if (has_vcpu) { - CPUState *cpu = qemu_get_cpu(vcpu); - if (cpu == 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_pattern, +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_unavailable, bool is_pattern return false; } - /* 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 char *name, bool has_vcpu, int64_t vcpu, Error **errp) { - Error *err = NULL; TraceEventInfoList *events = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return NULL; - } /* Check events */ - if (!check_events(has_vcpu, true, is_pattern, name, errp)) { + if (!check_events(true, is_pattern, name, errp)) { return NULL; } @@ -93,33 +65,17 @@ TraceEventInfoList *qmp_trace_event_get_state(const char *name, trace_event_iter_init_pattern(&iter, name); while ((ev = trace_event_iter_next(&iter)) != NULL) { TraceEventInfo *value; - bool is_vcpu = trace_event_is_vcpu(ev); - if (has_vcpu && !is_vcpu) { - continue; - } value = g_new(TraceEventInfo, 1); - value->vcpu = is_vcpu; value->name = g_strdup(trace_event_get_name(ev)); if (!trace_event_get_state_static(ev)) { value->state = TRACE_EVENT_STATE_UNAVAILABLE; } else { - if (has_vcpu) { - if (is_vcpu) { - if (trace_event_get_vcpu_state_dynamic(cpu, ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } - } - /* else: already skipped above */ + if (trace_event_get_state_dynamic(ev)) { + value->state = TRACE_EVENT_STATE_ENABLED; } else { - if (trace_event_get_state_dynamic(ev)) { - value->state = TRACE_EVENT_STATE_ENABLED; - } else { - value->state = TRACE_EVENT_STATE_DISABLED; - } + value->state = 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 = NULL; TraceEventIter iter; TraceEvent *ev; bool is_pattern = trace_event_is_pattern(name); - CPUState *cpu; - - /* Check provided vcpu */ - cpu = get_cpu(has_vcpu, vcpu, &err); - if (err) { - error_propagate(errp, err); - return; - } /* Check events */ - if (!check_events(has_vcpu, has_ignore_unavailable && ignore_unavailable, + 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 = trace_event_iter_next(&iter)) != NULL) { - if (!trace_event_get_state_static(ev) || - (has_vcpu && !trace_event_is_vcpu(ev))) { + if (!trace_event_get_state_static(ev)) { continue; } - if (has_vcpu) { - trace_event_set_vcpu_state_dynamic(cpu, ev, enable); - } else { - trace_event_set_state_dynamic(ev, enable); - } + trace_event_set_state_dynamic(ev, enable); } } diff --git a/trace/trace-hmp-cmds.c b/trace/trace-hmp-cmds.c index 792876c34a..86211fce27 100644 --- a/trace/trace-hmp-cmds.c +++ b/trace/trace-hmp-cmds.c @@ -37,16 +37,10 @@ void hmp_trace_event(Monitor *mon, const QDict *qdict) { const char *tp_name = qdict_get_str(qdict, "name"); bool new_state = qdict_get_bool(qdict, "option"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); Error *local_err = NULL; - 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, vcpu, &local_err); + qmp_trace_event_set_state(tp_name, new_state, + true, true, false, 0, &local_err); if (local_err) { error_report_err(local_err); } @@ -80,8 +74,6 @@ void hmp_trace_file(Monitor *mon, const QDict *qdict) void hmp_info_trace_events(Monitor *mon, const QDict *qdict) { const char *name = qdict_get_try_str(qdict, "name"); - bool has_vcpu = qdict_haskey(qdict, "vcpu"); - int vcpu = qdict_get_try_int(qdict, "vcpu", 0); TraceEventInfoList *events; TraceEventInfoList *elem; Error *local_err = NULL; @@ -89,12 +81,8 @@ void hmp_info_trace_events(Monitor *mon, const QDict *qdict) if (name == NULL) { name = "*"; } - if (vcpu < 0) { - monitor_printf(mon, "argument vcpu must be positive"); - return; - } - events = qmp_trace_event_get_state(name, has_vcpu, vcpu, &local_err); + events = qmp_trace_event_get_state(name, false, 0, &local_err); if (local_err) { error_report_err(local_err); return; From patchwork Fri May 26 16:53:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685923 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025153wrt; Fri, 26 May 2023 09:54:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5WXMSHKDmpvumW/pN+zvx2cvcT+BTw7qiAXb0tgxAb2AifA1CPf0iy9jzpv4NsJdyB3pRB X-Received: by 2002:a05:622a:353:b0:3f6:99f7:bf94 with SMTP id r19-20020a05622a035300b003f699f7bf94mr2673380qtw.62.1685120056788; Fri, 26 May 2023 09:54:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120056; cv=none; d=google.com; s=arc-20160816; b=gwCHyt1Qba/9bEHBYm8qc1s3LgC0DPPTFLh6inSEKq59sXUur2blfaK+mrzazPSK0g P85qq3pDQ9bdssLee57pnbt0y4QERD2WBMp6AdrzuPur38urLinGSNTuZopua72edHUV Y88lslYOTCiXCzCLL0u63m0a/xSD45+O0zQbs7IOXGfsjtt5SnzvYHXvv2VEcrX85krq WXyjHP3H5JlaAc2KdBOS0mT3TIj8c0IIQ4n9J5tPNUDxRABzzV4gTZv94f/Q/tpPL08I 4EnYZXMOdW2dPwfItwI6FDTCL2iQTaeBkqAZRsTnBYInvZdvklQzvwsOt3l2q3je4bRY f6Bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=XF/ePxPKEfBhQ36dLSVYy30NbV+K169mpLmCZQ782uuUK6JFwXmZsdPORDOzL2L8vK fxLT2Ij4Oc3wTlnmwTB7VsRi437wGdmpiqjP7ZaG/CQjfcMbwQiXrz3sjp2YNEl8FEjR NWsGrQUk+samrmKZcph2B1anev83TUuBmgLGvzIGKyGKy5mLQqywhm11ZADget8i4E5Y LHcPMi8FQGNF5o4ufy1wCkLvIiqnEqf/TOfqTYsffnywEmZ3tBSyJJsmUmkiuiEohNY6 1pHC5Hz25G8VXfih3G1zewCNsBFXWjwHPv9ZzDpXg/SFP+2afXS4UemwP84rX/kD74bt e2qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gG8UMMIL; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id s2-20020ac85cc2000000b003ef499add83si1529996qta.516.2023.05.26.09.54.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:16 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gG8UMMIL; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120056; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=gG8UMMILe5FewBezjqUx/kHaSzlXqIaA7yMh7GrIOUgAdE3hY5wVUHCN7K4jmq5aKcqeVI 8056HSbotidpHAEhNBQEpapqJJokWrlYkwazR5XnIehrOr3ajMpIiBQLb2fmrnOh3hN/hF 5NePBL9BgFpf+SKGvo4NODw4KpVvcRY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-445--h0Zafk0Mx-iAGHOaFTgug-1; Fri, 26 May 2023 12:54:13 -0400 X-MC-Unique: -h0Zafk0Mx-iAGHOaFTgug-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 20949185A7BA; Fri, 26 May 2023 16:54:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0539FC0297C; Fri, 26 May 2023 16:54:11 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B69371946A46; Fri, 26 May 2023 16:54:10 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C7FAC19465B7 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id BE85040CFD46; Fri, 26 May 2023 16:54:09 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B6AA940CFD45 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9C9BF3C14123 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-440-b1RYypBnOYSH4PHMz75GQQ-1; Fri, 26 May 2023 12:54:08 -0400 X-MC-Unique: b1RYypBnOYSH4PHMz75GQQ-1 Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-3f606912ebaso10057315e9.3 for ; Fri, 26 May 2023 09:54:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jR3hYoNQairvfPLkchXzs2j4mJfUeyks2q4lp9MRHVc=; b=cE14adKrAXvj05d709vzUA7oDkxJYjCPntvCDfRX+JCGnE3WKyiD5O5vHo1Mfbu458 eyjs1DPB5EHE1i4KXLGVe1cVhoBGP2OaHohJq2jUbUlXCqal7u8tvgarwqsaV1dqVZRS iPNsWIBvMpsk5Gqt5Peb2h4nONEM46hqfAjOSRuoE4cjo1ccID+2VvD17wlBJRrc2hkV qKzmd3s1tX9YoSiwOR43/aR2lfyiO9A2rgNZnd2Xu7oyJ+K6QT3SGV57PjCo0wv/1g30 oNxc2LmWwzpYBhM0XTuL15w1ECkLQfmsPHE2MaerP7e4pFK/51JSoAHUe+jaaq0web2u c1eg== X-Gm-Message-State: AC+VfDyYs5xJXfbNby9fvEniDqGP/39gJY9+o5359X7I/3nPiqxdKcyN nDrafWBIuGzejMKPHhvQemYnsg== X-Received: by 2002:a1c:7216:0:b0:3f6:476:915 with SMTP id n22-20020a1c7216000000b003f604760915mr2003755wmc.6.1685120046854; Fri, 26 May 2023 09:54:06 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c2-20020adfed82000000b003078a3f3a24sm5647610wro.114.2023.05.26.09.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:05 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AF2461FFBB; Fri, 26 May 2023 17:54:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 08/11] trace: remove control-vcpu.h Date: Fri, 26 May 2023 17:53:58 +0100 Message-Id: <20230526165401.574474-9-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org Now we no longer have vcpu controlled trace events we can excise the code that allows us to query its status. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-8-alex.bennee@linaro.org> --- trace/control-vcpu.h | 47 ----------------------------------- trace/qmp.c | 2 +- scripts/tracetool/format/h.py | 5 +--- 3 files changed, 2 insertions(+), 52 deletions(-) delete mode 100644 trace/control-vcpu.h diff --git a/trace/control-vcpu.h b/trace/control-vcpu.h deleted file mode 100644 index 800fc5a219..0000000000 --- a/trace/control-vcpu.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Interface for configuring and controlling the state of tracing events. - * - * Copyright (C) 2011-2016 Lluís Vilanova - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * 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 given - * vCPU. - * - * If the event has the disabled property, the check will have no performance - * 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" 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 @@ def generate(events, backend, group): - if group == "root": - header = "trace/control-vcpu.h" - else: - header = "trace/control.h" + header = "trace/control.h" out('/* This file is autogenerated by tracetool, do not edit. */', '', From patchwork Fri May 26 16:53:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685924 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025184wrt; Fri, 26 May 2023 09:54:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6EB86A/EGH5aRVTJvur5GShFHdJN6vnGcvj0v2hgHrszumu9uXV7tnwPymLZyZJ9wIPp5v X-Received: by 2002:a05:622a:86:b0:3f6:a490:49c0 with SMTP id o6-20020a05622a008600b003f6a49049c0mr2457852qtw.49.1685120060375; Fri, 26 May 2023 09:54:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120060; cv=none; d=google.com; s=arc-20160816; b=gyLFxfvixW8+HEks7qJdIPi9wsxNFJfu1YfCdk1tfSHRykDarDOcEUZrZFl6uW0Fqm zZGlAKYhJ5uan0xFKGsvUHkR4ndVsJYsCGT/FvGcIgjZodKZ3rT7ogJF2pK2cna0Ft87 xm1Od/mUxMPsvGfWCBTGVHBcVbPCw6p2gcqO66/BqCjlm4UD+Z89mcGnR9JX819MhGRD ZPDT4NTkNlDZEgqIf222IwIQ3bbk3F8jeYeAUWQvSOdW+YPDIvxpos+d2VrJeV2nykgW lfniHsjqxFKU36U1AQI3HHtG4tySnK/5jhhNbWdOKMsdUXRaz8/LyQenL8E5O2G40uxg dSew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=iEFNg0Si1d/PNtVjbZOw9A7Varq8HZz7aijeQbhE2JN3zBs7h4I+IxTYf9/qDaLIj8 zJdpwnuoa3QIVLDoXorNzjzyD+j/JJGQ7H9E+iDCbtCt8pO930Jjkzf+KqdoodskDKc2 l5nfuepBjuR9s0SnsUqrFF9ouf1sHLgKr5JDMBk1yuTcIj6/NBy8o1Le733vuNc5ThOd 0josRPP6pv45kDhCMIcIrou51IZgW90bp7l0zkl4JzOJ9v9hfSVoCuP1BA2IJe71rkoL tvhHQ2lNc/F6ictDlfwmfabhT4g1PgxUoUtuB5U3xKDCaAHH7sc4edy2Fx8NSw/+Rg2c 1aOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cw03bpHX; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.129.124]) by mx.google.com with ESMTPS id l10-20020a05622a050a00b003ee1adf539esi1476657qtx.488.2023.05.26.09.54.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:20 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cw03bpHX; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120059; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=cw03bpHXJWo4IAbQaVq4SIafL0+QDWIe2S/TqPjcWxqE5s0b0hIdUUT45gK3L0jGoulkYF pkucCUgDIVIa+g8P3gBVWpzh86sB1RaD1Xy+mRaKPkhrjWKC4Q+HmrS1WjGkKlZZ/ee1jH xVH82pWhIGWVbtlXlauzVefWCPz2ACQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-Fqqbgan7P6ax9hC2sJO-fA-1; Fri, 26 May 2023 12:54:18 -0400 X-MC-Unique: Fqqbgan7P6ax9hC2sJO-fA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1752B29324A6; Fri, 26 May 2023 16:54:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id ED3BEC359AA; Fri, 26 May 2023 16:54:12 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 2597219451C5; Fri, 26 May 2023 16:54:12 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6822D19465A4 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 4B7B148205F; Fri, 26 May 2023 16:54:10 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 425EF48205E for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BE6C858EEC for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-148-U8jZd0IkNNCKg_M-PM2IOw-1; Fri, 26 May 2023 12:54:08 -0400 X-MC-Unique: U8jZd0IkNNCKg_M-PM2IOw-1 Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-3f611ccd06eso7187035e9.0 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120047; x=1687712047; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XebfzUZQBA1ilEy0+7OzzMavlGn27zqK0j5kHcKVcZ8=; b=VJ92+aFfkHPSHzJMaQ9eSlKLVOXQdZB947sOjZE8/K3qDd2RzIJhhdLgiCameh8Y68 ijVDTQbICq9Ozv5Aif87Ho7lmLfmhkDtVeBuOnguDNGJNIK7tLBsCuuPa8Lga6VKxF2d eV690dQ4733V1XWdkrjnV/S1mMVBSwTH04gnAHRPsdYK2Xpo2iHf6dYlVH/wE2JWZamq sfHVf+Srvue1Ug9hrrEWsZOvLLJCgu50CUxAhSj1njAaw3pBeWY3yzUdC/GGa5hJZ3jo w9XAxzNxhitlzOACMNm/JZiiOnTYAS58Hk9cW8Me8A328IMj9vUz+GRL5lwepu/vm4WM iMbA== X-Gm-Message-State: AC+VfDwYM35C+n+aUhL6K8hSKDZeg99Zii4cqI4CsI6+3/mZN7QQNx8b GrL4/LsbvyHi9Mh0k6Fpxs9RAA== X-Received: by 2002:a1c:f40a:0:b0:3f4:e853:6a1 with SMTP id z10-20020a1cf40a000000b003f4e85306a1mr2206300wma.38.1685120047514; Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0ac700b003f4fb5532a1sm5682160wmr.43.2023.05.26.09.54.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:06 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 11F201FFBC; Fri, 26 May 2023 17:54:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 09/11] tcg: remove the final vestiges of dstate Date: Fri, 26 May 2023 17:53:59 +0100 Message-Id: <20230526165401.574474-10-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org 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=virt,highmem=off \ -display none -m 2048 \ -serial mon:stdio \ -netdev user,id=unet,hostfwd=tcp::2222-:22 \ -device virtio-net-pci,netdev=unet \ -device virtio-scsi-pci \ -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf \ -device scsi-hd,drive=hd -smp 4 \ -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage \ -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' \ -snapshot" It has a marginal effect on runtime, before: Time (mean ± σ): 26.279 s ± 2.438 s [User: 41.113 s, System: 1.843 s] Range (min … max): 24.420 s … 32.565 s 20 runs after: Time (mean ± σ): 24.440 s ± 2.885 s [User: 34.474 s, System: 2.028 s] Range (min … max): 21.663 s … 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é Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-9-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 6 +++--- include/exec/exec-all.h | 3 --- include/hw/core/cpu.h | 5 ----- accel/tcg/cpu-exec.c | 7 +------ accel/tcg/tb-maint.c | 5 ++--- accel/tcg/translate-all.c | 6 ------ 6 files changed, 6 insertions(+), 26 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 83dc610e4c..1d19c69caa 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -61,10 +61,10 @@ static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) #endif /* CONFIG_SOFTMMU */ 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 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); } #endif diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 4d2b151986..3b1b57f6ad 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -545,9 +545,6 @@ struct TranslationBlock { #define CF_CLUSTER_MASK 0xff000000 /* Top 8 bits are cluster ID */ #define CF_CLUSTER_SHIFT 24 - /* 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_cpu_data data); struct qemu_work_item; #define CPU_UNSET_NUMA_NODE_ID -1 -#define CPU_TRACE_DSTATE_MAX_EVENTS 32 /** * CPUState: @@ -407,10 +406,6 @@ struct CPUState { /* Use by accel-block: CPU is executing an ioctl() */ QemuLockCnt in_ioctl_lock; - /* 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); #ifdef CONFIG_PLUGIN diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 0e741960da..4a1dce98ff 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -175,7 +175,6 @@ struct tb_desc { tb_page_addr_t page_addr0; uint32_t flags; uint32_t cflags; - uint32_t trace_vcpu_dstate; }; 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) == desc->page_addr0 && tb->cs_base == desc->cs_base && tb->flags == desc->flags && - tb->trace_vcpu_dstate == desc->trace_vcpu_dstate && tb_cflags(tb) == desc->cflags) { /* check next page if needed */ tb_page_addr_t tb_phys_page1 = tb_page_addr1(tb); @@ -228,7 +226,6 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, desc.cs_base = cs_base; desc.flags = flags; desc.cflags = cflags; - desc.trace_vcpu_dstate = *cpu->trace_dstate; desc.pc = pc; phys_pc = get_page_addr_code(desc.env, pc); if (phys_pc == -1) { @@ -236,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, } desc.page_addr0 = phys_pc; h = 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); } @@ -263,7 +260,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, jc->array[hash].pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == cflags)) { return tb; } @@ -282,7 +278,6 @@ static inline TranslationBlock *tb_lookup(CPUState *cpu, target_ulong pc, tb->pc == pc && tb->cs_base == cs_base && tb->flags == flags && - tb->trace_vcpu_dstate == *cpu->trace_dstate && tb_cflags(tb) == 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 == b->cs_base && a->flags == b->flags && (tb_cflags(a) & ~CF_INVALID) == (tb_cflags(b) & ~CF_INVALID) && - a->trace_vcpu_dstate == b->trace_vcpu_dstate && tb_page_addr0(a) == tb_page_addr0(b) && tb_page_addr1(a) == 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 = tb_page_addr0(tb); h = 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, /* add in the hash table */ h = 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); /* remove TB from the page(s) if we couldn't insert it */ diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index c87648b99e..bf814b9e81 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -65,11 +65,6 @@ #include "internal.h" #include "perf.h" -/* 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; /* @@ -352,7 +347,6 @@ TranslationBlock *tb_gen_code(CPUState *cpu, tb->cs_base = cs_base; tb->flags = flags; tb->cflags = cflags; - tb->trace_vcpu_dstate = *cpu->trace_dstate; tb_set_page_addr0(tb, phys_pc); tb_set_page_addr1(tb, -1); tcg_ctx->gen_tb = tb; From patchwork Fri May 26 16:54:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685926 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025198wrt; Fri, 26 May 2023 09:54:21 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5YMQK4KbklpjIfanIZAYVu1KEeJeAWh1HHfgUS19ZRSQfic9cwTHYKAy1XXmkeuuczaGjF X-Received: by 2002:a05:622a:242:b0:3f8:45f:997 with SMTP id c2-20020a05622a024200b003f8045f0997mr2487977qtx.22.1685120061651; Fri, 26 May 2023 09:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120061; cv=none; d=google.com; s=arc-20160816; b=e5/KafAQyogEr4o8OWastZGGVVoxdVXVlaxijMHNriy+pCuhVrMWI6Zcb5k9dJAA73 8+rPHPuIla2L2hI4eZxjHCU8kE3rCj9DUVCP3zXnU7UT093JGKfpzT6k7NONiu8djG4r Q3NyF0Yz0y9g3wysRue+FiUBL9BjOvrlulRm7MG6YmrkSWRCCZy420/C6IjbiH/XEeyp heDxYGm6f6j6nR4WIRTdFXMMalhn1Wbf+WovYDFrI6MPWlJRdbLAIhDb+UMbwILu/gOs Nsj7Ozs7ZYarEVyij0t2c5s4jmPmLfbrEGtexp2dCjhwyPD8VtL8MyVPVTIQNa1zxhpW hu1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=1Gyl8vWtuQadkl9DhdrZCLujxqFf+zQNyMptT54p45zpENssT3liklPOAxe2s5Pt77 +tu7HOSZxQgpQu0yXXhnoUjeyxbJX6ZYWS3saCPmIooj85WxhisVmDvIiDAADlZkYpUR zYykC59+arrnjApS/f5vYtQ1s8tlJjZcMFCUFepkxIIezcNifQCWqeWjbZn1X7SOys/U wrltiOBhjoktuFC2q734ikwHf0on4+5ETIJyCLLQeChTgGr17gZCGpWLwEJ06rRMQxaG 1uvCSNR+MuQio9sgt3sPPIs20r4e4FJJsGlUTHCLQXP3R3p4vPYwPTo2vT4X7gxUtBIZ hH5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FsWjRmY1; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id i6-20020ac85c06000000b003f38b2e048esi1508923qti.678.2023.05.26.09.54.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FsWjRmY1; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120061; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=FsWjRmY1Lm0XEynEFZTm5n8vjo4bXHXzwGDAwQtQil/BK6WY0+zvO2S5qrw1v9CFIndaoS HUbXV26vHKMn55eo+/a6Ly/2XNHty2juLv+n4dAAKKm+8HySl9w4bx5kiftUVxo15uwXEf FYEIRk7x3o/5Mm1/ujYn+CfhxGMg5C4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-320-ngA9ZwAKOW6ClbJXOmSRJA-1; Fri, 26 May 2023 12:54:19 -0400 X-MC-Unique: ngA9ZwAKOW6ClbJXOmSRJA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9B6808038E8; Fri, 26 May 2023 16:54:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 79ABA140E965; Fri, 26 May 2023 16:54:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 692DE1946A46; Fri, 26 May 2023 16:54:12 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B09A51946A44 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7F54640CFD46; Fri, 26 May 2023 16:54:10 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast07.extmail.prod.ext.rdu2.redhat.com [10.11.55.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 773D540CFD45 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A9E03C14119 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-ro3DVSveOPO-7225WsBsyA-2; Fri, 26 May 2023 12:54:08 -0400 X-MC-Unique: ro3DVSveOPO-7225WsBsyA-2 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-3f6e72a1464so7300495e9.1 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120048; x=1687712048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=golKvSYvzbphYFdgYW/zJabTWZL4ziquNJ4trhfkWb0=; b=bg0z0kQpY5V0Rv1UU2oIwu5d3O5YC/wDwnQoTbfNCN8I8FuzfIhwPJCtdZKkj6aRI+ 4bC2WfrGXS4Avmgr7O5oWGyL5UhCNLOIzb0XOUHcDkcQ3dUqg5AFjX9zMKvjALep18VH KDXDqQ4cqIQGY39WS5RQuGI8Xz/B2KI5oP5By9sDmqD9o9m7jN1U/ef8unCs+JsE8UBX lQz5tQHVGrvD+03IzpO3DKHV0zPRBnzk8KSbYqq7x5AN1tKaqE1aYUdy23wYwdvWqiO0 bByIh/5CMzggmUv1gBNLnP0zZWgLAm5BlIUb+3RtilZ1KZs9Bc1EkQTOH9vPIPM/wnZT 1fVg== X-Gm-Message-State: AC+VfDz6kwpzSc6mkL1JzU82t1STrRMZ65s8miWVnvYimVtzSoXflQNr +CI4qEnLR6+6AmKhrFKN7F0dTA== X-Received: by 2002:a05:600c:d2:b0:3f6:536:a4b2 with SMTP id u18-20020a05600c00d200b003f60536a4b2mr1892054wmm.27.1685120047859; Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id x4-20020a5d54c4000000b002c70ce264bfsm5609626wrv.76.2023.05.26.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4948A1FFC0; Fri, 26 May 2023 17:54:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 10/11] hw/9pfs: use qemu_xxhash4 Date: Fri, 26 May 2023 17:54:00 +0100 Message-Id: <20230526165401.574474-11-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org No need to pass zeros as we have helpers that do that for us. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Christian Schoenebeck Reviewed-by: Stefan Hajnoczi Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20230524133952.3971948-10-alex.bennee@linaro.org> --- hw/9pfs/9p.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 9621ec1341..991645adca 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -738,15 +738,14 @@ static VariLenAffix affixForIndex(uint64_t index) return invertAffix(&prefix); /* convert prefix to suffix */ } -/* 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); } static uint32_t qpf_hash(QpfEntry e) { - return qemu_xxhash7(e.ino, e.dev, 0, 0, 0); + return qemu_xxhash4(e.ino, e.dev); } static bool qpd_cmp_func(const void *obj, const void *userp) From patchwork Fri May 26 16:54:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685929 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025228wrt; Fri, 26 May 2023 09:54:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4clnSebJW41cRHXBtb/V8JlMDPEz7e13vgbR0V9xVV9xUkNl1+i/8OJ6NS07tfiohXJfoX X-Received: by 2002:a05:620a:24c3:b0:75b:23a1:8330 with SMTP id m3-20020a05620a24c300b0075b23a18330mr118347qkn.43.1685120064315; Fri, 26 May 2023 09:54:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120064; cv=none; d=google.com; s=arc-20160816; b=G000qxUX2zhxbGOg7mMkxuKWVFUVS+DB1PyhxUcW6kwdzAw25WOpyCyOaouOJ7i3fO jGSYdo1xSqMh1KbTmB58zceSiZoV6kaWnfaUYGTyZ+XgpdEEzP0Y7Q5cN4fy1UsGDlgx wZvWao/xtrGTY/GNnPLrIIpzg1g3a8EBLk+9pnp9eB/dlhiWvI1tl4zzM+y1boAmrHJm FLebN378GWQrjlbtLslk2rjBQglojO9Z7Z+ugeiCbNkseryoJ2iCMI0nBp6/H+iGuihr jx+ZgtTgfVUBCp1gqgyfrygt6p0bZxi2iGXhiKjOQGrkkzj1Of6sSMDE6rgCpjUe5NjN y/Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=YKEf+gEbPzDF7Cxv3I9V3xYuZjBfJ+lj+qLaGFamBHS09vnrkLBtrsOmbiOf5rWPqu FVNJCR+wsKn+WYCZ3MOEUf9tFuB2Ban7kLk34HkGXAFgWtHY+OIxTKT23x6Nb430j3il 5ynwrf6Bihcpxm9Bm3zCECoQoksdyQ1gqKwHa+Jf/7mq1TuIZ9ty5aF4I6udBeQuRn/7 ccPBtaECoMf3p3V3oR9ruijJUJbjoiIUj+eXahpilxBBR7FO8bxntBauXyDkk3VnmdJ2 5UEFiWbRn5Zuk8SdOGNMAvUgypfpKZzap1eOqzeJQrlDILXcvN6A7oZYQHUXiVi1peMv wARA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YgRffbmj; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id t5-20020a05620a004500b00748492ce727si1587344qkt.418.2023.05.26.09.54.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:24 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YgRffbmj; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120063; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=YgRffbmjTbgOzpbiUQW2Z498MM2uR8CkKDytDIv0PWA9jkXKM3Yce6JPlupDCPtVnpto7q fob7bD4my7RFQ+7hRXSpYcAUJrBZlUTCnvnE7KaRI8x8ByKgdA4IRkLz5ohjpDSzvD2JoI kZjGgpT8KxYcGdaL90mk2ezRBNRJ7Lc= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-112-0kzjYyAXMMmnemg_fyODnQ-1; Fri, 26 May 2023 12:54:19 -0400 X-MC-Unique: 0kzjYyAXMMmnemg_fyODnQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 08474382C98F; Fri, 26 May 2023 16:54:14 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E48DC492B0D; Fri, 26 May 2023 16:54:13 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id B968E19452C3; Fri, 26 May 2023 16:54:12 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 28BC719465B3 for ; Fri, 26 May 2023 16:54:11 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EE369140E95D; Fri, 26 May 2023 16:54:10 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E623E140E961 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C13658039A9 for ; Fri, 26 May 2023 16:54:10 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595-B_Zyq-LmPpCAYIo53LLwgg-2; Fri, 26 May 2023 12:54:09 -0400 X-MC-Unique: B_Zyq-LmPpCAYIo53LLwgg-2 Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-3f6da07feb2so10946715e9.0 for ; Fri, 26 May 2023 09:54:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120048; x=1687712048; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kaQ6aX3/NMsMPVdtxMM/G0wVfiz9FGlFKsRZqI+Cegk=; b=MlXM0vQlApuIPeb0bluXAcKIi3DIGAqdIEUdfIVHBRwzEzXR7roocbAVRkkFT5kO7C xOOBzhV4Wt3XNUN0RbCEET0OmHYyOyHiMoREP7RrVT6OqnuvZ4MsjcgavYR1iCCBXxN6 zbVuX8AHwCqZegG8+kfqowiqT7SKXKI332NMSKyp5LMNvdXbRVuWOiPltX9VFL2w0cW4 rsTJzEukik1tjXXvDbV+5dovU7xi3ST/9W1s+mNRZIUPcMiIy2RefmTfzK5WKifhb8gN Qxr5Yx7MTtgahUO5Q3V/v9G1LaXslw3d3lZAUapRWzEmJLDa06tVWA+d/gNDyJhPNBj1 l2ZQ== X-Gm-Message-State: AC+VfDwSRG1OIJVIv0pKrfhaGHRBMvttwyC3l7Hc0wr/Cmc/PuxaCI8w CYO05VY0YVxT5qLCWSQaO3iUjQ== X-Received: by 2002:adf:e7cf:0:b0:309:3ddc:1c90 with SMTP id e15-20020adfe7cf000000b003093ddc1c90mr2298168wrn.30.1685120048614; Fri, 26 May 2023 09:54:08 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id y3-20020a5d4703000000b002f103ca90cdsm5596870wrq.101.2023.05.26.09.54.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:07 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id AC9581FFBE; Fri, 26 May 2023 17:54:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 11/11] accel/tcg: include cs_base in our hash calculations Date: Fri, 26 May 2023 17:54:01 +0100 Message-Id: <20230526165401.574474-12-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org 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 ➜ hyperfine -w 2 -m 20 "./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot" Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot Time (mean ± σ): 24.627 s ± 2.708 s [User: 34.309 s, System: 1.797 s] Range (min … max): 22.345 s … 29.864 s 20 runs arm64 ➜ hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot" Benchmark 1: 20 Time (mean ± σ): 62.559 s ± 2.917 s [User: 189.115 s, System: 4.089 s] Range (min … max): 59.997 s … 70.153 s 10 runs After: armhf Benchmark 1: ./arm-softmmu/qemu-system-arm -cpu cortex-a15 -machine type=virt,highmem=off -display none -m 2048 -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-armhf -device scsi-hd,drive=hd -smp 4 -kernel /home/alex/lsrc/linux.git/builds/arm/arch/arm/boot/zImage -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark.service' -snapshot Time (mean ± σ): 24.223 s ± 2.151 s [User: 34.284 s, System: 1.906 s] Range (min … max): 22.000 s … 28.476 s 20 runs arm64 hyperfine -w 2 -n 20 "./qemu-system-aarch64 -cpu max,pauth-impdef=on -machine type=virt,virtualization=on,gic-version=3 -display none -serial mon:stdio -netdev user,id=unet,hostfwd=tcp::2222-:22,hostfwd=tcp::1234-:1234 -device virtio-net-pci,netdev=unet -device virtio-scsi-pci -blockdev driver=raw,node-name=hd,discard=unmap,file.driver=host_device,file.filename=/dev/zen-disk/debian-bullseye-arm64 -device scsi-hd,drive=hd -smp 4 -kernel ~/lsrc/linux.git/builds/arm64/arch/arm64/boot/Image.gz -append 'console=ttyAMA0 root=/dev/sda2 systemd.unit=benchmark-pigz.service' -snapshot" Benchmark 1: 20 Time (mean ± σ): 62.769 s ± 1.978 s [User: 188.431 s, System: 5.269 s] Range (min … max): 60.285 s … 66.868 s 10 runs Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson Message-Id: <20230524133952.3971948-11-alex.bennee@linaro.org> --- accel/tcg/tb-hash.h | 4 ++-- include/qemu/xxhash.h | 23 +++++++++++++++++------ accel/tcg/cpu-exec.c | 2 +- accel/tcg/tb-maint.c | 4 ++-- util/qsp.c | 2 +- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/accel/tcg/tb-hash.h b/accel/tcg/tb-hash.h index 1d19c69caa..2ba2193731 100644 --- a/accel/tcg/tb-hash.h +++ b/accel/tcg/tb-hash.h @@ -62,9 +62,9 @@ static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc) 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); } #endif diff --git a/include/qemu/xxhash.h b/include/qemu/xxhash.h index c2dcccadbf..0259bbef18 100644 --- a/include/qemu/xxhash.h +++ b/include/qemu/xxhash.h @@ -48,8 +48,8 @@ * xxhash32, customized for input variables that are not guaranteed to be * contiguous in memory. */ -static inline uint32_t -qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) +static inline uint32_t qemu_xxhash8(uint64_t ab, uint64_t cd, uint64_t ef, + uint32_t g, uint32_t h) { uint32_t v1 = QEMU_XXHASH_SEED + PRIME32_1 + PRIME32_2; uint32_t v2 = 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 = ab >> 32; uint32_t c = cd; uint32_t d = cd >> 32; + uint32_t e = ef; + uint32_t f = ef >> 32; uint32_t h32; v1 += 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 += g * PRIME32_3; h32 = rol32(h32, 17) * PRIME32_4; + h32 += h * PRIME32_3; + h32 = rol32(h32, 17) * PRIME32_4; + h32 ^= h32 >> 15; h32 *= PRIME32_2; h32 ^= h32 >> 13; @@ -100,23 +105,29 @@ qemu_xxhash7(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f, uint32_t g) 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); } 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); } static inline uint32_t qemu_xxhash5(uint64_t ab, uint64_t cd, uint32_t e) { - return qemu_xxhash7(ab, cd, e, 0, 0); + return qemu_xxhash8(ab, cd, 0, e, 0); } static inline uint32_t qemu_xxhash6(uint64_t ab, uint64_t cd, uint32_t e, uint32_t f) { - return qemu_xxhash7(ab, cd, e, f, 0); + return qemu_xxhash8(ab, cd, 0, e, f); +} + +static inline uint32_t qemu_xxhash7(uint64_t ab, uint64_t cd, uint64_t ef, + uint32_t g) +{ + return qemu_xxhash8(ab, cd, ef, g, 0); } /* diff --git a/accel/tcg/cpu-exec.c b/accel/tcg/cpu-exec.c index 4a1dce98ff..60ca9e229e 100644 --- a/accel/tcg/cpu-exec.c +++ b/accel/tcg/cpu-exec.c @@ -233,7 +233,7 @@ static TranslationBlock *tb_htable_lookup(CPUState *cpu, target_ulong pc, } desc.page_addr0 = phys_pc; h = 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); } 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 = tb_page_addr0(tb); h = 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, /* add in the hash table */ h = 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); /* 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 *callsite, uint64_t ab) uint32_t e = callsite->line; uint32_t f = callsite->type; - return qemu_xxhash6(ab, cd, e, f); + return qemu_xxhash8(ab, cd, 0, e, f); } static inline