Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp337989ybb; Wed, 25 Mar 2020 00:16:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvZwb8MnnnRodB/Nq22VM58qSd+kKXBPpcL852PoXurY9Es/9gh2EbJyGuGDG5Ti6CQu5Rp X-Received: by 2002:a05:6830:1348:: with SMTP id r8mr1392296otq.57.1585120609282; Wed, 25 Mar 2020 00:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585120609; cv=none; d=google.com; s=arc-20160816; b=WCIQkcKwqW4mIJ/+27LpG9hDMCnbGI9n2ewf81M9FBKfNStZgkXOESJEuaiDtfYDAi YqEz/7JtdMgE9TQInjOFqUQtIMqprpPO6w2E/s+BXpM7tL5/2To2W+M2lFABli6/dNyl ZuWuwRqK37xsVcWu31jylqQCwHDD/REDUFF9iwkhpDsS8sUb89f5yoVt92vvHuHWMSOU V/f/vhfr2SAGQV/n5TshzzsrMEiWdwT+zdR7V2AO2TFwh+dCUQxSWHGMZjID25NgtE4M 8lU+DC3ig3KGr7X1FKy++zc3PUPfpdVRZdaCB0c5QdP+dE64EYw6vTGcrbwLQ53Jb8xe RnpQ== 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-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:dkim-signature; bh=/uvEuu5157i1qwfOiIOBUtxGUiAPahfuD8HQNkA0ynM=; b=qETskkgzGtPJvVrzo4lWjWZfrlkoMhZpnOJVmSzlTncIJWFpbFJN/kqzMKP4DPPrNs oBr+R32dDqCx4D8ZDJA8g/EcjXZ6u5HL98FPGhcvJ8tGXCxdkOY8M/dtkvDvSd/2Uk2c UDBHH5T8df2YVagKiJ4E/eYTrcWvFtczgCmgrAlPCg3U6A92w+stGFQSIlSF2okn1q2J jVeqH0i3CpJ17HjFf97WnsnEz5XWWIU3jbbfei2wz3Q4X/DFnjpf8hS4+Ecu2fixlqng tSjzcAz0Tg2Hw5ATOq828RR5uA8vsp8mAdbFRViS/HeLoSOg8bJXj6v9GSQdVHsx27Ih bQUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=IEqe1JAk; 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 m125si9537935oia.240.2020.03.25.00.16.37; Wed, 25 Mar 2020 00:16:49 -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=IEqe1JAk; 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 S1726102AbgCYHPK (ORCPT + 99 others); Wed, 25 Mar 2020 03:15:10 -0400 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:16976 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725909AbgCYHPJ (ORCPT ); Wed, 25 Mar 2020 03:15:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585120507; x=1616656507; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=/uvEuu5157i1qwfOiIOBUtxGUiAPahfuD8HQNkA0ynM=; b=IEqe1JAkJAGygYdK0w70bWA2c33rMoMTTQmYAWmM0AzSNkhN69nRfpfI rPCwLgg46EMwmuHna4Bsn/csbWUvCdn9Y6aC/9EPaEsIpcx0JcB2yoDRQ Jmb55ScJ0jHN5V2VCcMIP9dZkjQ+fFpnKZ3ntv8yCHggI1JDFYkzRqpmu M=; IronPort-SDR: /TJH2FelNaaDGAuuSgwJSdoi3uIZD+qVvLUZl3cF4Xs5DfBaqgmUFcNx3w8NXENwCoRztiHlGn z/prLf8IT16Q== X-Amazon-filename: v2-0004-arch-x86-L1D-flush-optimize-the-context-switch.patch X-IronPort-AV: E=Sophos;i="5.72,303,1580774400"; d="scan'208,223";a="34698652" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP; 25 Mar 2020 07:15:05 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (Postfix) with ESMTPS id 8F00FA26D7; Wed, 25 Mar 2020 07:15:02 +0000 (UTC) Received: from EX13D01UWB004.ant.amazon.com (10.43.161.157) by EX13MTAUWB001.ant.amazon.com (10.43.161.249) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 25 Mar 2020 07:15:01 +0000 Received: from EX13D01UWB002.ant.amazon.com (10.43.161.136) by EX13d01UWB004.ant.amazon.com (10.43.161.157) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 25 Mar 2020 07:15:01 +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; Wed, 25 Mar 2020 07:15:01 +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" Subject: Re: [RFC PATCH v2 4/4] arch/x86: L1D flush, optimize the context switch Thread-Topic: [RFC PATCH v2 4/4] arch/x86: L1D flush, optimize the context switch Thread-Index: AQHWAnSYFSI4KfGBZEuiUZixsPHjuqhY5UcA Date: Wed, 25 Mar 2020 07:15:01 +0000 Message-ID: References: <20200325071101.29556-1-sblbir@amazon.com> <20200325071101.29556-5-sblbir@amazon.com> In-Reply-To: <20200325071101.29556-5-sblbir@amazon.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.43.162.164] Content-Type: multipart/mixed; boundary="_002_a0926f775b8cba31218602c3a8ba932ca5017334camelamazoncom_" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --_002_a0926f775b8cba31218602c3a8ba932ca5017334camelamazoncom_ Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 T24gV2VkLCAyMDIwLTAzLTI1IGF0IDE4OjExICsxMTAwLCBCYWxiaXIgU2luZ2ggd3JvdGU6DQo+ IFVzZSBhIHN0YXRpYyBicmFuY2gvanVtcCBsYWJlbCB0byBvcHRpbWl6ZSB0aGUgY29kZS4gUmln aHQgbm93DQo+IHdlIGRvbid0IHJlZiBjb3VudCB0aGUgdXNlcnMsIGJ1dCB0aGF0IGNvdWxkIGJl IGRvbmUgaWYgbmVlZGVkDQo+IGluIHRoZSBmdXR1cmUuDQo+IA0KPiBTaWduZWQtb2ZmLWJ5OiBC YWxiaXIgU2luZ2ggPHNibGJpckBhbWF6b24uY29tPg0KPiANCg0KSSBzZW50IGFuIG9sZGVyIHZl cnNpb24gb2YgdGhlIHBhdGNoLCBoZXJlIGlzIHRoZSB1cGRhdGVkIHZlcnNpb24NCg0KQmFsYmly IFNpbmdoDQoNCg0K --_002_a0926f775b8cba31218602c3a8ba932ca5017334camelamazoncom_ Content-Type: text/x-patch; name="v2-0004-arch-x86-L1D-flush-optimize-the-context-switch.patch" Content-Description: v2-0004-arch-x86-L1D-flush-optimize-the-context-switch.patch Content-Disposition: attachment; filename="v2-0004-arch-x86-L1D-flush-optimize-the-context-switch.patch"; size=3493; creation-date="Wed, 25 Mar 2020 07:15:01 GMT"; modification-date="Wed, 25 Mar 2020 07:15:01 GMT" Content-ID: Content-Transfer-Encoding: base64 RnJvbSBmYTgwZTk2OTEyMDIxODNhMjg3OWEwMTNlNDk3ZjIyMWIyMjMwNWE2IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBCYWxiaXIgU2luZ2ggPHNibGJpckBhbWF6b24uY29tPgpEYXRl OiBXZWQsIDI1IE1hciAyMDIwIDE2OjQxOjE4ICsxMTAwClN1YmplY3Q6IFtSRkMgUEFUQ0ggdjIg NC80XSBhcmNoL3g4NjogTDFEIGZsdXNoLCBvcHRpbWl6ZSB0aGUgY29udGV4dCBzd2l0Y2gKClVz ZSBhIHN0YXRpYyBicmFuY2gvanVtcCBsYWJlbCB0byBvcHRpbWl6ZSB0aGUgY29kZS4gUmlnaHQg bm93CndlIGRvbid0IHJlZiBjb3VudCB0aGUgdXNlcnMsIGJ1dCB0aGF0IGNvdWxkIGJlIGRvbmUg aWYgbmVlZGVkCmluIHRoZSBmdXR1cmUuCgpTaWduZWQtb2ZmLWJ5OiBCYWxiaXIgU2luZ2ggPHNi bGJpckBhbWF6b24uY29tPgotLS0KIGFyY2gveDg2L2luY2x1ZGUvYXNtL25vc3BlYy1icmFuY2gu aCB8ICAyICsrCiBhcmNoL3g4Ni9tbS90bGIuYyAgICAgICAgICAgICAgICAgICAgfCA1MiArKysr KysrKysrKysrKysrKy0tLS0tLS0tLS0tCiAyIGZpbGVzIGNoYW5nZWQsIDM0IGluc2VydGlvbnMo KyksIDIwIGRlbGV0aW9ucyg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