Re: [Qemu-devel] [PATCH RFC 0/1] KVM: ioctl for reading/writing guest memory

2015-02-03 Thread Christian Borntraeger
Am 03.02.2015 um 13:59 schrieb Paolo Bonzini:
 
 
 On 03/02/2015 13:11, Thomas Huth wrote:
 The userspace (QEMU) then can simply call this ioctl when it wants
 to read or write from/to virtual guest memory. Then kernel then takes
 the IPTE-lock, walks the MMU table of the guest to find out the
 physical address that corresponds to the virtual address, copies
 the requested amount of bytes from the userspace buffer to guest
 memory or the other way round, and finally frees the IPTE-lock again.

 Does that sound like a viable solution (IMHO it does ;-))? Or should
 I maybe try to pursue another approach?
 
 It looks feasible to me as well.

Yes, we discussed this internally a lot and things are really tricky. The
ipte lock could be exported to userspace, but we might also need to handle
storage keys (and key protection) in an atomic fashion, so this really
looks like the only safe way.
I guess we will give it some more testing, but to me it looks like a good
candidate for kvm/next after 3.20-rc1.


Christian




Re: [Qemu-devel] [PATCH RFC 0/1] KVM: ioctl for reading/writing guest memory

2015-02-03 Thread Paolo Bonzini


On 03/02/2015 13:11, Thomas Huth wrote:
 The userspace (QEMU) then can simply call this ioctl when it wants
 to read or write from/to virtual guest memory. Then kernel then takes
 the IPTE-lock, walks the MMU table of the guest to find out the
 physical address that corresponds to the virtual address, copies
 the requested amount of bytes from the userspace buffer to guest
 memory or the other way round, and finally frees the IPTE-lock again.
 
 Does that sound like a viable solution (IMHO it does ;-))? Or should
 I maybe try to pursue another approach?

It looks feasible to me as well.

Paolo