From: Michael Ellerman <mpe@ellerman•id.au>
To: Jason Yan <yanaijie@huawei•com>
Cc: Scott Wood <oss@buserror•net>, linuxppc-dev@lists•ozlabs.org
Subject: Re: Pull request: scottwood/linux.git next
Date: Wed, 13 Nov 2019 20:23:21 +1100 [thread overview]
Message-ID: <87pnhw165y.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <20191022232155.GA26174@home.buserror.net>
Scott Wood <oss@buserror•net> writes:
> This contains KASLR support for book3e 32-bit.
>
> The following changes since commit 612ee81b9461475b5a5612c2e8d71559dd3c7920:
>
> powerpc/papr_scm: Fix an off-by-one check in papr_scm_meta_{get, set} (2019-10-10 20:15:53 +1100)
>
> are available in the Git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git next
>
> for you to fetch changes up to 9df1ef3f1376ec5d3a1b51a4546c94279bcd88ca:
>
> powerpc/fsl_booke/32: Document KASLR implementation (2019-10-21 16:09:16 -0500)
>
> ----------------------------------------------------------------
> Jason Yan (12):
> powerpc: unify definition of M_IF_NEEDED
> powerpc: move memstart_addr and kernstart_addr to init-common.c
> powerpc: introduce kernstart_virt_addr to store the kernel base
> powerpc/fsl_booke/32: introduce create_kaslr_tlb_entry() helper
> powerpc/fsl_booke/32: introduce reloc_kernel_entry() helper
> powerpc/fsl_booke/32: implement KASLR infrastructure
This commit breaks booting on the qemu mac99 machine, using pmac32_defconfig.
$ qemu-system-ppc -nographic -vga none -M mac99 -m 1G -kernel vmlinux
>> =============================================================
>> OpenBIOS 1.1 [Oct 5 2018 08:21]
>> Configuration device id QEMU version 1 machine id 1
>> CPUs: 1
>> Memory: 1024M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,G4
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on Oct 5 2018 08:21
>> [ppc] Kernel already loaded (0x01000000 + 0x009d2920) (initrd 0x00000000 + 0x00000000)
>> [ppc] Kernel command line:
>> switching to new context:
OF stdout device is: /pci@f2000000/mac-io@c/escc@13000/ch-a@13020
Preparing to boot Linux version 5.4.0-rc2-gcc49-05398-g4e1bb50 (michael@alpine1-p1) (gcc version 7.4.0 (Ubuntu 7.4.0-1ubuntu1~18.04.1)) #30 Wed Nov 13 15:07:39 AEDT 2019
Detected machine type: 00000400
command line:
memory layout at init:
memory_limit : 00000000 (16 MB aligned)
alloc_bottom : 019d7000
alloc_top : 30000000
alloc_top_hi : 40000000
rmo_top : 30000000
ram_top : 40000000
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x019d8000 -> 0x019d70a4
Device tree struct 0x019d9000 -> 0x3fde7eb0
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x01000000 ...
And no output after that.
The problematic hunk is the change to early_32.c:
diff --git a/arch/powerpc/kernel/early_32.c b/arch/powerpc/kernel/early_32.c
index 3482118ffe76..6f8689d7ca7b 100644
--- a/arch/powerpc/kernel/early_32.c
+++ b/arch/powerpc/kernel/early_32.c
@@ -22,7 +22,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
unsigned long offset = reloc_offset();
/* First zero the BSS */
- memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
+ if (kernstart_virt_addr == KERNELBASE)
+ memset(PTRRELOC(&__bss_start), 0, __bss_stop - __bss_start);
/*
* Identify the CPU type and fix up code sections
@@ -32,5 +33,5 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
apply_feature_fixups();
- return KERNELBASE + offset;
+ return kernstart_virt_addr + offset;
}
It needs to use PTRRELOC() for the kernstart_virt_addr accesses.
I've made that change and squashed it into the series. I've pushed that
as a branch to here:
https://github.com/linuxppc/linux/commits/topic/kaslr-book3e32
That boots for me on qemu mac99.
Jason can you please test it on your setup with KASLR enabled to make
sure it still works.
cheers
next prev parent reply other threads:[~2019-11-13 9:25 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-22 23:21 Pull request: scottwood/linux.git next Scott Wood
2019-10-31 2:01 ` Jason Yan
2019-11-01 17:01 ` Scott Wood
2019-11-04 2:36 ` Jason Yan
2019-11-02 10:38 ` Michael Ellerman
2019-11-04 2:38 ` Jason Yan
2019-11-13 9:23 ` Michael Ellerman [this message]
2019-11-14 6:00 ` Jason Yan
-- strict thread matches above, loose matches on Subject: below --
2019-11-17 9:44 Scott Wood
2018-12-22 4:42 Scott Wood
2018-12-22 10:50 ` christophe leroy
2018-12-22 20:01 ` Scott Wood
2018-12-23 13:13 ` Michael Ellerman
2018-12-24 2:09 ` Scott Wood
2018-12-27 13:10 ` Christoph Hellwig
2018-12-28 0:03 ` Scott Wood
2018-10-23 0:22 Scott Wood
2018-08-11 5:29 Scott Wood
2018-01-21 7:55 Scott Wood
2018-01-23 5:24 ` Michael Ellerman
2017-08-29 4:20 Scott Wood
2017-05-06 3:42 Scott Wood
2017-01-27 23:53 Scott Wood
2017-02-17 11:08 ` Scott Wood
2017-02-18 8:00 ` Michael Ellerman
2016-12-12 8:17 Scott Wood
2016-12-13 15:49 ` Aneesh Kumar K.V
2016-12-13 18:34 ` Aneesh Kumar K.V
2016-09-27 22:08 Scott Wood
2016-07-21 17:09 Scott Wood
2016-05-17 1:37 Scott Wood
2016-05-19 12:35 ` Michael Ellerman
2016-03-12 3:15 Scott Wood
2016-03-15 0:19 ` Michael Ellerman
2016-03-15 7:01 ` Scott Wood
2016-03-15 9:07 ` Michael Ellerman
2016-03-15 17:50 ` Scott Wood
2016-03-15 10:27 ` Christophe Leroy
2016-01-04 21:38 Scott Wood
2016-01-14 13:05 ` Michael Ellerman
2015-10-28 21:56 Scott Wood
2015-08-18 4:30 Scott Wood
2015-08-26 14:14 ` Scott Wood
2015-08-27 1:14 ` Michael Ellerman
2015-06-05 23:06 Scott Wood
2015-04-02 22:47 Scott Wood
2015-02-03 17:20 Scott Wood
2015-02-04 0:58 ` Michael Ellerman
2015-02-04 1:05 ` Scott Wood
2015-02-04 2:25 ` Michael Ellerman
2014-11-18 5:20 Scott Wood
2014-09-22 22:21 Scott Wood
2014-09-23 3:52 ` Bob Cochran
2014-09-23 5:45 ` Scott Wood
2014-09-23 10:47 ` Joakim Tjernlund
2014-09-23 12:37 ` Scott Wood
2014-09-23 16:19 ` Bob Cochran
2014-10-03 19:52 ` Scott Wood
2014-10-03 23:06 ` Stephen Rothwell
2014-08-01 19:54 Scott Wood
2014-07-03 0:51 Scott Wood
2014-03-20 4:25 Scott Wood
2014-03-23 23:16 ` Benjamin Herrenschmidt
2014-03-23 23:33 ` Benjamin Herrenschmidt
2014-03-25 1:09 ` Scott Wood
2013-10-29 2:44 Scott Wood
2013-10-29 3:05 ` Scott Wood
2013-08-24 1:07 Scott Wood
2013-08-26 15:48 ` Scott Wood
2013-08-08 22:45 Scott Wood
2013-08-09 6:03 ` Benjamin Herrenschmidt
2013-08-09 14:43 ` Kumar Gala
2013-08-09 16:30 ` Scott Wood
2013-08-14 4:18 ` Benjamin Herrenschmidt
2013-08-14 17:02 ` Scott Wood
2013-08-14 21:01 ` Benjamin Herrenschmidt
2013-08-19 22:56 ` Scott Wood
2013-08-19 23:47 ` Benjamin Herrenschmidt
2013-08-19 23:49 ` Josh Boyer
2013-08-20 0:49 ` Benjamin Herrenschmidt
2013-07-01 23:43 Scott Wood
2013-07-02 7:43 ` Benjamin Herrenschmidt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pnhw165y.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman$(echo .)id.au \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=oss@buserror$(echo .)net \
--cc=yanaijie@huawei$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox