[PATCH v2] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-04-19 Thread Adalbert Lazăr
failover floppy Fixes: 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug") Reported-by: Alexandru Herghelegiu Signed-off-by: Adalbert Lazăr Co-developed-by: Stefan Hajnoczi --- net/vmw_vsock/virtio_transport_common.c | 22 +++--- 1 file changed, 15

Re: [PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-04-19 Thread Adalbert Lazăr
On Wed, 6 Mar 2019 08:41:04 +, Stefan Hajnoczi wrote: > On Tue, Mar 05, 2019 at 08:01:45PM +0200, Adalbert Lazăr wrote: > > Thanks for the patch, Adalbert! Please add a Signed-off-by tag so your > patch can be merged (see Documentation/process/submitting-patches.rst > Chapter

[PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-04-19 Thread Adalbert Lazăr
Previous to commit 22b5c0b63f32 ("vsock/virtio: fix kernel panic after device hot-unplug"), vsock_core_init() was called from virtio_vsock_probe(). Now, virtio_transport_reset_no_sock() can be called before vsock_core_init() has the chance to run. [Wed Feb 27 14:17:09 2019] BUG: unable to handle

Re: [PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-04-19 Thread Adalbert Lazăr
On Wed, 6 Mar 2019 09:12:36 +0100, Stefano Garzarella wrote: > > --- a/net/vmw_vsock/virtio_transport_common.c > > +++ b/net/vmw_vsock/virtio_transport_common.c > > @@ -662,6 +662,7 @@ static int virtio_transport_reset(struct vsock_sock > > *vsk, > > */ > > static int

Re: [PATCH] vsock/virtio: fix kernel panic from virtio_transport_reset_no_sock

2019-04-19 Thread Adalbert Lazăr
On Wed, 6 Mar 2019 17:02:16 +, Stefan Hajnoczi wrote: > On Wed, Mar 06, 2019 at 11:10:41AM +0200, Adalbert Lazăr wrote: > > On Wed, 6 Mar 2019 08:41:04 +, Stefan Hajnoczi > > wrote: > > > On Tue, Mar 05, 2019 at 08:01:45PM +0200, Adalbert Lazăr wrote

Re: [RFC PATCH v6 75/92] kvm: x86: disable gpa_available optimization in emulator_read_write_onepage()

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 10:47:34 +0200, Paolo Bonzini wrote: > On 09/08/19 18:00, Adalbert Lazăr wrote: > > If the EPT violation was caused by an execute restriction imposed by the > > introspection tool, gpa_available will point to the instruction pointer, > > not the to th

Re: [RFC PATCH v6 70/92] kvm: x86: filter out access rights only when tracked by the introspection tool

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 11:08:39 +0200, Paolo Bonzini wrote: > On 09/08/19 18:00, Adalbert Lazăr wrote: > > It should complete the commit fd34a9518173 ("kvm: x86: consult the page > > tracking from kvm_mmu_get_page() and __direct_map()") > > > > Signed-off-by:

Re: [RFC PATCH v6 16/92] kvm: introspection: handle events and event replies

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 10:55:21 +0200, Paolo Bonzini wrote: > On 09/08/19 17:59, Adalbert Lazăr wrote: > > > > +reply->padding2); > > + > > + ivcpu->reply_waiting = false; > > + return expected->error; > > +} > > + >

Re: [RFC PATCH v6 06/92] kvm: introspection: add KVMI_CONTROL_CMD_RESPONSE

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 11:15:34 +0200, Paolo Bonzini wrote: > On 09/08/19 17:59, Adalbert Lazăr wrote: > > +If `now` is 1, the command reply is enabled/disabled (according to > > +`enable`) starting with the current command. For example, `enable=0` > > +and `now=1` means that

Re: [RFC PATCH v6 02/92] kvm: introspection: add basic ioctls (hook/unhook)

2019-08-13 Thread Adalbert Lazăr
We'll do. On Tue, 13 Aug 2019 10:44:28 +0200, Paolo Bonzini wrote: > On 09/08/19 17:59, Adalbert Lazăr wrote: > > +static int kvmi_recv(void *arg) > > +{ > > + struct kvmi *ikvm = arg; > > + > > + kvmi_info(ikvm, "Hooking VM\n");

Re: [RFC PATCH v6 74/92] kvm: x86: do not unconditionally patch the hypercall instruction during emulation

2019-08-14 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 11:20:45 +0200, Paolo Bonzini wrote: > On 09/08/19 18:00, Adalbert Lazăr wrote: > > From: Mihai Donțu > > > > It can happened for us to end up emulating the VMCALL instruction as a > > result of the handling of an EPT write fault. In this situation

Re: [RFC PATCH v6 14/92] kvm: introspection: handle introspection commands before returning to guest

2019-08-14 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 16:45:11 +0200, Paolo Bonzini wrote: > On 13/08/19 15:54, Adalbert Lazăr wrote: > > Leaving kvm_vcpu_block() in order to handle a request such as 'pause', > > would cause the vCPU to enter the guest when resumed. Most of the > > time

Re: [RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)

2019-08-14 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 08:01:28 -0700, Sean Christopherson wrote: > On Tue, Aug 13, 2019 at 02:09:51PM +0200, Paolo Bonzini wrote: > > On 13/08/19 13:57, Adalbert Lazăr wrote: > > >> The refcounting approach seems a bit backwards, and AFAICT is driven by > > >>

Re: DANGER WILL ROBINSON, DANGER

2019-08-13 Thread Adalbert Lazăr
On Fri, 9 Aug 2019 09:24:44 -0700, Matthew Wilcox wrote: > On Fri, Aug 09, 2019 at 07:00:26PM +0300, Adalbert Lazăr wrote: > > +++ b/include/linux/page-flags.h > > @@ -417,8 +417,10 @@ PAGEFLAG(Idle, idle, PF_ANY) > > */ > > #define PAGE_MAPPING_ANON 0x1 > &

Re: [RFC PATCH v6 14/92] kvm: introspection: handle introspection commands before returning to guest

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 10:26:29 +0200, Paolo Bonzini wrote: > On 09/08/19 17:59, Adalbert Lazăr wrote: > > + prepare_to_swait_exclusive(>wq, , > > + TASK_INTERRUPTIBLE); > > + > > + if (

Re: [RFC PATCH v6 13/92] kvm: introspection: make the vCPU wait even when its jobs list is empty

2019-08-13 Thread Adalbert Lazăr
On Tue, 13 Aug 2019 10:43:52 +0200, Paolo Bonzini wrote: > On 09/08/19 17:59, Adalbert Lazăr wrote: > > +void kvmi_handle_requests(struct kvm_vcpu *vcpu) > > +{ > > + struct kvmi *ikvm; > > + > > + ikvm = kvmi_get(vcpu->kvm); >

Re: [RFC PATCH v6 64/92] kvm: introspection: add single-stepping

2019-08-13 Thread Adalbert Lazăr
On Mon, 12 Aug 2019 13:50:39 -0700, Sean Christopherson wrote: > On Fri, Aug 09, 2019 at 07:00:19PM +0300, Adalbert Lazăr wrote: > > From: Nicușor Cîțu > > > > This would be used either if the introspection tool request it as a > > reply to a KVMI_EVENT_PF event o

Re: [RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)

2019-08-13 Thread Adalbert Lazăr
On Mon, 12 Aug 2019 13:20:30 -0700, Sean Christopherson wrote: > On Fri, Aug 09, 2019 at 06:59:16PM +0300, Adalbert Lazăr wrote: > > diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig > > index 72fa955f4a15..f70a6a1b6814 100644 > > --- a/arch/x86/kvm/Kconfig > >

Re: [RFC PATCH v6 69/92] kvm: x86: keep the page protected if tracked by the introspection tool

2019-09-10 Thread Adalbert Lazăr
On Tue, 10 Sep 2019 10:26:42 -0400, Konrad Rzeszutek Wilk wrote: > On Fri, Aug 09, 2019 at 07:00:24PM +0300, Adalbert Lazăr wrote: > > This patch might be obsolete thanks to single-stepping. > > sooo should it be skipped from this large patchset to easy > review? I'll add a

[RFC PATCH v6 00/92] VM introspection

2019-08-09 Thread Adalbert Lazăr
le (on pair with our introspection products using Xen) - speed improvements (the penalty on web browsing actions is 50% lower, at least) Adalbert Lazăr (25): kvm: introspection: add basic ioctls (hook/unhook) kvm: introspection: add permission access ioctls kvm: introspection: add the r

[RFC PATCH v6 04/92] kvm: introspection: add the read/dispatch message function

2019-08-09 Thread Adalbert Lazăr
is closed (signaled by userspace/QEMU or the introspection tool) or on the first API error (eg. wrong message size). Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 86 +++ include/uapi/linux/kvmi.h | 13 ++ virt/kvm/kvmi.c| 43

[RFC PATCH v6 06/92] kvm: introspection: add KVMI_CONTROL_CMD_RESPONSE

2019-08-09 Thread Adalbert Lazăr
was running in a different VM) was around 5-10%. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 50 ++ include/uapi/linux/kvmi.h | 7 virt/kvm/kvmi_int.h| 2 ++ virt/kvm/kvmi_msg.c| 57

[RFC PATCH v6 48/92] kvm: add kvm_vcpu_kick_and_wait()

2019-08-09 Thread Adalbert Lazăr
This function is needed for the KVMI_PAUSE_VCPU command. There are cases when it is easier for the introspection tool if it knows that the vCPU doesn't run guest code when the command is completed, without waiting for the KVMI_EVENT_PAUSE_VCPU event. Signed-off-by: Adalbert Lazăr --- include

[RFC PATCH v6 53/92] kvm: introspection: add KVMI_INJECT_EXCEPTION + KVMI_EVENT_TRAP

2019-08-09 Thread Adalbert Lazăr
with the KVMI_EVENT_TRAP event and abort the injection. The introspecion tool is expected to try again at a later time. CC: Joerg Roedel Signed-off-by: Mihai Donțu Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 71

[RFC PATCH v6 37/92] KVM: VMX: Introduce SPP access bitmap and operation functions

2019-08-09 Thread Adalbert Lazăr
-by: He Chen Signed-off-by: He Chen Co-developed-by: Zhang Yi Signed-off-by: Zhang Yi Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-5-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 1 + arch/x

[RFC PATCH v6 57/92] kvm: introspection: add KVMI_GET_XSAVE

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This vCPU command is used to get the XSAVE area. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 31 ++ arch/x86/include/uapi/asm/kvmi.h | 4 arch/x86/kvm/kvmi.c| 21

[RFC PATCH v6 72/92] kvm: introspection: add memory map/unmap support on the guest side

2019-08-09 Thread Adalbert Lazăr
). Signed-off-by: Mircea Cîrjaliu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/hypercalls.txt | 34 ++ arch/x86/Kconfig | 9 + arch/x86/include/asm/kvmi_guest.h| 10 + arch/x86/kernel/Makefile | 1 + arch/x86/kernel

[RFC PATCH v6 52/92] kvm: introspection: add KVMI_GET_CPUID

2019-08-09 Thread Adalbert Lazăr
From: Marian Rotariu This command returns a CPUID leaf (as seen by the guest OS). Signed-off-by: Marian Rotariu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 36 ++ arch/x86/include/uapi/asm/kvmi.h | 12 ++ arch/x86/kvm/kvmi.c

[RFC PATCH v6 92/92] kvm: x86: fallback to the single-step on multipage CMPXCHG emulation

2019-08-09 Thread Adalbert Lazăr
, this is an uncommon occurrence making the overhead of the single-step mechanism acceptable. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[RFC PATCH v6 64/92] kvm: introspection: add single-stepping

2019-08-09 Thread Adalbert Lazăr
Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 3 + arch/x86/kvm/kvmi.c | 47 ++- arch/x86/kvm/svm.c | 5 ++ arch/x86/kvm/vmx/vmx.c | 17 arch/x86/kvm/x86.c | 19 + include

[RFC PATCH v6 76/92] kvm: x86: disable EPT A/D bits if introspection is present

2019-08-09 Thread Adalbert Lazăr
Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/vmx/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index dc648ba47df3..152c58b63f69 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -7718,7 +7718,7

[RFC PATCH v6 77/92] kvm: introspection: add trace functions

2019-08-09 Thread Adalbert Lazăr
Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Co-developed-by: Mircea Cîrjaliu Signed-off-by: Mircea Cîrjaliu Co-developed-by: Marian Rotariu Signed-off-by: Marian Rotariu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/kvmi.c | 63

[RFC PATCH v6 90/92] kvm: x86: emulate lock cmpxchg8b atomically

2019-08-09 Thread Adalbert Lazăr
as the first step made the changes directly in memory. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 42 +- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[RFC PATCH v6 01/92] kvm: introduce KVMI (VM introspection subsystem)

2019-08-09 Thread Adalbert Lazăr
). Signed-off-by: Mihai Donțu Co-developed-by: Mircea Cîrjaliu Signed-off-by: Mircea Cîrjaliu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 75 ++ arch/x86/kvm/Kconfig | 7 +++ arch/x86/kvm/Makefile | 1 + include/linux

[RFC PATCH v6 05/92] kvm: introspection: add KVMI_GET_VERSION

2019-08-09 Thread Adalbert Lazăr
messages. The command is always allowed and any attempt from userspace to disallow it through KVM_INTROSPECTION_COMMAND will get -EPERM (unless userspace choose to disable all commands, using id=-1, in which case KVMI_GET_VERSION is quietly allowed, without an error). Signed-off-by: Adalbert

[RFC PATCH v6 45/92] kvm: introspection: add KVMI_GET_PAGE_WRITE_BITMAP

2019-08-09 Thread Adalbert Lazăr
that the KVMI_EVENT_PF events are filter using the radix tree and that the introspection tool should know what it tracks, we should choose the later. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 44 ++ arch/x86/kvm/kvmi.c| 44

[RFC PATCH v6 62/92] kvm: introspection: add KVMI_EVENT_HYPERCALL

2019-08-09 Thread Adalbert Lazăr
during a scan. Signed-off-by: Mihai Donțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/hypercalls.txt | 34 +++- Documentation/virtual/kvm/kvmi.rst | 31 + arch/x86/kvm/kvmi.c | 33

[RFC PATCH v6 49/92] kvm: introspection: add KVMI_PAUSE_VCPU and KVMI_EVENT_PAUSE_VCPU

2019-08-09 Thread Adalbert Lazăr
. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 68 ++ include/uapi/linux/kvm_para.h | 1 + include/uapi/linux/kvmi.h | 7 +++ virt/kvm/kvmi.c| 65 virt/kvm/kvmi_int.h| 4

[RFC PATCH v6 38/92] KVM: VMX: Add init/set/get functions for SPP

2019-08-09 Thread Adalbert Lazăr
whether the fault EPT page is SPP protected as well. Co-developed-by: He Chen Signed-off-by: He Chen Co-developed-by: Zhang Yi Signed-off-by: Zhang Yi Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-6-weijiang.y...@intel.com> Signed-off-by: Ad

[RFC PATCH v6 82/92] kvm: x86: emulate movq r, xmm

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This adds support for movq r, xmm. It introduces a new flag (GPRModRM) to indicate decode_modrm() that the encoded register is a general purpose one. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 15 +-- 1 file changed, 13

[RFC PATCH v6 43/92] kvm: introspection: add KVMI_CONTROL_SPP

2019-08-09 Thread Adalbert Lazăr
This command enables/disables subpage protection (SPP) for the current VM. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 33 ++ arch/x86/kvm/kvmi.c| 4 include/uapi/linux/kvmi.h | 7 +++ virt/kvm/kvmi_int.h

[RFC PATCH v6 07/92] kvm: introspection: honor the reply option when handling the KVMI_GET_VERSION command

2019-08-09 Thread Adalbert Lazăr
is disabled it will return an error to the caller. In the end, the receiving worker will finish and the introspection socket will be closed. Signed-off-by: Adalbert Lazăr --- virt/kvm/kvmi_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt/kvm/kvmi_msg.c b/virt/kvm/kvmi_msg.c

[RFC PATCH v6 89/92] kvm: x86: make lock cmpxchg r, r/m atomic

2019-08-09 Thread Adalbert Lazăr
-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_emulate.h | 2 +- arch/x86/kvm/emulate.c | 57 +++--- arch/x86/kvm/x86.c | 48 ++--- 3 files changed, 89 insertions(+), 18 deletions(-) diff --git a/arch/x86/include/asm

[RFC PATCH v6 36/92] KVM: VMX: Implement functions for SPPT paging setup

2019-08-09 Thread Adalbert Lazăr
-developed-by: Zhang Yi Signed-off-by: Zhang Yi Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-4-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 7 +- arch/x86/kvm/mmu.c

[RFC PATCH v6 40/92] KVM: VMX: Handle SPP induced vmexit and page fault

2019-08-09 Thread Adalbert Lazăr
Weijiang Message-Id: <20190717133751.12910-8-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/vmx.h | 7 arch/x86/include/uapi/asm/vmx.h | 2 + arch/x86/kvm/mmu.c | 17 arch/x86/kvm/vmx/vmx.c

[RFC PATCH v6 66/92] kvm: introspection: add custom input when single-stepping a vCPU

2019-08-09 Thread Adalbert Lazăr
data. Signed-off-by: Adalbert Lazăr --- virt/kvm/kvmi.c | 119 virt/kvm/kvmi_int.h | 3 ++ 2 files changed, 122 insertions(+) diff --git a/virt/kvm/kvmi.c b/virt/kvm/kvmi.c index 3dfedf3ae739..06dc23f40ded 100644 --- a/virt/kvm/kvmi.c +++ b

[RFC PATCH v6 08/92] kvm: introspection: add KVMI_CHECK_COMMAND and KVMI_CHECK_EVENT

2019-08-09 Thread Adalbert Lazăr
. As with the KVMI_GET_VERSION command, these commands can never be disallowed by userspace/QEMU. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 60 ++ include/uapi/linux/kvmi.h | 12 ++ virt/kvm/kvmi.c| 8

[RFC PATCH v6 09/92] kvm: introspection: add KVMI_GET_GUEST_INFO

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu For now, this command returns only the number of online vCPUs. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 18 ++ include/uapi/linux/kvmi.h | 5 + virt/kvm/kvmi_msg.c| 14

[RFC PATCH v6 58/92] kvm: introspection: add KVMI_GET_MTRR_TYPE

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This command returns the memory type for a guest physical address. Signed-off-by: Mihai Donțu Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 32 ++ arch/x86

[RFC PATCH v6 84/92] kvm: x86: enable the half part of movss, movsd, movups

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu A previous patch added emulation support for these instructions with a register source and memory destination. This patch adds the variants with a memory source and a register destination. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c

[RFC PATCH v6 55/92] kvm: introspection: add KVMI_CONTROL_MSR and KVMI_EVENT_MSR

2019-08-09 Thread Adalbert Lazăr
. This is meant to prevent malicious changes to MSR-s such as MSR_IA32_SYSENTER_EIP. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 73 + arch/x86/include/asm/kvm_host.h| 4 + arch/x86/include/asm/kvmi_host.h | 6 ++ arch

[RFC PATCH v6 61/92] kvm: introspection: add KVMI_EVENT_BREAKPOINT

2019-08-09 Thread Adalbert Lazăr
a certain operation (like creating a process). Signed-off-by: Mihai Donțu Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 36 + arch/x86/kvm/kvmi.c| 20 +++ arch/x86/kvm/svm.c

[RFC PATCH v6 87/92] kvm: x86: emulate xorps xmm/m128, xmm

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This extends the previous xorpd by creating a dedicated group, something I should have done since the very beginning. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 22 +- 1 file changed, 21 insertions(+), 1

[RFC PATCH v6 60/92] kvm: x86: add kvm_arch_vcpu_set_guest_debug()

2019-08-09 Thread Adalbert Lazăr
This function is need in order to intercept breakpoints and send KVMI_EVENT_BREAKPOINT events to the introspection tool. Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 18 +- include/linux/kvm_host.h | 2 ++ 2 files changed, 15 insertions(+), 5 deletions(-) diff

[RFC PATCH v6 81/92] kvm: x86: emulate movq xmm, m64

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed in order to be able to support guest code that uses movq to write into pages that are marked for write tracking. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 24 +++- 1 file changed, 15 insertions

[RFC PATCH v6 70/92] kvm: x86: filter out access rights only when tracked by the introspection tool

2019-08-09 Thread Adalbert Lazăr
It should complete the commit fd34a9518173 ("kvm: x86: consult the page tracking from kvm_mmu_get_page() and __direct_map()") Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/mmu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 65

[RFC PATCH v6 88/92] kvm: x86: emulate fst/fstp m64fp

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This adds support for fst m64fp and fstp m64fp. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[RFC PATCH v6 56/92] kvm: x86: block any attempt to disable MSR interception if tracked by introspection

2019-08-09 Thread Adalbert Lazăr
-by: Adalbert Lazăr --- arch/x86/include/asm/kvmi_host.h | 6 +++ arch/x86/kvm/kvmi.c | 25 + arch/x86/kvm/svm.c | 33 ++--- arch/x86/kvm/vmx/vmx.c | 63 +++- 4 files changed, 88 insertions(+), 39 deletions

[RFC PATCH v6 46/92] kvm: introspection: add KVMI_SET_PAGE_WRITE_BITMAP

2019-08-09 Thread Adalbert Lazăr
This command sets the subpage protection (SPP) write bitmap for an array of guest physical addresses of 4KB bytes. Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 66

[RFC PATCH v6 65/92] kvm: introspection: add KVMI_EVENT_SINGLESTEP

2019-08-09 Thread Adalbert Lazăr
From: Nicușor Cîțu This event is sent when the current instruction has been single stepped as a result of a KVMI_EVENT_PF event to which the introspection tool set the singlestep field and responded with CONTINUE. Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- Documentation

[RFC PATCH v6 41/92] KVM: MMU: Enable Lazy mode SPPT setup

2019-08-09 Thread Adalbert Lazăr
Weijiang Message-Id: <20190717133751.12910-9-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/mmu.c | 24 1 file changed, 24 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index d59108a3ebbf..24222e3add91 100644 --- a/arch/x

[RFC PATCH v6 63/92] kvm: introspection: add KVMI_EVENT_DESCRIPTOR

2019-08-09 Thread Adalbert Lazăr
of interested will be suppressed (after some appropriate guest-side handling) while the rest will be sent to the introspector via a VMCALL. Signed-off-by: Nicușor Cîțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 38 +++ arch/x86

[RFC PATCH v6 19/92] kvm: introspection: add KVMI_EVENT_CREATE_VCPU

2019-08-09 Thread Adalbert Lazăr
From: Mircea Cîrjaliu This event is sent when a vCPU is ready to be introspected. Signed-off-by: Mircea Cîrjaliu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 23 +++ virt/kvm/kvmi.c| 47

[RFC PATCH v6 26/92] kvm: x86: add kvm_mmu_nested_pagefault()

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed to filter #PF introspection events. Signed-off-by: Mihai Donțu Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 4 arch/x86/kvm/mmu.c | 5 + arch/x86/kvm

[RFC PATCH v6 25/92] kvm: x86: intercept the write access on sidt and other emulated instructions

2019-08-09 Thread Adalbert Lazăr
This is needed for the introspection subsystem to track the changes to descriptor table registers. CC: Joerg Roedel Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7aef002be551

[RFC PATCH v6 69/92] kvm: x86: keep the page protected if tracked by the introspection tool

2019-08-09 Thread Adalbert Lazăr
This patch might be obsolete thanks to single-stepping. Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2c06de73a784..06f44ce8ed07 100644 --- a/arch/x86/kvm/x86.c

[RFC PATCH v6 91/92] kvm: x86: emulate lock cmpxchg16b m128

2019-08-09 Thread Adalbert Lazăr
, writeback is completely disabled as the operation is executed directly on guest memory, unless the architecture does not advertise CMPXCHG16B in CPUID. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 117 ++--- arch/x86/kvm

[RFC PATCH v6 13/92] kvm: introspection: make the vCPU wait even when its jobs list is empty

2019-08-09 Thread Adalbert Lazăr
ends a new job in the same time. Signed-off-by: Adalbert Lazăr --- include/linux/swait.h | 11 ++ virt/kvm/kvmi.c | 80 +++ virt/kvm/kvmi_int.h | 2 ++ 3 files changed, 93 insertions(+) diff --git a/include/linux/swait.h b/include/linux/swa

[RFC PATCH v6 42/92] KVM: MMU: Handle host memory remapping and reclaim

2019-08-09 Thread Adalbert Lazăr
: <20190717133751.12910-10-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/mmu.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 24222e3add91..0b859b1797f6 100644 --- a/arch/x86/kvm/mmu.c +++ b/ar

[RFC PATCH v6 47/92] kvm: introspection: add KVMI_READ_PHYSICAL and KVMI_WRITE_PHYSICAL

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu These commands allows the introspection tool to read/write from/to the guest memory. Signed-off-by: Mihai Donțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 60 include/uapi/linux/kvmi.h

[RFC PATCH v6 59/92] kvm: introspection: add KVMI_EVENT_XSETBV

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This event is sent when the extended control register XCR0 is going to be changed. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 25 +++ arch/x86/include/asm/kvmi_host.h | 5 arch/x86/kvm/kvmi.c

[RFC PATCH v6 73/92] kvm: introspection: use remote mapping

2019-08-09 Thread Adalbert Lazăr
From: Mircea Cîrjaliu This commit adds the missing KVMI_GET_MAP_TOKEN command and handle the hypercalls used to map/unmap guest pages. Suggested-by: Paolo Bonzini Signed-off-by: Mircea Cîrjaliu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 39 arch/x86/kvm

[RFC PATCH v6 80/92] kvm: x86: emulate movss xmm, m32

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed in order to be able to support guest code that uses movss to write into pages that are marked for write tracking. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[RFC PATCH v6 68/92] kvm: x86: emulate a guest page table walk on SPT violations due to A/D bit updates

2019-08-09 Thread Adalbert Lazăr
-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/include/asm/kvmi_host.h | 6 ++ arch/x86/kvm/kvmi.c | 34 +++- arch/x86/kvm/mmu.c | 11 +-- arch/x86/kvm/x86.c | 6 +++--- include/linux/kvmi.h

[RFC PATCH v6 78/92] kvm: x86: add tracepoints for interrupt and exception injections

2019-08-09 Thread Adalbert Lazăr
due to a buggy VMEXIT handler. Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/svm.c | 9 +++- arch/x86/kvm/trace.h | 118 - arch/x86/kvm/vmx/vmx.c | 8 ++- arch/x86/kvm/x86.c | 12 +++-- 4 files changed, 116

[RFC PATCH v6 51/92] kvm: introspection: add KVMI_SET_REGISTERS

2019-08-09 Thread Adalbert Lazăr
-off-by: Mircea Cîrjaliu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 28 + arch/x86/kvm/x86.c | 33 ++ include/linux/kvm_host.h | 1 + virt/kvm/kvmi.c| 25

[RFC PATCH v6 39/92] KVM: VMX: Introduce SPP user-space IOCTLs

2019-08-09 Thread Adalbert Lazăr
-by: Zhang Yi Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-7-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 73 include/linux/kvm_host.h | 3 ++ include/uapi

[RFC PATCH v6 50/92] kvm: introspection: add KVMI_GET_REGISTERS

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This command is used to get kvm_regs and kvm_sregs structures, plus the list of struct kvm_msrs. Signed-off-by: Mihai Donțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 43 arch/x86/include/uapi/asm

[RFC PATCH v6 79/92] kvm: x86: emulate movsd xmm, m64

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed in order to be able to support guest code that uses movsd to write into pages that are marked for write tracking. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 32 +++- 1 file changed, 27

[RFC PATCH v6 83/92] kvm: x86: emulate movd xmm, m32

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed in order to be able to support guest code that uses movd to write into pages that are marked for write tracking. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 12 +++- 1 file changed, 11 insertions(+), 1

[RFC PATCH v6 67/92] kvm: introspection: use single stepping on unimplemented instructions

2019-08-09 Thread Adalbert Lazăr
-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 5 +++ arch/x86/include/asm/vmx.h | 2 ++ arch/x86/kvm/kvmi.c | 21 arch/x86/kvm/mmu.c | 5 +++ arch/x86/kvm/svm.c | 8 + arch/x86/kvm/vmx/vmx.c | 13 ++-- arch

[RFC PATCH v6 21/92] kvm: page track: add track_create_slot() callback

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is used to add page access notifications as soon as a slot appears. CC: Xiao Guangrong Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_page_track.h | 5 - arch/x86/kvm/page_track.c | 18 -- arch

[RFC PATCH v6 75/92] kvm: x86: disable gpa_available optimization in emulator_read_write_onepage()

2019-08-09 Thread Adalbert Lazăr
is introspected, not just because the introspection subsystem is present. Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 965c4f0108eb..3975331230b9 100644 --- a/arch/x86/kvm/x86.c

[RFC PATCH v6 86/92] kvm: x86: emulate xorpd xmm2/m128, xmm1

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This adds support for xorpd xmm2/m128, xmm1. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/emulate.c | 19 ++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[RFC PATCH v6 17/92] kvm: introspection: introduce event actions

2019-08-09 Thread Adalbert Lazăr
path", while the RETRY action as "re-enter guest". Note: KVMI_EVENT_UNHOOK, a VM event, doesn't have/need a reply. Suggested-by: Paolo Bonzini Signed-off-by: Mihai Donțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 10 ++

[RFC PATCH v6 22/92] kvm: x86: provide all page tracking hooks with the guest virtual address

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu This is needed because the emulator calls the page tracking code irrespective of the current VMEXIT reason or available information. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/include/asm

[RFC PATCH v6 12/92] kvm: introspection: add a jobs list to every introspected vCPU

2019-08-09 Thread Adalbert Lazăr
șor Cîțu Signed-off-by: Nicușor Cîțu Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvm_host.h | 1 + virt/kvm/kvmi.c | 102 +++- virt/kvm/kvmi_int.h | 9 +++ 3 files changed, 111 insertions(+), 1 deletion(-) diff --git a/

[RFC PATCH v6 10/92] kvm: introspection: add KVMI_CONTROL_VM_EVENTS

2019-08-09 Thread Adalbert Lazăr
own_ for X=KVMI_EVENT_CREATE_VCPU. Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 39 ++ include/uapi/linux/kvmi.h | 7 ++ virt/kvm/kvmi.c| 11 + virt/kvm/kvmi_int.h| 3 +++ virt/kvm/kvmi_msg.c

[RFC PATCH v6 34/92] Documentation: Introduce EPT based Subpage Protection

2019-08-09 Thread Adalbert Lazăr
From: Yang Weijiang Co-developed-by: yi.z.zh...@linux.intel.com Signed-off-by: yi.z.zh...@linux.intel.com Co-developed-by: Yang Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-2-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- Documentation/virtu

[RFC PATCH v6 35/92] KVM: VMX: Add control flags for SPP enabling

2019-08-09 Thread Adalbert Lazăr
Weijiang Signed-off-by: Yang Weijiang Message-Id: <20190717133751.12910-3-weijiang.y...@intel.com> Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/vmx.h | 1 + arch/x86/kernel/cpu/intel.c| 4 arch/x86/kvm/vmx/capabili

[RFC PATCH v6 54/92] kvm: introspection: add KVMI_CONTROL_CR and KVMI_EVENT_CR

2019-08-09 Thread Adalbert Lazăr
From: Mihai Donțu Using the KVMI_CONTROL_CR command, the introspection tool subscribes to KVMI_EVENT_CR events that will be sent when CR{0,3,4} is going to be changed. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 70

[RFC PATCH v6 71/92] mm: add support for remote mapping

2019-08-09 Thread Adalbert Lazăr
runs, points to the indicated page into the introspected guest. I have not included here the use of the mapping token described in the KVMI documentation. Signed-off-by: Mircea Cîrjaliu Signed-off-by: Adalbert Lazăr --- include/linux/page-flags.h |9 +- include/linux/remote_mapping.h

[RFC PATCH v6 15/92] kvm: introspection: handle vCPU related introspection commands

2019-08-09 Thread Adalbert Lazăr
). Signed-off-by: Mihai Donțu Co-developed-by: Nicușor Cîțu Signed-off-by: Nicușor Cîțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 8 ++ include/uapi/linux/kvm_para.h | 4 +- include/uapi/linux/kvmi.h | 6 ++ virt

[RFC PATCH v6 44/92] kvm: introspection: extend the internal database of tracked pages with write_bitmap info

2019-08-09 Thread Adalbert Lazăr
This will allow us to use the subpage protection feature. Signed-off-by: Adalbert Lazăr --- virt/kvm/kvmi.c | 46 + virt/kvm/kvmi_int.h | 1 + 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/virt/kvm/kvmi.c b/virt/kvm/kvmi.c index

[RFC PATCH v6 74/92] kvm: x86: do not unconditionally patch the hypercall instruction during emulation

2019-08-09 Thread Adalbert Lazăr
Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- arch/x86/kvm/x86.c | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 04b1d2916a0a..965c4f0108eb 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86

[RFC PATCH v6 31/92] kvm: introspection: add KVMI_EVENT_PF

2019-08-09 Thread Adalbert Lazăr
Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 63 ++ arch/x86/kvm/kvmi.c| 38 ++- arch/x86/kvm/x86.c | 7 +- include/linux/kvmi.h | 4 ++ include/uapi/linux/kvmi.h | 18 + virt/kvm

[RFC PATCH v6 27/92] kvm: introspection: use page track

2019-08-09 Thread Adalbert Lazăr
-by: Marian Rotariu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- arch/x86/include/asm/kvmi_host.h | 12 ++ arch/x86/kvm/kvmi.c | 45 + include/uapi/linux/kvmi.h| 4 + virt/kvm/kvmi.c | 293 ++- virt/kvm

[RFC PATCH v6 03/92] kvm: introspection: add permission access ioctls

2019-08-09 Thread Adalbert Lazăr
allowed (those querying the introspection capabilities). Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/api.txt | 56 +++- include/uapi/linux/kvm.h | 6 +++ virt/kvm/kvm_main.c | 6 +++ virt/kvm/kvmi.c | 85

[RFC PATCH v6 16/92] kvm: introspection: handle events and event replies

2019-08-09 Thread Adalbert Lazăr
ff-by: Mihai Donțu Co-developed-by: Adalbert Lazăr Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 56 + arch/x86/include/uapi/asm/kvmi.h | 29 +++ arch/x86/kvm/Makefile | 2 +- arch/x86/kvm/kvmi.c| 92

[RFC PATCH v6 32/92] kvm: introspection: add KVMI_GET_PAGE_ACCESS

2019-08-09 Thread Adalbert Lazăr
to mention that the KVMI_EVENT_PF events are sent only for EPT violation caused by these restrictions. So, we might drop this command. Signed-off-by: Mihai Donțu Signed-off-by: Adalbert Lazăr --- Documentation/virtual/kvm/kvmi.rst | 54 ++ arch/x86/kvm/kvmi.c

  1   2   3   4   5   6   7   >