diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/ia64/kvm.txt | 82 | ||||
-rw-r--r-- | Documentation/ioctl-number.txt | 2 | ||||
-rw-r--r-- | Documentation/powerpc/kvm_440.txt | 41 | ||||
-rw-r--r-- | Documentation/s390/kvm.txt | 125 |
4 files changed, 250 insertions, 0 deletions
diff --git a/Documentation/ia64/kvm.txt b/Documentation/ia64/kvm.txt new file mode 100644 index 000000000000..bec9d815da33 --- /dev/null +++ b/Documentation/ia64/kvm.txt | |||
@@ -0,0 +1,82 @@ | |||
1 | Currently, kvm module in EXPERIMENTAL stage on IA64. This means that | ||
2 | interfaces are not stable enough to use. So, plase had better don't run | ||
3 | critical applications in virtual machine. We will try our best to make it | ||
4 | strong in future versions! | ||
5 | Guide: How to boot up guests on kvm/ia64 | ||
6 | |||
7 | This guide is to describe how to enable kvm support for IA-64 systems. | ||
8 | |||
9 | 1. Get the kvm source from git.kernel.org. | ||
10 | Userspace source: | ||
11 | git clone git://git.kernel.org/pub/scm/virt/kvm/kvm-userspace.git | ||
12 | Kernel Source: | ||
13 | git clone git://git.kernel.org/pub/scm/linux/kernel/git/xiantao/kvm-ia64.git | ||
14 | |||
15 | 2. Compile the source code. | ||
16 | 2.1 Compile userspace code: | ||
17 | (1)cd ./kvm-userspace | ||
18 | (2)./configure | ||
19 | (3)cd kernel | ||
20 | (4)make sync LINUX= $kernel_dir (kernel_dir is the directory of kernel source.) | ||
21 | (5)cd .. | ||
22 | (6)make qemu | ||
23 | (7)cd qemu; make install | ||
24 | |||
25 | 2.2 Compile kernel source code: | ||
26 | (1) cd ./$kernel_dir | ||
27 | (2) Make menuconfig | ||
28 | (3) Enter into virtualization option, and choose kvm. | ||
29 | (4) make | ||
30 | (5) Once (4) done, make modules_install | ||
31 | (6) Make initrd, and use new kernel to reboot up host machine. | ||
32 | (7) Once (6) done, cd $kernel_dir/arch/ia64/kvm | ||
33 | (8) insmod kvm.ko; insmod kvm-intel.ko | ||
34 | |||
35 | Note: For step 2, please make sure that host page size == TARGET_PAGE_SIZE of qemu, otherwise, may fail. | ||
36 | |||
37 | 3. Get Guest Firmware named as Flash.fd, and put it under right place: | ||
38 | (1) If you have the guest firmware (binary) released by Intel Corp for Xen, use it directly. | ||
39 | |||
40 | (2) If you have no firmware at hand, Please download its source from | ||
41 | hg clone http://xenbits.xensource.com/ext/efi-vfirmware.hg | ||
42 | you can get the firmware's binary in the directory of efi-vfirmware.hg/binaries. | ||
43 | |||
44 | (3) Rename the firware you owned to Flash.fd, and copy it to /usr/local/share/qemu | ||
45 | |||
46 | 4. Boot up Linux or Windows guests: | ||
47 | 4.1 Create or install a image for guest boot. If you have xen experience, it should be easy. | ||
48 | |||
49 | 4.2 Boot up guests use the following command. | ||
50 | /usr/local/bin/qemu-system-ia64 -smp xx -m 512 -hda $your_image | ||
51 | (xx is the number of virtual processors for the guest, now the maximum value is 4) | ||
52 | |||
53 | 5. Known possibile issue on some platforms with old Firmware. | ||
54 | |||
55 | If meet strange host crashe issues, try to solve it through either of the following ways: | ||
56 | |||
57 | (1): Upgrade your Firmware to the latest one. | ||
58 | |||
59 | (2): Applying the below patch to kernel source. | ||
60 | diff --git a/arch/ia64/kernel/pal.S b/arch/ia64/kernel/pal.S | ||
61 | index 0b53344..f02b0f7 100644 | ||
62 | --- a/arch/ia64/kernel/pal.S | ||
63 | +++ b/arch/ia64/kernel/pal.S | ||
64 | @@ -84,7 +84,8 @@ GLOBAL_ENTRY(ia64_pal_call_static) | ||
65 | mov ar.pfs = loc1 | ||
66 | mov rp = loc0 | ||
67 | ;; | ||
68 | - srlz.d // seralize restoration of psr.l | ||
69 | + srlz.i // seralize restoration of psr.l | ||
70 | + ;; | ||
71 | br.ret.sptk.many b0 | ||
72 | END(ia64_pal_call_static) | ||
73 | |||
74 | 6. Bug report: | ||
75 | If you found any issues when use kvm/ia64, Please post the bug info to kvm-ia64-devel mailing list. | ||
76 | https://lists.sourceforge.net/lists/listinfo/kvm-ia64-devel/ | ||
77 | |||
78 | Thanks for your interest! Let's work together, and make kvm/ia64 stronger and stronger! | ||
79 | |||
80 | |||
81 | Xiantao Zhang <xiantao.zhang@intel.com> | ||
82 | 2008.3.10 | ||
diff --git a/Documentation/ioctl-number.txt b/Documentation/ioctl-number.txt index c18363bd8d11..240ce7a56c40 100644 --- a/Documentation/ioctl-number.txt +++ b/Documentation/ioctl-number.txt | |||
@@ -183,6 +183,8 @@ Code Seq# Include File Comments | |||
183 | 0xAC 00-1F linux/raw.h | 183 | 0xAC 00-1F linux/raw.h |
184 | 0xAD 00 Netfilter device in development: | 184 | 0xAD 00 Netfilter device in development: |
185 | <mailto:rusty@rustcorp.com.au> | 185 | <mailto:rusty@rustcorp.com.au> |
186 | 0xAE all linux/kvm.h Kernel-based Virtual Machine | ||
187 | <mailto:kvm-devel@lists.sourceforge.net> | ||
186 | 0xB0 all RATIO devices in development: | 188 | 0xB0 all RATIO devices in development: |
187 | <mailto:vgo@ratio.de> | 189 | <mailto:vgo@ratio.de> |
188 | 0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> | 190 | 0xB1 00-1F PPPoX <mailto:mostrows@styx.uwaterloo.ca> |
diff --git a/Documentation/powerpc/kvm_440.txt b/Documentation/powerpc/kvm_440.txt new file mode 100644 index 000000000000..c02a003fa03a --- /dev/null +++ b/Documentation/powerpc/kvm_440.txt | |||
@@ -0,0 +1,41 @@ | |||
1 | Hollis Blanchard <hollisb@us.ibm.com> | ||
2 | 15 Apr 2008 | ||
3 | |||
4 | Various notes on the implementation of KVM for PowerPC 440: | ||
5 | |||
6 | To enforce isolation, host userspace, guest kernel, and guest userspace all | ||
7 | run at user privilege level. Only the host kernel runs in supervisor mode. | ||
8 | Executing privileged instructions in the guest traps into KVM (in the host | ||
9 | kernel), where we decode and emulate them. Through this technique, unmodified | ||
10 | 440 Linux kernels can be run (slowly) as guests. Future performance work will | ||
11 | focus on reducing the overhead and frequency of these traps. | ||
12 | |||
13 | The usual code flow is started from userspace invoking an "run" ioctl, which | ||
14 | causes KVM to switch into guest context. We use IVPR to hijack the host | ||
15 | interrupt vectors while running the guest, which allows us to direct all | ||
16 | interrupts to kvmppc_handle_interrupt(). At this point, we could either | ||
17 | - handle the interrupt completely (e.g. emulate "mtspr SPRG0"), or | ||
18 | - let the host interrupt handler run (e.g. when the decrementer fires), or | ||
19 | - return to host userspace (e.g. when the guest performs device MMIO) | ||
20 | |||
21 | Address spaces: We take advantage of the fact that Linux doesn't use the AS=1 | ||
22 | address space (in host or guest), which gives us virtual address space to use | ||
23 | for guest mappings. While the guest is running, the host kernel remains mapped | ||
24 | in AS=0, but the guest can only use AS=1 mappings. | ||
25 | |||
26 | TLB entries: The TLB entries covering the host linear mapping remain | ||
27 | present while running the guest. This reduces the overhead of lightweight | ||
28 | exits, which are handled by KVM running in the host kernel. We keep three | ||
29 | copies of the TLB: | ||
30 | - guest TLB: contents of the TLB as the guest sees it | ||
31 | - shadow TLB: the TLB that is actually in hardware while guest is running | ||
32 | - host TLB: to restore TLB state when context switching guest -> host | ||
33 | When a TLB miss occurs because a mapping was not present in the shadow TLB, | ||
34 | but was present in the guest TLB, KVM handles the fault without invoking the | ||
35 | guest. Large guest pages are backed by multiple 4KB shadow pages through this | ||
36 | mechanism. | ||
37 | |||
38 | IO: MMIO and DCR accesses are emulated by userspace. We use virtio for network | ||
39 | and block IO, so those drivers must be enabled in the guest. It's possible | ||
40 | that some qemu device emulation (e.g. e1000 or rtl8139) may also work with | ||
41 | little effort. | ||
diff --git a/Documentation/s390/kvm.txt b/Documentation/s390/kvm.txt new file mode 100644 index 000000000000..6f5ceb0f09fc --- /dev/null +++ b/Documentation/s390/kvm.txt | |||
@@ -0,0 +1,125 @@ | |||
1 | *** BIG FAT WARNING *** | ||
2 | The kvm module is currently in EXPERIMENTAL state for s390. This means that | ||
3 | the interface to the module is not yet considered to remain stable. Thus, be | ||
4 | prepared that we keep breaking your userspace application and guest | ||
5 | compatibility over and over again until we feel happy with the result. Make sure | ||
6 | your guest kernel, your host kernel, and your userspace launcher are in a | ||
7 | consistent state. | ||
8 | |||
9 | This Documentation describes the unique ioctl calls to /dev/kvm, the resulting | ||
10 | kvm-vm file descriptors, and the kvm-vcpu file descriptors that differ from x86. | ||
11 | |||
12 | 1. ioctl calls to /dev/kvm | ||
13 | KVM does support the following ioctls on s390 that are common with other | ||
14 | architectures and do behave the same: | ||
15 | KVM_GET_API_VERSION | ||
16 | KVM_CREATE_VM (*) see note | ||
17 | KVM_CHECK_EXTENSION | ||
18 | KVM_GET_VCPU_MMAP_SIZE | ||
19 | |||
20 | Notes: | ||
21 | * KVM_CREATE_VM may fail on s390, if the calling process has multiple | ||
22 | threads and has not called KVM_S390_ENABLE_SIE before. | ||
23 | |||
24 | In addition, on s390 the following architecture specific ioctls are supported: | ||
25 | ioctl: KVM_S390_ENABLE_SIE | ||
26 | args: none | ||
27 | see also: include/linux/kvm.h | ||
28 | This call causes the kernel to switch on PGSTE in the user page table. This | ||
29 | operation is needed in order to run a virtual machine, and it requires the | ||
30 | calling process to be single-threaded. Note that the first call to KVM_CREATE_VM | ||
31 | will implicitly try to switch on PGSTE if the user process has not called | ||
32 | KVM_S390_ENABLE_SIE before. User processes that want to launch multiple threads | ||
33 | before creating a virtual machine have to call KVM_S390_ENABLE_SIE, or will | ||
34 | observe an error calling KVM_CREATE_VM. Switching on PGSTE is a one-time | ||
35 | operation, is not reversible, and will persist over the entire lifetime of | ||
36 | the calling process. It does not have any user-visible effect other than a small | ||
37 | performance penalty. | ||
38 | |||
39 | 2. ioctl calls to the kvm-vm file descriptor | ||
40 | KVM does support the following ioctls on s390 that are common with other | ||
41 | architectures and do behave the same: | ||
42 | KVM_CREATE_VCPU | ||
43 | KVM_SET_USER_MEMORY_REGION (*) see note | ||
44 | KVM_GET_DIRTY_LOG (**) see note | ||
45 | |||
46 | Notes: | ||
47 | * kvm does only allow exactly one memory slot on s390, which has to start | ||
48 | at guest absolute address zero and at a user address that is aligned on any | ||
49 | page boundary. This hardware "limitation" allows us to have a few unique | ||
50 | optimizations. The memory slot doesn't have to be filled | ||
51 | with memory actually, it may contain sparse holes. That said, with different | ||
52 | user memory layout this does still allow a large flexibility when | ||
53 | doing the guest memory setup. | ||
54 | ** KVM_GET_DIRTY_LOG doesn't work properly yet. The user will receive an empty | ||
55 | log. This ioctl call is only needed for guest migration, and we intend to | ||
56 | implement this one in the future. | ||
57 | |||
58 | In addition, on s390 the following architecture specific ioctls for the kvm-vm | ||
59 | file descriptor are supported: | ||
60 | ioctl: KVM_S390_INTERRUPT | ||
61 | args: struct kvm_s390_interrupt * | ||
62 | see also: include/linux/kvm.h | ||
63 | This ioctl is used to submit a floating interrupt for a virtual machine. | ||
64 | Floating interrupts may be delivered to any virtual cpu in the configuration. | ||
65 | Only some interrupt types defined in include/linux/kvm.h make sense when | ||
66 | submitted as floating interrupts. The following interrupts are not considered | ||
67 | to be useful as floating interrupts, and a call to inject them will result in | ||
68 | -EINVAL error code: program interrupts and interprocessor signals. Valid | ||
69 | floating interrupts are: | ||
70 | KVM_S390_INT_VIRTIO | ||
71 | KVM_S390_INT_SERVICE | ||
72 | |||
73 | 3. ioctl calls to the kvm-vcpu file descriptor | ||
74 | KVM does support the following ioctls on s390 that are common with other | ||
75 | architectures and do behave the same: | ||
76 | KVM_RUN | ||
77 | KVM_GET_REGS | ||
78 | KVM_SET_REGS | ||
79 | KVM_GET_SREGS | ||
80 | KVM_SET_SREGS | ||
81 | KVM_GET_FPU | ||
82 | KVM_SET_FPU | ||
83 | |||
84 | In addition, on s390 the following architecture specific ioctls for the | ||
85 | kvm-vcpu file descriptor are supported: | ||
86 | ioctl: KVM_S390_INTERRUPT | ||
87 | args: struct kvm_s390_interrupt * | ||
88 | see also: include/linux/kvm.h | ||
89 | This ioctl is used to submit an interrupt for a specific virtual cpu. | ||
90 | Only some interrupt types defined in include/linux/kvm.h make sense when | ||
91 | submitted for a specific cpu. The following interrupts are not considered | ||
92 | to be useful, and a call to inject them will result in -EINVAL error code: | ||
93 | service processor calls and virtio interrupts. Valid interrupt types are: | ||
94 | KVM_S390_PROGRAM_INT | ||
95 | KVM_S390_SIGP_STOP | ||
96 | KVM_S390_RESTART | ||
97 | KVM_S390_SIGP_SET_PREFIX | ||
98 | KVM_S390_INT_EMERGENCY | ||
99 | |||
100 | ioctl: KVM_S390_STORE_STATUS | ||
101 | args: unsigned long | ||
102 | see also: include/linux/kvm.h | ||
103 | This ioctl stores the state of the cpu at the guest real address given as | ||
104 | argument, unless one of the following values defined in include/linux/kvm.h | ||
105 | is given as arguement: | ||
106 | KVM_S390_STORE_STATUS_NOADDR - the CPU stores its status to the save area in | ||
107 | absolute lowcore as defined by the principles of operation | ||
108 | KVM_S390_STORE_STATUS_PREFIXED - the CPU stores its status to the save area in | ||
109 | its prefix page just like the dump tool that comes with zipl. This is useful | ||
110 | to create a system dump for use with lkcdutils or crash. | ||
111 | |||
112 | ioctl: KVM_S390_SET_INITIAL_PSW | ||
113 | args: struct kvm_s390_psw * | ||
114 | see also: include/linux/kvm.h | ||
115 | This ioctl can be used to set the processor status word (psw) of a stopped cpu | ||
116 | prior to running it with KVM_RUN. Note that this call is not required to modify | ||
117 | the psw during sie intercepts that fall back to userspace because struct kvm_run | ||
118 | does contain the psw, and this value is evaluated during reentry of KVM_RUN | ||
119 | after the intercept exit was recognized. | ||
120 | |||
121 | ioctl: KVM_S390_INITIAL_RESET | ||
122 | args: none | ||
123 | see also: include/linux/kvm.h | ||
124 | This ioctl can be used to perform an initial cpu reset as defined by the | ||
125 | principles of operation. The target cpu has to be in stopped state. | ||