From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>, xen-devel@lists.xen.org
Subject: Re: [PATCH 1/4] xen: use domid check in is_hardware_domain
Date: Mon, 08 Jul 2013 11:58:13 -0400 [thread overview]
Message-ID: <51DAE195.1070500@tycho.nsa.gov> (raw)
In-Reply-To: <51DAEFD002000078000E35FC@nat28.tlf.novell.com>
On 07/08/2013 10:58 AM, Jan Beulich wrote:
>>>> On 08.07.13 at 16:46, Daniel De Graaf <dgdegra@tycho.nsa.gov> wrote:
>> --- a/xen/common/domain.c
>> +++ b/xen/common/domain.c
>> @@ -238,7 +238,7 @@ struct domain *domain_create(
>> if ( domcr_flags & DOMCRF_hvm )
>> d->is_hvm = 1;
>>
>> - if ( domid == 0 )
>> + if ( is_hardware_domain(d) )
>> {
>> d->is_pinned = opt_dom0_vcpus_pin;
>> d->disable_migrate = 1;
>> @@ -263,10 +263,10 @@ struct domain *domain_create(
>> d->is_paused_by_controller = 1;
>> atomic_inc(&d->pause_count);
>>
>> - if ( domid )
>> - d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
>> - else
>> + if ( is_hardware_domain(d) )
>> d->nr_pirqs = nr_static_irqs + extra_dom0_irqs;
>> + else
>> + d->nr_pirqs = nr_static_irqs + extra_domU_irqs;
>> if ( d->nr_pirqs > nr_irqs )
>> d->nr_pirqs = nr_irqs;
>>
>> @@ -600,7 +600,7 @@ void domain_shutdown(struct domain *d, u8 reason)
>> d->shutdown_code = reason;
>> reason = d->shutdown_code;
>>
>> - if ( d->domain_id == 0 )
>> + if ( is_hardware_domain(d) )
>> dom0_shutdown(reason);
>
> All earlier changes can be explained in one way or another to also
> apply to other than Dom0. This one, however, can't: There can
> only ever be one domain controling when to shut down the system,
> and hence I think it is misleading to use is_hardware_domain()
> here. Or is your targeted abstract model aiming at a single such
> domain, just perhaps with a domain ID other than zero?
>
> Jan
Yes, that is the model I am using. It splits dom0 into three domains:
0. Domain builder: bootstraps the system. May remain to perform requested
builds of domains that need a minimal trust chain (i.e. vTPM domains).
Other than being built by the hypervisor, nothing is special about this
domain - although it may be useful to have is_control_domain be true.
1. Hardware domain: manages devices for PCI pass-through to driver domains
or can act as a driver domain itself, depending on the desired degree
of disaggregation. This is the only domain where is_hardware_domain()
is true. The return of is_control_domain() is false for this domain.
2. Control domain: manages other domains, controls guest launch/shutdown,
manages resource constraints, etc; is_control_domain() returns true.
This model has a working implementation derived from the work in the XOAR
paper. It requires a patch on top of these to change the IOMMU setup to
happen after dom0 starts, and a dedicated domain builder domain.
--
Daniel De Graaf
National Security Agency
next prev parent reply other threads:[~2013-07-08 15:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 14:46 [PATCH 0/4] Clarify explicit domain ID checks Daniel De Graaf
2013-07-08 14:46 ` [PATCH 1/4] xen: use domid check in is_hardware_domain Daniel De Graaf
2013-07-08 14:58 ` Jan Beulich
2013-07-08 15:58 ` Daniel De Graaf [this message]
2013-07-09 6:29 ` Jan Beulich
2013-07-09 13:26 ` George Dunlap
2013-07-08 14:46 ` [PATCH 2/4] xen/arch/x86: clarify domid == 0 checks Daniel De Graaf
2013-07-08 14:46 ` [PATCH 3/4] IOMMU: use is_hardware_domain instead of domid == 0 Daniel De Graaf
2013-07-11 19:57 ` Suravee Suthikulanit
2013-07-08 14:46 ` [PATCH 4/4] xen/arch/arm: clarify domid == 0 checks 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=51DAE195.1070500@tycho.nsa.gov \
--to=dgdegra@tycho.nsa.gov \
--cc=JBeulich@suse.com \
--cc=keir@xen.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.