diff options
author | Michael Mueller <mimu@linux.vnet.ibm.com> | 2015-02-02 09:42:51 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-02-09 06:44:12 -0500 |
commit | 9d8d578605b4fca37bd2230bbacb3ad0ee48e7e4 (patch) | |
tree | 4d0af38197c3f4350b49cbd2c5bd6fc303b89377 /arch/s390/kvm/kvm-s390.h | |
parent | 45c9b47c5883d02abab6c7c7788e3d97a2f158e1 (diff) |
KVM: s390: use facilities and cpu_id per KVM
The patch introduces facilities and cpu_ids per virtual machine.
Different virtual machines may want to expose different facilities and
cpu ids to the guest, so let's make them per-vm instead of global.
Signed-off-by: Michael Mueller <mimu@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.h')
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index c22dce8a7536..985c2114d7ef 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -18,12 +18,10 @@ | |||
18 | #include <linux/hrtimer.h> | 18 | #include <linux/hrtimer.h> |
19 | #include <linux/kvm.h> | 19 | #include <linux/kvm.h> |
20 | #include <linux/kvm_host.h> | 20 | #include <linux/kvm_host.h> |
21 | #include <asm/facility.h> | ||
21 | 22 | ||
22 | typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu); | 23 | typedef int (*intercept_handler_t)(struct kvm_vcpu *vcpu); |
23 | 24 | ||
24 | /* declare vfacilities extern */ | ||
25 | extern unsigned long *vfacilities; | ||
26 | |||
27 | /* Transactional Memory Execution related macros */ | 25 | /* Transactional Memory Execution related macros */ |
28 | #define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10)) | 26 | #define IS_TE_ENABLED(vcpu) ((vcpu->arch.sie_block->ecb & 0x10)) |
29 | #define TDB_FORMAT1 1 | 27 | #define TDB_FORMAT1 1 |
@@ -127,6 +125,12 @@ static inline void kvm_s390_set_psw_cc(struct kvm_vcpu *vcpu, unsigned long cc) | |||
127 | vcpu->arch.sie_block->gpsw.mask |= cc << 44; | 125 | vcpu->arch.sie_block->gpsw.mask |= cc << 44; |
128 | } | 126 | } |
129 | 127 | ||
128 | /* test availability of facility in a kvm intance */ | ||
129 | static inline int test_kvm_facility(struct kvm *kvm, unsigned long nr) | ||
130 | { | ||
131 | return __test_facility(nr, kvm->arch.model.fac->kvm); | ||
132 | } | ||
133 | |||
130 | /* are cpu states controlled by user space */ | 134 | /* are cpu states controlled by user space */ |
131 | static inline int kvm_s390_user_cpu_state_ctrl(struct kvm *kvm) | 135 | static inline int kvm_s390_user_cpu_state_ctrl(struct kvm *kvm) |
132 | { | 136 | { |
@@ -183,7 +187,8 @@ int kvm_s390_vcpu_setup_cmma(struct kvm_vcpu *vcpu); | |||
183 | void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu); | 187 | void kvm_s390_vcpu_unsetup_cmma(struct kvm_vcpu *vcpu); |
184 | /* is cmma enabled */ | 188 | /* is cmma enabled */ |
185 | bool kvm_s390_cmma_enabled(struct kvm *kvm); | 189 | bool kvm_s390_cmma_enabled(struct kvm *kvm); |
186 | int test_vfacility(unsigned long nr); | 190 | unsigned long kvm_s390_fac_list_mask_size(void); |
191 | extern unsigned long kvm_s390_fac_list_mask[]; | ||
187 | 192 | ||
188 | /* implemented in diag.c */ | 193 | /* implemented in diag.c */ |
189 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); | 194 | int kvm_s390_handle_diag(struct kvm_vcpu *vcpu); |