Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1205821imu; Tue, 11 Dec 2018 14:49:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/UMfOsAT/yRW6wvpTSzLH2b2IzCwZMkUVBtaTd9Ij077et9g6OgP5Y5sfqL5gZZ3PSh5sLY X-Received: by 2002:a65:47ca:: with SMTP id f10mr16647025pgs.166.1544568553328; Tue, 11 Dec 2018 14:49:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544568553; cv=none; d=google.com; s=arc-20160816; b=tqjSocNGmPqUAhQFGlP4tye+80Nrh4JNMaTyraamNVXDLsNvdZroQACB/8fxB32hsp ka1C6FzL/APBEP5oe6/CpE/rxqpOU+xynVXpuS3iPL2c7MdYh/GxOHjdOPbVZsrHA0fP RMkDoEpzQS5kUBUX/05sGwLFoL8BKZBreQguZcsgkmSAUYH5t6uz0I53P2YKAfHeCTcA 5+yWKpOvRv0pAX/3CrN3pH09BdvrJZSH4dgNpwCfo69DyMJ5KsopmrbAHse0td9K93+E ApgmipLqsyr3/ceIH7L5VnV8VYnb8cU5zSqf0QxddK12Kq04E7PFq/rqZNP0Y+4e8fSI Y1jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:spamdiagnosticmetadata:spamdiagnosticoutput :content-language:accept-language:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=CumKVzNJIVp3sFfpHVZSP953H8JPy5OIFTFWZUlbY1I=; b=e8EGhHb402gV55G1iHARk9RzfC9SICL5fKTryZSso4ok4ZOjdIFIGed7aX9g3dKkag XIOdKdrPcmG62AZoV53UK2e4/S4lW8yR56kp210i+wON/g9boSZtplEZ02DkTx8Ta1SO Th3wM76ZZuVWQaO22e6Z4K/KTwVT6l2RYsAJYjaDHP1XE9a1M9QzDFCOQ+kDhjsHcJkG oFWgmKW4eVWAIU/79gbyRtHx+EtLkVtAJtpVvLfFGwphdpkSDwaCRyq8rnQQpBjir7K5 JdVqokjaJY5S7BVmgncxUrpiotphL6u1/esOKOQw5bFufCoHqtRamvbdnybE4AEKcEF+ mzeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=mOksNH0G; 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 a24si12943492pgd.248.2018.12.11.14.48.58; Tue, 11 Dec 2018 14:49:13 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=mOksNH0G; 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 S1726850AbeLKWqW (ORCPT + 99 others); Tue, 11 Dec 2018 17:46:22 -0500 Received: from mail-eopbgr720046.outbound.protection.outlook.com ([40.107.72.46]:34114 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726361AbeLKWqU (ORCPT ); Tue, 11 Dec 2018 17:46:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CumKVzNJIVp3sFfpHVZSP953H8JPy5OIFTFWZUlbY1I=; b=mOksNH0GcPfrwUSuGS1cRHzhiu5aTCrHN3rn0HYgBoXKCAbQ96Hf7woL66qRrQE0v3vNuB/TgyddZ9J3frUPDrBPNhQZRwEAqM5DY6TbJAm4xHCiVCzAddFEfWIboiraypI8j5EYT3UcRljY1f/aLCpL10xdjsiNvocH9mPq1eI= Received: from SN1PR12MB0175.namprd12.prod.outlook.com (10.162.3.15) by SN1PR12MB2445.namprd12.prod.outlook.com (52.132.195.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1425.19; Tue, 11 Dec 2018 22:46:17 +0000 Received: from SN1PR12MB0175.namprd12.prod.outlook.com ([fe80::bc0e:7f7f:ee65:e2d5]) by SN1PR12MB0175.namprd12.prod.outlook.com ([fe80::bc0e:7f7f:ee65:e2d5%6]) with mapi id 15.20.1425.016; Tue, 11 Dec 2018 22:46:17 +0000 From: "Lendacky, Thomas" To: "x86@kernel.org" , "linux-kernel@vger.kernel.org" CC: Andrea Arcangeli , Konrad Rzeszutek Wilk , Jiri Kosina , Ingo Molnar , Borislav Petkov , Thomas Gleixner , Tim Chen , David Woodhouse Subject: [PATCH v2] x86/speculation: Add support for STIBP always-on preferred mode Thread-Topic: [PATCH v2] x86/speculation: Add support for STIBP always-on preferred mode Thread-Index: AQHUkaNTNctPywnCTEqVxIZjhKo+lQ== Date: Tue, 11 Dec 2018 22:46:16 +0000 Message-ID: <20181211224615.5373.65736.stgit@tlendack-t1.amdoffice.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: SN4PR0201CA0055.namprd02.prod.outlook.com (2603:10b6:803:20::17) To SN1PR12MB0175.namprd12.prod.outlook.com (2a01:111:e400:5143::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [165.204.77.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;SN1PR12MB2445;20:S22ogREjwXjOPovUb0cPYNPuwA6l941tV0wCSNvroG2O8uS/2ZovdyzqM+gLUMMHLPp7vw9c/SR9N4uMNc7nTRsP1Iui4fV8pT/laHJCAaNVv+jsRCcrOG86ogIehedWmOozAZGdkhkGfFCLGBZVNuOQmPZ3NRY3DSmK+ofvsnlaLh8W+DEQx6zh7b3a3X5VOHmqo49RcTJaoqcmCoc7u3hSMwGYsJiRDKJhIJORlrwbP2DA7kdM607/xILc25mo x-ms-office365-filtering-correlation-id: 8d7c8a71-e271-4fb0-5693-08d65fba75db x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:SN1PR12MB2445; x-ms-traffictypediagnostic: SN1PR12MB2445: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823302103)(3002001)(10201501046)(3231455)(999002)(944501520)(52105112)(93006095)(93001095)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:SN1PR12MB2445;BCL:0;PCL:0;RULEID:;SRVR:SN1PR12MB2445; x-forefront-prvs: 08831F51DC x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(346002)(136003)(39860400002)(396003)(366004)(199004)(189003)(81156014)(71200400001)(316002)(8676002)(8936002)(81166006)(54906003)(71190400001)(476003)(6506007)(478600001)(7416002)(486006)(110136005)(99286004)(4326008)(386003)(52116002)(68736007)(2906002)(97746001)(33896004)(256004)(14444005)(7736002)(86362001)(97736004)(102836004)(186003)(26005)(6486002)(5660300001)(9686003)(1076002)(6512007)(305945005)(14454004)(66066001)(6436002)(3846002)(103116003)(53936002)(2501003)(6116002)(72206003)(106356001)(25786009)(105586002);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR12MB2445;H:SN1PR12MB0175.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: +hGrp9Jb3zc4KrFzqNJ12Cwd1M7x2ewpkBVp+BwPL3AYChXSpYweP3TMsKXf3ku2F4pi1UuCYsdHba+qF6jasUK3neOICqeU019qJCouFW0fXWG7z6NQmRIrKGFB3Of9uGOLBbx/jUNAZ+1G3eICbGe/P5dQVkCRqzh01LonDJCLdqfIKAfmRmZkXNtO94U6x0JMTv/qJbWbYuA0tH0JTzAhiyEVBApCl5Nxg/NuzP7A9FfUoADdYAkZ/wSlYyIhUj1pUyMG2epuV4zNLlUWIJXNJp75vNTITzrf1GuslsILE+IGxCo3zJxB7Z2dW7Fu spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <0A76A1C96716C144A7102BD39F6F412A@namprd12.prod.outlook.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d7c8a71-e271-4fb0-5693-08d65fba75db X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2018 22:46:16.8340 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2445 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org RGlmZmVyZW50IEFNRCBwcm9jZXNzb3JzIG1heSBoYXZlIGRpZmZlcmVudCBpbXBsZW1lbnRhdGlv bnMgb2YgU1RJQlAuDQpXaGVuIFNUSUJQIGlzIGNvbmRpdGlvbmFsbHkgZW5hYmxlZCwgc29tZSBp b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