diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2020-07-30 10:20:40 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2020-08-02 20:24:07 -0400 |
commit | 27759eff63089f539ab9fac366498377ef6dd666 (patch) | |
tree | c93bf30d5d3bab2bd28240fb8238e45a1e95404f /recipes-extended/ipxe | |
parent | f84f789e969ccaa127a0b1e53935e96ddd21aa4f (diff) | |
download | meta-virtualization-27759eff63089f539ab9fac366498377ef6dd666.tar.gz |
ipxe: fix build with gcc 10.1.0
Apply two upstream patches to fix compiler warnings.
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-extended/ipxe')
3 files changed, 134 insertions, 0 deletions
diff --git a/recipes-extended/ipxe/files/ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch b/recipes-extended/ipxe/files/ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch new file mode 100644 index 00000000..62e8e9df --- /dev/null +++ b/recipes-extended/ipxe/files/ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From 8a1d66c7aec020f3e90254ed2fa55ecd9494fcc3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Brown <mcb30@ipxe.org> | ||
3 | Date: Sat, 27 Jun 2020 20:43:32 +0100 | ||
4 | Subject: [PATCH] [golan] Add explicit type casts for nodnic_queue_pair_type | ||
5 | |||
6 | GCC 10 emits warnings for implicit conversions of enumerated types. | ||
7 | |||
8 | The flexboot_nodnic code defines nodnic_queue_pair_type with values | ||
9 | identical to those of ib_queue_pair_type, and implicitly casts between | ||
10 | them. Add an explicit cast to fix the warning. | ||
11 | |||
12 | Signed-off-by: Michael Brown <mcb30@ipxe.org> | ||
13 | --- | ||
14 | src/drivers/infiniband/flexboot_nodnic.c | 6 ++++-- | ||
15 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/src/drivers/infiniband/flexboot_nodnic.c b/src/drivers/infiniband/flexboot_nodnic.c | ||
18 | index 93bb0544..7d039fff 100644 | ||
19 | --- a/drivers/infiniband/flexboot_nodnic.c | ||
20 | +++ b/drivers/infiniband/flexboot_nodnic.c | ||
21 | @@ -365,7 +365,8 @@ static int flexboot_nodnic_create_qp ( struct ib_device *ibdev, | ||
22 | goto qp_alloc_err; | ||
23 | } | ||
24 | |||
25 | - status = nodnic_port_create_qp(&port->port_priv, qp->type, | ||
26 | + status = nodnic_port_create_qp(&port->port_priv, | ||
27 | + (nodnic_queue_pair_type) qp->type, | ||
28 | qp->send.num_wqes * sizeof(struct nodnic_send_wqbb), | ||
29 | qp->send.num_wqes, | ||
30 | qp->recv.num_wqes * sizeof(struct nodnic_recv_wqe), | ||
31 | @@ -406,7 +407,8 @@ static void flexboot_nodnic_destroy_qp ( struct ib_device *ibdev, | ||
32 | struct flexboot_nodnic_port *port = &flexboot_nodnic->port[ibdev->port - 1]; | ||
33 | struct flexboot_nodnic_queue_pair *flexboot_nodnic_qp = ib_qp_get_drvdata ( qp ); | ||
34 | |||
35 | - nodnic_port_destroy_qp(&port->port_priv, qp->type, | ||
36 | + nodnic_port_destroy_qp(&port->port_priv, | ||
37 | + (nodnic_queue_pair_type) qp->type, | ||
38 | flexboot_nodnic_qp->nodnic_queue_pair); | ||
39 | |||
40 | free(flexboot_nodnic_qp); | ||
41 | -- | ||
42 | 2.17.1 | ||
43 | |||
diff --git a/recipes-extended/ipxe/files/ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch b/recipes-extended/ipxe/files/ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch new file mode 100644 index 00000000..e424d220 --- /dev/null +++ b/recipes-extended/ipxe/files/ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch | |||
@@ -0,0 +1,89 @@ | |||
1 | From 28cf9806d1632d378485005babec295da0c77fcf Mon Sep 17 00:00:00 2001 | ||
2 | From: Michael Brown <mcb30@ipxe.org> | ||
3 | Date: Sat, 27 Jun 2020 20:21:11 +0100 | ||
4 | Subject: [PATCH] [intel] Avoid spurious compiler warning on GCC 10 | ||
5 | |||
6 | GCC 10 produces a spurious warning about an out-of-bounds array access | ||
7 | for the unsized raw dword array in union intelvf_msg. | ||
8 | |||
9 | Avoid the warning by embedding the zero-length array within a struct. | ||
10 | |||
11 | Signed-off-by: Michael Brown <mcb30@ipxe.org> | ||
12 | --- | ||
13 | src/drivers/net/intelvf.c | 18 ++++++++++-------- | ||
14 | src/drivers/net/intelvf.h | 8 +++++++- | ||
15 | 2 files changed, 17 insertions(+), 9 deletions(-) | ||
16 | |||
17 | diff --git a/src/drivers/net/intelvf.c b/src/drivers/net/intelvf.c | ||
18 | index ac6fea74..0d48b417 100644 | ||
19 | --- a/drivers/net/intelvf.c | ||
20 | +++ b/drivers/net/intelvf.c | ||
21 | @@ -52,14 +52,15 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); | ||
22 | */ | ||
23 | static void intelvf_mbox_write ( struct intel_nic *intel, | ||
24 | const union intelvf_msg *msg ) { | ||
25 | + const struct intelvf_msg_raw *raw = &msg->raw; | ||
26 | unsigned int i; | ||
27 | |||
28 | /* Write message */ | ||
29 | DBGC2 ( intel, "INTEL %p sending message", intel ); | ||
30 | - for ( i = 0 ; i < ( sizeof ( *msg ) / sizeof ( msg->dword[0] ) ) ; i++){ | ||
31 | - DBGC2 ( intel, "%c%08x", ( i ? ':' : ' ' ), msg->dword[i] ); | ||
32 | - writel ( msg->dword[i], ( intel->regs + intel->mbox.mem + | ||
33 | - ( i * sizeof ( msg->dword[0] ) ) ) ); | ||
34 | + for ( i = 0 ; i < ( sizeof ( *msg ) / sizeof ( raw->dword[0] ) ) ; i++){ | ||
35 | + DBGC2 ( intel, "%c%08x", ( i ? ':' : ' ' ), raw->dword[i] ); | ||
36 | + writel ( raw->dword[i], ( intel->regs + intel->mbox.mem + | ||
37 | + ( i * sizeof ( raw->dword[0] ) ) ) ); | ||
38 | } | ||
39 | DBGC2 ( intel, "\n" ); | ||
40 | } | ||
41 | @@ -72,14 +73,15 @@ static void intelvf_mbox_write ( struct intel_nic *intel, | ||
42 | */ | ||
43 | static void intelvf_mbox_read ( struct intel_nic *intel, | ||
44 | union intelvf_msg *msg ) { | ||
45 | + struct intelvf_msg_raw *raw = &msg->raw; | ||
46 | unsigned int i; | ||
47 | |||
48 | /* Read message */ | ||
49 | DBGC2 ( intel, "INTEL %p received message", intel ); | ||
50 | - for ( i = 0 ; i < ( sizeof ( *msg ) / sizeof ( msg->dword[0] ) ) ; i++){ | ||
51 | - msg->dword[i] = readl ( intel->regs + intel->mbox.mem + | ||
52 | - ( i * sizeof ( msg->dword[0] ) ) ); | ||
53 | - DBGC2 ( intel, "%c%08x", ( i ? ':' : ' ' ), msg->dword[i] ); | ||
54 | + for ( i = 0 ; i < ( sizeof ( *msg ) / sizeof ( raw->dword[0] ) ) ; i++){ | ||
55 | + raw->dword[i] = readl ( intel->regs + intel->mbox.mem + | ||
56 | + ( i * sizeof ( raw->dword[0] ) ) ); | ||
57 | + DBGC2 ( intel, "%c%08x", ( i ? ':' : ' ' ), raw->dword[i] ); | ||
58 | } | ||
59 | DBGC2 ( intel, "\n" ); | ||
60 | } | ||
61 | diff --git a/src/drivers/net/intelvf.h b/src/drivers/net/intelvf.h | ||
62 | index ab404698..ffb18e04 100644 | ||
63 | --- a/drivers/net/intelvf.h | ||
64 | +++ b/drivers/net/intelvf.h | ||
65 | @@ -119,6 +119,12 @@ struct intelvf_msg_queues { | ||
66 | uint32_t dflt; | ||
67 | } __attribute__ (( packed )); | ||
68 | |||
69 | +/** Raw mailbox message */ | ||
70 | +struct intelvf_msg_raw { | ||
71 | + /** Raw dwords */ | ||
72 | + uint32_t dword[0]; | ||
73 | +} __attribute__ (( packed )); | ||
74 | + | ||
75 | /** Mailbox message */ | ||
76 | union intelvf_msg { | ||
77 | /** Message header */ | ||
78 | @@ -132,7 +138,7 @@ union intelvf_msg { | ||
79 | /** Queue configuration message */ | ||
80 | struct intelvf_msg_queues queues; | ||
81 | /** Raw dwords */ | ||
82 | - uint32_t dword[0]; | ||
83 | + struct intelvf_msg_raw raw; | ||
84 | }; | ||
85 | |||
86 | /** Maximum time to wait for mailbox message | ||
87 | -- | ||
88 | 2.17.1 | ||
89 | |||
diff --git a/recipes-extended/ipxe/ipxe_git.bb b/recipes-extended/ipxe/ipxe_git.bb index 47c5b7ad..fbaad309 100644 --- a/recipes-extended/ipxe/ipxe_git.bb +++ b/recipes-extended/ipxe/ipxe_git.bb | |||
@@ -13,6 +13,8 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/files:" | |||
13 | SRC_URI = " \ | 13 | SRC_URI = " \ |
14 | git://git.ipxe.org/ipxe.git;protocol=https \ | 14 | git://git.ipxe.org/ipxe.git;protocol=https \ |
15 | file://ipxe-fix-hostcc-nopie-cflags.patch \ | 15 | file://ipxe-fix-hostcc-nopie-cflags.patch \ |
16 | file://ipxe-intel-Avoid-spurious-compiler-warning-on-GCC-10.patch \ | ||
17 | file://ipxe-golan-Add-explicit-type-casts-for-nodnic_queue_pair_.patch \ | ||
16 | " | 18 | " |
17 | 19 | ||
18 | FILES_${PN} = "/usr/share/firmware/*.rom" | 20 | FILES_${PN} = "/usr/share/firmware/*.rom" |