Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-17 Thread Avi Kivity
On 10/16/2012 10:03 PM, Anthony Liguori wrote: This forces userspace to dedicate a thread for the HPT. If no changes are available, does read return a size 0? I don't think it's necessary to support polling. The kernel should always be able to respond to userspace here. The only catch

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-17 Thread Avi Kivity
On 10/16/2012 11:52 PM, Paul Mackerras wrote: On Tue, Oct 16, 2012 at 03:06:33PM +0200, Avi Kivity wrote: On 10/16/2012 01:58 PM, Paul Mackerras wrote: On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: Does/should the fd support O_NONBLOCK and poll? (=waiting for an entry to

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Avi Kivity
On 10/16/2012 06:01 AM, Paul Mackerras wrote: A new ioctl, KVM_PPC_GET_HTAB_FD, returns a file descriptor. Reads on this fd return the contents of the HPT (hashed page table), writes create and/or remove entries in the HPT. There is a new capability, KVM_CAP_PPC_HTAB_FD, to indicate the

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Paul Mackerras
On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: On 10/16/2012 06:01 AM, Paul Mackerras wrote: +4.78 KVM_PPC_GET_HTAB_FD + +Capability: KVM_CAP_PPC_HTAB_FD +Architectures: powerpc +Type: vm ioctl +Parameters: Pointer to struct kvm_get_htab_fd (in) +Returns: file

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Avi Kivity
On 10/16/2012 01:58 PM, Paul Mackerras wrote: On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: On 10/16/2012 06:01 AM, Paul Mackerras wrote: +4.78 KVM_PPC_GET_HTAB_FD + +Capability: KVM_CAP_PPC_HTAB_FD +Architectures: powerpc +Type: vm ioctl +Parameters: Pointer to struct

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Anthony Liguori
Avi Kivity a...@redhat.com writes: On 10/16/2012 01:58 PM, Paul Mackerras wrote: On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: On 10/16/2012 06:01 AM, Paul Mackerras wrote: +4.78 KVM_PPC_GET_HTAB_FD + +Capability: KVM_CAP_PPC_HTAB_FD +Architectures: powerpc +Type: vm

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-16 Thread Paul Mackerras
On Tue, Oct 16, 2012 at 03:06:33PM +0200, Avi Kivity wrote: On 10/16/2012 01:58 PM, Paul Mackerras wrote: On Tue, Oct 16, 2012 at 12:06:58PM +0200, Avi Kivity wrote: Does/should the fd support O_NONBLOCK and poll? (=waiting for an entry to change). No. This forces userspace to

[PATCH 5/5] KVM: PPC: Book3S HV: Provide a method for userspace to read and write the HPT

2012-10-15 Thread Paul Mackerras
A new ioctl, KVM_PPC_GET_HTAB_FD, returns a file descriptor. Reads on this fd return the contents of the HPT (hashed page table), writes create and/or remove entries in the HPT. There is a new capability, KVM_CAP_PPC_HTAB_FD, to indicate the presence of the ioctl. The ioctl takes an argument