Received: by 10.223.176.5 with SMTP id f5csp3278025wra; Mon, 29 Jan 2018 11:11:50 -0800 (PST) X-Google-Smtp-Source: AH8x2244AqhhAY0qnVmwp/uVCBDbDIrwwieKiR0hteu/L5Je2cwDemJpRvGfrLPsUJeFHEXDW+vT X-Received: by 2002:a17:902:8304:: with SMTP id bd4-v6mr7003084plb.123.1517253110542; Mon, 29 Jan 2018 11:11:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517253110; cv=none; d=google.com; s=arc-20160816; b=HPT0+ICYfxgV1WYlsZZNPhHSmThjozE/yozw/6nJoO0ZzWNKvzu0M2sx7AaDiOt/It dL5so4F+w9yAFD5CysETJ72eVZZyTz30GXlI5eRnfVDI2JeqhMuMTivDzvBbhX9Xf3OY rwpRRdpzxKEfJvBiwY32WXogwX5dtai8Zb0nP+nZW0W6Ffn60A9agQstajSl+KEMQe9M BXiAd2qaar55+6+HR84Z9IaUlDHKa2N0lYj5YtmIYoSo99mUnJCq2F9P2Q+mlyQLYWGT 9lH7N05sdU4+aiLrh4KEQLXkGLxNKZYGvRe4jHfgSHY61ilapVkRqSoaAdyqWujPRnQ/ kYCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=54JFGm1GnTdqYqEHVliQYM6308yB517yxDezO5cF0P0=; b=p2r7HnnT1J+lVPW6ctO2Ak5PW5cWDWHEAgOA+Voh1j81l64wLDXJF3+gusdWKx2bmg dIz/FVdhPMsLfkR3Iy1mv+kaEfV8eDOsVm9/OpXdlWPWvtnIqnWJtYzdJnsMXJELtjxP s5JQlDg7CUdU878PAAdWzStlsaLBjAQoGIA91VWlNkPpGG4/KYBVRBkMhaO7xHTKw5+L UDhVvkhcshLc7t5hp+ilixVzU9L8WuyII6AQkKWcRdGHPkPIaQm8j02ID0yh9tFdJws+ fO/l1NeGlu4LSUxUfATaRtnhsqdQwUYN4TpQYa3FWUR3BCYixAbgbqEM5P7YqhV/OK2Y zEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Q5D65ixy; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si1706724pfi.191.2018.01.29.11.11.35; Mon, 29 Jan 2018 11:11:50 -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; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=Q5D65ixy; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbeA2TLN (ORCPT + 99 others); Mon, 29 Jan 2018 14:11:13 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:65520 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeA2TLL (ORCPT ); Mon, 29 Jan 2018 14:11:11 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1517253071; x=1548789071; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=54JFGm1GnTdqYqEHVliQYM6308yB517yxDezO5cF0P0=; b=Q5D65ixyZJxvWhm/8KLxMZcTmi7BeF7zy+Fm+bY1do9VYovKvbNM93Sg eENTVLCLobNi8CV9n3sw4qha1yms4h1JP9vCqce2XDW9H2lsxkrmnn24I GPEPOMQ1S/rOcIomsOtO6pEXuRUEKDC+9NhJm16M+qML/f3VxWdMA193y E=; X-IronPort-AV: E=Sophos;i="5.46,432,1511827200"; d="scan'208";a="717456439" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-1e-428a6f71.us-east-1.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Jan 2018 19:10:39 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1e-428a6f71.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id w0TJAN06030291 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 29 Jan 2018 19:10:27 GMT Received: from EX13D01EUB003.ant.amazon.com (10.43.166.248) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Mon, 29 Jan 2018 19:10:21 +0000 Received: from [10.85.90.136] (10.43.161.222) by EX13D01EUB003.ant.amazon.com (10.43.166.248) with Microsoft SMTP Server (TLS) id 15.0.1236.3; Mon, 29 Jan 2018 19:10:08 +0000 Subject: Re: [PATCH] x86: vmx: Allow direct access to MSR_IA32_SPEC_CTRL To: Jim Mattson , David Woodhouse CC: KarimAllah Ahmed , kvm list , LKML , Asit Mallick , Arjan Van De Ven , Dave Hansen , Andi Kleen , Andrea Arcangeli , Linus Torvalds , "Tim Chen" , Thomas Gleixner , "Dan Williams" , Jun Nakajima , Paolo Bonzini , Greg KH , Andy Lutomirski , Ashok Raj References: <1517167750-23485-1-git-send-email-karahmed@amazon.de> <1517252472.18619.28.camel@infradead.org> From: KarimAllah Ahmed Message-ID: Date: Mon, 29 Jan 2018 20:10:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [10.43.161.222] X-ClientProxiedBy: EX13D17UWB004.ant.amazon.com (10.43.161.132) To EX13D01EUB003.ant.amazon.com (10.43.166.248) Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gMDEvMjkvMjAxOCAwODowNCBQTSwgSmltIE1hdHRzb24gd3JvdGU6Cj4gQ2FuIEkgYXNzdW1l IHlvdSdsbCBzZW5kIG91dCBhIG5ldyB2ZXJzaW9uIHdpdGggdGhlIGZpeGVzPwoKWWVzLCBJIGFt IGN1cnJlbnRseSBkb2luZyBzb21lIHRlc3RzIGFuZCBvbmNlIEkgYW0gZG9uZSBJIHdpbGwgc2Vu ZCBhIApuZXcgcm91bmQuCgouLi4gYW5kIHRoZSB0eXBvIGlzIGFscmVhZHkgZml4ZWQgaW4gJ2li cGItd2lwJyA6KQoKPiAKPiBPbiBNb24sIEphbiAyOSwgMjAxOCBhdCAxMTowMSBBTSwgRGF2aWQg V29vZGhvdXNlIDxkd213MkBpbmZyYWRlYWQub3JnPiB3cm90ZToKPj4KPj4gKFRvcC1wb3N0aW5n OyBzb3JyeS4pCj4+Cj4+IE11Y2ggb2YgdGhhdCBpcyBhbHJlYWR5IGZpeGVkIGR1cmluZyBvdXIg ZGF5LCBpbgo+PiBodHRwOi8vZ2l0LmluZnJhZGVhZC5vcmcvbGludXgtcmV0cG9saW5lLmdpdC9z aG9ydGxvZy9yZWZzL2hlYWRzL2licGIKPj4KPj4gSSBmb3Jnb3QgdG8gZml4IHVwIHRoZSB3cm9u Zy1NU1IgdHlwbyB0aG91Z2gsIGFuZCB3ZSBkbyBzdGlsbCBuZWVkIHRvIGFkZHJlc3MgcmVzZXQu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