Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp587482iob; Wed, 18 May 2022 08:36:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzSBEyBfJphQ5M2mVAvqPet+b6YJ6HUW5YeJ/bQkVgKOwsXg0wA9a3N547II4XqDFEfgMvG X-Received: by 2002:a17:90b:1a88:b0:1dc:e4a1:a81e with SMTP id ng8-20020a17090b1a8800b001dce4a1a81emr626189pjb.96.1652888201618; Wed, 18 May 2022 08:36:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652888201; cv=none; d=google.com; s=arc-20160816; b=ZAHVzL29LYnjtWby0WICBhTlBGueAedKpHQFeFu7W6MJKgY1DVbGrTB/hwuPiUEul8 pI2Z5cP6V1TojLkXtzBkqBpQDH9611N2h2n4fvNekOXNT9XmsmAaHno149SpbMw79Iy+ RQWRWCTp9AGG4ovMH216LgRGiS1UlWw80Iumdairry5uzD0o6hBl9P/lldU5Rqexczel A/12WKqroNDysFbftxukZHXwLsvzNdX2Og7+im7Pg5e9EaKTxz1GlMVEreUnYoQQoOgC AAQB55VlC9Px/wVapJY5XPczR1Wo+cKy+3s2F5CKf3UgjWhrdifGGqrJXb3JnMfBMxwy hzyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FR9qyGtEo59tSbFrJbMFBVFHC4OKA2OLIt+JMoIDPvM=; b=jrA5m2Lx8/EqFLamPRX+kQxeTW5xc2r4zOobdy3E/3m4n8PzpSiurwCtxhWqyoTmDO bEnZABxHG+HRLo8oQcXHZlo7vy7teNhlHXFKp4e6mR+Mby8422ER2NboWnIxa6Kle/T4 DnUZ6CGhAjNonF9ctvkpKenLESW4rgaS4q8keEd2RxqQgnmWxOlbkt5i6F6Ut5ceNNf+ OopSiZtM4K6l6i9tzsWLRRkYwD1LeMaCIo5sFHeRMAXXJjP3r4U7HmdUVXo3Rs8ICQwV AfcxcK2aap024dhnKhPt22fZ5nsZLkCgkZQ2q84sdrLclgNKFtS96XhYFaJNxgDKkzru X5rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RtS3h7w6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id l8-20020a17090aec0800b001df1a4f0071si6518936pjy.75.2022.05.18.08.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 08:36:41 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=RtS3h7w6; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CCFB97891D; Wed, 18 May 2022 08:34:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239441AbiERPes (ORCPT + 99 others); Wed, 18 May 2022 11:34:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239437AbiERPep (ORCPT ); Wed, 18 May 2022 11:34:45 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB8407523F for ; Wed, 18 May 2022 08:34:43 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id m1so2136058plx.3 for ; Wed, 18 May 2022 08:34:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=FR9qyGtEo59tSbFrJbMFBVFHC4OKA2OLIt+JMoIDPvM=; b=RtS3h7w6VWloSj64YgK8YxUYZKqX5IVbhO1MmjCN7A70qZVqpfOQ5786Qw2V3fGfbs OWncq6hdYddmMJ/3fDGm+d9VcRRwoGPORUnyl8GonyRs79stfm/aB9WYjYBBNT7WtF5g ohiFV9BU32FC/iyhTxUM5ImlaBnS14jdf1RkmAF7J8R3o0iXbFMsKT7Tq6Pg+JwVSrhA Y5WdbKNUMGd+640+L/r//U7KhZ4ktkMrfIf/Hry9lgq8OTicFUuwW7b98pXWzyHvLj7M eWhHL1TE14JiYXauOLvzcQQRBacVOYh8D1HEz8Y+8q67pkSCYm9ea3svHKzyMDpsV8XH +eDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=FR9qyGtEo59tSbFrJbMFBVFHC4OKA2OLIt+JMoIDPvM=; b=oSKrqM5bojIVMuZpu5n4jiJWC9iPOA5dFS7zO2BjdDI9NHJ5+qNlmR1P5uFoEZ+mzz lDm6+BFJLncKOd2cX2umscsL0OgqTwPI7Cy6lf+82LTV0VssUmdSkaUmhzQDx1/opaYa 9bEy9x9/hniadkqLrZDYaULhxxboFf4kxatoSEjgdMRqTweIB9qwyQnmeBgnY0oE16wB DBNCT1wduRiS6uKU6USePRABfXOZYpzqgla9tO4imYRzwm3QTzDqgI8mR98nDSVAmq6s 4nCQT8y17zhvfqIIJAK4gp4oyUFyQgRYuToiH1Tpp/qJrMcvLnWaBu4YZkizBRv+SYKt PJTA== X-Gm-Message-State: AOAM531XV9jVMIlpI3oSBeEGavcaxj0KYokhIR2T08UXpULSKVsMdP3s ZCiq1W+fQp0MIqpiq2YkUNZRcQ== X-Received: by 2002:a17:90a:a82:b0:1da:3763:5cf5 with SMTP id 2-20020a17090a0a8200b001da37635cf5mr81975pjw.55.1652888083156; Wed, 18 May 2022 08:34:43 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id m5-20020a17090b068500b001df99ceff43sm2888402pjz.36.2022.05.18.08.34.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 08:34:42 -0700 (PDT) Date: Wed, 18 May 2022 15:34:38 +0000 From: Sean Christopherson To: Suleiman Souhlal Cc: Wei Zhang , Sangwhan Moon , Ingo Molnar , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, Linux Kernel , Jing Zhang , David Matlack Subject: Re: [PATCH 0/2] KVM: x86: Fix incorrect VM-exit profiling Message-ID: References: <20220412195846.3692374-1-zhanwei@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 On Wed, May 18, 2022, Suleiman Souhlal wrote: > On Tue, May 17, 2022 at 4:30 AM Wei Zhang wrote: > > > > > Please don't top-post. From https://people.kernel.org/tglx/notes-about-netiquette: > > > > Ah, I didn't know this should be avoided. Thanks for the info! > > > > > My preference would be to find a more complete, KVM-specific solution. The > > > profiling stuff seems like it's a dead end, i.e. will always be flawed in some > > > way. If this cleanup didn't require a new hypercall then I wouldn't care, but > > > I don't love having to extend KVM's guest/host ABI for something that ideally > > > will become obsolete sooner than later. > > > > I also feel that adding a new hypercall is too much here. A > > KVM-specific solution is definitely better, and the eBPF based > > approach you mentioned sounds like the ultimate solution (at least for > > inspecting exit reasons). > > > > +Suleiman What do you think? The on-going work Sean described sounds > > promising, perhaps we should put this patch aside for the time being. > > I'm ok with that. > That said, the advantage of the current solution is that it already > exists and is very easy to use, by anyone, without having to write any > code. The proposed solution doesn't sound like it will be as easy. My goal/hope is to make the eBPF approach just as easy by providing/building a library of KVM eBPF programs in tools/ so that doing common things like profiling VM-Exits doesn't require reinventing the wheel. And those programs could be used (and thus implicitly tested) by KVM selftests to verify the kernel functionality.