From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Borntraeger Subject: Re: [PATCH 1/4] kvm-s390: add capability indicating COW support Date: Tue, 15 May 2012 14:38:30 +0200 Message-ID: <4FB24E46.1050600@de.ibm.com> References: <1337084128-38219-1-git-send-email-borntraeger@de.ibm.com> <1337084128-38219-2-git-send-email-borntraeger@de.ibm.com> <4FB24B11.1050607@redhat.com> <4FB24CB5.3070606@de.ibm.com> <4FB24D0D.7090707@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Marcelo Tossati , Carsten Otte , Alexander Graf , Jens Freimann , Cornelia Huck , Heiko Carstens , Martin Schwidefsky , Heinz Graalfs , KVM To: Avi Kivity Return-path: Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:41328 "EHLO e06smtp17.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932154Ab2EOMjN (ORCPT ); Tue, 15 May 2012 08:39:13 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 15 May 2012 13:39:11 +0100 Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q4FCcTcN2412762 for ; Tue, 15 May 2012 13:38:29 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q4FCUqlU031583 for ; Tue, 15 May 2012 08:30:52 -0400 In-Reply-To: <4FB24D0D.7090707@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 15/05/12 14:33, Avi Kivity wrote: > On 05/15/2012 03:31 PM, Christian Borntraeger wrote: >> On 15/05/12 14:24, Avi Kivity wrote: >>>> Newer systems allow to write-protect the guest backing memory >>>> and let the fault be delivered to the host, thus allowing COW. >>>> >>>> Use a capability bit to tell qemu if that is possible. >>>> >>> >>> Asking out of ignorance: who is doing the write protection here? The >>> guest? If so, why is qemu involved? >> >> It is about the host doing write protection of guest/user memory (e.g. for >> dirty pages tracking or KSM) > > Ok, so why does qemu^Wuserspace need to know about it? By default qemu will use MAP_PRIVATE for guest pages. This will write protect pages and thus break on s390 systems that dont support this feature. Therefore qemu has a hack to always use MAP_SHARED for s390. But MAP_SHARED has other problems (no dirty pages tracking, a lot more swap overhead etc.) With this feature qemu can use the standard qemu alloc if available, otherwise it will use the old s390 hack. I will put you on cc for the qemu patch :-) Christian