qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Hollis Blanchard" <hollis@penguinppc.org>
To: qemu-devel@nongnu.org
Cc: kvm-ppc@vger.kernel.org, Glauber Costa <glommer@redhat.com>,
	Avi Kivity <avi@redhat.com>, kvm-devel <kvm@vger.kernel.org>,
	Anthony Liguori <aliguori@us.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] Add KVM support to QEMU
Date: Tue, 28 Oct 2008 15:49:26 -0500	[thread overview]
Message-ID: <fb412d760810281349q2572acf0j4a3f5eff9e8a55a4@mail.gmail.com> (raw)
In-Reply-To: <1225224814-9875-3-git-send-email-aliguori@us.ibm.com>

Just a quick skim...

On Tue, Oct 28, 2008 at 3:13 PM, Anthony Liguori <aliguori@us.ibm.com> wrote:
> +int kvm_cpu_exec(CPUState *env)
> +{
> +    struct kvm_run *run = env->kvm_run;
> +    int ret;
> +
> +    dprintf("kvm_cpu_exec()\n");
> +
> +    do {
> +        kvm_arch_pre_run(env, run);
> +
> +        if ((env->interrupt_request & CPU_INTERRUPT_EXIT)) {
> +            dprintf("interrupt exit requested\n");
> +            ret = 0;
> +            break;
> +        }
> +
> +        dprintf("setting tpr\n");
> +        run->cr8 = cpu_get_apic_tpr(env);

This belongs in the arch_pre_run hook above.

> +        ret = kvm_vcpu_ioctl(env, KVM_RUN, 0);
> +        kvm_arch_post_run(env, run);
> +
> +        if (ret == -EINTR || ret == -EAGAIN) {
> +            dprintf("io window exit\n");
> +            ret = 0;
> +            break;
> +        }
> +
> +        if (ret < 0) {
> +            dprintf("kvm run failed %s\n", strerror(-ret));
> +            abort();
> +        }
> +
> +        ret = 0; /* exit loop */
> +        switch (run->exit_reason) {
> +        case KVM_EXIT_IO:
> +            dprintf("handle_io\n");
> +            ret = kvm_handle_io(env, run->io.port,
> +                                (uint8_t *)run + run->io.data_offset,
> +                                run->io.direction,
> +                                run->io.size,
> +                                run->io.count);
> +            break;
> +        case KVM_EXIT_MMIO:
> +            dprintf("handle_mmio\n");
> +            cpu_physical_memory_rw(run->mmio.phys_addr,
> +                                   run->mmio.data,
> +                                   run->mmio.len,
> +                                   run->mmio.is_write);
> +            ret = 1;
> +            break;
> +        case KVM_EXIT_IRQ_WINDOW_OPEN:
> +            dprintf("irq_window_open\n");
> +            break;
> +        case KVM_EXIT_SHUTDOWN:
> +            dprintf("shutdown\n");
> +            qemu_system_reset_request();
> +            ret = 1;
> +            break;
> +        case KVM_EXIT_UNKNOWN:
> +            dprintf("kvm_exit_unknown\n");
> +            break;
> +        case KVM_EXIT_FAIL_ENTRY:
> +            dprintf("kvm_exit_fail_entry\n");
> +            break;
> +        case KVM_EXIT_EXCEPTION:
> +            dprintf("kvm_exit_exception\n");
> +            break;
> +        case KVM_EXIT_DEBUG:
> +            dprintf("kvm_exit_debug\n");
> +            break;
> +        default:
> +            dprintf("kvm_arch_handle_exit\n");
> +            ret = kvm_arch_handle_exit(env, run);
> +            break;
> +        }
> +    } while (ret > 0);
> +
> +    return ret;
> +}

How did you decide which exit handlers should go into
architecture-specific code? Looking at just the KVM architecture set:
IO: x86 and ia64, not PowerPC or s390
MMIO: everybody except s390
DCRs: PowerPC only
IRQ window: not sure

-Hollis

  reply	other threads:[~2008-10-28 20:49 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-28 20:13 [Qemu-devel] [PATCH 1/3] Add additional CPU flag definitions Anthony Liguori
2008-10-28 20:13 ` [Qemu-devel] [PATCH 2/3] Split CPUID from op_helper Anthony Liguori
2008-10-28 20:13   ` [Qemu-devel] [PATCH 3/3] Add KVM support to QEMU Anthony Liguori
2008-10-28 20:49     ` Hollis Blanchard [this message]
2008-10-28 21:10       ` Anthony Liguori
2008-10-28 20:57     ` Andreas Färber
2008-10-28 21:04       ` Glauber Costa
2008-10-28 21:16         ` Anthony Liguori
2008-10-28 21:05       ` Anthony Liguori
2008-11-04 13:25         ` Avi Kivity
2008-10-28 21:41     ` [Qemu-devel] " Gerd Hoffmann
2008-10-28 21:51       ` Anthony Liguori
2008-10-28 23:04         ` Glauber Costa
2008-10-28 23:36           ` Anthony Liguori
2008-10-29  9:54             ` Avi Kivity
2008-10-29 12:35               ` Glauber Costa
2008-10-29 12:39                 ` Avi Kivity
2008-10-29 12:56                   ` Glauber Costa
2008-10-29 13:07               ` Anthony Liguori
2008-10-29 13:23                 ` Avi Kivity
2008-10-29 13:32                   ` Anthony Liguori
2008-10-29 13:51             ` Hollis Blanchard
2008-10-29 14:09               ` Avi Kivity
2008-10-29 14:16                 ` Fabrice Bellard
2008-10-29 14:23                   ` Anthony Liguori
2008-10-29 19:13                 ` Blue Swirl
2008-11-01 16:25                   ` Blue Swirl
2008-10-29 14:58     ` Glauber Costa
2008-10-29 17:41     ` Glauber Costa
2008-10-29 19:01       ` Anthony Liguori
2008-11-04 13:24     ` Avi Kivity
2008-11-04 14:02       ` Anthony Liguori
2008-11-04 14:46         ` Avi Kivity
2008-11-04 14:50           ` 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=fb412d760810281349q2572acf0j4a3f5eff9e8a55a4@mail.gmail.com \
    --to=hollis@penguinppc.org \
    --cc=aliguori@us.ibm.com \
    --cc=avi@redhat.com \
    --cc=glommer@redhat.com \
    --cc=kvm-ppc@vger.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).