[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YxXMvPLfxdv8QlJo@kernel.org>
Date: Mon, 5 Sep 2022 13:17:32 +0300
From: "jarkko@...nel.org" <jarkko@...nel.org>
To: "Huang, Kai" <kai.huang@...el.com>
Cc: "linux-sgx@...r.kernel.org" <linux-sgx@...r.kernel.org>,
"pmenzel@...gen.mpg.de" <pmenzel@...gen.mpg.de>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
"bp@...en8.de" <bp@...en8.de>,
"Dhanraj, Vijay" <vijay.dhanraj@...el.com>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"x86@...nel.org" <x86@...nel.org>,
"haitao.huang@...ux.intel.com" <haitao.huang@...ux.intel.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>,
"hpa@...or.com" <hpa@...or.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [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@...nel.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
Powered by blists - more mailing lists