Commit f67d5c4f authored by Will Deacon's avatar Will Deacon

arm64: mm: Remove useless and wrong comments from fault.c

Fault.c seems to be a magnet for useless and wrong comments, largely
due to its ancestry in other architectures where the code has since
moved on, but the comments have remained intact.

This patch removes both useless and incorrect comments, leaving only
those that say something correct and relevant.
Reported-by: default avatarWenjia Zhou <zhiyuan_zhu@htc.com>
Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
parent 9339fd34
...@@ -105,9 +105,6 @@ static void data_abort_decode(unsigned int esr) ...@@ -105,9 +105,6 @@ static void data_abort_decode(unsigned int esr)
(esr & ESR_ELx_WNR) >> ESR_ELx_WNR_SHIFT); (esr & ESR_ELx_WNR) >> ESR_ELx_WNR_SHIFT);
} }
/*
* Decode mem abort information
*/
static void mem_abort_decode(unsigned int esr) static void mem_abort_decode(unsigned int esr)
{ {
pr_alert("Mem abort info:\n"); pr_alert("Mem abort info:\n");
...@@ -249,9 +246,6 @@ static inline bool is_permission_fault(unsigned int esr, struct pt_regs *regs, ...@@ -249,9 +246,6 @@ static inline bool is_permission_fault(unsigned int esr, struct pt_regs *regs,
return false; return false;
} }
/*
* The kernel tried to access some page that wasn't present.
*/
static void __do_kernel_fault(unsigned long addr, unsigned int esr, static void __do_kernel_fault(unsigned long addr, unsigned int esr,
struct pt_regs *regs) struct pt_regs *regs)
{ {
...@@ -264,9 +258,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr, ...@@ -264,9 +258,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
if (!is_el1_instruction_abort(esr) && fixup_exception(regs)) if (!is_el1_instruction_abort(esr) && fixup_exception(regs))
return; return;
/*
* No handler, we'll have to terminate things with extreme prejudice.
*/
bust_spinlocks(1); bust_spinlocks(1);
if (is_permission_fault(esr, regs, addr)) { if (is_permission_fault(esr, regs, addr)) {
...@@ -291,10 +282,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr, ...@@ -291,10 +282,6 @@ static void __do_kernel_fault(unsigned long addr, unsigned int esr,
do_exit(SIGKILL); do_exit(SIGKILL);
} }
/*
* Something tried to access memory that isn't in our memory map. User mode
* accesses just cause a SIGSEGV
*/
static void __do_user_fault(struct task_struct *tsk, unsigned long addr, static void __do_user_fault(struct task_struct *tsk, unsigned long addr,
unsigned int esr, unsigned int sig, int code, unsigned int esr, unsigned int sig, int code,
struct pt_regs *regs, int fault) struct pt_regs *regs, int fault)
...@@ -559,23 +546,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr, ...@@ -559,23 +546,6 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
return 0; return 0;
} }
/*
* First Level Translation Fault Handler
*
* We enter here because the first level page table doesn't contain a valid
* entry for the address.
*
* If the address is in kernel space (>= TASK_SIZE), then we are probably
* faulting in the vmalloc() area.
*
* If the init_task's first level page tables contains the relevant entry, we
* copy the it to this task. If not, we send the process a signal, fixup the
* exception, or oops the kernel.
*
* NOTE! We MUST NOT take any locks for this case. We may be in an interrupt
* or a critical region, and should only copy the information from the master
* page table, nothing more.
*/
static int __kprobes do_translation_fault(unsigned long addr, static int __kprobes do_translation_fault(unsigned long addr,
unsigned int esr, unsigned int esr,
struct pt_regs *regs) struct pt_regs *regs)
...@@ -594,18 +564,11 @@ static int do_alignment_fault(unsigned long addr, unsigned int esr, ...@@ -594,18 +564,11 @@ static int do_alignment_fault(unsigned long addr, unsigned int esr,
return 0; return 0;
} }
/*
* This abort handler always returns "fault".
*/
static int do_bad(unsigned long addr, unsigned int esr, struct pt_regs *regs) static int do_bad(unsigned long addr, unsigned int esr, struct pt_regs *regs)
{ {
return 1; return 1; /* "fault" */
} }
/*
* This abort handler deals with Synchronous External Abort.
* It calls notifiers, and then returns "fault".
*/
static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs)
{ {
struct siginfo info; struct siginfo info;
...@@ -710,13 +673,6 @@ static const struct fault_info fault_info[] = { ...@@ -710,13 +673,6 @@ static const struct fault_info fault_info[] = {
{ do_bad, SIGBUS, 0, "unknown 63" }, { do_bad, SIGBUS, 0, "unknown 63" },
}; };
/*
* Handle Synchronous External Aborts that occur in a guest kernel.
*
* The return value will be zero if the SEA was successfully handled
* and non-zero if there was an error processing the error or there was
* no error to process.
*/
int handle_guest_sea(phys_addr_t addr, unsigned int esr) int handle_guest_sea(phys_addr_t addr, unsigned int esr)
{ {
int ret = -ENOENT; int ret = -ENOENT;
...@@ -727,9 +683,6 @@ int handle_guest_sea(phys_addr_t addr, unsigned int esr) ...@@ -727,9 +683,6 @@ int handle_guest_sea(phys_addr_t addr, unsigned int esr)
return ret; return ret;
} }
/*
* Dispatch a data abort to the relevant handler.
*/
asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr, asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
struct pt_regs *regs) struct pt_regs *regs)
{ {
...@@ -751,9 +704,6 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr, ...@@ -751,9 +704,6 @@ asmlinkage void __exception do_mem_abort(unsigned long addr, unsigned int esr,
arm64_notify_die("", regs, &info, esr); arm64_notify_die("", regs, &info, esr);
} }
/*
* Handle stack alignment exceptions.
*/
asmlinkage void __exception do_sp_pc_abort(unsigned long addr, asmlinkage void __exception do_sp_pc_abort(unsigned long addr,
unsigned int esr, unsigned int esr,
struct pt_regs *regs) struct pt_regs *regs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment