From patchwork Sun Sep 24 12:44:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Levitsky X-Patchwork-Id: 13396946 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A639CE7A88 for ; Sun, 24 Sep 2023 12:45:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjIXMpM (ORCPT ); Sun, 24 Sep 2023 08:45:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229606AbjIXMpL (ORCPT ); Sun, 24 Sep 2023 08:45:11 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8644C103 for ; Sun, 24 Sep 2023 05:44:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695559458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=iy6m9rfrGHIez/IGJ65IvETHEu81RQinD/bp3oWQKQI=; b=ZLBobyc0/2GYxAFplHGPf1w52YDgxojFiZqTsunRqBtyQKcSgpjJ3BUmPenSk4gD0tyzg/ G2MBDxwoj+3nEUMD1SuPRyVkUydTJnLebwuXk0IiJXcdjivQZu1aegkLUUWIWvzV6/pKH3 0tC6DI50tzqRMe51jkXrGpGvar4iW6s= 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-28-uE8Jf8XMOl6CmJI0vk2k7w-1; Sun, 24 Sep 2023 08:44:15 -0400 X-MC-Unique: uE8Jf8XMOl6CmJI0vk2k7w-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 AD3AD185A78E; Sun, 24 Sep 2023 12:44:14 +0000 (UTC) Received: from localhost.localdomain (unknown [10.45.226.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id 588B840C6EA8; Sun, 24 Sep 2023 12:44:11 +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 0/4] KVM: x86: tracepoint updates Date: Sun, 24 Sep 2023 15:44:06 +0300 Message-Id: <20230924124410.897646-1-mlevitsk@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This patch series is intended to add some selected information to the kvm tracepoints to make it easier to gather insights about running nested guests. This patch series was developed together with a new x86 performance analysis tool that I developed recently (https://gitlab.com/maximlevitsky/kvmon) which aims to be a better kvm_stat, and allows you at glance to see what is happening in a VM, including nesting. Best regards, Maxim Levitsky Maxim Levitsky (4): KVM: x86: refactor req_immediate_exit logic KVM: x86: add more information to the kvm_entry tracepoint KVM: x86: add more information to kvm_exit tracepoint KVM: x86: add new nested vmexit tracepoints arch/x86/include/asm/kvm-x86-ops.h | 2 +- arch/x86/include/asm/kvm_host.h | 11 ++- arch/x86/kvm/svm/nested.c | 22 ++++++ arch/x86/kvm/svm/svm.c | 22 +++++- arch/x86/kvm/trace.h | 115 +++++++++++++++++++++++++++-- arch/x86/kvm/vmx/nested.c | 21 ++++++ arch/x86/kvm/vmx/vmx.c | 31 +++++--- arch/x86/kvm/vmx/vmx.h | 2 - arch/x86/kvm/x86.c | 34 ++++----- 9 files changed, 214 insertions(+), 46 deletions(-)