xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Daniel De Graaf <dgdegra@tycho.nsa.gov>, xen-devel@lists.xen.org
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 4/6] xen: Allow hardare domain != dom0
Date: Wed, 05 Mar 2014 11:50:37 +0800	[thread overview]
Message-ID: <53169F0D.509@linaro.org> (raw)
In-Reply-To: <1393973494-29411-5-git-send-email-dgdegra@tycho.nsa.gov>

Hello Daniel,

On 05/03/14 06:51, Daniel De Graaf wrote:
> This adds a hypervisor command line option "hardware_dom=" which takes a
> domain ID.  When the domain with this ID is created, it will be used as
> the hardware domain.
>
> This is intended to be used when dom0 is a dedicated stub domain for
> domain building, allowing the hardware domain to be de-privileged and
> act only as a driver domain.
>
> Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
> Cc: Keir Fraser <keir@xen.org>
> Cc: Jan Beulich <jbeulich@suse.com>
> ---
>   xen/arch/x86/domain_build.c |  4 +++-
>   xen/arch/x86/setup.c        |  3 +++
>   xen/common/domctl.c         |  8 ++++++++
>   xen/common/rangeset.c       | 26 ++++++++++++++++++++++++++
>   xen/include/xen/rangeset.h  |  3 +++
>   xen/include/xen/sched.h     |  3 ++-
>   6 files changed, 45 insertions(+), 2 deletions(-)
>
> diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
> index 84ce392..e9de496 100644
> --- a/xen/arch/x86/domain_build.c
> +++ b/xen/arch/x86/domain_build.c
> @@ -1149,7 +1149,9 @@ int __init construct_dom0(
>           printk(" Xen warning: dom0 kernel broken ELF: %s\n",
>                  elf_check_broken(&elf));
>
> -    iommu_dom0_init(dom0);
> +    if( is_hardware_domain(dom0) )
> +        iommu_dom0_init(dom0);
> +
>       return 0;
>
>   out:
> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
> index 3a4f69c..3480854 100644
> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -88,6 +88,9 @@ unsigned long __initdata highmem_start;
>   size_param("highmem-start", highmem_start);
>   #endif
>
> +unsigned int __read_mostly hardware_dom;
> +integer_param("hardware_dom", hardware_dom);
> +
>   cpumask_t __read_mostly cpu_present_map;
>
>   unsigned long __read_mostly xen_phys_start;
> diff --git a/xen/common/domctl.c b/xen/common/domctl.c
> index eebeee7..11e6b94 100644
> --- a/xen/common/domctl.c
> +++ b/xen/common/domctl.c
> @@ -472,6 +472,14 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl)
>               break;
>           }
>
> +        if (d->domain_id == hardware_dom) {
> +            printk("Initialising hardware domain %d\n", hardware_dom);
> +            rangeset_swap(d->irq_caps, dom0->irq_caps);
> +
> +            dom0 = d;
> +            iommu_dom0_init(dom0);
> +        }
> +

This patch will break compilation on ARM. You are using hardware_dom 
which is defined in xen/arch/x86/setup.c.

I'm not sure if the best solution is to move the defined for 
hardware_dom in common code ... because settings this variable to a 
value other than 0 will break ARM boot with your changes in patch #1.

Supporting hardware domain on ARM will need rework on dom0 builder.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-03-05  3:50 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04 22:51 [PATCH 0/6] xen: Hardware domain support Daniel De Graaf
2014-03-04 22:51 ` [PATCH 1/6] xen: use domid check in is_hardware_domain Daniel De Graaf
2014-03-05  3:44   ` Julien Grall
2014-03-05  9:23   ` Jan Beulich
2014-03-05 15:25     ` Daniel De Graaf
2014-03-05 15:45       ` Jan Beulich
2014-03-05 21:23         ` Daniel De Graaf
2014-03-11 13:10       ` Ian Campbell
2014-03-04 22:51 ` [PATCH 2/6] xen/iommu: Move dom0 setup code out of __init Daniel De Graaf
2014-03-05  9:56   ` Jan Beulich
2014-03-05 22:25     ` Daniel De Graaf
2014-03-06  9:53       ` Jan Beulich
2014-03-04 22:51 ` [PATCH 3/6] xen: prevent 0 from being used as a dynamic domid Daniel De Graaf
2014-03-04 22:51 ` [PATCH 4/6] xen: Allow hardare domain != dom0 Daniel De Graaf
2014-03-05  3:50   ` Julien Grall [this message]
2014-03-05 23:04     ` Daniel De Graaf
2014-03-05 10:04   ` Jan Beulich
2014-03-05 23:04     ` Daniel De Graaf
2014-03-06  9:54       ` Jan Beulich
2014-03-04 22:51 ` [PATCH 5/6] tools/libxl: Allow dom0 to be destroyed Daniel De Graaf
2014-03-05 10:07   ` Jan Beulich
2014-03-05 12:02   ` Ian Jackson
2014-03-05 22:36     ` Daniel De Graaf
2014-03-10 16:45       ` Ian Jackson
2014-03-12 14:27         ` Daniel De Graaf
2014-03-13 17:17           ` Ian Jackson
2014-03-13 17:41             ` Daniel De Graaf
2014-03-14 14:32               ` Ian Jackson
2014-03-04 22:51 ` [PATCH 6/6] xenstored: add --master-domid to support domain builder Daniel De Graaf
2014-03-10 12:14   ` Ian Jackson
2014-03-04 23:32 ` Domain Builder Daniel De Graaf

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=53169F0D.509@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /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).