Commit ef61ee0d authored by Stefano Stabellini's avatar Stefano Stabellini

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: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent eff8d644
#include <xen/xen.h> #include <xen/xen.h>
#include <xen/interface/xen.h> #include <xen/interface/xen.h>
#include <xen/interface/memory.h> #include <xen/interface/memory.h>
#include <xen/features.h>
#include <xen/platform_pci.h> #include <xen/platform_pci.h>
#include <asm/xen/hypervisor.h> #include <asm/xen/hypervisor.h>
#include <asm/xen/hypercall.h> #include <asm/xen/hypercall.h>
...@@ -66,6 +67,12 @@ static int __init xen_guest_init(void) ...@@ -66,6 +67,12 @@ static int __init xen_guest_init(void)
} }
xen_domain_type = XEN_HVM_DOMAIN; xen_domain_type = XEN_HVM_DOMAIN;
xen_setup_features();
if (xen_feature(XENFEAT_dom0))
xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
else
xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED);
if (!shared_info_page) if (!shared_info_page)
shared_info_page = (struct shared_info *) shared_info_page = (struct shared_info *)
get_zeroed_page(GFP_KERNEL); get_zeroed_page(GFP_KERNEL);
......
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
/* x86: pirq can be used by HVM guests */ /* x86: pirq can be used by HVM guests */
#define XENFEAT_hvm_pirqs 10 #define XENFEAT_hvm_pirqs 10
/* operation as Dom0 is supported */
#define XENFEAT_dom0 11
#define XENFEAT_NR_SUBMAPS 1 #define XENFEAT_NR_SUBMAPS 1
#endif /* __XEN_PUBLIC_FEATURES_H__ */ #endif /* __XEN_PUBLIC_FEATURES_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment