aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/kvm_host.h
diff options
context:
space:
mode:
authorJanosch Frank <frankja@linux.vnet.ibm.com>2016-05-10 15:03:42 +0200
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-10 12:07:12 +0200
commit7d0a5e62411a9223512c6af2e4c08a2d7c00fa2e (patch)
tree1c735ee1c90c691b0246c9bb07811030734d14e4 /arch/s390/include/asm/kvm_host.h
parentKVM: s390: Add sthyi emulation (diff)
downloadlinux-dev-7d0a5e62411a9223512c6af2e4c08a2d7c00fa2e.tar.xz
linux-dev-7d0a5e62411a9223512c6af2e4c08a2d7c00fa2e.zip
KVM: s390: Limit sthyi execution
Store hypervisor information is a valid instruction not only in supervisor state but also in problem state, i.e. the guest's userspace. Its execution is not only computational and memory intensive, but also has to get hold of the ipte lock to write to the guest's memory. This lock is not intended to be held often and long, especially not from the untrusted guest userspace. Therefore we apply rate limiting of sthyi executions per VM. Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com> Acked-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include/asm/kvm_host.h')
-rw-r--r--arch/s390/include/asm/kvm_host.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 7233b1c49964..bcc20dc91ea8 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -652,6 +652,7 @@ struct kvm_arch{
wait_queue_head_t ipte_wq;
int ipte_lock_count;
struct mutex ipte_mutex;
+ struct ratelimit_state sthyi_limit;
spinlock_t start_stop_lock;
struct sie_page2 *sie_page2;
struct kvm_s390_cpu_model model;