mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nadav Amit <namit@vmware.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Ingo Molnar <mingo@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>,
	Sam Ravnborg <sam@ravnborg.org>,
	Michal Marek <michal.lkml@markovi.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"linux-kbuild@vger.kernel.org" <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm
Date: Wed, 26 Sep 2018 17:56:06 +0000	[thread overview]
Message-ID: <307823F9-DCCF-4384-9FBE-28642FAD6B4E@vmware.com> (raw)
In-Reply-To: <1aa5a1f3-ef3d-5cd3-831c-2202d73d3c9e@rasmusvillemoes.dk>

at 1:58 AM, Rasmus Villemoes <linux@rasmusvillemoes.dk> wrote:

> On 2018-09-18 23:28, Nadav Amit wrote:
> 
>> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
>> index 8f6e7eb8ae9f..944fa3bc9376 100644
>> --- a/arch/x86/Makefile
>> +++ b/arch/x86/Makefile
>> @@ -214,8 +214,8 @@ ifdef CONFIG_X86_64
>> KBUILD_LDFLAGS += $(call ld-option, -z max-page-size=0x200000)
>> endif
>> 
>> -# Speed up the build
>> -KBUILD_CFLAGS += -pipe
>> +# We cannot use -pipe flag since we give an additional .s file to the compiler
>> +#KBUILD_CFLAGS += -pipe
> 
> Is this really necessary? The gas manual says that one can use -- to
> name stdin, though that's probably a typo and should just be - . Doing
> 
> gcc -pipe -Wa,foo.s -Wa,-

Good idea. I didn’t think of it. Yes, this can do the trick. I’ll do it in
v9.

> does seem to work as expected (and would also make it possible to append
> some .s file should that ever be required).
>> +archmacros:
>> +	$(Q)$(MAKE) $(build)=arch/x86/kernel arch/x86/kernel/macros.s
>> +
>> +ASM_MACRO_FLAGS = -Wa,arch/x86/kernel/macros.s
>> +export ASM_MACRO_FLAGS
>> +KBUILD_CFLAGS += $(ASM_MACRO_FLAGS)
> How does this affect what gets rebuilt when one of the asm/foo.h files
> going into macros.s changes? Does that cause a global rebuild because
> everything depends on macros.s, or do we still only rebuild the files
> that actually include asm/foo.h?

There will not be a global rebuild. Any source file that uses the header
files that are included in macros.S will be rebuilt.

But your question actually raises two issues:

1. If macros.S changes, there *should* be a global rebuild, and currently
there wouldn’t be one. Do you happen to know what would be the appropriate
way to trigger one?

2. Someone might mistakenly use the macros through inline assembly without
including the header file. It would be better to detect such cases and fail
the build. I may be able to create another asm macro in the C part of the
header that would cause the build to fail. But let me know if you any
better idea.

Regards,
Nadav


  reply	other threads:[~2018-09-26 17:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-18 21:28 [PATCH v8 00/10] x86: macrofying inline asm for better compilation Nadav Amit
2018-09-18 21:28 ` [PATCH v8 01/10] xtensa: defining LINKER_SCRIPT for the linker script Nadav Amit
2018-09-18 21:28 ` [PATCH v8 02/10] Makefile: Prepare for using macros for inline asm Nadav Amit
2018-09-26  8:58   ` Rasmus Villemoes
2018-09-26 17:56     ` Nadav Amit [this message]
2018-09-27  7:52       ` Rasmus Villemoes
2018-10-01 22:01       ` Masahiro Yamada
2018-10-03 19:41         ` Nadav Amit
2018-10-02 10:59       ` Ingo Molnar
2018-10-03 19:43         ` hpa
2018-10-03 20:29           ` Nadav Amit
2018-09-18 21:28 ` [PATCH v8 03/10] x86: objtool: use asm macro for better compiler decisions Nadav Amit
2018-09-18 21:28 ` [PATCH v8 04/10] x86: refcount: prevent gcc distortions Nadav Amit
2018-09-18 21:28 ` [PATCH v8 05/10] x86: alternatives: macrofy locks for better inlining Nadav Amit
2018-09-18 21:28 ` [PATCH v8 06/10] x86: bug: prevent gcc distortions Nadav Amit
2018-09-18 21:28 ` [PATCH v8 07/10] x86: prevent inline distortion by paravirt ops Nadav Amit
2018-09-18 21:28 ` [PATCH v8 08/10] x86: extable: use macros instead of inline assembly Nadav Amit
2018-09-18 21:28 ` [PATCH v8 09/10] x86: cpufeature: " Nadav Amit
2018-09-18 21:28 ` [PATCH v8 10/10] x86: jump-labels: " Nadav Amit
2018-09-21 18:26 ` [PATCH v8 00/10] x86: macrofying inline asm for better compilation Kees Cook

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=307823F9-DCCF-4384-9FBE-28642FAD6B4E@vmware.com \
    --to=namit@vmware.com \
    --cc=hpa@zytor.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=michal.lkml@markovi.net \
    --cc=mingo@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®