Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp52794ybb; Tue, 7 Apr 2020 16:40:24 -0700 (PDT) X-Google-Smtp-Source: APiQypKLVGftEH4ZW9vxfrvqLKnomGMC/0pH5AF6KuxczOzYek4h1hulUTdmPzxBsRncT1svh4Hh X-Received: by 2002:a4a:3f19:: with SMTP id e25mr3967523ooa.67.1586302824244; Tue, 07 Apr 2020 16:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586302824; cv=none; d=google.com; s=arc-20160816; b=0wouIRYboyyvWWlVLrp+KIWTrkyv+H5/+w+W1VSIcblHII7b+3zGUNG/VGXEUBdAB6 yyZZYl1fq8rq0kgH12s4DNQ1xjn9GTPgJx9fU78anpk1vWXLDbYAo2oZA3+b8B7WQ1iD +K0yrwun1cO7tD+YpUnDBuo6nRTiglw6+OajuQL9pzSQRGMuiPk0VkL1P7Ga9/w7MDks 1yvjXx1tu180s0ycHC9iGFuhb02txykcKuqrrcLesW7H5H+M1Bsmd4xAXrM6KUinZnvd tTXlvgeO90sgNbKu/SwXuXuXmBhFBa+x5BcAviEeZKU4BRy/qi973aHhot+kq/JdUtli v2cQ== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=O6bk9Ichy5itvSt3kisa3QDhzUHXtRem1Y1djO4ZFCk=; b=XWraBD9WMmAvr1VqXGiN++UkNhyFhQSfL9vZRlbNr3ycC56xs1jF+iqZR+3fNkzCLR ju9A72cQ80PBW7dKRc+cOvHAJppgbj1pU3xpq5KSer5m+s6txjWaCmx1roqqHMmtoidh z9nyfxT9BZ0Kcw4d7T3ytxO5UX3a4O/rEHrRProQ+BcTSF3wtHO6WGoJhQFz7bSPbgTC f21Nl2FgzAZmRBXbeD0Iiw/vREGLvVuxh53nsiMvS2OHlk9UgnCz1lBCJAlDKDR9keWK hgkVVbhV2kHaukelzxB6GtgD3brP8hsiruYehjhmcuggK5fanCZzdSCHSoCNeBUXQ+zu Pb0A== 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 z26si617890ooz.59.2020.04.07.16.39.56; Tue, 07 Apr 2020 16:40:24 -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; 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 S1726484AbgDGXhi (ORCPT + 99 others); Tue, 7 Apr 2020 19:37:38 -0400 Received: from kernel.crashing.org ([76.164.61.194]:40830 "EHLO kernel.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbgDGXhh (ORCPT ); Tue, 7 Apr 2020 19:37:37 -0400 Received: from localhost (gate.crashing.org [63.228.1.57]) (authenticated bits=0) by kernel.crashing.org (8.14.7/8.14.7) with ESMTP id 037Nb5WB017897 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 7 Apr 2020 18:37:08 -0500 Message-ID: <8be4a3c08fce8c47f7d7e42c6d5b6c854a39995c.camel@kernel.crashing.org> Subject: Re: [PATCH v2 3/4] arch/x86: Optionally flush L1D on context switch From: Benjamin Herrenschmidt To: Kees Cook , Balbir Singh Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org, jpoimboe@redhat.com, tony.luck@intel.com, x86@kernel.org, dave.hansen@intel.com Date: Wed, 08 Apr 2020 09:37:04 +1000 In-Reply-To: <202004071125.605F665@keescook> References: <20200406031946.11815-1-sblbir@amazon.com> <20200406031946.11815-4-sblbir@amazon.com> <202004071125.605F665@keescook> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-04-07 at 11:26 -0700, Kees Cook wrote: > > Add arch specific prctl()'s to opt-in to the L1D cache on context > > switch > > out, the existing mechanisms of tracking prev_mm via cpu_tlbstate > > is > > reused. cond_ibpb() is refactored and renamed into > > cond_mitigation(). > > I still think this should be a generic prctl(). If there is a strong > reason not to do this, can it be described in the commit log here? Agreed. Cheers, Ben.