diff options
author | Dan McDonald <danmcd@mnx.io> | 2022-04-30 01:55:41 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@mnx.io> | 2022-04-30 01:55:41 -0400 |
commit | 0bac467c5c1d37ae879894be3f86644aa211be1f (patch) | |
tree | 0dbdff48ac96164d2c44f6ac0d147a0c187353a9 | |
parent | 88d6179bf7f82b5b89831f91c9f784c0b0c4f170 (diff) | |
parent | e0994bd28f025d3d74315f7479562b6be19773c3 (diff) | |
download | illumos-joyent-0bac467c5c1d37ae879894be3f86644aa211be1f.tar.gz |
[illumos-gate merge]
commit e0994bd28f025d3d74315f7479562b6be19773c3
14649 remove blanket smatch gag from bhyve kernel
-rw-r--r-- | usr/src/compat/bhyve/sys/callout.h | 14 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/Makefile.vmm | 7 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/amd/svm.c | 6 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/intel/vmx.c | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/ppt.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/ppt.h | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/vatpic.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/vatpit.c | 6 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/vhpet.c | 10 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/vlapic.c | 20 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/io/vrtc.c | 13 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm.c | 28 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_instruction_emul.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_reservoir.c | 6 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_sol_dev.c | 6 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_sol_glue.c | 12 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_stat.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_vm.c | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/io/vmm/vmm_zsd.c | 4 |
19 files changed, 80 insertions, 74 deletions
diff --git a/usr/src/compat/bhyve/sys/callout.h b/usr/src/compat/bhyve/sys/callout.h index 4156c2d4c6..f9c1dad05b 100644 --- a/usr/src/compat/bhyve/sys/callout.h +++ b/usr/src/compat/bhyve/sys/callout.h @@ -44,9 +44,9 @@ struct callout { */ #define callout_pending(c) ((c)->c_target > (c)->c_fired) -void vmm_glue_callout_init(struct callout *c, int mpsafe); -int vmm_glue_callout_stop(struct callout *c); -int vmm_glue_callout_drain(struct callout *c); +void vmm_glue_callout_init(struct callout *c, int mpsafe); +void vmm_glue_callout_stop(struct callout *c); +void vmm_glue_callout_drain(struct callout *c); /* illumos-custom function for resource locality optimization */ void vmm_glue_callout_localize(struct callout *c); @@ -57,16 +57,16 @@ callout_init(struct callout *c, int mpsafe) vmm_glue_callout_init(c, mpsafe); } -static __inline int +static __inline void callout_stop(struct callout *c) { - return (vmm_glue_callout_stop(c)); + vmm_glue_callout_stop(c); } -static __inline int +static __inline void callout_drain(struct callout *c) { - return (vmm_glue_callout_drain(c)); + vmm_glue_callout_drain(c); } void callout_reset_hrtime(struct callout *c, hrtime_t target, diff --git a/usr/src/uts/intel/io/vmm/Makefile.vmm b/usr/src/uts/intel/io/vmm/Makefile.vmm index 920da5dee6..84ef0548d9 100644 --- a/usr/src/uts/intel/io/vmm/Makefile.vmm +++ b/usr/src/uts/intel/io/vmm/Makefile.vmm @@ -32,11 +32,10 @@ CFLAGS += -DVMM_KEEP_STATS LDFLAGS += -N misc/acpica -N misc/pcie -N fs/dev LDFLAGS += -M $(MAPFILE) -# 3rd party code -SMOFF += all_func_returns - -# needs work +# devmem span calculations currently run afoul of overflow checks $(OBJS_DIR)/vmm_sol_dev.o := SMOFF += signed_integer_overflow_check +# vmm_zsd_add_vm() failure unhandled in face of racing zone shutdown +$(OBJS_DIR)/vmm_sol_dev.o := SMOFF += all_func_returns OFFSETS_VMX = $(CONF_SRCDIR)/intel/offsets.in OFFSETS_SVM = $(CONF_SRCDIR)/amd/offsets.in diff --git a/usr/src/uts/intel/io/vmm/amd/svm.c b/usr/src/uts/intel/io/vmm/amd/svm.c index 11c1e9c249..b679f8c9c0 100644 --- a/usr/src/uts/intel/io/vmm/amd/svm.c +++ b/usr/src/uts/intel/io/vmm/amd/svm.c @@ -925,6 +925,7 @@ svm_save_exitintinfo(struct svm_softc *svm_sc, int vcpu) { struct vmcb_ctrl *ctrl; uint64_t intinfo; + int err; ctrl = svm_get_vmcb_ctrl(svm_sc, vcpu); intinfo = ctrl->exitintinfo; @@ -940,7 +941,8 @@ svm_save_exitintinfo(struct svm_softc *svm_sc, int vcpu) VCPU_CTR2(svm_sc->vm, vcpu, "SVM:Pending INTINFO(0x%lx), vector=%d.\n", intinfo, VMCB_EXITINTINFO_VECTOR(intinfo)); vmm_stat_incr(svm_sc->vm, vcpu, VCPU_EXITINTINFO, 1); - vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); + err = vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); + VERIFY0(err); } static __inline int @@ -1443,7 +1445,7 @@ svm_vmexit(struct svm_softc *svm_sc, int vcpu, struct vm_exit *vmexit) vmm_stat_incr(svm_sc->vm, vcpu, VMEXIT_INOUT, 1); break; case VMCB_EXIT_SHUTDOWN: - vm_suspend(svm_sc->vm, VM_SUSPEND_TRIPLEFAULT); + (void) vm_suspend(svm_sc->vm, VM_SUSPEND_TRIPLEFAULT); handled = 1; break; case VMCB_EXIT_INVD: diff --git a/usr/src/uts/intel/io/vmm/intel/vmx.c b/usr/src/uts/intel/io/vmm/intel/vmx.c index a44c90dcbe..36c01e42da 100644 --- a/usr/src/uts/intel/io/vmm/intel/vmx.c +++ b/usr/src/uts/intel/io/vmm/intel/vmx.c @@ -2907,7 +2907,7 @@ vmx_vmcleanup(void *arg) uint16_t maxcpus; if (vmx_cap_en(vmx, VMX_CAP_APICV)) { - vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); + (void) vm_unmap_mmio(vmx->vm, DEFAULT_APIC_BASE, PAGE_SIZE); kmem_free(vmx->apic_access_page, PAGESIZE); } else { VERIFY3P(vmx->apic_access_page, ==, NULL); diff --git a/usr/src/uts/intel/io/vmm/io/ppt.c b/usr/src/uts/intel/io/vmm/io/ppt.c index e79842d8a8..75a29fa17a 100644 --- a/usr/src/uts/intel/io/vmm/io/ppt.c +++ b/usr/src/uts/intel/io/vmm/io/ppt.c @@ -1118,7 +1118,7 @@ ppt_unassign_device(struct vm *vm, int pptfd) return (err); } -int +void ppt_unassign_all(struct vm *vm) { struct pptdev *ppt; @@ -1131,8 +1131,6 @@ ppt_unassign_all(struct vm *vm) } } mutex_exit(&pptdev_mtx); - - return (0); } int diff --git a/usr/src/uts/intel/io/vmm/io/ppt.h b/usr/src/uts/intel/io/vmm/io/ppt.h index f69a352fe0..13a9ef2ea5 100644 --- a/usr/src/uts/intel/io/vmm/io/ppt.h +++ b/usr/src/uts/intel/io/vmm/io/ppt.h @@ -31,7 +31,7 @@ #ifndef _IO_PPT_H_ #define _IO_PPT_H_ -int ppt_unassign_all(struct vm *vm); +void ppt_unassign_all(struct vm *vm); int ppt_map_mmio(struct vm *vm, int pptfd, vm_paddr_t gpa, size_t len, vm_paddr_t hpa); int ppt_unmap_mmio(struct vm *vm, int pptfd, vm_paddr_t gpa, size_t len); diff --git a/usr/src/uts/intel/io/vmm/io/vatpic.c b/usr/src/uts/intel/io/vmm/io/vatpic.c index aa3ae4186d..43e332d70d 100644 --- a/usr/src/uts/intel/io/vmm/io/vatpic.c +++ b/usr/src/uts/intel/io/vmm/io/vatpic.c @@ -288,8 +288,8 @@ vatpic_notify_intr(struct vatpic *vatpic) * interrupt. */ atpic->intr_raised = true; - lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); - vioapic_pulse_irq(vatpic->vm, 0); + (void) lapic_set_local_intr(vatpic->vm, -1, APIC_LVT_LINT0); + (void) vioapic_pulse_irq(vatpic->vm, 0); vatpic->stats.as_interrupts++; } else { VATPIC_CTR3(vatpic, "atpic master no eligible interrupts " diff --git a/usr/src/uts/intel/io/vmm/io/vatpit.c b/usr/src/uts/intel/io/vmm/io/vatpit.c index 9616444d25..3d66932a3a 100644 --- a/usr/src/uts/intel/io/vmm/io/vatpit.c +++ b/usr/src/uts/intel/io/vmm/io/vatpit.c @@ -163,8 +163,8 @@ vatpit_callout_handler(void *a) pit_timer_start_cntr0(vatpit); } - vatpic_pulse_irq(vatpit->vm, 0); - vioapic_pulse_irq(vatpit->vm, 2); + (void) vatpic_pulse_irq(vatpit->vm, 0); + (void) vioapic_pulse_irq(vatpit->vm, 2); done: VATPIT_UNLOCK(vatpit); @@ -323,7 +323,7 @@ vatpit_update_mode(struct vatpit *vatpit, uint8_t val) c = &vatpit->channel[sel >> 6]; if (rw == TIMER_LATCH) { - pit_update_counter(vatpit, c, true); + (void) pit_update_counter(vatpit, c, true); } else { c->mode = mode; c->olatched = false; /* reset latch after reprogramming */ diff --git a/usr/src/uts/intel/io/vmm/io/vhpet.c b/usr/src/uts/intel/io/vmm/io/vhpet.c index d9515d0cc3..423280a32e 100644 --- a/usr/src/uts/intel/io/vmm/io/vhpet.c +++ b/usr/src/uts/intel/io/vmm/io/vhpet.c @@ -179,7 +179,7 @@ vhpet_timer_clear_isr(struct vhpet *vhpet, int n) if (vhpet->isr & (1 << n)) { pin = vhpet_timer_ioapic_pin(vhpet, n); KASSERT(pin != 0, ("vhpet timer %d irq incorrectly routed", n)); - vioapic_deassert_irq(vhpet->vm, pin); + (void) vioapic_deassert_irq(vhpet->vm, pin); vhpet->isr &= ~(1 << n); } } @@ -229,7 +229,7 @@ vhpet_timer_interrupt(struct vhpet *vhpet, int n) } if (vhpet_timer_msi_enabled(vhpet, n)) { - lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, + (void) lapic_intr_msi(vhpet->vm, vhpet->timer[n].msireg >> 32, vhpet->timer[n].msireg & 0xffffffff); return; } @@ -241,10 +241,10 @@ vhpet_timer_interrupt(struct vhpet *vhpet, int n) } if (vhpet_timer_edge_trig(vhpet, n)) { - vioapic_pulse_irq(vhpet->vm, pin); + (void) vioapic_pulse_irq(vhpet->vm, pin); } else { vhpet->isr |= 1 << n; - vioapic_assert_irq(vhpet->vm, pin); + (void) vioapic_assert_irq(vhpet->vm, pin); } } @@ -460,7 +460,7 @@ vhpet_timer_update_config(struct vhpet *vhpet, int n, uint64_t data, if (clear_isr) { VM_CTR1(vhpet->vm, "hpet t%d isr cleared due to " "configuration change", n); - vioapic_deassert_irq(vhpet->vm, old_pin); + (void) vioapic_deassert_irq(vhpet->vm, old_pin); vhpet->isr &= ~(1 << n); } } diff --git a/usr/src/uts/intel/io/vmm/io/vlapic.c b/usr/src/uts/intel/io/vmm/io/vlapic.c index 1cd6c72aaf..ef7a876c0c 100644 --- a/usr/src/uts/intel/io/vmm/io/vlapic.c +++ b/usr/src/uts/intel/io/vmm/io/vlapic.c @@ -511,10 +511,10 @@ vlapic_fire_lvt(struct vlapic *vlapic, uint_t lvt) vcpu_notify_event_type(vlapic->vm, vlapic->vcpuid, notify); break; case APIC_LVT_DM_NMI: - vm_inject_nmi(vlapic->vm, vlapic->vcpuid); + (void) vm_inject_nmi(vlapic->vm, vlapic->vcpuid); break; case APIC_LVT_DM_EXTINT: - vm_inject_extint(vlapic->vm, vlapic->vcpuid); + (void) vm_inject_extint(vlapic->vm, vlapic->vcpuid); break; default: // Other modes ignored @@ -721,10 +721,12 @@ vlapic_trigger_lvt(struct vlapic *vlapic, int vector) */ switch (vector) { case APIC_LVT_LINT0: - vm_inject_extint(vlapic->vm, vlapic->vcpuid); + (void) vm_inject_extint(vlapic->vm, + vlapic->vcpuid); break; case APIC_LVT_LINT1: - vm_inject_nmi(vlapic->vm, vlapic->vcpuid); + (void) vm_inject_nmi(vlapic->vm, + vlapic->vcpuid); break; default: break; @@ -1030,14 +1032,14 @@ vlapic_icrlo_write_handler(struct vlapic *vlapic) CPU_CLR(i, &dmask); switch (mode) { case APIC_DELMODE_FIXED: - lapic_intr_edge(vlapic->vm, i, vec); + (void) lapic_intr_edge(vlapic->vm, i, vec); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_IPI_SEND, 1); vmm_stat_incr(vlapic->vm, i, VLAPIC_IPI_RECV, 1); break; case APIC_DELMODE_NMI: - vm_inject_nmi(vlapic->vm, i); + (void) vm_inject_nmi(vlapic->vm, i); break; case APIC_DELMODE_INIT: (void) vm_inject_init(vlapic->vm, i); @@ -1062,7 +1064,7 @@ vlapic_self_ipi_handler(struct vlapic *vlapic, uint32_t val) /* self-IPI is only exposed via x2APIC */ ASSERT(vlapic_x2mode(vlapic)); - lapic_intr_edge(vlapic->vm, vlapic->vcpuid, vec); + (void) lapic_intr_edge(vlapic->vm, vlapic->vcpuid, vec); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_IPI_SEND, 1); vmm_stat_incr(vlapic->vm, vlapic->vcpuid, VLAPIC_IPI_RECV, 1); VLAPIC_CTR1(vlapic, "vlapic self-ipi %d", vec); @@ -1718,9 +1720,9 @@ vlapic_deliver_intr(struct vm *vm, bool level, uint32_t dest, bool phys, vcpuid--; CPU_CLR(vcpuid, &dmask); if (delmode == IOART_DELEXINT) { - vm_inject_extint(vm, vcpuid); + (void) vm_inject_extint(vm, vcpuid); } else { - lapic_set_intr(vm, vcpuid, vec, level); + (void) lapic_set_intr(vm, vcpuid, vec, level); } } } diff --git a/usr/src/uts/intel/io/vmm/io/vrtc.c b/usr/src/uts/intel/io/vmm/io/vrtc.c index 185cbc100a..e01fabfa68 100644 --- a/usr/src/uts/intel/io/vmm/io/vrtc.c +++ b/usr/src/uts/intel/io/vmm/io/vrtc.c @@ -606,8 +606,8 @@ vrtc_set_reg_c(struct vrtc *vrtc, uint8_t newval) if (!oldirqf && newirqf) { VM_CTR1(vrtc->vm, "RTC irq %d asserted", RTC_IRQ); - vatpic_pulse_irq(vrtc->vm, RTC_IRQ); - vioapic_pulse_irq(vrtc->vm, RTC_IRQ); + (void) vatpic_pulse_irq(vrtc->vm, RTC_IRQ); + (void) vioapic_pulse_irq(vrtc->vm, RTC_IRQ); } else if (oldirqf && !newirqf) { VM_CTR1(vrtc->vm, "RTC irq %d deasserted", RTC_IRQ); } @@ -873,7 +873,7 @@ vrtc_data_handler(void *arg, bool in, uint16_t port, uint8_t bytes, error = 0; curtime = vrtc_curtime(vrtc, &basetime); - vrtc_time_update(vrtc, curtime, basetime); + (void) vrtc_time_update(vrtc, curtime, basetime); /* * Update RTC date/time fields if necessary. @@ -953,7 +953,8 @@ vrtc_reset(struct vrtc *vrtc) VRTC_LOCK(vrtc); rtc = &vrtc->rtcdev; - vrtc_set_reg_b(vrtc, rtc->reg_b & ~(RTCSB_ALL_INTRS | RTCSB_SQWE)); + (void) vrtc_set_reg_b(vrtc, + rtc->reg_b & ~(RTCSB_ALL_INTRS | RTCSB_SQWE)); vrtc_set_reg_c(vrtc, 0); KASSERT(!callout_active(&vrtc->callout), ("rtc callout still active")); @@ -966,6 +967,7 @@ vrtc_init(struct vm *vm) struct vrtc *vrtc; struct rtcdev *rtc; time_t curtime; + int error; vrtc = malloc(sizeof (struct vrtc), M_VRTC, M_WAITOK | M_ZERO); vrtc->vm = vm; @@ -989,7 +991,8 @@ vrtc_init(struct vm *vm) VRTC_LOCK(vrtc); vrtc->base_rtctime = VRTC_BROKEN_TIME; - vrtc_time_update(vrtc, curtime, gethrtime()); + error = vrtc_time_update(vrtc, curtime, gethrtime()); + VERIFY0(error); secs_to_rtc(curtime, vrtc, 0); VRTC_UNLOCK(vrtc); diff --git a/usr/src/uts/intel/io/vmm/vmm.c b/usr/src/uts/intel/io/vmm/vmm.c index be181781de..6d70cd31a0 100644 --- a/usr/src/uts/intel/io/vmm/vmm.c +++ b/usr/src/uts/intel/io/vmm/vmm.c @@ -366,14 +366,14 @@ vcpu_init(struct vm *vm, int vcpu_id, bool create) vcpu->run_state = VRS_HALT; vcpu->vlapic = VLAPIC_INIT(vm->cookie, vcpu_id); - vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); + (void) vm_set_x2apic_state(vm, vcpu_id, X2APIC_DISABLED); vcpu->reqidle = 0; vcpu->exitintinfo = 0; vcpu->nmi_pending = 0; vcpu->extint_pending = 0; vcpu->exception_pending = 0; vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; - hma_fpu_init(vcpu->guestfpu); + (void) hma_fpu_init(vcpu->guestfpu); vmm_stat_init(vcpu->stats); vcpu->tsc_offset = 0; } @@ -526,7 +526,7 @@ vm_create(const char *name, uint64_t flags, struct vm **retvm) return (ENOMEM); vm = malloc(sizeof (struct vm), M_VM, M_WAITOK | M_ZERO); - strcpy(vm->name, name); + (void) strlcpy(vm->name, name, sizeof (vm->name)); vm->vmspace = vmspace; vm->mem_transient = (flags & VCF_RESERVOIR_MEM) == 0; @@ -857,7 +857,7 @@ vm_mmap_memseg(struct vm *vm, vm_paddr_t gpa, int segid, vm_ooffset_t first, if ((flags & VM_MEMMAP_F_WIRED) != 0) { error = vmspace_populate(vm->vmspace, gpa, gpa + len); if (error != 0) { - vmspace_unmap(vm->vmspace, gpa, gpa + len); + VERIFY0(vmspace_unmap(vm->vmspace, gpa, gpa + len)); return (EFAULT); } } @@ -1012,7 +1012,7 @@ vm_iommu_modify(struct vm *vm, bool map) vmp = vmc_hold(vmc, gpa, PROT_WRITE); ASSERT(vmp != NULL); hpa = ((uintptr_t)vmp_get_pfn(vmp) << PAGESHIFT); - vmp_release(vmp); + (void) vmp_release(vmp); if (map) { iommu_create_mapping(vm->iommu, gpa, hpa, sz); @@ -1470,8 +1470,9 @@ vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled) vcpu_unlock(vcpu); - if (vm_halted) - vm_suspend(vm, VM_SUSPEND_HALT); + if (vm_halted) { + (void) vm_suspend(vm, VM_SUSPEND_HALT); + } return (userspace_exit ? -1 : 0); } @@ -2312,7 +2313,7 @@ restart: affinity_type = CPU_BEST; break; case VM_EXITCODE_MTRAP: - vm_suspend_cpu(vm, vcpuid); + VERIFY0(vm_suspend_cpu(vm, vcpuid)); error = -1; break; default: @@ -2483,7 +2484,7 @@ nested_fault(struct vm *vm, int vcpuid, uint64_t info1, uint64_t info2, if (type1 == VM_INTINFO_HWEXCEPTION && vector1 == IDT_DF) { VCPU_CTR2(vm, vcpuid, "triple fault: info1(%lx), info2(%lx)", info1, info2); - vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); + (void) vm_suspend(vm, VM_SUSPEND_TRIPLEFAULT); *retinfo = 0; return (0); } @@ -2637,8 +2638,9 @@ vm_inject_exception(struct vm *vm, int vcpuid, int vector, int errcode_valid, KASSERT(error == 0, ("%s: error %d clearing interrupt shadow", __func__, error)); - if (restart_instruction) - vm_restart_instruction(vm, vcpuid); + if (restart_instruction) { + VERIFY0(vm_restart_instruction(vm, vcpuid)); + } vcpu->exception_pending = 1; vcpu->exc_vector = vector; @@ -2960,7 +2962,7 @@ vcpu_arch_reset(struct vm *vm, int vcpuid, bool init_only) */ if (!init_only) { vcpu->guest_xcr0 = XFEATURE_ENABLED_X87; - hma_fpu_init(vcpu->guestfpu); + (void) hma_fpu_init(vcpu->guestfpu); /* XXX: clear MSRs and other pieces */ } @@ -3464,7 +3466,7 @@ vm_copy_teardown(struct vm *vm, int vcpuid, struct vm_copyinfo *copyinfo, { for (uint_t idx = 0; idx < num_copyinfo; idx++) { if (copyinfo[idx].cookie != NULL) { - vmp_release((vm_page_t *)copyinfo[idx].cookie); + (void) vmp_release((vm_page_t *)copyinfo[idx].cookie); } } bzero(copyinfo, num_copyinfo * sizeof (struct vm_copyinfo)); diff --git a/usr/src/uts/intel/io/vmm/vmm_instruction_emul.c b/usr/src/uts/intel/io/vmm/vmm_instruction_emul.c index 06baec53bf..a71fa63cc4 100644 --- a/usr/src/uts/intel/io/vmm/vmm_instruction_emul.c +++ b/usr/src/uts/intel/io/vmm/vmm_instruction_emul.c @@ -2926,7 +2926,7 @@ static void ptp_release(vm_page_t **vmp) { if (*vmp != NULL) { - vmp_release(*vmp); + (void) vmp_release(*vmp); *vmp = NULL; } } @@ -2941,7 +2941,7 @@ ptp_hold(struct vm *vm, int vcpu, uintptr_t gpa, size_t len, vm_page_t **vmp) VERIFY3U(gpa + len, <=, hold_gpa + PAGESIZE); if (*vmp != NULL) { - vmp_release(*vmp); + (void) vmp_release(*vmp); } *vmp = vmc_hold(vmc, hold_gpa, PROT_READ | PROT_WRITE); diff --git a/usr/src/uts/intel/io/vmm/vmm_reservoir.c b/usr/src/uts/intel/io/vmm/vmm_reservoir.c index 1bb64a4851..158e1505b2 100644 --- a/usr/src/uts/intel/io/vmm/vmm_reservoir.c +++ b/usr/src/uts/intel/io/vmm/vmm_reservoir.c @@ -531,7 +531,11 @@ vmmr_free(vmmr_region_t *region) mutex_exit(&vmmr_lock); if (region->vr_transient) { - vmmr_remove(region->vr_size, true); + /* + * Since the transient capacity was previously allocated for + * this region, its removal should not fail. + */ + VERIFY0(vmmr_remove(region->vr_size, true)); } kmem_free(region, sizeof (*region)); } diff --git a/usr/src/uts/intel/io/vmm/vmm_sol_dev.c b/usr/src/uts/intel/io/vmm/vmm_sol_dev.c index eacad25e5d..3474ba905b 100644 --- a/usr/src/uts/intel/io/vmm/vmm_sol_dev.c +++ b/usr/src/uts/intel/io/vmm/vmm_sol_dev.c @@ -320,7 +320,7 @@ vcpu_unlock_one(vmm_softc_t *sc, int vcpu) ASSERT(vcpu >= 0 && vcpu < VM_MAXCPU); VERIFY3U(vcpu_get_state(sc->vmm_vm, vcpu, NULL), ==, VCPU_FROZEN); - vcpu_set_state(sc->vmm_vm, vcpu, VCPU_IDLE, false); + VERIFY0(vcpu_set_state(sc->vmm_vm, vcpu, VCPU_IDLE, false)); } static void @@ -1981,13 +1981,13 @@ vmm_drv_page_hold(vmm_lease_t *lease, uintptr_t gpa, int prot) void vmm_drv_page_release(vmm_page_t *vmmp) { - vmp_release((vm_page_t *)vmmp); + (void) vmp_release((vm_page_t *)vmmp); } void vmm_drv_page_release_chain(vmm_page_t *vmmp) { - vmp_release_chain((vm_page_t *)vmmp); + (void) vmp_release_chain((vm_page_t *)vmmp); } const void * diff --git a/usr/src/uts/intel/io/vmm/vmm_sol_glue.c b/usr/src/uts/intel/io/vmm/vmm_sol_glue.c index 132d5dc87f..81c3ea0ea9 100644 --- a/usr/src/uts/intel/io/vmm/vmm_sol_glue.c +++ b/usr/src/uts/intel/io/vmm/vmm_sol_glue.c @@ -342,21 +342,19 @@ callout_reset_hrtime(struct callout *c, hrtime_t target, void (*func)(void *), c->c_func = func; c->c_arg = arg; c->c_target = target; - cyclic_reprogram(c->c_cyc_id, target); + (void) cyclic_reprogram(c->c_cyc_id, target); } -int +void vmm_glue_callout_stop(struct callout *c) { ASSERT(c->c_cyc_id != CYCLIC_NONE); c->c_target = 0; - cyclic_reprogram(c->c_cyc_id, CY_INFINITY); - - return (0); + (void) cyclic_reprogram(c->c_cyc_id, CY_INFINITY); } -int +void vmm_glue_callout_drain(struct callout *c) { ASSERT(c->c_cyc_id != CYCLIC_NONE); @@ -366,8 +364,6 @@ vmm_glue_callout_drain(struct callout *c) cyclic_remove(c->c_cyc_id); c->c_cyc_id = CYCLIC_NONE; mutex_exit(&cpu_lock); - - return (0); } void diff --git a/usr/src/uts/intel/io/vmm/vmm_stat.c b/usr/src/uts/intel/io/vmm/vmm_stat.c index da38bb7de5..b2b73f890d 100644 --- a/usr/src/uts/intel/io/vmm/vmm_stat.c +++ b/usr/src/uts/intel/io/vmm/vmm_stat.c @@ -136,10 +136,10 @@ vmm_stat_desc_copy(int index, char *buf, int bufsize) vst = vsttab[i]; if (index >= vst->index && index < vst->index + vst->nelems) { if (vst->nelems > 1) { - snprintf(buf, bufsize, "%s[%d]", + (void) snprintf(buf, bufsize, "%s[%d]", vst->desc, index - vst->index); } else { - strlcpy(buf, vst->desc, bufsize); + (void) strlcpy(buf, vst->desc, bufsize); } return (0); /* found it */ } diff --git a/usr/src/uts/intel/io/vmm/vmm_vm.c b/usr/src/uts/intel/io/vmm/vmm_vm.c index c87c8a62d3..6e75e6bf87 100644 --- a/usr/src/uts/intel/io/vmm/vmm_vm.c +++ b/usr/src/uts/intel/io/vmm/vmm_vm.c @@ -1329,7 +1329,7 @@ vmp_release_inner(vm_page_t *vmp, vm_client_t *vmc) if ((vmp->vmp_prot & PROT_WRITE) != 0 && vmc->vmc_track_dirty) { vmm_gpt_t *gpt = vmc->vmc_space->vms_gpt; - vmm_gpt_reset_dirty(gpt, vmp->vmp_ptep, true); + (void) vmm_gpt_reset_dirty(gpt, vmp->vmp_ptep, true); } } kmem_free(vmp, sizeof (*vmp)); diff --git a/usr/src/uts/intel/io/vmm/vmm_zsd.c b/usr/src/uts/intel/io/vmm/vmm_zsd.c index d396c89e58..d441c9dad6 100644 --- a/usr/src/uts/intel/io/vmm/vmm_zsd.c +++ b/usr/src/uts/intel/io/vmm/vmm_zsd.c @@ -212,9 +212,9 @@ void vmm_zsd_fini(void) { /* Calls vmm_zsd_destroy() on all zones. */ - zone_key_delete(vmm_zsd_key); - ASSERT(list_is_empty(&vmm_zsd_list)); + VERIFY0(zone_key_delete(vmm_zsd_key)); + ASSERT(list_is_empty(&vmm_zsd_list)); list_destroy(&vmm_zsd_list); mutex_destroy(&vmm_zsd_lock); } |