Skip to contentSkip to conversation

x86/irqflags: Fix build failure

PATCH In review Juergen Gross 2 participants 13 messages Jan 15 – Jan 19 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/irqflags: Fix build failure

When building with CONFIG_PARAVIRT, but without CONFIG_PARAVIRT_XXL, a build failure might happen due to arch/x86/include/asm/irqflags.h only including asm/paravirt.h when CONFIG_PARAVIRT_XXL is set.

This was spotted when testing a patch removing the "#include <asm/paravirt.h>" from another header.

Fixes 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
---
 arch/x86/include/asm/irqflags.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/include/asm/irqflags.h +3 -3
index a1193e9d65f2..4d4d02e31287 100644
@@ -96,11 +96,11 @@ static __always_inline void halt(void)
 	native_halt();
 }
 #endif /* __ASSEMBLY__ */
+#else
+#include <asm/paravirt.h>
 #endif /* CONFIG_PARAVIRT */
 
-#ifdef CONFIG_PARAVIRT_XXL
-#include <asm/paravirt.h>
-#else
+#ifndef CONFIG_PARAVIRT_XXL
 #ifndef __ASSEMBLER__
 #include <linux/types.h>
 
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 10 lines · Juergen Gross

When building with CONFIG_PARAVIRT, but without CONFIG_PARAVIRT_XXL, a build failure might happen due to arch/x86/include/asm/irqflags.h only including asm/paravirt.h when CONFIG_PARAVIRT_XXL is set.

This was spotted when testing a patch removing the "#include <asm/paravirt.h>" from another header.

Fixes 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")

So this got reported against a patchset which is not upstream yet, yet your
Fixes: points to a patch from ~year ago.

The right thing to do would be to take *that* fix and prepend your not-upstrea-yet set with it.

Also, why does *this* fix need to go to all kernels which contain the patch in Fixes?

All this sounds weird.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#2 lore raw
Quoted 8 lines · Borislav Petkov
Quoted 7 lines · Juergen Gross

When building with CONFIG_PARAVIRT, but without CONFIG_PARAVIRT_XXL, a build failure might happen due to arch/x86/include/asm/irqflags.h only including asm/paravirt.h when CONFIG_PARAVIRT_XXL is set.

This was spotted when testing a patch removing the "#include <asm/paravirt.h>" from another header.

Quoted 6 lines
Quoted 3 lines
Fixes 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")

So this got reported against a patchset which is not upstream yet, yet your
Fixes: points to a patch from ~year ago.

Yes. The problem was introduced by that patch. It was pure luck paravirt.h got included via another header.

Quoted 2 lines

The right thing to do would be to take *that* fix and prepend your not-upstrea-yet set with it.

Yes, this would be a possibility. I still can do that, but I saw no real reason to resend the other 5 patches without any change.

Quoted 2 lines

Also, why does *this* fix need to go to all kernels which contain the patch in Fixes?

Whenever another patch is being backported results in the same problem, it will be mitigated by my fix.

Quoted 1 line

All this sounds weird.

TBH I'm quite puzzled that this build failure hasn't been seen before. As I said
above: pure luck.

Juergen

maintainer
#3 lore raw
Quoted 2 lines · Jürgen Groß

Yes. The problem was introduced by that patch. It was pure luck paravirt.h got included via another header.

So there's no configuration right now which triggers this problem?

Quoted 2 lines

Yes, this would be a possibility. I still can do that, but I saw no real reason to resend the other 5 patches without any change.

You mean, you expect me to read minds? :)

Quoted 2 lines

TBH I'm quite puzzled that this build failure hasn't been seen before. As I said
above: pure luck.

Sorry, we don't do "pure luck."

This either fixes something in the *current* kernel or if not, it should be applied as an urgent fix when it does after "pure luck" has been debugged properly and explained.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw
Quoted 5 lines · Borislav Petkov
Quoted 2 lines · Jürgen Groß

Yes. The problem was introduced by that patch. It was pure luck paravirt.h got included via another header.

So there's no configuration right now which triggers this problem?

I don't know any. This doesn't mean there is none.

Quoted 5 lines
Quoted 3 lines

Yes, this would be a possibility. I still can do that, but I saw no real reason to resend the other 5 patches without any change.

You mean, you expect me to read minds? :)

Oh, you can't? ;-)

Quoted 9 lines
Quoted 3 lines

TBH I'm quite puzzled that this build failure hasn't been seen before. As I said
above: pure luck.

Sorry, we don't do "pure luck."

This either fixes something in the *current* kernel or if not, it should be applied as an urgent fix when it does after "pure luck" has been debugged properly and explained.

Well, your call in this case.

So do you want me to resend the series triggering the issue with this patch prepended, or are you fine with applying this patch to the tip branch for the next merge window, and wait for the other series to get the needed Acks?

Juergen

maintainer
#5 lore raw
Quoted 3 lines · Jürgen Groß

So do you want me to resend the series triggering the issue with this patch prepended, or are you fine with applying this patch to the tip branch for the next merge window, and wait for the other series to get the needed Acks?

Or, you could redesign your set in a way so that the build error doesn't happen and there's no need for an urgent patch with a questionable Fixes: tag?

Also, the "pure luck" thing would need debugging too, to figure out why the build error happens.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#6 lore raw
Quoted 11 lines · Borislav Petkov
Quoted 3 lines · Jürgen Groß

So do you want me to resend the series triggering the issue with this patch prepended, or are you fine with applying this patch to the tip branch for the next merge window, and wait for the other series to get the needed Acks?

Or, you could redesign your set in a way so that the build error doesn't happen and there's no need for an urgent patch with a questionable Fixes: tag?

Also, the "pure luck" thing would need debugging too, to figure out why the build error happens.

Well, the patch IS the fix for the build error.

paravirt.h just needs to be included if CONFIG_PARAVIRT is set. It isn't enough to include it only if CONFIG_PARAVIRT_XXL is set.

The patch listed under "Fixes:" moved the halt related functions from the CONFIG_PARAVIRT_XXL to the CONFIG_PARAVIRT umbrella, but missed to move the #include of paravirt.h, too. This is what my patch is doing.

Juergen

#7 lore raw
In reply to Borislav Petkov
Quoted 11 lines · Borislav Petkov
Quoted 3 lines · Jürgen Groß

So do you want me to resend the series triggering the issue with this patch prepended, or are you fine with applying this patch to the tip branch for the next merge window, and wait for the other series to get the needed Acks?

Or, you could redesign your set in a way so that the build error doesn't happen and there's no need for an urgent patch with a questionable Fixes: tag?

Also, the "pure luck" thing would need debugging too, to figure out why the build error happens.

Ah, yes. The build error happens due to the change of io.h: instead of including paravirt.h only paravirt-base.h is included. Obviously several sources did include io.h and irqflags.h, but no other header including paravirt.h.

Juergen

maintainer
#8 lore raw
Quoted 4 lines · Jürgen Groß

Ah, yes. The build error happens due to the change of io.h: instead of including paravirt.h only paravirt-base.h is included. Obviously several sources did include io.h and irqflags.h, but no other header including paravirt.h.

So your io set needs the paravirt pile from tip/x86/paravirt. So you can include paravirt.h in there and no need for a "fix" patch.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#9 lore raw
Quoted 9 lines · Borislav Petkov
Quoted 4 lines · Jürgen Groß

Ah, yes. The build error happens due to the change of io.h: instead of including paravirt.h only paravirt-base.h is included. Obviously several sources did include io.h and irqflags.h, but no other header including paravirt.h.

So your io set needs the paravirt pile from tip/x86/paravirt. So you can include paravirt.h in there and no need for a "fix" patch.

Sigh.

paravirt.h is a big hammer.

Switching to paravirt-base.h is part of the goal to reduce include hell with paravirt.

Why do you insist on keeping irqflags.h inconsistent by not defining some prototypes if CONFIG_PARAVIRT is set, but not CONFIG_PARAVIRT_XXL.

Commit 22cc5ca5de52 was just missing the part of my patch. It was wrong. Should have moved the "#include <asm/paravirt.h>" from the CONFIG_PARAVIRT_XXL to the CONFIG_PARAVIRT umbrella, just like my patch.

Or do you really think everyone including irqflags.h should include io.h, too?

Juergen

maintainer
#10 lore raw
Quoted 2 lines · Jürgen Groß

Why do you insist on keeping irqflags.h inconsistent by not defining some prototypes if CONFIG_PARAVIRT is set, but not CONFIG_PARAVIRT_XXL.

The only thing I'm insisting on is proper patch documentation because stable patches do get looked at by stable folks so it better be clear what we're fixing.

Quoted 4 lines

Commit 22cc5ca5de52 was just missing the part of my patch. It was wrong. Should have moved the "#include <asm/paravirt.h>" from the CONFIG_PARAVIRT_XXL to the CONFIG_PARAVIRT umbrella, just like my patch.

So this makes more sense. Your current patch is fixing 22cc5ca5de52. But nothing breaks currently, only after you switch to including paravirt-base.h and not the big fat header.

Which means that the patch at the beginning of this thread should be the first patch in your io set, it should have a Fixes: tag but we should NOT send it to stable because nothing breaks there.

Your io patchset, at a quick glance, is cleanups so it won't go to stable either so no need for that fix to go stable either.

Does that sound like a good strategy?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#11 lore raw
Quoted 17 lines · Borislav Petkov
Quoted 2 lines · Jürgen Groß

Why do you insist on keeping irqflags.h inconsistent by not defining some prototypes if CONFIG_PARAVIRT is set, but not CONFIG_PARAVIRT_XXL.

The only thing I'm insisting on is proper patch documentation because stable patches do get looked at by stable folks so it better be clear what we're fixing.

Quoted 4 lines

Commit 22cc5ca5de52 was just missing the part of my patch. It was wrong. Should have moved the "#include <asm/paravirt.h>" from the CONFIG_PARAVIRT_XXL to the CONFIG_PARAVIRT umbrella, just like my patch.

So this makes more sense. Your current patch is fixing 22cc5ca5de52. But nothing breaks currently, only after you switch to including paravirt-base.h and not the big fat header.

Quoted 9 lines

Which means that the patch at the beginning of this thread should be the first patch in your io set, it should have a Fixes: tag but we should NOT send it to stable because nothing breaks there.

Your io patchset, at a quick glance, is cleanups so it won't go to stable either so no need for that fix to go stable either.

Does that sound like a good strategy?

Fine with me.

I'll change the commit message to:

Commit 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT") moved some paravirt hooks from the CONFIG_PARAVIRT_XXL umbrella to CONFIG_PARAVIRT, but missed to move the associated "#include <asm/paravirt.h>" in irqflags.h from CONFIG_PARAVIRT_XXL to CONFIG_PARAVIRT.

This hasn't resulted in build failures yet, as all use cases of irqflags.h had paravirt.h included via other header files, even without CONFIG_PARAVIRT_XXL being set.

In order to allow changing those other header files, e.g. by no longer including paravirt.h, fix irqflags.h by moving inclusion of paravirt.h under the CONFIG_PARAVIRT umbrella.

Is that fine with you?

Juergen

maintainer
#12 lore raw
Quoted 12 lines · Jürgen Groß

I'll change the commit message to:

Commit 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT") moved some paravirt hooks from the CONFIG_PARAVIRT_XXL umbrella to CONFIG_PARAVIRT, but missed to move the associated "#include <asm/paravirt.h>" in irqflags.h from CONFIG_PARAVIRT_XXL to CONFIG_PARAVIRT.

This hasn't resulted in build failures yet, as all use cases of irqflags.h had paravirt.h included via other header files, even without CONFIG_PARAVIRT_XXL being set.

Quoted 5 lines

In order to allow changing those other header files, e.g. by no longer including paravirt.h, fix irqflags.h by moving inclusion of paravirt.h under the CONFIG_PARAVIRT umbrella.

Is that fine with you?

Yap, LGTM.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette