Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp198973lfo; Tue, 17 May 2022 22:12:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLGJfXdplH5R3jdiuGiEdbIUQlCerdTnqrLNnweiWG0Ht81mrGgHv3D64izBz0eKNB+Nz9 X-Received: by 2002:a65:6b95:0:b0:3f2:638f:db1d with SMTP id d21-20020a656b95000000b003f2638fdb1dmr13029883pgw.604.1652850768968; Tue, 17 May 2022 22:12:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652850768; cv=none; d=google.com; s=arc-20160816; b=qFy7y/S596ULpYV5sebBwgxFtz+bb8WZpZX1ubjIOU9PP8gtOH1TUOT05g90fz5hQD DbroILF5aozoIYxRHC4z1ZrBG0ILplTQ3m2oVAAFQrG3Yr5mVaM1sp/Pdt1Qnh+B9RSL 5NDyKGyB7wtOJojONby40BOdD751tKNPm06uS+vMiW5uQ8w+29Ks7tuAGgByweJh+DIH ZYliP6E2STqAEhObyTOTcB/lE5MNQM6Sa+6wRKup6aAbTmEvHdJWY8j7ukzlCiBilqJv MdhmwoXy3JVQSqFj/ZMZrMyZnQQFQkapNI0BckipDMAv+xJvEsJ5wPzF3rECR4FvHZZV nbuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=fN13pJNCQ7oz0V1a6VyLZjsh0STVPMddJluiS+KeExg=; b=bpSQ5e+rnD7N6wHKLP40OPXmlWA985Atgp/sz+ZfNd02dMBeSaT73/3lwAc842o29M Blvzy1E3bbOvG2KiI4HK+FFdDygNrBRh0y/1H9z6K3/iQVB1NaB+BgXuTO3tREuqHgIl Mm+EDLohHkO15F/Xrq8vYgfmuxvXJsr9+0Nu7p8TC0xEP1oG6NZkti5wB5NSIg0OOnF/ 9JArQNGevPC6DbSjfPUusTgVMczNTkKFiF/Kfd15/fCIMV8aHfTmHJ04vaQ7sis0HT3Y Bgke5TTyaMoJU5+QM/Nh5+mCh//r/6J4lHop5Jlha6naATrxP6JHbFUAQ4uDwfZXq/ij 85eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WlCChO47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o15-20020a056a0015cf00b005180bf342a1si1850770pfu.180.2022.05.17.22.12.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 May 2022 22:12:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=WlCChO47; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 0C4A933EB8; Tue, 17 May 2022 21:28:05 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbiERE1r (ORCPT + 99 others); Wed, 18 May 2022 00:27:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229894AbiERE1q (ORCPT ); Wed, 18 May 2022 00:27:46 -0400 Received: from mail-vs1-xe2a.google.com (mail-vs1-xe2a.google.com [IPv6:2607:f8b0:4864:20::e2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8B6D33E05 for ; Tue, 17 May 2022 21:27:43 -0700 (PDT) Received: by mail-vs1-xe2a.google.com with SMTP id c26so817171vsl.6 for ; Tue, 17 May 2022 21:27:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fN13pJNCQ7oz0V1a6VyLZjsh0STVPMddJluiS+KeExg=; b=WlCChO47c3vDXVCIaGjEVf7IsHZmcxFElzELAX1bTuklI1SJiAii02Y+KhlrHFYMcA l0FGFrztHSYpPDGyy8kQ0dO9s3cgF74xrLRcYkXkB5ZXX/jTXS7V/UDH7LpMNoDMUPVD +IVOB9LKz5YDLy8a4J3vZUgYFMrDyjbzf5KnnkUX+cIiOSx8TN2bGVFRqcPlaI5YU8/G rkJe32cp1+sc8NasjculNggoEIyDRikxGBiYx74LLl/kly1+2tWIx7radm01VM8Yst9i HbZ55rTzMDRwqwJ78PMAr5E01gN87P8l+IR8Ie0RqJTnApjh0O4Tqm+p/NhW4DmQnqos BTTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fN13pJNCQ7oz0V1a6VyLZjsh0STVPMddJluiS+KeExg=; b=ZqC3VhDRnoO8ZnMFPAKaZoPJpXKOE1/fCCNrWymnuTJmJ/Fa7ijlfCECPIO42qPz3I /s22lrBBsn40W7PmZw4CgY6KZ1WxeUAflsCG29UNLSr0EzkZ3MCB93Otl3eLsvxSc+ld 8aX+D/GYoAlF/fuPKNg3BjB9M3TaR2q4EMm4fUqWKerfYhabGxtF0efcb3OuBbNln8Em 7iUtzqvJEIrQpoNszK2XKJOM9PTZ6qLaB8AEI4JTIBfG35yvrMUEYHQY7RhWtRFAZvjm /6+QrPezZy5Z0GgJCIJ2c0eeAzI/Wt3te1W30l61eyvlWSruQZBTl4A/6/k6sUGNE6nW iahw== X-Gm-Message-State: AOAM531mHdGwrP4tPnhHjJcjVhHL6+jZu+P8TnTpPemMj7ineXbbb6XF TzQrxWg9rRa8t9594NHA85hCohwrd0z4sLjM8L4onQ== X-Received: by 2002:a67:db95:0:b0:335:cd7c:6e9 with SMTP id f21-20020a67db95000000b00335cd7c06e9mr1726746vsk.41.1652848062686; Tue, 17 May 2022 21:27:42 -0700 (PDT) MIME-Version: 1.0 References: <20220412195846.3692374-1-zhanwei@google.com> In-Reply-To: From: Suleiman Souhlal Date: Wed, 18 May 2022 13:27:30 +0900 Message-ID: Subject: Re: [PATCH 0/2] KVM: x86: Fix incorrect VM-exit profiling To: Wei Zhang Cc: Sean Christopherson , Sangwhan Moon , Ingo Molnar , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, Linux Kernel , Jing Zhang , David Matlack Content-Type: text/plain; charset="UTF-8" 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 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. Regarding the earlier question about wanting to know which instructions trigger exits, most times I've needed to get exit profiles, I actually wanted to know where the guest was at the time of the exit, regardless of who triggered the exit. -- Suleiman