diff mbox series

arm64: mm: fault: replace the behavior of fault_info[18]

Message ID 20241214091937.203842-1-lsahn@ooseel.net (mailing list archive)
State New
Headers show
Series arm64: mm: fault: replace the behavior of fault_info[18] | expand

Commit Message

Leesoo Ahn Dec. 14, 2024, 9:19 a.m. UTC
Replace the behavior of 18th element of fault_info with the 'fn' member to
do_sea(..) and 'name' to 'level -2 (translation table walk)' based on
the information[1] of the latest reference manual[2].

The information has described in the chapter, D24.2.40 of [2] and
DFSC[5:0] bit (stands for Data Fault Status Code).

[1]: Synchronous External abort on translation table walk, level -2
[2]: Arm Architecture Reference Manual, for A-profile architecture

Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
---
 arch/arm64/mm/fault.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Leesoo Ahn Dec. 14, 2024, 9:38 a.m. UTC | #1
I just figured out that do_sea(..) isn't the right function to deal
with VMSAv9-128.
Please ignore this patch.

BR
Leesoo

2024년 12월 14일 (토) 오후 6:20, Leesoo Ahn <lsahn@ooseel.net>님이 작성:
>
> Replace the behavior of 18th element of fault_info with the 'fn' member to
> do_sea(..) and 'name' to 'level -2 (translation table walk)' based on
> the information[1] of the latest reference manual[2].
>
> The information has described in the chapter, D24.2.40 of [2] and
> DFSC[5:0] bit (stands for Data Fault Status Code).
>
> [1]: Synchronous External abort on translation table walk, level -2
> [2]: Arm Architecture Reference Manual, for A-profile architecture
>
> Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
> ---
>  arch/arm64/mm/fault.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> index ef63651099a9..b1c08289a5cc 100644
> --- a/arch/arm64/mm/fault.c
> +++ b/arch/arm64/mm/fault.c
> @@ -863,7 +863,7 @@ static const struct fault_info fault_info[] = {
>         { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
>         { do_sea,               SIGBUS,  BUS_OBJERR,    "synchronous external abort"    },
>         { do_tag_check_fault,   SIGSEGV, SEGV_MTESERR,  "synchronous tag check fault"   },
> -       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 18"                    },
> +       { do_sea,               SIGKILL, SI_KERNEL,     "level -2 (translation table walk)"     },
>         { do_sea,               SIGKILL, SI_KERNEL,     "level -1 (translation table walk)"     },
>         { do_sea,               SIGKILL, SI_KERNEL,     "level 0 (translation table walk)"      },
>         { do_sea,               SIGKILL, SI_KERNEL,     "level 1 (translation table walk)"      },
> --
> 2.46.1
>
Anshuman Khandual Dec. 16, 2024, 4:31 a.m. UTC | #2
On 12/14/24 15:08, Leesoo Ahn wrote:
> I just figured out that do_sea(..) isn't the right function to deal
> with VMSAv9-128.
> Please ignore this patch.

Right, actual handling needs to be sorted out when 128 bit PTE is enabled.
For example, following change might be required to handle 128 bit related
faults but the handlers such as do_sea(), do_bad(), do_translation_fault()
need to be changed and tested for 128 bit PTE format.

--- a/arch/arm64/include/asm/esr.h
+++ b/arch/arm64/include/asm/esr.h
@@ -415,7 +415,8 @@ static inline bool esr_fsc_is_translation_fault(unsigned long esr)
               (esr == ESR_ELx_FSC_FAULT_L(2)) ||
               (esr == ESR_ELx_FSC_FAULT_L(1)) ||
               (esr == ESR_ELx_FSC_FAULT_L(0)) ||
-              (esr == ESR_ELx_FSC_FAULT_L(-1));
+              (esr == ESR_ELx_FSC_FAULT_L(-1)) ||
+              (esr == ESR_ELx_FSC_FAULT_L(-2));
 }
 
 static inline bool esr_fsc_is_permission_fault(unsigned long esr)
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index 8b281cf308b3..3a35c580395e 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -823,7 +823,7 @@ static const struct fault_info fault_info[] = {
        { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
        { do_sea,               SIGBUS,  BUS_OBJERR,    "synchronous external abort"    },
        { do_tag_check_fault,   SIGSEGV, SEGV_MTESERR,  "synchronous tag check fault"   },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 18"                    },
+       { do_sea,               SIGKILL, SI_KERNEL,     "level -2 (translation table walk)"     },
        { do_sea,               SIGKILL, SI_KERNEL,     "level -1 (translation table walk)"     },
        { do_sea,               SIGKILL, SI_KERNEL,     "level 0 (translation table walk)"      },
        { do_sea,               SIGKILL, SI_KERNEL,     "level 1 (translation table walk)"      },
@@ -847,9 +847,9 @@ static const struct fault_info fault_info[] = {
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 39"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 40"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "level -1 address size fault"   },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 42"                    },
+       { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level -2 translation fault"    },
        { do_translation_fault, SIGSEGV, SEGV_MAPERR,   "level -1 translation fault"    },
-       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 44"                    },
+       { do_bad,               SIGKILL, SI_KERNEL,     "level -2 address size fault"   },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 45"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 46"                    },
        { do_bad,               SIGKILL, SI_KERNEL,     "unknown 47"                    },


> 
> BR
> Leesoo
> 
> 2024년 12월 14일 (토) 오후 6:20, Leesoo Ahn <lsahn@ooseel.net>님이 작성:
>>
>> Replace the behavior of 18th element of fault_info with the 'fn' member to
>> do_sea(..) and 'name' to 'level -2 (translation table walk)' based on
>> the information[1] of the latest reference manual[2].
>>
>> The information has described in the chapter, D24.2.40 of [2] and
>> DFSC[5:0] bit (stands for Data Fault Status Code).
>>
>> [1]: Synchronous External abort on translation table walk, level -2
>> [2]: Arm Architecture Reference Manual, for A-profile architecture
>>
>> Signed-off-by: Leesoo Ahn <lsahn@ooseel.net>
>> ---
>>  arch/arm64/mm/fault.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
>> index ef63651099a9..b1c08289a5cc 100644
>> --- a/arch/arm64/mm/fault.c
>> +++ b/arch/arm64/mm/fault.c
>> @@ -863,7 +863,7 @@ static const struct fault_info fault_info[] = {
>>         { do_page_fault,        SIGSEGV, SEGV_ACCERR,   "level 3 permission fault"      },
>>         { do_sea,               SIGBUS,  BUS_OBJERR,    "synchronous external abort"    },
>>         { do_tag_check_fault,   SIGSEGV, SEGV_MTESERR,  "synchronous tag check fault"   },
>> -       { do_bad,               SIGKILL, SI_KERNEL,     "unknown 18"                    },
>> +       { do_sea,               SIGKILL, SI_KERNEL,     "level -2 (translation table walk)"     },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level -1 (translation table walk)"     },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level 0 (translation table walk)"      },
>>         { do_sea,               SIGKILL, SI_KERNEL,     "level 1 (translation table walk)"      },
>> --
>> 2.46.1
>>
>
diff mbox series

Patch

diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
index ef63651099a9..b1c08289a5cc 100644
--- a/arch/arm64/mm/fault.c
+++ b/arch/arm64/mm/fault.c
@@ -863,7 +863,7 @@  static const struct fault_info fault_info[] = {
 	{ do_page_fault,	SIGSEGV, SEGV_ACCERR,	"level 3 permission fault"	},
 	{ do_sea,		SIGBUS,  BUS_OBJERR,	"synchronous external abort"	},
 	{ do_tag_check_fault,	SIGSEGV, SEGV_MTESERR,	"synchronous tag check fault"	},
-	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 18"			},
+	{ do_sea,		SIGKILL, SI_KERNEL,	"level -2 (translation table walk)"	},
 	{ do_sea,		SIGKILL, SI_KERNEL,	"level -1 (translation table walk)"	},
 	{ do_sea,		SIGKILL, SI_KERNEL,	"level 0 (translation table walk)"	},
 	{ do_sea,		SIGKILL, SI_KERNEL,	"level 1 (translation table walk)"	},