From mboxrd@z Thu Jan 1 00:00:00 1970 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 1E00CC433EF for ; Wed, 18 May 2022 15:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239445AbiERPes (ORCPT ); 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-Google-Smtp-Source: ABdhPJzyykcy3MUxSxpp0AlR8glBuhiHrygpxmJfu0hexllbVvSOfHMABHxBTUyB4oFrQ3Vi0ZV1RA== 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: 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.