@@ -1212,7 +1212,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
12121212 exec_fault = kvm_vcpu_trap_is_exec_fault (vcpu );
12131213 VM_BUG_ON (write_fault && exec_fault );
12141214
1215- if (fault_status == FSC_PERM && !write_fault && !exec_fault ) {
1215+ if (fault_status == ESR_ELx_FSC_PERM && !write_fault && !exec_fault ) {
12161216 kvm_err ("Unexpected L2 read permission error\n" );
12171217 return - EFAULT ;
12181218 }
@@ -1277,7 +1277,8 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
12771277 * only exception to this is when dirty logging is enabled at runtime
12781278 * and a write fault needs to collapse a block entry into a table.
12791279 */
1280- if (fault_status != FSC_PERM || (logging_active && write_fault )) {
1280+ if (fault_status != ESR_ELx_FSC_PERM ||
1281+ (logging_active && write_fault )) {
12811282 ret = kvm_mmu_topup_memory_cache (memcache ,
12821283 kvm_mmu_cache_min_pages (kvm ));
12831284 if (ret )
@@ -1342,15 +1343,16 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
13421343 * backed by a THP and thus use block mapping if possible.
13431344 */
13441345 if (vma_pagesize == PAGE_SIZE && !(force_pte || device )) {
1345- if (fault_status == FSC_PERM && fault_granule > PAGE_SIZE )
1346+ if (fault_status == ESR_ELx_FSC_PERM &&
1347+ fault_granule > PAGE_SIZE )
13461348 vma_pagesize = fault_granule ;
13471349 else
13481350 vma_pagesize = transparent_hugepage_adjust (kvm , memslot ,
13491351 hva , & pfn ,
13501352 & fault_ipa );
13511353 }
13521354
1353- if (fault_status != FSC_PERM && !device && kvm_has_mte (kvm )) {
1355+ if (fault_status != ESR_ELx_FSC_PERM && !device && kvm_has_mte (kvm )) {
13541356 /* Check the VMM hasn't introduced a new disallowed VMA */
13551357 if (kvm_vma_mte_allowed (vma )) {
13561358 sanitise_mte_tags (kvm , pfn , vma_pagesize );
@@ -1376,7 +1378,7 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
13761378 * permissions only if vma_pagesize equals fault_granule. Otherwise,
13771379 * kvm_pgtable_stage2_map() should be called to change block size.
13781380 */
1379- if (fault_status == FSC_PERM && vma_pagesize == fault_granule )
1381+ if (fault_status == ESR_ELx_FSC_PERM && vma_pagesize == fault_granule )
13801382 ret = kvm_pgtable_stage2_relax_perms (pgt , fault_ipa , prot );
13811383 else
13821384 ret = kvm_pgtable_stage2_map (pgt , fault_ipa , vma_pagesize ,
@@ -1441,7 +1443,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
14411443 fault_ipa = kvm_vcpu_get_fault_ipa (vcpu );
14421444 is_iabt = kvm_vcpu_trap_is_iabt (vcpu );
14431445
1444- if (fault_status == FSC_FAULT ) {
1446+ if (fault_status == ESR_ELx_FSC_FAULT ) {
14451447 /* Beyond sanitised PARange (which is the IPA limit) */
14461448 if (fault_ipa >= BIT_ULL (get_kvm_ipa_limit ())) {
14471449 kvm_inject_size_fault (vcpu );
@@ -1476,8 +1478,9 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
14761478 kvm_vcpu_get_hfar (vcpu ), fault_ipa );
14771479
14781480 /* Check the stage-2 fault is trans. fault or write fault */
1479- if (fault_status != FSC_FAULT && fault_status != FSC_PERM &&
1480- fault_status != FSC_ACCESS ) {
1481+ if (fault_status != ESR_ELx_FSC_FAULT &&
1482+ fault_status != ESR_ELx_FSC_PERM &&
1483+ fault_status != ESR_ELx_FSC_ACCESS ) {
14811484 kvm_err ("Unsupported FSC: EC=%#x xFSC=%#lx ESR_EL2=%#lx\n" ,
14821485 kvm_vcpu_trap_get_class (vcpu ),
14831486 (unsigned long )kvm_vcpu_trap_get_fault (vcpu ),
@@ -1539,7 +1542,7 @@ int kvm_handle_guest_abort(struct kvm_vcpu *vcpu)
15391542 /* Userspace should not be able to register out-of-bounds IPAs */
15401543 VM_BUG_ON (fault_ipa >= kvm_phys_size (vcpu -> kvm ));
15411544
1542- if (fault_status == FSC_ACCESS ) {
1545+ if (fault_status == ESR_ELx_FSC_ACCESS ) {
15431546 handle_access_fault (vcpu , fault_ipa );
15441547 ret = 1 ;
15451548 goto out_unlock ;
0 commit comments