linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
To: <arnd@arndb.de>
Cc: <linux@arm.linux.org.uk>, <linaro-dev@lists.linaro.org>,
	<linux-arm-kernel@lists.infradead.org>, <tim@xen.org>,
	<Ian.Campbell@citrix.com>, <konrad.wilk@oracle.com>,
	<Stefano.Stabellini@eu.citrix.com>,
	<xen-devel@lists.xensource.com>, <linux-kernel@vger.kernel.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: [PATCH v5 11/17] xen/arm: get privilege status
Date: Mon, 17 Sep 2012 18:38:57 +0100	[thread overview]
Message-ID: <1347903543-2135-11-git-send-email-stefano.stabellini@eu.citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1209171215490.29232@kaball.uk.xensource.com>

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>
---
 arch/arm/xen/enlighten.c         |    7 +++++++
 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 6a0217d..c2a47a7 100644
--- a/arch/arm/xen/enlighten.c
+++ b/arch/arm/xen/enlighten.c
@@ -1,6 +1,7 @@
 #include <xen/xen.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/memory.h>
+#include <xen/features.h>
 #include <xen/platform_pci.h>
 #include <asm/xen/hypervisor.h>
 #include <asm/xen/hypercall.h>
@@ -66,6 +67,12 @@ static int __init xen_guest_init(void)
 	}
 	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)
 		shared_info_page = (struct shared_info *)
 			get_zeroed_page(GFP_KERNEL);
diff --git a/include/xen/interface/features.h b/include/xen/interface/features.h
index b6ca39a..131a6cc 100644
--- a/include/xen/interface/features.h
+++ b/include/xen/interface/features.h
@@ -50,6 +50,9 @@
 /* x86: pirq can be used by HVM guests */
 #define XENFEAT_hvm_pirqs           10
 
+/* operation as Dom0 is supported */
+#define XENFEAT_dom0                      11
+
 #define XENFEAT_NR_SUBMAPS 1
 
 #endif /* __XEN_PUBLIC_FEATURES_H__ */
-- 
1.7.2.5


  parent reply	other threads:[~2012-09-17 17:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 17:37 [PATCH v5 00/17] Introduce Xen support on ARM (based on 3.6-rc5) Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 01/17] arm: initial Xen support Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 02/17] xen/arm: hypercalls Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 03/17] xen/arm: page.h definitions Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 04/17] xen/arm: sync_bitops Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 05/17] xen/arm: empty implementation of grant_table arch specific functions Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 06/17] docs: Xen ARM DT bindings Stefano Stabellini
2012-09-18  2:59   ` Rob Herring
2012-09-17 17:38 ` [PATCH v5 07/17] xen/arm: Xen detection and shared_info page mapping Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 08/17] xen/arm: Introduce xen_ulong_t for unsigned long Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 09/17] xen: do not compile manage, balloon, pci, acpi, pcpu and cpu_hotplug on ARM Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 10/17] xen/arm: introduce CONFIG_XEN " Stefano Stabellini
2012-09-17 17:38 ` Stefano Stabellini [this message]
2012-09-17 17:38 ` [PATCH v5 12/17] xen/arm: initialize grant_table " Stefano Stabellini
2012-09-17 17:38 ` [PATCH v5 13/17] xen/arm: receive Xen events " Stefano Stabellini
2012-09-17 17:39 ` [PATCH v5 14/17] xen/arm: implement alloc/free_xenballooned_pages with alloc_pages/kfree Stefano Stabellini
2012-09-17 17:39 ` [PATCH v5 15/17] xen/arm: compile blkfront and blkback Stefano Stabellini
2012-09-17 17:39 ` [PATCH v5 16/17] xen/arm: compile netback Stefano Stabellini
2012-09-17 17:39 ` [PATCH v5 17/17] MAINTAINERS: add myself as Xen ARM maintainer Stefano Stabellini
2012-09-18 12:34 ` [PATCH v5 00/17] Introduce Xen support on ARM (based on 3.6-rc5) Arnd Bergmann
2012-09-18 13:53   ` Konrad Rzeszutek Wilk
2012-09-18 13:57   ` Stefano Stabellini
2012-09-18 14:37     ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1347903543-2135-11-git-send-email-stefano.stabellini@eu.citrix.com \
    --to=stefano.stabellini@eu.citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=arnd@arndb.de \
    --cc=konrad.wilk@oracle.com \
    --cc=linaro-dev@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).