|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCHv6] 23/28] build: convert HAS_MEM_ACCESS use to Kconfig
Use the Kconfig generated CONFIG_HAS_MEM_ACCESS defines in the code base.
CC: Ian Campbell <ian.campbell@xxxxxxxxxx>
CC: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Jan Beulich <jbeulich@xxxxxxxx>
CC: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
CC: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>
CC: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
Acked-by: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
Acked-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Tested-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
xen/Rules.mk | 1 -
xen/arch/arm/Kconfig | 1 +
xen/arch/x86/Kconfig | 1 +
xen/common/Kconfig | 4 ++++
xen/common/Makefile | 2 +-
xen/common/domctl.c | 2 +-
xen/common/vm_event.c | 2 +-
xen/include/xen/mem_access.h | 4 ++--
xen/include/xsm/dummy.h | 2 +-
xen/include/xsm/xsm.h | 4 ++--
xen/xsm/dummy.c | 2 +-
xen/xsm/flask/hooks.c | 4 ++--
12 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 4d90aca..f5ffe9d 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -56,7 +56,6 @@ CFLAGS-$(crash_debug) += -DCRASH_DEBUG
CFLAGS-$(perfc) += -DPERF_COUNTERS
CFLAGS-$(perfc_arrays) += -DPERF_ARRAYS
CFLAGS-$(lock_profile) += -DLOCK_PROFILE
-CFLAGS-$(HAS_MEM_ACCESS) += -DHAS_MEM_ACCESS
CFLAGS-$(HAS_MEM_PAGING) += -DHAS_MEM_PAGING
CFLAGS-$(HAS_MEM_SHARING) += -DHAS_MEM_SHARING
CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
index 9e7351e..b52474e 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -21,6 +21,7 @@ config ARM
select HAS_ARM_HDLCD
select HAS_PASSTHROUGH
select HAS_PDX
+ select HAS_MEM_ACCESS
config ARCH_DEFCONFIG
string
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 90d3020..530563f 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -15,6 +15,7 @@ config X86
select HAS_GDBSX
select HAS_PDX
select HAS_KEXEC
+ select HAS_MEM_ACCESS
config ARCH_DEFCONFIG
string
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 6987e84..bdb95f0 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -5,6 +5,10 @@ menu "Common Features"
config HAS_DEVICE_TREE
bool
+# Select HAS_MEM_ACCESS if mem access is supported
+config HAS_MEM_ACCESS
+ bool
+
# Select HAS_PDX if PDX is supported
config HAS_PDX
bool
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 0acd2b0..8ab15ba 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -18,7 +18,7 @@ obj-$(CONFIG_KEXEC) += kexec.o
obj-$(CONFIG_KEXEC) += kimage.o
obj-y += lib.o
obj-y += lzo.o
-obj-$(HAS_MEM_ACCESS) += mem_access.o
+obj-$(CONFIG_HAS_MEM_ACCESS) += mem_access.o
obj-y += memory.o
obj-y += multicall.o
obj-y += notifier.o
diff --git a/xen/common/domctl.c b/xen/common/domctl.c
index 46b967e..1fab587 100644
--- a/xen/common/domctl.c
+++ b/xen/common/domctl.c
@@ -1130,7 +1130,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t)
u_domctl)
d->disable_migrate = op->u.disable_migrate.disable;
break;
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
case XEN_DOMCTL_set_access_required:
if ( unlikely(current->domain == d) )
ret = -EPERM;
diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
index e1f9580..0fe93dc 100644
--- a/xen/common/vm_event.c
+++ b/xen/common/vm_event.c
@@ -397,7 +397,7 @@ void vm_event_resume(struct domain *d, struct
vm_event_domain *ved)
vm_event_register_write_resume(v, &rsp);
break;
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
case VM_EVENT_REASON_MEM_ACCESS:
mem_access_resume(v, &rsp);
break;
diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h
index 111f1fe..90efe01 100644
--- a/xen/include/xen/mem_access.h
+++ b/xen/include/xen/mem_access.h
@@ -25,7 +25,7 @@
#include <public/memory.h>
#include <asm/p2m.h>
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
int mem_access_memop(unsigned long cmd,
XEN_GUEST_HANDLE_PARAM(xen_mem_access_op_t) arg);
@@ -58,7 +58,7 @@ void mem_access_resume(struct vcpu *vcpu, vm_event_response_t
*rsp)
/* Nothing to do. */
}
-#endif /* HAS_MEM_ACCESS */
+#endif /* CONFIG_HAS_MEM_ACCESS */
#endif /* _XEN_ASM_MEM_ACCESS_H */
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 42e696a..7a9006b 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -560,7 +560,7 @@ static XSM_INLINE int xsm_vm_event_control(XSM_DEFAULT_ARG
struct domain *d, int
return xsm_default_action(action, current->domain, d);
}
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
static XSM_INLINE int xsm_mem_access(XSM_DEFAULT_ARG struct domain *d)
{
XSM_ASSERT_ACTION(XSM_DM_PRIV);
diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index c843a41..a550ae2 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -152,7 +152,7 @@ struct xsm_operations {
int (*vm_event_control) (struct domain *d, int mode, int op);
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
int (*mem_access) (struct domain *d);
#endif
@@ -603,7 +603,7 @@ static inline int xsm_vm_event_control (xsm_default_t def,
struct domain *d, int
return xsm_ops->vm_event_control(d, mode, op);
}
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
static inline int xsm_mem_access (xsm_default_t def, struct domain *d)
{
return xsm_ops->mem_access(d);
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index e8741a4..19fb8f7 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -129,7 +129,7 @@ void xsm_fixup_ops (struct xsm_operations *ops)
set_to_dummy_if_null(ops, vm_event_control);
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
set_to_dummy_if_null(ops, mem_access);
#endif
diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c
index db01875..82cc79b 100644
--- a/xen/xsm/flask/hooks.c
+++ b/xen/xsm/flask/hooks.c
@@ -1192,7 +1192,7 @@ static int flask_vm_event_control(struct domain *d, int
mode, int op)
return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__VM_EVENT);
}
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
static int flask_mem_access(struct domain *d)
{
return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MEM_ACCESS);
@@ -1705,7 +1705,7 @@ static struct xsm_operations flask_ops = {
.vm_event_control = flask_vm_event_control,
-#ifdef HAS_MEM_ACCESS
+#ifdef CONFIG_HAS_MEM_ACCESS
.mem_access = flask_mem_access,
#endif
--
2.4.10
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |