All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Yang Z" <yang.z.zhang@intel.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "Chen, Tiejun" <tiejun.chen@intel.com>,
	"Tian, Kevin" <kevin.tian@intel.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [v6][PATCH 2/2] xen:vtd: missing RMRR mapping while share EPT
Date: Thu, 25 Sep 2014 01:53:06 +0000	[thread overview]
Message-ID: <A9667DDFB95DB7438FA9D7D576C3D87E0AB9B238@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <5422A08C020000780003814F@mail.emea.novell.com>

Jan Beulich wrote on 2014-09-24:
> >>> On 24.09.14 at 10:23, <yang.z.zhang@intel.com> wrote:
> > Since we still have arguments on the whole RMRR patch set, so I list the
> > existing RMRR problem to make sure all of us on the same page. And then we
> > can have a discussion on how to solve them perfectly. I also give my
> > suggestion but it may not be the best solution. Also, if there is any missing
> > problem, please tell me.
> 
> Thanks for doing this; it looks complete to me (except for lacking an
> explicit statement on the consequences of some of the changes).
> 
> > 1. RMRR region isn't reserved in guest e820 table and guest is able to touch
> > it.
> >
> > Possible solution: set RMRR region as reserved in guest e820 table and
> > create identity map in EPT and VT-d page table.
> 
> And relocate guest RAM accordingly.

ok. Let's look into more detail:
1. Whether there has device assigned or not, the RMRR mapping must be created when building e820 table if the VT-d is enabled.
2. Despite of share or non-share case, the RMRR region must be identity map in EPT and VT-d page table.
3. Tiejun's patch uses hypercall to get the RMRR info, is it ok? Or should we get it from xenstore, and then both tools and hvmloader can access it?

> 
> > 2. RMRR region may conflict with MMIO.
> >
> > Possible solution: Refuse to assign device or reallocate the MMIO.
> 
> "Reallocate" is perhaps the wrong term here: Since the allocation of
> MMIO resources happens in hvmloader, it's really that this allocation
> needs to be done with the RMRRs in mind from the beginning.

Yes, you are right.

> 
> > 3. RMRR region isn't checked when updating EPT table and VT-d table.
> >
> > Possible solution: Return error when trying to update EPT and VT-d table if
> > the gfn is inside RMRR region.

So just do a simple check in EPT table and VT-d table updating is ok?

> >
> > 4. RMRR region isn't setup in page table in sharing EPT case.
> >
> > Tiejun's two patches are able to fix this issue.
> >
> > 5. rmrr_identity_mapping() blindly overwrites what may already be in the
> > page tables(EPT table in share case and VT-table in non-share case).
> >
> > Possible solution: Actually, it should be same to issue 1. If RMRR region is
> > reserved in guest e820 table, guest should not touch it. Otherwise, any
> > unpredictable behavior to guest is acceptable.
> 
> This leaves aside that not all updates are necessarily caused by
> guest activity (i.e. qemu and the tool stack could affect such too).

Yes, but qemu and tool stack should not touch the memory marked as reserved in e820. They should only touch the memory that they know.

> 
> > 6. Live migration with RMRR region and hotplug.
> >
> > Possible solution: Do the checking in tool stack: If the device which
> > requires RMRR but the corresponding region is not reserved in guest e820 or
> > have overlap with MMIO, then refuse to do the hotplug.
> >
> > One question, should we fix all of them at once or can we fix them one by
> > one based on severity? For example, the issue 6 happens rarely and I think we
> > can leave it after Xen 4.5.
> 
> I really only see two routes for 4.5: Either fix everything properly
> or disallow assignment of devices associated with RMRRs altogether
> (with log messages clearly pointing to an override command line
> option).

Ok. It makes sense. Do you think it possible to cacth the Xen 4.5 if everything is fixed properly?

> 
> Jan


Best regards,
Yang

  reply	other threads:[~2014-09-25  1:53 UTC|newest]

Thread overview: 84+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <541FB087.4080008@intel.com>
2014-09-22  5:46 ` [v6][PATCH 2/2] xen:vtd: missing RMRR mapping while share EPT Chen, Tiejun
2014-09-22  8:53   ` Jan Beulich
2014-09-22  9:05     ` Chen, Tiejun
2014-09-22 10:36       ` Jan Beulich
2014-09-23  1:56         ` Chen, Tiejun
2014-09-23 12:14           ` Jan Beulich
2014-09-24  0:28             ` Tian, Kevin
2014-09-24  7:54               ` Jan Beulich
2014-09-24  8:23           ` Zhang, Yang Z
2014-09-24  8:35             ` Chen, Tiejun
2014-09-24  8:47               ` Jan Beulich
2014-09-24  8:53                 ` Chen, Tiejun
2014-09-24  9:13                   ` Jan Beulich
2014-09-25  2:30                     ` Zhang, Yang Z
2014-09-25  8:11                       ` Jan Beulich
2014-09-26  1:24                         ` Zhang, Yang Z
2014-09-26  6:38                           ` Jan Beulich
2014-09-30  3:49                             ` Zhang, Yang Z
2014-09-30  7:07                               ` Jan Beulich
2014-10-02 10:29                                 ` Tim Deegan
2014-10-03 21:15                                   ` Tian, Kevin
2014-09-24  8:44             ` Jan Beulich
2014-09-25  1:53               ` Zhang, Yang Z [this message]
2014-09-25  8:08                 ` Jan Beulich
2014-09-25 14:12                   ` Konrad Rzeszutek Wilk
2014-09-25 15:14                     ` Jan Beulich
2014-09-26 13:55                       ` Discussion on whether to continue with the patches for Xen 4.5 " Konrad Rzeszutek Wilk
2014-09-26 15:05                         ` Jan Beulich
2014-09-29  1:26                         ` Zhang, Yang Z
2014-09-29  9:16                           ` Pasi Kärkkäinen
2014-09-29 16:14                           ` Konrad Rzeszutek Wilk
2014-09-29 16:40                             ` Konrad Rzeszutek Wilk
2014-09-30  2:56                             ` Zhang, Yang Z
2014-09-28  3:11                   ` Chen, Tiejun
2014-09-30  3:51                   ` Zhang, Yang Z
2014-09-30  7:09                     ` Jan Beulich
2014-07-30  1:36 [v6][PATCH 1/2] xen:x86:mm:p2m: introduce set_identity_p2m_entry Tiejun Chen
2014-07-30  1:36 ` [v6][PATCH 2/2] xen:vtd: missing RMRR mapping while share EPT Tiejun Chen
2014-07-30  8:36   ` Jan Beulich
2014-07-30  8:59     ` Chen, Tiejun
2014-07-30  9:23       ` Jan Beulich
2014-07-30  9:40         ` Chen, Tiejun
2014-07-30 10:25           ` Jan Beulich
2014-07-30 10:40             ` Chen, Tiejun
2014-07-30 10:47               ` Jan Beulich
2014-07-31  9:45                 ` Chen, Tiejun
2014-07-31 22:44                   ` Tian, Kevin
2014-08-01  2:07                     ` Chen, Tiejun
2014-08-01  6:51                   ` Jan Beulich
2014-08-01  7:10                     ` Chen, Tiejun
2014-08-01  7:21                       ` Jan Beulich
2014-08-01  9:50                         ` Chen, Tiejun
2014-08-01 13:47                           ` Jan Beulich
2014-08-01 23:22                             ` Tian, Kevin
2014-08-04  7:23                               ` Jan Beulich
2014-08-03  8:04                             ` Chen, Tiejun
2014-08-04  7:31                               ` Jan Beulich
2014-08-07 10:59                                 ` Chen, Tiejun
2014-09-03  9:41                                 ` Chen, Tiejun
2014-09-03  9:54                                   ` Jan Beulich
2014-09-12  6:38                                     ` Chen, Tiejun
2014-09-12  7:19                                       ` Jan Beulich
2014-09-12  8:27                                         ` Chen, Tiejun
2014-09-12 16:59                                           ` Lars Kurth
2014-09-12 21:26                                             ` Tim Deegan
2014-09-16  1:24                                               ` Chen, Tiejun
2014-09-17  1:01                                                 ` Chen, Tiejun
2014-09-17  2:42                                                   ` Tian, Kevin
2014-09-17  9:21                                                     ` Jan Beulich
2014-09-18  2:02                                                       ` Zhang, Yang Z
2014-09-18  7:24                                                         ` Jan Beulich
2014-09-18  7:41                                                           ` Zhang, Yang Z
2014-09-18  8:12                                                             ` Jan Beulich
2014-09-17  9:18                                                   ` Jan Beulich
2014-09-18  9:09   ` Jan Beulich
2014-09-19  1:20     ` Chen, Tiejun
2014-09-19  6:26       ` Jan Beulich
2014-09-19  6:50         ` Chen, Tiejun
2014-09-19  7:10           ` Jan Beulich
2014-09-19  7:40             ` Chen, Tiejun
2014-09-19  8:06               ` Jan Beulich
2014-09-19  8:30                 ` Chen, Tiejun
2014-09-19  9:26                   ` Jan Beulich
2014-09-19  2:43     ` Zhang, Yang Z
2014-09-19  6:33       ` Jan Beulich

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=A9667DDFB95DB7438FA9D7D576C3D87E0AB9B238@SHSMSX104.ccr.corp.intel.com \
    --to=yang.z.zhang@intel.com \
    --cc=JBeulich@suse.com \
    --cc=kevin.tian@intel.com \
    --cc=tiejun.chen@intel.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 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.