From: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH 17 of 27] Move kvm_run_abi10 to kvmctl-x86.c
Date: Wed, 31 Oct 2007 12:05:22 -0500 [thread overview]
Message-ID: <278fbab64f4b40dd4c40.1193850322@thinkpad> (raw)
In-Reply-To: <patchbomb.1193850305@thinkpad>
# HG changeset patch
# User Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
# Date 1193849564 18000
# Node ID 278fbab64f4b40dd4c40a7b07cb92e9b19aedd71
# Parent a694904630e6805dfe51f4eed16e18b7ac2ed504
Move kvm_run_abi10 to kvmctl-x86.c
Signed-off-by: Jerone Young <jyoung5-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
diff --git a/libkvm/libkvm-x86.c b/libkvm/libkvm-x86.c
--- a/libkvm/libkvm-x86.c
+++ b/libkvm/libkvm-x86.c
@@ -510,3 +510,79 @@ static int handle_mmio_abi10(kvm_context
return r;
}
+int kvm_run_abi10(kvm_context_t kvm, int vcpu)
+{
+ int r;
+ int fd = kvm->vcpu_fd[vcpu];
+ struct kvm_run_abi10 *run = (struct kvm_run_abi10 *)kvm->run[vcpu];
+
+again:
+ run->request_interrupt_window = try_push_interrupts(kvm);
+ r = pre_kvm_run(kvm, vcpu);
+ if (r)
+ return r;
+ r = ioctl(fd, KVM_RUN, 0);
+ post_kvm_run(kvm, vcpu);
+
+ run->io_completed = 0;
+ if (r == -1 && errno != EINTR) {
+ r = -errno;
+ printf("kvm_run: %m\n");
+ return r;
+ }
+ if (r == -1) {
+ r = handle_io_window(kvm);
+ goto more;
+ }
+ if (1) {
+ switch (run->exit_reason) {
+ case KVM_EXIT_UNKNOWN:
+ fprintf(stderr, "unhandled vm exit: 0x%x vcpu_id %d\n",
+ (unsigned)run->hw.hardware_exit_reason, vcpu);
+ kvm_show_regs(kvm, vcpu);
+ abort();
+ break;
+ case KVM_EXIT_FAIL_ENTRY:
+ fprintf(stderr, "kvm_run: failed entry, reason %u\n",
+ (unsigned)run->fail_entry.hardware_entry_failure_reason & 0xffff);
+ return -ENOEXEC;
+ break;
+ case KVM_EXIT_EXCEPTION:
+ fprintf(stderr, "exception %d (%x)\n",
+ run->ex.exception,
+ run->ex.error_code);
+ kvm_show_regs(kvm, vcpu);
+ kvm_show_code(kvm, vcpu);
+ abort();
+ break;
+ case KVM_EXIT_IO:
+ r = handle_io_abi10(kvm, run, vcpu);
+ break;
+ case KVM_EXIT_DEBUG:
+ r = handle_debug(kvm, vcpu);
+ break;
+ case KVM_EXIT_MMIO:
+ r = handle_mmio_abi10(kvm, run);
+ break;
+ case KVM_EXIT_HLT:
+ r = handle_halt(kvm, vcpu);
+ break;
+ case KVM_EXIT_IRQ_WINDOW_OPEN:
+ break;
+ case KVM_EXIT_SHUTDOWN:
+ r = handle_shutdown(kvm, vcpu);
+ break;
+ default:
+ fprintf(stderr, "unhandled vm exit: 0x%x\n", run->exit_reason);
+ kvm_show_regs(kvm, vcpu);
+ abort();
+ break;
+ }
+ }
+more:
+ if (!r)
+ goto again;
+ return r;
+}
+
+
diff --git a/libkvm/libkvm-x86.h b/libkvm/libkvm-x86.h
--- a/libkvm/libkvm-x86.h
+++ b/libkvm/libkvm-x86.h
@@ -56,4 +56,6 @@ int kvm_set_lapic(kvm_context_t kvm, int
int kvm_set_lapic(kvm_context_t kvm, int vcpu, struct kvm_lapic_state *s);
#endif
+int kvm_run_abi10(kvm_context_t kvm, int vcpu);
+
#endif
diff --git a/libkvm/libkvm.c b/libkvm/libkvm.c
--- a/libkvm/libkvm.c
+++ b/libkvm/libkvm.c
@@ -911,81 +911,6 @@ __u64 kvm_get_cr8(kvm_context_t kvm, int
return kvm->run[vcpu]->cr8;
}
-static int kvm_run_abi10(kvm_context_t kvm, int vcpu)
-{
- int r;
- int fd = kvm->vcpu_fd[vcpu];
- struct kvm_run_abi10 *run = (struct kvm_run_abi10 *)kvm->run[vcpu];
-
-again:
- run->request_interrupt_window = try_push_interrupts(kvm);
- r = pre_kvm_run(kvm, vcpu);
- if (r)
- return r;
- r = ioctl(fd, KVM_RUN, 0);
- post_kvm_run(kvm, vcpu);
-
- run->io_completed = 0;
- if (r == -1 && errno != EINTR) {
- r = -errno;
- printf("kvm_run: %m\n");
- return r;
- }
- if (r == -1) {
- r = handle_io_window(kvm);
- goto more;
- }
- if (1) {
- switch (run->exit_reason) {
- case KVM_EXIT_UNKNOWN:
- fprintf(stderr, "unhandled vm exit: 0x%x vcpu_id %d\n",
- (unsigned)run->hw.hardware_exit_reason, vcpu);
- kvm_show_regs(kvm, vcpu);
- abort();
- break;
- case KVM_EXIT_FAIL_ENTRY:
- fprintf(stderr, "kvm_run: failed entry, reason %u\n",
- (unsigned)run->fail_entry.hardware_entry_failure_reason & 0xffff);
- return -ENOEXEC;
- break;
- case KVM_EXIT_EXCEPTION:
- fprintf(stderr, "exception %d (%x)\n",
- run->ex.exception,
- run->ex.error_code);
- kvm_show_regs(kvm, vcpu);
- kvm_show_code(kvm, vcpu);
- abort();
- break;
- case KVM_EXIT_IO:
- r = handle_io_abi10(kvm, run, vcpu);
- break;
- case KVM_EXIT_DEBUG:
- r = handle_debug(kvm, vcpu);
- break;
- case KVM_EXIT_MMIO:
- r = handle_mmio_abi10(kvm, run);
- break;
- case KVM_EXIT_HLT:
- r = handle_halt(kvm, vcpu);
- break;
- case KVM_EXIT_IRQ_WINDOW_OPEN:
- break;
- case KVM_EXIT_SHUTDOWN:
- r = handle_shutdown(kvm, vcpu);
- break;
- default:
- fprintf(stderr, "unhandled vm exit: 0x%x\n", run->exit_reason);
- kvm_show_regs(kvm, vcpu);
- abort();
- break;
- }
- }
-more:
- if (!r)
- goto again;
- return r;
-}
-
int kvm_run(kvm_context_t kvm, int vcpu)
{
int r;
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
next prev parent reply other threads:[~2007-10-31 17:05 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-31 17:05 [PATCH 00 of 27] Refactor libkvm code Phase 1 Jerone Young
2007-10-31 17:05 ` [PATCH 01 of 27] Move kvm_context to kvmctl.h Jerone Young
2007-10-31 17:37 ` Hollis Blanchard
2007-10-31 18:48 ` Jerone Young
2007-10-31 22:33 ` Avi Kivity
2007-10-31 17:05 ` [PATCH 02 of 27] Make static slot & kvm_memory region funcions public Jerone Young
2007-11-01 12:41 ` Avi Kivity
2007-10-31 17:05 ` [PATCH 03 of 27] Move fuction kvm_alloc_kernel_memory to kvmctl-x86.c Jerone Young
2007-10-31 17:05 ` [PATCH 04 of 27] Move kvm_alloc_userspace_memory " Jerone Young
2007-10-31 17:05 ` [PATCH 05 of 27] Move kvm_set_tss_addr " Jerone Young
2007-10-31 17:05 ` [PATCH 06 of 27] imported patch move_kvm_set_init_tss Jerone Young
2007-10-31 17:05 ` [PATCH 07 of 27] Move function kvm_create_default_phys_mem to kvmctl-x86 and rename Jerone Young
2007-11-01 12:44 ` Avi Kivity
2007-10-31 17:05 ` [PATCH 08 of 27] Modify out arch specific code from kvm_create function Jerone Young
2007-11-01 12:45 ` Avi Kivity
2007-10-31 17:05 ` [PATCH 09 of 27] Move kvm_create_kernel_phys_mem to kvmctl-x86.c Jerone Young
2007-10-31 17:05 ` [PATCH 10 of 27] Move kvm_create_phys_mem " Jerone Young
2007-10-31 17:05 ` [PATCH 11 of 27] Move kvm_destroy_phys_mem " Jerone Young
2007-10-31 21:11 ` Izik Eidus
2007-10-31 17:05 ` [PATCH 12 of 27] Move kvm_create_memory_alias & kvm_destroy_memory_alias " Jerone Young
2007-10-31 17:05 ` [PATCH 13 of 27] Move kvm_get & kmv_set_lapci functions " Jerone Young
2007-10-31 17:05 ` [PATCH 14 of 27] Make functions in kvmctl.c nonstatic Jerone Young
2007-10-31 17:05 ` [PATCH 15 of 27] Move handle_io_abi_10 to kvmctl-x86.c Jerone Young
2007-10-31 17:05 ` [PATCH 16 of 27] Move handle_mmio_abi10 " Jerone Young
2007-10-31 17:05 ` Jerone Young [this message]
2007-10-31 17:05 ` [PATCH 18 of 27] Change name of post_kvm_run & pre_kvm_run in kvmctl.c Jerone Young
2007-10-31 17:05 ` [PATCH 19 of 27] Move msrs functions to kvmctl-x86.c Jerone Young
2007-10-31 17:05 ` [PATCH 20 of 27] Move print_seg " Jerone Young
2007-10-31 17:05 ` [PATCH 21 of 27] Move kvm_show_regs " Jerone Young
2007-10-31 17:05 ` [PATCH 22 of 27] Declare kvm_abi as a global variable in kvmctl.h Jerone Young
2007-10-31 17:05 ` [PATCH 23 of 27] Move kvm_get_apic to kvmctl-x86.c Jerone Young
2007-10-31 17:05 ` [PATCH 24 of 27] Move cr8 functions " Jerone Young
2007-10-31 17:05 ` [PATCH 25 of 27] Move kvm_setup_cpuid " Jerone Young
2007-10-31 17:05 ` [PATCH 26 of 27] Move kvm_show_code " Jerone Young
2007-10-31 17:05 ` [PATCH 27 of 27] Remove unsued inclusion of linux/kvm_parah.h in userspace kvmctl.h Jerone Young
2007-11-01 12:52 ` [PATCH 00 of 27] Refactor libkvm code Phase 1 Avi Kivity
2007-11-02 5:26 ` Zhang, Xiantao
[not found] ` <42DFA526FC41B1429CE7279EF83C6BDC9040D8-wq7ZOvIWXbMAbVU2wMM1CrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-11-02 7:49 ` Jerone Young
2007-11-02 19:41 ` [kvm-ppc-devel] " Hollis Blanchard
2007-11-04 7:40 ` Avi Kivity
[not found] ` <472D7772.9070907-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-11-05 1:13 ` Zhang, Xiantao
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=278fbab64f4b40dd4c40.1193850322@thinkpad \
--to=jyoung5-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=kvm-ppc-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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 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.