Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp456651lql; Mon, 11 Mar 2024 07:41:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXes327SAIKaa/Kf5IEGr2hp/4O+jKfmMKvQflUTy/s686OQAwx/jihsNMpfwLQx1RpQxRPuBnSnwAgREcBbRhLdZP98MT87m6J0l8ugg== X-Google-Smtp-Source: AGHT+IFCg7IFCcSl6ooCOO4/tg2MXVB84weRJird+F+fGuVsKBxMZ8mw7muvEMbL8EZX3h4dMpnQ X-Received: by 2002:a05:622a:613:b0:42e:e02c:aa52 with SMTP id z19-20020a05622a061300b0042ee02caa52mr12426030qta.2.1710168118651; Mon, 11 Mar 2024 07:41:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710168118; cv=pass; d=google.com; s=arc-20160816; b=BFR9tZfzjyID/05JgP8tKBOiXyp+pV6VwK8tCDHzrLgga7HRDYMShx/jwRU5VE8i9H czvCkJJREBdu6tKJSOVpABskoGAYF2Aa6JtuSmFZUeJ3Q9dw/RTLen22JHyVNYrlIANe k4/QFntBKmv6wKntslAdy+xYTyV3MtKpOoz2HE7khC9UN8iaQRmFb719Ur+76sDoLDSK O+DnwLw6BBU9aJ8/Vquvv7uYaBAObLaF0cpo3FQx+S39axatJhri+yzx17JaSNHSjlMn ql5husqp5QLLAuJ3MgDH/7s2dHQRy+VEZg2qu6m5zL7aeWYXrRLbdTAMphGlFHyZAspK 9SAQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=1Ln6DMStTH/dqt1H0TtHk7/u1gLfSe+VO2DEgx5urmQ=; fh=k/AkHp5z7EP/btlFNjn1XLLGGEyaNKApPE3wLmkQU9Y=; b=CSvEo1nD+5nRp9/UG6N2oe9x/2miZQBkgvYRvQC4arS8rzt1kb5N+udTXJ+UEGJNYv NrNWJUSPS9YX5Y23q6X0Z0ViUepsmJih5C190V2oewRWASgvj3y30oTaIr8YRe1uz5Mx OKOhrXAmAsyGKG7oB581tn0/fowK8eXUsbHqzg53xxFcOcsmxkb8zhMDnZwp7Maz2JEU rckksQlB2fKDI76dG7WfB3XNPivzCu3Ar+eaR6fmQzVawHooiv8Zz93FVoimmAUT3pCL dIKZjl5IQFKJrHZUVusUFFqS/3ptXNwVatz1hhN41H9TbPLLEG27qArNQuhG8UH7SOqo HwEw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Udbj26mp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id bp30-20020a05620a459e00b007884370840esi5903767qkb.256.2024.03.11.07.41.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Mar 2024 07:41:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Udbj26mp; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-98980-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98980-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 634981C22012 for ; Mon, 11 Mar 2024 14:41:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B56264087D; Mon, 11 Mar 2024 14:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Udbj26mp" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D8C33FBAD for ; Mon, 11 Mar 2024 14:41:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710168069; cv=none; b=J+8QV26rm6OC3mJhy25NKn5wSDHhJ9sDIG0ZbvC9Zdp8T4lw5sejJw0GAD1wLB5vRHi9cEPbLy77ABCtDAMOi4XNDopiZ+p4mH+mIuZrA5qHxyD9DxT6GpIHmw+gTu6WUFwV8Uux3twdwQ2Lu1eDRbLi/UQFE6Brk5Rf4BFXENg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710168069; c=relaxed/simple; bh=yucr9s/lBBGdWtlJzYXkiwRLHLQBsa6ElDX2Jb0ofJs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=P9dW7vGO4A7eDj+EEbQybUZ1ULii+egsw2mUQWJW/CfHUwbnsr7DXCS3MANrVb00Mc3F4NMYaytiFn2UjGRKQqBWDUMfn/YCQQGQIpAbfGtWoyIJsRwHrb6x5mM3A/B5qziBDA1h8D3pM+cCwztpDaBFWN8EatRse31WwEvCBvY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Udbj26mp; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710168066; 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:autocrypt:autocrypt; bh=1Ln6DMStTH/dqt1H0TtHk7/u1gLfSe+VO2DEgx5urmQ=; b=Udbj26mpOt8rXUJzRfXjbiaz1wM26TjJP3+9kQC1D4UGBjhF/BiRZq66ejZDnV8MY0RYzb tObHARLDrQKpnWM8Q+krJKp0WxiL2J0rroDnAxJ7ThIF+4Q2zwHLTjIfoVizrKT8IxPPQT rYi5bQQ8VejkuDkDGb56wfoKcCx52kg= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-630-aQd2lRzbP6K2hqPjnfNaDQ-1; Mon, 11 Mar 2024 10:41:03 -0400 X-MC-Unique: aQd2lRzbP6K2hqPjnfNaDQ-1 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-a46309731b9so39390166b.1 for ; Mon, 11 Mar 2024 07:41:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710168062; x=1710772862; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1Ln6DMStTH/dqt1H0TtHk7/u1gLfSe+VO2DEgx5urmQ=; b=eujwgc+ANW9UQmoYRgrl4ZzI6wOlpklSitk9fyk7fLy4SLEQBx9j+nzioVk3gLs2yB TuYTOIXw4ZmGJJ8ByvS/7pKH77AtkJ3OCPOisHsspLVRF0elEoISabKgGZAROzgVD0RY rud0uV7ioVLuDcmxmHftEzohyldZdb/korG1/kAPetyuxb2lomgUBLjowOI0nRnUYk3v EMUFdzS1cYRo2QxRq8/GbmtJUqtRWAgKFVHEUOvDA0q3Fj++4Iz4tXTL8PX73stL9eJB 7b0h2frTh19ZJEOZuiMfwvuwgb8c7Zu+4T0J9xPqBgDUnP3phI6QxD2q5iWUhqC9vP8Z UqSw== X-Forwarded-Encrypted: i=1; AJvYcCWTqFx5f7Z9wDNXDOTYqxkWdX9cd0tPz7RfzGTlcnkAV9YTgu3L2I7nifYFlfdWoiUrcLeOlX6M5o+CnL5ahRc19GUKc/5aTxJi0+aN X-Gm-Message-State: AOJu0YwMP1Fk8i16u05eTdrmiNSYBbpiwy6SUv0BtatcP/UpxtTH6vBr iT7s4KbFXph+9cVzeTQ/M/sRLkGD4x51uKwBDVgZz5XUNbgyol/Ky9jPfDHddPbalou2IDdbSAh ZyxoXSInnMZdcenr6DYDSBsEwLoWtTxtzo52Vt68i2LIKxjrDRWz7x8ec7rdn1w== X-Received: by 2002:a17:907:a08f:b0:a46:130a:468 with SMTP id hu15-20020a170907a08f00b00a46130a0468mr5144859ejc.13.1710168062195; Mon, 11 Mar 2024 07:41:02 -0700 (PDT) X-Received: by 2002:a17:907:a08f:b0:a46:130a:468 with SMTP id hu15-20020a170907a08f00b00a46130a0468mr5144824ejc.13.1710168061842; Mon, 11 Mar 2024 07:41:01 -0700 (PDT) Received: from [192.168.10.81] ([151.49.77.21]) by smtp.googlemail.com with ESMTPSA id t25-20020a1709063e5900b00a45c8c9a876sm2911741eji.88.2024.03.11.07.41.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Mar 2024 07:41:00 -0700 (PDT) Message-ID: <3d9fcdfd-dbc7-409a-bc1c-c1b8f601ace9@redhat.com> Date: Mon, 11 Mar 2024 15:40:59 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [GIT PULL] KVM: x86: PMU changes for 6.9 Content-Language: en-US To: Sean Christopherson Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240308223702.1350851-1-seanjc@google.com> <20240308223702.1350851-6-seanjc@google.com> From: Paolo Bonzini Autocrypt: addr=pbonzini@redhat.com; keydata= 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 In-Reply-To: <20240308223702.1350851-6-seanjc@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 3/8/24 23:36, Sean Christopherson wrote: > Lots of PMU fixes and cleanups, along with related selftests. The most notable > fix is to *not* disallow the use of fixed counters and event encodings just > because the CPU doesn't report support for the matching architectural event > encoding. > > Note, the selftests changes have several annoying conflicts with "the" selftests > pull request that you'll also receive from me. I recommend merging that one > first, as I found it slightly easier to resolve the conflicts in that order. > > P.S. I expect to send another PMU related pull request of 3-4 fixes at some > point during the merge window. But they're all small and urgent (if we had a > few more weeks for 6.8, I'd have tried to squeeze them into 6.8). > > The following changes since commit 41bccc98fb7931d63d03f326a746ac4d429c1dd3: > > Linux 6.8-rc2 (2024-01-28 17:01:12 -0800) > > are available in the Git repository at: > > https://github.com/kvm-x86/linux.git tags/kvm-x86-pmu-6.9 > > for you to fetch changes up to 812d432373f629eb8d6cb696ea6804fca1534efa: > > KVM: x86/pmu: Explicitly check NMI from guest to reducee false positives (2024-02-26 15:57:22 -0800) Pulled, thanks. Paolo > ---------------------------------------------------------------- > KVM x86 PMU changes for 6.9: > > - Fix several bugs where KVM speciously prevents the guest from utilizing > fixed counters and architectural event encodings based on whether or not > guest CPUID reports support for the _architectural_ encoding. > > - Fix a variety of bugs in KVM's emulation of RDPMC, e.g. for "fast" reads, > priority of VMX interception vs #GP, PMC types in architectural PMUs, etc. > > - Add a selftest to verify KVM correctly emulates RDMPC, counter availability, > and a variety of other PMC-related behaviors that depend on guest CPUID, > i.e. are difficult to validate via KVM-Unit-Tests. > > - Zero out PMU metadata on AMD if the virtual PMU is disabled to avoid wasting > cycles, e.g. when checking if a PMC event needs to be synthesized when > skipping an instruction. > > - Optimize triggering of emulated events, e.g. for "count instructions" events > when skipping an instruction, which yields a ~10% performance improvement in > VM-Exit microbenchmarks when a vPMU is exposed to the guest. > > - Tighten the check for "PMI in guest" to reduce false positives if an NMI > arrives in the host while KVM is handling an IRQ VM-Exit. > > ---------------------------------------------------------------- > Dapeng Mi (1): > KVM: selftests: Test top-down slots event in x86's pmu_counters_test > > Jinrong Liang (7): > KVM: selftests: Add vcpu_set_cpuid_property() to set properties > KVM: selftests: Add pmu.h and lib/pmu.c for common PMU assets > KVM: selftests: Test Intel PMU architectural events on gp counters > KVM: selftests: Test Intel PMU architectural events on fixed counters > KVM: selftests: Test consistency of CPUID with num of gp counters > KVM: selftests: Test consistency of CPUID with num of fixed counters > KVM: selftests: Add functional test for Intel's fixed PMU counters > > Like Xu (1): > KVM: x86/pmu: Explicitly check NMI from guest to reducee false positives > > Sean Christopherson (32): > KVM: x86/pmu: Always treat Fixed counters as available when supported > KVM: x86/pmu: Allow programming events that match unsupported arch events > KVM: x86/pmu: Remove KVM's enumeration of Intel's architectural encodings > KVM: x86/pmu: Setup fixed counters' eventsel during PMU initialization > KVM: x86/pmu: Get eventsel for fixed counters from perf > KVM: x86/pmu: Don't ignore bits 31:30 for RDPMC index on AMD > KVM: x86/pmu: Prioritize VMX interception over #GP on RDPMC due to bad index > KVM: x86/pmu: Apply "fast" RDPMC only to Intel PMUs > KVM: x86/pmu: Disallow "fast" RDPMC for architectural Intel PMUs > KVM: x86/pmu: Treat "fixed" PMU type in RDPMC as index as a value, not flag > KVM: x86/pmu: Explicitly check for RDPMC of unsupported Intel PMC types > KVM: selftests: Drop the "name" param from KVM_X86_PMU_FEATURE() > KVM: selftests: Extend {kvm,this}_pmu_has() to support fixed counters > KVM: selftests: Expand PMU counters test to verify LLC events > KVM: selftests: Add a helper to query if the PMU module param is enabled > KVM: selftests: Add helpers to read integer module params > KVM: selftests: Query module param to detect FEP in MSR filtering test > KVM: selftests: Move KVM_FEP macro into common library header > KVM: selftests: Test PMC virtualization with forced emulation > KVM: selftests: Add a forced emulation variation of KVM_ASM_SAFE() > KVM: selftests: Add helpers for safe and safe+forced RDMSR, RDPMC, and XGETBV > KVM: selftests: Extend PMU counters test to validate RDPMC after WRMSR > KVM: x86/pmu: Zero out PMU metadata on AMD if PMU is disabled > KVM: x86/pmu: Add common define to capture fixed counters offset > KVM: x86/pmu: Move pmc_idx => pmc translation helper to common code > KVM: x86/pmu: Snapshot and clear reprogramming bitmap before reprogramming > KVM: x86/pmu: Add macros to iterate over all PMCs given a bitmap > KVM: x86/pmu: Process only enabled PMCs when emulating events in software > KVM: x86/pmu: Snapshot event selectors that KVM emulates in software > KVM: x86/pmu: Expand the comment about what bits are check emulating events > KVM: x86/pmu: Check eventsel first when emulating (branch) insns retired > KVM: x86/pmu: Avoid CPL lookup if PMC enabline for USER and KERNEL is the same > > arch/x86/include/asm/kvm-x86-pmu-ops.h | 4 +- > arch/x86/include/asm/kvm_host.h | 11 +- > arch/x86/kvm/emulate.c | 2 +- > arch/x86/kvm/kvm_emulate.h | 2 +- > arch/x86/kvm/pmu.c | 163 ++++-- > arch/x86/kvm/pmu.h | 57 +- > arch/x86/kvm/svm/pmu.c | 22 +- > arch/x86/kvm/vmx/nested.c | 2 +- > arch/x86/kvm/vmx/pmu_intel.c | 222 +++----- > arch/x86/kvm/x86.c | 15 +- > arch/x86/kvm/x86.h | 6 - > tools/testing/selftests/kvm/Makefile | 2 + > .../testing/selftests/kvm/include/kvm_util_base.h | 4 + > tools/testing/selftests/kvm/include/x86_64/pmu.h | 97 ++++ > .../selftests/kvm/include/x86_64/processor.h | 148 +++-- > tools/testing/selftests/kvm/lib/kvm_util.c | 62 ++- > tools/testing/selftests/kvm/lib/x86_64/pmu.c | 31 ++ > tools/testing/selftests/kvm/lib/x86_64/processor.c | 15 +- > .../selftests/kvm/x86_64/pmu_counters_test.c | 620 +++++++++++++++++++++ > .../selftests/kvm/x86_64/pmu_event_filter_test.c | 143 ++--- > .../kvm/x86_64/smaller_maxphyaddr_emulation_test.c | 2 +- > .../selftests/kvm/x86_64/userspace_msr_exit_test.c | 29 +- > .../selftests/kvm/x86_64/vmx_pmu_caps_test.c | 2 +- > 23 files changed, 1262 insertions(+), 399 deletions(-) > create mode 100644 tools/testing/selftests/kvm/include/x86_64/pmu.h > create mode 100644 tools/testing/selftests/kvm/lib/x86_64/pmu.c > create mode 100644 tools/testing/selftests/kvm/x86_64/pmu_counters_test.c >