From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2256y6UyxGuBiKYxxIh9NrgDVIgS4B4K8XaPG6x/yts5RojnIS9N2KlHBZRKI6fAkALHXs84 ARC-Seal: i=1; a=rsa-sha256; t=1517439403; cv=none; d=google.com; s=arc-20160816; b=fvSj2M+tvem+qLwf+ws3htixrfEk2mGm4g+hw1dLginjyX4Tf6P6sAJboHJ7ZtPIvM F170gWO+wojiPsM0eOxVsz4mG4yWqLDF8eP46+XSqsmmh9f81SeLdp/mWuMpQvfVXDqB UAUOU9KFV+Q4VrRCJQzu7E39VZgH4Y5ebtDcnZ2DlxgFt7mTYhfBgJk3OhccGSjvOFiL jFooS4IyA2EARu1gX/e9BUfmCFVYgevK1RA/xVKH22e2MT3Tw6cppls/bRpAjo4l4GVU UO7CseEYy032/H+5bByWrr+7IYfwkNfcBYeNu0u6gxUeRGidTZLJND0p6QaX5hAtKMXJ agIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:arc-authentication-results; bh=pLp6SGsgo2YnfGOEY4VzHuRjiJUiQIJzp30HjcVddwU=; b=drS8xGrIXywdcWG3ZR5OLiLzjv9UfT8MWP07e1widFMdCk4+T0b7dtKn9PvbgfyGAc 2BUTh4JuJJf2mn/khUxSYUQ0FJWu3drBPli5hSQuUJMH6i/ysa/l02N67x6Ji4VMPWTj bFr99MCRnEYuk4iUjlgICM2mJdfJhb9VvlpfRmY7ndbvlgGBWoHXSCGkG9sWowgao+KS jCXprba5UNMSe62lo5fblhNSS4J3735JLPZ83Qjaczt+g/eqgrMX3NNbgvHUI0mTlH5p jD7numL/NepvouGFV2kFAMjBCQc7Rp7GmK6UwoxXthJWhrBJxAbCGvi1G15np8xgTZBc MjFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ashok.raj@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=ashok.raj@intel.com Authentication-Results: mx.google.com; spf=pass (google.com: domain of ashok.raj@intel.com designates 134.134.136.100 as permitted sender) smtp.mailfrom=ashok.raj@intel.com X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,441,1511856000"; d="scan'208";a="26327342" Date: Wed, 31 Jan 2018 14:56:42 -0800 From: "Raj, Ashok" To: KarimAllah Ahmed Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Asit Mallick , Arjan Van De Ven , Dave Hansen , Andi Kleen , Andrea Arcangeli , Linus Torvalds , Tim Chen , Thomas Gleixner , Dan Williams , Jun Nakajima , Paolo Bonzini , David Woodhouse , Greg KH , Andy Lutomirski , Ashok Raj Subject: Re: [PATCH v5 4/5] KVM: VMX: Allow direct access to MSR_IA32_SPEC_CTRL Message-ID: <20180131225642.GA39829@otc-nc-03> References: <1517427467-28567-1-git-send-email-karahmed@amazon.de> <1517427467-28567-5-git-send-email-karahmed@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517427467-28567-5-git-send-email-karahmed@amazon.de> User-Agent: Mutt/1.5.24 (2015-08-30) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1591113692084885209?= X-GMAIL-MSGID: =?utf-8?q?1591150540345742933?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: Hi Karim On Wed, Jan 31, 2018 at 08:37:46PM +0100, KarimAllah Ahmed wrote: > [ Based on a patch from Ashok Raj ] > > Add direct access to MSR_IA32_SPEC_CTRL for guests. This is needed for > guests that will only mitigate Spectre V2 through IBRS+IBPB and will not > be using a retpoline+IBPB based approach. With these changes SPEC_CTRL is properly exposed to the guest when using latest Qemu. > > To avoid the overhead of atomically saving and restoring the > MSR_IA32_SPEC_CTRL for guests that do not actually use the MSR, only > add_atomic_switch_msr when a non-zero is written to it. > > No attempt is made to handle STIBP here, intentionally. Filtering STIBP > may be added in a future patch, which may require trapping all writes > if we don't want to pass it through directly to the guest. > > [dwmw2: Clean up CPUID bits, save/restore manually, handle reset] >