From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takuya Yoshikawa Subject: Re: [PATCH RFC v2 4/6] KVM: change mark_page_dirty() to handle endian issues explicitly Date: Tue, 20 Apr 2010 20:20:02 +0900 Message-ID: <4BCD8DE2.2070608@oss.ntt.co.jp> References: <20100420195349.dab60b1d.yoshikawa.takuya@oss.ntt.co.jp> <20100420200043.956302db.yoshikawa.takuya@oss.ntt.co.jp> <59610ECC-E995-45D2-86CB-E2B4FE4A864D@suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: avi@redhat.com, mtosatti@redhat.com, kvm@vger.kernel.org, kvm-ia64@vger.kernel.org, kvm-ppc@vger.kernel.org, fernando@oss.ntt.co.jp To: Alexander Graf Return-path: Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:47723 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753892Ab0DTLQp (ORCPT ); Tue, 20 Apr 2010 07:16:45 -0400 In-Reply-To: <59610ECC-E995-45D2-86CB-E2B4FE4A864D@suse.de> Sender: kvm-owner@vger.kernel.org List-ID: (2010/04/20 20:00), Alexander Graf wrote: > > On 20.04.2010, at 13:00, Takuya Yoshikawa wrote: > >> We are now using generic___set_le_bit() to make dirty bitmaps le. >> Though this works well, we have to replace __set_bit() to appropriate >> uaccess function to move dirty bitmaps to user space. So this patch >> splits generic___set_le_bit() and prepares for that. >> >> Signed-off-by: Takuya Yoshikawa >> Signed-off-by: Fernando Luis Vazquez Cao >> --- >> virt/kvm/kvm_main.c | 16 +++++++++++----- >> 1 files changed, 11 insertions(+), 5 deletions(-) >> >> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c >> index 6908304..66c4daf 100644 >> --- a/virt/kvm/kvm_main.c >> +++ b/virt/kvm/kvm_main.c >> @@ -1194,6 +1194,15 @@ int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len) >> } >> EXPORT_SYMBOL_GPL(kvm_clear_guest); >> >> +static int __mark_page_dirty(unsigned long nr, >> + unsigned long *dirty_bitmap) >> +{ >> +#ifdef __BIG_ENDIAN >> + nr = nr ^ BITOP_LE_SWIZZLE; > > Why an XOR here? Ah, might be my cut and paste mistake. I just copied from generic___set_le_bit(). > > Also is this LE set_bit new? I didn't see it when I did the patch back then :). Really? I need to check the git log then. This LE set_bit is not new I think. > > > Alex >