Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1871944ybt; Mon, 15 Jun 2020 11:34:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiwwhuSgpDOqEYWyzGTwVtO4P69MsX0EcZFVHHmL0X1Jmv2piXEn3HuPJSGLhVeFrgw+aE X-Received: by 2002:a17:906:ae88:: with SMTP id md8mr28189419ejb.347.1592246067238; Mon, 15 Jun 2020 11:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592246067; cv=none; d=google.com; s=arc-20160816; b=IMG6mnjUOTo4r5rc/7/y4yHXmfZTzEy24ZgYQpGiVjwSvxTYpJ8Gi4rUfRnNvSbGm5 O5p9gbT7WHCPjVGIKjWJkD1gLfaqBrU29vbwWMiND+O7Ecqp+Xm86mxuyQRvdojyOvcX PaFRto7PEmtDEq92zeOVbQjuZ4tic0pNeiF7qc9BAAnmts3o73D4oUDs4+QKbL2RrQ4O oUrJwd+cN2BXg16KvzNEBQpvHBzVaG11zW/KRA7iKiz5lbuGE+gWxgqT403aL1GEvg1L Q8+I7CILCKRbZ4SwJpi6aXaEg8WrwBbARI2Hv2C5oq5ZHxnLcGc74WfKYX5FMUXHUEEF o8Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=0uaXx1a8X6ge6muz2Sp6fD7wbgSxal+3tZhrZaa6Nx0=; b=CzOd9/Y93/nSLjuZU0SDKj+DD7YG8iZcFle13SB2wCu93YJxavDXBpFoK1eT+Bx4Yc H2hM/NvYGq806XFjMhlg2KleX+4oYEITS+Q3KDzFS4N6FuNkM7c/drCnOCAtSg6FNYp9 r5/ZozEtrBupZ4qVfo1r5AlUKQfSNzZKMXDhrxR93WHyqY2cw/EBVcHCb30cqQsj5opP dJ4Pa6zshK/OuRFMG8FiWuGJhd7HwtltwuZ4mR0Gz5ptZoKOwDRssXQ7pv67sLPlaiyc 9TEr/ZtdxfyQZM5bXbP1b+0sKv1cbE1+s7KK5ZxvBjNsePIH1uQxfHA6ROfkGzT8xvG4 LqoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=D0jY9gpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si8950310edo.114.2020.06.15.11.34.04; Mon, 15 Jun 2020 11:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=D0jY9gpN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731320AbgFOScD (ORCPT + 99 others); Mon, 15 Jun 2020 14:32:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729354AbgFOScC (ORCPT ); Mon, 15 Jun 2020 14:32:02 -0400 Received: from merlin.infradead.org (unknown [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BD56C061A0E for ; Mon, 15 Jun 2020 11:32:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=0uaXx1a8X6ge6muz2Sp6fD7wbgSxal+3tZhrZaa6Nx0=; b=D0jY9gpNa4VuJV7CCVE0XGTQx+ wFyrLfr7o8wDoY51qJTNQjm/4B8lqrCNzGQDtIaw4ik+p3fchHqc7GxZQo3PPjYkyaFuJN0vv+3BM 2lQuY83HRICjGt/2OvYBHm3yWeok729oCC5gH6Ce1JzaIhM3P6pBkVkSZtPK8xvoWPiuvbFN6y7Wn Urz7U9kmgzIn63lIN4t/iFRfGFOxrO7VZC7rNkYDf7PaemLg1BDQRCIIRd845l7uL243G3Kxz+WFs Tlh3KXfKbIpNqHotyfOur8ysWtNG2ghRlTkgsgoiArC27XGJ1RhR25u1/kKY8q02E0olPt8AwdSSc AroCuvcA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jkttA-0003xc-97; Mon, 15 Jun 2020 18:31:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5D9C03003E1; Mon, 15 Jun 2020 20:31:16 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 4B487203B815D; Mon, 15 Jun 2020 20:31:16 +0200 (CEST) Date: Mon, 15 Jun 2020 20:31:16 +0200 From: Peter Zijlstra To: Fenghua Yu Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , David Woodhouse , Lu Baolu , Frederic Barrat , Andrew Donnellan , Felix Kuehling , Joerg Roedel , Dave Hansen , Tony Luck , Ashok Raj , Jacob Jun Pan , Dave Jiang , Yu-cheng Yu , Sohil Mehta , Ravi V Shankar , linux-kernel , x86 , iommu@lists.linux-foundation.org, amd-gfx , linuxppc-dev Subject: Re: [PATCH v2 12/12] x86/traps: Fix up invalid PASID Message-ID: <20200615183116.GD2531@hirez.programming.kicks-ass.net> References: <1592008893-9388-1-git-send-email-fenghua.yu@intel.com> <1592008893-9388-13-git-send-email-fenghua.yu@intel.com> <20200615075649.GK2497@hirez.programming.kicks-ass.net> <20200615154854.GB13792@romley-ivt3.sc.intel.com> <20200615160357.GA2531@hirez.programming.kicks-ass.net> <20200615181259.GC13792@romley-ivt3.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200615181259.GC13792@romley-ivt3.sc.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 11:12:59AM -0700, Fenghua Yu wrote: > > I don't get why you need a rdmsr here, or why not having one would > > require a TIF flag. Is that because this MSR is XSAVE/XRSTOR managed? > > My concern is TIF flags are precious (only 3 slots available). Defining > a new TIF flag may be not worth it while rdmsr() can check if PASID > is valid in the MSR. And performance here might not be a big issue > in #GP. > > But if you think using TIF flag is better, I can define a new TIF flag > and maintain it per thread (init 0 when clone()/fork(), set 1 in fixup()). > Then we can avoid using rdmsr() to check valid PASID in the MSR. WHY ?!?! What do you need a TIF flag for?