diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-08-08 13:20:18 -0400 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2012-08-08 13:20:18 -0400 |
commit | ef61ee0dc7ba0409dc0e8122de90d4e48d4c8669 (patch) | |
tree | 69318ec779b0c71fbd8d7763b5ddb018b22b7673 | |
parent | eff8d6447d5fac2995ffa5c1f0ea2da5bd7074c9 (diff) |
xen/arm: get privilege status
Use Xen features to figure out if we are privileged.
XENFEAT_dom0 was introduced by 23735 in xen-unstable.hg.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r-- | arch/arm/xen/enlighten.c | 7 | ||||
-rw-r--r-- | include/xen/interface/features.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 6a0217d4e662..c2a47a724870 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <xen/xen.h> | 1 | #include <xen/xen.h> |
2 | #include <xen/interface/xen.h> | 2 | #include <xen/interface/xen.h> |
3 | #include <xen/interface/memory.h> | 3 | #include <xen/interface/memory.h> |
4 | #include <xen/features.h> | ||
4 | #include <xen/platform_pci.h> | 5 | #include <xen/platform_pci.h> |
5 | #include <asm/xen/hypervisor.h> | 6 | #include <asm/xen/hypervisor.h> |
6 | #include <asm/xen/hypercall.h> | 7 | #include <asm/xen/hypercall.h> |
@@ -66,6 +67,12 @@ static int __init xen_guest_init(void) | |||
66 | } | 67 | } |
67 | xen_domain_type = XEN_HVM_DOMAIN; | 68 | xen_domain_type = XEN_HVM_DOMAIN; |
68 | 69 | ||
70 | xen_setup_features(); | ||
71 | if (xen_feature(XENFEAT_dom0)) | ||
72 | xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; | ||
73 | else | ||
74 | xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED); | ||
75 | |||
69 | if (!shared_info_page) | 76 | if (!shared_info_page) |
70 | shared_info_page = (struct shared_info *) | 77 | shared_info_page = (struct shared_info *) |
71 | get_zeroed_page(GFP_KERNEL); | 78 | get_zeroed_page(GFP_KERNEL); |
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h index b6ca39a069d8..131a6ccdba25 100644 --- a/include/xen/interface/features.h +++ b/include/xen/interface/features.h | |||
@@ -50,6 +50,9 @@ | |||
50 | /* x86: pirq can be used by HVM guests */ | 50 | /* x86: pirq can be used by HVM guests */ |
51 | #define XENFEAT_hvm_pirqs 10 | 51 | #define XENFEAT_hvm_pirqs 10 |
52 | 52 | ||
53 | /* operation as Dom0 is supported */ | ||
54 | #define XENFEAT_dom0 11 | ||
55 | |||
53 | #define XENFEAT_NR_SUBMAPS 1 | 56 | #define XENFEAT_NR_SUBMAPS 1 |
54 | 57 | ||
55 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ | 58 | #endif /* __XEN_PUBLIC_FEATURES_H__ */ |