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 287ECC77B7E for ; Fri, 2 Jun 2023 01:19:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233197AbjFBBT1 (ORCPT ); Thu, 1 Jun 2023 21:19:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjFBBTZ (ORCPT ); Thu, 1 Jun 2023 21:19:25 -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 0A765F2 for ; Thu, 1 Jun 2023 18:19:24 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-babb76a9831so2005785276.2 for ; Thu, 01 Jun 2023 18:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685668763; x=1688260763; h=cc:to:from:subject:message-id:mime-version:date:reply-to:from:to:cc :subject:date:message-id:reply-to; bh=7s6TXqvpanfQFBEsVN94RP/FFrdSwVeosc4TIXMzv9Q=; b=ShqUQDV+6MH+Rk0LpIY+kQhVfsZfFoxbXgXsE0YZAn3zoQIIdEJMZnCVEm3A69HGov pjbcXGNbTZRaDIbKet1Q5bpNedda4NNl0U5bh29PkmhLmGjosBvHb8Ij8aZkoMAhI1ua 1TJCCv/U30pBq70FdTDF/vxAotUG8qg7Zz+uvQe0eCKajthFwj1Pt+SVvLzm+YENaVIi eZWW0kMHD+Q75LZzWJzh50xKkr71ImnR1LXwMpz7D8NPl+PFf6yTYT0sZAVwq2TttcPq Ay12AKugOKaJhPbocv8I7RWk/w5Bt+DZJB9+uJ9DdXon4bVvqrLHY6+MigC3S9TMEL8N s+LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685668763; x=1688260763; h=cc:to:from:subject:message-id:mime-version:date:reply-to :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=7s6TXqvpanfQFBEsVN94RP/FFrdSwVeosc4TIXMzv9Q=; b=AwP07SWcaH+r9qp3K02TL/iKVYQ/HyrWzt5M08gQcJCDZ0h1EbP3lsNiobxdvd1RNR GrvIw5j+c69GsLGtQUt4z5XtevoeKABmypKn7qRr04mWyYwIC+swB1wTV2N0UT/Au8Vg gde+HgKkyUimXRqqMtlC+A3aE57lUZLhyXpfWmNMwdfWpoqvw/j2n5w6kfFO3++NKO3V 6ukxpbjvpReNjYV89phFJfQPdPmQwEq+wL/Apd+IjmV9aFkDNZ9+efL9tuJ5nvtkKSdx 9BLZYjjFHVVUsqOx0LP7wjxJCYqylJqhtTFd41MmuFCgQPjRLIzLxBF4TpiBlcT13g9L MYEg== X-Gm-Message-State: AC+VfDwASqJq3Gq6kehD9yMqHKQZOffB9ktF+h/eV9doUaBHxqzUoqf9 lzhkDOwe4ySZOSyMbdtssHYAHPFj1cE= X-Google-Smtp-Source: ACHHUZ6QCx5vcdViefzGxmDYcjizRuhzDj62nhQw5nWWSdQVLCV5Xo5iEqhfHjt3EHD8DpkjiSaGxtYW+Wo= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:161e:b0:bab:f968:ec83 with SMTP id bw30-20020a056902161e00b00babf968ec83mr670519ybb.11.1685668763335; Thu, 01 Jun 2023 18:19:23 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 1 Jun 2023 18:19:18 -0700 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.rc2.161.g9c6817b8e7-goog Message-ID: <20230602011920.787844-1-seanjc@google.com> Subject: [PATCH 0/2] KVM: x86: Fastpath accounting fixes From: Sean Christopherson To: Sean Christopherson , Paolo Bonzini Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Fix two bugs where KVM fails to account/trace exits that are handled in the super fast fastpath. SVM doesn't actually utilize the super fast fastpath, i.e. patch 1 only affects VMX and the bug fixed by patch 2 is benign in the current code base. Found by inspection, confirmed by hacking together a small selftest and manually verifying the stats via sysfs. Sean Christopherson (2): KVM: x86: Account fastpath-only VM-Exits in vCPU stats KVM: SVM: Invoke trace_kvm_exit() for fastpath VM-Exits arch/x86/kvm/svm/svm.c | 4 ++-- arch/x86/kvm/x86.c | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) base-commit: 39428f6ea9eace95011681628717062ff7f5eb5f -- 2.41.0.rc2.161.g9c6817b8e7-goog