, we can add it back later once the
> license is cleared up.
>
> Reported-by: Prarit Bhargava
> Cc: Christoph Hellwig
> Cc: Vitaly Kuznetsov
FWIW,
Reviewed-by: Vitaly Kuznetsov
> Cc: jsch...@samba.org
> Signed-off-by: Greg Kroah-Hartman
> ---
> .../device_dr
Saurabh Sengar writes:
> For non VTL platforms vtl is always 0, and there is no need of
> get_vtl function. For VTL platforms get_vtl should always succeed
> and should return the correct VTL.
>
> Signed-off-by: Saurabh Sengar
> ---
> arch/x86/hyperv/hv_init.c | 8 +---
> 1 file changed, 5
Vineeth Pillai writes:
> On 4/16/2021 4:36 AM, Vitaly Kuznetsov wrote:
>>
>>> struct kvm_vm_stat {
>>> diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
>>> index 58fa8c029867..614b4448a028 100644
>>> --- a/arch/x86/kvm/hyperv.c
>
UNLOAD_MSG_LOOPS))
> + pr_notice("Waiting for VMBus UNLOAD to complete\n");
> +
> + mdelay(UNLOAD_DELAY_UNIT_MS);
> }
> + pr_err("Continuing even though VMBus UNLOAD did not complete\n");
>
> +completed:
> /*
>* We're crashing and already got the UNLOAD_RESPONSE, cleanup all
>* maybe-pending messages on all CPUs to be able to receive new
This is definitely an improvement,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4, HV_X64_MSR_CRASH_CTL are only
available to guest when HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE bit is
exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch
These defines can be shared by multiple tests, move them to a dedicated
header.
Signed-off-by: Vitaly Kuznetsov
---
.../selftests/kvm/include/x86_64/hyperv.h | 19 +++
.../selftests/kvm/x86_64/hyperv_clock.c | 8 +---
2 files changed, 20 insertions(+), 7 deletions
evmcs.h is x86_64 only thing, move it to x86_64/ subdirectory.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/include/{ => x86_64}/evmcs.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
rename tools/testing/selftests/kvm/include/{ => x86_64}/evmcs.h (99%)
diff
The initial implementation of the test only tests that access to Hyper-V
MSRs and hypercalls is in compliance with guest visible CPUID feature bits.
Signed-off-by: Vitaly Kuznetsov
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/Makefile | 1
Hypercalls which use extended processor masks are only available when
HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED privilege bit is exposed (and
'RECOMMENDED' is rather a misnomer).
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 8
1 file changed, 8 insertions(+)
diff --git
Hyper-V partition must possess 'HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED'
privilege ('recommended' is rather a misnomer) to issue
HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST/SPACE hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 6 ++
1 file changed, 6 insertions(+)
diff --git
Hyper-V partition must possess 'HV_X64_CLUSTER_IPI_RECOMMENDED'
privilege ('recommended' is rather a misnomer) to issue
HVCALL_SEND_IPI hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86
will
be HV_STATUS_INVALID_HYPERCALL_CODE and not HV_STATUS_ACCESS_DENIED.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 523f63287636..36ec688cda4e 100644
--- a/arch/x86/kvm/hyperv.c
+++ b
lures. 0x indicates never notify." Use this to check access to
the hypercall. Also, check against zero as the corresponding CPUID must
be set (and '0' attempts before re-try is weird anyway).
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 11 +++
1 file changed, 11
Hyper-V partition must possess 'HV_POST_MESSAGES' privilege to issue
HVCALL_POST_MESSAGE hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index bd424f2d4294..ff86c00d1396
Hyper-V partition must possess 'HV_SIGNAL_EVENTS' privilege to issue
HVCALL_SIGNAL_EVENT hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index ff86c00d1396..523f63287636
Introduce hv_check_hypercallr_access() to check if the particular hypercall
should be available to guest, this will be used with
KVM_CAP_HYPERV_ENFORCE_CPUID mode.
No functional change intended.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 11 +++
1 file changed, 11
Synthetic timers can only be configured in 'direct' mode when
HV_STIMER_DIRECT_MODE_AVAILABLE bit was exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index ec065177531b
-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 43ebb53b6b38..f54385ffcdc0 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -1257,6 +1257,10 @@ static bool hv_check_msr_access
Access to all MSRs is now properly checked. To avoid 'forgetting' to
properly check access to new MSRs in the future change the default
to 'false' meaning 'no access'.
No functional change intended.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 2 +-
1 file changed, 1 insertion
HV_X64_MSR_REENLIGHTENMENT_CONTROL/HV_X64_MSR_TSC_EMULATION_CONTROL/
HV_X64_MSR_TSC_EMULATION_STATUS are only available to guest when
HV_ACCESS_REENLIGHTENMENT bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch
HV_X64_MSR_TSC_FREQUENCY/HV_X64_MSR_APIC_FREQUENCY are only available to
guest when HV_ACCESS_FREQUENCY_MSRS bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1 file changed, 4 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index
Synthetic timers MSRs (HV_X64_MSR_STIMER[0-3]_CONFIG,
HV_X64_MSR_STIMER[0-3]_COUNT) are only available to guest when
HV_MSR_SYNTIMER_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/arch/x86/kvm
HV_X64_MSR_EOI, HV_X64_MSR_ICR, HV_X64_MSR_TPR, and
HV_X64_MSR_VP_ASSIST_PAGE are only available to guest when
HV_MSR_APIC_ACCESS_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c
SynIC MSRs (HV_X64_MSR_SCONTROL, HV_X64_MSR_SVERSION, HV_X64_MSR_SIEFP,
HV_X64_MSR_SIMP, HV_X64_MSR_EOM, HV_X64_MSR_SINT0 ... HV_X64_MSR_SINT15)
are only available to guest when HV_MSR_SYNIC_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 8
1 file
HV_X64_MSR_REFERENCE_TSC is only available to guest when
HV_MSR_REFERENCE_TSC_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index affc6e0cda09..be6156a27bd7
HV_X64_MSR_TIME_REF_COUNT is only available to guest when
HV_MSR_TIME_REF_COUNT_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 152d991ed033
HV_X64_MSR_RESET is only available to guest when HV_MSR_RESET_AVAILABLE bit
is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 0f3f30f6ca69..affc6e0cda09 100644
HV_X64_MSR_VP_INDEX is only available to guest when
HV_MSR_VP_INDEX_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 0b2261a50ee8..0f3f30f6ca69 100644
HV_X64_MSR_VP_RUNTIME is only available to guest when
HV_MSR_VP_RUNTIME_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 13011803ebbd..152d991ed033
Introduce hv_check_msr_access() to check if the particular MSR
should be accessible by guest, this will be used with
KVM_CAP_HYPERV_ENFORCE_CPUID mode.
No functional change intended.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 18 ++
1 file changed, 18
Modeled after KVM_CAP_ENFORCE_PV_FEATURE_CPUID, the new capability allows
for limiting Hyper-V features to those exposed to the guest in Hyper-V
CPUIDs (0x4003, 0x4004, ...).
Signed-off-by: Vitaly Kuznetsov
---
Documentation/virt/kvm/api.rst | 11 +++
arch/x86/include/asm
Limiting exposed Hyper-V features requires a fast way to check if the
particular feature is exposed in guest visible CPUIDs or not. To aboid
looping through all CPUID entries on every hypercall/MSR access cache
the required leaves on CPUID update.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86
HV_X64_MSR_GUEST_OS_ID/HV_X64_MSR_HYPERCALL are only available to guest
when HV_MSR_HYPERCALL_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 12
1 file changed, 12 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index
>From TLFSv6.0b, this status means: "The caller did not possess sufficient
access rights to perform the requested operation."
Signed-off-by: Vitaly Kuznetsov
Acked-by: Wei Liu
---
include/asm-generic/hyperv-tlfs.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/asm-g
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
Vineeth Pillai writes:
> Enable remote TLB flush for SVM.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/kvm/svm/svm.c | 37 +
> 1 file changed, 37 insertions(+)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index
Vineeth Pillai writes:
> Add Hyper-V specific fields in VMCB to support SVM enlightenments.
> Also a small refactoring of VMCB clean bits handling.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/include/asm/svm.h | 24 +++-
> arch/x86/kvm/svm/svm.c | 8
>
Vineeth Pillai writes:
> Currently the remote TLB flush logic is specific to VMX.
> Move it to a common place so that SVM can use it as well.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/include/asm/kvm_host.h | 14 +
> arch/x86/kvm/hyperv.c | 87
ESTED_FEATURES) {
> ms_hyperv.nested_features =
> cpuid_eax(HYPERV_CPUID_NESTED_FEATURES);
> + pr_info("Hyper-V: Nested features: 0x%x\n",
> + ms_hyperv.nested_features);
> }
>
> /*
With the commit message expanded,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Wei Liu writes:
> On Tue, Apr 13, 2021 at 02:26:09PM +0200, Vitaly Kuznetsov wrote:
>> From TLFSv6.0b, this status means: "The caller did not possess sufficient
>> access rights to perform the requested operation."
>>
>> Signed-off-by: Vitaly Kuznetsov
&
Simplify the code by making PV features shutdown happen in one place.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kernel/kvm.c | 42 +-
1 file changed, 17 insertions(+), 25 deletions(-)
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index
Crash shutdown handler only disables kvmclock and steal time, other PV
features remain active so we risk corrupting memory or getting some
side-effects in kdump kernel. Move crash handler to kvm.c and unify
with CPU offline.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_para.h
to place anything there). For secondary CPUs the job is
already done by kvm_cpu_down_prepare(), register syscore ops to do
the same for boot CPU.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kernel/kvm.c | 32
1 file changed, 28 insertions(+), 4 deletions(-)
diff
updating the location so for the short
while after write and while CPU is still alive, the clock remains usable
and correct so we don't need to switch to some other clocksource.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_para.h | 4 ++--
arch/x86/kernel/kvm.c | 1 +
arch
'pr_fmt' already has 'kvm-guest: ' so 'KVM' prefix is redundant.
"Unregister pv shared memory" is very ambiguous, it's hard to
say which particular PV feature it relates to.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kernel/kvm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletion
his series unifies all teardown paths in kvm.c and makes sure all
features are disabled when needed.
Vitaly Kuznetsov (5):
x86/kvm: Fix pr_info() for async PF setup/teardown
x86/kvm: Teardown PV features on boot CPU as well
x86/kvm: Disable kvmclock on all CPUs on shutdown
x86/kvm: Disa
> + ent->edx |= HV_X64_HYPERCALL_XMM_INPUT_AVAILABLE;
> + ent->edx |= HV_X64_HYPERCALL_XMM_OUTPUT_AVAILABLE;
> ent->edx |= HV_FEATURE_FREQUENCY_MSRS_AVAILABLE;
> ent->edx |= HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE;
With 'ouput' typo fixed,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Siddharth Chandrasekaran writes:
> Hyper-V supports the use of XMM registers to perform fast hypercalls.
> This allows guests to take advantage of the improved performance of the
> fast hypercall interface even though a hypercall may require more than
> (the current maximum of) two input
break;
> case HVCALL_SEND_IPI_EX:
> - if (unlikely(fast || rep)) {
> + if (unlikely(hc.fast || hc.rep)) {
> ret = HV_STATUS_INVALID_HYPERCALL_INPUT;
> break;
> }
> - ret = kvm_hv_send_ipi(vcpu, ingpa, outgpa, true, false);
> + ret = kvm_hv_send_ipi(vcpu, , true);
> break;
> case HVCALL_POST_DEBUG_DATA:
> case HVCALL_RETRIEVE_DEBUG_DATA:
> - if (unlikely(fast)) {
> + if (unlikely(hc.fast)) {
> ret = HV_STATUS_INVALID_PARAMETER;
> break;
> }
> @@ -2012,9 +2023,9 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu)
> }
> vcpu->run->exit_reason = KVM_EXIT_HYPERV;
> vcpu->run->hyperv.type = KVM_EXIT_HYPERV_HCALL;
> - vcpu->run->hyperv.u.hcall.input = param;
> - vcpu->run->hyperv.u.hcall.params[0] = ingpa;
> - vcpu->run->hyperv.u.hcall.params[1] = outgpa;
> + vcpu->run->hyperv.u.hcall.input = hc.param;
> + vcpu->run->hyperv.u.hcall.params[0] = hc.ingpa;
> + vcpu->run->hyperv.u.hcall.params[1] = hc.outgpa;
> vcpu->arch.complete_userspace_io =
> kvm_hv_hypercall_complete_userspace;
> return 0;
With or without the nitpicks from above addressed,
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
Siddharth Chandrasekaran writes:
> Hyper-v XMM fast hypercalls use XMM registers to pass input/output
> parameters. To access these, hyperv.c can reuse some FPU register
> accessors defined in emulator.c. Move them to a common location so both
> can access them.
>
> While at it, reorder the
Synthetic timers can only be configured in 'direct' mode when
HV_STIMER_DIRECT_MODE_AVAILABLE bit was exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 1299847c89ba
lures. 0x indicates never notify." Use this to check access to
the hypercall. Also, check against zero as the corresponding CPUID must
be set (and '0' attempts before re-try is weird anyway).
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 6 ++
1 file changed, 6 insertion
Hyper-V partition must possess 'HV_DEBUGGING' privilege to issue
HVCALL_POST_DEBUG_DATA/HVCALL_RETRIEVE_DEBUG_DATA/
HVCALL_RESET_DEBUG_SESSION hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b
Hyper-V partition must possess 'HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED'
privilege ('recommended' is rather a misnomer) to issue
HVCALL_FLUSH_VIRTUAL_ADDRESS_LIST/SPACE hypercalls. '_EX' versions of these
hypercalls also require HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED.
Signed-off-by: Vitaly Kuznetsov
Hyper-V partition must possess 'HV_X64_CLUSTER_IPI_RECOMMENDED'
privilege ('recommended' is rather a misnomer) to issue
HVCALL_SEND_IPI hypercalls. 'HVCALL_SEND_IPI_EX' version of the
hypercall also requires HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm
Hyper-V partition must possess 'HV_SIGNAL_EVENTS' privilege to issue
HVCALL_SIGNAL_EVENT hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 6e4bf1da9dcf..b661f92d90c8
Hyper-V partition must possess 'HV_POST_MESSAGES' privilege to issue
HVCALL_POST_MESSAGE hypercalls.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 14 --
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index
-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 0678f1012ed7..1299847c89ba 100644
--- a/arch/x86/kvm/hyperv.c
+++ b/arch/x86/kvm/hyperv.c
@@ -312,7 +312,9 @@ static int
HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4, HV_X64_MSR_CRASH_CTL are only
available to guest when HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE bit is
exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 16
1 file changed, 16 insertions(+)
diff --git a/arch/x86/kvm
HV_X64_MSR_TSC_FREQUENCY/HV_X64_MSR_APIC_FREQUENCY are only available to
guest when HV_ACCESS_FREQUENCY_MSRS bit is exposed.
Note, writing to HV_X64_MSR_TSC_FREQUENCY/HV_X64_MSR_APIC_FREQUENCY is
unsupported so kvm_hv_set_msr() doesn't need an additional check.
Signed-off-by: Vitaly Kuznetsov
fig()/
stimer_set_count().
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 34 --
1 file changed, 28 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index d85c441011c4..032305ad5615 100644
--- a/arch/x86/kvm/hyperv.c
++
HV_X64_MSR_REENLIGHTENMENT_CONTROL/HV_X64_MSR_TSC_EMULATION_CONTROL/
HV_X64_MSR_TSC_EMULATION_STATUS are only available to guest when
HV_ACCESS_REENLIGHTENMENT bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 23 ++-
1 file changed, 22 insertions
HV_X64_MSR_EOI, HV_X64_MSR_ICR, HV_X64_MSR_TPR, and
HV_X64_MSR_VP_ASSIST_PAGE are only available to guest when
HV_MSR_APIC_ACCESS_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 32
1 file changed, 32 insertions(+)
diff
HV_X64_MSR_REFERENCE_TSC is only available to guest when
HV_MSR_REFERENCE_TSC_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 8
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 15d557ce32b5
HV_X64_MSR_RESET is only available to guest when HV_MSR_RESET_AVAILABLE bit
is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 8
1 file changed, 8 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
index 07f1fc8575e5..15d557ce32b5 100644
SynIC MSRs (HV_X64_MSR_SCONTROL, HV_X64_MSR_SVERSION, HV_X64_MSR_SIEFP,
HV_X64_MSR_SIMP, HV_X64_MSR_EOM, HV_X64_MSR_SINT0 ... HV_X64_MSR_SINT15)
are only available to guest when HV_MSR_SYNIC_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 9 +++--
1
HV_X64_MSR_TIME_REF_COUNT is only available to guest when
HV_MSR_TIME_REF_COUNT_AVAILABLE bit is exposed.
Note, writing to HV_X64_MSR_TIME_REF_COUNT is unsupported so
kvm_hv_set_msr_pw() doesn't need an additional check.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 5 +
1
HV_X64_MSR_GUEST_OS_ID/HV_X64_MSR_HYPERCALL are only available to guest
when HV_MSR_HYPERCALL_AVAILABLE bit is exposed.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 17 +
1 file changed, 17 insertions(+)
diff --git a/arch/x86/kvm/hyperv.c b/arch/x86/kvm/hyperv.c
HV_X64_MSR_VP_INDEX is only available to guest when
HV_MSR_VP_INDEX_AVAILABLE bit is exposed.
Note, writing to HV_X64_MSR_VP_INDEX is only available from the host so
kvm_hv_set_msr() doesn't need an additional check.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1 file
HV_X64_MSR_VP_RUNTIME is only available to guest when
HV_MSR_VP_RUNTIME_AVAILABLE bit is exposed.
Note, writing to HV_X64_MSR_VP_RUNTIME is only available from the host so
kvm_hv_set_msr() doesn't need an additional check.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/hyperv.c | 4
1
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/kvm_host.h | 8 ++
arch/x86/kvm/hyperv.c | 50 ++---
2 files changed, 48 insertions(+), 10 deletions(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index
>From TLFSv6.0b, this status means: "The caller did not possess sufficient
access rights to perform the requested operation."
Signed-off-by: Vitaly Kuznetsov
---
include/asm-generic/hyperv-tlfs.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/asm-generic/hyperv-tlfs
a selftest
- Check with various Windows/Hyper-V versions that CPUID feature bits
are actually respected.
Vitaly Kuznetsov (22):
asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition
KVM: x86: hyper-v: Cache guest CPUID leaves determining features
availability
KVM: x86: hyper-v: Honor
Siddharth Chandrasekaran writes:
> On Thu, Apr 08, 2021 at 04:44:23PM +0200, Vitaly Kuznetsov wrote:
>> Siddharth Chandrasekaran writes:
>> > On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote:
>> >> Siddharth Chandrasekaran writes:
>> >>
Siddharth Chandrasekaran writes:
> On Thu, Apr 08, 2021 at 04:30:18PM +, Wei Liu wrote:
>> On Thu, Apr 08, 2021 at 05:54:43PM +0200, Siddharth Chandrasekaran wrote:
>> > On Thu, Apr 08, 2021 at 05:48:19PM +0200, Paolo Bonzini wrote:
>> > > On 08/04/21 17:40, Siddharth Chandrasekaran wrote:
Siddharth Chandrasekaran writes:
> On Thu, Apr 08, 2021 at 04:44:23PM +0200, Vitaly Kuznetsov wrote:
>> CAUTION: This email originated from outside of the organization. Do not
>> click links or open attachments unless you can confirm the sender and know
>>
Siddharth Chandrasekaran writes:
> On Thu, Apr 08, 2021 at 02:05:53PM +0200, Vitaly Kuznetsov wrote:
>> Siddharth Chandrasekaran writes:
>>
>> > Now that all extant hypercalls that can use XMM registers (based on
>> > spec) for input/outputs are patc
Paolo Bonzini writes:
> On 08/04/21 14:01, Vitaly Kuznetsov wrote:
>>
>> Also, we can probably defer kvm_hv_hypercall_read_xmm() until we know
>> how many regs we actually need to not read them all (we will always
>> need xmm[0] I guess so we can as well read it her
Siddharth Chandrasekaran writes:
> Now that all extant hypercalls that can use XMM registers (based on
> spec) for input/outputs are patched to support them, we can start
> advertising this feature to guests.
>
> Cc: Alexander Graf
> Cc: Evgeny Iakovlev
> Signed-off-by: Siddharth
Siddharth Chandrasekaran writes:
> Hyper-V supports the use of XMM registers to perform fast hypercalls.
> This allows guests to take advantage of the improved performance of the
> fast hypercall interface even though a hypercall may require more than
> (the current maximum of) two input
Vineeth Pillai writes:
> From Hyper-V TLFS:
> "The hypervisor exposes hypercalls (HvFlushVirtualAddressSpace,
> HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressList, and
> HvFlushVirtualAddressListEx) that allow operating systems to more
> efficiently manage the virtual TLB. The L1
Vineeth Pillai writes:
> Enlightened MSR-Bitmap as per TLFS:
>
> "The L1 hypervisor may collaborate with the L0 hypervisor to make MSR
> accesses more efficient. It can enable enlightened MSR bitmaps by setting
> the corresponding field in the enlightened VMCS to 1. When enabled, L0
>
Vineeth Pillai writes:
> Enable remote TLB flush for SVM.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/kvm/svm/svm.c | 35 +++
> 1 file changed, 35 insertions(+)
>
> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
> index
Vineeth Pillai writes:
> Currently the remote TLB flush logic is specific to VMX.
> Move it to a common place so that SVM can use it as well.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/include/asm/kvm_host.h | 15 +
> arch/x86/kvm/hyperv.c | 89
Vineeth Pillai writes:
> Detect nested features exposed by Hyper-V if SVM is enabled.
>
> Signed-off-by: Vineeth Pillai
> ---
> arch/x86/kernel/cpu/mshyperv.c | 10 +-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/mshyperv.c
Stephen Rothwell writes:
> Hi all,
>
> In commit
>
> fa26d0c778b4 ("ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m")
>
> Fixes tag
>
> Fixes: 8c182bd7 ("CPI: processor: Fix CPU0 wakeup in
> acpi_idle_play_dead()")
"A" in "ACPI" seems to be missing
>
> has these problem(s):
>
Wei Liu writes:
> On Wed, Apr 07, 2021 at 09:38:21AM +0200, Vitaly Kuznetsov wrote:
>
>> One more though: it is probably a good idea to introduce selftests for
>> /dev/mshv (similar to KVM's selftests in
>> /tools/testing/selftests/kvm). Selftests don't really need a st
Nuno Das Neves writes:
> On 3/5/2021 1:18 AM, Vitaly Kuznetsov wrote:
>> Nuno Das Neves writes:
>>
>>> On 2/9/2021 5:11 AM, Vitaly Kuznetsov wrote:
>>>> Nuno Das Neves writes:
>>>>
>> ...
>>>>> +
>>>>> +3.
2bd7 ("CPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()")
Cc: # 5.10+
Signed-off-by: Vitaly Kuznetsov
---
Changes since v2:
- Use proper kerneldoc format [Rafael J. Wysocki]
---
arch/x86/include/asm/smp.h| 2 +-
arch/x86/kernel/smpboot.c | 26
"Rafael J. Wysocki" writes:
> On Tue, Apr 6, 2021 at 4:01 PM Vitaly Kuznetsov wrote:
>>
>> Commit 8c182bd7 ("ACPI: processor: Fix CPU0 wakeup in
>> acpi_idle_play_dead()") tried to fix CPU0 hotplug breakage by copying
>> wakeup
ed. Also, '|=' for flags could be just '='.
> + entry.ecx = F(RDPID);
> break;
> + default:
> + goto out;
> }
>
> + if (array->nent >= array->maxnent)
> + return -E2BIG;
> +
> + memcpy(>entries[array->nent++], , sizeof(entry));
> +
> +out:
> return 0;
> }
Reviewed-by: Vitaly Kuznetsov
--
Vitaly
2bd7 ("CPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()")
Cc: # 5.10+
Signed-off-by: Vitaly Kuznetsov
---
Changes since v1:
- Rename wakeup_cpu0() to cond_wakeup_cpu0() and fold wakeup_cpu0() in
as it has no other users [Rafael J. Wysocki]
---
arch/x86/include/asm/smp.h| 2
"Rafael J. Wysocki" writes:
> On Tue, Apr 6, 2021 at 2:50 PM Vitaly Kuznetsov wrote:
>>
>> Commit 8c182bd7 ("ACPI: processor: Fix CPU0 wakeup in
>> acpi_idle_play_dead()") tried to fix CPU0 hotplug breakage by copying
>> wakeup
2bd7 ("CPI: processor: Fix CPU0 wakeup in acpi_idle_play_dead()")
Cc: # 5.10+
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/include/asm/smp.h| 2 +-
arch/x86/kernel/smpboot.c | 15 ++-
drivers/acpi/processor_idle.c | 3 +--
3 files changed, 12 insertions(+), 8 dele
Paolo Bonzini writes:
> On 01/04/21 15:03, Vitaly Kuznetsov wrote:
>>> + svm->sysenter_eip_hi = guest_cpuid_is_intel(vcpu) ? (data >>
>>> 32) : 0;
>>
>> (Personal taste) I'd suggest we keep the whole 'sysenter_eip'/'sysenter_esp
Maxim Levitsky writes:
> Currently to support Intel->AMD migration, if CPU vendor is GenuineIntel,
> we emulate the full 64 value for MSR_IA32_SYSENTER_{EIP|ESP}
> msrs, and we also emulate the sysenter/sysexit instruction in long mode.
>
> (Emulator does still refuse to emulate sysenter in 64
Emanuele Giuseppe Esposito writes:
> Introduce a new selftest for the KVM_GET_EMULATED_CPUID
> ioctl. Since the behavior and functionality is similar to
> get_cpuid_test, the test checks:
>
> 1) checks for corner case in the nent field of the struct kvm_cpuid2.
> 2) sets and gets it as cpuid
Sean Christopherson writes:
> On Wed, Mar 31, 2021, Yang Li wrote:
>> Using __set_bit() to set a bit in an integer is not a good idea, since
>> the function expects an unsigned long as argument, which can be 64bit wide.
>> Coverity reports this problem as
>>
>> High:Out-of-bounds
Shixin Liu writes:
> When compiling with defconfig on x86_64, I got a warning:
>
> drivers/acpi/processor_idle.c: In function ‘acpi_idle_play_dead’:
> drivers/acpi/processor_idle.c:542:15: warning: extra tokens at end of #ifdef
> directive
> 542 | #ifdef defined(CONFIG_X86) &&
clock is in
use and get_kvmclock_base_ns() when it's not to prevent 'system_time' from
going negative.
Signed-off-by: Vitaly Kuznetsov
---
arch/x86/kvm/x86.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 2bfd00da465
1 - 100 of 4372 matches
Mail list logo