[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 4/4] hvmloader: add support to load extra ACPI tables from qemu



On 01/20/2016 11:41 PM, Konrad Rzeszutek Wilk wrote:
>>>>> 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)
>>

If I understand right, in this case the MFN is the block layout of the DAX-file?
If we find all the file blocks, then we get all the MFN.

>> Can this step be done by QEMU? Or does linux kernel provide some
>> approach for the userspace to do the translation?
> 

The ioctl(fd, FIBMAP, &block) may help, which can get the LBAs that a given 
file occupies. 

-Bob

> 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/<pid>/maps and /proc/<pid>/smaps there are some data there.
> 
> Hm, /proc/<pid>/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?

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.