]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
convert XSM_ENABLE to Kconfig
authorDoug Goldstein <cardoe@cardoe.com>
Tue, 12 Jan 2016 10:39:47 +0000 (11:39 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 12 Jan 2016 10:39:47 +0000 (11:39 +0100)
Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM
within Kconfig. This also re-adds the dependency of CONFIG_FLASK on
CONFIG_XSM.

Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Config.mk
INSTALL
docs/misc/xsm-flask.txt
xen/Rules.mk
xen/common/Kconfig
xen/include/asm-x86/config.h
xen/include/xen/sched.h
xen/include/xsm/dummy.h
xen/include/xsm/xsm.h
xen/xsm/Makefile
xen/xsm/xsm_core.c

index 13159188cc73ebe9306d64b3855b81bd21ce0bed..62f82099907ba56de6e14976d93f8bdbd2f37cfb 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i))
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE ?= n
-
 XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff --git a/INSTALL b/INSTALL
index c51447bdfea57fbf849c3748f282cdf1c1e023fb..3d2e86a2a0f67ac4cf91c601d21d364680a619be 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to
 setup.py. Config.mk contains additional info how to use this variable.
 PYTHON_PREFIX_ARG=
 
-The hypervisor may be build with XSM support, which can be changed with
-the following variables.
-XSM_ENABLE=y
-
-The hypervisor may be build with Flask support, which can be changed
+he hypervisor may be build with XSM/Flask support, which can be changed
 by running:
 make -C xen menuconfig
-and enabling Flask in the 'Common Features' menu.
+and enabling XSM/Flask in the 'Common Features' menu.
 
 Do a build for coverage.
 coverage=y
index f2f0fd47d7ab0503a9e88781ee307c800983ee43..fb2fe9f42fbd27c978a268ed8a7c5965a9a490d5 100644 (file)
@@ -172,9 +172,9 @@ Setting up FLASK
 ----------------
 
 Xen must be compiled with XSM and FLASK enabled; by default, the security
-framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to
-"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common
-Features'; this change requires a make clean and rebuild.
+framework is disabled. Running 'make -C xen menuconfig' and enabling XSM
+and FLASK inside 'Common Features'; this change requires a make clean and
+rebuild.
 
 FLASK uses only one domain configuration parameter (seclabel) defining the
 full security label of the newly created domain. If using the example policy,
index 9e4e6ff5dc4e90126dc5123f2196fbcc2131a32f..8bd109825e6284c33a06951819d8fc904ea699c0 100644 (file)
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith
 CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h
 CFLAGS += '-D__OBJECT_FILE__="$@"'
 
-CFLAGS-$(XSM_ENABLE)    += -DXSM_ENABLE
 CFLAGS-$(verbose)       += -DVERBOSE
 CFLAGS-$(crash_debug)   += -DCRASH_DEBUG
 CFLAGS-$(perfc)         += -DPERF_COUNTERS
index 3419816422b80d3a49b5684527d0c8bd2aec7e16..eadfc3bbe284b3e01bcd9b2d814ace916af9de16 100644 (file)
@@ -10,7 +10,8 @@ config COMPAT
 
 config FLASK
        bool "FLux Advanced Security Kernel support"
-       default n
+       default y
+       depends on XSM
        ---help---
          Enables the FLASK (FLux Advanced Security Kernel) support which
          provides a mandatory access control framework by which security
@@ -62,4 +63,38 @@ config KEXEC
 
          If unsure, say Y.
 
+# Allows "late" initialization of the hardware domain
+config LATE_HWDOM
+       bool "dedicated hardware domain"
+       default n
+       depends on XSM && X86
+       ---help---
+         Allows the creation of a dedicated hardware domain distinct from
+         domain 0 that manages devices without needing access to other
+         privileged functionality such as the ability to manage domains.
+         This requires that the actual domain 0 be a stub domain that
+         constructs the actual hardware domain instead of initializing the
+         hardware itself.  Because the hardware domain needs access to
+         hypercalls not available to unprivileged guests, an XSM policy
+         is required to properly define the privilege of these domains.
+
+         This feature does nothing if the "hardware_dom" boot parameter is
+         not present.  If this feature is being used for security, it should
+         be combined with an IOMMU in strict mode.
+
+         If unsure, say N.
+
+# Enable/Disable XSM support
+config XSM
+       bool "Xen Security Modules support"
+       default n
+       ---help---
+         Enables the security framework known as Xen Security Modules which
+         allows administrators fine-grained control over a Xen domain and
+         its capabilities by defining permissible interactions between domains,
+         the hypervisor itself, and related resources such as memory and
+         devices.
+
+         If unsure, say N.
+
 endmenu
index f25d92ea383b9a7b1a65bc5ef4063d1455bc8ab4..3305a75aea898370a798c68fed595e9175436982 100644 (file)
 
 #define CONFIG_MULTIBOOT 1
 
-#ifdef XSM_ENABLE
-#define CONFIG_LATE_HWDOM 1
-#endif
-
 #define HZ 100
 
 #define OPT_CONSOLE_STR "vga"
index 8fc26cea875c872b899819ab29e21ac5de7ffbbb..82b6dd1527434b7df681f932e98a8695330d9a3b 100644 (file)
@@ -110,7 +110,7 @@ struct evtchn
     u8 priority;
     u8 last_priority;
     u16 last_vcpu_id;
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
     union {
 #ifdef XSM_NEED_GENERIC_EVTCHN_SSID
         /*
index 9803ff4775b756dd8892313d0a23cf33d7a75aed..1d138269f795c4bc27a6f92717cacbe3bc482733 100644 (file)
@@ -27,9 +27,9 @@
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
-/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and
+/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and
  * contains static (not inline) functions compiled to the dummy XSM module.
  * There is no xsm_default_t argument available, so the value from the assertion
  * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID void
 #define XSM_ASSERT_ACTION(def) xsm_default_t action = def; (void)action
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
-/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and
+/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and
  * contains inline functions for each XSM hook. These functions also perform
  * compile-time checks on the xsm_default_t argument to ensure that the behavior
  * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);
 #define XSM_DEFAULT_VOID xsm_default_t action
 #define XSM_ASSERT_ACTION(def) LINKER_BUG_ON(def != action)
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 static always_inline int xsm_default_action(
     xsm_default_t action, struct domain *src, struct domain *target)
index 150f94a7b49bbaabf864cf7f0a2c3f5ff8984571..3afed70d75fec104cf27276f8484dbbca3fb978b 100644 (file)
@@ -195,7 +195,7 @@ struct xsm_operations {
 #endif
 };
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 extern struct xsm_operations *xsm_ops;
 
@@ -753,7 +753,7 @@ extern int unregister_xsm(struct xsm_operations *ops);
 extern struct xsm_operations dummy_xsm_ops;
 extern void xsm_fixup_ops(struct xsm_operations *ops);
 
-#else /* XSM_ENABLE */
+#else /* CONFIG_XSM */
 
 #include <xsm/dummy.h>
 
@@ -773,6 +773,6 @@ static inline int xsm_dt_init(void)
 }
 #endif
 
-#endif /* XSM_ENABLE */
+#endif /* CONFIG_XSM */
 
 #endif /* __XSM_H */
index d29e71c3a48605898732297be7794fe9523d9265..3252c46e64f5dd8c65cf5a132f45c47c7895d617 100644 (file)
@@ -1,7 +1,5 @@
 obj-y += xsm_core.o
-ifeq ($(XSM_ENABLE),y)
-obj-y += xsm_policy.o
-obj-y += dummy.o
-endif
+obj-$(CONFIG_XSM) += xsm_policy.o
+obj-$(CONFIG_XSM) += dummy.o
 
 subdir-$(CONFIG_FLASK) += flask
index 2a74496b8eb69ef892e3765926c59182680a48f0..5e432dee71fc48c8cfa55e1d69aa23c2a71f1641 100644 (file)
@@ -17,7 +17,7 @@
 #include <xen/hypercall.h>
 #include <xsm/xsm.h>
 
-#ifdef XSM_ENABLE
+#ifdef CONFIG_XSM
 
 #define XSM_FRAMEWORK_VERSION    "1.0.0"