diff options
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 6558b09ff579..8b00eb2ddf57 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -39,7 +39,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
39 | { "exit_instruction", VCPU_STAT(exit_instruction) }, | 39 | { "exit_instruction", VCPU_STAT(exit_instruction) }, |
40 | { "exit_program_interruption", VCPU_STAT(exit_program_interruption) }, | 40 | { "exit_program_interruption", VCPU_STAT(exit_program_interruption) }, |
41 | { "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) }, | 41 | { "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) }, |
42 | { "instruction_lctg", VCPU_STAT(instruction_lctg) }, | 42 | { "instruction_lctlg", VCPU_STAT(instruction_lctlg) }, |
43 | { "instruction_lctl", VCPU_STAT(instruction_lctl) }, | 43 | { "instruction_lctl", VCPU_STAT(instruction_lctl) }, |
44 | { "deliver_emergency_signal", VCPU_STAT(deliver_emergency_signal) }, | 44 | { "deliver_emergency_signal", VCPU_STAT(deliver_emergency_signal) }, |
45 | { "deliver_service_signal", VCPU_STAT(deliver_service_signal) }, | 45 | { "deliver_service_signal", VCPU_STAT(deliver_service_signal) }, |
@@ -79,10 +79,6 @@ void kvm_arch_hardware_disable(void *garbage) | |||
79 | { | 79 | { |
80 | } | 80 | } |
81 | 81 | ||
82 | void decache_vcpus_on_cpu(int cpu) | ||
83 | { | ||
84 | } | ||
85 | |||
86 | int kvm_arch_hardware_setup(void) | 82 | int kvm_arch_hardware_setup(void) |
87 | { | 83 | { |
88 | return 0; | 84 | return 0; |
@@ -116,7 +112,12 @@ long kvm_arch_dev_ioctl(struct file *filp, | |||
116 | 112 | ||
117 | int kvm_dev_ioctl_check_extension(long ext) | 113 | int kvm_dev_ioctl_check_extension(long ext) |
118 | { | 114 | { |
119 | return 0; | 115 | switch (ext) { |
116 | case KVM_CAP_USER_MEMORY: | ||
117 | return 1; | ||
118 | default: | ||
119 | return 0; | ||
120 | } | ||
120 | } | 121 | } |
121 | 122 | ||
122 | /* Section: vm related */ | 123 | /* Section: vm related */ |
@@ -198,6 +199,7 @@ out_nokvm: | |||
198 | void kvm_arch_destroy_vm(struct kvm *kvm) | 199 | void kvm_arch_destroy_vm(struct kvm *kvm) |
199 | { | 200 | { |
200 | debug_unregister(kvm->arch.dbf); | 201 | debug_unregister(kvm->arch.dbf); |
202 | kvm_free_physmem(kvm); | ||
201 | free_page((unsigned long)(kvm->arch.sca)); | 203 | free_page((unsigned long)(kvm->arch.sca)); |
202 | kfree(kvm); | 204 | kfree(kvm); |
203 | module_put(THIS_MODULE); | 205 | module_put(THIS_MODULE); |
@@ -250,11 +252,16 @@ static void kvm_s390_vcpu_initial_reset(struct kvm_vcpu *vcpu) | |||
250 | vcpu->arch.sie_block->gbea = 1; | 252 | vcpu->arch.sie_block->gbea = 1; |
251 | } | 253 | } |
252 | 254 | ||
255 | /* The current code can have up to 256 pages for virtio */ | ||
256 | #define VIRTIODESCSPACE (256ul * 4096ul) | ||
257 | |||
253 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | 258 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) |
254 | { | 259 | { |
255 | atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH); | 260 | atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH); |
256 | vcpu->arch.sie_block->gmslm = 0xffffffffffUL; | 261 | vcpu->arch.sie_block->gmslm = vcpu->kvm->arch.guest_memsize + |
257 | vcpu->arch.sie_block->gmsor = 0x000000000000; | 262 | vcpu->kvm->arch.guest_origin + |
263 | VIRTIODESCSPACE - 1ul; | ||
264 | vcpu->arch.sie_block->gmsor = vcpu->kvm->arch.guest_origin; | ||
258 | vcpu->arch.sie_block->ecb = 2; | 265 | vcpu->arch.sie_block->ecb = 2; |
259 | vcpu->arch.sie_block->eca = 0xC1002001U; | 266 | vcpu->arch.sie_block->eca = 0xC1002001U; |
260 | setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, | 267 | setup_timer(&vcpu->arch.ckc_timer, kvm_s390_idle_wakeup, |
@@ -273,7 +280,8 @@ struct kvm_vcpu *kvm_arch_vcpu_create(struct kvm *kvm, | |||
273 | if (!vcpu) | 280 | if (!vcpu) |
274 | goto out_nomem; | 281 | goto out_nomem; |
275 | 282 | ||
276 | vcpu->arch.sie_block = (struct sie_block *) get_zeroed_page(GFP_KERNEL); | 283 | vcpu->arch.sie_block = (struct kvm_s390_sie_block *) |
284 | get_zeroed_page(GFP_KERNEL); | ||
277 | 285 | ||
278 | if (!vcpu->arch.sie_block) | 286 | if (!vcpu->arch.sie_block) |
279 | goto out_free_cpu; | 287 | goto out_free_cpu; |
@@ -672,6 +680,10 @@ int kvm_arch_set_memory_region(struct kvm *kvm, | |||
672 | return 0; | 680 | return 0; |
673 | } | 681 | } |
674 | 682 | ||
683 | void kvm_arch_flush_shadow(struct kvm *kvm) | ||
684 | { | ||
685 | } | ||
686 | |||
675 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) | 687 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) |
676 | { | 688 | { |
677 | return gfn; | 689 | return gfn; |