Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d99faaa6 authored by Prasad Sodagudi's avatar Prasad Sodagudi Committed by Venkata Narendra Kumar Gutta
Browse files

arm64: Add TLB conflict fault handler



Add TLB conflict fault handler and try to handle
gracefully. Check whether TLB fault can be handled
by EL2 and cause panic if EL2 is not able to handle.

Change-Id: I276ec5413411932bd8a67ed4c85ebbf66f4affcf
Signed-off-by: default avatarPrasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: default avatarVenkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
parent 13c6da45
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -45,6 +45,7 @@
#include <asm/tlbflush.h>
#include <asm/kryo-arm64-edac.h>
#include <asm/traps.h>
#include <soc/qcom/scm.h>

#include <acpi/ghes.h>

@@ -601,6 +602,23 @@ static int __kprobes do_page_fault(unsigned long addr, unsigned int esr,
	return 0;
}

static int do_tlb_conf_fault(unsigned long addr,
				unsigned int esr,
				struct pt_regs *regs)
{
#define SCM_TLB_CONFLICT_CMD	0x1B
	struct scm_desc desc = {
		.args[0] = addr,
		.arginfo = SCM_ARGS(1),
	};

	if (scm_call2_atomic(SCM_SIP_FNID(SCM_SVC_MP, SCM_TLB_CONFLICT_CMD),
						&desc))
		return 1;

	return 0;
}

static int __kprobes do_translation_fault(unsigned long addr,
					  unsigned int esr,
					  struct pt_regs *regs)
@@ -709,7 +727,7 @@ static const struct fault_info fault_info[] = {
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 45"			},
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 46"			},
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 47"			},
	{ do_bad,		SIGKILL, SI_KERNEL,	"TLB conflict abort"		},
	{ do_tlb_conf_fault,	SIGKILL, SI_KERNEL,	"TLB conflict abort"},
	{ do_bad,		SIGKILL, SI_KERNEL,	"Unsupported atomic hardware update fault"	},
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 50"			},
	{ do_bad,		SIGKILL, SI_KERNEL,	"unknown 51"			},