diff mbox series

[v1,44/57] xen/riscv: introduce asm/vm_event.h

Message ID 5e9219fb6c5e3d0ad921d7d050abc2a802d1742b.1692181079.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series Enable build of full Xen for RISC-V | expand

Commit Message

Oleksii Kurochko Aug. 16, 2023, 10:19 a.m. UTC
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/arch/riscv/include/asm/vm_event.h | 52 +++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)
 create mode 100644 xen/arch/riscv/include/asm/vm_event.h

Comments

Tamas K Lengyel Aug. 21, 2023, 4:43 p.m. UTC | #1
On Wed, Aug 16, 2023 at 12:30 PM Oleksii Kurochko
<oleksii.kurochko@gmail.com> wrote:
>
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/arch/riscv/include/asm/vm_event.h | 52 +++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>  create mode 100644 xen/arch/riscv/include/asm/vm_event.h

I don't think we ought to replicate this header for every arch when
clearly the functions in them are only relevant for specific
architectures. Would make more sense to me to just conditionalize the
caller side to the specific archs where these functions are actually
defined, which would largely just be CONFIG_X86.

Tamas
Oleksii Kurochko Aug. 22, 2023, 3:08 p.m. UTC | #2
On Mon, 2023-08-21 at 18:43 +0200, Tamas K Lengyel wrote:
> On Wed, Aug 16, 2023 at 12:30 PM Oleksii Kurochko
> <oleksii.kurochko@gmail.com> wrote:
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  xen/arch/riscv/include/asm/vm_event.h | 52
> > +++++++++++++++++++++++++++
> >  1 file changed, 52 insertions(+)
> >  create mode 100644 xen/arch/riscv/include/asm/vm_event.h
> 
> I don't think we ought to replicate this header for every arch when
> clearly the functions in them are only relevant for specific
> architectures. Would make more sense to me to just conditionalize the
> caller side to the specific archs where these functions are actually
> defined, which would largely just be CONFIG_X86.

Thanks. I'll take it into account.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/arch/riscv/include/asm/vm_event.h b/xen/arch/riscv/include/asm/vm_event.h
new file mode 100644
index 0000000000..4cae80840a
--- /dev/null
+++ b/xen/arch/riscv/include/asm/vm_event.h
@@ -0,0 +1,52 @@ 
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * vm_event.h: architecture specific vm_event handling routines
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com)
+ */
+
+#ifndef __ASM_RISCV_VM_EVENT_H__
+#define __ASM_RISCV_VM_EVENT_H__
+
+#include <xen/sched.h>
+#include <xen/vm_event.h>
+#include <public/domctl.h>
+
+static inline int vm_event_init_domain(struct domain *d)
+{
+    /* Nothing to do. */
+    return 0;
+}
+
+static inline void vm_event_cleanup_domain(struct domain *d)
+{
+    memset(&d->monitor, 0, sizeof(d->monitor));
+}
+
+static inline void vm_event_toggle_singlestep(struct domain *d, struct vcpu *v,
+                                              vm_event_response_t *rsp)
+{
+    /* Not supported on RISCV. */
+}
+
+static inline
+void vm_event_register_write_resume(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Not supported on RISCV. */
+}
+
+static inline
+void vm_event_emulate_check(struct vcpu *v, vm_event_response_t *rsp)
+{
+    /* Not supported on RISCV. */
+}
+
+static inline
+void vm_event_sync_event(struct vcpu *v, bool value)
+{
+    /* Not supported on RISCV. */
+}
+
+void vm_event_reset_vmtrace(struct vcpu *v);
+
+#endif /* __ASM_RISCV_VM_EVENT_H__ */