From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH 4/4] hvmloader: add support to load extra ACPI tables from qemu Date: Wed, 20 Jan 2016 10:41:06 -0500 Message-ID: <20160120154106.GC1742@char.us.oracle.com> References: <569F575902000078000C8EDC@prv-mh.provo.novell.com> <569F4C2C.7040300@citrix.com> <20160120101526.GC4939@hz-desktop.sh.intel.com> <569F6336.2040104@linux.intel.com> <569F88AC.40100@citrix.com> <569F9DA5.7010903@citrix.com> <20160120145310.GF11445@hz-desktop.sh.intel.com> <20160120151312.GH24581@char.us.oracle.com> <20160120152902.GA6362@hz-desktop.sh.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20160120152902.GA6362@hz-desktop.sh.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Stefano Stabellini , Kevin Tian , Wei Liu , Ian Campbell , Jun Nakajima , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich , Xiao Guangrong , Keir Fraser , bob.liu@oracle.com List-Id: xen-devel@lists.xenproject.org > > > > Neither of these are sufficient however. That gets Qemu a mapping of > > > > the NVDIMM, not the guest. Something, one way or another, has to turn > > > > this into appropriate add-to-phymap hypercalls. > > > > > > > > > > Yes, those hypercalls are what I'm going to add. > > > > Why? > > > > What you need (in a rought hand-wave way) is to: > > - mount /dev/pmem0 > > - mmap the file on /dev/pmem0 FS > > - walk the VMA for the file - extract the MFN (machien frame numbers) > > Can this step be done by QEMU? Or does linux kernel provide some > approach for the userspace to do the translation? I don't know. I would think no - as you wouldn't want the userspace application to figure out the physical frames from the virtual address (unless they are root). But then if you look in /proc//maps and /proc//smaps there are some data there. Hm, /proc//pagemaps has something intersting See pagemap_read function. That looks to be doing it? > > Haozhong > > > - feed those frame numbers to xc_memory_mapping hypercall. The > > guest pfns would be contingous. > > Example: say the E820_NVDIMM starts at 8GB->16GB, so an 8GB file on > > /dev/pmem0 FS - the guest pfns are 0x200000 upward. > > > > However the MFNs may be discontingous as the NVDIMM could be an > > 1TB - and the 8GB file is scattered all over. > > > > I believe that is all you would need to do?