diff mbox series

[v2] x86/hyperv: change hv_tlb_flush_ex to fix clang build

Message ID 20191223110330.26883-1-liuwe@microsoft.com (mailing list archive)
State New, archived
Headers show
Series [v2] x86/hyperv: change hv_tlb_flush_ex to fix clang build | expand

Commit Message

Wei Liu Dec. 23, 2019, 11:03 a.m. UTC
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.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Cc: Paul Durrant <paul@xen.org>
---
 xen/include/asm-x86/guest/hyperv-tlfs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Beulich Dec. 23, 2019, 11:05 a.m. UTC | #1
On 23.12.2019 12:03, Wei Liu wrote:
> 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.
> 
> Signed-off-by: Wei Liu <liuwe@microsoft.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>
Paul Durrant Dec. 23, 2019, 2:20 p.m. UTC | #2
On Mon, 23 Dec 2019 at 11:03, Wei Liu <wl@xen.org> wrote:
>
> 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.
>
> Signed-off-by: Wei Liu <liuwe@microsoft.com>
> Cc: Paul Durrant <paul@xen.org>

Reviewed-by: Paul Durrant <paul@xen.org>

> ---
>  xen/include/asm-x86/guest/hyperv-tlfs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-x86/guest/hyperv-tlfs.h
> index fe9fb232d0..5b43f99de8 100644
> --- a/xen/include/asm-x86/guest/hyperv-tlfs.h
> +++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
> @@ -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 {
> --
> 2.20.1
>
diff mbox series

Patch

diff --git a/xen/include/asm-x86/guest/hyperv-tlfs.h b/xen/include/asm-x86/guest/hyperv-tlfs.h
index fe9fb232d0..5b43f99de8 100644
--- a/xen/include/asm-x86/guest/hyperv-tlfs.h
+++ b/xen/include/asm-x86/guest/hyperv-tlfs.h
@@ -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 {