Introduce generic headers
v3 cover Introduce generic headers
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.
Patch related to delay.h [3] was sent separately.
[1] https://lore.kernel.org/xen-devel/[email protected]/
[2] https://lore.kernel.org/xen-devel/[email protected]/
[3] https://lore.kernel.org/xen-devel/3d55bce44bd6ab9973cbe0ea2fc136cc44d35df2.1698759633.git.oleksii.kurochko@gmail.com/
---
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 (14):
xen/asm-generic: introduce stub header paging.h xen/asm-generic: introduce generic device.h xen/asm-generic: introduce generic hypercall.h xen/asm-generic: introduce generic header iocap.h xen/asm-generic: introduce stub header <asm/random.h> xen/asm-generic: introduce generic header percpu.h xen/asm-generic: introduce generalized hardirq.h xen/asm-generic: introduce generic div64.h header xen/asm-generic: introduce generic header altp2m.h 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/arch/arm/domain_build.c | 1 +
xen/arch/arm/include/asm/Makefile | 7 +
xen/arch/arm/include/asm/altp2m.h | 39 -----
xen/arch/arm/include/asm/current.h | 3 +
xen/arch/arm/include/asm/paging.h | 16 --
xen/arch/arm/include/asm/random.h | 9 --
xen/arch/arm/p2m.c | 1 +
xen/arch/arm/traps.c | 1 +
xen/arch/ppc/include/asm/Makefile | 10 ++
xen/arch/ppc/include/asm/altp2m.h | 25 ---
xen/arch/ppc/include/asm/current.h | 6 +
xen/arch/ppc/include/asm/div64.h | 14 --
xen/arch/ppc/include/asm/grant_table.h | 5 -
xen/arch/ppc/include/asm/hardirq.h | 19 ---
xen/arch/ppc/include/asm/hypercall.h | 5 -
xen/arch/ppc/include/asm/iocap.h | 8 -
xen/arch/ppc/include/asm/mem_access.h | 5 -
xen/arch/ppc/include/asm/monitor.h | 43 -----
xen/arch/ppc/include/asm/numa.h | 26 ----
xen/arch/ppc/include/asm/paging.h | 7 -
xen/arch/ppc/include/asm/percpu.h | 24 ---
xen/arch/ppc/include/asm/random.h | 9 --
xen/arch/x86/include/asm/Makefile | 3 +
xen/arch/x86/include/asm/current.h | 2 +
xen/arch/x86/include/asm/div64.h | 14 --
xen/arch/x86/include/asm/percpu.h | 22 ---
xen/include/asm-generic/altp2m.h | 34 ++++
xen/include/asm-generic/device.h | 147 ++++++++++++++++++
xen/include/asm-generic/div64.h | 27 ++++
.../asm => include/asm-generic}/hardirq.h | 8 +-
xen/include/asm-generic/hypercall.h | 18 +++
.../asm => include/asm-generic}/iocap.h | 7 +-
xen/include/asm-generic/monitor.h | 63 ++++++++
.../asm => include/asm-generic}/numa.h | 13 +-
xen/include/asm-generic/paging.h | 19 +++
.../asm => include/asm-generic}/percpu.h | 18 ++-
xen/include/asm-generic/random.h | 20 +++
xen/include/asm-generic/softirq.h | 17 ++
xen/include/xen/grant_table.h | 3 +
xen/include/xen/mem_access.h | 2 +
xen/include/xen/percpu.h | 4 +-
41 files changed, 414 insertions(+), 310 deletions(-)
delete mode 100644 xen/arch/arm/include/asm/altp2m.h
delete mode 100644 xen/arch/arm/include/asm/paging.h
delete mode 100644 xen/arch/arm/include/asm/random.h
delete mode 100644 xen/arch/ppc/include/asm/altp2m.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/hardirq.h
delete mode 100644 xen/arch/ppc/include/asm/hypercall.h
delete mode 100644 xen/arch/ppc/include/asm/iocap.h
delete mode 100644 xen/arch/ppc/include/asm/mem_access.h
delete mode 100644 xen/arch/ppc/include/asm/monitor.h
delete mode 100644 xen/arch/ppc/include/asm/numa.h
delete mode 100644 xen/arch/ppc/include/asm/paging.h
delete mode 100644 xen/arch/ppc/include/asm/percpu.h
delete mode 100644 xen/arch/ppc/include/asm/random.h
create mode 100644 xen/arch/x86/include/asm/Makefile
delete mode 100644 xen/arch/x86/include/asm/div64.h
delete mode 100644 xen/arch/x86/include/asm/percpu.h
create mode 100644 xen/include/asm-generic/altp2m.h
create mode 100644 xen/include/asm-generic/device.h
create mode 100644 xen/include/asm-generic/div64.h
rename xen/{arch/arm/include/asm => include/asm-generic}/hardirq.h (79%)
create mode 100644 xen/include/asm-generic/hypercall.h
rename xen/{arch/arm/include/asm => include/asm-generic}/iocap.h (60%)
create mode 100644 xen/include/asm-generic/monitor.h
rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (75%)
create mode 100644 xen/include/asm-generic/paging.h
rename xen/{arch/arm/include/asm => include/asm-generic}/percpu.h (57%)
create mode 100644 xen/include/asm-generic/random.h
create mode 100644 xen/include/asm-generic/softirq.hSignature · 1 line
2.41.0
PATCH v3 1/14 xen/asm-generic: introduce stub header paging.h
The patch introduces generic paging.h header for Arm, PPC and RISC-V.
All mentioned above architectures use hardware virt extensions and hardware pagetable extensions thereby it makes sense to set paging_mode_translate and paging_mode_external by default.
Also in this patch Arm and PPC architectures are switched to generic paging.h header.
---
Changes in V3:
- Sort xen/arch/{arm,ppc}/include/asm/Makefile alphabetically.
- Add Reviewed-by: Jan Beulich <[email protected]>
---
Changes in V2:
- evaluate argument of macros
- covert macros to true
- use proper tabs
- switch Arm & PPC to generic paging.h
- update commit message
--- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/paging.h | 16 ---------------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/paging.h | 7 ------- xen/include/asm-generic/paging.h | 19 +++++++++++++++++++ 5 files changed, 21 insertions(+), 23 deletions(-) delete mode 100644 xen/arch/arm/include/asm/paging.h delete mode 100644 xen/arch/ppc/include/asm/paging.h create mode 100644 xen/include/asm-generic/paging.h
xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += paging.h generic-y += vm_event.h
xen/arch/arm/include/asm/paging.h deleted +0 -16
@@ -1,16 +0,0 @@ -#ifndef _XEN_PAGING_H -#define _XEN_PAGING_H - -#define paging_mode_translate (d) (1) -#define paging_mode_external (d) (1) - -#endif /* XEN_PAGING_H */ - -/* -* Local variables: -* mode: C -* c-file-style: "BSD" -* c-basic-offset: 4 -* indent-tabs-mode: nil -* End: -*/
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += paging.h generic-y += vm_event.h
xen/arch/ppc/include/asm/paging.h deleted +0 -7
@@ -1,7 +0,0 @@ -#ifndef __ASM_PPC_PAGING_H__ -#define __ASM_PPC_PAGING_H__ - -#define paging_mode_translate (d) (1) -#define paging_mode_external (d) (1) - -#endif /* __ASM_PPC_PAGING_H__ */
xen/include/asm-generic/paging.h new file +19 -0
@@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_PAGING_H__ +#define __ASM_GENERIC_PAGING_H__ + +#include <xen/stdbool.h> + +#define paging_mode_translate (d) ((void)(d), true) +#define paging_mode_external (d) ((void)(d), true) + +#endif /* __ASM_GENERIC_PAGING_H__ */ + +/* +* Local variables: +* mode: C +* c-file-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
2.41.0
Re: [PATCH v3 01/14] xen/asm-generic: introduce stub header paging.h
Hi Oleksii,
Quoted 7 lines · Oleksii Kurochko
The patch introduces generic
paging.hheader for Arm, PPC and RISC-V.All mentioned above architectures use hardware virt extensions and hardware pagetable extensions thereby it makes sense to set
paging_mode_translateandpaging_mode_externalby default.
Quoted 5 lines
Also in this patch Arm and PPC architectures are switched to generic
paging.hheader.Signed-off-by Oleksii Kurochko <[email protected]>Reviewed-by Jan Beulich <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 2/14 xen/asm-generic: introduce generic device.h
In reply to Oleksii KurochkoArm, 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.
---
It is still open question if device.h should be in asm-generic. Need more opinions.
---
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/include/asm-generic/device.h | 147 +++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 xen/include/asm-generic/device.h
xen/include/asm-generic/device.h new file +147 -0
@@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE +DEV_DT , +#endif + +#ifdef HAS_PCI +DEV_PCI , +#endif +}; + +struct dev_archdata { +void *iommu;/* IOMMU private data */ +}; + +/* struct device - The basic device structure */ +struct device +{ +enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE +struct dt_device_node *of_node;/* Used by drivers imported from Linux */ +#endif +struct dev_archdata archdata; +struct iommu_fwspec *iommu_fwspec;/* per-device IOMMU instance data */ +}; + +typedef struct device device_t ; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include <xen/device_tree.h> +#endif + +#ifdef HAS_PCI +#define dev_is_pci (dev) ((dev)->type == DEV_PCI) +#endif + +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt (dev) ((dev)->type == DEV_DT) +#endif + +enum device_class +{ +DEVICE_SERIAL , +DEVICE_IOMMU , +DEVICE_IC , +#ifdef HAS_PCI +DEVICE_PCI_HOSTBRIDGE , +#endif +/* 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); +}; + +#ifdef CONFIG_ACPI + +struct acpi_device_desc { +/* Device name */ +const char *name; +/* Device class */ +enum device_class class; +/* type of device supported by the driver */ +const int class_type; +/* Device initialization */ +int (*init)(const void *data); +}; + +/** +* acpi_device_init - Initialize a device +* @class: class of the device (serial, network...) +* @data: specific data for initializing the device +* +* Return 0 on success. +*/ +int acpi_device_init (enum device_class class, +const void *data,int class_type); + +#endif /* CONFIG_ACPI */ + +/** +* 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 \ +}; + +#ifdef CONFIG_ACPI + +#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_GENERIC_DEVICE_H__ */ + +/* +* Local variables: +* mode: C +* c-file-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
2.41.0
Re: [PATCH v3 02/14] xen/asm-generic: introduce generic device.h
Quoted 4 lines · Oleksii Kurochko
xen/include/asm-generic/device.h new file +1
-0@@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */
xen/include/asm-generic/device.h line 11
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + +#ifdef HAS_PCI
CONFIG_HAS_PCI?
xen/include/asm-generic/device.h line 17
Quoted 6 lines
xen/include/asm-generic/device.h new file +6
-0+ DEV_PCI, +#endif +}; + +struct dev_archdata { +void *iommu;/* IOMMU private data */
#ifdef CONFIG_HAS_PASSTHROUGH around this field?
xen/include/asm-generic/device.h line 28
Quoted 11 lines
xen/include/asm-generic/device.h new file +11
-0+}; + +/* struct device - The basic device structure */ +struct device +{ +enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE +struct dt_device_node *of_node;/* Used by drivers imported from Linux */ +#endif +struct dev_archdata archdata; +struct iommu_fwspec *iommu_fwspec;/* per-device IOMMU instance data */
Same here then?
Quoted 11 lines
xen/include/asm-generic/device.h new file +11
-0+}; + +typedef struct device device_t ; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include <xen/device_tree.h> +#endif + +#ifdef HAS_PCI +#define dev_is_pci (dev) ((dev)->type == DEV_PCI) +#endif
xen/include/asm-generic/device.h line 49
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+ +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt (dev) ((dev)->type == DEV_DT) +#endif + +enum device_class +{ +DEVICE_SERIAL , +DEVICE_IOMMU , +DEVICE_IC ,
What is IC here? (And thus: Is this generic enough to live here?)
Quoted 4 lines
xen/include/asm-generic/device.h new file +4
-0+#ifdef HAS_PCI + DEVICE_PCI_HOSTBRIDGE, +#endif +/* Use for error */
xen/include/asm-generic/device.h line 63
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+ 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;
This and ...
xen/include/asm-generic/device.h line 69
Quoted 6 lines
xen/include/asm-generic/device.h new file +6
-0+/* +* Device initialization. +* +* -EAGAIN is used to indicate that device probing is deferred. +*/ +int (*init)(struct dt_device_node *dev,const void *data);
... this look to be DT-specific.
Quoted 27 lines
xen/include/asm-generic/device.h new file +27
-0+}; + +#ifdef CONFIG_ACPI + +struct acpi_device_desc { +/* Device name */ +const char *name; +/* Device class */ +enum device_class class; +/* type of device supported by the driver */ +const int class_type; +/* Device initialization */ +int (*init)(const void *data); +}; + +/** +* acpi_device_init - Initialize a device +* @class: class of the device (serial, network...) +* @data: specific data for initializing the device +* +* Return 0 on success. +*/ +int acpi_device_init (enum device_class class, +const void *data,int class_type); + +#endif /* CONFIG_ACPI */ +
xen/include/asm-generic/device.h line 106
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+/** +* 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);
As is this, simply from its first parameter's type.
Quoted 6 lines
xen/include/asm-generic/device.h new file +6
-0+/** +* device_get_type - Get the type of the device +* @dev: device to match +* +* Return the device type on success or DEVICE_ANY on failure +*/
xen/include/asm-generic/device.h line 123
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+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 \ +};
And all of these.
Jan
Re: [PATCH v3 02/14] xen/asm-generic: introduce generic device.h
Quoted 17 lines · Jan Beulich
Quoted 4 lines · Oleksii Kurochko
xen/include/asm-generic/device.h new file +1
-0@@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ xen/include/asm-generic/device.h line 11
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + +#ifdef HAS_PCI
CONFIG_HAS_PCI?
Should be CONFIG_HAS_PCI. Thanks.
Quoted 9 lines
xen/include/asm-generic/device.h line 17
Quoted 7 lines
xen/include/asm-generic/device.h new file +6
-0+ DEV_PCI, +#endif +}; + +struct dev_archdata { + void *iommu; /* IOMMU private data */#ifdef
CONFIG_HAS_PASSTHROUGHaround this field?
It makes sense to #ifdef iommu and iommu_fwspec fields. I'll add it.
Quoted 32 lines
Quoted 9 lines
xen/include/asm-generic/device.h new file +8
-0+}; + +/* struct device - The basic device structure */ +struct device +{ + enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE + struct dt_device_node *of_node; /* Used by drivers importedQuoted 5 lines
from Linux */
+#endif
+ structdev_archdataarchdata;
+ structiommu_fwspec*iommu_fwspec; /* per-device IOMMU instance data */Same here then?
Quoted 15 lines
xen/include/asm-generic/device.h new file +15
-0+}; + +typedef struct device device_t ; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include <xen/device_tree.h> +#endif + +#ifdef HAS_PCI +#define dev_is_pci (dev) ((dev)->type == DEV_PCI) +#endif + +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt (dev) ((dev)->type == DEV_DT) +#endif
Quoted 8 lines
xen/include/asm-generic/device.h line 49
Quoted 6 lines
xen/include/asm-generic/device.h new file +6
-0+ +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_IC,What is IC here? (And thus: Is this generic enough to live here?)
It is Interrupt Controller. I think yes, it should live here and is expected to use by Arm, RISC-V and PPC.
Quoted 26 lines
Quoted 5 lines
xen/include/asm-generic/device.h new file +4
-0+#ifdef HAS_PCI + DEVICE_PCI_HOSTBRIDGE, +#endif + /* Use for error */xen/include/asm-generic/device.h line 63
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+ 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;This and ...
Quoted 7 lines
+ /*
+ * Device initialization.
+ *
+ *-EAGAINis used to indicate that device probing is deferred.
+ */
+ int (*init)(structdt_device_node*dev, const void *data);
Quoted 1 line
... this look to be DT-specific.
They are. I'll ifdef it.
Quoted 33 lines
Quoted 33 lines
xen/include/asm-generic/device.h new file +32
-0+}; + +#ifdef CONFIG_ACPI + +struct acpi_device_desc { + /* Device name */ + const char *name; + /* Device class */ + enum device_class class; + /* type of device supported by the driver */ + const int class_type; + /* Device initialization */ + int (*init)(const void *data); +}; + +/** +* acpi_device_init - Initialize a device +* @class: class of the device (serial, network...) +* @data: specific data for initializing the device +* +* Return 0 on success. +*/ +int acpi_device_init (enum device_class class, + const void *data, int class_type); + +#endif /* CONFIG_ACPI */ + +/** +* device_init - Initialize a device +* @dev: device to initialize +* @class: class of the device (serial, network...) +* @data: specific data for initializing the device
Quoted 8 lines
Quoted 6 lines
+ *
+ * Return 0 on success.
+ */
+int device_init(structdt_device_node*dev, enumdevice_classclass,
+ const void *data);As is this, simply from its first parameter's type.
I missed to take changes related to ifdef-ing DT related things to this version of device.h. So I'll update that.
Quoted 18 lines
Quoted 18 lines
xen/include/asm-generic/device.h new file +7
-0+/** +* 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);
xen/include/asm-generic/device.h new file +2
-0+ +#define DT_DEVICE_START(_name, _namestr,_class) \
+static const structdevice_desc__dev_desc_##_name __used \
+__section(".dev.info") =
{ \
+ .name =
_namestr, \
Quoted 8 lines
Quoted 6 lines
+ .class =
_class, \xen/include/asm-generic/device.h new file +2
-0+ +#defineDT_DEVICE_END \
+};And all of these.
Probably it also make sense to swtich Arm and PPC to asm-generic device.h file.
~ Oleksii
Re: [PATCH v3 02/14] xen/asm-generic: introduce generic device.h
In reply to Oleksii KurochkoHi Oleksii,
Quoted 2 lines · Oleksii Kurochko
Arm, PPC and RISC-V use the same
device.htherebydevice.hwas moved to asm-generic.
I read "was moved" as the patch should also contain some deleted lines. But below, I only see the file introduced. Did you intend to also remove the version in arm/include/asm?
Quoted 11 lines
Arm's
device.hwas taken as a base with
the following changes:
- #ifdef PCI related things.
- #ifdef ACPI related things.
- Rename #ifdef guards.
- Add SPDX tag.
- #ifdefCONFIG_HAS_DEVICE_TREErelated things.Signed-off-by Oleksii Kurochko <[email protected]>---
It is still open question ifdevice.hshould be in asm-generic. Need more opinions.
I still think it should. But I guess you want others to answer? If so it would be worth to point out from who you seek opinions.
Quoted 51 lines
---
Changes in V3:
- ifdef device tree related things.
- update the commit message
---
Changes in V2:
- take ( as common )device.hfrom Arm as PPC and RISC-V use it as a base.
- #ifdef PCI related things.
- #ifdef ACPI related things.
- renameDEVICE_GICtoDEVIC_IC.
- rename #ifdef guards.
- switch Arm and PPC to genericdevice.h
- add SPDX tag
- update the commit message--- xen/include/asm-generic/device.h | 147 +++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+)create mode 100644
xen/include/asm-generic/device.hxen/include/asm-generic/device.h new file +25
-0@@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + +#ifdef HAS_PCI + DEV_PCI, +#endif +}; + +struct dev_archdata { + void *iommu; /* IOMMU private data */ +}; + +/* struct device - The basic device structure */ +struct device +{ + enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE + struct dt_device_node *of_node; /* Used by drivers imported from Linux */
xen/include/asm-generic/device.h line 35
Quoted 10 lines
xen/include/asm-generic/device.h new file +10
-0+#endif +struct dev_archdata archdata; +struct iommu_fwspec *iommu_fwspec;/* per-device IOMMU instance data */ +}; + +typedef struct device device_t ; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include <xen/device_tree.h> +#endif
NIT: Could we try to rationalize the number of #ifdef CONFIG_HAS_*? For example ...
xen/include/asm-generic/device.h line 43
Quoted 8 lines
xen/include/asm-generic/device.h new file +8
-0+ +#ifdef HAS_PCI +#define dev_is_pci (dev) ((dev)->type == DEV_PCI) +#endif + +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt (dev) ((dev)->type == DEV_DT) +#endif
... this is another definition for Device-Tree only. It could be easily moved above the definitnion of dev_is_pci(). The others would be the DT_DEVICE_*() helpers.
xen/include/asm-generic/device.h line 49
Quoted 6 lines
xen/include/asm-generic/device.h new file +6
-0+ +enum device_class +{ +DEVICE_SERIAL , +DEVICE_IOMMU , +DEVICE_IC ,
I guess you mean INTERRUPT_CONTROLLER? If so, can this be spelt out? (I don't think shorthand version is worth it here)
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 02/14] xen/asm-generic: introduce generic device.h
Quoted 11 lines · Julien Grall
Hi Oleksii,
Quoted 2 lines · Oleksii Kurochko
Arm, PPC and RISC-V use the same
device.htherebydevice.hwas moved to asm-generic.I read "was moved" as the patch should also contain some deleted lines.
But below, I only see the file introduced. Did you intend to also remove
the version in arm/include/asm?
Yes, I just messed up with the patch version. Here is the version of the patch which remove Arm's device.h:
https://gitlab.com/xen-project/people/olkur/xen/-/commit/ce845abfb57d27b0c08984f5433085c767550495
Quoted 89 lines
Quoted 9 lines
Arm's
device.hwas taken as a base with
the following changes:
- #ifdef PCI related things.
- #ifdef ACPI related things.
- Rename #ifdef guards.
- Add SPDX tag.
- #ifdefCONFIG_HAS_DEVICE_TREErelated things.Quoted 4 lines
Signed-off-by Oleksii Kurochko <[email protected]>---
It is still open question ifdevice.hshould be in asm-generic. Need more opinions.I still think it should. But I guess you want others to answer? If so it
would be worth to point out from who you seek opinions.Quoted 59 lines
---
Changes in V3:
- ifdef device tree related things.
- update the commit message
---
Changes in V2:
- take ( as common )device.hfrom Arm as PPC and RISC-V
use it as a base.
- #ifdef PCI related things.
- #ifdef ACPI related things.
- renameDEVICE_GICtoDEVIC_IC.
- rename #ifdef guards.
- switch Arm and PPC to genericdevice.h
- add SPDX tag
- update the commit message---
xen/include/asm-generic/device.h| 147
+++++++++++++++++++++++++++++++1 file changed, 147 insertions(+)create mode 100644
xen/include/asm-generic/device.hxen/include/asm- renamed from xen/include/asm-generic/device.h +0
-0
generic/device.h
new file mode 100644
index 0000000000..7ef5aa955axen/include/asm-generic/device.h new file +25
-0@@ -0,0 +1,147 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DEVICE_H__ +#define __ASM_GENERIC_DEVICE_H__ + +enum device_type +{ +#ifdef CONFIG_HAS_DEVICE_TREE + DEV_DT, +#endif + +#ifdef HAS_PCI + DEV_PCI, +#endif +}; + +struct dev_archdata { + void *iommu; /* IOMMU private data */ +}; + +/* struct device - The basic device structure */ +struct device +{ + enum device_type type; +#ifdef CONFIG_HAS_DEVICE_TREE + struct dt_device_node *of_node; /* Used by drivers importedfrom Linux */
+#endif
+ structdev_archdataarchdata;
+ structiommu_fwspec*iommu_fwspec; /* per-device IOMMU instance data */xen/include/asm-generic/device.h line 35
Quoted 7 lines
xen/include/asm-generic/device.h new file +7
-0+}; + +typedef struct device device_t ; + +#ifdef CONFIG_HAS_DEVICE_TREE +#include <xen/device_tree.h> +#endif NIT: Could we try to rationalize the number of #ifdef CONFIG_HAS_*? For
example ...
Quoted 13 lines
xen/include/asm-generic/device.h line 43
Quoted 8 lines
xen/include/asm-generic/device.h new file +8
-0+ +#ifdef HAS_PCI +#define dev_is_pci (dev) ((dev)->type == DEV_PCI) +#endif + +#ifdef CONFIG_HAS_DEVICE_TREE +#define dev_is_dt (dev) ((dev)->type == DEV_DT) +#endif ... this is another definition for Device-Tree only. It could be easily
moved above the definitnion ofdev_is_pci(). The others would be the DT_DEVICE_*() helpers.
Yes, sure. I can combine CONFIG_HAS_DEVICE_TREE related things better.
Quoted 11 lines
xen/include/asm-generic/device.h line 49
Quoted 7 lines
xen/include/asm-generic/device.h new file +6
-0+ +enum device_class +{ + DEVICE_SERIAL, + DEVICE_IOMMU, + DEVICE_IC,I guess you mean
INTERRUPT_CONTROLLER? If so, can this be spelt out? (I
don't think shorthand version is worth it here)
Sure, I'll change to INTERRUPT_CONTROLLER.
~ Oleksii
PATCH v3 3/14 xen/asm-generic: introduce generic hypercall.h
In reply to Oleksii KurochkoIntroduce an empty generic hypercall.h for archs which don't implement it.
Drop PPC's hypercall.h and switch to generic one instead.
---
Changes in V3:
- Drop PPC's hypercall.h and switch to generic one.
- Update the commit message
- Add Acked-by: Jan Beulich <[email protected]>
---
Changes in V2:
- add check that <asm/hypercall.h> isn't included directly.
--- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/hypercall.h | 5 ----- xen/include/asm-generic/hypercall.h | 18 ++++++++++++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/hypercall.h create mode 100644 xen/include/asm-generic/hypercall.h
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hypercall.h generic-y += paging.h generic-y += vm_event.h
xen/arch/ppc/include/asm/hypercall.h deleted +0 -5
@@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_HYPERCALL_H__ -#define __ASM_PPC_HYPERCALL_H__ - -#endif /* __ASM_PPC_HYPERCALL_H__ */
xen/include/asm-generic/hypercall.h new file +18 -0
@@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __XEN_HYPERCALL_H__ +#error "asm/hypercall.h should not be included directly - include xen/hypercall.h instead" +#endif + +#ifndef __ASM_GENERIC_HYPERCALL_H__ +#define __ASM_GENERIC_HYPERCALL_H__ + +#endif /* __ASM_GENERIC_HYPERCALL_H__ */ + +/* +* Local variables: +* mode: C +* c-file-style: "BSD" +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
2.41.0
PATCH v3 4/14 xen/asm-generic: introduce generic header iocap.h
In reply to Oleksii Kurochkoiocap.h is common for Arm, PPC and RISC-V architectures thereby it was moved to asm-generic.
Also Arm and PPC were switched to asm-generic version of iocap.h.
---
Changes in V3:
- Drop Arm and PPC's iocap.h and switch to asm-generic's version.
- 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/iocap.h | 8 --------
xen/{arch/arm/include/asm => include/asm-generic}/iocap.h | 7 ++++---
4 files changed, 6 insertions(+), 11 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/iocap.h
rename xen/{arch/arm/include/asm => include/asm-generic}/iocap.h (60%)xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += iocap.h generic-y += paging.h generic-y += vm_event.h
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += hypercall.h +generic-y += iocap.h generic-y += paging.h generic-y += vm_event.h
xen/arch/ppc/include/asm/iocap.h deleted +0 -8
@@ -1,8 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_IOCAP_H__ -#define __ASM_PPC_IOCAP_H__ - -#define cache_flush_permitted (d) \ - (!rangeset_is_empty((d)->iomem_caps)) - -#endif /* __ASM_PPC_IOCAP_H__ */
xen/include/asm-generic/iocap.h renamed from xen/arch/arm/include/asm/iocap.h +4 -3
@@ -1,10 +1,11 @@ -#ifndef __X86_IOCAP_H__ -#define __X86_IOCAP_H__ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_IOCAP_H__ +#define __ASM_GENERIC_IOCAP_H__#define cache_flush_permitted (d) \ (!rangeset_is_empty((d)->iomem_caps)) -#endif +#endif /* __ASM_GENERIC_IOCAP_H__ */ /* * Local variables:
Signature · 1 line
2.41.0
Re: [PATCH v3 04/14] xen/asm-generic: introduce generic header iocap.h
Quoted 6 lines · Oleksii Kurochko
iocap.his common for Arm, PPC and RISC-V architectures thereby it was moved to asm-generic.Also Arm and PPC were switched to asm-generic version of
iocap.h.Signed-off-by Oleksii Kurochko <[email protected]>
Re: [PATCH v3 04/14] xen/asm-generic: introduce generic header iocap.h
In reply to Oleksii KurochkoHi Oleksii,
Quoted 6 lines · Oleksii Kurochko
iocap.his common for Arm, PPC and RISC-V architectures thereby it was moved to asm-generic.Also Arm and PPC were switched to asm-generic version of
iocap.h.Signed-off-by Oleksii Kurochko <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 5/14 xen/asm-generic: introduce stub header <asm/random.h>
In reply to Oleksii Kurochko<asm/random.h> is common for Arm, PPC and RISC-V thereby it is moved to asm-generic.
---
Changes in V3:
- Drop Arm and PPC's random.h and switch to asm-generic verison.
---
Changes in V2:
- update the commit messages
--- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/random.h | 9 --------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/random.h | 9 --------- xen/include/asm-generic/random.h | 20 ++++++++++++++++++++ 5 files changed, 22 insertions(+), 18 deletions(-) delete mode 100644 xen/arch/arm/include/asm/random.h delete mode 100644 xen/arch/ppc/include/asm/random.h create mode 100644 xen/include/asm-generic/random.h
xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += iocap.h generic-y += paging.h +generic-y += random.h generic-y += vm_event.h
xen/arch/arm/include/asm/random.h deleted +0 -9
@@ -1,9 +0,0 @@ -#ifndef __ASM_RANDOM_H__ -#define __ASM_RANDOM_H__ - -static inline unsigned int arch_get_random (void ) -{ -return 0 ; -} - -#endif /* __ASM_RANDOM_H__ */
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -2,4 +2,5 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h +generic-y += random.h generic-y += vm_event.h
xen/arch/ppc/include/asm/random.h deleted +0 -9
@@ -1,9 +0,0 @@ -#ifndef __ASM_PPC_RANDOM_H__ -#define __ASM_PPC_RANDOM_H__ - -static inline unsigned int arch_get_random (void ) -{ -return 0 ; -} - -#endif /* __ASM_PPC_RANDOM_H__ */
xen/include/asm-generic/random.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_RANDOM_H__ +#define __ASM_GENERIC_RANDOM_H__ + +static inline unsigned int arch_get_random (void ) +{ +return 0 ; +} + +#endif /* __ASM_GENERIC_RANDOM_H__ */ + + +/* +* Local variables: +* mode: C +* c-file-style: BSD +* c-basic-offset: 4 +* indent-tabs-mode: nil +* End: +*/
Signature · 1 line
2.41.0
Re: [PATCH v3 05/14] xen/asm-generic: introduce stub header <asm/random.h>
Quoted 4 lines · Oleksii Kurochko
<
asm/random.h> is common for Arm, PPC and RISC-V thereby it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>
with ...
Quoted 6 lines
xen/include/asm-generic/random.h new file +3
-0@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_RANDOM_H__ +#define __ASM_GENERIC_RANDOM_H__
xen/include/asm-generic/random.h line 13
Quoted 10 lines
xen/include/asm-generic/random.h new file +10
-0+ +static inline unsigned int arch_get_random (void ) +{ +return 0 ; +} + +#endif /* __ASM_GENERIC_RANDOM_H__ */ + + +/*
... the double blank lines above here shrunk to a single one. Can likely be done while committing.
Jan
Re: [PATCH v3 05/14] xen/asm-generic: introduce stub header <asm/random.h>
In reply to Oleksii KurochkoHi Oleksii,
Quoted 4 lines · Oleksii Kurochko
<
asm/random.h> is common for Arm, PPC and RISC-V thereby it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 6/14 xen/asm-generic: introduce generic header percpu.h
In reply to Oleksii KurochkoThe patch introduces generic percpu.h which was based on Arm's version with the following changes:
* makes __per_cpu_data_end[] constant
* introduce get_per_cpu_offset() for macros this_cpu() and this_cpu_ptr()
* add inclustion of <asm/current.h> as get_per_cpu_offset() is located there.
Also it was changed a place where <asm/percpu.h> is included in <xen/percpu.h> because asm-generic version of percpu.h started to include <asm/current.h> which requires definition of DECLARE_PER_CPU.
As well the patch switches Arm, PPC and x86 architectures to use asm-generic version of percpu.h.
---
Changes in V3:
- switch all architectures to asm-generic version of percpu.h
- introduce get_per_cpu_offset() and implement it architectures.
- make __per_cpu_data_end constamt.
- update the commit message.
---
Changes in V2:
- use smp_processor_id() instead of get_processor_id().
- update commit message .
---
xen/arch/arm/include/asm/Makefile | 1 +
xen/arch/arm/include/asm/current.h | 3 +++
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/current.h | 6 +++++
xen/arch/ppc/include/asm/percpu.h | 24 -------------------
xen/arch/x86/include/asm/Makefile | 2 ++
xen/arch/x86/include/asm/current.h | 2 ++
xen/arch/x86/include/asm/percpu.h | 22 -----------------
.../asm => include/asm-generic}/percpu.h | 18 ++++++++------
xen/include/xen/percpu.h | 4 ++--
10 files changed, 28 insertions(+), 55 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/percpu.h
create mode 100644 xen/arch/x86/include/asm/Makefile
delete mode 100644 xen/arch/x86/include/asm/percpu.h
rename xen/{arch/arm/include/asm => include/asm-generic}/percpu.h (57%)xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,5 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only generic-y += iocap.h generic-y += paging.h +generic-y += percpu.h generic-y += random.h generic-y += vm_event.h
xen/arch/arm/include/asm/current.h +3 -0
@@ -5,6 +5,7 @@#include <xen/percpu.h> #include <asm/processor.h> +#include <asm/sysregs.h> /* Tell whether the guest vCPU enabled Workaround 2 (i.e variant 4) */ #define CPUINFO_WORKAROUND_2_FLAG_SHIFT 0
@@ -60,6 +61,8 @@ do { \this_cpu (cpu_id) = (id); \ } while ( 0 ) +#define get_per_cpu_offset () READ_SYSREG(TPIDR_EL2) +#endif #endif /* __ARM_CURRENT_H__ */
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -2,5 +2,6 @@ generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h +generic-y += percpu.h generic-y += random.h generic-y += vm_event.h
xen/arch/ppc/include/asm/current.h +6 -0
@@ -4,6 +4,8 @@#include <xen/percpu.h> +#include <asm/processor.h> +#ifndef __ASSEMBLY__struct vcpu ;
@@ -38,6 +40,10 @@ static inline struct cpu_info *get_cpu_info(void)#define guest_cpu_user_regs () (&get_cpu_info()->guest_cpu_user_regs) +#define smp_processor_id () 0/* TODO: Fix this */ + +#define get_per_cpu_offset () smp_processor_id() +#endif /* __ASSEMBLY__ */ #endif /* __ASM_PPC_CURRENT_H__ */
xen/arch/ppc/include/asm/percpu.h deleted +0 -24
@@ -1,24 +0,0 @@ -#ifndef __PPC_PERCPU_H__ -#define __PPC_PERCPU_H__ - -#ifndef __ASSEMBLY__ - -extern char __per_cpu_start[], __per_cpu_data_end[]; -extern unsigned long __per_cpu_offset[NR_CPUS ]; -void percpu_init_areas (void ); - -#define smp_processor_id () 0/* TODO: Fix this */ - -#define per_cpu (var, cpu) \ - (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define this_cpu (var) \ - (*RELOC_HIDE(&per_cpu__##var, smp_processor_id())) - -#define per_cpu_ptr (var, cpu) \ - (*RELOC_HIDE(var, __per_cpu_offset[cpu])) -#define this_cpu_ptr (var) \ - (*RELOC_HIDE(var, smp_processor_id())) - -#endif - -#endif /* __PPC_PERCPU_H__ */
xen/arch/x86/include/asm/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only +generic-y += percpu.h
xen/arch/x86/include/asm/current.h +2 -0
@@ -102,6 +102,8 @@ static inline struct cpu_info *get_cpu_info(void)#define smp_processor_id () (get_cpu_info()->processor_id)#define guest_cpu_user_regs () (&get_cpu_info()->guest_cpu_user_regs) +#define get_per_cpu_offset () (get_cpu_info()->per_cpu_offset) +/* * Get the bottom-of-stack, as stored in the per-CPU TSS. This actually points * into the middle of cpu_info.guest_cpu_user_regs, at the section that
xen/arch/x86/include/asm/percpu.h deleted +0 -22
@@ -1,22 +0,0 @@ -#ifndef __X86_PERCPU_H__ -#define __X86_PERCPU_H__ - -#ifndef __ASSEMBLY__ -extern char __per_cpu_start[], __per_cpu_data_end[]; -extern unsigned long __per_cpu_offset[NR_CPUS ]; -void percpu_init_areas (void ); -#endif - -/* var is in discarded region: offset to particular copy we want */ -#define per_cpu (var, cpu) \ - (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) -#define this_cpu (var) \ - (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset)) - -#define this_cpu_ptr (var) \ - (*RELOC_HIDE(var, get_cpu_info()->per_cpu_offset)) - -#define per_cpu_ptr (var, cpu) \ - (*RELOC_HIDE(var, __per_cpu_offset[cpu])) - -#endif /* __X86_PERCPU_H__ */
xen/include/asm-generic/percpu.h renamed from xen/arch/arm/include/asm/percpu.h +11 -7
@@ -1,28 +1,32 @@ -#ifndef __ARM_PERCPU_H__ -#define __ARM_PERCPU_H__ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_PERCPU_H__ +#define __ASM_GENERIC_PERCPU_H__#ifndef __ASSEMBLY__#include <xen/types.h> -#include <asm/sysregs.h> +#include <asm/current.h> -extern char __per_cpu_start[], __per_cpu_data_end[]; +extern char __per_cpu_start[]; +extern const char __per_cpu_data_end[];extern unsigned long __per_cpu_offset[NR_CPUS ];void percpu_init_areas (void );#define per_cpu (var, cpu) \ (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) +#define this_cpu (var) \ - (*RELOC_HIDE(&per_cpu__##var, READ_SYSREG(TPIDR_EL2))) + (*RELOC_HIDE(&per_cpu__##var, get_per_cpu_offset()))#define per_cpu_ptr (var, cpu) \ (*RELOC_HIDE(var, __per_cpu_offset[cpu]))#define this_cpu_ptr (var) \ - (*RELOC_HIDE(var, READ_SYSREG(TPIDR_EL2))) + (*RELOC_HIDE(var, get_per_cpu_offset()))#endif -#endif /* __ARM_PERCPU_H__ */ +#endif /* __ASM_GENERIC_PERCPU_H__ */ +/* * Local variables: * mode: C
xen/include/xen/percpu.h +2 -2
@@ -1,8 +1,6 @@#ifndef __XEN_PERCPU_H__#define __XEN_PERCPU_H__ -#include <asm/percpu.h> -#define DECLARE_PER_CPU (type, name) \ extern __typeof__(type) per_cpu__ ## name
@@ -29,6 +27,8 @@#define get_per_cpu_var (var) (per_cpu__##var) +#include <asm/percpu.h> +/* Linux compatibility. */ #define get_cpu_var (var) this_cpu(var)#define put_cpu_var (var)
Signature · 1 line
2.41.0
Re: [PATCH v3 06/14] xen/asm-generic: introduce generic header percpu.h
Quoted 12 lines · Oleksii Kurochko
xen/arch/ppc/include/asm/current.h +2
-0@@ -4,6 +4,8 @@#include <xen/percpu.h> +#include <asm/processor.h> +#ifndef __ASSEMBLY__struct vcpu ;
xen/arch/ppc/include/asm/current.h static inline struct cpu_info *get_cpu_info(void) · line 45
Quoted 6 lines
xen/arch/ppc/include/asm/current.h +3
-0@@ -38,6 +40,10 @@ static inline struct cpu_info *get_cpu_info(void)#define guest_cpu_user_regs () (&get_cpu_info()->guest_cpu_user_regs) +#define smp_processor_id () 0/* TODO: Fix this */ + +#define get_per_cpu_offset () smp_processor_id()
This 2nd item can't be quite right either, so likely also wants a FIXME comment. Shawn will have the ultimate say here anyway.
Quoted 12 lines
xen/include/xen/percpu.h +0
-2@@ -1,8 +1,6 @@#ifndef __XEN_PERCPU_H__#define __XEN_PERCPU_H__ -#include <asm/percpu.h> -#define DECLARE_PER_CPU (type, name) \ extern __typeof__(type) per_cpu__ ## name
xen/include/xen/percpu.h line 34
Quoted 8 lines
xen/include/xen/percpu.h +2
-0@@ -29,6 +27,8 @@#define get_per_cpu_var (var) (per_cpu__##var) +#include <asm/percpu.h> +/* Linux compatibility. */ #define get_cpu_var (var) this_cpu(var)#define put_cpu_var (var)
While you explain the reason for this movement, it still feels a little fragile to me.
Jan
Re: [PATCH v3 06/14] xen/asm-generic: introduce generic header percpu.h
Quoted 17 lines · Jan Beulich
Quoted 16 lines · Oleksii Kurochko
xen/arch/ppc/include/asm/current.h +0
-0@@ -4,6 +4,8 @@
#include <xen/percpu.h>xen/arch/ppc/include/asm/current.h +2
-0+#include <asm/processor.h> +#ifndef
__ASSEMBLY__
struct vcpu;xen/arch/ppc/include/asm/current.h +0
-0@@ -38,6 +40,10 @@ static inline struct cpu_info *get_cpu_info (void)
#defineguest_cpu_user_regs()(&get_cpu_info()-Quoted 1 line
guest_cpu_user_regs)
Quoted 8 lines
xen/arch/ppc/include/asm/current.h static inline struct cpu_info *get_cpu_info(void) · line 45
Quoted 4 lines
xen/arch/ppc/include/asm/current.h +3
-0+#define smp_processor_id () 0/* TODO: Fix this */ + +#define get_per_cpu_offset () smp_processor_id()This 2nd item can't be quite right either, so likely also wants a FIXME comment.
Shawn will have the ultimate say here anyway.
I did so because it is how percpu stuff was implemented before get_per_cpu_offset was introduced.
Quoted 17 lines
Quoted 17 lines
xen/include/xen/percpu.h +0
-0@@ -1,8 +1,6 @@ #ifndef __XEN_PERCPU_H__ #define __XEN_PERCPU_H__xen/include/xen/percpu.h +0
-2-#include <asm/percpu.h> -#define
DECLARE_PER_CPU(type, name)\
extern__typeof__(type)per_cpu__## namexen/include/xen/percpu.h +0
-0@@ -29,6 +27,8 @@
#define get_per_cpu_var(var) (per_cpu__##var)
+#include <asm/percpu.h>
Quoted 8 lines
Quoted 4 lines
+
/* Linux compatibility. */
#defineget_cpu_var(var)this_cpu(var)
#defineput_cpu_var(var)While you explain the reason for this movement, it still feels a little
fragile to me.
The reason for that is #include <asm/processor.h> was added to <asm/percpu.h>. <asm/processor.h> uses DECLARE_PER_CPU(...) so it should be defined before inclusion of <asm/percpu.h>. Otherwise the following error will occur:./arch/riscv/include/asm/current.h:13:32: error: unknown type name 'curr_vcpu'
13 | DECLARE_PER_CPU(struct vcpu *, curr_vcpu);
| ^~~~~~~~~
In file included from ././include/xen/config.h:17,
from <command-line>:./include/xen/sched.h: In function 'rcu_unlock_domain':./include/asm-generic/percpu.h:19:19: error: 'per_cpu__curr_vcpu' undeclared (first use in this function)
19 | (*RELOC_HIDE(&per_cpu__##var, get_per_cpu_offset()))
| ^~~~~~~~~
./include/xen/compiler.h:146:37: note: in definition of macro 'RELOC_HIDE'
146 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
| ^~~./arch/riscv/include/asm/current.h:15:29: note: in expansion of macro 'this_cpu'
15 | #define current (this_cpu(curr_vcpu))
| ^~~~~~~~./include/xen/sched.h:726:15: note: in expansion of macro 'current'
726 | if ( d != current->domain )
| ^~~~~~~
./include/asm-generic/percpu.h:19:19: note: each undeclared identifier
is reported only once for each function it appears in
19 | (*RELOC_HIDE(&per_cpu__##var, get_per_cpu_offset()))
| ^~~~~~~~~ ./include/xen/compiler.h:146:37: note: in definition of macro 'RELOC_HIDE'
146 | __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
| ^~~./arch/riscv/include/asm/current.h:15:29: note: in expansion of macro 'this_cpu'
15 | #define current (this_cpu(curr_vcpu))
| ^~~~~~~~./include/xen/sched.h:726:15: note: in expansion of macro 'current'
726 | if ( d != current->domain )
~ Oleksii
Re: [PATCH v3 06/14] xen/asm-generic: introduce generic header percpu.h
In reply to Oleksii KurochkoHi Oleksii,
Quoted 24 lines · Oleksii Kurochko
The patch introduces generic
percpu.hwhich was based on Arm's version with the following changes:
* makes __per_cpu_data_end[] constant
* introduceget_per_cpu_offset()for macrosthis_cpu()andthis_cpu_ptr()
* add inclustion of <asm/current.h> asget_per_cpu_offset()is located there.Also it was changed a place where <
asm/percpu.h> is included in <xen/percpu.h> because asm-generic version ofpercpu.hstarted to include <asm/current.h> which requires definition ofDECLARE_PER_CPU.As well the patch switches Arm, PPC and x86 architectures to use asm-generic version of
percpu.h.Signed-off-by Oleksii Kurochko <[email protected]>---
Changes in V3:
- switch all architectures to asm-generic version ofpercpu.h
- introduceget_per_cpu_offset()and implement it architectures.
- make__per_cpu_data_endconstamt.
- update the commit message.
---
Changes in V2:
- usesmp_processor_id()instead ofget_processor_id().
- update commit message .
Quoted 3 lines
--- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/current.h | 3 +++
The changes for Arm and common looks good to me. I saw Jan thought the include movement is fragile, I don't have any strong opinion about the placement so long it compiles :). So feels free to add my ack:
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 7/14 xen/asm-generic: introduce generalized hardirq.h
In reply to Oleksii Kurochko<asm/hardirq.h> is common through archs thereby it is moved to asm-generic.
Arm and PPC were switched to asm generic verstion of hardirq.h.
---
Changes in V3:
- Drop Arm and PPC's hardirq.h
- Update the commit message.
---
Changes in V2:
- add #include <xen/cache.h>.
- update the commit message
---
xen/arch/arm/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/Makefile | 1 +
xen/arch/ppc/include/asm/hardirq.h | 19 -------------------
.../asm => include/asm-generic}/hardirq.h | 8 +++++---
4 files changed, 7 insertions(+), 22 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/hardirq.h
rename xen/{arch/arm/include/asm => include/asm-generic}/hardirq.h (79%)xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hardirq.h generic-y += iocap.h generic-y += paging.h generic-y += percpu.h
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += paging.h
xen/arch/ppc/include/asm/hardirq.h deleted +0 -19
@@ -1,19 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_HARDIRQ_H__ -#define __ASM_PPC_HARDIRQ_H__ - -#include <xen/cache.h> - -typedef struct { -unsigned long __softirq_pending; -unsigned int __local_irq_count; -} __cacheline_aligned irq_cpustat_t; - -#include <xen/irq_cpustat.h> /* Standard mappings for irq_cpustat_t above */ - -#define in_irq () (local_irq_count(smp_processor_id()) != 0) - -#define irq_enter () (local_irq_count(smp_processor_id())++) -#define irq_exit () (local_irq_count(smp_processor_id())--) - -#endif /* __ASM_PPC_HARDIRQ_H__ */
xen/include/asm-generic/hardirq.h renamed from xen/arch/arm/include/asm/hardirq.h +5 -3
@@ -1,5 +1,6 @@ -#ifndef __ASM_HARDIRQ_H -#define __ASM_HARDIRQ_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_HARDIRQ_H +#define __ASM_GENERIC_HARDIRQ_H#include <xen/cache.h> #include <xen/smp.h>
@@ -16,7 +17,8 @@ typedef struct {#define irq_enter () (local_irq_count(smp_processor_id())++)#define irq_exit () (local_irq_count(smp_processor_id())--) -#endif /* __ASM_HARDIRQ_H */ +#endif /* __ASM_GENERIC_HARDIRQ_H */ +/* * Local variables: * mode: C
Signature · 1 line
2.41.0
Re: [PATCH v3 07/14] xen/asm-generic: introduce generalized hardirq.h
Quoted 6 lines · Oleksii Kurochko
<
asm/hardirq.h> is common through archs thereby it is moved to asm-generic.Arm and PPC were switched to asm generic verstion of
hardirq.h.Signed-off-by Oleksii Kurochko <[email protected]>
Re: [PATCH v3 07/14] xen/asm-generic: introduce generalized hardirq.h
In reply to Oleksii KurochkoHi Oleksii,
Quoted 6 lines · Oleksii Kurochko
<
asm/hardirq.h> is common through archs thereby it is moved to asm-generic.Arm and PPC were switched to asm generic verstion of
hardirq.h.Signed-off-by Oleksii Kurochko <[email protected]>
Cheers,
Signature · 1 line
Julien Grall
PATCH v3 8/14 xen/asm-generic: introduce generic div64.h header
In reply to Oleksii KurochkoAll 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.
---
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/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 +++++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 28 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
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h
xen/arch/ppc/include/asm/div64.h deleted +0 -14
@@ -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__ */
xen/arch/x86/include/asm/Makefile +1 -0
@@ -1,2 +1,3 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += div64.h generic-y += percpu.h
xen/arch/x86/include/asm/div64.h deleted +0 -14
@@ -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
xen/include/asm-generic/div64.h new file +27 -0
@@ -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: +*/
Signature · 1 line
2.41.0
Re: [PATCH v3 08/14] xen/asm-generic: introduce generic div64.h header
Quoted 6 lines · Oleksii Kurochko
All archs have the
do_divimplementation forBITS_PER_LONG== 64 sodo_div64.his moved to asm-generic.x86 and PPC were switched to asm-generic version of
div64.h.Signed-off-by Oleksii Kurochko <[email protected]>
Re: [PATCH v3 08/14] xen/asm-generic: introduce generic div64.h header
In reply to Oleksii KurochkoHi,
Quoted 2 lines · Oleksii Kurochko
All archs have the
do_divimplementation forBITS_PER_LONG== 64 sodo_div64.his moved to asm-generic.
You are saying "all archs" but ...
Quoted 2 lines
x86 and PPC were switched to asm-generic version of
div64.h.
... you only switch x86/PPC to div64.h.
I guess this is because for arm we have a different implementation for 32-bits. The 64-bits version is the same as x86/PPC.
So I wonder if it is possible to include asm-generic/div64.h from arch/arm/include/asm/div64.h?
This will avoid duplicating some code.
Cheers,
Signature · 1 line
Julien Grall
Re: [PATCH v3 08/14] xen/asm-generic: introduce generic div64.h header
Hi Julien,
Quoted 6 lines · Julien Grall
Hi,
Quoted 2 lines · Oleksii Kurochko
All archs have the
do_divimplementation forBITS_PER_LONG== 64 sodo_div64.his moved to asm-generic.
Quoted 6 lines
You are saying "all archs" but ...
Quoted 2 lines
x86 and PPC were switched to asm-generic version of
div64.h.... you only switch x86/PPC to
div64.h.
You are right. I wasn't precise enough. Also RISC-V uses asm-generic version of div64.h but for that I have separate patch series.
Quoted 9 lines
I guess this is because for arm we have a different implementation for
32-bits. The 64-bits version is the same as x86/PPC.So I wonder if it is possible to include
asm-generic/div64.hfromarch/arm/include/asm/div64.h?This will avoid duplicating some code.
Yes, you are right. Arm wasn't switched to asm-generic/div64.h because of different implementaion for 32-bit.
I think we can include asm-generic/div64.h excplicitly for Arm. I made a little test and it works so I started full CI and if it won't any issue with Arm I'll update the patch.
Thanks for the comments.
Quoted 2 lines
Cheers,
PATCH v3 9/14 xen/asm-generic: introduce generic header altp2m.h
In reply to Oleksii Kurochko<asm/alt2pm.h> is common between archs so it is moved to asm-generic.
Arm and PPC were switched to asm-generic version of altp2m.h.
---
Changes in V3:
- Drop Arm and PPC's altp2m.h
- Update the commit message.
---
Changes in V2:
- change uint16_t to unsigned int in declaration of altp2m_vcpu_idx
- update the commit message
--- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/altp2m.h | 39 ------------------------------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/altp2m.h | 25 -------------------- xen/include/asm-generic/altp2m.h | 34 +++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 64 deletions(-) delete mode 100644 xen/arch/arm/include/asm/altp2m.h delete mode 100644 xen/arch/ppc/include/asm/altp2m.h create mode 100644 xen/include/asm-generic/altp2m.h
xen/arch/arm/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += altp2m.h generic-y += hardirq.h generic-y += iocap.h generic-y += paging.h
xen/arch/arm/include/asm/altp2m.h deleted +0 -39
@@ -1,39 +0,0 @@ -/* -* Alternate p2m -* -* Copyright (c) 2014, Intel Corporation. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms and conditions of the GNU General Public License, -* version 2, as published by the Free Software Foundation. -* -* This program is distributed in the hope it will be useful, but WITHOUT -* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along with -* this program; If not, see <http://www.gnu.org/licenses/>. -*/ - -#ifndef __ASM_ARM_ALTP2M_H -#define __ASM_ARM_ALTP2M_H - -#include <xen/sched.h> - -/* Alternate p2m on/off per domain */ -static inline bool altp2m_active (const struct domain *d) -{ -/* Not implemented on ARM. */ -return false; -} - -/* Alternate p2m VCPU */ -static inline uint16_t altp2m_vcpu_idx (const struct vcpu *v) -{ -/* Not implemented on ARM, should not be reached. */ -BUG (); -return 0 ; -} - -#endif /* __ASM_ARM_ALTP2M_H */
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += altp2m.h generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h
xen/arch/ppc/include/asm/altp2m.h deleted +0 -25
@@ -1,25 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -#ifndef __ASM_PPC_ALTP2M_H__ -#define __ASM_PPC_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 PPC. */ -return false; -} - -/* Alternate p2m VCPU */ -static inline uint16_t altp2m_vcpu_idx (const struct vcpu *v) -{ -/* Not implemented on PPC, should not be reached. */ -ASSERT_UNREACHABLE (); -return 0 ; -} - -#endif /* __ASM_PPC_ALTP2M_H__ */
xen/include/asm-generic/altp2m.h new file +34 -0
@@ -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 unsigned int 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: +*/
Signature · 1 line
2.41.0
Re: [PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
Hi,
Quoted 43 lines · Oleksii Kurochko
<
asm/alt2pm.h> is common between archs so it is moved to asm-generic.Arm and PPC were switched to asm-generic version of
altp2m.h.Signed-off-by Oleksii Kurochko <[email protected]>---
Changes in V3:
- Drop Arm and PPC'saltp2m.h
- Update the commit message.
---
Changes in V2:
- changeuint16_tto unsigned int in declaration ofaltp2m_vcpu_idx
- update the commit message--- xen/arch/arm/include/asm/Makefile | 1 + xen/arch/arm/include/asm/altp2m.h | 39 ------------------------------- xen/arch/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/altp2m.h | 25 -------------------- xen/include/asm-generic/altp2m.h | 34 +++++++++++++++++++++++++++ 5 files changed, 36 insertions(+), 64 deletions(-) delete mode 100644 xen/arch/arm/include/asm/altp2m.h delete mode 100644 xen/arch/ppc/include/asm/altp2m.h create mode 100644 xen/include/asm-generic/altp2m.hxen/arch/arm/include/asm/Makefile +1
-0@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generic-y += altp2m.h generic-y += hardirq.h generic-y += iocap.h generic-y += paging.hxen/arch/arm/include/asm/altp2m.h deleted +0
-0
xen/arch/arm/include/asm/altp2m.h line 4
Quoted 4 lines
xen/arch/arm/include/asm/altp2m.h deleted +0
-4@@ -1,39 +0,0 @@ -/* -* Alternate p2m -* -* Copyright (c) 2014, Intel Corporation.
Shouldn't this copyright be moved to generic header as well?
Apart from that:
~Michal
Re: [PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
Quoted 9 lines · Michal Orzel
xen/arch/arm/include/asm/altp2m.h line 4
Quoted 7 lines · Oleksii Kurochko
xen/arch/arm/include/asm/altp2m.h deleted +0
-4@@ -1,39 +0,0 @@ -/* -* Alternate p2m -* -* Copyright (c) 2014, Intel Corporation. Shouldn't this copyright be moved to generic header as well?
In earlier communication I raised the question whether such trivial stubs are actually copyright-able.
Jan
Re: [PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Michal Orzel
xen/arch/arm/include/asm/altp2m.h line 4
Quoted 7 lines · Oleksii Kurochko
xen/arch/arm/include/asm/altp2m.h deleted +0
-4@@ -1,39 +0,0 @@ -/* -* Alternate p2m -* -* Copyright (c) 2014, Intel Corporation. Shouldn't this copyright be moved to generic header as well?
Quoted 2 lines
In earlier communication I raised the question whether such trivial stubs are actually copyright-able.
Could you please give a link? I couldn't remember what was the decision and why.
Thanks in advance.
~ Oleksii
Re: [PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
Quoted 12 lines · Oleksii
Quoted 11 lines · Jan Beulich
Quoted 9 lines · Michal Orzel
xen/arch/arm/include/asm/altp2m.h line 4
Quoted 7 lines · Oleksii Kurochko
xen/arch/arm/include/asm/altp2m.h deleted +0
-4@@ -1,39 +0,0 @@ -/* -* Alternate p2m -* -* Copyright (c) 2014, Intel Corporation. Shouldn't this copyright be moved to generic header as well?
Quoted 3 lines
Quoted 2 lines
In earlier communication I raised the question whether such trivial stubs are actually copyright-able.
Could you please give a link?
I'm sorry, but no, I don't recall in the context of which patch this was.
Jan
Quoted 6 lines
I couldn't remember what was the decision
and why.Thanks in advance.
~ Oleksii
Re: [PATCH v3 09/14] xen/asm-generic: introduce generic header altp2m.h
In reply to Oleksii KurochkoQuoted 2 lines · Oleksii Kurochko
<
asm/alt2pm.h> is common between archs so it is moved to asm-generic.
Here and elsewhere: The statement above can be read that the same applies to all arch-s (in which case the header would better move to include/xen/). Since this isn't true for x86, may I suggest to insert "several" or "some"? Then (here)
Jan
PATCH v3 10/14 xen/asm-generic: introduce stub header monitor.h
In reply to Oleksii KurochkoThe header is shared between archs so it is moved to asm-generic.
---
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/ppc/include/asm/Makefile | 1 + xen/arch/ppc/include/asm/monitor.h | 43 -------------------- xen/include/asm-generic/monitor.h | 63 ++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 43 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/monitor.h create mode 100644 xen/include/asm-generic/monitor.h
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -4,6 +4,7 @@ generic-y += div64.h generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h +generic-y += monitor.h generic-y += paging.h generic-y += percpu.h generic-y += random.h
xen/arch/ppc/include/asm/monitor.h deleted +0 -43
43 lines not on this page · raw message
xen/include/asm-generic/monitor.h new file +63 -0
63 lines not on this page · raw message
Signature · 1 line
2.41.0
Re: [PATCH v3 10/14] xen/asm-generic: introduce stub header monitor.h
Quoted 98 lines · Oleksii Kurochko
xen/arch/ppc/include/asm/monitor.h deleted +0
-43@@ -1,43 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* Derived from xen/arch/arm/include/asm/monitor.h */ -#ifndef __ASM_PPC_MONITOR_H__ -#define __ASM_PPC_MONITOR_H__ - -#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. */ -} - -static inline uint32_t arch_monitor_get_capabilities (struct domain *d) -{ -BUG_ON ("unimplemented" ); -return 0 ; -} - -#endif /* __ASM_PPC_MONITOR_H__ */ xen/include/asm-generic/monitor.h new file +46
-0@@ -0,0 +1,63 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* include/asm-GENERIC/monitor.h +* +* Arch-specific monitor_op domctl handler. +* +* Copyright (c) 2015 Tamas K Lengyel ([email protected]) +* 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. */ +}
xen/include/asm-generic/monitor.h line 56
Quoted 10 lines
xen/include/asm-generic/monitor.h new file +10
-0+ +static inline uint32_t arch_monitor_get_capabilities (struct domain *d) +{ +return 0 ; +} + +#endif /* __ASM_GENERIC_MONITOR_H__ */ + + +/*
With the double blank line removed here
PATCH v3 11/14 xen/asm-generic: introduce stub header numa.h
In reply to Oleksii Kurochko<asm/numa.h> is common through some archs so it is moved to asm-generic.
---
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 | 13 ++++++----
4 files changed, 10 insertions(+), 31 deletions(-)
delete mode 100644 xen/arch/ppc/include/asm/numa.h
rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (75%)xen/arch/arm/include/asm/Makefile +1 -0
@@ -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
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -5,6 +5,7 @@ generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += monitor.h +generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.h
xen/arch/ppc/include/asm/numa.h deleted +0 -26
@@ -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__ */
xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +8 -5
@@ -1,9 +1,11 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ARCH_GENERIC_NUMA_H +#define __ARCH_GENERIC_NUMA_H -#include <xen/mm.h> +#include <xen/mm-frame.h> +#include <xen/stdint.h> -typedef u8 nodeid_t ; +typedef uint8_t nodeid_t ;#ifndef CONFIG_NUMA
@@ -26,7 +28,8 @@ extern mfn_t first_valid_mfn;#define arch_want_default_dmazone () (false) -#endif /* __ARCH_ARM_NUMA_H */ +#endif /* __ARCH_GENERIC_NUMA_H */ +/* * Local variables: * mode: C
Signature · 1 line
2.41.0
Re: [PATCH v3 11/14] xen/asm-generic: introduce stub header numa.h
Hi,
Quoted 89 lines · Oleksii Kurochko
<
asm/numa.h> is common through some archs so it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>---
Changes in V3:
- Remove old header inclusion in asm-genericnuma.hand include <xen/mm-frame.h> and <xen/stdint.h>
- Drop Arm and PPC'snuma.hand use asm-generic version instead.
---
Changes in V2:
- update the commit message.
- change u8 touint8_t.
- add ifndedCONFIG_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 | 13 ++++++---- 4 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/numa.h rename xen/{arch/arm/include/asm => include/asm-generic}/numa.h (75%)xen/arch/arm/include/asm/Makefile +1
-0@@ -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.hxen/arch/ppc/include/asm/Makefile +1
-0@@ -5,6 +5,7 @@ generic-y += hardirq.h generic-y += hypercall.h generic-y += iocap.h generic-y += monitor.h +generic-y += numa.h generic-y += paging.h generic-y += percpu.h generic-y += random.hxen/arch/ppc/include/asm/numa.h deleted +0
-26@@ -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__ */ xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +0
-0
xen/include/asm-generic/numa.h line 3
Quoted 5 lines
xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +3
-2@@ -1,9 +1,11 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ARCH_GENERIC_NUMA_H +#define __ARCH_GENERIC_NUMA_H
ASM_GENERIC ?
xen/include/asm-generic/numa.h line 5
Quoted 3 lines
xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +1
-1-#include <xen/mm.h> +#include <xen/mm-frame.h>
If this is for mfn_t, shouldn't this inclusion be moved under #ifndef ?
Apart from that:
~Michal
Re: [PATCH v3 11/14] xen/asm-generic: introduce stub header numa.h
Quoted 12 lines · Michal Orzel
xen/include/asm-generic/numa.h line 3
Quoted 8 lines · Oleksii Kurochko
xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +3
-2@@ -1,9 +1,11 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ARCH_GENERIC_NUMA_H +#define __ARCH_GENERIC_NUMA_H
ASM_GENERIC?Quoted 1 line
Quoted 3 lines
xen/include/asm-generic/numa.h line 5
Quoted 2 lines
xen/include/asm-generic/numa.h renamed from xen/arch/arm/include/asm/numa.h +1
-1-#include <xen/mm.h> +#include <xen/mm-frame.h> If this is for
mfn_t, shouldn't this inclusion be moved under #ifndef ?
I agree, it better would be.
Jan
Re: [PATCH v3 11/14] xen/asm-generic: introduce stub header numa.h
In reply to Michal OrzelHello Michal,
Quoted 97 lines · Michal Orzel
Quoted 95 lines · Oleksii Kurochko
<
asm/numa.h> is common through some archs so it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>---
Changes in V3:
- Remove old header inclusion in asm-genericnuma.hand include <xen/mm-frame.h> and <xen/stdint.h>
- Drop Arm and PPC'snuma.hand use asm-generic version instead.
---
Changes in V2:
- update the commit message.
- change u8 touint8_t.
- add ifndedCONFIG_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 | 13 ++++++----4 files changed, 10 insertions(+), 31 deletions(-)delete mode 100644
xen/arch/ppc/include/asm/numa.hrename xen/{arch/arm/include/asm =>include/asm-generic}/numa.h(75%)xen/arch/arm/include/asm/Makefile +0
-0@@ -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.hxen/arch/ppc/include/asm/Makefile +0
-0@@ -5,6 +5,7 @@ generic-y += hardirq.hgeneric-y +=
hypercall.h
generic-y +=iocap.h
generic-y +=monitor.h
+generic-y +=numa.h
generic-y +=paging.h
generic-y +=percpu.h
generic-y +=random.hxen/arch/ppc/include/asm/numa.h deleted +0
-14@@ -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.
- */xen/arch/ppc/include/asm/numa.h deleted +0
-4-extern mfn_t first_valid_mfn; - -/* XXX: implement NUMA support */ -#define node_spanned_pages (nid) (max_page -
mfn_x(first_valid_mfn))xen/arch/ppc/include/asm/numa.h deleted +0
-6-#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__ */ xen/include/asm- renamed from xen/arch/arm/include/asm/numa.h +0
-0
generic/numa.h
similarity index 75%
rename fromxen/arch/arm/include/asm/numa.h
rename toxen/include/asm-generic/numa.h
indexe2bee2bd82..c5b522dee8100644
---a/xen/arch/arm/include/asm/numa.h
Quoted 8 lines
xen/include/asm- line 3
Quoted 7 lines
+++
b/xen/include/asm-generic/numa.hxen/include/asm- renamed from xen/arch/arm/include/asm/numa.h +3
-2@@ -1,9 +1,11 @@ -#ifndef __ARCH_ARM_NUMA_H -#define __ARCH_ARM_NUMA_H +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ARCH_GENERIC_NUMA_H +#define __ARCH_GENERIC_NUMA_H
ASM_GENERIC?
Thanks. I'll rename the guard.
Quoted 6 lines
xen/include/asm- line 4
Quoted 4 lines
xen/include/asm- renamed from xen/arch/arm/include/asm/numa.h +1
-1-#include <xen/mm.h> +#include <xen/mm-frame.h>If this is for
mfn_t, shouldn't this inclusion be moved under #ifndef ?
It would be better. I'll update that in the next patch series.
Quoted 3 lines
Apart from that:
Reviewed-by Michal Orzel <[email protected]>
~ Oleksii
PATCH v3 12/14 xen/asm-generic: introduce stub header softirq.h
In reply to Oleksii Kurochko<asm/softirq.h> is common between Arm, PPC and RISC-V so it is moved to asm-generic.
---
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%)xen/arch/arm/include/asm/Makefile +1 -0
@@ -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
xen/arch/ppc/include/asm/Makefile +1 -0
@@ -9,4 +9,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
xen/arch/ppc/include/asm/softirq.h deleted +0 -8
@@ -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__ */
xen/include/asm-generic/softirq.h renamed from xen/arch/arm/include/asm/softirq.h +4 -3
@@ -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
Signature · 1 line
2.41.0
Re: [PATCH v3 12/14] xen/asm-generic: introduce stub header softirq.h
Hi,
Quoted 6 lines · Oleksii Kurochko
<
asm/softirq.h> is common between Arm, PPC and RISC-V so it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>
~Michal
Jan Beulich
Acked-byRe: [PATCH v3 12/14] xen/asm-generic: introduce stub header softirq.h
Quoted 8 lines · Michal Orzel
Quoted 6 lines · Oleksii Kurochko
<
asm/softirq.h> is common between Arm, PPC and RISC-V so it is moved to asm-generic.Signed-off-by Oleksii Kurochko <[email protected]>Reviewed-by Michal Orzel <[email protected]>
PATCH v3 13/14 xen: ifdef inclusion of <asm/grant_table.h> in <xen/grant_table.h>
In reply to Oleksii KurochkoIfdef-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.
---
Changes in V3:
- Remove unnecessary comment.
--- xen/arch/arm/domain_build.c | 1 + xen/arch/ppc/include/asm/grant_table.h | 5 ----- xen/include/xen/grant_table.h | 3 +++ 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/grant_table.h
xen/arch/arm/domain_build.c +1 -0
@@ -34,6 +34,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
xen/arch/ppc/include/asm/grant_table.h deleted +0 -5
@@ -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__ */
xen/include/xen/grant_table.h +3 -0
@@ -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 ;
Signature · 1 line
2.41.0
PATCH v3 14/14 xen/asm-generic: ifdef inclusion of <asm/mem_access.h>
In reply to Oleksii Kurochkoifdefing 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.
---
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/include/xen/mem_access.h | 2 ++ 4 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 xen/arch/ppc/include/asm/mem_access.h
xen/arch/arm/p2m.c +1 -0
@@ -11,6 +11,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>
xen/arch/arm/traps.c +1 -0
@@ -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>
xen/arch/ppc/include/asm/mem_access.h deleted +0 -5
@@ -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__ */
xen/include/xen/mem_access.h +2 -0
@@ -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
Signature · 1 line
2.41.0