diff mbox series

[RFC,XEN,22/23] riscv: Add sysctl.c

Message ID 7ebc34d888493f27302ed0a53e09216233cc9e7e.1579615303.git.bobbyeshleman@gmail.com (mailing list archive)
State New, archived
Headers show
Series xen: beginning support for RISC-V | expand

Commit Message

Bobby Eshleman Jan. 22, 2020, 1:59 a.m. UTC
From: Alistair Francis <alistair.francis@wdc.com>

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
 xen/arch/riscv/sysctl.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 xen/arch/riscv/sysctl.c

Comments

Jan Beulich June 22, 2020, 11:43 a.m. UTC | #1
On 22.01.2020 02:59, Bobby Eshleman wrote:
> --- /dev/null
> +++ b/xen/arch/riscv/sysctl.c
> @@ -0,0 +1,31 @@
> +/******************************************************************************
> + * Arch-specific sysctl.c
> + *
> + * System management operations. For use by node control stack.
> + *
> + * Copyright (c) 2012, Citrix Systems
> + */
> +
> +#include <xen/types.h>
> +#include <xen/lib.h>
> +#include <xen/errno.h>
> +#include <xen/hypercall.h>
> +#include <public/sysctl.h>
> +
> +void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { }
> +
> +long arch_do_sysctl(struct xen_sysctl *sysctl,
> +                    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
> +{
> +    return -ENOSYS;

At the example of this (there may be more in this series) - -EOPNOTSUPP
please. Only top level hypercall handlers ought to produce -ENOSYS, for
major hypercall numbers with no handler.

Jan
Bobby Eshleman June 30, 2020, 1:51 a.m. UTC | #2
On Mon, Jun 22, 2020 at 01:43:40PM +0200, Jan Beulich wrote:
> On 22.01.2020 02:59, Bobby Eshleman wrote:
> > --- /dev/null
> > +++ b/xen/arch/riscv/sysctl.c
> > @@ -0,0 +1,31 @@
> > +/******************************************************************************
> > + * Arch-specific sysctl.c
> > + *
> > + * System management operations. For use by node control stack.
> > + *
> > + * Copyright (c) 2012, Citrix Systems
> > + */
> > +
> > +#include <xen/types.h>
> > +#include <xen/lib.h>
> > +#include <xen/errno.h>
> > +#include <xen/hypercall.h>
> > +#include <public/sysctl.h>
> > +
> > +void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { }
> > +
> > +long arch_do_sysctl(struct xen_sysctl *sysctl,
> > +                    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
> > +{
> > +    return -ENOSYS;
> 
> At the example of this (there may be more in this series) - -EOPNOTSUPP
> please. Only top level hypercall handlers ought to produce -ENOSYS, for
> major hypercall numbers with no handler.
> 

Got it, will do.  Thanks!
diff mbox series

Patch

diff --git a/xen/arch/riscv/sysctl.c b/xen/arch/riscv/sysctl.c
new file mode 100644
index 0000000000..fbfdb44eff
--- /dev/null
+++ b/xen/arch/riscv/sysctl.c
@@ -0,0 +1,31 @@ 
+/******************************************************************************
+ * Arch-specific sysctl.c
+ *
+ * System management operations. For use by node control stack.
+ *
+ * Copyright (c) 2012, Citrix Systems
+ */
+
+#include <xen/types.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <xen/hypercall.h>
+#include <public/sysctl.h>
+
+void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { }
+
+long arch_do_sysctl(struct xen_sysctl *sysctl,
+                    XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
+{
+    return -ENOSYS;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */