diff options
author | Paul Mackerras <paulus@samba.org> | 2008-10-08 10:03:29 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-10-10 00:55:19 -0400 |
commit | 91a00302959545a9ae423e99732b1e46eb19e877 (patch) | |
tree | 180192f6f8d2b97c332d970fc07278010287f3f5 /arch/powerpc/kernel | |
parent | 58f467ce1476f5b2a347cee3a32275b737fbd667 (diff) |
powerpc: Sync RPA note in zImage with kernel's RPA note
Commit 9b09c6d909dfd8de96b99b9b9c808b94b0a71614 ("powerpc: Change the
default link address for pSeries zImage kernels") changed the
real-base value in the CHRP note added by the addnote program from
12MB to 32MB to give more space for Open Firmware to load the zImage.
(The real-base value says where we want OF to position itself in
memory.) However, this change was ineffective on most pSeries
machines, because the RPA note added by addnote has the "ignore me"
flag set to 1. This was intended to tell OF to ignore just the RPA
note, but has the side effect of also making OF ignore the CHRP note
(at least on most pSeries machines).
To solve this we have to set the "ignore me" flag to 0 in the RPA
note. (We can't just omit the RPA note because that is equivalent to
having an RPA note with default values, and the default values are not
what we want.) However, then we have to make sure the values in the
zImage's RPA note match up with the values that the kernel supplies
later in prom_init.c with either the ibm,client-architecture-support
call or the process-elf-header call in prom_send_capabilities().
So this sets the "ignore me" flag in the RPA note in addnote to 0, and
adjusts the RPA note values in addnote.c and in prom_init.c to be
consistent with each other and with the values in ibm_architecture_vec.
However, since the wrapper is independent of the kernel, this doesn't
ensure that the notes will stay consistent. To ensure that, this adds
code to addnote.c so that it can extract the kernel's RPA note from
the kernel binary and put that in the zImage. To that end, we put the
kernel's fake ELF header (which contains the kernel's RPA note) into
its own section, and arrange for wrapper to pull out that section with
objcopy and pass it to addnote, which then extracts the RPA note from
it and transfers it to the zImage.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/vmlinux.lds.S | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 7cf274a2b334..2fdbc18ae94a 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -732,7 +732,7 @@ static struct fake_elf { | |||
732 | u32 ignore_me; | 732 | u32 ignore_me; |
733 | } rpadesc; | 733 | } rpadesc; |
734 | } rpanote; | 734 | } rpanote; |
735 | } fake_elf = { | 735 | } fake_elf __section(.fakeelf) = { |
736 | .elfhdr = { | 736 | .elfhdr = { |
737 | .e_ident = { 0x7f, 'E', 'L', 'F', | 737 | .e_ident = { 0x7f, 'E', 'L', 'F', |
738 | ELFCLASS32, ELFDATA2MSB, EV_CURRENT }, | 738 | ELFCLASS32, ELFDATA2MSB, EV_CURRENT }, |
@@ -774,13 +774,13 @@ static struct fake_elf { | |||
774 | .type = 0x12759999, | 774 | .type = 0x12759999, |
775 | .name = "IBM,RPA-Client-Config", | 775 | .name = "IBM,RPA-Client-Config", |
776 | .rpadesc = { | 776 | .rpadesc = { |
777 | .lpar_affinity = 0, | 777 | .lpar_affinity = 1, |
778 | .min_rmo_size = 64, /* in megabytes */ | 778 | .min_rmo_size = 128, /* in megabytes */ |
779 | .min_rmo_percent = 0, | 779 | .min_rmo_percent = 0, |
780 | .max_pft_size = 48, /* 2^48 bytes max PFT size */ | 780 | .max_pft_size = 46, /* 2^46 bytes max PFT size */ |
781 | .splpar = 1, | 781 | .splpar = 1, |
782 | .min_load = ~0U, | 782 | .min_load = ~0U, |
783 | .new_mem_def = 0 | 783 | .new_mem_def = 1 |
784 | } | 784 | } |
785 | } | 785 | } |
786 | }; | 786 | }; |
diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index e6927fb2e655..b39c27ed7919 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S | |||
@@ -203,6 +203,9 @@ SECTIONS | |||
203 | *(.rela*) | 203 | *(.rela*) |
204 | } | 204 | } |
205 | 205 | ||
206 | /* Fake ELF header containing RPA note; for addnote */ | ||
207 | .fakeelf : AT(ADDR(.fakeelf) - LOAD_OFFSET) { *(.fakeelf) } | ||
208 | |||
206 | /* freed after init ends here */ | 209 | /* freed after init ends here */ |
207 | . = ALIGN(PAGE_SIZE); | 210 | . = ALIGN(PAGE_SIZE); |
208 | __init_end = .; | 211 | __init_end = .; |