[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2] x86/hvm: Allow guest_request vm_events coming from userspace


  • To: xen-devel@xxxxxxxxxxxxx
  • From: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>
  • Date: Tue, 1 Aug 2017 12:46:16 +0300
  • Cc: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, andrew.cooper3@xxxxxxxxxx, jbeulich@xxxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Tue, 01 Aug 2017 09:53:25 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=cqvPspgMXURyIR2xWoSiRMxofj6s3XPcyhTsZlqXknszMIFNGXcOYTZ3vPdaP+pxjpoaSg7GB2vpNAi2kG5xDX/KZemFLAEnoRNvSMKhKDmH3wohKJMmgYmTs5z2XZ/0HJi3uBS/D+4gJLbdKNAcVFXZFlJ4z2zU/uXBFe/qavoZ+emaJBedq+vpX1B9pkZpIpt0FVBOSqaYteKzXvnSkqrTj+5pbCpvhxPgCM9BaRY6NyUSJ1GUCjrtr2JXPrRBCmCYgksgut+kW81S+fKKDeoUKrjh+gVCMmbLyK+JZc/XBE6ZhaQSFPwIltARKLtAIFs5KZ6VOw7Wu/51HSiH4w==; h=Received:Received:Received:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

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").
This is a use case in communication between a userspace application
in the guest and the introspection application in dom0.

Signed-off-by: Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>

---
Changes since V1:
        - Added Fallthrough check on mode == 2
---
 xen/arch/x86/hvm/hypercall.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/xen/arch/x86/hvm/hypercall.c b/xen/arch/x86/hvm/hypercall.c
index e7238ce..1c067c3 100644
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -152,9 +152,15 @@ int hvm_hypercall(struct cpu_user_regs *regs)
     {
     case 8:
         eax = regs->rax;
+        if ( eax == __HYPERVISOR_hvm_op &&
+             regs->rdi == HVMOP_guest_request_vm_event )
+            break;
         /* Fallthrough to permission check. */
     case 4:
     case 2:
+        if ( mode != 8 && eax == __HYPERVISOR_hvm_op &&
+             regs->ebx == HVMOP_guest_request_vm_event )
+            break;
         if ( unlikely(hvm_get_cpl(curr)) )
         {
     default:
-- 
2.7.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.