diff mbox series

[v1,21/29] xen/asm-generic: introduce stub header altp2m.h

Message ID 619b24fbd568f439baf1941a972c6943f423b4ad.1694702259.git.oleksii.kurochko@gmail.com (mailing list archive)
State New, archived
Headers show
Series Introduce stub headers necessary for full Xen build | expand

Commit Message

Oleksii K. Sept. 14, 2023, 2:56 p.m. UTC
The patch introduces header stub necessry for full Xen build.

Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
 xen/include/asm-generic/altp2m.h | 34 ++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 xen/include/asm-generic/altp2m.h

Comments

Jan Beulich Oct. 19, 2023, 11:27 a.m. UTC | #1
On 14.09.2023 16:56, Oleksii Kurochko wrote:
> The patch introduces header stub necessry for full Xen build.
> 
> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> ---
>  xen/include/asm-generic/altp2m.h | 34 ++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
>  create mode 100644 xen/include/asm-generic/altp2m.h

While odd to be needed, this looks largely okay for the moment. Just
one remark:

> --- /dev/null
> +++ b/xen/include/asm-generic/altp2m.h
> @@ -0,0 +1,34 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_ALTP2M_H
> +#define __ASM_GENERIC_ALTP2M_H
> +
> +#include <xen/bug.h>
> +
> +struct domain;
> +struct vcpu;
> +
> +/* Alternate p2m on/off per domain */
> +static inline bool altp2m_active(const struct domain *d)
> +{
> +    /* Not implemented on GENERIC. */
> +    return false;
> +}
> +
> +/* Alternate p2m VCPU */
> +static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)

uint16_t is what x86 wants, but even on Arm it's suspicious. For a
generic header I'd say make it unsigned int, thus also eliminating
the question whether xen/types.h should be included here.

Jan
Oleksii K. Oct. 23, 2023, 11:34 a.m. UTC | #2
On Thu, 2023-10-19 at 13:27 +0200, Jan Beulich wrote:
> On 14.09.2023 16:56, Oleksii Kurochko wrote:
> > The patch introduces header stub necessry for full Xen build.
> > 
> > Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
> > ---
> >  xen/include/asm-generic/altp2m.h | 34
> > ++++++++++++++++++++++++++++++++
> >  1 file changed, 34 insertions(+)
> >  create mode 100644 xen/include/asm-generic/altp2m.h
> 
> While odd to be needed, this looks largely okay for the moment. Just
> one remark:
> 
> > --- /dev/null
> > +++ b/xen/include/asm-generic/altp2m.h
> > @@ -0,0 +1,34 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only */
> > +#ifndef __ASM_GENERIC_ALTP2M_H
> > +#define __ASM_GENERIC_ALTP2M_H
> > +
> > +#include <xen/bug.h>
> > +
> > +struct domain;
> > +struct vcpu;
> > +
> > +/* Alternate p2m on/off per domain */
> > +static inline bool altp2m_active(const struct domain *d)
> > +{
> > +    /* Not implemented on GENERIC. */
> > +    return false;
> > +}
> > +
> > +/* Alternate p2m VCPU */
> > +static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
> 
> uint16_t is what x86 wants, but even on Arm it's suspicious. For a
> generic header I'd say make it unsigned int, thus also eliminating
> the question whether xen/types.h should be included here.

Thanks. I'll make sure to update the patch accordingly.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/include/asm-generic/altp2m.h b/xen/include/asm-generic/altp2m.h
new file mode 100644
index 0000000000..e73cc8a04f
--- /dev/null
+++ b/xen/include/asm-generic/altp2m.h
@@ -0,0 +1,34 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_ALTP2M_H
+#define __ASM_GENERIC_ALTP2M_H
+
+#include <xen/bug.h>
+
+struct domain;
+struct vcpu;
+
+/* Alternate p2m on/off per domain */
+static inline bool altp2m_active(const struct domain *d)
+{
+    /* Not implemented on GENERIC. */
+    return false;
+}
+
+/* Alternate p2m VCPU */
+static inline uint16_t altp2m_vcpu_idx(const struct vcpu *v)
+{
+    /* Not implemented on GENERIC, should not be reached. */
+    BUG();
+    return 0;
+}
+
+#endif /* __ASM_GENERIC_ALTP2M_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: BSD
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */