Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1905171ybt; Mon, 15 Jun 2020 12:29:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkjtus4rKhpcqt6CyZLXItN6RJJUPGrD5b7lSteF5A/bBvvxFTOfcdiNqLe5Gu9mFikXTd X-Received: by 2002:a50:9fc2:: with SMTP id c60mr26122563edf.319.1592249381302; Mon, 15 Jun 2020 12:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592249381; cv=none; d=google.com; s=arc-20160816; b=pxXLRwVlM6MVz6U8mnwiGW3HtGTqPGcU12GL12DLgKPCFz81DJJJtT/STN1DxpfTR7 z8ZsCDUAWilzNqtEkqM8IW9sFzCiBohYjaYzsyhV1jcl3g8a6qRT1WkdLezwuPs0iLZv 0i78Drd10m5c3lSdP/2PTDlixZ2k1OZx47amYqHEEoqqPTVZYryxusD4KJjHtQ+z4N3I ZToV63pRHpclq1L8rVR4VVQ+aeNsUu6z2SgSJizt8W6C0XFiUXJSWj0YstQwCOVz1A8X /DV3e5OiONX3QcDyV7GNefT8u06zgb8LgnxzBp+KSqWSqokO9sUQ2v9HKtkAq9UoK/Ro ateg== 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 :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=vl82OfzRcx7QvC7BhErfRxvdGfbyI7A6WeZimFgYluI=; b=LvyK6dcQM400TG71M79GNIEH2yhDG5fxgRDkvBc/rFMKRLOHdrQjKtiBqrAIBCBdk/ 585AzkIIGXm0EI5E3XVOPXWVGTkHKOewrFfcvfKlQPhH1lw0nacpUFKq+wlxIVawWDFO mqUjg9+6IDGJkKOD4aGKgQxZ2J23rnMrt3pZX242yJYU9HSRIWPUOehGrBHB/UwUWIZj J2sBQfRQS6G0yMf1hITgCuma8pQiKAG6KPLBk+04DEVzNS+OhXZiVKm0//k2aDeFLCDf cBmhoM2xcNtQPMculCgoQn2uIwW6764FHgFwG+rc6WpgibCR/ird3KkJ/nyYYntyPTxM rA2w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gu10si9523420ejb.38.2020.06.15.12.29.18; Mon, 15 Jun 2020 12:29:41 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731162AbgFORLF convert rfc822-to-8bit (ORCPT + 99 others); Mon, 15 Jun 2020 13:11:05 -0400 Received: from mga18.intel.com ([134.134.136.126]:16214 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgFORLE (ORCPT ); Mon, 15 Jun 2020 13:11:04 -0400 IronPort-SDR: 0qn1lHL521TMRPY7Qzi0cyXpzweXZ/rsDFt8UH+tV1tzfiuA6T77evzGkLyRVUOilaX62ewbCE LvWSnnenG4Dg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 10:11:04 -0700 IronPort-SDR: RVNXESVvO6FWtMErjyjWNKs0+yP0qEGVpzaS46AsbhzCxBJ4pgFxBRHP0UsFn0BSa/WFZhIvwg gS0bY/MY5b0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,515,1583222400"; d="scan'208";a="449468052" Received: from orsmsx101.amr.corp.intel.com ([10.22.225.128]) by orsmga005.jf.intel.com with ESMTP; 15 Jun 2020 10:11:03 -0700 Received: from orsmsx125.amr.corp.intel.com (10.22.240.125) by ORSMSX101.amr.corp.intel.com (10.22.225.128) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 15 Jun 2020 10:11:03 -0700 Received: from orsmsx115.amr.corp.intel.com ([169.254.4.56]) by ORSMSX125.amr.corp.intel.com ([169.254.3.61]) with mapi id 14.03.0439.000; Mon, 15 Jun 2020 10:11:03 -0700 From: "Luck, Tony" To: Peter Zijlstra , "Yu, Fenghua" CC: Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , "David Woodhouse" , Lu Baolu , Frederic Barrat , Andrew Donnellan , Felix Kuehling , Joerg Roedel , "Hansen, Dave" , "Raj, Ashok" , "Pan, Jacob jun" , "Jiang, Dave" , "Yu, Yu-cheng" , "Mehta, Sohil" , "Shankar, Ravi V" , linux-kernel , x86 , "iommu@lists.linux-foundation.org" , amd-gfx , linuxppc-dev Subject: RE: [PATCH v2 12/12] x86/traps: Fix up invalid PASID Thread-Topic: [PATCH v2 12/12] x86/traps: Fix up invalid PASID Thread-Index: AQHWQRt0fMmHYsE9aUKb3rSjyAIL46jZyC2AgACD5gCAAAQ1gP//m/aA Date: Mon, 15 Jun 2020 17:11:02 +0000 Message-ID: <3908561D78D1C84285E8C5FCA982C28F7F66C290@ORSMSX115.amr.corp.intel.com> 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> In-Reply-To: <20200615160357.GA2531@hirez.programming.kicks-ass.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.138] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> The heuristic always initializes the MSR with the per mm PASID IIF the >> mm has a valid PASID but the MSR doesn't have one. This heuristic usually >> happens only once on the first #GP in a thread. > > But it doesn't guarantee the PASID is the right one. Suppose both the mm > has a PASID and the MSR has a VALID one, but the MSR isn't the mm one. > Then we NO-OP. So if the exception was due to us having the wrong PASID, > we stuck. ENQCMD only checks the 'valid' bit of the IA32_PASID MSR to decide whether to #GP or not. H/W has no concept of the "right" pasid value. If IA32_PASID is valid with the wrong value ... then the system is about to see some major corruption because the operations in the accelerator are not going to translate to the physical addresses for pages owned by the process that issued the ENQCMD. -Tony