GCCs of at least 4.4 and earlier do not tollerate the initialisiation of the
$VENDOR_cpu_dev structures, because of c_ident becoming an anonymous union.
Instead of using an anonymous union, reintepret c_ident[] in its CPUID form
just in get_cpu_vendor().
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
for (i = 0; i < X86_VENDOR_NUM; i++) {
if (cpu_devs[i]) {
- if (cpu_devs[i]->b == b && cpu_devs[i]->c == c &&
- cpu_devs[i]->d == d) {
+ struct {
+ uint32_t b, d, c;
+ } *ptr = (void *)cpu_devs[i]->c_ident;
+
+ if (ptr->b == b && ptr->c == c && ptr->d == d) {
if (mode == gcv_host)
this_cpu = cpu_devs[i];
return i;
/* attempt to consolidate cpu attributes */
struct cpu_dev {
char c_vendor[8];
-
- union {
- char c_ident[13];
- struct {
- uint32_t b, d, c;
- };
- };
+ char c_ident[13];
void (*c_early_init)(struct cpuinfo_x86 *c);
void (*c_init)(struct cpuinfo_x86 * c);