Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp643890rdh; Sun, 24 Sep 2023 06:00:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFiIlIRbDYPszjNcBuMyUOZSbG24Due3AIiz+J/ITa/dzvU0hUrWOKPgOuBMgj7/R0kwx92 X-Received: by 2002:a05:6808:2a4e:b0:3ab:8cb8:1294 with SMTP id fa14-20020a0568082a4e00b003ab8cb81294mr5132532oib.28.1695560431269; Sun, 24 Sep 2023 06:00:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695560431; cv=none; d=google.com; s=arc-20160816; b=xX6OK6OiUjZgptGABW/ccanupY96yz5+EL+wANhg2SbRVGy71inz0byt7bM2NJkEAV 5Rs1L3oGkxNiW2kG6bHouSIR/uac8MsJdG883Jwwm4F+ECFsrRGTARx3ZZeJyV28Y7fg RPEhsqTusVte4T/+LS3zS9wkooiRXtVnlVVEhZZb9VpFaUx0yid/T1v0fc7fB8GQU3x6 reT+e9EaJaYvE+zyXtXwff5MLVvT+74dxRciKV7m00pbO+mN8GA1ztCW/QXEyX/6Dh2l RIsJdxFRn8T/GQhIBosNwmTZy1pjleoVVnCAbM07IYVnycLUzicExkCMgy6WXX1KVz6U u65Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=woWU04N+glUzD420ymk+4+G9vxtbf/gGrQWI0ejKWmM=; fh=OD5LJn7r8xaW8Hto+Zrc7PP2Q/aiDb2yLCcOHFkx4kw=; b=pjSDZ538JGXxckbkzGK+nKvvyCPKBDmlfN+zsMLSEpwfZJexCdCs3EUl7kRK7SPNT3 kk2B8hKVVId4EJcu0vijXi4WwckWRGFiGY7/MLhUNKc6rn7sz8EpwHf1i3GtWhwVwNLA x1250x+Dx+4zOOytgMnws1ocD91+3QDdHUoD8t1Lhao2clmCGHjyma9rtbtpG5R4ljWa n/DHJ4EdqYZEeRbRR17sS2uJslj4NnNQ3YgmB/5zSudfXoOSeBaAgkOCkD/FmBIYCPrK MruCev6dPKxgjj/yAwkbdhas6tg4VfjPq72aBC2cK1oz5gNpQZjl/Bq2yCP2KfGK153+ PoAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T6CiLbeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id x4-20020a17090a6c0400b00274b944508fsi10010993pjj.39.2023.09.24.06.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 06:00:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=T6CiLbeG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 9E9858084584; Sun, 24 Sep 2023 05:46:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjIXMp7 (ORCPT + 99 others); Sun, 24 Sep 2023 08:45:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbjIXMp6 (ORCPT ); Sun, 24 Sep 2023 08:45:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AE9910E for ; Sun, 24 Sep 2023 05:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695559469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=woWU04N+glUzD420ymk+4+G9vxtbf/gGrQWI0ejKWmM=; b=T6CiLbeG8XhdZq1QNr6fbR8WScFTIgqlrvxTG6eNuTDh+gRdp3T/DmrsA/U/mN+8wMarlO dXHzEFscixOgtihsgPyU0hTxPx4rB3RJ2gDaCVbpvsyGLB7MNjUqXcS09SVuwZO48eNJfX tTMsKikxfHmQr7vEAbjI8EX28DdMZuk= 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-553-RcpmpXc_Nr6f4ntLhMcivQ-1; Sun, 24 Sep 2023 08:44:23 -0400 X-MC-Unique: RcpmpXc_Nr6f4ntLhMcivQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (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 C1EBA85A5A8; Sun, 24 Sep 2023 12:44:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id 777B740C6EA8; Sun, 24 Sep 2023 12:44:20 +0000 (UTC) From: Maxim Levitsky To: kvm@vger.kernel.org Cc: Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, "H. Peter Anvin" , Sean Christopherson , Paolo Bonzini , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Maxim Levitsky Subject: [PATCH v2 3/4] KVM: x86: add more information to kvm_exit tracepoint Date: Sun, 24 Sep 2023 15:44:09 +0300 Message-Id: <20230924124410.897646-4-mlevitsk@redhat.com> In-Reply-To: <20230924124410.897646-1-mlevitsk@redhat.com> References: <20230924124410.897646-1-mlevitsk@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Sun, 24 Sep 2023 05:46:03 -0700 (PDT) Add: - Flag that shows that the VM is in guest mode - Bitmap of pending kvm requests. - Flag showing that this VM exit is due to request to have an immediate VM exit. Signed-off-by: Maxim Levitsky --- arch/x86/kvm/trace.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/trace.h b/arch/x86/kvm/trace.h index f4c56f59f5c11b..0657a3a348b4ae 100644 --- a/arch/x86/kvm/trace.h +++ b/arch/x86/kvm/trace.h @@ -320,12 +320,18 @@ TRACE_EVENT(name, \ __field( u32, intr_info ) \ __field( u32, error_code ) \ __field( unsigned int, vcpu_id ) \ + __field( bool, guest_mode ) \ + __field( u64, requests ) \ + __field( bool, req_imm_exit ) \ ), \ \ TP_fast_assign( \ __entry->guest_rip = kvm_rip_read(vcpu); \ __entry->isa = isa; \ __entry->vcpu_id = vcpu->vcpu_id; \ + __entry->guest_mode = is_guest_mode(vcpu); \ + __entry->requests = READ_ONCE(vcpu->requests); \ + __entry->req_imm_exit = vcpu->arch.req_immediate_exit; \ static_call(kvm_x86_get_exit_info)(vcpu, \ &__entry->exit_reason, \ &__entry->info1, \ @@ -335,11 +341,15 @@ TRACE_EVENT(name, \ ), \ \ TP_printk("vcpu %u reason %s%s%s rip 0x%lx info1 0x%016llx " \ - "info2 0x%016llx intr_info 0x%08x error_code 0x%08x", \ + "info2 0x%016llx intr_info 0x%08x error_code 0x%08x " \ + "requests 0x%016llx%s%s", \ __entry->vcpu_id, \ kvm_print_exit_reason(__entry->exit_reason, __entry->isa), \ __entry->guest_rip, __entry->info1, __entry->info2, \ - __entry->intr_info, __entry->error_code) \ + __entry->intr_info, __entry->error_code, \ + __entry->requests, \ + __entry->guest_mode ? " [guest]" : "", \ + __entry->req_imm_exit ? " [imm exit]" : "") \ ) /* -- 2.26.3