From: Ingo Molnar <mingo@elte.hu>
To: Sasha Levin <levinsasha928@gmail.com>
Cc: penberg@kernel.org, asias.hejun@gmail.com,
prasadjoshi124@gmail.com, gorcunov@gmail.com,
kvm@vger.kernel.org, john@jfloren.net
Subject: Re: [PATCH 2/2] kvm tools: Add MMIO address mapper
Date: Tue, 17 May 2011 09:42:33 +0200 [thread overview]
Message-ID: <20110517074233.GH22305@elte.hu> (raw)
In-Reply-To: <1305615515-13913-2-git-send-email-levinsasha928@gmail.com>
* Sasha Levin <levinsasha928@gmail.com> wrote:
> When we have a MMIO exit, we need to find which device
> has registered to use the accessed MMIO space.
>
> The mapper maps ranges of guest physical addresses to
> callback functions.
>
> Implementation is based on an interval red-black tree.
>
> Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
> ---
> tools/kvm/include/kvm/kvm.h | 2 +
> tools/kvm/mmio.c | 79 +++++++++++++++++++++++++++++++++++++++++-
> 2 files changed, 79 insertions(+), 2 deletions(-)
>
> diff --git a/tools/kvm/include/kvm/kvm.h b/tools/kvm/include/kvm/kvm.h
> index b310d50..d9943bf 100644
> --- a/tools/kvm/include/kvm/kvm.h
> +++ b/tools/kvm/include/kvm/kvm.h
> @@ -44,6 +44,8 @@ void kvm__stop_timer(struct kvm *kvm);
> void kvm__irq_line(struct kvm *kvm, int irq, int level);
> bool kvm__emulate_io(struct kvm *kvm, u16 port, void *data, int direction, int size, u32 count);
> bool kvm__emulate_mmio(struct kvm *kvm, u64 phys_addr, u8 *data, u32 len, u8 is_write);
> +bool kvm__register_mmio(u64 phys_addr, u64 phys_addr_len, void (*kvm_mmio_callback_fn)(u64 addr, u8 *data, u32 len, u8 is_write));
> +bool kvm__deregister_mmio(u64 phys_addr);
>
> /*
> * Debugging
> diff --git a/tools/kvm/mmio.c b/tools/kvm/mmio.c
> index 848267d..fab6489 100644
> --- a/tools/kvm/mmio.c
> +++ b/tools/kvm/mmio.c
> @@ -1,7 +1,48 @@
> #include "kvm/kvm.h"
> +#include "kvm/interval-rbtree.h"
>
> #include <stdio.h>
> +#include <stdlib.h>
> +
> #include <linux/types.h>
> +#include <linux/rbtree.h>
> +
> +#define MMIO_NODE(n) container_of(n, struct mmio_mapping, node)
Please make this lowercase, mmio_node() or mmio_entry().
Other than that:
Acked-by: Ingo Molnar <mingo@elte.hu>
Thanks,
Ingo
next prev parent reply other threads:[~2011-05-17 7:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 6:58 [PATCH 1/2] kvm tools: Add interval red-black tree helper Sasha Levin
2011-05-17 6:58 ` [PATCH 2/2] kvm tools: Add MMIO address mapper Sasha Levin
2011-05-17 7:42 ` Ingo Molnar [this message]
2011-05-17 7:41 ` [PATCH 1/2] kvm tools: Add interval red-black tree helper Ingo Molnar
2011-05-17 7:55 ` Sasha Levin
2011-05-17 8:05 ` Ingo Molnar
2011-05-17 8:18 ` Pekka Enberg
2011-05-17 8:21 ` Sasha Levin
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=20110517074233.GH22305@elte.hu \
--to=mingo@elte.hu \
--cc=asias.hejun@gmail.com \
--cc=gorcunov@gmail.com \
--cc=john@jfloren.net \
--cc=kvm@vger.kernel.org \
--cc=levinsasha928@gmail.com \
--cc=penberg@kernel.org \
--cc=prasadjoshi124@gmail.com \
/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