From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id 3F9DF6B0268 for ; Mon, 18 Dec 2017 14:07:08 -0500 (EST) Received: by mail-wm0-f72.google.com with SMTP id k126so7842114wmd.5 for ; Mon, 18 Dec 2017 11:07:08 -0800 (PST) Received: from mx02.buh.bitdefender.com (mx02.bbu.dsd.mx.bitdefender.com. [91.199.104.133]) by mx.google.com with ESMTPS id 31si9919043wrm.4.2017.12.18.11.07.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 11:07:07 -0800 (PST) From: =?UTF-8?q?Adalber=20Laz=C4=83r?= Subject: [RFC PATCH v4 10/18] kvm: x86: handle the new vCPU request (KVM_REQ_INTROSPECTION) Date: Mon, 18 Dec 2017 21:06:34 +0200 Message-Id: <20171218190642.7790-11-alazar@bitdefender.com> In-Reply-To: <20171218190642.7790-1-alazar@bitdefender.com> References: <20171218190642.7790-1-alazar@bitdefender.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org List-ID: To: kvm@vger.kernel.org Cc: linux-mm@kvack.org, Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Xiao Guangrong , =?UTF-8?q?Mihai=20Don=C8=9Bu?= , Adalbert Lazar From: Adalbert Lazar The thread/worker receiving vCPU commands (from the guest introspection tool) signals the vCPU by placing the command in a vCPU buffer, sets this vCPU request bit and kicks the vCPU. This patch adds the call to the introspection handler that will: - execute the command - send the results back to the introspection tool - pause the vCPU (if requested) Signed-off-by: Adalbert LazA?r --- arch/x86/kvm/x86.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index cdfc7200a018..9889e96f64e6 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -20,6 +20,7 @@ */ #include +#include #include "irq.h" #include "mmu.h" #include "i8254.h" @@ -6904,6 +6905,9 @@ static int vcpu_enter_guest(struct kvm_vcpu *vcpu) */ if (kvm_check_request(KVM_REQ_HV_STIMER, vcpu)) kvm_hv_process_stimers(vcpu); + + if (kvm_check_request(KVM_REQ_INTROSPECTION, vcpu)) + kvmi_handle_request(vcpu); } if (kvm_check_request(KVM_REQ_EVENT, vcpu) || req_int_win) { -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org