Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1821539rdh; Tue, 26 Sep 2023 04:51:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4EaBGuuI4uiNNR4T/WwrExIWAnsoNYbO/BpULVqx8Y/P+dBLy6Fur779PSsgT5rlRlmAJ X-Received: by 2002:a05:6808:190b:b0:3ae:2924:8748 with SMTP id bf11-20020a056808190b00b003ae29248748mr16004354oib.53.1695729097609; Tue, 26 Sep 2023 04:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695729097; cv=none; d=google.com; s=arc-20160816; b=mCVjrwx4fTaUjMiQdJND2VKdMPHX6Lz+JBl8E32vv4UH/aBi5qdc0bZka7Ln7ymlvC k2XmDIEu6az8IM5w6oTkKBTD2vLySCBdS6Z3hIwihuGG0eR+s2iuUveBKGUFZBB6yadR opz64WVjq0bM/LPH9HWLaE6/amA5qxR8cpgI4LLqrvijU/pm8tpsek2GPdi+ZetEIB6m bzDvVcn5NF6L/J1YeHr9VzMsxG2NpMdbPHo3svw0QR7q4Odt94eLgsWwE3S5gQCRwY8J J5uIMBYevKQMXY74Gfhg3Hmypu6tyP+X38TV6FEwyz6lAMUZCSEFl6cp6gMZPOBMKyJW 5+qA== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=BDGMuzc+Ph0H26Zmokb7by0M5wtPKpu7VqpmaaH1U6E=; fh=CI6J8Twi/EG9Zttr15Mh59h6dO5gy/iUSnaqZQ5OhhA=; b=ZSVDG5Qg2w/L/PeJsHzQjMOcZHRguNEyyM5Mr7CZnE3QH+ZfKCSV2+YuiugYf8vmOZ M+0mml5Pkjyx8EOxmEdtud94mBUr5LXJcaCnjtxcNrdTsyZLNI8xvkU/GpFMQR0sGuq0 KjtmzH6YLuI2RfjlK9UBmMvvGxWIp26jUMHFQKnXLkzywkfEjG1jzHgW+gFIHzRHXvFS 5aYFcmSXcp6XhZEPjF428fFB2vfF0+dDGG2W7EKvKC+FE1YJwAK25Gy9a7M8oYTfMdi1 YjZDFp/arpfhIgmUZg9iWbWDzyIr7sPsGawcQh3xlrQqaZpqhevWOCpP2/6ljg7t/cwV ElcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dRvO65Hm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s200-20020a632cd1000000b0056fad9586d2si12077540pgs.429.2023.09.26.04.51.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 04:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dRvO65Hm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 7FAD881A7BCB; Tue, 26 Sep 2023 01:29:28 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233848AbjIZI32 (ORCPT + 99 others); Tue, 26 Sep 2023 04:29:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbjIZI31 (ORCPT ); Tue, 26 Sep 2023 04:29:27 -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 445C1B4 for ; Tue, 26 Sep 2023 01:28:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695716920; 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: in-reply-to:in-reply-to:references:references; bh=BDGMuzc+Ph0H26Zmokb7by0M5wtPKpu7VqpmaaH1U6E=; b=dRvO65Hm6NKk94mtdPiI1Kh+ay2Ka4Ck8+kTQVY/NRSh45dHRJ5DhGAjsfMF7TfexnPMlA b1j2H7ttYF+z/hkjnp5dYR0bKEw83cYOT8H3CjUACDqc7WsrhjbuE3ft3cJ77hri+v49go 3K33nju/zDbylHxjG7wKymaj4qf1zv4= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-52-kH42RRsBNdWN6GRUj7Y6RA-1; Tue, 26 Sep 2023 04:28:38 -0400 X-MC-Unique: kH42RRsBNdWN6GRUj7Y6RA-1 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-532eb7faea1so6476195a12.2 for ; Tue, 26 Sep 2023 01:28:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695716917; x=1696321717; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BDGMuzc+Ph0H26Zmokb7by0M5wtPKpu7VqpmaaH1U6E=; b=d1G28Y7iaheA3OvEXUDVdWCoe5jd4p5VQuUH9fpmolO3SgdqiUsyzrA2xtLBmURm3E AHMRJiiZNpIwXRv72tcyew5Z2E28InKnD059/Xho0fDKTt5Hmy9WDD2tHfzUQKcoA8Gk +rBUjOsbnfV/JXkRXMjYUfgBF18/0IDON/AN9YGblxOtN84rOe3LBtwkrQ6+MCWiKe06 ay1NrGJwQtPWWCoDwBTdXoDkXVWofzitk17NOSEoWD8Zq/VUrAZG+gT8XoICInHAom5/ yQl6G01PellTMQP7j9VDLjBIaL7TRAGndzk9Ip3/5KpT9hLUXXmQmHjeHMfHZ3Vmq8Mt QSyA== X-Gm-Message-State: AOJu0YxOH/u+QIVkgMt/HsfY3hcjHzldvg6+zwfb1+TVX+nDoPStn+12 IDJ/rA4MhR5+fGTTWwaP+L1P5iaokmt7rnG8dqeN3plk5JiQcnYzy2EJY2+h+CrF5ebwpPyFuXG EEh3/69IrqATFBzCEEINAjClj X-Received: by 2002:aa7:df0a:0:b0:530:df47:f172 with SMTP id c10-20020aa7df0a000000b00530df47f172mr7552037edy.15.1695716917860; Tue, 26 Sep 2023 01:28:37 -0700 (PDT) X-Received: by 2002:aa7:df0a:0:b0:530:df47:f172 with SMTP id c10-20020aa7df0a000000b00530df47f172mr7552030edy.15.1695716917532; Tue, 26 Sep 2023 01:28:37 -0700 (PDT) Received: from starship ([89.237.96.178]) by smtp.gmail.com with ESMTPSA id l21-20020a056402125500b0053315f0d510sm6549327edw.76.2023.09.26.01.28.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 01:28:37 -0700 (PDT) Message-ID: Subject: Re: [PATCH v2 0/4] KVM: x86: tracepoint updates From: Maxim Levitsky To: Sean Christopherson 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 Date: Tue, 26 Sep 2023 11:28:35 +0300 In-Reply-To: References: <20230924124410.897646-1-mlevitsk@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email 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 (pete.vger.email [0.0.0.0]); Tue, 26 Sep 2023 01:29:28 -0700 (PDT) У пн, 2023-09-25 у 17:03 -0700, Sean Christopherson пише: > 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. > While eBPF has its use cases, none of the extra tracepoints were added solely because of the monitoring tool and I do understand that tracepoints are a limited resource. Each added tracepoint/info was added only when it was also found to be useful for regular kvm tracing. Best regards, Maxim Levitsky