Return-Path: Received: from mail.linutronix.de (146.0.238.70:993) by crypto-ml.lab.linutronix.de with IMAP4-SSL for ; 12 Jul 2018 16:13:40 -0000 Received: from mx3-rdu2.redhat.com ([66.187.233.73] helo=mx1.redhat.com) by Galois.linutronix.de with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1fdeDq-0000tD-KF for speck@linutronix.de; Thu, 12 Jul 2018 18:13:39 +0200 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4F9940122CD for ; Thu, 12 Jul 2018 16:13:31 +0000 (UTC) Received: from treble (ovpn-120-114.rdu2.redhat.com [10.10.120.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8EE761C676 for ; Thu, 12 Jul 2018 16:13:31 +0000 (UTC) Date: Thu, 12 Jul 2018 11:13:30 -0500 From: Josh Poimboeuf Subject: [MODERATED] Re: [patch V10 10/10] Control knobs and Documentation 10 Message-ID: <20180712161330.liz4cdyulklhpvxc@treble> References: <20180712141902.576562442@linutronix.de> <20180712142957.791282859@linutronix.de> MIME-Version: 1.0 In-Reply-To: <20180712142957.791282859@linutronix.de> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit To: speck@linutronix.de List-ID: On Thu, Jul 12, 2018 at 04:19:12PM +0200, speck for Thomas Gleixner wrote: > + - L1D Flush mode: > + > + ================================ =================================== > + 'L1D vulnerable' L1D flushing is disabled > + > + 'L1D conditional cache flushes' L1D flush is conditionally enabled > + > + 'L1D cache flushes' SMT is disabled and L1D flush Typo in the description: s/SMT is disabled and L1D flush/L1D flushing is unconditionally enabled/ ? > +Mitigation control on the kernel command line > +--------------------------------------------- > + > +The kernel command line allows to control the L1TF mitigations at boot > +time with the option "l1tf=". The valid arguments for this option are: > + > + ============ =================================================== > + full Provides all available mitigations for the L1TF > + vulnerability. Disables SMT and enables all mitigations in > + the hypervisors. > + > + SMT control and L1D flush control via the sysfs interface > + is still possible after boot. Hypervisors will issue a > + warning when the first VM is started in a potentially > + insecure configuration, i.e. SMT enabled or L1D flush > + disabled. > + > + full,force Same as 'full', but disables SMT and L1D flush runtime > + control. Implies the 'nosmt=force' command line option. > + (i.e. sysfs control of SMT is disabled.) > + > + flush Leaves SMT enabled and enables the default hypervisor > + mitigation. > + > + SMT control and L1D flush control via the sysfs interface > + is still possible after boot. Hypervisors will issue a > + warning when the first VM is started in a potentially > + insecure configuration, i.e. SMT enabled or L1D flush > + disabled. The difference is between 'flush' and 'full' is quite vague here (and in kernel-parameters.txt). It might be a good idea to give a little more detail. It also might be helpful to add a pointer to this document in kernel-parameters.txt, if the user needs more detail. > +Mitigation control for KVM - module parameter > +------------------------------------------------------------- > + > +The KVM hypervisor mitigation mechanism, flushing the L1D cache when > +entering a guest, can be controlled with a module parameter. > + > +The option/parameter is "kvm-intel.vmentry_l1d_flush=". It takes the > +following arguments: > + > + ============ ============================================================== > + always L1D cache flush on every VMENTER. > + > + cond Flush L1D on VMENTER only when the code between VMEXIT and > + VMENTER can leak host memory which is considered > + interesting for an attacker. This still can leak host memory > + which allows e.g. to determine the hosts address space layout. > + > + never Disables the mitigation > + ============ ============================================================== > + > +The parameter can be provided on the kernel command line, as a module > +parameter when loading the modules and at runtime modified via the sysfs > +file: > + > + /sys/module/kvm_intel/parameters/vmentry_l1d_flush > + > +The default is 'cond'. If 'l1tf=full,force' is given on the kernel command > +line, then 'always' is enforced and the kvm-intel.vmentry_l1d_flush > +module parameter is ignored and writes to the sysfs file are rejected. I didn't see the disadvantage of 'always' (performance) described anywhere -- here or in the "L1D flush on VMENTER section". Though maybe that's obvious... -- Josh