lkml.org 
[lkml]   [2020]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2020-09-14 20:39    [W:2.238 / U:1.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site