Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp775182pxb; Thu, 23 Sep 2021 10:16:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt1u+NBWvDX25Icio88ug7bponzIAaMDlInlloXFjgCUmj8DHHF6vq5PBVrOaUIhE4yY4g X-Received: by 2002:a05:6e02:1ba9:: with SMTP id n9mr4640991ili.204.1632417418079; Thu, 23 Sep 2021 10:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632417418; cv=none; d=google.com; s=arc-20160816; b=xupD+Lyb+V+SsxBxFh456q6sZ2Jwhj130RCQdgdFVz3HCB9Hcw7gnIBWPCgoMJ55r8 tjO84B+pUL67S0J889q1UV0KQmeFi0hxOpwzCTYYTGfzspb49L/zGaWoPCdJIumxI/jF i1JTtEK+rGdph3Yshvpvtk3CZ5DOmvfCSf7PsyYrXaCeHPwTFC6f90I+NDxlz0RSm6jx dsLBQSvuAjQevkKGl3IYS1JjM76SHfXzuyOKpZS0RF1fDxgroklVehH/7eNjc+hVNYel pgfqYIg9o7kXAldyM5W98MQsP0VwbsA4r7IPm9/hzFVqP6bKTtvXmPeUs2Kz+Ph2wJ3S E77Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HTTVdMBxoLkolvbRD4ukmDZHr/qRu7yVgqPZqC44qRI=; b=NJDGi7ak6E7rCD5sH1DskWEkNlSfCfjNA7AH1NhbHIcF0r/qFhGO52teq4YeFiFVxi K5ox8e7FbbNsqtRPb0V9QYJQ+7hCLuo7mgSHh9RCBby8bvceTA5oIWv05riShP9QWGN/ OctcKfG24Zg3qmIcAYtgGggGun1gSa5RvdSe2iDKJXzWv/O5u9aRGpEonyOj11h52nyf TOBr8Pz/iv21JOX0z47vVfHasYNuN1ejv/gkUeN7IrR3X+sUbQwQXXdnCv1xCg4WVDZN WvdfSBKraR6l3zG3rNN7tVYpfsI0O73FYxDBlO9LAuVXLHSH3C/29Zv7YhWXTmVnStJa AyaA== 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 l10si8099637ios.26.2021.09.23.10.16.45; Thu, 23 Sep 2021 10:16:58 -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 S242206AbhIWRQR (ORCPT + 99 others); Thu, 23 Sep 2021 13:16:17 -0400 Received: from mga07.intel.com ([134.134.136.100]:12216 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242287AbhIWRQQ (ORCPT ); Thu, 23 Sep 2021 13:16:16 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="287569501" X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="287569501" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 10:14:44 -0700 X-IronPort-AV: E=Sophos;i="5.85,316,1624345200"; d="scan'208";a="551227833" Received: from agluck-desk2.sc.intel.com (HELO agluck-desk2.amr.corp.intel.com) ([10.3.52.146]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Sep 2021 10:14:44 -0700 Date: Thu, 23 Sep 2021 10:14:42 -0700 From: "Luck, Tony" To: Peter Zijlstra Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Andy Lutomirski , Dave Hansen , Lu Baolu , Joerg Roedel , Josh Poimboeuf , Dave Jiang , Jacob Jun Pan , Ashok Raj , Ravi V Shankar , iommu@lists.linux-foundation.org, x86 , linux-kernel Subject: Re: [PATCH 4/8] x86/traps: Demand-populate PASID MSR via #GP Message-ID: References: <20210920192349.2602141-1-fenghua.yu@intel.com> <20210920192349.2602141-5-fenghua.yu@intel.com> <20210922210722.GV4323@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210922210722.GV4323@worktop.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021 at 11:07:22PM +0200, Peter Zijlstra wrote: > On Mon, Sep 20, 2021 at 07:23:45PM +0000, Fenghua Yu wrote: > > @@ -538,6 +547,9 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) > > > > cond_local_irq_enable(regs); > > > > + if (user_mode(regs) && fixup_pasid_exception()) > > + goto exit; > > + > So you're eating any random #GP that might or might not be PASID > related. And all that witout a comment... Enlighten? This is moderately well commented inside the fixup_pasid_exception() function. Another copy of the comments here at the call-site seems overkill. Would it help to change the name to try_fixup_pasid_exception() to make it clearer that this is just a heuristic that may or may not fix this particular #GP? -Tony