All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Pavlu <petr.pavlu@suse.com>
To: Borislav Petkov <bp@alien8.de>
Cc: tglx@linutronix.de, mingo@redhat.com,
	dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
	nicolas@fjasle.eu, masahiroy@kernel.org,
	kirill.shutemov@linux.intel.com, tony.luck@intel.com,
	michael.roth@amd.com, nathan@kernel.org, ndesaulniers@google.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86: Avoid relocation information in final vmlinux
Date: Mon, 28 Nov 2022 15:38:08 +0100	[thread overview]
Message-ID: <16941b45-0f4f-e7c9-4602-d9acb0c612c3@suse.com> (raw)
In-Reply-To: <Y4EWqbCTBYEF8LOf@zn.tnic>

On 11/25/22 20:25, Borislav Petkov wrote:
> On Tue, Sep 27, 2022 at 10:46:32AM +0200, Petr Pavlu wrote:
>> diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
>> index 35ce1a64068b..eba7709d75ae 100644
>> --- a/arch/x86/boot/compressed/Makefile
>> +++ b/arch/x86/boot/compressed/Makefile
>> @@ -120,14 +120,12 @@ $(obj)/vmlinux.bin: vmlinux FORCE
>>  
>>  targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs
>>  
>> -CMD_RELOCS = arch/x86/tools/relocs
>> -quiet_cmd_relocs = RELOCS  $@
>> -      cmd_relocs = $(CMD_RELOCS) $< > $@;$(CMD_RELOCS) --abs-relocs $<
>> -$(obj)/vmlinux.relocs: vmlinux FORCE
>> -	$(call if_changed,relocs)
>> +# vmlinux.relocs is created by the vmlinux postlink step.
>> +vmlinux.relocs: vmlinux
>> +	@true
>>  
>>  vmlinux.bin.all-y := $(obj)/vmlinux.bin
>> -vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs
>> +vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += vmlinux.relocs
> 
> Any particular reason why vmlinux.relocs must move out of $(obj)/ where
> it resides now?

It looked slightly cleaner to me that Makefile.postlink generates
vmlinux.relocs at the same directory level where it is executed instead of
stuffing the file into arch/x86/boot/compressed. Makefile.postlink is invoked
in the context where it has no $(obj) variable set and has no immediate
knowledge about arch/x86/boot/compressed. It would also require that
Makefile.postlink makes first sure that this directory exists in the target
build tree as this step is run prior to arch/x86/boot/compressed/Makefile.

Let me know if this move of vmlinux.relocs is ok or if it would be preferred
to preserve its location.

With the move, the patch should be however at least updated to remove
vmlinux.relocs from arch/x86/boot/compressed/.gitignore, which I missed.

Thanks,
Petr

  reply	other threads:[~2022-11-28 14:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27  8:46 [PATCH v2] x86: Avoid relocation information in final vmlinux Petr Pavlu
2022-11-23 12:30 ` Borislav Petkov
2022-11-23 13:31   ` Bagas Sanjaya
2022-11-23 14:38     ` Borislav Petkov
2022-11-23 15:43   ` Petr Pavlu
2022-11-23 15:54     ` Borislav Petkov
2022-11-23 17:45       ` H. Peter Anvin
2022-11-24 10:03         ` Petr Pavlu
2022-11-24  9:21       ` Petr Pavlu
2022-11-24 12:38         ` Borislav Petkov
2022-11-24 13:33           ` Petr Pavlu
2022-11-24 15:41             ` Borislav Petkov
2022-11-25 16:41               ` Borislav Petkov
2022-11-25 19:25 ` Borislav Petkov
2022-11-28 14:38   ` Petr Pavlu [this message]
2023-06-14 18:42 ` [tip: x86/build] x86/build: " tip-bot2 for Petr Pavlu

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=16941b45-0f4f-e7c9-4602-d9acb0c612c3@suse.com \
    --to=petr.pavlu@suse.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=tglx@linutronix.de \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.