All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Keir Fraser <keir@xen.org>,
	Ian Campbell <ian.campbell@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
	xen-devel@lists.xen.org, Daniel De Graaf <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v4 2/2] allow hardware domain != dom0
Date: Wed, 16 Apr 2014 10:41:19 +0100	[thread overview]
Message-ID: <534E503F.1000100@citrix.com> (raw)
In-Reply-To: <534E649702000078000095D2@nat28.tlf.novell.com>

On 16/04/14 10:08, Jan Beulich wrote:
>>>> On 16.04.14 at 01:37, <andrew.cooper3@citrix.com> wrote:
>> On 15/04/2014 23:07, Daniel De Graaf wrote:
>>> On 04/15/2014 10:45 AM, Andrew Cooper wrote:
>>>> On 14/04/14 22:23, Daniel De Graaf wrote:
>>>>> diff --git a/xen/common/domain.c b/xen/common/domain.c
>>>>> index 3c05711..11c905a 100644
>>>>> --- a/xen/common/domain.c
>>>>> +++ b/xen/common/domain.c
>>>>> @@ -61,6 +61,11 @@ struct domain *domain_list;
>>>>>
>>>>>   struct domain *hardware_domain __read_mostly;
>>>>>
>>>>> +#ifdef CONFIG_LATE_HWDOM
>>>>> +domid_t hardware_domid __read_mostly;
>>>>> +integer_param("hardware_dom", hardware_domid);
>>>>> +#endif
>>>>> +
>>>> Is it worth putting a custom_param() in here which clamps hardware_domid
>>>> below FIRST_RESERVED_DOMID, or allow anyone specifying
>>>> hardware_dom=0xffff to keep all the broken pieces they find?  Aliasing
>>>> the magic domids is sure to break things.
>>>>
>>>> ~Andrew
>>> I'm currently of the opinion that a custom_param is overkill to prevent
>>> users from deliberately doing bad things, but could easily write one if
>>> others think that it would be helpful.
>>>
>> I suppose the answer depends on how subtle the breakage will be if the
>> user gets it accidentally wrong.  Given that slightly over half the
>> domid space is reserved and domid_t signed value, I can forsee subtle
>> bugs if a domid_t ever used as an array index, as well as very unsubtle
>> breakage if the user aliases one of the magic domids.
>>
>> On the balance, a custom_param() is probably worthwhile for peace of mind.
> Why can't we just BUG_ON() or panic() the first time domain_create()
> gets to see the out of range domain ID?
>
> Jan
>

That would also work.

~Andrew

  reply	other threads:[~2014-04-16  9:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 21:23 [PATCH 1/2] implement is_hardware_domain using hardware_domain global Daniel De Graaf
2014-04-14 21:23 ` [PATCH v4 2/2] allow hardware domain != dom0 Daniel De Graaf
2014-04-15  7:53   ` Jan Beulich
2014-04-15 14:45   ` Andrew Cooper
2014-04-15 22:07     ` Daniel De Graaf
2014-04-15 23:37       ` Andrew Cooper
2014-04-16  9:08         ` Jan Beulich
2014-04-16  9:41           ` Andrew Cooper [this message]
2014-04-15  8:56 ` [PATCH 1/2] implement is_hardware_domain using hardware_domain global Ian Campbell

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=534E503F.1000100@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=keir@xen.org \
    --cc=tim@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.