[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200427224646.GA103955@otc-nc-03>
Date: Mon, 27 Apr 2020 15:46:46 -0700
From: "Raj, Ashok" <ashok.raj@...el.com>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: Fenghua Yu <fenghua.yu@...el.com>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, H Peter Anvin <hpa@...or.com>,
David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
Tony Luck <tony.luck@...el.com>,
Jacob Jun Pan <jacob.jun.pan@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Sohil Mehta <sohil.mehta@...el.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>,
x86 <x86@...nel.org>, iommu@...ts.linux-foundation.org,
Ashok Raj <ashok.raj@...el.com>
Subject: Re: [PATCH 6/7] x86/traps: Fix up invalid PASID
Hi Thomas
On Sun, Apr 26, 2020 at 05:25:06PM +0200, Thomas Gleixner wrote:
> Fenghua Yu <fenghua.yu@...el.com> writes:
> > A #GP fault is generated when ENQCMD instruction is executed without
> > a valid PASID value programmed in.
>
> Programmed in what?
>
> > The #GP fault handler will initialize the current thread's PASID MSR.
> >
> > The following heuristic is used to avoid decoding the user instructions
> > to determine the precise reason for the #GP fault:
> > 1) If the mm for the process has not been allocated a PASID, this #GP
> > cannot be fixed.
> > 2) If the PASID MSR is already initialized, then the #GP was for some
> > other reason
> > 3) Try initializing the PASID MSR and returning. If the #GP was from
> > an ENQCMD this will fix it. If not, the #GP fault will be repeated
> > and we will hit case "2".
> >
> > Suggested-by: Thomas Gleixner <tglx@...utronix.de>
>
> Just for the record I also suggested to have a proper errorcode in the
> #GP for ENQCMD and I surely did not suggest to avoid decoding the user
> instructions.
We certainly discussed the possiblity of adding an error code to
identiy #GP due to ENQCMD with our HW architects.
There are only a few cases that have an error code, like move to segment
with an invalid value for instance. There were a few but i don't
recall that entire list.
Since the error code is 0 in most places, there isn't plumbing in hw to return
this value in all cases. It appeared that due to some uarch reasons it
wasn't as simple as it appears to /me sw kinds :-)
So after some internal discussion we decided to take the current
approach. Its possible that if the #GP was due to some other reason
we might #GP another time. Since this wasn't perf or speed path we took
this lazy approach.
We will keep tabs with HW folks for future consideration.
Powered by blists - more mailing lists