diff mbox series

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

Message ID c89b1a60ee40576a2841c222a2cefc5ae2a301d3.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 Kurochko Sept. 14, 2023, 2:56 p.m. UTC
The patch introduces stub header needed for full Xen build.

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

Comments

Jan Beulich Oct. 19, 2023, 9:11 a.m. UTC | #1
On 14.09.2023 16:56, Oleksii Kurochko wrote:
> --- /dev/null
> +++ b/xen/include/asm-generic/cpufeature.h
> @@ -0,0 +1,23 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +#ifndef __ASM_GENERIC_CPUFEATURE_H__
> +#define __ASM_GENERIC_CPUFEATURE_H__
> +
> +#ifndef __ASSEMBLY__
> +
> +static inline int cpu_nr_siblings(unsigned int cpu)
> +{
> +    return 1;
> +}
> +
> +#endif
> +
> +#endif /* __ASM_GENERIC_CPUFEATURE_H__  */

I'm not convinced an arch can get away without such a header. Certainly
RISC-V and PPC can't, with all their ISA extensions that already exist
(part of which will want making use of, others may simply want exposing
to guests).

Jan
Oleksii Kurochko Oct. 23, 2023, 9:49 a.m. UTC | #2
On Thu, 2023-10-19 at 11:11 +0200, Jan Beulich wrote:
> I'm not convinced an arch can get away without such a header.
> Certainly
> RISC-V and PPC can't, with all their ISA extensions that already
> exist
> (part of which will want making use of, others may simply want
> exposing
> to guests).
Yes, it looks like you are right. I forgot about a considerable amount
of ISA.

By this patch series, I tried to move headers to asm-generic to build
minimal Xen without introducing the stub cpu_nr_siblings(unsigned int
cpu) for each new arch. But taking into account that likely this header
will be re-introduced for an arch, there is probably no sense to have
it in asm-generic.

~ Oleksii
diff mbox series

Patch

diff --git a/xen/include/asm-generic/cpufeature.h b/xen/include/asm-generic/cpufeature.h
new file mode 100644
index 0000000000..86e2a8b455
--- /dev/null
+++ b/xen/include/asm-generic/cpufeature.h
@@ -0,0 +1,23 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_CPUFEATURE_H__
+#define __ASM_GENERIC_CPUFEATURE_H__
+
+#ifndef __ASSEMBLY__
+
+static inline int cpu_nr_siblings(unsigned int cpu)
+{
+    return 1;
+}
+
+#endif
+
+#endif /* __ASM_GENERIC_CPUFEATURE_H__  */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */