Print this page
Revert "OS-8005 bhyve memory pressure needs to target ARC better (#354)"
This reverts commit a6033573eedd94118d2b9e65f45deca0bf4b42f7.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
          +++ new/usr/src/uts/i86pc/io/vmm/vmm_sol_dev.c
↓ open down ↓ 4 lines elided ↑ open up ↑
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  /* This file is dual-licensed; see usr/src/contrib/bhyve/LICENSE */
  12   12  
  13   13  /*
  14   14   * Copyright 2015 Pluribus Networks Inc.
  15      - * Copyright 2020 Joyent, Inc.
       15 + * Copyright 2019 Joyent, Inc.
  16   16   * Copyright 2020 OmniOS Community Edition (OmniOSce) Association.
  17   17   * Copyright 2021 Oxide Computer Company
  18   18   */
  19   19  
  20   20  #include <sys/types.h>
  21   21  #include <sys/conf.h>
  22   22  #include <sys/cpuvar.h>
  23   23  #include <sys/ioccom.h>
  24   24  #include <sys/stat.h>
  25   25  #include <sys/vmsystm.h>
↓ open down ↓ 443 lines elided ↑ open up ↑
 469  469          case VM_REINIT:
 470  470          case VM_BIND_PPTDEV:
 471  471          case VM_UNBIND_PPTDEV:
 472  472          case VM_MAP_PPTDEV_MMIO:
 473  473          case VM_UNMAP_PPTDEV_MMIO:
 474  474          case VM_ALLOC_MEMSEG:
 475  475          case VM_MMAP_MEMSEG:
 476  476          case VM_MUNMAP_MEMSEG:
 477  477          case VM_WRLOCK_CYCLE:
 478  478          case VM_PMTMR_LOCATE:
 479      -        case VM_ARC_RESV:
 480  479                  vmm_write_lock(sc);
 481  480                  lock_type = LOCK_WRITE_HOLD;
 482  481                  break;
 483  482  
 484  483          case VM_GET_GPA_PMAP:
 485  484          case VM_GET_MEMSEG:
 486  485          case VM_MMAP_GETNEXT:
 487  486          case VM_LAPIC_IRQ:
 488  487          case VM_INJECT_NMI:
 489  488          case VM_IOAPIC_ASSERT_IRQ:
↓ open down ↓ 915 lines elided ↑ open up ↑
1405 1404                  }
1406 1405                  break;
1407 1406          }
1408 1407          case VM_WRLOCK_CYCLE: {
1409 1408                  /*
1410 1409                   * Present a test mechanism to acquire/release the write lock
1411 1410                   * on the VM without any other effects.
1412 1411                   */
1413 1412                  break;
1414 1413          }
1415      -        case VM_ARC_RESV:
1416      -                error = vm_arc_resv(sc->vmm_vm, (uint64_t)arg);
1417      -                break;
     1414 +
1418 1415          default:
1419 1416                  error = ENOTTY;
1420 1417                  break;
1421 1418          }
1422 1419  
1423 1420          /* Release exclusion resources */
1424 1421          switch (lock_type) {
1425 1422          case LOCK_NONE:
1426 1423                  break;
1427 1424          case LOCK_VCPU:
↓ open down ↓ 754 lines elided ↑ open up ↑
2182 2179                   * HMA already ensured that the features necessary for SVM
2183 2180                   * operation were present and online during vmm_attach().
2184 2181                   */
2185 2182                  r = 0;
2186 2183          } else {
2187 2184                  r = ENXIO;
2188 2185                  msg = "Unsupported CPU vendor";
2189 2186          }
2190 2187  
2191 2188          if (r != 0 && arg != (intptr_t)NULL) {
2192      -                if (copyoutstr(msg, (char *)arg, strlen(msg), NULL) != 0)
     2189 +                if (copyoutstr(msg, (char *)arg, strlen(msg) + 1, NULL) != 0)
2193 2190                          return (EFAULT);
2194 2191          }
2195 2192          return (r);
2196 2193  }
2197 2194  
2198 2195  static int
2199 2196  vmm_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, cred_t *credp,
2200 2197      int *rvalp)
2201 2198  {
2202 2199          vmm_softc_t     *sc;
↓ open down ↓ 414 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX