Received: by 10.223.176.5 with SMTP id f5csp1997152wra; Wed, 31 Jan 2018 14:57:24 -0800 (PST) X-Google-Smtp-Source: AH8x2245/u0YFoIS7AEXPkKdwRf3H5jwN2tJWpIZxzBO3SoU8Q66VwB+inp/ko9EvS/va6HEZSDT X-Received: by 2002:a17:902:3381:: with SMTP id b1-v6mr30408153plc.20.1517439444684; Wed, 31 Jan 2018 14:57:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517439444; cv=none; d=google.com; s=arc-20160816; b=k/onOSvVeUCCXIKrpDfMLYTZM34ub0b/JoiHdxS3ky/8BuzKOQ42CwZUJ8c0EW2kx9 j1ov5zBDpFbFzzMoNY52lEQDF4jybGRKkj5YzwCGpE0Db4K8/1qelKsw+Y0IJv+vLDCy sWG9CGBHoHw+pzBMrYJ20K+Sxkib4Krv4b8xpfve1Y00cBJgkTuHjZgzXrRfcBr/iTtI TyfuxPQ/5JgbXXfDFX79qi2TS+wNMy3b2vqgtf400gqCfq09+22VW2FK7f5sH5DAw0Es IJM5B7KC0YFOHgSFUeyUK/KBMY/OW+MwfRUZfNjmtMS9OWd+x8kW3VjTKZ8U/8jnON2R BBcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=pLp6SGsgo2YnfGOEY4VzHuRjiJUiQIJzp30HjcVddwU=; b=zJQxSNtGLh037wXu+VN5HyCC7Cc5uDokreiZgSR2jfKHygPnG+IHeHpaeXgFcFaReA 4a02LnpVnWL92vBQK53XnWvG5I9J6kFmTxRv5XwRMaxctGYWY7cJKIqPM5cEhiQT8dGz eqa3G0V+OJ71aQl+L3/btO/ud65C+aySFb1kRzW0gXgmdYzdavDZjNOaPqVRt+p9Kwxv /KI7IhPWtRW+kvgvMZLM5i8n0rRCZ8sagkceIX5LLz/oScKEF12EQNkIhjsoaOal4Q7L r3KD5qJx50Q/SzVw6sH1Ee8ua0SpqhCSRZcQrA9+yZglPJ8p3QeXrnOpbYj2Q+7Rn6Eb d/Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h127si1803385pgc.1.2018.01.31.14.57.09; Wed, 31 Jan 2018 14:57:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751839AbeAaW4o (ORCPT + 99 others); Wed, 31 Jan 2018 17:56:44 -0500 Received: from mga17.intel.com ([192.55.52.151]:50641 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751643AbeAaW4n (ORCPT ); Wed, 31 Jan 2018 17:56:43 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2018 14:56:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,441,1511856000"; d="scan'208";a="26327342" Received: from otc-nc-03.jf.intel.com (HELO otc-nc-03) ([10.54.39.38]) by fmsmga004.fm.intel.com with ESMTP; 31 Jan 2018 14:56:42 -0800 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) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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] >