Skip to contentSkip to conversation

hyperv: Include linux/types.h to avoid build break

PATCH In review Andy Shevchenko 2 participants 4 messages Aug 13, 2017 – Aug 14, 2017 Hyper-V/Azure core and drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 hyperv: Include linux/types.h to avoid build break

The commit 2ffd9e33ce4a

("x86/hyper-v: Use hypercall for remote TLB flush")

introduced a new C-file where uapi/linux/hyperv.h is included first.

This makes build failed since UAPI headers are heavily dependent to special types of variables, e.g. __u8.

CC arch/x86/hyperv/mmu.o
In file included from include/linux/hyperv.h:28:0,

                 from arch/x86/hyperv/mmu.c:3:

include/uapi/linux/hyperv.h:71:2: error: unknown type name ‘__u8’
__u8 operation;
^~~~

Include linux/types.h to the UAPI header like many others do.

Cc Vitaly Kuznetsov <[email protected]>
Cc K. Y. Srinivasan <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Stephen Hemminger <[email protected]>
---
 include/uapi/linux/hyperv.h | 2 ++
 1 file changed, 2 insertions(+)
include/uapi/linux/hyperv.h +2 -0
index 7560c0aa60e3..aaf32131b556 100644
@@ -25,6 +25,8 @@
 #ifndef _UAPI_HYPERV_H
 #define _UAPI_HYPERV_H
 
+#include <linux/types.h>
+
 /*
  * Framework version for util services.
  */
Signature · 1 line
2.13.2
#1 lore raw

PATCH 2/2 MAINTAINERS: Add missed file for Hyper-V

include/uapi/linux/hyperv.h is a part of Hyper-V support.

Cc K. Y. Srinivasan <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Stephen Hemminger <[email protected]>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index acf95f158b97..ab96ea3003ef 100644
@@ -6314,6 +6314,7 @@ F:	drivers/scsi/storvsc_drv.c
 F:	drivers/uio/uio_hv_generic.c
 F:	drivers/video/fbdev/hyperv_fb.c
 F:	include/linux/hyperv.h
+F:	include/uapi/linux/hyperv.h
 F:	tools/hv/
 F:	Documentation/ABI/stable/sysfs-bus-vmbus
 
Signature · 1 line
2.13.2
#2 lore raw

[tip:x86/platform] MAINTAINERS: Add missed file for Hyper-V

MAINTAINERS: Add missed file for Hyper-V
Commit-ID:  db46e14f8a3c2657b8f777d422d7dfc7e61e52e9
Gitweb:     http://git.kernel.org/tip/db46e14f8a3c2657b8f777d422d7dfc7e61e52e9
Author:     Andy Shevchenko <[email protected]>
AuthorDate: Sun, 13 Aug 2017 16:34:44 +0300
Committer:  Ingo Molnar <[email protected]>
CommitDate: Mon, 14 Aug 2017 12:45:39 +0200

MAINTAINERS: Add missed file for Hyper-V

include/uapi/linux/hyperv.h is a part of Hyper-V support.

---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
index 84d6a82..e99c748 100644
@@ -6270,6 +6270,7 @@ F:	drivers/scsi/storvsc_drv.c
 F:	drivers/uio/uio_hv_generic.c
 F:	drivers/video/fbdev/hyperv_fb.c
 F:	include/linux/hyperv.h
+F:	include/uapi/linux/hyperv.h
 F:	tools/hv/
 F:	Documentation/ABI/stable/sysfs-bus-vmbus
 
#3 lore raw
In reply to Andy Shevchenko
Quoted 10 lines · Andy Shevchenko

The commit 2ffd9e33ce4a

    ("x86/hyper-v: Use hypercall for remote TLB flush")

introduced a new C-file where uapi/linux/hyperv.h is included first.

This makes build failed since UAPI headers are heavily dependent to special
types of variables, e.g. __u8.

Quoted 9 lines

  CC      arch/x86/hyperv/mmu.o
In file included from include/linux/hyperv.h:28:0,
                 from arch/x86/hyperv/mmu.c:3:
include/uapi/linux/hyperv.h:71:2: error: unknown type name ‘__u8’ __u8 operation;
  ^~~~

Include linux/types.h to the UAPI header like many others do.

Oops, it's because I have an update to this file in my local uuid branch.

In any case this is right thing to do independently of uuid.h inclusion.

Please, ignore this patch for now, but note the second one is still valid.

Quoted 22 lines
Cc Vitaly Kuznetsov <[email protected]>
Cc K. Y. Srinivasan <[email protected]>
Cc Haiyang Zhang <[email protected]>
Cc Stephen Hemminger <[email protected]>

---
 include/uapi/linux/hyperv.h | 2 ++

 1 file changed, 2 insertions(+)
include/uapi/linux/hyperv.h +0 -0
index 7560c0aa60e3..aaf32131b556 100644
@@ -25,6 +25,8 @@
  #ifndef _UAPI_HYPERV_H
  #define _UAPI_HYPERV_H

include/uapi/linux/hyperv.h +2 -0
+#include <linux/types.h>
+

 /*
  * Framework version for util services. */

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy