From: Paolo Bonzini <pbonzini@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>, kvm@vger.kernel.org
Cc: Sean Christopherson <seanjc@google.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
Siddharth Chandrasekaran <sidcha@amazon.de>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 00/30] KVM: x86: hyper-v: Fine-grained access check to Hyper-V hypercalls and MSRs
Date: Thu, 10 Jun 2021 17:30:22 +0200 [thread overview]
Message-ID: <71508674-e20f-f133-3aec-455936d35ff4@redhat.com> (raw)
In-Reply-To: <20210521095204.2161214-1-vkuznets@redhat.com>
On 21/05/21 11:51, Vitaly Kuznetsov wrote:
> Changes since v1:
> - Rebase to kvm/next.
>
> Original description:
>
> Currently, all implemented Hyper-V features (MSRs and hypercalls) are
> available unconditionally to all Hyper-V enabled guests. This is not
> ideal as KVM userspace may decide to provide only a subset of the
> currently implemented features to emulate an older Hyper-V version,
> to reduce attack surface,... Implement checks against guest visible
> CPUIDs for all currently implemented MSRs and hypercalls.
>
> Vitaly Kuznetsov (30):
> asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition
> KVM: x86: hyper-v: Introduce KVM_CAP_HYPERV_ENFORCE_CPUID
> KVM: x86: hyper-v: Cache guest CPUID leaves determining features
> availability
> KVM: x86: hyper-v: Prepare to check access to Hyper-V MSRs
> KVM: x86: hyper-v: Honor HV_MSR_HYPERCALL_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_VP_RUNTIME_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_TIME_REF_COUNT_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_VP_INDEX_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_RESET_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_REFERENCE_TSC_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_SYNIC_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_SYNTIMER_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_MSR_APIC_ACCESS_AVAILABLE privilege bit
> KVM: x86: hyper-v: Honor HV_ACCESS_FREQUENCY_MSRS privilege bit
> KVM: x86: hyper-v: Honor HV_ACCESS_REENLIGHTENMENT privilege bit
> KVM: x86: hyper-v: Honor HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE
> privilege bit
> KVM: x86: hyper-v: Honor HV_FEATURE_DEBUG_MSRS_AVAILABLE privilege bit
> KVM: x86: hyper-v: Inverse the default in hv_check_msr_access()
> KVM: x86: hyper-v: Honor HV_STIMER_DIRECT_MODE_AVAILABLE privilege bit
> KVM: x86: hyper-v: Prepare to check access to Hyper-V hypercalls
> KVM: x86: hyper-v: Check access to HVCALL_NOTIFY_LONG_SPIN_WAIT
> hypercall
> KVM: x86: hyper-v: Honor HV_POST_MESSAGES privilege bit
> KVM: x86: hyper-v: Honor HV_SIGNAL_EVENTS privilege bit
> KVM: x86: hyper-v: Honor HV_DEBUGGING privilege bit
> KVM: x86: hyper-v: Honor HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED bit
> KVM: x86: hyper-v: Honor HV_X64_CLUSTER_IPI_RECOMMENDED bit
> KVM: x86: hyper-v: Honor HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED bit
> KVM: selftests: move Hyper-V MSR definitions to hyperv.h
> KVM: selftests: Move evmcs.h to x86_64/
> KVM: selftests: Introduce hyperv_features test
>
> Documentation/virt/kvm/api.rst | 11 +
> arch/x86/include/asm/kvm_host.h | 9 +
> arch/x86/kvm/hyperv.c | 216 +++++-
> arch/x86/kvm/hyperv.h | 1 +
> arch/x86/kvm/x86.c | 4 +
> include/asm-generic/hyperv-tlfs.h | 1 +
> include/uapi/linux/kvm.h | 1 +
> tools/testing/selftests/kvm/.gitignore | 1 +
> tools/testing/selftests/kvm/Makefile | 1 +
> .../kvm/include/{ => x86_64}/evmcs.h | 2 +-
> .../selftests/kvm/include/x86_64/hyperv.h | 185 +++++
> .../selftests/kvm/x86_64/hyperv_clock.c | 8 +-
> .../selftests/kvm/x86_64/hyperv_features.c | 649 ++++++++++++++++++
> 13 files changed, 1071 insertions(+), 18 deletions(-)
> rename tools/testing/selftests/kvm/include/{ => x86_64}/evmcs.h (99%)
> create mode 100644 tools/testing/selftests/kvm/include/x86_64/hyperv.h
> create mode 100644 tools/testing/selftests/kvm/x86_64/hyperv_features.c
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2021-06-10 15:30 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-21 9:51 [PATCH v2 00/30] KVM: x86: hyper-v: Fine-grained access check to Hyper-V hypercalls and MSRs Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 01/30] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 02/30] KVM: x86: hyper-v: Introduce KVM_CAP_HYPERV_ENFORCE_CPUID Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 03/30] KVM: x86: hyper-v: Cache guest CPUID leaves determining features availability Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 04/30] KVM: x86: hyper-v: Prepare to check access to Hyper-V MSRs Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 05/30] KVM: x86: hyper-v: Honor HV_MSR_HYPERCALL_AVAILABLE privilege bit Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 06/30] KVM: x86: hyper-v: Honor HV_MSR_VP_RUNTIME_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 07/30] KVM: x86: hyper-v: Honor HV_MSR_TIME_REF_COUNT_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 08/30] KVM: x86: hyper-v: Honor HV_MSR_VP_INDEX_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 09/30] KVM: x86: hyper-v: Honor HV_MSR_RESET_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 10/30] KVM: x86: hyper-v: Honor HV_MSR_REFERENCE_TSC_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 11/30] KVM: x86: hyper-v: Honor HV_MSR_SYNIC_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 12/30] KVM: x86: hyper-v: Honor HV_MSR_SYNTIMER_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 13/30] KVM: x86: hyper-v: Honor HV_MSR_APIC_ACCESS_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 14/30] KVM: x86: hyper-v: Honor HV_ACCESS_FREQUENCY_MSRS " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 15/30] KVM: x86: hyper-v: Honor HV_ACCESS_REENLIGHTENMENT " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 16/30] KVM: x86: hyper-v: Honor HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 17/30] KVM: x86: hyper-v: Honor HV_FEATURE_DEBUG_MSRS_AVAILABLE " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 18/30] KVM: x86: hyper-v: Inverse the default in hv_check_msr_access() Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 19/30] KVM: x86: hyper-v: Honor HV_STIMER_DIRECT_MODE_AVAILABLE privilege bit Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 20/30] KVM: x86: hyper-v: Prepare to check access to Hyper-V hypercalls Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 21/30] KVM: x86: hyper-v: Check access to HVCALL_NOTIFY_LONG_SPIN_WAIT hypercall Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 22/30] KVM: x86: hyper-v: Honor HV_POST_MESSAGES privilege bit Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 23/30] KVM: x86: hyper-v: Honor HV_SIGNAL_EVENTS " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 24/30] KVM: x86: hyper-v: Honor HV_DEBUGGING " Vitaly Kuznetsov
2021-05-21 9:51 ` [PATCH v2 25/30] KVM: x86: hyper-v: Honor HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED bit Vitaly Kuznetsov
2021-05-21 9:52 ` [PATCH v2 26/30] KVM: x86: hyper-v: Honor HV_X64_CLUSTER_IPI_RECOMMENDED bit Vitaly Kuznetsov
2021-05-21 9:52 ` [PATCH v2 27/30] KVM: x86: hyper-v: Honor HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED bit Vitaly Kuznetsov
2021-05-21 9:52 ` [PATCH v2 28/30] KVM: selftests: move Hyper-V MSR definitions to hyperv.h Vitaly Kuznetsov
2021-05-21 9:52 ` [PATCH v2 29/30] KVM: selftests: Move evmcs.h to x86_64/ Vitaly Kuznetsov
2021-05-21 9:52 ` [PATCH v2 30/30] KVM: selftests: Introduce hyperv_features test Vitaly Kuznetsov
2021-06-10 15:30 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=71508674-e20f-f133-3aec-455936d35ff4@redhat.com \
--to=pbonzini@redhat.com \
--cc=jmattson@google.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=seanjc@google.com \
--cc=sidcha@amazon.de \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).