From patchwork Fri Aug 5 07:08:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Razvan Cojocaru X-Patchwork-Id: 9264837 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 DF97F60839 for ; Fri, 5 Aug 2016 07:11:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF72C28409 for ; Fri, 5 Aug 2016 07:11:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C38B828422; Fri, 5 Aug 2016 07:11:17 +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 C6D2928409 for ; Fri, 5 Aug 2016 07:11:16 +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 1bVZFD-0006DB-IN; Fri, 05 Aug 2016 07:08:35 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bVZFC-0006D5-6E for xen-devel@lists.xen.org; Fri, 05 Aug 2016 07:08:34 +0000 Received: from [85.158.137.68] by server-12.bemta-3.messagelabs.com id 96/69-09160-17B34A75; Fri, 05 Aug 2016 07:08:33 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprAIsWRWlGSWpSXmKPExsUSfTxjoW6h9ZJ wgxUPmSyWfFzM4sDocXT3b6YAxijWzLyk/IoE1oxjy8+yF6zgqJjRtJilgXE9WxcjB4eQgLvE m5XWXYycQOYaRok/t4W7GLmA7GuMEk03ljFBJNwkZjxoZoFI7GOUeLT5FhtIgk3AUGL1xhYwW 0RAWuLa58uMIDazQJ7EixWTmUAWCAv4Sry4UwASZhFQlbg49SLYTF4BT4mF92ezgtgSAnISJ4 9NhrJzJD5tWgl2m4SAlMT/ViWQtRICy1kkFm04xgJRIyPxaOJNtgmMAgsYGVYxqhenFpWlFul a6iUVZaZnlOQmZuboGhoY6+WmFhcnpqfmJCYV6yXn525iBIZUPQMD4w7G1z+dDjFKcjApifLm bV4cLsSXlJ9SmZFYnBFfVJqTWnyIUYaDQ0mC96zlknAhwaLU9NSKtMwcYHDDpCU4eJREeHmtg NK8xQWJucWZ6RCpU4yKUuK8H0D6BEASGaV5cG2wiLrEKCslzMvIwMAgxFOQWpSbWYIq/4pRnI NRSZiXB2Q8T2ZeCdz0V0CLmYAWnzBYALK4JBEhJdXAqF6q891MfYaeYeqH4vYtj5wK/3qu6/9 5K+R6kGxR2MdpOnVWD7122Z5wvF/q7uCmXln50GjP4n1zgzZMY/8c8v56T5VY69MG1nkHi7pk uV9mv3TybhH96JiQ5pLQc/H/l0u1jdouF0+ukOKM+ORUkOG7Oe7i2nOncy1nzNy8xuJk3f9D3 TdblViKMxINtZiLihMBb2rIkqMCAAA= X-Env-Sender: rcojocaru@bitdefender.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1470380912!50173730!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.77; banners=-,-,- X-VirusChecked: Checked Received: (qmail 25647 invoked from network); 5 Aug 2016 07:08:32 -0000 Received: from mx01.bbu.dsd.mx.bitdefender.com (HELO mx01.bbu.dsd.mx.bitdefender.com) (91.199.104.161) by server-15.tower-31.messagelabs.com with DHE-RSA-AES128-GCM-SHA256 encrypted SMTP; 5 Aug 2016 07:08:32 -0000 Received: (qmail 26450 invoked from network); 5 Aug 2016 10:08:31 +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; 5 Aug 2016 10:08:31 +0300 Received: from smtp03.buh.bitdefender.org (smtp.bitdefender.biz [10.17.80.77]) by mx-sr.buh.bitdefender.com (Postfix) with ESMTP id AB8537FBEF for ; Fri, 5 Aug 2016 10:08:31 +0300 (EEST) Received: (qmail 8344 invoked from network); 5 Aug 2016 10:08:31 +0300 Received: from xen.dsd.ro (HELO xen.dsd.bitdefender.biz) (rcojocaru@bitdefender.com@10.10.14.109) by smtp03.buh.bitdefender.org with AES128-SHA256 encrypted SMTP; 5 Aug 2016 10:08:31 +0300 From: Razvan Cojocaru To: xen-devel@lists.xen.org Date: Fri, 5 Aug 2016 10:08:19 +0300 Message-Id: <1470380899-11382-1-git-send-email-rcojocaru@bitdefender.com> X-Mailer: git-send-email 1.9.1 X-BitDefender-Scanner: Clean, Agent: BitDefender qmail 3.1.6 on smtp03.buh.bitdefender.org, sigver: 7.66681 X-BitDefender-Spam: No (0) X-BitDefender-SpamStamp: Build: [Engines: 2.15.6.911, Dats: 429920, Stamp: 3], Multi: [Enabled, t: (0.000014, 0.001434)], BW: [Enabled, t: (0.000010,0.000001)], RBL DNSBL: [Disabled], APM: [Enabled, Score: 500, t: (0.002121), Flags: 85D2ED72; NN_NO_CONTENT_TYPE; NN_NO_LINK_NMD; NN_LEGIT_BITDEFENDER; NN_LEGIT_S_SQARE_BRACKETS; NN_LEGIT_MAILING_LIST_TO; NN_LEGIT_ML_MAIL_LIST_ADN], SGN: [Enabled, t: (0.017623)], URL: [Enabled, t: (0.000005)], RTDA: [Enabled, t: (0.011767), Hit: No, Details: v2.3.10; Id: 2m1ghk0.1apanqtu1.3s34], total: 0(775) X-BitDefender-CF-Stamp: none Cc: andrew.cooper3@citrix.com, keir@xen.org, Razvan Cojocaru , jbeulich@suse.com Subject: [Xen-devel] [PATCH] x86/hvm: Allow guest_request vm_events coming from userspace 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 Allow guest userspace code to request that a vm_event be sent out via VMCALL. This functionality seems to be handy for a number of Xen developers, as stated on the mailing list (thread "[Xen-devel] HVMOP_guest_request_vm_event only works from guest in ring0"). Signed-off-by: Razvan Cojocaru --- xen/arch/x86/hvm/hvm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 202866a..2d38936 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5349,8 +5349,14 @@ int hvm_do_hypercall(struct cpu_user_regs *regs) switch ( mode ) { case 8: + if ( eax == __HYPERVISOR_hvm_op && + regs->rdi == HVMOP_guest_request_vm_event ) + break; case 4: case 2: + if ( eax == __HYPERVISOR_hvm_op && + regs->_ebx == HVMOP_guest_request_vm_event ) + break; hvm_get_segment_register(curr, x86_seg_ss, &sreg); if ( unlikely(sreg.attr.fields.dpl) ) {