Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/nvmm/x86 Simplify, remove unnecessary #ifdef DIAGNOS...



details:   https://anonhg.NetBSD.org/src/rev/11da528c6178
branches:  trunk
changeset: 936809:11da528c6178
user:      maxv <maxv%NetBSD.org@localhost>
date:      Wed Aug 05 10:20:50 2020 +0000

description:
Simplify, remove unnecessary #ifdef DIAGNOSTIC around KASSERTs.

diffstat:

 sys/dev/nvmm/x86/nvmm_x86_vmx.c |  14 +++-----------
 1 files changed, 3 insertions(+), 11 deletions(-)

diffs (55 lines):

diff -r 1176c7a3672e -r 11da528c6178 sys/dev/nvmm/x86/nvmm_x86_vmx.c
--- a/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Wed Aug 05 08:50:42 2020 +0000
+++ b/sys/dev/nvmm/x86/nvmm_x86_vmx.c   Wed Aug 05 10:20:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmm_x86_vmx.c,v 1.65 2020/07/19 06:56:09 maxv Exp $   */
+/*     $NetBSD: nvmm_x86_vmx.c,v 1.66 2020/08/05 10:20:50 maxv Exp $   */
 
 /*
  * Copyright (c) 2018-2020 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.65 2020/07/19 06:56:09 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvmm_x86_vmx.c,v 1.66 2020/08/05 10:20:50 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -883,15 +883,11 @@
 {
        struct vmx_cpudata *cpudata = vcpu->cpudata;
        struct cpu_info *vmcs_ci;
-       paddr_t oldpa __diagused;
 
        cpudata->vmcs_refcnt++;
        if (cpudata->vmcs_refcnt > 1) {
-#ifdef DIAGNOSTIC
                KASSERT(kpreempt_disabled());
-               oldpa = vmx_vmptrst();
-               KASSERT(oldpa == cpudata->vmcs_pa);
-#endif
+               KASSERT(vmx_vmptrst() == cpudata->vmcs_pa);
                return;
        }
 
@@ -921,9 +917,7 @@
        struct vmx_cpudata *cpudata = vcpu->cpudata;
 
        KASSERT(kpreempt_disabled());
-#ifdef DIAGNOSTIC
        KASSERT(vmx_vmptrst() == cpudata->vmcs_pa);
-#endif
        KASSERT(cpudata->vmcs_refcnt > 0);
        cpudata->vmcs_refcnt--;
 
@@ -941,9 +935,7 @@
        struct vmx_cpudata *cpudata = vcpu->cpudata;
 
        KASSERT(kpreempt_disabled());
-#ifdef DIAGNOSTIC
        KASSERT(vmx_vmptrst() == cpudata->vmcs_pa);
-#endif
        KASSERT(cpudata->vmcs_refcnt == 1);
        cpudata->vmcs_refcnt--;
 



Home | Main Index | Thread Index | Old Index