Skip to contentSkip to conversation

x86/mshyperv: Remove unneeded includes from mshyperv.h

PATCH Thomas Gleixner 3 participants 4 messages Jun 23, 2017 – Jun 24, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

A recent commit included linux/slab.h in linux/irq.h. This breaks the build of vdso32 on a 64bit kernel.

The reason is that linux/irq.h gets included into the vdso code via linux/interrupt.h which is included from asm/mshyperv.h. That makes the 32bit vdso compile fail, because slab.h includes the pgtable headers for 64bit on a 64bit build.

Neither linux/clocksource.h nor linux/interrupt.h are needed in the mshyperv.h header file itself.

Remove the includes and unbreak the build.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")

---

arch/x86/include/asm/mshyperv.h +0 -2
index fba100713924..2f4acbdbfc51 100644
@@ -2,8 +2,6 @@
 #define _ASM_X86_MSHYPER_H
 
 #include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/clocksource.h>
 #include <asm/hyperv.h>
 
 /*
#1 lore raw
Quoted 23 lines · Thomas Gleixner

A recent commit included linux/slab.h in linux/irq.h. This breaks the build of vdso32 on a 64bit kernel.

The reason is that linux/irq.h gets included into the vdso code via linux/interrupt.h which is included from asm/mshyperv.h. That makes the 32bit vdso compile fail, because slab.h includes the pgtable headers for 64bit on a 64bit build.

Neither linux/clocksource.h nor linux/interrupt.h are needed in the mshyperv.h header file itself.

Remove the includes and unbreak the build.

Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")

---

arch/x86/include/asm/mshyperv.h +0 -0
index fba100713924..2f4acbdbfc51 100644

arch/x86/include/asm/mshyperv.h line 5

Quoted 6 lines
arch/x86/include/asm/mshyperv.h +0 -2
@@ -2,8 +2,6 @@
 #define _ASM_X86_MSHYPER_H
 
 #include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/clocksource.h>
 #include <asm/hyperv.h>

Bah. this needs the following delta fix:

arch/x86/include/asm/mshyperv.h +1 -0
@@ -2,6 +2,7 @@
 #define _ASM_X86_MSHYPER_H
 
 #include <linux/types.h>
+#include <linux/atomic.h>
 #include <asm/hyperv.h>
 
 /*
#2 lore raw

[tip:x86/urgent] x86/mshyperv: Remove excess #includes from mshyperv.h

In reply to Thomas Gleixner
x86/mshyperv: Remove excess #includes from mshyperv.h
Commit-ID:  26fcd952d5c977a94ac64bb44ed409e37607b2c9
Gitweb:     http://git.kernel.org/tip/26fcd952d5c977a94ac64bb44ed409e37607b2c9
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Fri, 23 Jun 2017 10:50:38 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sat, 24 Jun 2017 08:48:51 +0200

x86/mshyperv: Remove excess #includes from mshyperv.h

A recent commit included linux/slab.h in linux/irq.h. This breaks the build of vdso32 on a 64-bit kernel.

The reason is that linux/irq.h gets included into the vdso code via linux/interrupt.h which is included from asm/mshyperv.h. That makes the 32-bit vdso compile fail, because slab.h includes the pgtable headers for 64-bit on a 64-bit build.

Neither linux/clocksource.h nor linux/interrupt.h are needed in the mshyperv.h header file itself - it has a dependency on <linux/atomic.h>.

Remove the includes and unbreak the build.

Cc K. Y. Srinivasan <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Vitaly Kuznetsov <[email protected]>
Fixes dee863b571b0 ("hv: export current Hyper-V clocksource")
---
 arch/x86/include/asm/mshyperv.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
arch/x86/include/asm/mshyperv.h +1 -2
index fba1007..d5acc27 100644
@@ -2,8 +2,7 @@
 #define _ASM_X86_MSHYPER_H
 
 #include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/clocksource.h>
+#include <linux/atomic.h>
 #include <asm/hyperv.h>
 
 /*
#3 lore raw
In reply to Thomas Gleixner
url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/x86-mshyperv-Remove-unneeded-includes-from-mshyperv-h/20170624-121055 config: i386-randconfig-b0-06241558 (attached as .config)…

Hi Thomas,

[auto build test ERROR on tip/auto-latest]
[also build test ERROR on v4.12-rc6 next-20170623]
[cannot apply to tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url: https://github.com/0day-ci/linux/commits/Thomas-Gleixner/x86-mshyperv-Remove-unneeded-includes-from-mshyperv-h/20170624-121055
config: i386-randconfig-b0-06241558 (attached as .config)
compiler: gcc-5 (Debian 5.4.1-2) 5.4.1 20160904 reproduce:

        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

In file included from arch/x86/hyperv/hv_init.c:23:0:
arch/x86/include/asm/mshyperv.h: In function 'vmbus_signal_eom':

>> arch/x86/include/asm/mshyperv.h:115:6: error: implicit declaration of function 'cmpxchg' [-Werror=implicit-function-declaration]
     if (cmpxchg(&msg->header.message_type, old_msg_type,
         ^

Cyclomatic Complexity 1 arch/x86/include/asm/mshyperv.h:generate_guest_id Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:paravirt_read_msr Cyclomatic Complexity 1 arch/x86/hyperv/hv_init.c:read_hv_clock_msr Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:paravirt_write_msr Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:wrmsrl Cyclomatic Complexity 1 include/linux/clocksource.h:clocksource_register_hz Cyclomatic Complexity 1 arch/x86/include/asm/io.h:virt_to_phys Cyclomatic Complexity 4 arch/x86/hyperv/hv_init.c:hyperv_init Cyclomatic Complexity 1 arch/x86/hyperv/hv_init.c:hyperv_cleanup Cyclomatic Complexity 4 arch/x86/hyperv/hv_init.c:hv_do_hypercall Cyclomatic Complexity 2 arch/x86/hyperv/hv_init.c:hyperv_report_panic Cyclomatic Complexity 2 arch/x86/hyperv/hv_init.c:hv_is_hypercall_page_setup
cc1: some warnings being treated as errors
--
In file included from arch/x86//hyperv/hv_init.c:23:0:
arch/x86/include/asm/mshyperv.h: In function 'vmbus_signal_eom':

>> arch/x86/include/asm/mshyperv.h:115:6: error: implicit declaration of function 'cmpxchg' [-Werror=implicit-function-declaration]
     if (cmpxchg(&msg->header.message_type, old_msg_type,
         ^

Cyclomatic Complexity 1 arch/x86/include/asm/mshyperv.h:generate_guest_id Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:paravirt_read_msr Cyclomatic Complexity 1 arch/x86//hyperv/hv_init.c:read_hv_clock_msr Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:paravirt_write_msr Cyclomatic Complexity 1 arch/x86/include/asm/paravirt.h:wrmsrl Cyclomatic Complexity 1 include/linux/clocksource.h:clocksource_register_hz Cyclomatic Complexity 1 arch/x86/include/asm/io.h:virt_to_phys Cyclomatic Complexity 4 arch/x86//hyperv/hv_init.c:hyperv_init Cyclomatic Complexity 1 arch/x86//hyperv/hv_init.c:hyperv_cleanup Cyclomatic Complexity 4 arch/x86//hyperv/hv_init.c:hv_do_hypercall Cyclomatic Complexity 2 arch/x86//hyperv/hv_init.c:hyperv_report_panic Cyclomatic Complexity 2 arch/x86//hyperv/hv_init.c:hv_is_hypercall_page_setup
cc1: some warnings being treated as errors

vim +/cmpxchg +115 arch/x86/include/asm/mshyperv.h

e810e48c K. Y. Srinivasan 2017-01-19  109  	 * In case we blindly write msg->header.message_type we're going
e810e48c K. Y. Srinivasan 2017-01-19  110  	 * to lose it. We can still lose a message of the same type but
e810e48c K. Y. Srinivasan 2017-01-19  111  	 * we count on the fact that there can only be one
e810e48c K. Y. Srinivasan 2017-01-19  112  	 * CHANNELMSG_UNLOAD_RESPONSE and we don't care about other messages
e810e48c K. Y. Srinivasan 2017-01-19  113  	 * on crash.
e810e48c K. Y. Srinivasan 2017-01-19  114  	 */
e810e48c K. Y. Srinivasan 2017-01-19 @115  	if (cmpxchg(&msg->header.message_type, old_msg_type,
e810e48c K. Y. Srinivasan 2017-01-19  116  		    HVMSG_NONE) != old_msg_type)
e810e48c K. Y. Srinivasan 2017-01-19  117  		return;

e810e48c K. Y. Srinivasan 2017-01-19 118

:::::: The code at line 115 was first introduced by commit
:::::: e810e48c0c9a1a1ebb90cfe966bce6dc80ce08e7 Drivers: hv: vmbus: Move the code to signal end of message

:::::: TO: K. Y. Srinivasan <[email protected]> :::::: CC: Greg Kroah-Hartman <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation