From: Takuya Yoshikawa <yoshikawa.takuya-gVGce1chcLdL9jVzuh4AOg@public.gmane.org>
To: avi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
agraf-l3A5Bk7waGM@public.gmane.org
Cc: kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [RFC please check] KVM: question about the commit "Use Little Endian for Dirty Bitmap"
Date: Wed, 21 Apr 2010 17:45:32 +0900 [thread overview]
Message-ID: <4BCEBB2C.4040700@oss.ntt.co.jp> (raw)
In-Reply-To: <20100421150720.16516cb7.yoshikawa.takuya-gVGce1chcLdL9jVzuh4AOg@public.gmane.org>
(2010/04/21 15:07), Takuya Yoshikawa wrote:
> === not tested ===
> [PATCH sample] KVM: avoid to include an asm-generic bitops header file directly
>
> Including asm-generic bitops headers is kind of violation: there is no guarantee that
> no one will change those functions we are using.
>
> Signed-off-by: Takuya Yoshikawa<yoshikawatky-V2f5J/ArDKdQWUn/WH5d2uJTCWgwaB5pzw2xav70ESE@public.gmane.org>
Oh, I forgot to drop this line: this is made on my machine with not configured git.
Please ignore this Signed-off-by, the address is not valid.
> ---
> virt/kvm/kvm_main.c | 17 +++++++++++++----
> 1 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 3725605..f029760 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -51,7 +51,6 @@
> #include<asm/io.h>
> #include<asm/uaccess.h>
> #include<asm/pgtable.h>
> -#include<asm-generic/bitops/le.h>
>
> #include "coalesced_mmio.h"
>
> @@ -1179,6 +1178,18 @@ int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len)
> }
> EXPORT_SYMBOL_GPL(kvm_clear_guest);
>
> +/*
> + * __set_le_bit is defined for ppc only.
> + */
> +static void kvm___set_le_bit(unsigned long nr, unsigned long *addr)
> +{
> +#ifdef __set_le_bit
> + __set_le_bit(nr, addr);
> +#else
> + __set_bit(nr, addr);
> +#endif
> +}
> +
> void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
> {
> struct kvm_memory_slot *memslot;
> @@ -1188,9 +1199,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn)
> if (memslot&& memslot->dirty_bitmap) {
> unsigned long rel_gfn = gfn - memslot->base_gfn;
>
> - /* avoid RMW */
> - if (!generic_test_le_bit(rel_gfn, memslot->dirty_bitmap))
> - generic___set_le_bit(rel_gfn, memslot->dirty_bitmap);
> + kvm___set_le_bit(rel_gfn, memslot->dirty_bitmap);
> }
> }
>
next prev parent reply other threads:[~2010-04-21 8:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-21 6:07 [RFC please check] KVM: question about the commit "Use Little Endian for Dirty Bitmap" Takuya Yoshikawa
[not found] ` <20100421150720.16516cb7.yoshikawa.takuya-gVGce1chcLdL9jVzuh4AOg@public.gmane.org>
2010-04-21 8:45 ` Takuya Yoshikawa [this message]
2010-04-21 9:26 ` Avi Kivity
[not found] ` <4BCEC4AD.6060305-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2010-04-21 9:32 ` Alexander Graf
[not found] ` <F5C06DB2-AECA-4E05-8B58-74576B65D800-l3A5Bk7waGM@public.gmane.org>
2010-04-22 4:12 ` Takuya Yoshikawa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BCEBB2C.4040700@oss.ntt.co.jp \
--to=yoshikawa.takuya-gvgce1chcldl9jvzuh4aog@public.gmane.org \
--cc=agraf-l3A5Bk7waGM@public.gmane.org \
--cc=avi-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox