* [PATCH] x86: relocs is only used with 32bit
@ 2009-03-11 19:22 Yinghai Lu
2009-03-12 4:28 ` H. Peter Anvin
0 siblings, 1 reply; 4+ messages in thread
From: Yinghai Lu @ 2009-03-11 19:22 UTC (permalink / raw)
To: Ingo Molnar, H. Peter Anvin, Thomas Gleixner; +Cc: linux-kernel@vger.kernel.org
Impact: cleanup
those lines is not needed for 64bit
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/boot/compressed/Makefile | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Index: linux-2.6/arch/x86/boot/compressed/Makefile
===================================================================
--- linux-2.6.orig/arch/x86/boot/compressed/Makefile
+++ linux-2.6/arch/x86/boot/compressed/Makefile
@@ -26,6 +26,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment
$(obj)/vmlinux.bin: vmlinux FORCE
$(call if_changed,objcopy)
+ifeq ($(CONFIG_X86_32),y)
targets += vmlinux.bin.all vmlinux.relocs relocs
hostprogs-$(CONFIG_X86_32) += relocs
@@ -42,8 +43,6 @@ quiet_cmd_relocbin = BUILD $@
$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
$(call if_changed,relocbin)
-ifeq ($(CONFIG_X86_32),y)
-
ifdef CONFIG_RELOCATABLE
$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
$(call if_changed,gzip)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: relocs is only used with 32bit
2009-03-11 19:22 [PATCH] x86: relocs is only used with 32bit Yinghai Lu
@ 2009-03-12 4:28 ` H. Peter Anvin
2009-03-13 22:29 ` Eric W. Biederman
0 siblings, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2009-03-12 4:28 UTC (permalink / raw)
To: Yinghai Lu; +Cc: Ingo Molnar, Thomas Gleixner, linux-kernel@vger.kernel.org
Hi Yinghai,
In general I prefer minimizing the conditional sections rather than
maximizing them. If nothing else, it catches errors earlier that way,
and makes it easier to eventually eliminate them entirely.
-hpa
Yinghai Lu wrote:
> Impact: cleanup
>
> those lines is not needed for 64bit
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> ---
> arch/x86/boot/compressed/Makefile | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> Index: linux-2.6/arch/x86/boot/compressed/Makefile
> ===================================================================
> --- linux-2.6.orig/arch/x86/boot/compressed/Makefile
> +++ linux-2.6/arch/x86/boot/compressed/Makefile
> @@ -26,6 +26,7 @@ OBJCOPYFLAGS_vmlinux.bin := -R .comment
> $(obj)/vmlinux.bin: vmlinux FORCE
> $(call if_changed,objcopy)
>
> +ifeq ($(CONFIG_X86_32),y)
>
> targets += vmlinux.bin.all vmlinux.relocs relocs
> hostprogs-$(CONFIG_X86_32) += relocs
> @@ -42,8 +43,6 @@ quiet_cmd_relocbin = BUILD $@
> $(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE
> $(call if_changed,relocbin)
>
> -ifeq ($(CONFIG_X86_32),y)
> -
> ifdef CONFIG_RELOCATABLE
> $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
> $(call if_changed,gzip)
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: relocs is only used with 32bit
2009-03-12 4:28 ` H. Peter Anvin
@ 2009-03-13 22:29 ` Eric W. Biederman
2009-03-13 23:31 ` H. Peter Anvin
0 siblings, 1 reply; 4+ messages in thread
From: Eric W. Biederman @ 2009-03-13 22:29 UTC (permalink / raw)
To: H. Peter Anvin
Cc: Yinghai Lu, Ingo Molnar, Thomas Gleixner,
linux-kernel@vger.kernel.org
"H. Peter Anvin" <hpa@zytor.com> writes:
> Hi Yinghai,
>
> In general I prefer minimizing the conditional sections rather than
> maximizing them. If nothing else, it catches errors earlier that way,
> and makes it easier to eventually eliminate them entirely.
Makes sense. Although in this case that rule appears like it
can't even execute on x86_64.
The architectural differences result in different tradeoffs so the
relocation design is completely different on x86_64 and x86_32.
On x86_64 we just change the underlying page tables to point
at different physical addresses and have a fixed virtual address.
Since x86_64 is best with short (< 2GB) offsets that is a fairly
optimal.
On x86_32 where address space is precious and it doesn't really
matter where the kernel lives we take a 5% or so size penalty
to hold relocations in the binary and update the kernel at boot
time so everything assumes we run at the loaded address.
With the result that we need a link time helper on x86_32 and
not on x86_64.
Eric
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86: relocs is only used with 32bit
2009-03-13 22:29 ` Eric W. Biederman
@ 2009-03-13 23:31 ` H. Peter Anvin
0 siblings, 0 replies; 4+ messages in thread
From: H. Peter Anvin @ 2009-03-13 23:31 UTC (permalink / raw)
To: Eric W. Biederman
Cc: Yinghai Lu, Ingo Molnar, Thomas Gleixner,
linux-kernel@vger.kernel.org
Eric W. Biederman wrote:
>>
>> In general I prefer minimizing the conditional sections rather than
>> maximizing them. If nothing else, it catches errors earlier that way,
>> and makes it easier to eventually eliminate them entirely.
>
> Makes sense. Although in this case that rule appears like it
> can't even execute on x86_64.
>
That's fine. This is the same reason why it's better to have
if () { ... } than #ifdef as long as the condition can be statically
determined -- at least this way make will complain about a syntax error.
-hpa
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-03-13 23:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-11 19:22 [PATCH] x86: relocs is only used with 32bit Yinghai Lu
2009-03-12 4:28 ` H. Peter Anvin
2009-03-13 22:29 ` Eric W. Biederman
2009-03-13 23:31 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox