Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Dec 2008 19:57:12 +0000 (UTC)
From:      Ivan Voras <ivoras@FreeBSD.org>
To:        cvs-src-old@freebsd.org
Subject:   cvs commit: src/sys/kern subr_param.c
Message-ID:  <200812171957.mBHJvUPQ031745@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
ivoras      2008-12-17 19:57:12 UTC

  FreeBSD src repository

  Modified files:
    sys/kern             subr_param.c 
  Log:
  SVN rev 186252 on 2008-12-17 19:57:12Z by ivoras
  
  Introduce a sysctl kern.vm_guest that reflects what the kernel knows about
  it running under a virtual environment. This also introduces a globally
  accessible variable vm_guest that can be used where appropriate in the
  kernel to inspect this environment.
  
  To make it easier for the long run, an enum VM_GUEST is also introduced,
  which could possibly be factored out in a header somewhere (but the
  question is where - vm/vm_param.h? sys/param.h?) so it eventually becomes
  a part of the standard KPI. In any case, it's a start.
  
  The purpose of all this isn't to absolutely detect that the OS is running
  under a virtual environment (cf. "redpill") but to allow the parts of the
  kernel and the userland that care about this particular aspect and can do
  something useful depending on it to have a standardised interface. Reducing
  kern.hz is one example but there are other things that could be done like
  avoiding context switches, not using CPU instructions that are known to be
  slow in emulation, possibly different strategies in VM (memory) allocation,
  CPU scheduling, etc.
  
  It isn't clear if the JAILS/VIMAGE functionality should also be exposed
  by this particular mechanism (probably not since they're not "full"
  virtual hardware environments). Sometime in the future another sysctl and
  a variable could be introduced to reflect if the kernel supports any kind
  of virtual hosting (e.g. VMWare VMI, Xen dom0).
  
  Reviewed by:    silence from src-commiters@, virtualization@, kmacy@
  Approved by:    gnn (mentor)
  Security:       Obscurity doesn't help.
  
  Revision  Changes    Path
  1.81      +15 -6     src/sys/kern/subr_param.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812171957.mBHJvUPQ031745>