lkml.org 
[lkml]   [2022]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] x86/sgx: Do not fail on incomplete sanitization on premature stop of ksgxd
On Mon, Sep 05, 2022 at 12:44:56PM +0300, jarkko@kernel.org wrote:
> On Mon, Sep 05, 2022 at 07:50:33AM +0000, Huang, Kai wrote:
> > On Sat, 2022-09-03 at 13:26 +0300, Jarkko Sakkinen wrote:
> > > >   static int ksgxd(void *p)
> > > >   {
> > > > + unsigned long left_dirty;
> > > > +
> > > >    set_freezable();
> > > >  
> > > >    /*
> > > >    * Sanitize pages in order to recover from kexec(). The 2nd pass is
> > > >    * required for SECS pages, whose child pages blocked EREMOVE.
> > > >    */
> > > > - __sgx_sanitize_pages(&sgx_dirty_page_list);
> > > > - __sgx_sanitize_pages(&sgx_dirty_page_list);
> > > > + left_dirty = __sgx_sanitize_pages(&sgx_dirty_page_list);
> > > > + pr_debug("%ld unsanitized pages\n", left_dirty);
> > >                   %lu
> > >
> >
> > I assume the intention is to print out the unsanitized SECS pages, but what is
> > the value of printing it? To me it doesn't provide any useful information, even
> > for debug.
>
> How do you measure "useful"?
>
> If for some reason there were unsanitized pages, I would at least
> want to know where it ended on the first value.
>
> Plus it does zero harm unless you explicitly turn it on.

I would split it though for a separate patch because it does not need
to be part of the stable fix and change it to:

if (left_dirty)
pr_debug("%lu unsanitized pages\n", left_dirty);

BR, Jarkko

\
 
 \ /
  Last update: 2022-09-05 12:19    [W:0.098 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site