aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/tss.h
diff options
context:
space:
mode:
authorIzik Eidus <izike@qumranet.com>2008-03-24 23:14:53 +0200
committerAvi Kivity <avi@qumranet.com>2008-04-27 12:00:39 +0300
commit37817f2982d0f559f90cecc66e150dd9d2c2df05 (patch)
tree45114b5720d7a13bdbe48cc6a75dc6de03d6fcd2 /arch/x86/kvm/tss.h
parentKVM: x86: add functions to get the cpl of vcpu (diff)
downloadlinux-dev-37817f2982d0f559f90cecc66e150dd9d2c2df05.tar.xz
linux-dev-37817f2982d0f559f90cecc66e150dd9d2c2df05.zip
KVM: x86: hardware task switching support
This emulates the x86 hardware task switch mechanism in software, as it is unsupported by either vmx or svm. It allows operating systems which use it, like freedos, to run as kvm guests. Signed-off-by: Izik Eidus <izike@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/x86/kvm/tss.h')
-rw-r--r--arch/x86/kvm/tss.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/arch/x86/kvm/tss.h b/arch/x86/kvm/tss.h
new file mode 100644
index 000000000000..622aa10f692f
--- /dev/null
+++ b/arch/x86/kvm/tss.h
@@ -0,0 +1,59 @@
+#ifndef __TSS_SEGMENT_H
+#define __TSS_SEGMENT_H
+
+struct tss_segment_32 {
+ u32 prev_task_link;
+ u32 esp0;
+ u32 ss0;
+ u32 esp1;
+ u32 ss1;
+ u32 esp2;
+ u32 ss2;
+ u32 cr3;
+ u32 eip;
+ u32 eflags;
+ u32 eax;
+ u32 ecx;
+ u32 edx;
+ u32 ebx;
+ u32 esp;
+ u32 ebp;
+ u32 esi;
+ u32 edi;
+ u32 es;
+ u32 cs;
+ u32 ss;
+ u32 ds;
+ u32 fs;
+ u32 gs;
+ u32 ldt_selector;
+ u16 t;
+ u16 io_map;
+};
+
+struct tss_segment_16 {
+ u16 prev_task_link;
+ u16 sp0;
+ u16 ss0;
+ u16 sp1;
+ u16 ss1;
+ u16 sp2;
+ u16 ss2;
+ u16 ip;
+ u16 flag;
+ u16 ax;
+ u16 cx;
+ u16 dx;
+ u16 bx;
+ u16 sp;
+ u16 bp;
+ u16 si;
+ u16 di;
+ u16 es;
+ u16 cs;
+ u16 ss;
+ u16 ds;
+ u16 ldt;
+};
+
+#endif