[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v7 24/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>
---
 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 | 2 +-
 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, 16 insertions(+), 11 deletions(-)

diff --git a/xen/Rules.mk b/xen/Rules.mk
index 4ed0d11..9e2cff6 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -59,7 +59,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 ec2406c..ec176a6 100644
--- a/xen/arch/arm/Kconfig
+++ b/xen/arch/arm/Kconfig
@@ -18,6 +18,7 @@ config ARM
        def_bool y
        select HAS_ARM_HDLCD
        select HAS_DEVICE_TREE
+       select HAS_MEM_ACCESS
        select HAS_PASSTHROUGH
        select HAS_PDX
        select HAS_VIDEO
diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig
index 3b12a9e..bbd278e 100644
--- a/xen/arch/x86/Kconfig
+++ b/xen/arch/x86/Kconfig
@@ -9,6 +9,7 @@ config X86
        select HAS_GDBSX
        select HAS_IOPORTS
        select HAS_KEXEC
+       select HAS_MEM_ACCESS
        select HAS_NS16550
        select HAS_PASSTHROUGH
        select HAS_PCI
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 8d2ab4f..1193bbc 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..272f1e4 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);
diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index 5e6ee71..bdc7d1b 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 1dac834..714b3bf 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
 
@@ -604,7 +604,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 6f4101c..ee4d6f3 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 454b0ce..0102cc0 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.