Index: /trunk/src/VBox/VMM/PATM/CSAM.cpp
===================================================================
--- /trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 451)
+++ /trunk/src/VBox/VMM/PATM/CSAM.cpp	(revision 452)
@@ -36,4 +36,5 @@
 #include <VBox/selm.h>
 #include <VBox/trpm.h>
+#include <VBox/cfgm.h>
 #include <VBox/param.h>
 #include <iprt/avl.h>
@@ -174,8 +175,17 @@
     STAM_REG(pVM, &pVM->csam.s.StatCheckGates,       STAMTYPE_PROFILE, "/PROF/CSAM/CheckGates",       STAMUNIT_TICKS_PER_CALL, "CSAMR3CheckGates overhead.");
 
-
+    /* 
+     * Check CFGM option and enable/disable CSAM.
+     */
+    bool fEnabled;
+    rc = CFGMR3QueryBool(CFGMR3GetRoot(pVM), "CSAMEnabled", &fEnabled);
+    if (VBOX_FAILURE(rc))
 #ifdef CSAM_ENABLE
-    CSAMEnableScanning(pVM);
+        fEnabled = true;
+#else
+        fEnabled = false;
 #endif
+    if (fEnabled)
+        CSAMEnableScanning(pVM);
 
 #ifdef VBOX_WITH_DEBUGGER
