@@ -39,7 +39,7 @@ obj-$(CONFIG_LIVEPATCH) += livepatch.o
obj-$(CONFIG_LLC_COLORING) += llc-coloring.o
obj-$(CONFIG_VM_EVENT) += mem_access.o
obj-y += mm.o
-obj-y += monitor.o
+obj-$(CONFIG_VM_EVENT) += monitor.o
obj-y += p2m.o
obj-y += platform.o
obj-y += platform_hypercall.o
@@ -65,7 +65,7 @@ obj-$(CONFIG_VGICV2) += vgic-v2.o
obj-$(CONFIG_GICV3) += vgic-v3.o
obj-$(CONFIG_HAS_ITS) += vgic-v3-its.o
endif
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
obj-y += vtimer.o
obj-$(CONFIG_SBSA_VUART_CONSOLE) += vpl011.o
obj-y += vsmc.o
@@ -330,7 +330,8 @@ void do_trap_smc(struct cpu_user_regs *regs, const union hsr hsr)
}
/* If monitor is enabled, let it handle the call. */
- if ( current->domain->arch.monitor.privileged_call_enabled )
+ if ( IS_ENABLED(CONFIG_VM_EVENT) &&
+ current->domain->arch.monitor.privileged_call_enabled )
rc = monitor_smc();
if ( rc == 1 )
@@ -54,7 +54,7 @@ obj-y += timer.o
obj-$(CONFIG_TRACEBUFFER) += trace.o
obj-y += version.o
obj-y += virtual_region.o
-obj-y += vm_event.o
+obj-$(CONFIG_VM_EVENT) += vm_event.o
obj-$(CONFIG_HAS_VMAP) += vmap.o
obj-y += vsprintf.o
obj-y += wait.o
@@ -68,7 +68,7 @@ obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o xlat.o
ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
obj-y += domctl.o
-obj-y += monitor.o
+obj-$(CONFIG_VM_EVENT) += monitor.o
obj-y += sysctl.o
endif
@@ -27,8 +27,17 @@
struct domain;
struct xen_domctl_monitor_op;
+#ifdef CONFIG_VM_EVENT
int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop);
void monitor_guest_request(void);
+#else
+static inline int monitor_domctl(struct domain *d,
+ struct xen_domctl_monitor_op *mop)
+{
+ return -EINVAL;
+}
+static inline void monitor_guest_request(void) {}
+#endif
int monitor_traps(struct vcpu *v, bool sync, vm_event_request_t *req);
@@ -50,9 +50,6 @@ struct vm_event_domain
unsigned int last_vcpu_wake_up;
};
-/* Clean up on domain destruction */
-void vm_event_cleanup(struct domain *d);
-
/* Returns whether a ring has been set up */
bool vm_event_check_ring(struct vm_event_domain *ved);
@@ -88,7 +85,18 @@ void vm_event_cancel_slot(struct domain *d, struct vm_event_domain *ved);
void vm_event_put_request(struct domain *d, struct vm_event_domain *ved,
vm_event_request_t *req);
+#ifdef CONFIG_VM_EVENT
+/* Clean up on domain destruction */
+void vm_event_cleanup(struct domain *d);
int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec);
+#else
+static inline void vm_event_cleanup(struct domain *d) {}
+static inline int vm_event_domctl(struct domain *d,
+ struct xen_domctl_vm_event_op *vec)
+{
+ return -EINVAL;
+}
+#endif
void vm_event_vcpu_pause(struct vcpu *v);
void vm_event_vcpu_unpause(struct vcpu *v);