qemu-devel
[Top][All Lists]
Advanced

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

[RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op


From: David Woodhouse
Subject: [RFC PATCH 13/21] i386/xen: implement HYPERVISOR_hvm_op
Date: Mon, 5 Dec 2022 17:31:29 +0000

From: Joao Martins <joao.m.martins@oracle.com>

This is when guest queries for support for HVMOP_pagetable_dying.

Signed-off-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 target/i386/xen.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/target/i386/xen.c b/target/i386/xen.c
index 5d2d8a7e00..38d4cae3d0 100644
--- a/target/i386/xen.c
+++ b/target/i386/xen.c
@@ -17,6 +17,7 @@
 
 #include "standard-headers/xen/version.h"
 #include "standard-headers/xen/memory.h"
+#include "standard-headers/xen/hvm/hvm_op.h"
 
 #define PAGE_OFFSET    0xffffffff80000000UL
 #define PAGE_SHIFT     12
@@ -181,6 +182,20 @@ static int kvm_xen_hcall_memory_op(struct kvm_xen_exit 
*exit,
     return err ? HCALL_ERR : 0;
 }
 
+static int kvm_xen_hcall_hvm_op(struct kvm_xen_exit *exit,
+                                int cmd, uint64_t arg)
+{
+    switch (cmd) {
+    case HVMOP_pagetable_dying: {
+            exit->u.hcall.result = -ENOSYS;
+            return 0;
+        }
+    }
+
+    exit->u.hcall.result = -ENOSYS;
+    return HCALL_ERR;
+}
+
 static int __kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)
 {
     uint16_t code = exit->u.hcall.input;
@@ -191,6 +206,9 @@ static int __kvm_xen_handle_exit(X86CPU *cpu, struct 
kvm_xen_exit *exit)
     }
 
     switch (code) {
+    case __HYPERVISOR_hvm_op:
+        return kvm_xen_hcall_hvm_op(exit, exit->u.hcall.params[0],
+                                    exit->u.hcall.params[1]);
     case __HYPERVISOR_memory_op:
         return kvm_xen_hcall_memory_op(exit, exit->u.hcall.params[0],
                                        exit->u.hcall.params[1], cpu);
-- 
2.35.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]