All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Chen, Tiejun" <tiejun.chen@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: tim@xen.org, kevin.tian@intel.com, wei.liu2@citrix.com,
	ian.campbell@citrix.com, andrew.cooper3@citrix.com,
	Ian.Jackson@eu.citrix.com, xen-devel@lists.xen.org,
	stefano.stabellini@citrix.com, yang.z.zhang@intel.com
Subject: Re: [RFC][v2][PATCH 00/14] Fix RMRR
Date: Thu, 28 May 2015 13:48:59 +0800	[thread overview]
Message-ID: <5566AC4B.1000701@intel.com> (raw)
In-Reply-To: <555F172A020000780007D2B4@mail.emea.novell.com>

On 2015/5/22 17:46, Jan Beulich wrote:
>>>> On 22.05.15 at 11:35, <tiejun.chen@intel.com> wrote:
>> As you know all devices are owned by Dom0 firstly before we create any
>> DomU, right? Do we allow Dom0 still own a group device while assign another
>> device in the same group?
>
> Clearly not, or - just like anything else putting the security of a system
> at risk - only at explicit host admin request.
>

You're right.

After we discussed internally, we're intending to cover this simply 
since the case of shared RMRR is a rare case according to our previous 
experiences. Furthermore, Xen doesn't have a good existing API to 
directly assign this sort of group devices and even Xen doesn't identify 
these devices,  so currently we always assign devices one by one, right? 
This means we have to put more efforts to concern a good implementation 
to address something like, identification, atomic, hotplug and so on. 
Obviously, this would involve hypervisor and tools at the same time so 
this has a little bit of difficulty to work along with 4.6.

So could we do this separately?

#1. Phase 1 to 4.6

#1.1. Do a simple implementation

We just prevent from that device assignment if we're assigning this sort 
of group devices like this,

@@ -2291,6 +2291,16 @@ static int intel_iommu_assign_device(
               PCI_BUS(bdf) == bus &&
               PCI_DEVFN2(bdf) == devfn )
          {
+            if ( rmrr->scope.devices_cnt > 1 )
+            {
+                reassign_device_ownership(d, hardware_domain, devfn, pdev);
+                printk(XENLOG_G_ERR VTDPREFIX
+                       " cannot assign any device with RMRR for Dom%d 
(%d)\n",
+                       rmrr->base_address, rmrr->end_address,
+                       d->domain_id, ret);
+                ret = -EPERM;
+                break;
+            }
              ret = rmrr_identity_mapping(d, 1, rmrr, flag);
              if ( ret )
              {

Note this is just one draft code to show our idea. And I'm also 
concerning if we need to introduce a flag to bypass this to make sure we 
still have a approach to our original behavior.

#1.2. Post a design

We'd like to post a preliminary design to Xen community to get a better 
solution.

#2. Phase 2 after 4.6

Once the design is clear we will start writing patches to address this 
completely.

So any idea?

Thanks
Tiejun

  reply	other threads:[~2015-05-28  5:48 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-22  9:35 [RFC][v2][PATCH 00/14] Fix RMRR Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 01/14] tools: introduce some new parameters to set rdm policy Tiejun Chen
2015-06-02 15:57   ` Wei Liu
2015-06-03  1:35     ` Chen, Tiejun
2015-06-07 11:06       ` Wei Liu
2015-06-08  1:42         ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 02/14] introduce XENMEM_reserved_device_memory_map Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 03/14] tools/libxc: Expose new hypercall xc_reserved_device_memory_map Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 04/14] tools/libxl: detect and avoid conflicts with RDM Tiejun Chen
2015-06-02 16:29   ` Wei Liu
2015-06-03  2:25     ` Chen, Tiejun
2015-06-07 11:20       ` Wei Liu
2015-06-08  2:16         ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 05/14] xen/x86/p2m: introduce set_identity_p2m_entry Tiejun Chen
2015-05-28 12:27   ` Jan Beulich
2015-05-29  1:19     ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 06/14] xen:vtd: create RMRR mapping Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 07/14] xen/passthrough: extend hypercall to support rdm reservation policy Tiejun Chen
2015-05-22 10:33   ` Julien Grall
2015-05-25  2:09     ` Chen, Tiejun
2015-05-25 10:02       ` Julien Grall
2015-05-25 10:50         ` Chen, Tiejun
2015-05-25 11:42           ` Julien Grall
2015-05-26  0:42             ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 08/14] tools: extend xc_assign_device() " Tiejun Chen
2015-06-02 16:36   ` Wei Liu
2015-06-03  2:58     ` Chen, Tiejun
2015-06-07 11:27       ` Wei Liu
2015-06-09  5:42         ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 09/14] xen: enable XENMEM_memory_map in hvm Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 10/14] tools: extend XENMEM_set_memory_map Tiejun Chen
2015-05-22 10:25   ` Julien Grall
2015-05-25  2:00     ` Chen, Tiejun
2015-06-02 16:42   ` Wei Liu
2015-06-03  3:06     ` Chen, Tiejun
2015-05-22  9:35 ` [RFC][v2][PATCH 11/14] hvmloader: get guest memory map into memory_map[] Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 12/14] hvmloader/pci: skip reserved ranges Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 13/14] hvmloader/e820: construct guest e820 table Tiejun Chen
2015-05-22  9:35 ` [RFC][v2][PATCH 14/14] xen/vtd: enable USB device assignment Tiejun Chen
2015-05-22  9:46 ` [RFC][v2][PATCH 00/14] Fix RMRR Jan Beulich
2015-05-28  5:48   ` Chen, Tiejun [this message]
2015-05-28  7:55     ` Jan Beulich
2015-05-29  7:58       ` Chen, Tiejun

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=5566AC4B.1000701@intel.com \
    --to=tiejun.chen@intel.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=kevin.tian@intel.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=yang.z.zhang@intel.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 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.