git: kernel - Add two features to improve qemu emulation (64-bit only)

Matthew Dillon dillon at
Sat Jul 12 17:36:55 PDT 2014

commit b8d5441dd100292b031428ff862426356755d8ea
Author: Matthew Dillon <dillon at>
Date:   Sat Jul 12 17:31:48 2014 -0700

    kernel - Add two features to improve qemu emulation (64-bit only)
    * Implement a tunable for machdep.cpu_idle_hlt, allowing it to be
      set in /boot/loader.conf.  For qemu the admin might want to set
      the value to 4 (always use HLT) instead of the default 2.
    * Implement a tunable and new sysctl, machdep.pmap_fast_kernel_cpusync,
      which defaults to disabled (0).  Setting this to 1 in /boot/loader.conf
      or at anytime via sysctl tells the kernel to use a one-stage pmap
      invalidation for kernel_pmap updates.  User pmaps are not affected and
      will still use two-stage invalidations.
      One-stage pmap invalidations only have to spin on the originating cpu,
      but all other cpus will not be quiesced when updating a kernel_map pmap
      entry.  This is untested as there might be situations where the kernel
      pmap is updated without an interlock (though most should be interlocked
      This second sysctl/tunable, if enabled, greatly improves qemu performance
      particularly when the number of qemu cpus is greater than the number of
      real cpus.  It probably improves real hardware system performance as well,
      but is not recommended for production at this time.

Summary of changes:
 sys/platform/pc64/include/pmap.h       |  1 +
 sys/platform/pc64/include/pmap_inval.h |  1 +
 sys/platform/pc64/x86_64/machdep.c     |  1 +
 sys/platform/pc64/x86_64/pmap.c        |  8 +++++++-
 sys/platform/pc64/x86_64/pmap_inval.c  | 31 +++++++++++++++++++++++++++----
 5 files changed, 37 insertions(+), 5 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list