On Tue, 21 Apr 2015 21:48:02 +0200 Christian Borntraeger <borntrae...@de.ibm.com> wrote:
> Am 21.04.2015 um 21:36 schrieb Alexander Graf: > > On 04/21/2015 09:34 PM, Christian Borntraeger wrote: > >> Am 21.04.2015 um 21:12 schrieb Alexander Graf: > >>> On 04/20/2015 04:55 PM, Christian Borntraeger wrote: > >>>> Am 09.04.2015 um 10:51 schrieb Cornelia Huck: > >>>>> From: Thomas Huth <th...@linux.vnet.ibm.com> > >>>>> > >>>>> Add code to make use of the new ioctl for reading from / writing to > >>>>> virtual guest memory. By using the ioctl, the memory accesses are now > >>>>> protected with the so-called ipte-lock in the kernel. > >>>>> > >>>>> Signed-off-by: Thomas Huth <th...@linux.vnet.ibm.com> > >>>>> Signed-off-by: Cornelia Huck <cornelia.h...@de.ibm.com> > >>>> Acked-by: Christian Borntraeger <borntrae...@de.ibm.com> > >>>>> @@ -450,6 +450,15 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr > >>>>> laddr, void *hostbuf, > >>>>> target_ulong *pages; > >>>>> int ret; > >>>>> > >>>>> + if (kvm_enabled()) { > >>>>> + ret = kvm_s390_mem_op(cpu, laddr, hostbuf, len, is_write); > >>>>> + if (ret >= 0) { > >>>>> + return ret; > >>>>> + } else if (ret != -ENOSYS) { > >>>>> + error_printf("kvm_s390_mem_op() failed: %s\n", > >>>>> strerror(-ret)); > >>> Won't this spill the logs like crazy when running new qemu on old kernels? > >> kvm_s390_mem_op will return -ENOSYS if cap_mem_op is not set. > > > > Oh, I see the logic now. Can you think of any way to make it more obvious > > to a reader what's going on? > > > We could move the error_printf into kvm_s390_mem_op. > Well Conny has to do it as Thomas has left IBM. I can certainly do that, if that makes the code easier to follow.