[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200914183715.GA437309@otcwcpicx6.sc.intel.com>
Date: Mon, 14 Sep 2020 18:37:15 +0000
From: Fenghua Yu <fenghua.yu@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Fenghua Yu <fenghua.yu@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, H Peter Anvin <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
Christoph Hellwig <hch@...radead.org>,
Peter Zijlstra <peterz@...radead.org>,
David Woodhouse <dwmw2@...radead.org>,
Lu Baolu <baolu.lu@...ux.intel.com>,
Dave Hansen <dave.hansen@...el.com>,
Tony Luck <tony.luck@...el.com>,
Ashok Raj <ashok.raj@...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
Subject: Re: [PATCH v7 9/9] x86/mmu: Allocate/free PASID
Hi, Boris,
On Mon, Sep 07, 2020 at 01:18:43PM +0200, Borislav Petkov wrote:
> On Thu, Aug 27, 2020 at 08:06:34AM -0700, Fenghua Yu wrote:
> > + */
> > + xsave = &fpu->state.xsave;
> > + xsave->header.xfeatures |= XFEATURE_MASK_PASID;
> > + ppasid_state = get_xsave_addr(xsave, XFEATURE_PASID);
> > + if (ppasid_state) {
> > + /*
> > + * Only update the task's PASID state when it's
> > + * different from the mm's pasid.
> > + */
> > + if (ppasid_state->pasid != pasid_state) {
> > + /*
> > + * Invalid fpregs so that xrstors will pick up
> ^^^^^^^
>
> Not "xrstors" but the "state restoring" or so.
Fixed.
> > + * the PASID state.
> > + */
> > + __fpu_invalidate_fpregs_state(fpu);
> > + ppasid_state->pasid = pasid_state;
> > + }
>
> What happens if get_xsave_addr() returns NULL? A WARN_ONCE maybe?
get_xsave_addr() will not return NULL because xsave->header.xfeatures has
XFEATURE_MASK_PASID set. I will remove the unnecessary check "if (ppasid_state)"
to optimize the function and add a comment on why the check is unnecessary.
> Ok, done with review.
I addressed all of your comments and will send out the updated series soon.
Thank you very much for your review!
-Fenghua
Powered by blists - more mailing lists