From patchwork Thu Jun 16 14:07:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corneliu ZUZU X-Patchwork-Id: 9181009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0965C60776 for ; Thu, 16 Jun 2016 14:09:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEAEB280B0 for ; Thu, 16 Jun 2016 14:09:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3B5D28357; Thu, 16 Jun 2016 14:09:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 656E8280B0 for ; Thu, 16 Jun 2016 14:09:54 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDXxd-0004Ao-R5; Thu, 16 Jun 2016 14:07:57 +0000 Received: from mail6.bemta6.messagelabs.com ([85.158.143.247]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bDXxc-0004A9-HV for xen-devel@lists.xen.org; Thu, 16 Jun 2016 14:07:56 +0000 Received: from [85.158.143.35] by server-1.bemta-6.messagelabs.com id D4/34-09256-BB2B2675; Thu, 16 Jun 2016 14:07:55 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrFIsWRWlGSWpSXmKPExsUSfTxjoe7uTUn hBrPPqlgs+biYxYHR4+ju30wBjFGsmXlJ+RUJrBmfe+8zFmzgrjj16ghrA+NRzi5GTg4hAQ+J HTOPM3UxcgHZaxkl3q/eyALhnGSU+LHsFhtM1b/eaewQidWMErMuX2QBSbAJaEucO3SPCcQWE ZCWuPb5MiNIEbPAUkaJ2V9esoMkhAVCJC4s/MUMYrMIqEr8v/0fbCqvgIvE0ge3WbsYOTgkBO QkFlxIBwlzCrhKfNg7kQ0kLARU0nUwEiQsIZAj8XliFzNEtZTE/1YlkE0SAl0sEpvalzND1Mh IPJp4k20Co9ACRoZVjOrFqUVlqUW6xnpJRZnpGSW5iZk5uoYGZnq5qcXFiempOYlJxXrJ+bmb GIFhyAAEOxg7/jkdYpTkYFIS5a2vTwoX4kvKT6nMSCzOiC8qzUktPsQow8GhJMG7ciNQTrAoN T21Ii0zBxgRMGkJDh4lEd49IGne4oLE3OLMdIjUKUZFKXHeepCEAEgiozQPrg0WhZcYZaWEeR mBDhHiKUgtys0sQZV/xSjOwagkzLsNZApPZl4J3PRXQIuZgBbbTI8HWVySiJCSamCU3PNnu+x mZR2Z3HOa2+OMOSbd281Skiz17HQU+8lKhkaeBMWdHQqVjz+EaPrw/p/82UUkcAG/zM2y/XGH ZIwP9jFevqfP1Xpg/ha15SnLbZS/bv+z4sXcORvsQw01f81e38gpnsm9+u++HUdME958O7pyX kbNwohIzksv9813E/v73srxfky/EktxRqKhFnNRcSIADwtKsL0CAAA= X-Env-Sender: czuzu@bitdefender.com X-Msg-Ref: server-15.tower-21.messagelabs.com!1466086074!19265849!1 X-Originating-IP: [91.199.104.161] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 8.46; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20840 invoked from network); 16 Jun 2016 14:07:55 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-15.tower-21.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 16 Jun 2016 14:07:55 -0000 Received: (qmail 19652 invoked from network); 16 Jun 2016 17:07:54 +0300 Received: from unknown (HELO mx-sr.buh.bitdefender.com) (10.17.80.103) by mx01.bbu.dsd.mx.bitdefender.com with AES256-GCM-SHA384 encrypted SMTP; 16 Jun 2016 17:07:54 +0300 Received: from smtp01.buh.bitdefender.com (unknown [10.17.80.75]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id 3A5367FBD2 for ; Thu, 16 Jun 2016 17:07:54 +0300 (EEST) Received: (qmail 28496 invoked from network); 16 Jun 2016 17:07:54 +0300 Received: from unknown (HELO czuzu-dev-vm.clj.bitdefender.biz) (czuzu@bitdefender.com@91.199.104.243) by smtp01.buh.bitdefender.com with SMTP; 16 Jun 2016 17:07:54 +0300 From: Corneliu ZUZU To: xen-devel@lists.xen.org Date: Thu, 16 Jun 2016 17:07:57 +0300 Message-Id: <1466086077-7518-1-git-send-email-czuzu@bitdefender.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1466085888-7428-1-git-send-email-czuzu@bitdefender.com> References: <1466085888-7428-1-git-send-email-czuzu@bitdefender.com> X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp01.buh.bitdefender.com, sigver: 7.65934 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 424498, Stamp: 3], Multi: [Enabled, t: (0.000008, 0.001780)], BW: [Enabled, t: (0.000007,0.000002)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002316), Flags: BB9BAF5C; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO], SGN: [Enabled, t: (0.010539)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.013615), Hit: No, Details: v2.4.2; Id: 2m1ghmj.1akqg6v7g.qu6j], total: 0(775) X-BitDefender-CF-Stamp: none Cc: Andrew Cooper , Tamas K Lengyel , Jan Beulich , Razvan Cojocaru Subject: [Xen-devel] [PATCH 2/7] vm-event: VM_EVENT_FLAG_DENY requires VM_EVENT_FLAG_VCPU_PAUSED X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP For VM_EVENT_FLAG_DENY to work, the vcpu must be paused (sync = 1) until the vm-event is handled. A vm-event response having VM_EVENT_FLAG_DENY flag set should also set the VM_EVENT_FLAG_VCPU_PAUSED flag. Enforce that in vm_event_register_write_resume(). Signed-off-by: Corneliu ZUZU --- xen/arch/x86/vm_event.c | 3 ++- xen/include/public/vm_event.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/vm_event.c b/xen/arch/x86/vm_event.c index 5635603..75647c4 100644 --- a/xen/arch/x86/vm_event.c +++ b/xen/arch/x86/vm_event.c @@ -70,7 +70,8 @@ void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v) void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp) { - if ( rsp->flags & VM_EVENT_FLAG_DENY ) + if ( (rsp->flags & VM_EVENT_FLAG_DENY) && + (rsp->flags & VM_EVENT_FLAG_VCPU_PAUSED) ) { struct monitor_write_data *w = &v->arch.vm_event->write_data; diff --git a/xen/include/public/vm_event.h b/xen/include/public/vm_event.h index 586f43b..8f94e20 100644 --- a/xen/include/public/vm_event.h +++ b/xen/include/public/vm_event.h @@ -77,6 +77,7 @@ /* * Deny completion of the operation that triggered the event. * Currently only useful for MSR and control-register write events. + * Requires the vCPU to be paused already (synchronous events only). */ #define VM_EVENT_FLAG_DENY (1 << 6) /*