Skip to contentSkip to conversation

x86/hyperv: change hv_tlb_flush_ex to fix clang build

PATCH In review Wei Liu 3 participants 3 messages Dec 23, 2019

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 x86/hyperv: change hv_tlb_flush_ex to fix clang build

Clang complains:

In file included from synic.c:15:
/builds/xen-project/xen/xen/include/asm/guest/hyperv-tlfs.h:900:18: error: field 'hv_vp_set' with variable sized type 'struct hv_vpset' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]

        struct hv_vpset hv_vp_set;
                        ^

1 error generated.
/builds/xen-project/xen/xen/Rules.mk:198: recipe for target 'synic.o' failed make[6]: *** [synic.o] Error 1

Comment out the last variable size array from hv_tlb_flush_ex to fix clang builds.

Cc Paul Durrant <[email protected]>
---
 xen/include/asm-x86/guest/hyperv-tlfs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/asm-x86/guest/hyperv-tlfs.h +2 -2
index fe9fb232d0..5b43f99de8 100644
@@ -908,12 +908,12 @@ struct hv_tlb_flush {
 	u64 gva_list[];
 } __packed;
 
-/* HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressListEx hypercalls */
+/* HvFlushVirtualAddressSpaceEx hypercall */
 struct hv_tlb_flush_ex {
 	u64 address_space;
 	u64 flags;
 	struct hv_vpset hv_vp_set;
-	u64 gva_list[];
+	/* u64 gva_list[]; */
 } __packed;
 
 struct hv_partition_assist_pg {
Signature · 7 lines
2.20.1


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Wei Liu

Clang complains:

In file included from synic.c:15:
/builds/xen-project/xen/xen/include/asm/guest/hyperv-tlfs.h:900:18: error: field 'hv_vp_set' with variable sized type 'struct hv_vpset' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]

        struct hv_vpset hv_vp_set;
                        ^
Quoted 8 lines

1 error generated.
/builds/xen-project/xen/xen/Rules.mk:198: recipe for target 'synic.o' failed make[6]: *** [synic.o] Error 1

Comment out the last variable size array from hv_tlb_flush_ex to fix clang builds.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v2 1/1
#2 lore raw
In reply to Wei Liu
Quoted 11 lines · Wei Liu

Clang complains:

In file included from synic.c:15:
/builds/xen-project/xen/xen/include/asm/guest/hyperv-tlfs.h:900:18: error: field 'hv_vp_set' with variable sized type 'struct hv_vpset' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]

        struct hv_vpset hv_vp_set;
                        ^

1 error generated.
/builds/xen-project/xen/xen/Rules.mk:198: recipe for target 'synic.o' failed make[6]: *** [synic.o] Error 1

Quoted 5 lines

Comment out the last variable size array from hv_tlb_flush_ex to fix clang builds.

Cc Paul Durrant <[email protected]>
Quoted 24 lines
---
 xen/include/asm-x86/guest/hyperv-tlfs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
xen/include/asm-x86/guest/hyperv-tlfs.h +2 -3
index fe9fb232d0..5b43f99de8 100644
@@ -908,12 +908,12 @@ struct hv_tlb_flush {
        u64 gva_list[];
 } __packed;
 
-/* HvFlushVirtualAddressSpaceEx, HvFlushVirtualAddressListEx hypercalls */
+/* HvFlushVirtualAddressSpaceEx hypercall */
 struct hv_tlb_flush_ex {
        u64 address_space;
        u64 flags;
        struct hv_vpset hv_vp_set;
-       u64 gva_list[];
+       /* u64 gva_list[]; */
 } __packed;
 
 struct hv_partition_assist_pg {
--
Quoted 2 lines

2.20.1

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel