@@ -4766,6 +4766,13 @@ static int vcpu_post_run_addressing_exception(struct kvm_vcpu *vcpu)
4766
4766
return kvm_s390_inject_prog_irq (vcpu , & pgm_info );
4767
4767
}
4768
4768
4769
+ static void kvm_s390_assert_primary_as (struct kvm_vcpu * vcpu )
4770
+ {
4771
+ KVM_BUG (current -> thread .gmap_teid .as != PSW_BITS_AS_PRIMARY , vcpu -> kvm ,
4772
+ "Unexpected program interrupt 0x%x, TEID 0x%016lx" ,
4773
+ current -> thread .gmap_int_code , current -> thread .gmap_teid .val );
4774
+ }
4775
+
4769
4776
static int vcpu_post_run_handle_fault (struct kvm_vcpu * vcpu )
4770
4777
{
4771
4778
unsigned int flags = 0 ;
@@ -4781,9 +4788,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)
4781
4788
vcpu -> stat .exit_null ++ ;
4782
4789
break ;
4783
4790
case PGM_NON_SECURE_STORAGE_ACCESS :
4784
- KVM_BUG (current -> thread .gmap_teid .as != PSW_BITS_AS_PRIMARY , vcpu -> kvm ,
4785
- "Unexpected program interrupt 0x%x, TEID 0x%016lx" ,
4786
- current -> thread .gmap_int_code , current -> thread .gmap_teid .val );
4791
+ kvm_s390_assert_primary_as (vcpu );
4787
4792
/*
4788
4793
* This is normal operation; a page belonging to a protected
4789
4794
* guest has not been imported yet. Try to import the page into
@@ -4794,9 +4799,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)
4794
4799
break ;
4795
4800
case PGM_SECURE_STORAGE_ACCESS :
4796
4801
case PGM_SECURE_STORAGE_VIOLATION :
4797
- KVM_BUG (current -> thread .gmap_teid .as != PSW_BITS_AS_PRIMARY , vcpu -> kvm ,
4798
- "Unexpected program interrupt 0x%x, TEID 0x%016lx" ,
4799
- current -> thread .gmap_int_code , current -> thread .gmap_teid .val );
4802
+ kvm_s390_assert_primary_as (vcpu );
4800
4803
/*
4801
4804
* This can happen after a reboot with asynchronous teardown;
4802
4805
* the new guest (normal or protected) will run on top of the
@@ -4825,9 +4828,7 @@ static int vcpu_post_run_handle_fault(struct kvm_vcpu *vcpu)
4825
4828
case PGM_REGION_FIRST_TRANS :
4826
4829
case PGM_REGION_SECOND_TRANS :
4827
4830
case PGM_REGION_THIRD_TRANS :
4828
- KVM_BUG (current -> thread .gmap_teid .as != PSW_BITS_AS_PRIMARY , vcpu -> kvm ,
4829
- "Unexpected program interrupt 0x%x, TEID 0x%016lx" ,
4830
- current -> thread .gmap_int_code , current -> thread .gmap_teid .val );
4831
+ kvm_s390_assert_primary_as (vcpu );
4831
4832
if (vcpu -> arch .gmap -> pfault_enabled ) {
4832
4833
rc = gmap_fault (vcpu -> arch .gmap , gaddr , flags | FAULT_FLAG_RETRY_NOWAIT );
4833
4834
if (rc == - EFAULT )
0 commit comments