xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Tian, Kevin" <kevin.tian@intel.com>
To: "Zhang, Haozhong" <haozhong.zhang@intel.com>
Cc: Juergen Gross <jgross@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	"Nakajima, Jun" <jun.nakajima@intel.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Jan Beulich <jbeulich@suse.com>,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>
Subject: Re: [RFC Design Doc v2] Add vNVDIMM support for Xen
Date: Tue, 19 Jul 2016 00:58:46 +0000	[thread overview]
Message-ID: <AADFC41AFE54684AB9EE6CBC0274A5D15F908DFC@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <20160718090138.wgowwlw6g4fk72q2@hz-desktop>

> From: Zhang, Haozhong
> Sent: Monday, July 18, 2016 5:02 PM
> 
> On 07/18/16 16:36, Tian, Kevin wrote:
> > > From: Zhang, Haozhong
> > > Sent: Monday, July 18, 2016 8:29 AM
> > >
> > > Hi,
> > >
> > > Following is version 2 of the design doc for supporting vNVDIMM in
> > > Xen. It's basically the summary of discussion on previous v1 design
> > > (https://lists.xenproject.org/archives/html/xen-devel/2016-02/msg00006.html).
> > > Any comments are welcome. The corresponding patches are WIP.
> > >
> > > Thanks,
> > > Haozhong
> >
> > It's a very clear doc. Thanks a lot!
> >
> > >
> > > 4.2.2 Detection of Host pmem Devices
> > >
> > >  The detection and initialize host pmem devices require a non-trivial
> > >  driver to interact with the corresponding ACPI namespace devices,
> > >  parse namespace labels and make necessary recovery actions. Instead
> > >  of duplicating the comprehensive Linux pmem driver in Xen hypervisor,
> > >  our designs leaves it to Dom0 Linux and let Dom0 Linux report
> > >  detected host pmem devices to Xen hypervisor.
> > >
> > >  Our design takes following steps to detect host pmem devices when Xen
> > >  boots.
> > >  (1) As booting on bare metal, host pmem devices are detected by Dom0
> > >      Linux NVDIMM driver.
> > >
> > >  (2) Our design extends Linux NVDIMM driver to reports SPA's and sizes
> > >      of the pmem devices and reserved areas to Xen hypervisor via a
> > >      new hypercall.
> >
> > Does Linux need to provide reserved area to Xen? Why not leaving Xen
> > to decide reserved area within reported pmem regions and then return
> > reserved info to Dom0 NVDIMM driver to balloon out?
> >
> 
> NVDIMM can be used as a persistent storage like a disk drive, so the
> reservation should be done out of Xen and Dom0, for example, by an
> administrator who is expected to make necessary data backup in
> advance.

What prevents NVDIMM driver from reserving some region itself before
reporting to user space?

> 
> Therefore, dom0 linux actually reports (instead of providing) the
> reserved area to Xen, and the latter checks if the reserved area is
> large enough and (if yes) asks dom0 to balloon out the reserved area.

It looks non-intuitive since administrator doesn't know the actual requirement
of Xen. Then administrator has to guess and try. Even it finally works, the 
reserved size may not be optimal.

If Dom0 NVDIMM driver does reservation itself and notify Xen, at least there 
is a way for Xen to return a failure with required size and then at the 2nd time 
the NVDIMM driver can adjust the reservation as desired. 

Did I misunderstand the flow here?

> 
> > >
> > >  (3) Xen hypervisor then checks
> > >      - whether SPA and size of the newly reported pmem device is overlap
> > >        with any previously reported pmem devices;
> > >      - whether the reserved area can fit in the pmem device and is
> > >        large enough to hold page_info structs for itself.
> > >
> > >      If any checks fail, the reported pmem device will be ignored by
> > >      Xen hypervisor and hence will not be used by any
> > >      guests. Otherwise, Xen hypervisor will recorded the reported
> > >      parameters and create page_info structs in the reserved area.
> > >
> > >  (4) Because the reserved area is now used by Xen hypervisor, it
> > >      should not be accessible by Dom0 any more. Therefore, if a host
> > >      pmem device is recorded by Xen hypervisor, Xen will unmap its
> > >      reserved area from Dom0. Our design also needs to extend Linux
> > >      NVDIMM driver to "balloon out" the reserved area after it
> > >      successfully reports a pmem device to Xen hypervisor.
> >
> > Then both ndctl and Xen become source of requesting reserved area
> > to Linux NVDIMM driver. You don't need change ndctl as described in
> > 4.2.1. User can still use ndctl to reserve for Dom0's own purpose.
> >
> 
> I missed something here: Dom0 pmem driver should also prevent
> further operations on host namespace after it successfully reports to
> Xen. In this way, we can prevent uerspace tools like ndctl to break
> the host pmem device.
> 

yes, Dom0 driver is expected to reserve the region allocated for Xen.

Thanks
Kevin

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  reply	other threads:[~2016-07-19  0:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-18  0:29 [RFC Design Doc v2] Add vNVDIMM support for Xen Haozhong Zhang
2016-07-18  8:36 ` Tian, Kevin
2016-07-18  9:01   ` Zhang, Haozhong
2016-07-19  0:58     ` Tian, Kevin [this message]
2016-07-19  2:10       ` Zhang, Haozhong
2016-07-19  1:57 ` Bob Liu
2016-07-19  2:40   ` Haozhong Zhang
2016-08-02 14:46 ` Jan Beulich
2016-08-03  6:54   ` Haozhong Zhang
2016-08-03  8:45     ` Jan Beulich
2016-08-03  9:37       ` Haozhong Zhang
2016-08-03  9:47         ` Jan Beulich
2016-08-03 10:08           ` Haozhong Zhang
2016-08-03 10:18             ` Jan Beulich
2016-08-03 21:25 ` Konrad Rzeszutek Wilk
2016-08-03 23:16   ` Konrad Rzeszutek Wilk
2016-08-04  1:51     ` Haozhong Zhang
2016-08-04  8:52   ` Haozhong Zhang
2016-08-04  9:25     ` Jan Beulich
2016-08-04  9:35       ` Haozhong Zhang
2016-08-04 14:51         ` Konrad Rzeszutek Wilk
2016-08-04 14:51     ` Konrad Rzeszutek Wilk
2016-08-05  6:25       ` Haozhong Zhang
2016-08-05 13:29         ` Konrad Rzeszutek Wilk

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=AADFC41AFE54684AB9EE6CBC0274A5D15F908DFC@SHSMSX101.ccr.corp.intel.com \
    --to=kevin.tian@intel.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=haozhong.zhang@intel.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=sstabellini@kernel.org \
    --cc=wei.liu2@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).