From: "Raj, Ashok" <email@example.com> To: Thomas Gleixner <firstname.lastname@example.org> Cc: Fenghua Yu <email@example.com>, Ingo Molnar <firstname.lastname@example.org>, Borislav Petkov <email@example.com>, H Peter Anvin <firstname.lastname@example.org>, David Woodhouse <email@example.com>, Lu Baolu <firstname.lastname@example.org>, Dave Hansen <email@example.com>, Tony Luck <firstname.lastname@example.org>, Jacob Jun Pan <email@example.com>, Dave Jiang <firstname.lastname@example.org>, Sohil Mehta <email@example.com>, Ravi V Shankar <firstname.lastname@example.org>, linux-kernel <email@example.com>, x86 <firstname.lastname@example.org>, email@example.com, Ashok Raj <firstname.lastname@example.org> Subject: Re: [PATCH 6/7] x86/traps: Fix up invalid PASID Date: Mon, 27 Apr 2020 15:46:46 -0700 [thread overview] Message-ID: <20200427224646.GA103955@otc-nc-03> (raw) In-Reply-To: <email@example.com> Hi Thomas On Sun, Apr 26, 2020 at 05:25:06PM +0200, Thomas Gleixner wrote: > Fenghua Yu <firstname.lastname@example.org> 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 <email@example.com> > > 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.
next prev parent reply other threads:[~2020-04-27 22:46 UTC|newest] Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-30 19:33 [PATCH 0/7] x86: tag application address space for devices Fenghua Yu 2020-03-30 19:33 ` [PATCH 1/7] docs: x86: Add a documentation for ENQCMD Fenghua Yu 2020-04-26 11:02 ` Thomas Gleixner 2020-04-27 20:13 ` Fenghua Yu 2020-03-30 19:33 ` [PATCH 2/7] x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions Fenghua Yu 2020-04-26 11:06 ` Thomas Gleixner 2020-04-27 20:17 ` Fenghua Yu 2020-03-30 19:33 ` [PATCH 3/7] x86/fpu/xstate: Add supervisor PASID state for ENQCMD feature Fenghua Yu 2020-04-26 11:17 ` Thomas Gleixner 2020-04-27 20:33 ` Fenghua Yu 2020-03-30 19:33 ` [PATCH 4/7] x86/msr-index: Define IA32_PASID MSR Fenghua Yu 2020-04-26 11:22 ` Thomas Gleixner 2020-04-27 20:50 ` Fenghua Yu 2020-03-30 19:33 ` [PATCH 5/7] x86/mmu: Allocate/free PASID Fenghua Yu 2020-04-26 14:55 ` Thomas Gleixner 2020-04-27 22:18 ` Fenghua Yu 2020-04-27 23:44 ` Thomas Gleixner 2020-04-28 18:21 ` Jacob Pan (Jun) 2020-04-28 18:54 ` Thomas Gleixner 2020-04-28 19:07 ` Luck, Tony 2020-04-28 20:42 ` Jacob Pan (Jun) 2020-04-28 20:59 ` Luck, Tony 2020-04-28 22:13 ` Jacob Pan (Jun) 2020-04-28 22:32 ` Luck, Tony 2020-04-28 20:40 ` Jacob Pan (Jun) 2020-04-28 20:57 ` Fenghua Yu 2020-03-30 19:33 ` [PATCH 6/7] x86/traps: Fix up invalid PASID Fenghua Yu 2020-04-26 15:25 ` Thomas Gleixner 2020-04-27 20:11 ` Fenghua Yu 2020-04-28 0:13 ` Thomas Gleixner 2020-04-27 22:46 ` Raj, Ashok [this message] 2020-04-27 23:08 ` Luck, Tony 2020-04-28 0:20 ` Thomas Gleixner 2020-04-28 0:54 ` Thomas Gleixner 2020-04-28 1:08 ` Raj, Ashok 2020-03-30 19:33 ` [PATCH 7/7] x86/process: Clear PASID state for a newly forked/cloned thread Fenghua Yu 2020-04-22 20:41 ` [PATCH 0/7] x86: tag application address space for devices Fenghua Yu
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200427224646.GA103955@otc-nc-03 \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: [PATCH 6/7] x86/traps: Fix up invalid PASID' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).