KVM: s390: fixup and missing stat

1. A fixup for a bug that was introduced in 4.7-rc1 if userspace uses
    the cpu model ioctls
 2. Add the missing kvm stat for pei events
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.14 (GNU/Linux)
 
 iQIcBAABAgAGBQJXWnweAAoJEBF7vIC1phx8aOMP/i62RdrSJHMtvNhIpF620vKK
 7uYt8zUk1czo0JvmcoP744WLEaCPbOzHTpXOHWOo3Zv8G25H2U6MSVlBxEDcvLTf
 9X2UkuhqDlloXurPyTUQgkN6mclmqutywkKc98IYdtodCZX51ah9ZBHNE+6Z9dq3
 nSmu7zttQjPGcGz+pOxF0Gq/wtECTxuTzVjXBYvL1WvnoepY/6gGBMW6Qvv9JD1E
 AJtWUpY6KY+yXtox0CsUFi9o4Nsiza8FyRGujt7gW4K71vAip/b6NGZPxRDoN5Yg
 QJA8/10y1aiqzBd9DCLmIiBaa3pFi6oSXMGCbnZc0RVsYIOxNHxxJH2H+Z8LJt/d
 HJpOxs0IFeSHAEP9N+EJhRqanO+KlmpfXjaZV5aIBssDTnoEqOtsIFsxax+adbVQ
 DmwCl2LR8HhS2dIa94ntr4ASoBe8Hf0VsV5tDXvJcQ7gexs8glvrGRjEP63yznCK
 VhZlVWsuH1NJorHJn/5Tc5iJuEubCHX/Z44z7Tpfg15RVeFuy2UqTv/KUD5slJmI
 6OD0XhiJ1qmqMmNuDEHxeOmQweIYQXJsmud+YPw6TuVcRwWTBQ3yYXZp862qaqPq
 1n58JT2xlAZNklvG7F1StoYWYVQ3xJRM0niENPT0HosfIkYLDaIV+m0ujAHQdS+e
 4B6esMl9VzR+ZIWI0jYV
 =+kD9
 -----END PGP SIGNATURE-----

Merge tag 'kvm-s390-master-4.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD

KVM: s390: fixup and missing stat

1. A fixup for a bug that was introduced in 4.7-rc1 if userspace uses
   the cpu model ioctls
2. Add the missing kvm stat for pei events
This commit is contained in:
Paolo Bonzini 2016-06-13 13:44:50 +02:00
commit c1b8bfb08f
3 changed files with 5 additions and 1 deletions

View file

@ -245,6 +245,7 @@ struct kvm_vcpu_stat {
u32 exit_stop_request;
u32 exit_validity;
u32 exit_instruction;
u32 exit_pei;
u32 halt_successful_poll;
u32 halt_attempted_poll;
u32 halt_poll_invalid;

View file

@ -341,6 +341,8 @@ static int handle_mvpg_pei(struct kvm_vcpu *vcpu)
static int handle_partial_execution(struct kvm_vcpu *vcpu)
{
vcpu->stat.exit_pei++;
if (vcpu->arch.sie_block->ipa == 0xb254) /* MVPG */
return handle_mvpg_pei(vcpu);
if (vcpu->arch.sie_block->ipa >> 8 == 0xae) /* SIGP */

View file

@ -61,6 +61,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
{ "exit_external_request", VCPU_STAT(exit_external_request) },
{ "exit_external_interrupt", VCPU_STAT(exit_external_interrupt) },
{ "exit_instruction", VCPU_STAT(exit_instruction) },
{ "exit_pei", VCPU_STAT(exit_pei) },
{ "exit_program_interruption", VCPU_STAT(exit_program_interruption) },
{ "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) },
{ "halt_successful_poll", VCPU_STAT(halt_successful_poll) },
@ -657,7 +658,7 @@ static int kvm_s390_set_processor(struct kvm *kvm, struct kvm_device_attr *attr)
kvm->arch.model.cpuid = proc->cpuid;
lowest_ibc = sclp.ibc >> 16 & 0xfff;
unblocked_ibc = sclp.ibc & 0xfff;
if (lowest_ibc) {
if (lowest_ibc && proc->ibc) {
if (proc->ibc > unblocked_ibc)
kvm->arch.model.ibc = unblocked_ibc;
else if (proc->ibc < lowest_ibc)