All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel De Graaf <dgdegra@tycho.nsa.gov>
To: "Jan Beulich" <JBeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	SuraveeSuthikulpanit <suravee.suthikulpanit@amd.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Eddie Dong <eddie.dong@intel.com>,
	Aravind Gopalakrishnan <Aravind.Gopalakrishnan@amd.com>,
	Jun Nakajima <jun.nakajima@intel.com>,
	xen-devel@lists.xenproject.org,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>
Subject: Re: [PATCH v6 1/2] xen/pvh: use a custom IO bitmap for PVH hardware domains
Date: Fri, 15 May 2015 16:09:40 -0400	[thread overview]
Message-ID: <55565284.4070606@tycho.nsa.gov> (raw)
In-Reply-To: <5555BF74020000780007A697@mail.emea.novell.com>

On 05/15/2015 03:42 AM, Jan Beulich wrote:
>>>> On 15.05.15 at 09:34, <roger.pau@citrix.com> wrote:
>> El 15/05/15 a les 8.36, Jan Beulich ha escrit:
>>>>>> On 14.05.15 at 17:27, <roger.pau@citrix.com> wrote:
>>>> El 13/05/15 a les 11.53, Jan Beulich ha escrit:
>>>>>>>> On 11.05.15 at 16:57, <roger.pau@citrix.com> wrote:
>>>>>> --- a/xen/common/domain.c
>>>>>> +++ b/xen/common/domain.c
>>>>>> @@ -42,6 +42,7 @@
>>>>>>   #include <xsm/xsm.h>
>>>>>>   #include <xen/trace.h>
>>>>>>   #include <xen/tmem.h>
>>>>>> +#include <asm/setup.h>
>>>>>>
>>>>>>   /* Linux config option: propageted to domain0 */
>>>>>>   /* xen_processor_pmbits: xen control Cx, Px, ... */
>>>>>> @@ -219,6 +220,7 @@ static int late_hwdom_init(struct domain *d)
>>>>>>       rangeset_swap(d->iomem_caps, dom0->iomem_caps);
>>>>>>   #ifdef CONFIG_X86
>>>>>>       rangeset_swap(d->arch.ioport_caps, dom0->arch.ioport_caps);
>>>>>> +    setup_io_bitmap(d);
>>>>>>   #endif
>>>>>
>>>>> Considering that rangesets are getting swapped rather than
>>>>> copied, I think you also need to reset Dom0's I/O bitmap here
>>>>> to the ordinary, non-hardware domain one.
>>>>
>>>> Yes. Would it be fine to memset it and just call setup_io_bitmap on it
>>>> again, or would you prefer to exchange it with the static one and free it?
>>>
>>> Following how the rangesets are being treated, simply swapping
>>> the two I/O bitmaps would seem to be the right approach here.
>>
>> AFAICT this requires adding a new hook in hvm_function_table in order to
>> implement setting the io bitmap for SVM and VMX. I don't have a problem
>> with that, but it's going to need a separate patch.
>
> Right - if there is nothing like that currently, it'll need to be added.
> Of course you may want to get Daniel de Graaf's (who originally
> added this non-Dom0 hardware domain code, now Cc-ed) input on
> the above outline approach before going that route...

Currently, the only user of this code that I know of is a domain builder
which is a PV stub domain, which may impact a trivial swapping operation
because dom0->arch.hvm_domain will not be valid.  The primary reason why
the rangeset_swap calls are not rangeset_dup is because this stub domain
does not need access to the hardware after the creation of the hardware
domain.

I think it seems cleaner for the IO bitmap of domain 0 to also be cleared
after the hardware domain is created, but it's not really a requirement to
make things work.

-- 
Daniel De Graaf
National Security Agency

  reply	other threads:[~2015-05-15 20:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 14:57 [PATCH v6 0/3] xen/pvh: use a custom IO bitmap for PVH hardware domains Roger Pau Monne
2015-05-11 14:57 ` [PATCH v6 1/2] " Roger Pau Monne
2015-05-13  9:53   ` Jan Beulich
2015-05-14 15:27     ` Roger Pau Monné
2015-05-15  6:36       ` Jan Beulich
2015-05-15  7:34         ` Roger Pau Monné
2015-05-15  7:42           ` Jan Beulich
2015-05-15 20:09             ` Daniel De Graaf [this message]
2015-05-18  7:12               ` Jan Beulich
2015-05-11 14:57 ` [PATCH v6 2/2] xen/pvh: trap access to sensitive IO ports Roger Pau Monne

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=55565284.4070606@tycho.nsa.gov \
    --to=dgdegra@tycho.nsa.gov \
    --cc=Aravind.Gopalakrishnan@amd.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=roger.pau@citrix.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=xen-devel@lists.xenproject.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.