]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/hvm: Unify hvm_event_pending()'s API with the !CONFIG_HVM version
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 8 Nov 2018 18:12:19 +0000 (18:12 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 14 Nov 2018 18:42:48 +0000 (18:42 +0000)
This patch should have been part of, or a prerequiesite of, c/s 981c9a78 "x86:
provide stubs, declarations and macros in hvm.h" to avoid getting the API's
out of sync.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/hvm.h

index 07a5ed80116a980087be1b4f8eecb362dc37a815..396ee4a370b3182337818ead2e3a999d4a7621d7 100644 (file)
@@ -1581,10 +1581,9 @@ static void svm_inject_event(const struct x86_event *event)
         HVMTRACE_2D(INJ_EXC, _event.vector, _event.error_code);
 }
 
-static int svm_event_pending(struct vcpu *v)
+static bool svm_event_pending(const struct vcpu *v)
 {
-    struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
-    return vmcb->eventinj.fields.v;
+    return v->arch.hvm.svm.vmcb->eventinj.fields.v;
 }
 
 static void svm_cpu_dead(unsigned int cpu)
index e065f8bbdb2e09118f49ad320da5fbd47f466b6b..365eeb288622831c984b0a1aeb1591c07bdbcf22 100644 (file)
@@ -1903,7 +1903,7 @@ static void vmx_inject_event(const struct x86_event *event)
         HVMTRACE_2D(INJ_EXC, _event.vector, _event.error_code);
 }
 
-static int vmx_event_pending(struct vcpu *v)
+static bool vmx_event_pending(const struct vcpu *v)
 {
     unsigned long intr_info;
 
index 2a1acd8bfaf180b4e81ba2a20e828f648ca721b5..3d3250dff0d3a4197714461c3985bf915a59a231 100644 (file)
@@ -158,7 +158,7 @@ struct hvm_function_table {
 
     void (*init_hypercall_page)(struct domain *d, void *hypercall_page);
 
-    int  (*event_pending)(struct vcpu *v);
+    bool (*event_pending)(const struct vcpu *v);
     bool (*get_pending_event)(struct vcpu *v, struct x86_event *info);
     void (*invlpg)(struct vcpu *v, unsigned long linear);
 
@@ -507,7 +507,7 @@ static inline void hvm_inject_page_fault(int errcode, unsigned long cr2)
     hvm_inject_event(&event);
 }
 
-static inline int hvm_event_pending(struct vcpu *v)
+static inline bool hvm_event_pending(const struct vcpu *v)
 {
     return hvm_funcs.event_pending(v);
 }