Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1744416rdh; Tue, 26 Sep 2023 02:05:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkDzTUg3N/BZjgq+nZ9HRmmBIK+LvjdO6UP7eBN5F43jy+AIyhV6AOCSqX6fEJ8tYB77Sd X-Received: by 2002:a05:6a20:1614:b0:12d:23ea:9ccc with SMTP id l20-20020a056a20161400b0012d23ea9cccmr7938574pzj.39.1695719150236; Tue, 26 Sep 2023 02:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695719150; cv=none; d=google.com; s=arc-20160816; b=I/j9S30tqrU80YOUG6oQMfcJpdy5x7WFPnHmafehtZG4CRku9/8GvQ+iZcCICZx5Gd A1oyUU8zOt+HTyJuUh7o3mmszrBcLHbcJ+NQxDYiR1z0tR7TLSLArigRE2orKDVHFbVd N9sFFORrcCD6HXWbefGjeFH9TZ0K7oqA7HYya3K+qIg2SsQI6oq5wzY6TDGWb2JUY9QB zTqtTVNIcrlci69HQf5K+nD7GuDS6kNamq/QVhq1MLPc6h3cn1c3tvKfPmxra8lBpmBt GgzRV05JezhVyPJ9OTsnBTuj4warWTsp3SVu27RKVgxWVccatUUoGyAWQ0MNw+5gQTgr chcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=5YTmwARNMOrdL0eY6PvUVfzk6lroU7KMzCpG5updMAI=; fh=qu60BKMdqWYTwIiI4YEl48aVUnKM/Gjea39oJmJP3N8=; b=nf/MV6LOY40hZQDTB3xccFA8OcA4P50IAgZq8NnyclObLALy6R1+XlltZi29CFVQ/s Qk1CcHG9dgrAG5b7MfKGgGCAqkFjRkWqbQd2xellXls9BTpxfmoI4WPBfQbCkFEqao46 58pyK3kwxipfwFfT8V6dDih7dcLbgT8iEx+VqfWgnSJ4KVQN2M9hsWpSjN36ppyIubve I0uBTtWjvJfV7EBdbDbKihmbxMnGQLMJ4eWB+rdW1ZCkiCgJg0s88ZBIXVbQYi5tweSV NzVij91TuvkxjyEjgylHjmvbg/W+BSf+00c6SrCWQRPEcYvlLHTZxt0Jz48FfTnpD8hQ vnEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=AQQRUSkV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id h8-20020a170902f54800b001c584378322si12982019plf.619.2023.09.26.02.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 02:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=AQQRUSkV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 018E180C65F0; Mon, 25 Sep 2023 17:03:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229811AbjIZADn (ORCPT + 99 others); Mon, 25 Sep 2023 20:03:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbjIZADm (ORCPT ); Mon, 25 Sep 2023 20:03:42 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A28FB for ; Mon, 25 Sep 2023 17:03:35 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d868842eda1so7052366276.0 for ; Mon, 25 Sep 2023 17:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1695686614; x=1696291414; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=5YTmwARNMOrdL0eY6PvUVfzk6lroU7KMzCpG5updMAI=; b=AQQRUSkViezKihFy3fWNfoGQEEUOwvy9p7Mk/oZoT8f2N7jqkml9velSThK2chQJo7 l1v4oG6Ek0TSXECzmfook1Q/pIGKsoSOsccrVsT2tMVj7NTYvrkRr/nqHShW7z7Mihr4 loluEL+QO6hhHVBbHjQYGSClbQ2lKnDt4A4Kc9BW9QgnXfKo4SBi/tDmQnPeIVM9/4gd cHP3rUboBkvs3bZOHZ97dWja5UXkPWmw/buorojUBBCbEHvTYAt95YpEsIfkdJcWkWSF VzKSLtVp23Fuu5D4MBid8Zf5jWGVK61sxjhKxzzs/e09i4PNpbUruLPw5Xnrvj7RvsCQ 7wVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695686614; x=1696291414; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5YTmwARNMOrdL0eY6PvUVfzk6lroU7KMzCpG5updMAI=; b=ITkApLepK+MlBMpgKy6ASJGKO4sfoMRIFphhIz/gJn3V+BxF6UmRwpPbmJiH7zaWo8 WshB3Jmm9azGKT5o9pD6Mxnj0uKMFS+qq0Jz/lI9oSCEVIcENzmZJiVP3Dc6Ux/bhRU8 cQ4+xr8sqxbDjZ8t+u1OotGelEahtKqZmOeUdR0cypFoZ46zq+5vGuyVG+xeZFF8VSZt VgP9TG2kZdPQG9YBQjMDIXACtjhwUK4OTKEzf08aTfX5Iv66/aLrg8HYukCQ9zOZWWoi yll9ucDdd0eOkxsG7TNsbiuMX+kXNp38GIF2S/X8nskfcHRhL4uS2GGve38lkNyNRi2N GRvA== X-Gm-Message-State: AOJu0YxVK+ABlnd/bgYAo6L8iERXZ+gL9xBv7tUu5ZvhSa0/3dw6qdIJ DNL1yg46hHU4ekPYypo5DBMe1kGroGE= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:161c:b0:d0e:e780:81b3 with SMTP id bw28-20020a056902161c00b00d0ee78081b3mr82351ybb.2.1695686614668; Mon, 25 Sep 2023 17:03:34 -0700 (PDT) Date: Mon, 25 Sep 2023 17:03:32 -0700 In-Reply-To: <20230924124410.897646-1-mlevitsk@redhat.com> Mime-Version: 1.0 References: <20230924124410.897646-1-mlevitsk@redhat.com> Message-ID: Subject: Re: [PATCH v2 0/4] KVM: x86: tracepoint updates From: Sean Christopherson To: Maxim Levitsky Cc: kvm@vger.kernel.org, Dave Hansen , x86@kernel.org, linux-kernel@vger.kernel.org, "H. Peter Anvin" , Paolo Bonzini , Ingo Molnar , Thomas Gleixner , Borislav Petkov Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=ham 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 (snail.vger.email [0.0.0.0]); Mon, 25 Sep 2023 17:03:41 -0700 (PDT) On Sun, Sep 24, 2023, Maxim Levitsky wrote: > 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. Rather than add more and more tracepoints, I think we should be more thoughtful about (a) where we place KVM's tracepoints and (b) giving userspace the necessary hooks to write BPF programs to extract whatever data is needed at any give time. There's simply no way we can iterate fast enough in KVM tracepoints to adapt to userspace's debug/monitoring needs. E.g. if it turns out someone wants detailed info on hypercalls that use memory or registers beyond ABCD, the new tracepoints won't help them. If all KVM tracepoints grab "struct kvm_vcpu" and force VMCS "registers" to be cached (or decached depending on one's viewpoint), then I think that'll serve 99% of usecases. E.g. the vCPU gives a BPF program kvm_vcpu, vcpu_{vmx,svm}, kvm, etc. trace_kvm_exit is good example, where despite all of the information that is captured by KVM, it's borderline worthless for CPUID and MSR exits because their interesting information is held in registers and not captured in the VMCS or VMCB. There are some on BTF type info issues that I've encountered, but I suspect that's as much a PEBKAC problem as anything.