From: Gleb Natapov <gleb@redhat.com>
To: Glauber Costa <glommer@redhat.com>
Cc: kvm@vger.kernel.org, avi@redhat.com
Subject: Re: [PATCH 6/9] remove kvm_in* functions
Date: Tue, 21 Jul 2009 09:11:06 +0300 [thread overview]
Message-ID: <20090721061106.GV5638@redhat.com> (raw)
In-Reply-To: <1248131416-11272-7-git-send-email-glommer@redhat.com>
On Mon, Jul 20, 2009 at 07:10:13PM -0400, Glauber Costa wrote:
> We can use plain qemu's here, and save a couple of lines/complexity.
> I'm leaving outb for later, because the SMM thing makes it a little bit
> less trivial.
>
I think you can remove all this black SMM magic from kvm_outb(). It is
handled in acpi.c now. Just booted WindowsXP with all this crap deleted.
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
> qemu-kvm.c | 25 ++++---------------------
> 1 files changed, 4 insertions(+), 21 deletions(-)
>
> diff --git a/qemu-kvm.c b/qemu-kvm.c
> index 26cac25..58d5de2 100644
> --- a/qemu-kvm.c
> +++ b/qemu-kvm.c
> @@ -97,24 +97,6 @@ static int kvm_debug(void *opaque, void *data,
> }
> #endif
>
> -static int kvm_inb(void *opaque, uint16_t addr, uint8_t *data)
> -{
> - *data = cpu_inb(0, addr);
> - return 0;
> -}
> -
> -static int kvm_inw(void *opaque, uint16_t addr, uint16_t *data)
> -{
> - *data = cpu_inw(0, addr);
> - return 0;
> -}
> -
> -static int kvm_inl(void *opaque, uint16_t addr, uint32_t *data)
> -{
> - *data = cpu_inl(0, addr);
> - return 0;
> -}
> -
> #define PM_IO_BASE 0xb000
>
> static int kvm_outb(void *opaque, uint16_t addr, uint8_t data)
> @@ -855,15 +837,16 @@ static int handle_io(kvm_vcpu_context_t vcpu)
> for (i = 0; i < run->io.count; ++i) {
> switch (run->io.direction) {
> case KVM_EXIT_IO_IN:
> + r = 0;
> switch (run->io.size) {
> case 1:
> - r = kvm_inb(kvm->opaque, addr, p);
> + *(uint8_t *)p = cpu_inb(kvm->opaque, addr);
> break;
> case 2:
> - r = kvm_inw(kvm->opaque, addr, p);
> + *(uint16_t *)p = cpu_inw(kvm->opaque, addr);
> break;
> case 4:
> - r = kvm_inl(kvm->opaque, addr, p);
> + *(uint32_t *)p = cpu_inl(kvm->opaque, addr);
> break;
> default:
> fprintf(stderr, "bad I/O size %d\n", run->io.size);
> --
> 1.6.2.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Gleb.
next prev parent reply other threads:[~2009-07-21 6:11 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-20 23:10 [PATCH 0/9] More integration with qemu.git Glauber Costa
2009-07-20 23:10 ` [PATCH 1/9] require --enable-kvm Glauber Costa
2009-07-20 23:10 ` [PATCH 2/9] embed kvm_create_context into kvm_init Glauber Costa
2009-07-20 23:10 ` [PATCH 3/9] change order of kvm_init call Glauber Costa
2009-07-20 23:10 ` [PATCH 4/9] use qemu version of kvm initialization Glauber Costa
2009-07-20 23:10 ` [PATCH 5/9] fold second pass " Glauber Costa
2009-07-20 23:10 ` [PATCH 6/9] remove kvm_in* functions Glauber Costa
2009-07-20 23:10 ` [PATCH 7/9] reuse env stop and stopped states Glauber Costa
2009-07-20 23:10 ` [PATCH 8/9] kvm_send_ipi Glauber Costa
2009-07-20 23:10 ` [PATCH 9/9] remove kvm_abi variable Glauber Costa
2009-07-21 6:11 ` Gleb Natapov [this message]
2009-07-21 12:23 ` [PATCH 6/9] remove kvm_in* functions Glauber Costa
2009-07-21 12:18 ` Gleb Natapov
2009-07-26 18:59 ` [PATCH 3/9] change order of kvm_init call Jan Kiszka
2009-07-27 17:38 ` Glauber Costa
2009-07-27 17:49 ` Anthony Liguori
2009-07-27 18:00 ` Glauber Costa
2009-07-27 18:10 ` Jan Kiszka
2009-07-27 18:20 ` Glauber Costa
2009-07-27 18:28 ` Daniel P. Berrange
2009-07-27 18:38 ` Glauber Costa
2009-07-27 18:44 ` Daniel P. Berrange
2009-07-27 19:55 ` Glauber Costa
2009-07-27 18:34 ` Anthony Liguori
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=20090721061106.GV5638@redhat.com \
--to=gleb@redhat.com \
--cc=avi@redhat.com \
--cc=glommer@redhat.com \
--cc=kvm@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.