qemu-devel
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v2 10/22] i386/xen: handle guest hypercalls


From: Paolo Bonzini
Subject: Re: [RFC PATCH v2 10/22] i386/xen: handle guest hypercalls
Date: Mon, 12 Dec 2022 18:07:43 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0

On 12/9/22 10:56, David Woodhouse wrote:
+static bool __kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)

No double underscores in userspace.

+{
+    uint16_t code = exit->u.hcall.input;
+
+    if (exit->u.hcall.cpl > 0) {
+        exit->u.hcall.result = -EPERM;
+        return true;
+    }
+
+    switch (code) {
+    default:
+        return false;
+    }
+}
+
+int kvm_xen_handle_exit(X86CPU *cpu, struct kvm_xen_exit *exit)

BTW, please name this file either target/i386/xen-emu.c or target/i386/kvm/xen-emu.c (probably the latter is better, since XEN_EMU depends on KVM.)

Paolo




reply via email to

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