Re: [PATCH] net: appletalk: remove cops support

2023-09-27 Thread Vitaly Kuznetsov
, 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

Re: [PATCH] x86/hyperv: Restrict get_vtl to only VTL platforms

2023-09-14 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 3/7] KVM: x86: hyper-v: Move the remote TLB flush logic out of vmx

2021-04-20 Thread Vitaly Kuznetsov
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 >

Re: ** POTENTIAL FRAUD ALERT - RED HAT ** [PATCH v2 1/1] Drivers: hv: vmbus: Increase wait time for VMbus unload

2021-04-20 Thread Vitaly Kuznetsov
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

[PATCH 16/30] KVM: x86: hyper-v: Honor HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 28/30] KVM: selftests: move Hyper-V MSR definitions to hyperv.h

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 29/30] KVM: selftests: Move evmcs.h to x86_64/

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 30/30] KVM: selftests: Introduce hyperv_features test

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 27/30] KVM: x86: hyper-v: Honor HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 25/30] KVM: x86: hyper-v: Honor HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 26/30] KVM: x86: hyper-v: Honor HV_X64_CLUSTER_IPI_RECOMMENDED bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 24/30] KVM: x86: hyper-v: Honor HV_DEBUGGING privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 21/30] KVM: x86: hyper-v: Check access to HVCALL_NOTIFY_LONG_SPIN_WAIT hypercall

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 22/30] KVM: x86: hyper-v: Honor HV_POST_MESSAGES privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 23/30] KVM: x86: hyper-v: Honor HV_SIGNAL_EVENTS privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 20/30] KVM: x86: hyper-v: Prepare to check access to Hyper-V hypercalls

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 19/30] KVM: x86: hyper-v: Honor HV_STIMER_DIRECT_MODE_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 17/30] KVM: x86: hyper-v: Honor HV_FEATURE_DEBUG_MSRS_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
-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

[PATCH 18/30] KVM: x86: hyper-v: Inverse the default in hv_check_msr_access()

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 15/30] KVM: x86: hyper-v: Honor HV_ACCESS_REENLIGHTENMENT privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 14/30] KVM: x86: hyper-v: Honor HV_ACCESS_FREQUENCY_MSRS privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 12/30] KVM: x86: hyper-v: Honor HV_MSR_SYNTIMER_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 13/30] KVM: x86: hyper-v: Honor HV_MSR_APIC_ACCESS_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 11/30] KVM: x86: hyper-v: Honor HV_MSR_SYNIC_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 10/30] KVM: x86: hyper-v: Honor HV_MSR_REFERENCE_TSC_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 07/30] KVM: x86: hyper-v: Honor HV_MSR_TIME_REF_COUNT_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 09/30] KVM: x86: hyper-v: Honor HV_MSR_RESET_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 08/30] KVM: x86: hyper-v: Honor HV_MSR_VP_INDEX_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 06/30] KVM: x86: hyper-v: Honor HV_MSR_VP_RUNTIME_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 04/30] KVM: x86: hyper-v: Prepare to check access to Hyper-V MSRs

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 02/30] KVM: x86: hyper-v: Introduce KVM_CAP_HYPERV_ENFORCE_CPUID

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 03/30] KVM: x86: hyper-v: Cache guest CPUID leaves determining features availability

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 05/30] KVM: x86: hyper-v: Honor HV_MSR_HYPERCALL_AVAILABLE privilege bit

2021-04-19 Thread Vitaly Kuznetsov
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

[PATCH 01/30] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition

2021-04-19 Thread Vitaly Kuznetsov
>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

[PATCH 00/30] KVM: x86: hyper-v: Fine-grained access check to Hyper-V hypercalls and MSRs

2021-04-19 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 5/7] KVM: SVM: hyper-v: Remote TLB flush for SVM

2021-04-16 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 4/7] KVM: SVM: hyper-v: Nested enlightenments in VMCB

2021-04-16 Thread Vitaly Kuznetsov
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 >

Re: [PATCH v2 3/7] KVM: x86: hyper-v: Move the remote TLB flush logic out of vmx

2021-04-16 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 1/7] hyperv: Detect Nested virtualization support for SVM

2021-04-16 Thread Vitaly Kuznetsov
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

Re: [PATCH RFC 01/22] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition

2021-04-15 Thread Vitaly Kuznetsov
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 &

[PATCH 5/5] x86/kvm: Unify kvm_pv_guest_cpu_reboot() with kvm_guest_cpu_offline()

2021-04-14 Thread 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

[PATCH 4/5] x86/kvm: Disable all PV features on crash

2021-04-14 Thread Vitaly Kuznetsov
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

[PATCH 2/5] x86/kvm: Teardown PV features on boot CPU as well

2021-04-14 Thread Vitaly Kuznetsov
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

[PATCH 3/5] x86/kvm: Disable kvmclock on all CPUs on shutdown

2021-04-14 Thread Vitaly Kuznetsov
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

[PATCH 1/5] x86/kvm: Fix pr_info() for async PF setup/teardown

2021-04-14 Thread Vitaly Kuznetsov
'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

[PATCH 0/5] x86/kvm: Refactor KVM PV features teardown and fix restore from hibernation

2021-04-14 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-13 Thread Vitaly Kuznetsov
> + 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

Re: [PATCH v2 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-13 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 2/4] KVM: hyper-v: Collect hypercall params into struct

2021-04-13 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 1/4] KVM: x86: Move FPU register accessors into fpu.h

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 16/22] KVM: x86: hyper-v: Honor HV_STIMER_DIRECT_MODE_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 22/22] KVM: x86: hyper-v: Check access to HVCALL_NOTIFY_LONG_SPIN_WAIT hypercall

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 19/22] KVM: x86: hyper-v: Honor HV_DEBUGGING privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 20/22] KVM: x86: hyper-v: Honor HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 21/22] KVM: x86: hyper-v: Honor HV_X64_CLUSTER_IPI_RECOMMENDED bit

2021-04-13 Thread 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

[PATCH RFC 18/22] KVM: x86: hyper-v: Honor HV_SIGNAL_EVENTS privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 17/22] KVM: x86: hyper-v: Honor HV_POST_MESSAGES privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 15/22] KVM: x86: hyper-v: Honor HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
-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

[PATCH RFC 14/22] KVM: x86: hyper-v: Honor HV_FEATURE_GUEST_CRASH_MSR_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 12/22] KVM: x86: hyper-v: Honor HV_ACCESS_FREQUENCY_MSRS privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 10/22] KVM: x86: hyper-v: Honor HV_MSR_SYNTIMER_AVAILABLE privilege bit

2021-04-13 Thread 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 ++

[PATCH RFC 13/22] KVM: x86: hyper-v: Honor HV_ACCESS_REENLIGHTENMENT privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 11/22] KVM: x86: hyper-v: Honor HV_MSR_APIC_ACCESS_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 08/22] KVM: x86: hyper-v: Honor HV_MSR_REFERENCE_TSC_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 07/22] KVM: x86: hyper-v: Honor HV_MSR_RESET_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 09/22] KVM: x86: hyper-v: Honor HV_MSR_SYNIC_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 04/22] KVM: x86: hyper-v: Honor HV_MSR_TIME_REF_COUNT_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 05/22] KVM: x86: hyper-v: Honor HV_MSR_HYPERCALL_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 06/22] KVM: x86: hyper-v: Honor HV_MSR_VP_INDEX_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 03/22] KVM: x86: hyper-v: Honor HV_MSR_VP_RUNTIME_AVAILABLE privilege bit

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 02/22] KVM: x86: hyper-v: Cache guest CPUID leaves determining features availability

2021-04-13 Thread Vitaly Kuznetsov
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

[PATCH RFC 01/22] asm-generic/hyperv: add HV_STATUS_ACCESS_DENIED definition

2021-04-13 Thread Vitaly Kuznetsov
>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

[PATCH RFC 00/22] KVM: x86: hyper-v: Fine-grained access check to Hyper-V hypercalls and MSRs

2021-04-13 Thread Vitaly Kuznetsov
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

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-12 Thread Vitaly Kuznetsov
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: >> >>

Re: [PATCH 0/4] Add support for XMM fast hypercalls

2021-04-09 Thread Vitaly Kuznetsov
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:

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-09 Thread Vitaly Kuznetsov
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 >>

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 4/4] KVM: hyper-v: Advertise support for fast XMM hypercalls

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 3/4] KVM: x86: kvm_hv_flush_tlb use inputs from XMM registers

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 7/7] KVM: SVM: hyper-v: Direct Virtual Flush support

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 6/7] KVM: SVM: hyper-v: Enlightened MSR-Bitmap support

2021-04-08 Thread Vitaly Kuznetsov
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 >

Re: [PATCH 5/7] KVM: SVM: hyper-v: Remote TLB flush for SVM

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 3/7] KVM: x86: hyper-v: Move the remote TLB flush logic out of vmx

2021-04-08 Thread Vitaly Kuznetsov
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

Re: [PATCH 1/7] hyperv: Detect Nested virtualization support for SVM

2021-04-08 Thread Vitaly Kuznetsov
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

Re: linux-next: Fixes tag needs some work in the pm tree

2021-04-08 Thread Vitaly Kuznetsov
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): >

Re: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-04-07 Thread Vitaly Kuznetsov
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

Re: [RFC PATCH 04/18] virt/mshv: request version ioctl

2021-04-07 Thread Vitaly Kuznetsov
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.

[PATCH v3] ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m

2021-04-06 Thread Vitaly Kuznetsov
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

Re: [PATCH v2] ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m

2021-04-06 Thread Vitaly Kuznetsov
"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

Re: [PATCH v3 1/4] KVM: x86: Fix a spurious -E2BIG in KVM_GET_EMULATED_CPUID

2021-04-06 Thread Vitaly Kuznetsov
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

[PATCH v2] ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m

2021-04-06 Thread Vitaly Kuznetsov
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

Re: [PATCH] ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m

2021-04-06 Thread Vitaly Kuznetsov
"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

[PATCH] ACPI: processor: Fix build when CONFIG_ACPI_PROCESSOR=m

2021-04-06 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-04-01 Thread Vitaly Kuznetsov
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

Re: [PATCH v2 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-04-01 Thread Vitaly Kuznetsov
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

Re: [PATCH 4/4] selftests: kvm: add get_emulated_cpuid test

2021-04-01 Thread Vitaly Kuznetsov
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

Re: [PATCH] KVM: x86: Fix potential memory access error

2021-04-01 Thread Vitaly Kuznetsov
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

Re: [PATCH -next] ACPI: processor: Fix a prepocessor warning

2021-04-01 Thread Vitaly Kuznetsov
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) &&

[PATCH v3 1/2] KVM: x86: Prevent 'hv_clock->system_time' from going negative in kvm_guest_time_update()

2021-03-31 Thread Vitaly Kuznetsov
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   2   3   4   5   6   7   8   9   10   >