public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset()
@ 2018-12-12 10:56 Miles Chen
  2018-12-13 18:13 ` Will Deacon
  0 siblings, 1 reply; 4+ messages in thread
From: Miles Chen @ 2018-12-12 10:56 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon, Matthias Brugger
  Cc: Miles Chen, linux-mediatek, linux-kernel, linux-arm-kernel,
	wsd_upstream

When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to
perform linear virtual address to physical address translation.
Sometimes we're debugging with only few information such as a kernel log
and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case.

Tested by:
echo c > /proc/sysrq-trigger
[   11.996161] SMP: stopping secondary CPUs
[   11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000
[   11.996881] PHYS_OFFSET: 0xffffffeb40000000

Signed-off-by: Miles Chen <miles.chen@mediatek.com>
Tested-by: Miles Chen <miles.chen@mediatek.com>
---
 arch/arm64/kernel/setup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
index f4fc1e0544b7..4b0e1231625c 100644
--- a/arch/arm64/kernel/setup.c
+++ b/arch/arm64/kernel/setup.c
@@ -388,6 +388,7 @@ static int dump_kernel_offset(struct notifier_block *self, unsigned long v,
 	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) {
 		pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n",
 			 offset, KIMAGE_VADDR);
+		pr_emerg("PHYS_OFFSET: 0x%llx\n", PHYS_OFFSET);
 	} else {
 		pr_emerg("Kernel Offset: disabled\n");
 	}
-- 
2.18.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset()
  2018-12-12 10:56 [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset() Miles Chen
@ 2018-12-13 18:13 ` Will Deacon
  2018-12-13 18:15   ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2018-12-13 18:13 UTC (permalink / raw)
  To: Miles Chen
  Cc: wsd_upstream, ard.biesheuvel, Catalin Marinas, linux-kernel,
	linux-mediatek, Matthias Brugger, linux-arm-kernel

[+Ard because I'll basically go with his preference on this one]

On Wed, Dec 12, 2018 at 06:56:49PM +0800, Miles Chen wrote:
> When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to
> perform linear virtual address to physical address translation.
> Sometimes we're debugging with only few information such as a kernel log
> and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case.
> 
> Tested by:
> echo c > /proc/sysrq-trigger
> [   11.996161] SMP: stopping secondary CPUs
> [   11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000
> [   11.996881] PHYS_OFFSET: 0xffffffeb40000000
> 
> Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> Tested-by: Miles Chen <miles.chen@mediatek.com>
> ---
>  arch/arm64/kernel/setup.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> index f4fc1e0544b7..4b0e1231625c 100644
> --- a/arch/arm64/kernel/setup.c
> +++ b/arch/arm64/kernel/setup.c
> @@ -388,6 +388,7 @@ static int dump_kernel_offset(struct notifier_block *self, unsigned long v,
>  	if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) {
>  		pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n",
>  			 offset, KIMAGE_VADDR);
> +		pr_emerg("PHYS_OFFSET: 0x%llx\n", PHYS_OFFSET);
>  	} else {
>  		pr_emerg("Kernel Offset: disabled\n");
>  	}
> -- 
> 2.18.0
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset()
  2018-12-13 18:13 ` Will Deacon
@ 2018-12-13 18:15   ` Ard Biesheuvel
  2018-12-14  0:52     ` Miles Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Ard Biesheuvel @ 2018-12-13 18:15 UTC (permalink / raw)
  To: Will Deacon
  Cc: wsd_upstream, Catalin Marinas, Linux Kernel Mailing List,
	Miles Chen, moderated list:ARM/Mediatek SoC support,
	Matthias Brugger, linux-arm-kernel

On Thu, 13 Dec 2018 at 19:12, Will Deacon <will.deacon@arm.com> wrote:
>
> [+Ard because I'll basically go with his preference on this one]
>
> On Wed, Dec 12, 2018 at 06:56:49PM +0800, Miles Chen wrote:
> > When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to
> > perform linear virtual address to physical address translation.
> > Sometimes we're debugging with only few information such as a kernel log
> > and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case.
> >
> > Tested by:
> > echo c > /proc/sysrq-trigger
> > [   11.996161] SMP: stopping secondary CPUs
> > [   11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000
> > [   11.996881] PHYS_OFFSET: 0xffffffeb40000000
> >
> > Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > Tested-by: Miles Chen <miles.chen@mediatek.com>

Fine with me, but I would like to see an ack from Miles Chen :-)

> > ---
> >  arch/arm64/kernel/setup.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> > index f4fc1e0544b7..4b0e1231625c 100644
> > --- a/arch/arm64/kernel/setup.c
> > +++ b/arch/arm64/kernel/setup.c
> > @@ -388,6 +388,7 @@ static int dump_kernel_offset(struct notifier_block *self, unsigned long v,
> >       if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) {
> >               pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n",
> >                        offset, KIMAGE_VADDR);
> > +             pr_emerg("PHYS_OFFSET: 0x%llx\n", PHYS_OFFSET);
> >       } else {
> >               pr_emerg("Kernel Offset: disabled\n");
> >       }
> > --
> > 2.18.0
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset()
  2018-12-13 18:15   ` Ard Biesheuvel
@ 2018-12-14  0:52     ` Miles Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Miles Chen @ 2018-12-14  0:52 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: wsd_upstream, Catalin Marinas, Will Deacon,
	Linux Kernel Mailing List,
	moderated list:ARM/Mediatek SoC support, Matthias Brugger,
	linux-arm-kernel

On Thu, 2018-12-13 at 19:15 +0100, Ard Biesheuvel wrote:
> On Thu, 13 Dec 2018 at 19:12, Will Deacon <will.deacon@arm.com> wrote:
> >
> > [+Ard because I'll basically go with his preference on this one]
> >
> > On Wed, Dec 12, 2018 at 06:56:49PM +0800, Miles Chen wrote:
> > > When debug with kaslr, it is sometimes necessary to have PHYS_OFFSET to
> > > perform linear virtual address to physical address translation.
> > > Sometimes we're debugging with only few information such as a kernel log
> > > and a symbol file, print PHYS_OFFSET in dump_kernel_offset() for that case.
> > >
> > > Tested by:
> > > echo c > /proc/sysrq-trigger
> > > [   11.996161] SMP: stopping secondary CPUs
> > > [   11.996732] Kernel Offset: 0x2522200000 from 0xffffff8008000000
> > > [   11.996881] PHYS_OFFSET: 0xffffffeb40000000
> > >
> > > Signed-off-by: Miles Chen <miles.chen@mediatek.com>
> > > Tested-by: Miles Chen <miles.chen@mediatek.com>
> 
> Fine with me, but I would like to see an ack from Miles Chen :-)

Can I ack my own patch?

Acked-by:Miles Chen <miles.chen@mediatek.com>
> 
> > > ---
> > >  arch/arm64/kernel/setup.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
> > > index f4fc1e0544b7..4b0e1231625c 100644
> > > --- a/arch/arm64/kernel/setup.c
> > > +++ b/arch/arm64/kernel/setup.c
> > > @@ -388,6 +388,7 @@ static int dump_kernel_offset(struct notifier_block *self, unsigned long v,
> > >       if (IS_ENABLED(CONFIG_RANDOMIZE_BASE) && offset > 0) {
> > >               pr_emerg("Kernel Offset: 0x%lx from 0x%lx\n",
> > >                        offset, KIMAGE_VADDR);
> > > +             pr_emerg("PHYS_OFFSET: 0x%llx\n", PHYS_OFFSET);
> > >       } else {
> > >               pr_emerg("Kernel Offset: disabled\n");
> > >       }
> > > --
> > > 2.18.0
> > >



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-12-14  0:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-12 10:56 [PATCH] arm64: kaslr: print PHYS_OFFSET in dump_kernel_offset() Miles Chen
2018-12-13 18:13 ` Will Deacon
2018-12-13 18:15   ` Ard Biesheuvel
2018-12-14  0:52     ` Miles Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox