* [Qemu-devel] Suggestion on 'virtio-pmem' implementation [not found] <47547641.10900867.1521001354668.JavaMail.zimbra@redhat.com> @ 2018-03-14 5:06 ` Pankaj Gupta 2018-03-14 13:14 ` David Hildenbrand 0 siblings, 1 reply; 3+ messages in thread From: Pankaj Gupta @ 2018-03-14 5:06 UTC (permalink / raw) To: Qemu Developers, kvm-devel Cc: Michael S. Tsirkin, David Hildenbrand, Dan Williams, Xiao Guangrong, Igor Mammedov, Stefan Hajnoczi, Paolo Bonzini, Rik van Riel, Pankaj Gupta Hi, I am implementing 'virtio-pmem' as a mechanism to flush guest writes with 'fake DAX' flushing interface. Below is the high level details of components: 1] 'virtio-pmem' device expose guest physical address details(start, len). 2] 'virtio-pmem' driver in guest discovers this information and configures 'libnvdimm'. Guest 'pmem' driver works on this memory range. 3] Guest 'pmem' driver uses 'virtio-pmem' PV driver to send flush commands. I need suggestion implementing part 1] * When tried with 'hotplug_memory.base' address as guest physical address, I am facing 'EPT_MISCONFIG' errors when pmem does mkfs. After digging more it looks like address range I am using as guest physical address is either already mapped as MMIO or reserved. Though Guest hot-plugs this physical address into its virtual memory range when guest tries to read/write the memory KVM cannot translate the address and throw 'EPT_MISCONFIG' error. * While I am trying to get the appropriate guest physical address which is free, I could see memory 'pc_dimm_memory_plug' code has a function 'pc_dimm_get_free_addr' which works with 'PC DIMM' class. As I am using 'VIRTIO', there is no way AFAIK this function can be used by VIRTIO or my PV device code. I need ideas to get the free guest physical address from my PV device code so that we can use this range in guest address space. Find below pointer to previous discussion: https://marc.info/?l=kvm&m=151629709903946&w=2 Thanks, Pankaj ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Suggestion on 'virtio-pmem' implementation 2018-03-14 5:06 ` [Qemu-devel] Suggestion on 'virtio-pmem' implementation Pankaj Gupta @ 2018-03-14 13:14 ` David Hildenbrand 2018-03-15 5:40 ` Pankaj Gupta 0 siblings, 1 reply; 3+ messages in thread From: David Hildenbrand @ 2018-03-14 13:14 UTC (permalink / raw) To: Pankaj Gupta Cc: Qemu Developers, kvm-devel, Michael S. Tsirkin, David Hildenbrand, Dan Williams, Xiao Guangrong, Igor Mammedov, Stefan Hajnoczi, Paolo Bonzini, Rik van Riel Hi Pankaj, I have a prototype (new one for virtio-mem I was working on over the last weeks) for exactly what you need. I basically factored out the notion of a memory device. So also virtio devices can be memory devices and get recognized e.g. in formerly known pc_dimm_get_free_address(), so it works out nicely with ordinary memory hotplug and such. Guess your main problem right now is that you don‘t create a memory slot properly. But I also have code for that that you can built onto. I‘m right now in Sri Lanka on vacation, I‘ll be back on 23. September and will send you the link to a branch with the prototype asap. Thanks, David / dhildenb / david@redhat.com Von meinem iPhone gesendet > Am 14.03.2018 um 10:36 schrieb Pankaj Gupta <pagupta@redhat.com>: > > > > Hi, > > > I am implementing 'virtio-pmem' as a mechanism to > flush guest writes with 'fake DAX' flushing interface. > > Below is the high level details of components: > > 1] 'virtio-pmem' device expose guest physical address > details(start, len). > > 2] 'virtio-pmem' driver in guest discovers this > information and configures 'libnvdimm'. Guest 'pmem' > driver works on this memory range. > > 3] Guest 'pmem' driver uses 'virtio-pmem' PV driver to > send flush commands. > > > I need suggestion implementing part 1] > > * When tried with 'hotplug_memory.base' address as guest physical > address, I am facing 'EPT_MISCONFIG' errors when pmem does mkfs. > After digging more it looks like address range I am using as guest > physical address is either already mapped as MMIO or reserved. > Though Guest hot-plugs this physical address into its virtual > memory range when guest tries to read/write the memory KVM cannot > translate the address and throw 'EPT_MISCONFIG' error. > > * While I am trying to get the appropriate guest physical address > which is free, I could see memory 'pc_dimm_memory_plug' code > has a function 'pc_dimm_get_free_addr' which works with 'PC DIMM' > class. As I am using 'VIRTIO', there is no way AFAIK this function > can be used by VIRTIO or my PV device code. > > > I need ideas to get the free guest physical address from my PV > device code so that we can use this range in guest address space. > > Find below pointer to previous discussion: > > https://marc.info/?l=kvm&m=151629709903946&w=2 > > Thanks, > Pankaj > ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] Suggestion on 'virtio-pmem' implementation 2018-03-14 13:14 ` David Hildenbrand @ 2018-03-15 5:40 ` Pankaj Gupta 0 siblings, 0 replies; 3+ messages in thread From: Pankaj Gupta @ 2018-03-15 5:40 UTC (permalink / raw) To: David Hildenbrand Cc: Qemu Developers, kvm-devel, Michael S. Tsirkin, David Hildenbrand, Dan Williams, Xiao Guangrong, Igor Mammedov, Stefan Hajnoczi, Paolo Bonzini, Rik van Riel Hi David, > > Hi Pankaj, > > I have a prototype (new one for virtio-mem I was working on over the last > weeks) for exactly what you need. I basically factored out the notion of a > memory device. So also virtio devices can be memory devices and get > recognized e.g. in formerly known pc_dimm_get_free_address(), so it works > out nicely with ordinary memory hotplug and such. Nice. This is very useful re-factoring. > > Guess your main problem right now is that you don‘t create a memory slot > properly. But I also have code for that that you can built onto. sure. > > I‘m right now in Sri Lanka on vacation, I‘ll be back on 23. September and > will send you the link to a branch with the prototype asap. Cool. Enjoy your vacation and thanks for the reply. Best regards, Pankaj > > Thanks, > > David / dhildenb / david@redhat.com > > Von meinem iPhone gesendet > > > Am 14.03.2018 um 10:36 schrieb Pankaj Gupta <pagupta@redhat.com>: > > > > > > > > Hi, > > > > > > I am implementing 'virtio-pmem' as a mechanism to > > flush guest writes with 'fake DAX' flushing interface. > > > > Below is the high level details of components: > > > > 1] 'virtio-pmem' device expose guest physical address > > details(start, len). > > > > 2] 'virtio-pmem' driver in guest discovers this > > information and configures 'libnvdimm'. Guest 'pmem' > > driver works on this memory range. > > > > 3] Guest 'pmem' driver uses 'virtio-pmem' PV driver to > > send flush commands. > > > > > > I need suggestion implementing part 1] > > > > * When tried with 'hotplug_memory.base' address as guest physical > > address, I am facing 'EPT_MISCONFIG' errors when pmem does mkfs. > > After digging more it looks like address range I am using as guest > > physical address is either already mapped as MMIO or reserved. > > Though Guest hot-plugs this physical address into its virtual > > memory range when guest tries to read/write the memory KVM cannot > > translate the address and throw 'EPT_MISCONFIG' error. > > > > * While I am trying to get the appropriate guest physical address > > which is free, I could see memory 'pc_dimm_memory_plug' code > > has a function 'pc_dimm_get_free_addr' which works with 'PC DIMM' > > class. As I am using 'VIRTIO', there is no way AFAIK this function > > can be used by VIRTIO or my PV device code. > > > > > > I need ideas to get the free guest physical address from my PV > > device code so that we can use this range in guest address space. > > > > Find below pointer to previous discussion: > > > > https://marc.info/?l=kvm&m=151629709903946&w=2 > > > > Thanks, > > Pankaj > > > ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-03-15 5:40 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <47547641.10900867.1521001354668.JavaMail.zimbra@redhat.com> 2018-03-14 5:06 ` [Qemu-devel] Suggestion on 'virtio-pmem' implementation Pankaj Gupta 2018-03-14 13:14 ` David Hildenbrand 2018-03-15 5:40 ` Pankaj Gupta
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).