Re: [PATCH v1] kvm/x86: Hyper-V tsc page setup

2016-01-05 Thread Peter Hornyack
n Kagan > CC: Denis V. Lunev > CC: qemu-de...@nongnu.org Reviewed-by: Peter Hornyack > > --- > arch/x86/kvm/hyperv.c| 117 > +-- > arch/x86/kvm/hyperv.h| 2 + > arch/x86/kvm/x86.c | 12 + > include/lin

Re: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-21 Thread Peter Hornyack
On Fri, Dec 18, 2015 at 1:25 PM, Paolo Bonzini wrote: > > > On 18/08/2015 20:46, Peter Hornyack wrote: >> Define KVM_EXIT_MSR, a new exit reason for accesses to MSRs that kvm >> does not handle. Define KVM_CAP_UNHANDLED_MSR_EXITS, a vm-wide >> capability that guards th

Re: [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-12-18 Thread Peter Hornyack
On Fri, Dec 18, 2015 at 1:25 PM, Paolo Bonzini wrote: > > > On 18/08/2015 20:46, Peter Hornyack wrote: >> Define KVM_EXIT_MSR, a new exit reason for accesses to MSRs that kvm >> does not handle. Define KVM_CAP_UNHANDLED_MSR_EXITS, a vm-wide >> capability that guards th

Re: [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit

2015-12-18 Thread Peter Hornyack
On Fri, Dec 18, 2015 at 8:01 AM, Paolo Bonzini wrote: > > > On 18/12/2015 16:19, Pavel Fedin wrote: >> As far as i understand this code, KVM_EXIT_HYPERV is called when one >> of three MSRs are accessed. But, shouldn't we have implemented >> instead something more generic, like KVM_EXIT_REG_IO, whi

Re: [PATCH] KVM: x86: expose MSR_TSC_AUX to userspace

2015-11-13 Thread Peter Hornyack
On Fri, Nov 13, 2015 at 1:42 AM, Paolo Bonzini wrote: > >> Paolo, under what circumstances (which versions of Windows? Anything >> special running in the guest?) has this failure happened? I'd like to repro >> this, I'm not sure if we've observed it before. > > We saw it with migration under Windo

Re: [RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses

2015-08-20 Thread Peter Hornyack
On Wed, Aug 19, 2015 at 2:43 PM, Bandan Das wrote: > Peter Hornyack writes: > >> There are numerous MSRs that kvm does not currently handle. On Intel >> platforms we have observed guest VMs accessing some of these MSRs (for >> example, MSR_PLATFORM_INFO) and behaving

[RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-08-18 Thread Peter Hornyack
Define KVM_EXIT_MSR, a new exit reason for accesses to MSRs that kvm does not handle. Define KVM_CAP_UNHANDLED_MSR_EXITS, a vm-wide capability that guards the new exit reason and which can be enabled via the KVM_ENABLE_CAP ioctl. Signed-off-by: Peter Hornyack --- Documentation/virtual/kvm

[RFC PATCH 3/5] KVM: x86: add msr_exits_supported to kvm_x86_ops

2015-08-18 Thread Peter Hornyack
msr_exits_supported will be checked when user space attempts to enable the KVM_CAP_UNHANDLED_MSR_EXITS capability for the vm. This is needed because MSR exit support will be implemented for vmx but not svm later in this patchset. Signed-off-by: Peter Hornyack --- arch/x86/include/asm/kvm_host.h

[RFC PATCH 1/5] KVM: x86: refactor vmx rdmsr/wrmsr completion into new functions

2015-08-18 Thread Peter Hornyack
After handling a rdmsr or wrmsr, refactor the success and failure code paths into separate functions. This will allow us to also complete or fail MSR accesses on the entry path from userspace into kvm. Signed-off-by: Peter Hornyack --- arch/x86/kvm/vmx.c | 44

[RFC PATCH 5/5] KVM: x86: add trace events for unhandled MSR exits

2015-08-18 Thread Peter Hornyack
Add trace_kvm_userspace_msr and call it when user space reenters kvm after KVM_EXIT_MSR. Add KVM_EXIT_MSR to kvm_trace_exit_reason list. Signed-off-by: Peter Hornyack --- arch/x86/kvm/trace.h | 28 arch/x86/kvm/vmx.c | 4 arch/x86/kvm/x86.c

[RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses

2015-08-18 Thread Peter Hornyack
f kvm and allowing us to respond to bugs more quickly. This patchset has been tested with our non-qemu user space hypervisor on vmx platforms; svm support is not implemented. Peter Hornyack (5): KVM: x86: refactor vmx rdmsr/wrmsr completion into new functions KVM: add KVM_EXIT_MSR exit reaso

[RFC PATCH 4/5] KVM: x86: enable unhandled MSR exits for vmx

2015-08-18 Thread Peter Hornyack
, use the complete_userspace_io callback path to call vmx_complete_userspace_msr. Complete the MSR access if user space was able to handle it successfully, or fail the MSR access and inject a GP fault if user space could not handle the access. Signed-off-by: Peter Hornyack --- arch/x86/includ

Re: [PATCH 3/9] kvm: add hyper-v crash msrs values

2015-07-01 Thread Peter Hornyack
t; +#define HV_X64_MSR_CRASH_CTL_NOTIFY(1ULL << 63) >>> +#define HV_X64_MSR_CRASH_CTL_CONTENTS \ >>> + (HV_X64_MSR_CRASH_CTL_NOTIFY) >> >> Why is HV_X64_MSR_CRASH_CTL_CONTENTS needed? Can I just remove it? >> >> Pa

Re: [PATCH 8/9] kvm/x86: add sending hyper-v crash notification to user space

2015-06-30 Thread Peter Hornyack
RASH > and flag KVM_SYSTEM_EVENT_FL_HV_CRASH to clarify that > crash occures inside Hyper-V based guest. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb Natapov Reviewed-by: Peter Hornyack > --- > arch/x86/kvm/x86.c | 8 ++

Re: [PATCH 7/9] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-30 Thread Peter Hornyack
tingiush the moment of actual guest crash > by checking host initiated value from msr info. Also patch > prevents modification of crash ctl msr by guest. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb Natapov Rev

Re: [PATCH 6/9] kvm/x86: mark hyper-v crash msrs as partition wide

2015-06-30 Thread Peter Hornyack
On Tue, Jun 30, 2015 at 4:33 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Hyper-V crash msr's are per vm, aren't per vcpu, so mark them > as partition wide. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini >

Re: [PATCH 5/9] kvm: added KVM_REQ_HV_CRASH value to notify qemu about hyper-v crash

2015-06-30 Thread Peter Hornyack
CC: Gleb Natapov Reviewed-by: Peter Hornyack > --- > include/linux/kvm_host.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 2b2edf1..a377e00 100644 > --- a/include/linux/kvm_host.h > +++ b/include/l

Re: [PATCH 3/9] kvm: add hyper-v crash msrs values

2015-06-30 Thread Peter Hornyack
On Tue, Jun 30, 2015 at 4:33 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Added Hyper-V crash msrs values - HV_X64_MSR_CRASH*. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb Natapov Reviewed-by: Peter Horn

Re: [PATCH 4/9] kvm/x86: added hyper-v crash msrs into kvm hyperv context

2015-06-30 Thread Peter Hornyack
On Tue, Jun 30, 2015 at 4:33 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Added kvm Hyper-V context hv crash variables as storage > of Hyper-V crash msrs. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb

Re: [PATCH 1/9] kvm/x86: move Hyper-V MSR's/hypercall code into hyperv.c file

2015-06-30 Thread Peter Hornyack
V kvm/vcpu fields moved into appropriate hyperv context > structures. Copyrights and authors information copied from x86.c > to hyperv.c. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb Natapov Reviewed-by: Peter Hornyac

Re: [PATCH 2/9] kvm: introduce vcpu_debug = kvm_debug + vcpu context

2015-06-30 Thread Peter Hornyack
zini > CC: Gleb Natapov Reviewed-by: Peter Hornyack > --- > include/linux/kvm_host.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h > index 9564fd7..2b2edf1 100644 > --- a/include/linux/kvm_host.h > +++ b/in

Re: [PATCH 09/11] kvm/x86: distingiush hyper-v guest crash notification

2015-06-22 Thread Peter Hornyack
On Mon, Jun 22, 2015 at 9:05 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Previous patches allowes userspace to setup Hyper-V crash ctl msr. > This msr should expose HV_X64_MSR_CRASH_CTL_NOTIFY value to Hyper-V > guest to allow to send crash data. Unfortunately Hyper-V guest notifies > h

Re: [PATCH 07/11] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-06-22 Thread Peter Hornyack
On Mon, Jun 22, 2015 at 9:05 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control > geters and setters. > > Signed-off-by: Andrey Smetanin > Signed-off-by: Denis V. Lunev > CC: Paolo Bonzini > CC: Gleb Natapov > --- > arch/x86/kv

Re: [PATCH 1/2] kvm/x86: Hyper-V based guest crash data handling

2015-06-12 Thread Peter Hornyack
Hi Denis, Andrey, I have a few comments and questions. (re-sending in plain-text mode, apologies for sending twice.) On Thu, Jun 11, 2015 at 6:18 AM, Denis V. Lunev wrote: > From: Andrey Smetanin > > Windows 2012 guests can notify hypervisor about occurred guest crash > (Windows bugcheck(BSOD))