|
|
|
|
|
|
|
|
|
|
xen-devel
[Xen-devel] [PATCH 01 of 11] xen: short-circuit tests for dom0
When testing for a dom0/initial/privileged domain, make sure the
predicate evaluates to a compile-time 0 if CONFIG_XEN_DOM0 isn't
enabled. This will make most of the dom0 code evaporate without
much more effort.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
---
arch/x86/include/asm/xen/hypervisor.h | 28 ++++++++++++++++++----------
1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/arch/x86/include/asm/xen/hypervisor.h
b/arch/x86/include/asm/xen/hypervisor.h
--- a/arch/x86/include/asm/xen/hypervisor.h
+++ b/arch/x86/include/asm/xen/hypervisor.h
@@ -38,22 +38,30 @@
extern struct start_info *xen_start_info;
enum xen_domain_type {
- XEN_NATIVE,
- XEN_PV_DOMAIN,
- XEN_HVM_DOMAIN,
+ XEN_NATIVE, /* running on bare hardware */
+ XEN_PV_DOMAIN, /* running in a PV domain */
+ XEN_HVM_DOMAIN, /* running in a Xen hvm domain */
};
+#ifdef CONFIG_XEN
extern enum xen_domain_type xen_domain_type;
-
-#ifdef CONFIG_XEN
-#define xen_domain() (xen_domain_type != XEN_NATIVE)
#else
-#define xen_domain() (0)
+#define xen_domain_type XEN_NATIVE
#endif
-#define xen_pv_domain() (xen_domain() && xen_domain_type ==
XEN_PV_DOMAIN)
-#define xen_hvm_domain() (xen_domain() && xen_domain_type ==
XEN_HVM_DOMAIN)
+#define xen_domain() (xen_domain_type != XEN_NATIVE)
+#define xen_pv_domain() (xen_domain() &&
\
+ xen_domain_type == XEN_PV_DOMAIN)
+#define xen_hvm_domain() (xen_domain() && \
+ xen_domain_type == XEN_HVM_DOMAIN)
-#define xen_initial_domain() (xen_pv_domain() && xen_start_info->flags &
SIF_INITDOMAIN)
+#ifdef CONFIG_XEN_DOM0
+#include <xen/interface/xen.h>
+
+#define xen_initial_domain() (xen_pv_domain() && \
+ xen_start_info->flags & SIF_INITDOMAIN)
+#else /* !CONFIG_XEN_DOM0 */
+#define xen_initial_domain() (0)
+#endif /* CONFIG_XEN_DOM0 */
#endif /* _ASM_X86_XEN_HYPERVISOR_H */
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- [Xen-devel] [PATCH 00 of 11] xen: smattering of dom0 patches, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 01 of 11] xen: short-circuit tests for dom0,
Jeremy Fitzhardinge <=
- [Xen-devel] [PATCH 03 of 11] xen dom0: Initialize xenbus for dom0, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 04 of 11] xen dom0: Set up basic IO permissions for dom0, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 02 of 11] xen dom0: Make hvc_xen console work for dom0, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 09 of 11] xen/dom0: use _PAGE_IOMAP in ioremap to do machine mappings, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 06 of 11] xen dom0: Add support for the platform_ops hypercall, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 10 of 11] paravirt/xen: add pvop for page_is_ram, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 11 of 11] xen: use machine memory map in domain 0, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 05 of 11] xen-dom0: only selectively disable cpu features, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 08 of 11] xen: forcibly disable PAT support, Jeremy Fitzhardinge
- [Xen-devel] [PATCH 07 of 11] xen mtrr: Add mtrr_ops support for Xen mtrr, Jeremy Fitzhardinge
|
|
|
|
|