Project

General

Profile

Bug #12175

i86xpv: variable may be used uninitialized

Added by Toomas Soome 3 months ago. Updated 16 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

Build errors with gcc 9:

    ../../i86xpv/io/privcmd_hcall.c: In function 'privcmd_HYPERVISOR_mmuext_op':
    ../../i86xpv/io/privcmd_hcall.c:1087:11: error: 'kop' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1087 |   error = HYPERVISOR_mmuext_op(kop, count, &kscount, domid);
          |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../i86xpv/cpu/generic_cpu/gcpu_mca_xpv.c: In function 'gcpu_xpv_proxy_logout':
    ../../i86xpv/cpu/generic_cpu/gcpu_mca_xpv.c:120:20: error: 'mcrp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      120 |   mcrp->cmr_msrval = mib->mc_status;
          |   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~

    ../../i86xpv/io/psm/xpv_psm.c: In function 'xpv_psm_get_msi_vector':
    ../../i86xpv/io/psm/xpv_psm.c:1139:9: error: 'vector' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1139 |  return (vector);
          |         ^

    ../../common/xen/dtrace/xdt.c: In function 'xdt_process_rec':
    ../../common/xen/dtrace/xdt.c:154:14: error: 'eid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      154 |  dtrace_id_t id = xdt_probemap[event];    \
          |              ^~
    ../../common/xen/dtrace/xdt.c:697:6: note: 'eid' was declared here
      697 |  int eid;
          |      ^~~

    ../../common/xen/io/xnb.c: In function 'xnb_to_peer':
    ../../common/xen/io/xnb.c:823:26: error: 'len' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      823 |    xnbp->xnb_stat_rbytes += len;
          |                          ^~

    ../../i86xpv/os/xpv_panic.c: In function 'xpv_va_walk':
    ../../i86xpv/os/xpv_panic.c:190:11: error: 'pte' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      190 |  x86pte_t pte;
          |           ^~~

    ../../i86xpv/os/mp_xen.c: In function 'vcpu_config_report':
    ../../i86xpv/os/mp_xen.c:861:8: error: 'ps' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      861 |  len = snprintf(report, REPORT_LEN,
          |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      862 |      "cpu%d: externally initiated %s", id, ps);
          |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    ../../i86pc/vm/vm_machdep.c: In function 'page_swap_with_hypervisor':
    ../../i86pc/vm/vm_machdep.c:2876:3: error: 'extra' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     2876 |   for (i = 0; i < extra; i++) {
          |   ^~~

    ../../i86pc/os/cpupm/cpupm_mach.c: In function 'cpupm_plat_state_enumerate':
    ../../i86pc/os/cpupm/cpupm_mach.c:720:32: error: 'speeds' may be used uninitialized in this function [-Werror=maybe-uninitialized]
      720 |    states[i].cps_speed = speeds[i];
          |                                ^

    ../../i86pc/os/fakebop.c: In function 'xen_vbdroot_props':
    ../../i86pc/os/fakebop.c:1023:7: error: 'mi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     1023 |  char mi;
          |       ^~
    cc1: all warnings being treated as errors

Testing done: build/install/boot, but I have no xen.

History

#1

Updated by Electric Monk 16 days ago

  • % Done changed from 90 to 100
  • Status changed from In Progress to Closed

git commit 2a9992ecc0392fdbbaa57613c1bcfc31b6c7e247

commit  2a9992ecc0392fdbbaa57613c1bcfc31b6c7e247
Author: Toomas Soome <tsoome@me.com>
Date:   2020-03-23T16:12:01.000Z

    12175 i86xpv: variable may be used uninitialized
    Reviewed by: Andy Stormont <astormont@racktopsystems.com>
    Reviewed by: Gergő Doma <domag02@gmail.com>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF