mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
ARM: report proper DACR value in oops dumps
When printing the DACR value, we print the domain register value. This is incorrect, as with SW_PAN enabled, that is the current setting, rather than the faulting context's setting. Arrange to print the faulting domain's saved DACR value instead. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
parent
08925c2f12
commit
77f1b959b0
1 changed files with 18 additions and 15 deletions
|
@ -95,6 +95,22 @@ void __show_regs(struct pt_regs *regs)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
char buf[64];
|
char buf[64];
|
||||||
|
#ifndef CONFIG_CPU_V7M
|
||||||
|
unsigned int domain;
|
||||||
|
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
||||||
|
/*
|
||||||
|
* Get the domain register for the parent context. In user
|
||||||
|
* mode, we don't save the DACR, so lets use what it should
|
||||||
|
* be. For other modes, we place it after the pt_regs struct.
|
||||||
|
*/
|
||||||
|
if (user_mode(regs))
|
||||||
|
domain = DACR_UACCESS_ENABLE;
|
||||||
|
else
|
||||||
|
domain = *(unsigned int *)(regs + 1);
|
||||||
|
#else
|
||||||
|
domain = get_domain();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
show_regs_print_info(KERN_DEFAULT);
|
show_regs_print_info(KERN_DEFAULT);
|
||||||
|
|
||||||
|
@ -123,21 +139,8 @@ void __show_regs(struct pt_regs *regs)
|
||||||
|
|
||||||
#ifndef CONFIG_CPU_V7M
|
#ifndef CONFIG_CPU_V7M
|
||||||
{
|
{
|
||||||
unsigned int domain = get_domain();
|
|
||||||
const char *segment;
|
const char *segment;
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_SW_DOMAIN_PAN
|
|
||||||
/*
|
|
||||||
* Get the domain register for the parent context. In user
|
|
||||||
* mode, we don't save the DACR, so lets use what it should
|
|
||||||
* be. For other modes, we place it after the pt_regs struct.
|
|
||||||
*/
|
|
||||||
if (user_mode(regs))
|
|
||||||
domain = DACR_UACCESS_ENABLE;
|
|
||||||
else
|
|
||||||
domain = *(unsigned int *)(regs + 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((domain & domain_mask(DOMAIN_USER)) ==
|
if ((domain & domain_mask(DOMAIN_USER)) ==
|
||||||
domain_val(DOMAIN_USER, DOMAIN_NOACCESS))
|
domain_val(DOMAIN_USER, DOMAIN_NOACCESS))
|
||||||
segment = "none";
|
segment = "none";
|
||||||
|
@ -163,11 +166,11 @@ void __show_regs(struct pt_regs *regs)
|
||||||
buf[0] = '\0';
|
buf[0] = '\0';
|
||||||
#ifdef CONFIG_CPU_CP15_MMU
|
#ifdef CONFIG_CPU_CP15_MMU
|
||||||
{
|
{
|
||||||
unsigned int transbase, dac = get_domain();
|
unsigned int transbase;
|
||||||
asm("mrc p15, 0, %0, c2, c0\n\t"
|
asm("mrc p15, 0, %0, c2, c0\n\t"
|
||||||
: "=r" (transbase));
|
: "=r" (transbase));
|
||||||
snprintf(buf, sizeof(buf), " Table: %08x DAC: %08x",
|
snprintf(buf, sizeof(buf), " Table: %08x DAC: %08x",
|
||||||
transbase, dac);
|
transbase, domain);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl));
|
asm("mrc p15, 0, %0, c1, c0\n" : "=r" (ctrl));
|
||||||
|
|
Loading…
Reference in a new issue