Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751310AbdFFC4v (ORCPT ); Mon, 5 Jun 2017 22:56:51 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34006 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbdFFC4t (ORCPT ); Mon, 5 Jun 2017 22:56:49 -0400 Subject: Re: [Qemu-devel] [PATCH 0/7] KVM: MMU: fast write protect To: Jay Zhou , pbonzini@redhat.com, mtosatti@redhat.com, avi.kivity@gmail.com, rkrcmar@redhat.com Cc: Xiao Guangrong , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, qemu-devel@nongnu.org References: <20170503105224.19049-1-xiaoguangrong@tencent.com> <593509FB.3070605@huawei.com> From: Xiao Guangrong Message-ID: <7f5df260-63e3-7f7e-ff79-d2bc6fbf57f9@gmail.com> Date: Tue, 6 Jun 2017 10:56:55 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <593509FB.3070605@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1106 Lines: 37 On 06/05/2017 03:36 PM, Jay Zhou wrote: >> /* enable ucontrol for s390 */ >> struct kvm_s390_ucas_mapping { >> diff --git a/memory.c b/memory.c >> index 4c95aaf..b836675 100644 >> --- a/memory.c >> +++ b/memory.c >> @@ -809,6 +809,13 @@ static void address_space_update_ioeventfds(AddressSpace *as) >> flatview_unref(view); >> } >> >> +static write_protect_all_fn write_func; > > I think there should be a declaration in memory.h, > > diff --git a/include/exec/memory.h b/include/exec/memory.h > index 7fc3f48..31f3098 100644 > --- a/include/exec/memory.h > +++ b/include/exec/memory.h > @@ -1152,6 +1152,9 @@ void memory_global_dirty_log_start(void); > */ > void memory_global_dirty_log_stop(void); > > +typedef void (*write_protect_all_fn)(bool write); > +void memory_register_write_protect_all(write_protect_all_fn func); > + > void mtree_info(fprintf_function mon_printf, void *f); > Thanks for your suggestion, Jay! This code just demonstrates how to enable this feature in QEMU, i will carefully consider it and merger your suggestion when the formal patch is posted out.