Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+10
+7
arch/arm/xen/enlighten.c
··· 1 1 #include <xen/xen.h> 2 2 #include <xen/interface/xen.h> 3 3 #include <xen/interface/memory.h> 4 + #include <xen/features.h> 4 5 #include <xen/platform_pci.h> 5 6 #include <asm/xen/hypervisor.h> 6 7 #include <asm/xen/hypercall.h> ··· 66 65 return 0; 67 66 } 68 67 xen_domain_type = XEN_HVM_DOMAIN; 68 + 69 + xen_setup_features(); 70 + if (xen_feature(XENFEAT_dom0)) 71 + xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED; 72 + else 73 + xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED); 69 74 70 75 if (!shared_info_page) 71 76 shared_info_page = (struct shared_info *)
+3
include/xen/interface/features.h
··· 50 50 /* x86: pirq can be used by HVM guests */ 51 51 #define XENFEAT_hvm_pirqs 10 52 52 53 + /* operation as Dom0 is supported */ 54 + #define XENFEAT_dom0 11 55 + 53 56 #define XENFEAT_NR_SUBMAPS 1 54 57 55 58 #endif /* __XEN_PUBLIC_FEATURES_H__ */