From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mario Smarduch Subject: Re: [RESEND PATCH v7 3/4] arm: dirty log write protect management support Date: Wed, 11 Jun 2014 20:02:52 -0700 Message-ID: <5399185C.3010503@samsung.com> References: <1401837567-5527-1-git-send-email-m.smarduch@samsung.com> <1402076021-9425-1-git-send-email-m.smarduch@samsung.com> <20140608120522.GG3279@lvm> <539663A0.9080507@samsung.com> <20140610092240.GF1388@lvm> <53974998.70001@samsung.com> <20140611070352.GC24286@lvm> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Christoffer Dall , kvmarm@lists.cs.columbia.edu, marc.zyngier@arm.com, xiaoguangrong@linux.vnet.ibm.com, steve.capper@arm.com, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, gavin.guo@canonical.com, peter.maydell@linaro.org, jays.lee@samsung.com, sungjinn.chung@samsung.com To: Paolo Bonzini Return-path: Received: from mailout1.w2.samsung.com ([211.189.100.11]:32101 "EHLO usmailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754452AbaFLDCz (ORCPT ); Wed, 11 Jun 2014 23:02:55 -0400 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N7100G6GCGTVHA0@mailout1.w2.samsung.com> for kvm@vger.kernel.org; Wed, 11 Jun 2014 23:02:53 -0400 (EDT) In-reply-to: <20140611070352.GC24286@lvm> Sender: kvm-owner@vger.kernel.org List-ID: Hi Paolo, for ARM dirty page logging we have couple functions that are generic. - kvm_vm_ioctl_get_dirty_log - is identical to x86 version - kvm_flush_remote_tlbs - ARM version does hardware broadcast it's different from the generic one in kvm_main.c How to proceed to make these generic? Please see below from Christoffer. Current patch moves kvm_vm_ioctl_get_dirty_log() into kvm_main.c and labels it and kvm_flush_remote_tlbs weak. Please advise. Thanks, - Mario > So I don't see a lot of use of weak symbols in kvm_main.c (actually on > kvmarm/next I don't see any), but we do want to share code when more > than one architecture implements something in the exact same way, like > it seems x86 and ARM is doing here for this particular function. > > I think the KVM scheme is usually to check for some define, like: > > #ifdef KVM_ARCH_HAVE_GET_DIRTY_LOG > ret = kvm_arch_get_dirty_log(...); > #else > ret = kvm_get_dirty_log(...); > #endif > > but Paolo may have a more informed oppinion of how to deal with these. > > Thanks, > -Christoffer >