Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp51475ybb; Tue, 31 Mar 2020 16:58:09 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsGM3/JXdHwA1a7kaTrDzIpX70H3KQ4tfhJNi//3xUFhvJkGctLBd8b2i++Qf4SHe9HUq7D X-Received: by 2002:a9d:4b98:: with SMTP id k24mr4950293otf.26.1585699088843; Tue, 31 Mar 2020 16:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585699088; cv=none; d=google.com; s=arc-20160816; b=jOe1JePZi8TFtXZDcQe1/GsHTuN+b38zbtEwrk7B0qgvqGz2yDUp6AYFxeHVRVTULJ 3kwkFKbhg6zi5b4CHcT0ICjKPOou1sxgXSPRAcdkpX38ev4rrP7NVTSZFTk7CXIlEBJK 1MUR2pUVdnqVshniYVigEYVYPprievKSgGSDwDg4a1etvga0hjBA+hXe/hDHxayoiIoP WTmcOb2uxeFj68JqaZTzZHzNgedukreV5xP8pdy7AcP79H+XaJM597ztGT/8s3KhtdZk jV9kTcZsk69J+3dhnemfHrTnWhrMPUvScbghWZANxVYOeUhsTkhLSOHu8R2Qp0V1Qdj4 jAAg== 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:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:cc:to:from:thread-topic:subject :ironport-sdr:dkim-signature; bh=nPVp6Up/KQcJ/hfp9T1DqsjAaz6LJ9kiTRlDB0LCN4I=; b=IKD32N7fNlrSshPQzOD4zoTiCko2CnFfRapz7pw87whXfRydXmXOhXhXzVh0BastJ4 9KSkY1gcWgoq1+ARt2qE2iE53lKXQPhCE0+E5y/u/xvoUIEqp62FRBPm6CFdMzMbby/h vUaPnN6IW1KIzcI+XLKmy3Isgq/ncXrOyGHAenMbnQ4PUp4dZ/+cZM9goKOOkb3aUBZE VKAvQVW82QcuDWGpiWANP0Jc5J8Sm2x1foyNEOTU2YnY5+8G9ZeFPy9oQshdUW7yPfKC tDvWOu102C1AOHGR0zzl+1hM0ZCGsW/7bi7vh2ZqRI2yfYDUAWBzbFicuxB+tiCx4num 80SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=VCBkzDq2; 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 v24si52541oot.29.2020.03.31.16.57.55; Tue, 31 Mar 2020 16:58:08 -0700 (PDT) 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=VCBkzDq2; 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 S1731590AbgCaX4j (ORCPT + 99 others); Tue, 31 Mar 2020 19:56:39 -0400 Received: from smtp-fw-9102.amazon.com ([207.171.184.29]:17111 "EHLO smtp-fw-9102.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731531AbgCaX4i (ORCPT ); Tue, 31 Mar 2020 19:56:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585698997; x=1617234997; h=from:to:cc:date:message-id:references:in-reply-to: content-id:content-transfer-encoding:mime-version:subject; bh=nPVp6Up/KQcJ/hfp9T1DqsjAaz6LJ9kiTRlDB0LCN4I=; b=VCBkzDq28oitul/0wZdRLv/KRLELfkf/fv2lW7lbpWDwfm74EKM7MFUv lh4Kp4Z6jCryYc92jEVJ8VifrGyhGYKzILflAC0snWsHupd5Q8oBIoWkv BF3K5IZclqpLddwwwGrG4Lp6yN8cmV6Zb6vSW1Pg7jvENcMk5PVeH8JGH M=; IronPort-SDR: 669dVx3xnSnrhMyu0+TdY9lvaF92mrdYhNvm7pSQ7DXcmVcmsQ7AYslvQSa5GJUNxPZxuudUML g9IGk+Cgxe/w== X-IronPort-AV: E=Sophos;i="5.72,329,1580774400"; d="scan'208";a="34552256" Subject: Re: [RFC PATCH v2 3/4] arch/x86: Optionally flush L1D on context switch Thread-Topic: [RFC PATCH v2 3/4] arch/x86: Optionally flush L1D on context switch Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9102.sea19.amazon.com with ESMTP; 31 Mar 2020 23:56:35 +0000 Received: from EX13MTAUWB001.ant.amazon.com (pdx4-ws-svc-p6-lb7-vlan2.pdx.amazon.com [10.170.41.162]) by email-inbound-relay-2a-1c1b5cdd.us-west-2.amazon.com (Postfix) with ESMTPS id D082FA267D; Tue, 31 Mar 2020 23:56:33 +0000 (UTC) Received: from EX13D01UWB001.ant.amazon.com (10.43.161.75) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 31 Mar 2020 23:56:33 +0000 Received: from EX13D01UWB002.ant.amazon.com (10.43.161.136) by EX13d01UWB001.ant.amazon.com (10.43.161.75) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Mar 2020 23:56:32 +0000 Received: from EX13D01UWB002.ant.amazon.com ([10.43.161.136]) by EX13d01UWB002.ant.amazon.com ([10.43.161.136]) with mapi id 15.00.1497.006; Tue, 31 Mar 2020 23:56:33 +0000 From: "Singh, Balbir" To: "tglx@linutronix.de" , "linux-kernel@vger.kernel.org" CC: "keescook@chromium.org" , "tony.luck@intel.com" , "benh@kernel.crashing.org" , "x86@kernel.org" , "dave.hansen@intel.com" Thread-Index: AQHWAnSWq4TE5/rY20aSA0NzSiUBY6hjESUAgABZ8YA= Date: Tue, 31 Mar 2020 23:56:33 +0000 Message-ID: References: <20200325071101.29556-1-sblbir@amazon.com> <20200325071101.29556-4-sblbir@amazon.com> <87r1x8v0eb.fsf@nanos.tec.linutronix.de> In-Reply-To: <87r1x8v0eb.fsf@nanos.tec.linutronix.de> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.161.74] Content-Type: text/plain; charset="utf-8" Content-ID: <8E3B44BB20782942B5D86BABF91AC737@amazon.com> Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org T24gVHVlLCAyMDIwLTAzLTMxIGF0IDIwOjM0ICswMjAwLCBUaG9tYXMgR2xlaXhuZXIgd3JvdGU6 DQo+IA0KPiBCYWxiaXIgU2luZ2ggPHNibGJpckBhbWF6b24uY29tPiB3cml0ZXM6DQo+IA0KPiA+ IFRoaXMgcGF0Y2ggaW1wbGVtZW50cyBhIG1lY2hhbmlzbiB0byBzZWxlY3RpdmVseSBmbHVzaCB0 aGUgTDFEIGNhY2hlLg0KPiANCj4gZ2l0IGdyZXAgJ1RoaXMgcGF0Y2gnIERvY3VtZW50YXRpb24v cHJvY2Vzcy8NCj4gDQoNCkknbGwgZ2V0IG1vcmUgaW1wZXJhdGl2ZSwgdGhhbmtzIQ0KDQo+ID4g ZGlmZiAtLWdpdCBhL2FyY2gveDg2L2luY2x1ZGUvYXNtL3RsYmZsdXNoLmgNCj4gPiBiL2FyY2gv eDg2L2luY2x1ZGUvYXNtL3R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3Bl YyBmb3IgY29tcGFyaXNvbi4NCj4gKyAgICAgICAgICAgICAgICAqDQo+ICAgICAgICAgICAgICAg ICAgKiBJc3N1ZSBJQlBCIG9ubHkgaWYgdGhlIG1tJ3MgYXJlIGRpZmZlcmVudCBhbmQgb25lIG9y DQo+ICAgICAgICAgICAgICAgICAgKiBib3RoIGhhdmUgdGhlIElCUEIgYml0IHNldC4NCj4gICAg ICAgICAgICAgICAgICAqLw0KPiAgICAgICAgICAgICAgICAgaWYgKG5leHRfbW0gIT0gcHJldl9t bSAmJg0KPiAgICAgICAgICAgICAgICAgICAgIChuZXh0X21tIHwgcHJldl9tbSkgJiBMQVNUX1VT RVJfTU1fSUJQQikNCj4gICAgICAgICAgICAgICAgICAgICAgICAgaW5kaXJlY3RfYnJhbmNoX3By ZWRpY3Rpb25fYmFycmllcigpOw0KPiAtDQo+IC0gICAgICAgICAgICAgICB0aGlzX2NwdV93cml0 ZShjcHVfdGxic3RhdGUubGFzdF91c2VyX21tX2licGIsIG5leHRfbW0pOw0KPiAgICAgICAgIH0N Cj4gDQo+ICAgICAgICAgaWYgKHN0YXRpY19icmFuY2hfdW5saWtlbHkoJnN3aXRjaF9tbV9hbHdh eXNfaWJwYikpIHsNCj4gQEAgLTI2NSwxMSArMjY0LDE1IEBAIHN0YXRpYyB2b2lkIGNvbmRfaWJw YihzdHJ1Y3QgdGFza19zdHJ1Y3QNCj4gICAgICAgICAgICAgICAgICAqIGRpZmZlcmVudCBjb250 ZXh0IHRoYW4gdGhlIHVzZXIgc3BhY2UgdGFzayB3aGljaCByYW4NCj4gICAgICAgICAgICAgICAg ICAqIGxhc3Qgb24gdGhpcyBDUFUuDQo+ICAgICAgICAgICAgICAgICAgKi8NCj4gLSAgICAgICAg ICAgICAgIGlmICh0aGlzX2NwdV9yZWFkKGNwdV90bGJzdGF0ZS5sYXN0X3VzZXJfbW0pICE9IG5l eHQtPm1tKSB7DQo+ICsgICAgICAgICAgICAgICBpZiAoKHByZXZfbW0gJiB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