* [PATCH v5 0/7] Introduce generic headers
@ 2023-12-01 20:48 Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header Oleksii Kurochko
` (6 more replies)
0 siblings, 7 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio,
Roger Pau Monné, Tamas K Lengyel, Alexandru Isaila,
Petre Pircalabu
Some headers are common between several architectures, so the current patch series
provide them.
Another one reason to have them as generic is a simplification of adding support
necessary to make a complete Xen build as it was/is being done in the patch series [1]
and [2].
Also, instead of providing generic/stub headers, it was used
"#ifdef CONFIG_* #include <asm/*.h> #endif" instead of providing empty headers.
This patch series is a pre-requisite for "Enable build of full Xen for RISC-V" [3].
[1] https://lore.kernel.org/xen-devel/cover.1694543103.git.sanastasio@raptorengineering.com/
[2] https://lore.kernel.org/xen-devel/cover.1692181079.git.oleksii.kurochko@gmail.com/
[3] https://lore.kernel.org/xen-devel/cover.1700761381.git.oleksii.kurochko@gmail.com/
---
Changes in V5:
- Update the patch series message as patch related to delay.h was merged.
- Rebase on top of staging because half of the patches of the patch series were
merged to staging branch.
- Add A-by for some of the patches.
- Add "depends on X86 || Arm" for CONFIG_GRANT_TABLE and CONFIG_MEM_ACCESS to be
sure it won't be turned on by randconfig in CI.
- Partly switch Arm and PPC to asm-generic/monitor.h.
- Some other minor changes
---
Changes in V4:
- Update the cover letter message
- Add Reviewed-by/Acked-by for patches:
[PATCH v3 01/14] xen/asm-generic: introduce stub header paging.h
[PATCH v3 03/14] xen/asm-generic: introduce generic hypercall.h
[PATCH v3 04/14] xen/asm-generic: introduce generic header iocap.h
[PATCH v3 05/14] xen/asm-generic: introduce stub header <asm/random.h>
[PATCH v3 06/14] xen/asm-generic: introduce generic header percpu.h
[PATCH v3 07/14] xen/asm-generic: introduce generalized hardirq.h
[PATCH v3 08/14] xen/asm-generic: introduce generic div64.h header
[PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
[PATCH v3 10/14] xen/asm-generic: introduce stub header monitor.h
[PATCH v3 11/14] xen/asm-generic: introduce stub header numa.h
[PATCH v3 12/14] xen/asm-generic: introduce stub header softirq.h
- Fix some code style and minor issues.
- Use asm-generic version of device.h for Arm and PPC.
---
Changes in V3:
- Update the commit message of the cover letter.
- Drop the following patch as it can be arch-specific enough:
* [PATCH v2 09/15] xen/asm-generic: introduce generic header smp.h
- Drop correspondent arch specific headers and use asm-generic version of
a header.
- Back to the patch series patches:
* xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
* xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
---
Changes in V2:
- Update the commit message of the cover letter.
- Drop the following patches because they are arch-specific or was sent as a separate patch:
- xen/asm-generic: introduce stub header event.h
- xen/asm-generic: introduce stub header spinlock.h
- [PATCH v1 03/29] xen/asm-generic: introduce stub header cpufeature.h
- [PATCH v1 07/29] xen/asm-generic: introduce stub header guest_atomics.h
- [PATCH v1 10/29] xen/asm-generic: introduce stub header iommu.h
- [PATCH v1 12/29] xen/asm-generic: introduce stub header pci.h because separate patch was sent [5]
- [PATCH v1 14/29] xen/asm-generic: introduce stub header setup.h
- [PATCH v1 15/29] xen/asm-generic: introduce stub header xenoprof.h because of [3].
- [PATCH v1 16/29] xen/asm-generic: introduce stub header flushtlb.h
- [PATCH v1 22/29] xen/asm-generic: introduce stub header delay.h because of [3]
- [PATCH v1 23/29] xen/asm-generic: introduce stub header domain.h
- [PATCH v1 24/29] xen/asm-generic: introduce stub header guest_access.h
- [PATCH v1 25/29] xen/asm-generic: introduce stub header irq.h ( probably not so generic as I expected, I'll back to it if it will be necessary in the future )
- [PATCH v1 28/29] xen/asm-generic: introduce stub header p2m.h ( probably not so generic as I expected, I'll back to it if it will be necessary in the future )
- For the rest of the patches please look at changes for each patch separately.
---
Oleksii Kurochko (7):
xen/asm-generic: introduce generic div64.h header
xen/asm-generic: introduce stub header monitor.h
xen/asm-generic: introduce stub header numa.h
xen/asm-generic: introduce stub header softirq.h
xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
xen/asm-generic: introduce generic device.h
xen/arch/arm/device.c | 15 ++-
xen/arch/arm/domain_build.c | 3 +-
xen/arch/arm/gic-v2.c | 4 +-
xen/arch/arm/gic-v3.c | 6 +-
xen/arch/arm/gic.c | 4 +-
xen/arch/arm/include/asm/Makefile | 3 +
xen/arch/arm/include/asm/div64.h | 8 +-
xen/arch/arm/include/asm/monitor.h | 28 +---
xen/arch/arm/p2m.c | 1 +
xen/arch/arm/traps.c | 1 +
xen/arch/ppc/include/asm/Makefile | 4 +
xen/arch/ppc/include/asm/device.h | 53 --------
xen/arch/ppc/include/asm/div64.h | 14 --
xen/arch/ppc/include/asm/grant_table.h | 5 -
xen/arch/ppc/include/asm/mem_access.h | 5 -
xen/arch/ppc/include/asm/monitor.h | 28 +---
xen/arch/ppc/include/asm/numa.h | 26 ----
xen/arch/ppc/include/asm/softirq.h | 8 --
xen/arch/x86/include/asm/Makefile | 1 +
xen/arch/x86/include/asm/div64.h | 14 --
xen/common/Kconfig | 3 +-
.../asm => include/asm-generic}/device.h | 125 +++++++++++-------
xen/include/asm-generic/div64.h | 27 ++++
xen/include/asm-generic/monitor.h | 57 ++++++++
.../asm => include/asm-generic}/numa.h | 16 ++-
.../asm => include/asm-generic}/softirq.h | 7 +-
xen/include/xen/grant_table.h | 3 +
xen/include/xen/mem_access.h | 2 +
28 files changed, 219 insertions(+), 252 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/device.h
delete mode 100644 xen/arch/ppc/include/asm/div64.h
delete mode 100644 xen/arch/ppc/include/asm/grant_table.h
delete mode 100644 xen/arch/ppc/include/asm/mem_access.h
delete mode 100644 xen/arch/ppc/include/asm/numa.h
delete mode 100644 xen/arch/ppc/include/asm/softirq.h
delete mode 100644 xen/arch/x86/include/asm/div64.h
rename xen/{arch/arm/include/asm => include/asm-generic}/device.h (79%)
create mode 100644 xen/include/asm-generic/div64.h
create mode 100644 xen/include/asm-generic/monitor.h
rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (67%)
rename xen/{arch/arm/include/asm => include/asm-generic}/softirq.h (56%)
--
2.43.0
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 2/7] xen/asm-generic: introduce stub header monitor.h Oleksii Kurochko
` (5 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio,
Roger Pau Monné
All archs have the do_div implementation for BITS_PER_LONG == 64
so do_div64.h is moved to asm-generic.
x86 and PPC were switched to asm-generic version of div64.h.
Arm was switched partly because Arm has different implementation
for 32-bits.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in V5:
- add Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
- Update the commit message
- Partly switch Arm's div64.h to asm-generic version. Arm has different
implementation for 32-bits so only 64-bit version was switched.
---
Changes in V4:
- Added Acked-by: Jan Beulich <jbeulich@suse.com>.
- include <asm-generic/div64.h> in Arm's div64.h for 64-bit case.
---
Changes in V3:
- Drop x86 and PPC's div64.h.
- Update the commit message.
---
Changes in V2:
- rename base to divisor
- add "#if BITS_PER_LONG == 64"
- fix code style
---
xen/arch/arm/include/asm/div64.h | 8 +-------
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/div64.h | 14 --------------
xen/arch/x86/include/asm/Makefile | 1 +
xen/arch/x86/include/asm/div64.h | 14 --------------
xen/include/asm-generic/div64.h | 27 +++++++++++++++++++++++++++
6 files changed, 30 insertions(+), 35 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/div64.h
delete mode 100644 xen/arch/x86/include/asm/div64.h
create mode 100644 xen/include/asm-generic/div64.h
diff --git a/xen/arch/arm/include/asm/div64.h b/xen/arch/arm/include/asm/div64.h
index fc667a80f9..0459d5cc01 100644
--- a/xen/arch/arm/include/asm/div64.h
+++ b/xen/arch/arm/include/asm/div64.h
@@ -24,13 +24,7 @@
#if BITS_PER_LONG == 64
-# define do_div(n,base) ({ \
- uint32_t __base = (base); \
- uint32_t __rem; \
- __rem = ((uint64_t)(n)) % __base; \
- (n) = ((uint64_t)(n)) / __base; \
- __rem; \
- })
+#include <asm-generic/div64.h>
#elif BITS_PER_LONG == 32
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index 2da995bb2f..a8e848d4d0 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
generic-y += altp2m.h
+generic-y += div64.h
generic-y += hardirq.h
generic-y += hypercall.h
generic-y += iocap.h
diff --git a/xen/arch/ppc/include/asm/div64.h b/xen/arch/ppc/include/asm/div64.h
deleted file mode 100644
index d213e50585..0000000000
--- a/xen/arch/ppc/include/asm/div64.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_DIV64_H__
-#define __ASM_PPC_DIV64_H__
-
-#include <xen/types.h>
-
-#define do_div(n, base) ({ \
- uint32_t base_ = (base); \
- uint32_t rem_ = (uint64_t)(n) % base_; \
- (n) = (uint64_t)(n) / base_; \
- rem_; \
-})
-
-#endif /* __ASM_PPC_DIV64_H__ */
diff --git a/xen/arch/x86/include/asm/Makefile b/xen/arch/x86/include/asm/Makefile
index 874429ed30..daab34ff0a 100644
--- a/xen/arch/x86/include/asm/Makefile
+++ b/xen/arch/x86/include/asm/Makefile
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
+generic-y += div64.h
generic-y += percpu.h
diff --git a/xen/arch/x86/include/asm/div64.h b/xen/arch/x86/include/asm/div64.h
deleted file mode 100644
index dd49f64a3b..0000000000
--- a/xen/arch/x86/include/asm/div64.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#ifndef __X86_DIV64
-#define __X86_DIV64
-
-#include <xen/types.h>
-
-#define do_div(n,base) ({ \
- uint32_t __base = (base); \
- uint32_t __rem; \
- __rem = ((uint64_t)(n)) % __base; \
- (n) = ((uint64_t)(n)) / __base; \
- __rem; \
-})
-
-#endif
diff --git a/xen/include/asm-generic/div64.h b/xen/include/asm-generic/div64.h
new file mode 100644
index 0000000000..068d8a11ad
--- /dev/null
+++ b/xen/include/asm-generic/div64.h
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_DIV64
+#define __ASM_GENERIC_DIV64
+
+#include <xen/types.h>
+
+#if BITS_PER_LONG == 64
+
+#define do_div(n, divisor) ({ \
+ uint32_t divisor_ = (divisor); \
+ uint32_t rem_ = (uint64_t)(n) % divisor_; \
+ (n) = (uint64_t)(n) / divisor_; \
+ rem_; \
+})
+
+#endif /* BITS_PER_LONG */
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 2/7] xen/asm-generic: introduce stub header monitor.h
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 3/7] xen/asm-generic: introduce stub header numa.h Oleksii Kurochko
` (4 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Tamas K Lengyel, Alexandru Isaila,
Petre Pircalabu, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk,
Shawn Anastasio, Jan Beulich
The header is shared between several archs so it is
moved to asm-generic.
Switch partly Arm and PPC to asm-generic/monitor.h and only
arch_monitor_get_capabilities() left in arch-specific/monitor.h.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V5:
- Switched partly Arm and PPC to asm-generic monitor.h only
arch_monitor_get_capabilities() left in arch-specific/monitor.h.
- Updated the commit message.
---
Changes in V4:
- Removed the double blank line.
- Added Acked-by: Jan Beulich <jbeulich@suse.com>.
- Update the commit message
---
Changes in V3:
- Use forward-declaration of struct domain instead of " #include <xen/sched.h> ".
- Add ' include <xen/errno.h> '
- Drop PPC's monitor.h.
---
Changes in V2:
- remove inclusion of "+#include <public/domctl.h>"
- add "struct xen_domctl_monitor_op;"
- remove one of SPDX tags.
---
xen/arch/arm/include/asm/monitor.h | 28 +--------------
xen/arch/ppc/include/asm/monitor.h | 28 +--------------
xen/include/asm-generic/monitor.h | 57 ++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+), 54 deletions(-)
create mode 100644 xen/include/asm-generic/monitor.h
diff --git a/xen/arch/arm/include/asm/monitor.h b/xen/arch/arm/include/asm/monitor.h
index 7567be66bd..045217c310 100644
--- a/xen/arch/arm/include/asm/monitor.h
+++ b/xen/arch/arm/include/asm/monitor.h
@@ -25,33 +25,7 @@
#include <xen/sched.h>
#include <public/domctl.h>
-static inline
-void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace)
-{
-}
-
-static inline
-int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop)
-{
- /* No arch-specific monitor ops on ARM. */
- return -EOPNOTSUPP;
-}
-
-int arch_monitor_domctl_event(struct domain *d,
- struct xen_domctl_monitor_op *mop);
-
-static inline
-int arch_monitor_init_domain(struct domain *d)
-{
- /* No arch-specific domain initialization on ARM. */
- return 0;
-}
-
-static inline
-void arch_monitor_cleanup_domain(struct domain *d)
-{
- /* No arch-specific domain cleanup on ARM. */
-}
+#include <asm-generic/monitor.h>
static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
{
diff --git a/xen/arch/ppc/include/asm/monitor.h b/xen/arch/ppc/include/asm/monitor.h
index e5b0282bf1..89000dacc6 100644
--- a/xen/arch/ppc/include/asm/monitor.h
+++ b/xen/arch/ppc/include/asm/monitor.h
@@ -6,33 +6,7 @@
#include <public/domctl.h>
#include <xen/errno.h>
-static inline
-void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace)
-{
-}
-
-static inline
-int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop)
-{
- /* No arch-specific monitor ops on PPC. */
- return -EOPNOTSUPP;
-}
-
-int arch_monitor_domctl_event(struct domain *d,
- struct xen_domctl_monitor_op *mop);
-
-static inline
-int arch_monitor_init_domain(struct domain *d)
-{
- /* No arch-specific domain initialization on PPC. */
- return 0;
-}
-
-static inline
-void arch_monitor_cleanup_domain(struct domain *d)
-{
- /* No arch-specific domain cleanup on PPC. */
-}
+#include <asm-generic/monitor.h>
static inline uint32_t arch_monitor_get_capabilities(struct domain *d)
{
diff --git a/xen/include/asm-generic/monitor.h b/xen/include/asm-generic/monitor.h
new file mode 100644
index 0000000000..74e4870cd7
--- /dev/null
+++ b/xen/include/asm-generic/monitor.h
@@ -0,0 +1,57 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * include/asm-generic/monitor.h
+ *
+ * Arch-specific monitor_op domctl handler.
+ *
+ * Copyright (c) 2015 Tamas K Lengyel (tamas@tklengyel.com)
+ * Copyright (c) 2016, Bitdefender S.R.L.
+ *
+ */
+
+#ifndef __ASM_GENERIC_MONITOR_H__
+#define __ASM_GENERIC_MONITOR_H__
+
+#include <xen/errno.h>
+
+struct domain;
+struct xen_domctl_monitor_op;
+
+static inline
+void arch_monitor_allow_userspace(struct domain *d, bool allow_userspace)
+{
+}
+
+static inline
+int arch_monitor_domctl_op(struct domain *d, struct xen_domctl_monitor_op *mop)
+{
+ /* No arch-specific monitor ops on GENERIC. */
+ return -EOPNOTSUPP;
+}
+
+int arch_monitor_domctl_event(struct domain *d,
+ struct xen_domctl_monitor_op *mop);
+
+static inline
+int arch_monitor_init_domain(struct domain *d)
+{
+ /* No arch-specific domain initialization on GENERIC. */
+ return 0;
+}
+
+static inline
+void arch_monitor_cleanup_domain(struct domain *d)
+{
+ /* No arch-specific domain cleanup on GENERIC. */
+}
+
+#endif /* __ASM_GENERIC_MONITOR_H__ */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: BSD
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 3/7] xen/asm-generic: introduce stub header numa.h
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 2/7] xen/asm-generic: introduce stub header monitor.h Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 4/7] xen/asm-generic: introduce stub header softirq.h Oleksii Kurochko
` (3 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio
<asm/numa.h> is common through some archs so it is moved
to asm-generic.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in V5:
- Added Acked-by: Jan Beulich <jbeulich@suse.com>
- Updated the comment around first_valid_mfn. ( Arm -> GENERIC )
- Added Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in V4:
- Updated guards name: *ARCH_GENERIC* -> *ASM_GENERIC*.
- Moved inclusion of xen/mm-frame.h under "#ifndef CONFIG_NUMA".
- Added Reviewed-by: Michal Orzel <michal.orzel@amd.com>.
---
Changes in V3:
- Remove old header inclusion in asm-generic numa.h and include
<xen/mm-frame.h> and <xen/stdint.h>
- Drop Arm and PPC's numa.h and use asm-generic version instead.
---
Changes in V2:
- update the commit message.
- change u8 to uint8_t.
- add ifnded CONFIG_NUMA.
---
xen/arch/arm/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/numa.h | 26 -------------------
.../asm => include/asm-generic}/numa.h | 16 +++++++-----
4 files changed, 12 insertions(+), 32 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/numa.h
rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (67%)
diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 8221429c2c..0c855a798a 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -2,6 +2,7 @@
generic-y += altp2m.h
generic-y += hardirq.h
generic-y += iocap.h
+generic-y += numa.h
generic-y += paging.h
generic-y += percpu.h
generic-y += random.h
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index a8e848d4d0..f09c5ea8a1 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -4,6 +4,7 @@ generic-y += div64.h
generic-y += hardirq.h
generic-y += hypercall.h
generic-y += iocap.h
+generic-y += numa.h
generic-y += paging.h
generic-y += percpu.h
generic-y += random.h
diff --git a/xen/arch/ppc/include/asm/numa.h b/xen/arch/ppc/include/asm/numa.h
deleted file mode 100644
index 7fdf66c3da..0000000000
--- a/xen/arch/ppc/include/asm/numa.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef __ASM_PPC_NUMA_H__
-#define __ASM_PPC_NUMA_H__
-
-#include <xen/types.h>
-#include <xen/mm.h>
-
-typedef uint8_t nodeid_t;
-
-/* Fake one node for now. See also node_online_map. */
-#define cpu_to_node(cpu) 0
-#define node_to_cpumask(node) (cpu_online_map)
-
-/*
- * TODO: make first_valid_mfn static when NUMA is supported on PPC, this
- * is required because the dummy helpers are using it.
- */
-extern mfn_t first_valid_mfn;
-
-/* XXX: implement NUMA support */
-#define node_spanned_pages(nid) (max_page - mfn_x(first_valid_mfn))
-#define node_start_pfn(nid) (mfn_x(first_valid_mfn))
-#define __node_distance(a, b) (20)
-
-#define arch_want_default_dmazone() (false)
-
-#endif /* __ASM_PPC_NUMA_H__ */
diff --git a/xen/arch/arm/include/asm/numa.h b/xen/include/asm-generic/numa.h
similarity index 67%
rename from xen/arch/arm/include/asm/numa.h
rename to xen/include/asm-generic/numa.h
index e2bee2bd82..7f95a77e89 100644
--- a/xen/arch/arm/include/asm/numa.h
+++ b/xen/include/asm-generic/numa.h
@@ -1,18 +1,21 @@
-#ifndef __ARCH_ARM_NUMA_H
-#define __ARCH_ARM_NUMA_H
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_NUMA_H
+#define __ASM_GENERIC_NUMA_H
-#include <xen/mm.h>
+#include <xen/stdint.h>
-typedef u8 nodeid_t;
+typedef uint8_t nodeid_t;
#ifndef CONFIG_NUMA
+#include <xen/mm-frame.h>
+
/* Fake one node for now. See also node_online_map. */
#define cpu_to_node(cpu) 0
#define node_to_cpumask(node) (cpu_online_map)
/*
- * TODO: make first_valid_mfn static when NUMA is supported on Arm, this
+ * TODO: make first_valid_mfn static when NUMA is supported on GENERIC, this
* is required because the dummy helpers are using it.
*/
extern mfn_t first_valid_mfn;
@@ -26,7 +29,8 @@ extern mfn_t first_valid_mfn;
#define arch_want_default_dmazone() (false)
-#endif /* __ARCH_ARM_NUMA_H */
+#endif /* __ASM_GENERIC_NUMA_H */
+
/*
* Local variables:
* mode: C
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 4/7] xen/asm-generic: introduce stub header softirq.h
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
` (2 preceding siblings ...)
2023-12-01 20:48 ` [PATCH v5 3/7] xen/asm-generic: introduce stub header numa.h Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h> Oleksii Kurochko
` (2 subsequent siblings)
6 siblings, 0 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio
<asm/softirq.h> is common between Arm, PPC and RISC-V so it is
moved to asm-generic.
Drop Arm and PPC's softirq.h and use asm-generic version instead.
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in V5:
- Strayed "Added" in commit message
- Added Acked-by: Shawn Anastasio <sanastasio@raptorengineering.com>
---
Changes in V4:
- Added Reviewed-by: Michal Orzel <michal.orzel@amd.com>
- Added Acked-by: Jan Beulich <jbeulich@suse.com>
---
Changes in V3:
- Drop Arm and PPC's softirq.h
- Update the commit message.
---
Changes in V2:
- update the commit message.
---
xen/arch/arm/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/softirq.h | 8 --------
.../arm/include/asm => include/asm-generic}/softirq.h | 7 ++++---
4 files changed, 6 insertions(+), 11 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/softirq.h
rename xen/{arch/arm/include/asm => include/asm-generic}/softirq.h (56%)
diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index 0c855a798a..a28cc5d1b1 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -6,4 +6,5 @@ generic-y += numa.h
generic-y += paging.h
generic-y += percpu.h
generic-y += random.h
+generic-y += softirq.h
generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index f09c5ea8a1..efd72862c8 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -8,4 +8,5 @@ generic-y += numa.h
generic-y += paging.h
generic-y += percpu.h
generic-y += random.h
+generic-y += softirq.h
generic-y += vm_event.h
diff --git a/xen/arch/ppc/include/asm/softirq.h b/xen/arch/ppc/include/asm/softirq.h
deleted file mode 100644
index a0b28a5e51..0000000000
--- a/xen/arch/ppc/include/asm/softirq.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef __ASM_PPC_SOFTIRQ_H__
-#define __ASM_PPC_SOFTIRQ_H__
-
-#define NR_ARCH_SOFTIRQS 0
-
-#define arch_skip_send_event_check(cpu) 0
-
-#endif /* __ASM_PPC_SOFTIRQ_H__ */
diff --git a/xen/arch/arm/include/asm/softirq.h b/xen/include/asm-generic/softirq.h
similarity index 56%
rename from xen/arch/arm/include/asm/softirq.h
rename to xen/include/asm-generic/softirq.h
index 976e0ebd70..83be855e50 100644
--- a/xen/arch/arm/include/asm/softirq.h
+++ b/xen/include/asm-generic/softirq.h
@@ -1,11 +1,12 @@
-#ifndef __ASM_SOFTIRQ_H__
-#define __ASM_SOFTIRQ_H__
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_SOFTIRQ_H__
+#define __ASM_GENERIC_SOFTIRQ_H__
#define NR_ARCH_SOFTIRQS 0
#define arch_skip_send_event_check(cpu) 0
-#endif /* __ASM_SOFTIRQ_H__ */
+#endif /* __ASM_GENERIC_SOFTIRQ_H__ */
/*
* Local variables:
* mode: C
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
` (3 preceding siblings ...)
2023-12-01 20:48 ` [PATCH v5 4/7] xen/asm-generic: introduce stub header softirq.h Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-04 8:41 ` Jan Beulich
2023-12-01 20:48 ` [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h> Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 7/7] xen/asm-generic: introduce generic device.h Oleksii Kurochko
6 siblings, 1 reply; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio
Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
generation of empty <asm/grant_table.h> for cases when
CONFIG_GRANT_TABLE is not enabled.
The following changes were done for Arm:
<asm/grant_table.h> should be included directly because it contains
gnttab_dom0_frames() macros which is unique for Arm and is used in
arch/arm/domain_build.c.
<asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
<xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE gnttab_dom0_frames
won't be available for use in arch/arm/domain_build.c.
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
- Added dependencies for "Config GRANT_TABLE" to be sure that randconfig will not
turn on the config.
---
Changes in V4:
- Nothing changed. Only rebase.
---
Changes in V3:
- Remove unnecessary comment.
---
xen/arch/arm/domain_build.c | 1 +
xen/arch/ppc/include/asm/grant_table.h | 5 -----
xen/common/Kconfig | 1 +
xen/include/xen/grant_table.h | 3 +++
4 files changed, 5 insertions(+), 5 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/grant_table.h
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index df66fb88d8..28df515a3d 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -36,6 +36,7 @@
#include <xen/irq.h>
#include <xen/grant_table.h>
+#include <asm/grant_table.h>
#include <xen/serial.h>
#define STATIC_EVTCHN_NODE_SIZE_CELLS 2
diff --git a/xen/arch/ppc/include/asm/grant_table.h b/xen/arch/ppc/include/asm/grant_table.h
deleted file mode 100644
index d0ff58dd3d..0000000000
--- a/xen/arch/ppc/include/asm/grant_table.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_GRANT_TABLE_H__
-#define __ASM_PPC_GRANT_TABLE_H__
-
-#endif /* __ASM_PPC_GRANT_TABLE_H__ */
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 310ad4229c..13e26ca06f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -15,6 +15,7 @@ config CORE_PARKING
config GRANT_TABLE
bool "Grant table support" if EXPERT
default y
+ depends on ARM || X86
---help---
Grant table provides a generic mechanism to memory sharing
between domains. This shared memory interface underpins the
diff --git a/xen/include/xen/grant_table.h b/xen/include/xen/grant_table.h
index 85fe6b7b5e..50edfecfb6 100644
--- a/xen/include/xen/grant_table.h
+++ b/xen/include/xen/grant_table.h
@@ -26,7 +26,10 @@
#include <xen/mm-frame.h>
#include <xen/rwlock.h>
#include <public/grant_table.h>
+
+#ifdef CONFIG_GRANT_TABLE
#include <asm/grant_table.h>
+#endif
struct grant_table;
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
` (4 preceding siblings ...)
2023-12-01 20:48 ` [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h> Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
2023-12-04 8:46 ` Jan Beulich
2023-12-01 20:48 ` [PATCH v5 7/7] xen/asm-generic: introduce generic device.h Oleksii Kurochko
6 siblings, 1 reply; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Tamas K Lengyel,
Alexandru Isaila, Petre Pircalabu, Shawn Anastasio
ifdefing inclusion of <asm/mem_access.h> in <xen/mem_access.h>
allows to avoid generation of empty <asm/mem_access.h> header
for the case when !CONFIG_MEM_ACCESS.
For Arm it was explicitly added inclusion of <asm/mem_access.h> for p2m.c
and traps.c because they require some functions from <asm/mem_access.h> which
aren't available in case of !CONFIG_MEM_ACCESS.
Suggested-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Changes in V5:
- Added dependencies for "Config MEM_ACCESS" to be sure that randconfig will not
turn on the config.
---
Changes in V4:
- Nothing changed. Only rebase.
---
Changes in V3:
- Remove unnecessary comment.
---
xen/arch/arm/p2m.c | 1 +
xen/arch/arm/traps.c | 1 +
xen/arch/ppc/include/asm/mem_access.h | 5 -----
xen/common/Kconfig | 2 +-
xen/include/xen/mem_access.h | 2 ++
5 files changed, 5 insertions(+), 6 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/mem_access.h
diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index b991b76ce4..2465c266e9 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -7,6 +7,7 @@
#include <asm/event.h>
#include <asm/flushtlb.h>
#include <asm/guest_walk.h>
+#include <asm/mem_access.h>
#include <asm/page.h>
#include <asm/traps.h>
diff --git a/xen/arch/arm/traps.c b/xen/arch/arm/traps.c
index 3784e8276e..37a457f4b1 100644
--- a/xen/arch/arm/traps.c
+++ b/xen/arch/arm/traps.c
@@ -35,6 +35,7 @@
#include <asm/cpufeature.h>
#include <asm/event.h>
#include <asm/hsr.h>
+#include <asm/mem_access.h>
#include <asm/mmio.h>
#include <asm/regs.h>
#include <asm/smccc.h>
diff --git a/xen/arch/ppc/include/asm/mem_access.h b/xen/arch/ppc/include/asm/mem_access.h
deleted file mode 100644
index e7986dfdbd..0000000000
--- a/xen/arch/ppc/include/asm/mem_access.h
+++ /dev/null
@@ -1,5 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_MEM_ACCESS_H__
-#define __ASM_PPC_MEM_ACCESS_H__
-
-#endif /* __ASM_PPC_MEM_ACCESS_H__ */
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 13e26ca06f..d84e395a0b 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -87,7 +87,7 @@ config MEM_ACCESS_ALWAYS_ON
config MEM_ACCESS
def_bool MEM_ACCESS_ALWAYS_ON
prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
- depends on HVM
+ depends on HVM && (ARM || X86)
---help---
Framework to configure memory access types for guests and receive
diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h
index 4e4811680d..87d93b31f6 100644
--- a/xen/include/xen/mem_access.h
+++ b/xen/include/xen/mem_access.h
@@ -33,7 +33,9 @@
*/
struct vm_event_st;
+#ifdef CONFIG_MEM_ACCESS
#include <asm/mem_access.h>
+#endif
/*
* Additional access types, which are used to further restrict
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* [PATCH v5 7/7] xen/asm-generic: introduce generic device.h
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
` (5 preceding siblings ...)
2023-12-01 20:48 ` [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h> Oleksii Kurochko
@ 2023-12-01 20:48 ` Oleksii Kurochko
6 siblings, 0 replies; 21+ messages in thread
From: Oleksii Kurochko @ 2023-12-01 20:48 UTC (permalink / raw)
To: xen-devel
Cc: Oleksii Kurochko, Stefano Stabellini, Julien Grall,
Bertrand Marquis, Michal Orzel, Volodymyr Babchuk, Andrew Cooper,
George Dunlap, Jan Beulich, Wei Liu, Shawn Anastasio
Arm, PPC and RISC-V use the same device.h thereby device.h
was moved to asm-generic. Arm's device.h was taken as a base with
the following changes:
- #ifdef PCI related things.
- #ifdef ACPI related things.
- Rename #ifdef guards.
- Add SPDX tag.
- #ifdef CONFIG_HAS_DEVICE_TREE related things.
- #ifdef-ing iommu related things with CONFIG_HAS_PASSTHROUGH.
Also Arm and PPC are switched to asm-generic version of device.h
Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
---
Jan wrote the following:
Overall I think there are too many changes done all in one go here.
But it's mostly Arm which is affected, so I'll leave judging about that
to the Arm maintainers.
Arm maintainers will it be fine for you to not split the patch?
---
Changes in V5:
- Removed generated file: xen/include/headers++.chk.new
- Removed pointless #ifdef CONFIG_HAS_DEVICE_TREE ... #endif for PPC as
CONFIG_HAS_DEVICE_TREE will be always used for PPC.
---
Changes in V4:
- Updated the commit message
- Switched Arm and PPC to asm-generic version of device.h
- Replaced HAS_PCI with CONFIG_HAS_PCI
- ifdef-ing iommu filed of dev_archdata struct with CONFIG_HAS_PASSTHROUGH
- ifdef-ing iommu_fwspec of device struct with CONFIG_HAS_PASSTHROUGH
- ifdef-ing DT related things with CONFIG_HAS_DEVICE_TREE
- Updated the commit message ( remove a note with question about
if device.h should be in asm-generic or not )
- Replaced DEVICE_IC with DEVICE_INTERRUPT_CONTROLLER
- Rationalized usage of CONFIG_HAS_* in device.h
- Fixed indents for ACPI_DEVICE_START and ACPI_DEVICE_END
---
Changes in V3:
- ifdef device tree related things.
- update the commit message
---
Changes in V2:
- take ( as common ) device.h from Arm as PPC and RISC-V use it as a base.
- #ifdef PCI related things.
- #ifdef ACPI related things.
- rename DEVICE_GIC to DEVIC_IC.
- rename #ifdef guards.
- switch Arm and PPC to generic device.h
- add SPDX tag
- update the commit message
---
xen/arch/arm/device.c | 15 ++-
xen/arch/arm/domain_build.c | 2 +-
xen/arch/arm/gic-v2.c | 4 +-
xen/arch/arm/gic-v3.c | 6 +-
xen/arch/arm/gic.c | 4 +-
xen/arch/arm/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/device.h | 53 --------
.../asm => include/asm-generic}/device.h | 125 +++++++++++-------
9 files changed, 102 insertions(+), 109 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/device.h
rename xen/{arch/arm/include/asm => include/asm-generic}/device.h (79%)
diff --git a/xen/arch/arm/device.c b/xen/arch/arm/device.c
index 1f631d3274..affbe79f9a 100644
--- a/xen/arch/arm/device.c
+++ b/xen/arch/arm/device.c
@@ -16,7 +16,10 @@
#include <xen/lib.h>
extern const struct device_desc _sdevice[], _edevice[];
+
+#ifdef CONFIG_ACPI
extern const struct acpi_device_desc _asdevice[], _aedevice[];
+#endif
int __init device_init(struct dt_device_node *dev, enum device_class class,
const void *data)
@@ -45,6 +48,7 @@ int __init device_init(struct dt_device_node *dev, enum device_class class,
return -EBADF;
}
+#ifdef CONFIG_ACPI
int __init acpi_device_init(enum device_class class, const void *data, int class_type)
{
const struct acpi_device_desc *desc;
@@ -61,6 +65,7 @@ int __init acpi_device_init(enum device_class class, const void *data, int class
return -EBADF;
}
+#endif
enum device_class device_get_class(const struct dt_device_node *dev)
{
@@ -329,9 +334,13 @@ int handle_device(struct domain *d, struct dt_device_node *dev, p2m_type_t p2mt,
struct map_range_data mr_data = {
.d = d,
.p2mt = p2mt,
- .skip_mapping = !own_device ||
- (is_pci_passthrough_enabled() &&
- (device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE)),
+ .skip_mapping =
+ !own_device
+#ifdef CONFIG_HAS_PCI
+ || (is_pci_passthrough_enabled() &&
+ (device_get_class(dev) == DEVICE_PCI_HOSTBRIDGE))
+#endif
+ ,
.iomem_ranges = iomem_ranges,
.irq_ranges = irq_ranges
};
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 28df515a3d..a0518993b1 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -1651,7 +1651,7 @@ static int __init handle_node(struct domain *d, struct kernel_info *kinfo,
* Replace these nodes with our own. Note that the original may be
* used_by DOMID_XEN so this check comes first.
*/
- if ( device_get_class(node) == DEVICE_GIC )
+ if ( device_get_class(node) == DEVICE_INTERRUPT_CONTROLLER )
return make_gic_node(d, kinfo->fdt, node);
if ( dt_match_node(timer_matches, node) )
return make_timer_node(kinfo);
diff --git a/xen/arch/arm/gic-v2.c b/xen/arch/arm/gic-v2.c
index cf392bfd1c..5d6885e389 100644
--- a/xen/arch/arm/gic-v2.c
+++ b/xen/arch/arm/gic-v2.c
@@ -1366,7 +1366,7 @@ static const struct dt_device_match gicv2_dt_match[] __initconst =
{ /* sentinel */ },
};
-DT_DEVICE_START(gicv2, "GICv2", DEVICE_GIC)
+DT_DEVICE_START(gicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER)
.dt_match = gicv2_dt_match,
.init = gicv2_dt_preinit,
DT_DEVICE_END
@@ -1381,7 +1381,7 @@ static int __init gicv2_acpi_preinit(const void *data)
return 0;
}
-ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_GIC)
+ACPI_DEVICE_START(agicv2, "GICv2", DEVICE_INTERRUPT_CONTROLLER)
.class_type = ACPI_MADT_GIC_VERSION_V2,
.init = gicv2_acpi_preinit,
ACPI_DEVICE_END
diff --git a/xen/arch/arm/gic-v3.c b/xen/arch/arm/gic-v3.c
index 18289cd645..9e135aeb3d 100644
--- a/xen/arch/arm/gic-v3.c
+++ b/xen/arch/arm/gic-v3.c
@@ -1879,7 +1879,7 @@ static const struct dt_device_match gicv3_dt_match[] __initconst =
{ /* sentinel */ },
};
-DT_DEVICE_START(gicv3, "GICv3", DEVICE_GIC)
+DT_DEVICE_START(gicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER)
.dt_match = gicv3_dt_match,
.init = gicv3_dt_preinit,
DT_DEVICE_END
@@ -1894,12 +1894,12 @@ static int __init gicv3_acpi_preinit(const void *data)
return 0;
}
-ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_GIC)
+ACPI_DEVICE_START(agicv3, "GICv3", DEVICE_INTERRUPT_CONTROLLER)
.class_type = ACPI_MADT_GIC_VERSION_V3,
.init = gicv3_acpi_preinit,
ACPI_DEVICE_END
-ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_GIC)
+ACPI_DEVICE_START(agicv4, "GICv4", DEVICE_INTERRUPT_CONTROLLER)
.class_type = ACPI_MADT_GIC_VERSION_V4,
.init = gicv3_acpi_preinit,
ACPI_DEVICE_END
diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index d922ea67aa..b5a9c8266c 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -234,7 +234,7 @@ static void __init gic_dt_preinit(void)
if ( !dt_get_parent(node) )
continue;
- rc = device_init(node, DEVICE_GIC, NULL);
+ rc = device_init(node, DEVICE_INTERRUPT_CONTROLLER, NULL);
if ( !rc )
{
/* NOTE: Only one GIC is supported */
@@ -262,7 +262,7 @@ static void __init gic_acpi_preinit(void)
dist = container_of(header, struct acpi_madt_generic_distributor, header);
- if ( acpi_device_init(DEVICE_GIC, NULL, dist->version) )
+ if ( acpi_device_init(DEVICE_INTERRUPT_CONTROLLER, NULL, dist->version) )
panic("Unable to find compatible GIC in the ACPI table\n");
}
#else
diff --git a/xen/arch/arm/include/asm/Makefile b/xen/arch/arm/include/asm/Makefile
index a28cc5d1b1..c3f4291ee2 100644
--- a/xen/arch/arm/include/asm/Makefile
+++ b/xen/arch/arm/include/asm/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
generic-y += altp2m.h
+generic-y += device.h
generic-y += hardirq.h
generic-y += iocap.h
generic-y += numa.h
diff --git a/xen/arch/ppc/include/asm/Makefile b/xen/arch/ppc/include/asm/Makefile
index efd72862c8..adb752b804 100644
--- a/xen/arch/ppc/include/asm/Makefile
+++ b/xen/arch/ppc/include/asm/Makefile
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
generic-y += altp2m.h
+generic-y += device.h
generic-y += div64.h
generic-y += hardirq.h
generic-y += hypercall.h
diff --git a/xen/arch/ppc/include/asm/device.h b/xen/arch/ppc/include/asm/device.h
deleted file mode 100644
index 8253e61d51..0000000000
--- a/xen/arch/ppc/include/asm/device.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-#ifndef __ASM_PPC_DEVICE_H__
-#define __ASM_PPC_DEVICE_H__
-
-enum device_type
-{
- DEV_DT,
- DEV_PCI,
-};
-
-struct device {
- enum device_type type;
-#ifdef CONFIG_HAS_DEVICE_TREE
- struct dt_device_node *of_node; /* Used by drivers imported from Linux */
-#endif
-};
-
-enum device_class
-{
- DEVICE_SERIAL,
- DEVICE_IOMMU,
- DEVICE_PCI_HOSTBRIDGE,
- /* Use for error */
- DEVICE_UNKNOWN,
-};
-
-struct device_desc {
- /* Device name */
- const char *name;
- /* Device class */
- enum device_class class;
- /* List of devices supported by this driver */
- const struct dt_device_match *dt_match;
- /*
- * Device initialization.
- *
- * -EAGAIN is used to indicate that device probing is deferred.
- */
- int (*init)(struct dt_device_node *dev, const void *data);
-};
-
-typedef struct device device_t;
-
-#define DT_DEVICE_START(name_, namestr_, class_) \
-static const struct device_desc __dev_desc_##name_ __used \
-__section(".dev.info") = { \
- .name = namestr_, \
- .class = class_, \
-
-#define DT_DEVICE_END \
-};
-
-#endif /* __ASM_PPC_DEVICE_H__ */
diff --git a/xen/arch/arm/include/asm/device.h b/xen/include/asm-generic/device.h
similarity index 79%
rename from xen/arch/arm/include/asm/device.h
rename to xen/include/asm-generic/device.h
index b5d451e087..063c448c4e 100644
--- a/xen/arch/arm/include/asm/device.h
+++ b/xen/include/asm-generic/device.h
@@ -1,14 +1,37 @@
-#ifndef __ASM_ARM_DEVICE_H
-#define __ASM_ARM_DEVICE_H
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef __ASM_GENERIC_DEVICE_H__
+#define __ASM_GENERIC_DEVICE_H__
+
+#include <xen/stdbool.h>
enum device_type
{
+#ifdef CONFIG_HAS_DEVICE_TREE
DEV_DT,
+#endif
+
+#ifdef CONFIG_HAS_PCI
DEV_PCI,
+#endif
+ DEV_TYPE_MAX,
+};
+
+enum device_class
+{
+ DEVICE_SERIAL,
+ DEVICE_IOMMU,
+ DEVICE_INTERRUPT_CONTROLLER,
+#ifdef CONFIG_HAS_PCI
+ DEVICE_PCI_HOSTBRIDGE,
+#endif
+ /* Use for error */
+ DEVICE_UNKNOWN,
};
struct dev_archdata {
+#ifdef CONFIG_HAS_PASSTHROUGH
void *iommu; /* IOMMU private data */
+#endif
};
/* struct device - The basic device structure */
@@ -19,31 +42,65 @@ struct device
struct dt_device_node *of_node; /* Used by drivers imported from Linux */
#endif
struct dev_archdata archdata;
+#ifdef CONFIG_HAS_PASSTHROUGH
struct iommu_fwspec *iommu_fwspec; /* per-device IOMMU instance data */
+#endif
};
typedef struct device device_t;
+#ifdef CONFIG_HAS_DEVICE_TREE
+
#include <xen/device_tree.h>
-#define dev_is_pci(dev) ((dev)->type == DEV_PCI)
#define dev_is_dt(dev) ((dev)->type == DEV_DT)
-enum device_class
-{
- DEVICE_SERIAL,
- DEVICE_IOMMU,
- DEVICE_GIC,
- DEVICE_PCI_HOSTBRIDGE,
- /* Use for error */
- DEVICE_UNKNOWN,
+/**
+ * device_init - Initialize a device
+ * @dev: device to initialize
+ * @class: class of the device (serial, network...)
+ * @data: specific data for initializing the device
+ *
+ * Return 0 on success.
+ */
+int device_init(struct dt_device_node *dev, enum device_class class,
+ const void *data);
+
+/**
+ * device_get_type - Get the type of the device
+ * @dev: device to match
+ *
+ * Return the device type on success or DEVICE_ANY on failure
+ */
+enum device_class device_get_class(const struct dt_device_node *dev);
+
+#define DT_DEVICE_START(_name, _namestr, _class) \
+static const struct device_desc __dev_desc_##_name __used \
+__section(".dev.info") = { \
+ .name = _namestr, \
+ .class = _class, \
+
+#define DT_DEVICE_END \
};
+#else /* !CONFIG_HAS_DEVICE_TREE */
+#define dev_is_dt(dev) ((void)(dev), false)
+#endif /* CONFIG_HAS_DEVICE_TREE */
+
+#ifdef CONFIG_HAS_PCI
+#define dev_is_pci(dev) ((dev)->type == DEV_PCI)
+#else
+#define dev_is_pci(dev) ((void)(dev), false)
+#endif
+
struct device_desc {
/* Device name */
const char *name;
/* Device class */
enum device_class class;
+
+#ifdef CONFIG_HAS_DEVICE_TREE
+
/* List of devices supported by this driver */
const struct dt_device_match *dt_match;
/*
@@ -52,8 +109,12 @@ struct device_desc {
* -EAGAIN is used to indicate that device probing is deferred.
*/
int (*init)(struct dt_device_node *dev, const void *data);
+
+#endif
};
+#ifdef CONFIG_ACPI
+
struct acpi_device_desc {
/* Device name */
const char *name;
@@ -75,44 +136,18 @@ struct acpi_device_desc {
int acpi_device_init(enum device_class class,
const void *data, int class_type);
-/**
- * device_init - Initialize a device
- * @dev: device to initialize
- * @class: class of the device (serial, network...)
- * @data: specific data for initializing the device
- *
- * Return 0 on success.
- */
-int device_init(struct dt_device_node *dev, enum device_class class,
- const void *data);
-
-/**
- * device_get_type - Get the type of the device
- * @dev: device to match
- *
- * Return the device type on success or DEVICE_ANY on failure
- */
-enum device_class device_get_class(const struct dt_device_node *dev);
+#define ACPI_DEVICE_START(_name, _namestr, _class) \
+static const struct acpi_device_desc __dev_desc_##_name __used \
+__section(".adev.info") = { \
+ .name = _namestr, \
+ .class = _class, \
-#define DT_DEVICE_START(_name, _namestr, _class) \
-static const struct device_desc __dev_desc_##_name __used \
-__section(".dev.info") = { \
- .name = _namestr, \
- .class = _class, \
-
-#define DT_DEVICE_END \
+#define ACPI_DEVICE_END \
};
-#define ACPI_DEVICE_START(_name, _namestr, _class) \
-static const struct acpi_device_desc __dev_desc_##_name __used \
-__section(".adev.info") = { \
- .name = _namestr, \
- .class = _class, \
-
-#define ACPI_DEVICE_END \
-};
+#endif /* CONFIG_ACPI */
-#endif /* __ASM_ARM_DEVICE_H */
+#endif /* __ASM_GENERIC_DEVICE_H__ */
/*
* Local variables:
--
2.43.0
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-01 20:48 ` [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h> Oleksii Kurochko
@ 2023-12-04 8:41 ` Jan Beulich
2023-12-04 9:39 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-04 8:41 UTC (permalink / raw)
To: Oleksii Kurochko
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 01.12.2023 21:48, Oleksii Kurochko wrote:
> Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
> generation of empty <asm/grant_table.h> for cases when
> CONFIG_GRANT_TABLE is not enabled.
>
> The following changes were done for Arm:
> <asm/grant_table.h> should be included directly because it contains
> gnttab_dom0_frames() macros which is unique for Arm and is used in
> arch/arm/domain_build.c.
> <asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
> <xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE gnttab_dom0_frames
> won't be available for use in arch/arm/domain_build.c.
>
> Suggested-by: Jan Beulich <jbeulich@suse.com>
Not really, no: In particular ...
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -15,6 +15,7 @@ config CORE_PARKING
> config GRANT_TABLE
> bool "Grant table support" if EXPERT
> default y
> + depends on ARM || X86
... this I explicitly said I consider wrong to add.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
2023-12-01 20:48 ` [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h> Oleksii Kurochko
@ 2023-12-04 8:46 ` Jan Beulich
2023-12-04 9:36 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-04 8:46 UTC (permalink / raw)
To: Oleksii Kurochko
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu,
Shawn Anastasio, xen-devel
On 01.12.2023 21:48, Oleksii Kurochko wrote:
> --- a/xen/common/Kconfig
> +++ b/xen/common/Kconfig
> @@ -87,7 +87,7 @@ config MEM_ACCESS_ALWAYS_ON
> config MEM_ACCESS
> def_bool MEM_ACCESS_ALWAYS_ON
> prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON
> - depends on HVM
> + depends on HVM && (ARM || X86)
While - unlike for GRANT_TABLE - I view going this route as an option, I
still think it wants doing without explicitly naming architectures here.
There wants to be a HAS_MEM_ACCESS, selected by Arm's Kconfig and by
MEM_ACCESS_ALWAYS_ON (which in turn x86 selects). This could then also
replace the HVM dependency here - x86 ought to select MEM_ACCESS_ALWAYS_ON
only when HVM is enabled.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
2023-12-04 8:46 ` Jan Beulich
@ 2023-12-04 9:36 ` Oleksii
0 siblings, 0 replies; 21+ messages in thread
From: Oleksii @ 2023-12-04 9:36 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Tamas K Lengyel, Alexandru Isaila, Petre Pircalabu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-04 at 09:46 +0100, Jan Beulich wrote:
> On 01.12.2023 21:48, Oleksii Kurochko wrote:
> > --- a/xen/common/Kconfig
> > +++ b/xen/common/Kconfig
> > @@ -87,7 +87,7 @@ config MEM_ACCESS_ALWAYS_ON
> > config MEM_ACCESS
> > def_bool MEM_ACCESS_ALWAYS_ON
> > prompt "Memory Access and VM events" if
> > !MEM_ACCESS_ALWAYS_ON
> > - depends on HVM
> > + depends on HVM && (ARM || X86)
>
> While - unlike for GRANT_TABLE - I view going this route as an
> option, I
> still think it wants doing without explicitly naming architectures
> here.
> There wants to be a HAS_MEM_ACCESS, selected by Arm's Kconfig and by
> MEM_ACCESS_ALWAYS_ON (which in turn x86 selects). This could then
> also
> replace the HVM dependency here - x86 ought to select
> MEM_ACCESS_ALWAYS_ON
> only when HVM is enabled.
Thanks.
It will be definetely better to introduce HAS_MEM_ACCESS.
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-04 8:41 ` Jan Beulich
@ 2023-12-04 9:39 ` Oleksii
2023-12-04 9:46 ` Jan Beulich
0 siblings, 1 reply; 21+ messages in thread
From: Oleksii @ 2023-12-04 9:39 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-04 at 09:41 +0100, Jan Beulich wrote:
> On 01.12.2023 21:48, Oleksii Kurochko wrote:
> > Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
> > generation of empty <asm/grant_table.h> for cases when
> > CONFIG_GRANT_TABLE is not enabled.
> >
> > The following changes were done for Arm:
> > <asm/grant_table.h> should be included directly because it contains
> > gnttab_dom0_frames() macros which is unique for Arm and is used in
> > arch/arm/domain_build.c.
> > <asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
> > <xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE
> > gnttab_dom0_frames
> > won't be available for use in arch/arm/domain_build.c.
> >
> > Suggested-by: Jan Beulich <jbeulich@suse.com>
>
> Not really, no: In particular ...
>
> > --- a/xen/common/Kconfig
> > +++ b/xen/common/Kconfig
> > @@ -15,6 +15,7 @@ config CORE_PARKING
> > config GRANT_TABLE
> > bool "Grant table support" if EXPERT
> > default y
> > + depends on ARM || X86
>
> ... this I explicitly said I consider wrong to add.
Then I misunderstood you.
What about to do the same as with MEM_ACCESS config and introduce
HAS_GRANT_TABLE?
Or would it be better just update "depends on" to !RISCV && !PPC?
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-04 9:39 ` Oleksii
@ 2023-12-04 9:46 ` Jan Beulich
2023-12-04 10:34 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-04 9:46 UTC (permalink / raw)
To: Oleksii
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 04.12.2023 10:39, Oleksii wrote:
> On Mon, 2023-12-04 at 09:41 +0100, Jan Beulich wrote:
>> On 01.12.2023 21:48, Oleksii Kurochko wrote:
>>> Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
>>> generation of empty <asm/grant_table.h> for cases when
>>> CONFIG_GRANT_TABLE is not enabled.
>>>
>>> The following changes were done for Arm:
>>> <asm/grant_table.h> should be included directly because it contains
>>> gnttab_dom0_frames() macros which is unique for Arm and is used in
>>> arch/arm/domain_build.c.
>>> <asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
>>> <xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE
>>> gnttab_dom0_frames
>>> won't be available for use in arch/arm/domain_build.c.
>>>
>>> Suggested-by: Jan Beulich <jbeulich@suse.com>
>>
>> Not really, no: In particular ...
>>
>>> --- a/xen/common/Kconfig
>>> +++ b/xen/common/Kconfig
>>> @@ -15,6 +15,7 @@ config CORE_PARKING
>>> config GRANT_TABLE
>>> bool "Grant table support" if EXPERT
>>> default y
>>> + depends on ARM || X86
>>
>> ... this I explicitly said I consider wrong to add.
> Then I misunderstood you.
>
> What about to do the same as with MEM_ACCESS config and introduce
> HAS_GRANT_TABLE?
That's an option, provided (and I put that under question before) there
realistically can be ports which don't mean to support grant tables.
You mentioned that things are fine for the dom0less setup you're testing,
but I don't think a fully-functional Xen port makes sense to only support
dom0less. But of course I'm willing to hear arguments to the contrary.
> Or would it be better just update "depends on" to !RISCV && !PPC?
Definitely not.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-04 9:46 ` Jan Beulich
@ 2023-12-04 10:34 ` Oleksii
2023-12-04 10:39 ` Jan Beulich
0 siblings, 1 reply; 21+ messages in thread
From: Oleksii @ 2023-12-04 10:34 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-04 at 10:46 +0100, Jan Beulich wrote:
> On 04.12.2023 10:39, Oleksii wrote:
> > On Mon, 2023-12-04 at 09:41 +0100, Jan Beulich wrote:
> > > On 01.12.2023 21:48, Oleksii Kurochko wrote:
> > > > Ifdef-ing inclusion of <asm/grant_table.h> allows to avoid
> > > > generation of empty <asm/grant_table.h> for cases when
> > > > CONFIG_GRANT_TABLE is not enabled.
> > > >
> > > > The following changes were done for Arm:
> > > > <asm/grant_table.h> should be included directly because it
> > > > contains
> > > > gnttab_dom0_frames() macros which is unique for Arm and is used
> > > > in
> > > > arch/arm/domain_build.c.
> > > > <asm/grant_table.h> is #ifdef-ed with CONFIG_GRANT_TABLE in
> > > > <xen/grant_table.h> so in case of !CONFIG_GRANT_TABLE
> > > > gnttab_dom0_frames
> > > > won't be available for use in arch/arm/domain_build.c.
> > > >
> > > > Suggested-by: Jan Beulich <jbeulich@suse.com>
> > >
> > > Not really, no: In particular ...
If it is comment was addressed to Suggested-by. Then it was added when
we didn't have a discussion about config GRANT_TABLE and depends on
things.
Probably I had to remove it after I started to update Kconfig things.
I am really sorry if I had to remove that before send this patch
version.
> > >
> > > > --- a/xen/common/Kconfig
> > > > +++ b/xen/common/Kconfig
> > > > @@ -15,6 +15,7 @@ config CORE_PARKING
> > > > config GRANT_TABLE
> > > > bool "Grant table support" if EXPERT
> > > > default y
> > > > + depends on ARM || X86
> > >
> > > ... this I explicitly said I consider wrong to add.
> > Then I misunderstood you.
> >
> > What about to do the same as with MEM_ACCESS config and introduce
> > HAS_GRANT_TABLE?
>
> That's an option, provided (and I put that under question before)
> there
> realistically can be ports which don't mean to support grant tables.
> You mentioned that things are fine for the dom0less setup you're
> testing,
> but I don't think a fully-functional Xen port makes sense to only
> support
> dom0less. But of course I'm willing to hear arguments to the
> contrary.
Unfortunately, I am not experienced in the depths of Xen, but I used
grant tables in Arm to share frames between dom0 and guest in PV
drivers. It should be another usage of grant tables.
I assume it is possible not to use grant tables and come up with
another solution, but it isn't the best idea, and I don't have any
reason not to use what already exists and works. Are there any cases
where something else, instead of grant tables, is used?
Therefore, I agree that a fully functional Xen port will support only
dom0less, but it can live for a long time only with dom0less. And in
non-dom0less grant tables will be used somewhere sooner or later.
>
> > Or would it be better just update "depends on" to !RISCV && !PPC?
>
> Definitely not.
So we have a "weird" situation.
Considering the message above, grant tables are likely to be used
anyway. From this point of view, there is not a lot of sense in
introducing "temporary" HAS_GRANT_TABLE as, at some point, every
architecture will use grant tables ( the same is with "depends on
!RISCV && &!PPC or any other combination ), and HAS_GRANT_TABLE won't
be needed any more except the time when support for new architecture
will be started and it will live without grant tables for some time.
But an introduction of HAS_GRANT_TABLE makes sense ( at least, when the
work on support for new architectures will be started ) for me.
If you ( or anyone else ) don't mind, I'll update the patch with an
introduction of HAS_GRANT_TABLE.
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-04 10:34 ` Oleksii
@ 2023-12-04 10:39 ` Jan Beulich
2023-12-11 14:43 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-04 10:39 UTC (permalink / raw)
To: Oleksii
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 04.12.2023 11:34, Oleksii wrote:
> If you ( or anyone else ) don't mind, I'll update the patch with an
> introduction of HAS_GRANT_TABLE.
I won't NAK such a patch, but unless convincing arguments appear I also
won't ACK it.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-04 10:39 ` Jan Beulich
@ 2023-12-11 14:43 ` Oleksii
2023-12-11 16:02 ` Jan Beulich
0 siblings, 1 reply; 21+ messages in thread
From: Oleksii @ 2023-12-11 14:43 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-04 at 11:39 +0100, Jan Beulich wrote:
> On 04.12.2023 11:34, Oleksii wrote:
> > If you ( or anyone else ) don't mind, I'll update the patch with an
> > introduction of HAS_GRANT_TABLE.
>
> I won't NAK such a patch, but unless convincing arguments appear I
> also
> won't ACK it.
I am going to disable GRANT_TABLE config for RISC-V ( and PPC? ) by
providing a separate YAML file ( riscv-fixed-randconfig.yaml ) with the
following content:
.riscv-fixed-randconfig:
variables:
EXTRA_FIXED_RANDCONFIG:
CONFIG_COVERAGE=n
CONFIG_GRANT_TABLE=n
CONFIG_MEM_ACCESS=n # this I'll add in the next patch where asm-
geneic for mem_access.h is introduced
And then for riscv*randconfig jobs do the following:
archlinux-current-gcc-riscv64-randconfig:
extends:
- .gcc-riscv64-cross-build
variables:
CONTAINER: archlinux:current-riscv64
KBUILD_DEFCONFIG: tiny64_defconfig
RANDCONFIG: y
EXTRA_FIXED_RANDCONFIG: !reference [.riscv-fixed-randconfig,
variables, EXTRA_FIXED_RANDCONFIG]
For RISC-V, I prefer having a separate file for all the
EXTRA_FIXED_RANDCONFIG because in another patch series [1], I'll
introduce a large number of disabled configs for randconfig.
For PPC, I don't think it's necessary to introduce a separate YAML file
for EXTRA_FIXED_RANDCONFIG. For the time being, it is only necessary to
disable two configs: CONFIG_GRANT_TABLE and CONFIG_MEM_ACCESS (in the
next patch of this series).
If this solution is acceptable to you, can I retain your 'Suggested-
by'?"
[1]:
https://lore.kernel.org/xen-devel/b4e85f8f58787b4d179022973ce25673d6b56e36.1700761381.git.oleksii.kurochko@gmail.com/
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-11 14:43 ` Oleksii
@ 2023-12-11 16:02 ` Jan Beulich
2023-12-11 17:37 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-11 16:02 UTC (permalink / raw)
To: Oleksii
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 11.12.2023 15:43, Oleksii wrote:
> On Mon, 2023-12-04 at 11:39 +0100, Jan Beulich wrote:
>> On 04.12.2023 11:34, Oleksii wrote:
>>> If you ( or anyone else ) don't mind, I'll update the patch with an
>>> introduction of HAS_GRANT_TABLE.
>>
>> I won't NAK such a patch, but unless convincing arguments appear I
>> also
>> won't ACK it.
> I am going to disable GRANT_TABLE config for RISC-V ( and PPC? ) by
> providing a separate YAML file ( riscv-fixed-randconfig.yaml ) with the
> following content:
> .riscv-fixed-randconfig:
> variables:
> EXTRA_FIXED_RANDCONFIG:
> CONFIG_COVERAGE=n
> CONFIG_GRANT_TABLE=n
> CONFIG_MEM_ACCESS=n # this I'll add in the next patch where asm-
> geneic for mem_access.h is introduced
>
> And then for riscv*randconfig jobs do the following:
> archlinux-current-gcc-riscv64-randconfig:
> extends:
> - .gcc-riscv64-cross-build
> variables:
> CONTAINER: archlinux:current-riscv64
> KBUILD_DEFCONFIG: tiny64_defconfig
> RANDCONFIG: y
> EXTRA_FIXED_RANDCONFIG: !reference [.riscv-fixed-randconfig,
> variables, EXTRA_FIXED_RANDCONFIG]
>
> For RISC-V, I prefer having a separate file for all the
> EXTRA_FIXED_RANDCONFIG because in another patch series [1], I'll
> introduce a large number of disabled configs for randconfig.
>
> For PPC, I don't think it's necessary to introduce a separate YAML file
> for EXTRA_FIXED_RANDCONFIG. For the time being, it is only necessary to
> disable two configs: CONFIG_GRANT_TABLE and CONFIG_MEM_ACCESS (in the
> next patch of this series).
Why would this be different for PPC and RISC-V?
> If this solution is acceptable to you, can I retain your 'Suggested-
> by'?"
No, please don't. I've replied to Andrew on the other thread - I don't
see why helping just gitlab-CI is desirable. I'm actually surprised
Linux have no solution ready for use, as the underlying problem of not
all settings necessarily being valid to use ought to affect them as
well. Then again perhaps this really only is a transient issue during
arch bringup ... In which case the approach taken here may be fine, but
it still wouldn't be what I suggested. It may then be Stefano or Andrew
who you could consider for such a tag.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-11 16:02 ` Jan Beulich
@ 2023-12-11 17:37 ` Oleksii
2023-12-11 17:49 ` Jan Beulich
0 siblings, 1 reply; 21+ messages in thread
From: Oleksii @ 2023-12-11 17:37 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-11 at 17:02 +0100, Jan Beulich wrote:
> On 11.12.2023 15:43, Oleksii wrote:
> > On Mon, 2023-12-04 at 11:39 +0100, Jan Beulich wrote:
> > > On 04.12.2023 11:34, Oleksii wrote:
> > > > If you ( or anyone else ) don't mind, I'll update the patch
> > > > with an
> > > > introduction of HAS_GRANT_TABLE.
> > >
> > > I won't NAK such a patch, but unless convincing arguments appear
> > > I
> > > also
> > > won't ACK it.
> > I am going to disable GRANT_TABLE config for RISC-V ( and PPC? ) by
> > providing a separate YAML file ( riscv-fixed-randconfig.yaml ) with
> > the
> > following content:
> > .riscv-fixed-randconfig:
> > variables:
> > EXTRA_FIXED_RANDCONFIG:
> > CONFIG_COVERAGE=n
> > CONFIG_GRANT_TABLE=n
> > CONFIG_MEM_ACCESS=n # this I'll add in the next patch where
> > asm-
> > geneic for mem_access.h is introduced
> >
> > And then for riscv*randconfig jobs do the following:
> > archlinux-current-gcc-riscv64-randconfig:
> > extends:
> > - .gcc-riscv64-cross-build
> > variables:
> > CONTAINER: archlinux:current-riscv64
> > KBUILD_DEFCONFIG: tiny64_defconfig
> > RANDCONFIG: y
> > EXTRA_FIXED_RANDCONFIG: !reference [.riscv-fixed-randconfig,
> > variables, EXTRA_FIXED_RANDCONFIG]
> >
> > For RISC-V, I prefer having a separate file for all the
> > EXTRA_FIXED_RANDCONFIG because in another patch series [1], I'll
> > introduce a large number of disabled configs for randconfig.
> >
> > For PPC, I don't think it's necessary to introduce a separate YAML
> > file
> > for EXTRA_FIXED_RANDCONFIG. For the time being, it is only
> > necessary to
> > disable two configs: CONFIG_GRANT_TABLE and CONFIG_MEM_ACCESS (in
> > the
> > next patch of this series).
>
> Why would this be different for PPC and RISC-V?
I haven't investigated that. Perhaps Shawn covered more stubs for a larger numberof configs, so he didn't encounter issues with some configs.
For example, during my tests with the inclusion of riscv-fixed-
randconfig.yaml,
randconfig jobs for RISC-V failed several times on perf.c.
At least, during the inclusion of #include <asm/perfc.h>, which is not
provided
for RISC-V, so CONFIG_PERFC_COUNTER is disabled for RISC-V.
However, Shawn either provided necessary stubs for
CONFIG_PERF_COUNTERS,
or it is just luck that such an issue didn't occur for PPC."
>
> > If this solution is acceptable to you, can I retain your
> > 'Suggested-
> > by'?"
>
> No, please don't. I've replied to Andrew on the other thread - I
> don't
> see why helping just gitlab-CI is desirable. I'm actually surprised
Well, now I understand your point better, and it makes sense. I was
more confident in the GitLab-CI solution before you replied on the
other thread.
However, it seems to me that randconfig exists only for testing
purposes and usually doesn't require running locally. Therefore, it
makes sense to perform all these tasks only for GitLab-CI to avoid
complicating things around the Makefile in case anything related to
KCONFIG_ALLCONFIG needs to be in sync with Linux.
In any case, I believe it's a good idea to wait for Andrew's feedback.
> Linux have no solution ready for use, as the underlying problem of
> not
> all settings necessarily being valid to use ought to affect them as
> well. Then again perhaps this really only is a transient issue during
> arch bringup ...
"It is challenging for me, at least, to predict whether all options
mentioned in EXTRA_FIXED_RANDCONFIG will be disabled in the future.
Most of them will likely be implemented, but certainty is difficult to
ascertain."
> In which case the approach taken here may be fine, but
> it still wouldn't be what I suggested. It may then be Stefano or
> Andrew
> who you could consider for such a tag.
I'm a bit confused again. In this case, it seems that both you andStefano or Andrew should be on the suggested list.
You proposed the approach with "#ifdef CONFIG_GRANT_TABLE #include
<asm/grant_table.h> #endif".
Stefano and Andrew suggested how to disable CONFIG_GRANT_TABLE for the
config.
Could you please clarify where my understanding is incorrect?
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-11 17:37 ` Oleksii
@ 2023-12-11 17:49 ` Jan Beulich
2023-12-11 19:40 ` Oleksii
0 siblings, 1 reply; 21+ messages in thread
From: Jan Beulich @ 2023-12-11 17:49 UTC (permalink / raw)
To: Oleksii
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 11.12.2023 18:37, Oleksii wrote:
> On Mon, 2023-12-11 at 17:02 +0100, Jan Beulich wrote:
>> In which case the approach taken here may be fine, but
>> it still wouldn't be what I suggested. It may then be Stefano or
>> Andrew
>> who you could consider for such a tag.
> I'm a bit confused again. In this case, it seems that both you andStefano or Andrew should be on the suggested list.
> You proposed the approach with "#ifdef CONFIG_GRANT_TABLE #include
> <asm/grant_table.h> #endif".
But you're not meaning to use that approach anymore, are you?
Jan
> Stefano and Andrew suggested how to disable CONFIG_GRANT_TABLE for the
> config.
>
> Could you please clarify where my understanding is incorrect?
>
> ~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-11 17:49 ` Jan Beulich
@ 2023-12-11 19:40 ` Oleksii
2023-12-12 8:11 ` Jan Beulich
0 siblings, 1 reply; 21+ messages in thread
From: Oleksii @ 2023-12-11 19:40 UTC (permalink / raw)
To: Jan Beulich
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On Mon, 2023-12-11 at 18:49 +0100, Jan Beulich wrote:
> On 11.12.2023 18:37, Oleksii wrote:
> > On Mon, 2023-12-11 at 17:02 +0100, Jan Beulich wrote:
> > > In which case the approach taken here may be fine, but
> > > it still wouldn't be what I suggested. It may then be Stefano or
> > > Andrew
> > > who you could consider for such a tag.
> > I'm a bit confused again. In this case, it seems that both you
> > andStefano or Andrew should be on the suggested list.
> > You proposed the approach with "#ifdef CONFIG_GRANT_TABLE #include
> > <asm/grant_table.h> #endif".
>
> But you're not meaning to use that approach anymore, are you?
No, I am going to use it because there is still a need to use #ifdef
for #include <asm/grant_table.h> in <xen/grant_table.h> to avoid
providing a useless empty asm/grant_table.h header if
CONFIG_GRANT_TABLE isn't supported.
~ Oleksii
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
2023-12-11 19:40 ` Oleksii
@ 2023-12-12 8:11 ` Jan Beulich
0 siblings, 0 replies; 21+ messages in thread
From: Jan Beulich @ 2023-12-12 8:11 UTC (permalink / raw)
To: Oleksii
Cc: Stefano Stabellini, Julien Grall, Bertrand Marquis, Michal Orzel,
Volodymyr Babchuk, Andrew Cooper, George Dunlap, Wei Liu,
Shawn Anastasio, xen-devel
On 11.12.2023 20:40, Oleksii wrote:
> On Mon, 2023-12-11 at 18:49 +0100, Jan Beulich wrote:
>> On 11.12.2023 18:37, Oleksii wrote:
>>> On Mon, 2023-12-11 at 17:02 +0100, Jan Beulich wrote:
>>>> In which case the approach taken here may be fine, but
>>>> it still wouldn't be what I suggested. It may then be Stefano or
>>>> Andrew
>>>> who you could consider for such a tag.
>>> I'm a bit confused again. In this case, it seems that both you
>>> andStefano or Andrew should be on the suggested list.
>>> You proposed the approach with "#ifdef CONFIG_GRANT_TABLE #include
>>> <asm/grant_table.h> #endif".
>>
>> But you're not meaning to use that approach anymore, are you?
> No, I am going to use it because there is still a need to use #ifdef
> for #include <asm/grant_table.h> in <xen/grant_table.h> to avoid
> providing a useless empty asm/grant_table.h header if
> CONFIG_GRANT_TABLE isn't supported.
Then _there_ keeping the tag is okay of course. But the CI change (or
whatever is come of it) will need treating in whichever way it is going
to move.
Jan
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2023-12-12 8:12 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-01 20:48 [PATCH v5 0/7] Introduce generic headers Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 1/7] xen/asm-generic: introduce generic div64.h header Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 2/7] xen/asm-generic: introduce stub header monitor.h Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 3/7] xen/asm-generic: introduce stub header numa.h Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 4/7] xen/asm-generic: introduce stub header softirq.h Oleksii Kurochko
2023-12-01 20:48 ` [PATCH v5 5/7] xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h> Oleksii Kurochko
2023-12-04 8:41 ` Jan Beulich
2023-12-04 9:39 ` Oleksii
2023-12-04 9:46 ` Jan Beulich
2023-12-04 10:34 ` Oleksii
2023-12-04 10:39 ` Jan Beulich
2023-12-11 14:43 ` Oleksii
2023-12-11 16:02 ` Jan Beulich
2023-12-11 17:37 ` Oleksii
2023-12-11 17:49 ` Jan Beulich
2023-12-11 19:40 ` Oleksii
2023-12-12 8:11 ` Jan Beulich
2023-12-01 20:48 ` [PATCH v5 6/7] xen/asm-generic: ifdef inclusion of <asm/mem_access.h> Oleksii Kurochko
2023-12-04 8:46 ` Jan Beulich
2023-12-04 9:36 ` Oleksii
2023-12-01 20:48 ` [PATCH v5 7/7] xen/asm-generic: introduce generic device.h Oleksii Kurochko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.