lkml.org 
[lkml]   [2022]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v6 5/5] x86/tdx: Add Quote generation support
From
Date
On Fri, 2022-05-13 at 12:29 -0700, Sathyanarayanan Kuppuswamy wrote:
> >
> >
> > > +
> > > + /* Wait for attestation completion */
> > > + ret = wait_for_completion_interruptible(&entry->compl);
> > > + if (ret < 0) {
> > > + /*
> > > + * For premature termination, since VMM still owns the
> > > + * shared buffer, mark the request invalid to let
> > > + * quote_callback_handler() handle the memory cleanup
> > > + * function.
> > > + */
> > > + invalidate_quote_request(entry);
> >
> > Interrupt can arrive after signal interrupt.  So invalidate_quote_request()
> > should check if the request is already processed, and return 0 or -EINTR.
> > Probably check the state always and del_list under single lock/unlock pair.
>
> Agree. But I think we should return -EINTR for the interrupted case
> irrespective of the processed status (so no return 0).
>
> I will hold the lock and handle the cleanup for the processed
> status.

Even if we check the buffer status in invalidate_quote_request(), there's no
guarantee the VMM won't change the buffer status _after_ we do the check, so
looks such check isn't necessary.

--
Thanks,
-Kai


\
 
 \ /
  Last update: 2022-05-17 04:59    [W:0.141 / U:1.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site