[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4178fc1a04af49a85d53cb1f5c122b42e02a14e4.camel@intel.com>
Date: Tue, 02 Mar 2021 13:33:22 +1300
From: Kai Huang <kai.huang@...el.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: kvm@...r.kernel.org, x86@...nel.org, linux-sgx@...r.kernel.org,
linux-kernel@...r.kernel.org, jarkko@...nel.org, luto@...nel.org,
dave.hansen@...el.com, rick.p.edgecombe@...el.com,
haitao.huang@...el.com, pbonzini@...hat.com, bp@...en8.de,
tglx@...utronix.de, mingo@...hat.com, hpa@...or.com
Subject: Re: [PATCH 05/25] x86/sgx: Introduce virtual EPC for use by KVM
guests
On Mon, 2021-03-01 at 08:21 -0800, Sean Christopherson wrote:
> On Mon, Mar 01, 2021, Kai Huang wrote:
> > + /*
> > + * SECS pages are "pinned" by child pages, an unpinned once all
>
> s/an/and
Thanks!
>
> > + * children have been EREMOVE'd. A child page in this instance
> > + * may have pinned an SECS page encountered in an earlier release(),
> > + * creating a zombie. Since some children were EREMOVE'd above,
> > + * try to EREMOVE all zombies in the hopes that one was unpinned.
> > + */
> > + mutex_lock(&zombie_secs_pages_lock);
> > + list_for_each_entry_safe(epc_page, tmp, &zombie_secs_pages, list) {
> > + /*
> > + * Speculatively remove the page from the list of zombies,
> > + * if the page is successfully EREMOVE it will be added to
> > + * the list of free pages. If EREMOVE fails, throw the page
> > + * on the local list, which will be spliced on at the end.
> > + */
> > + list_del(&epc_page->list);
> > +
> > + if (sgx_vepc_free_page(epc_page))
> > + list_add_tail(&epc_page->list, &secs_pages);
> > + }
> > +
> > + if (!list_empty(&secs_pages))
> > + list_splice_tail(&secs_pages, &zombie_secs_pages);
> > + mutex_unlock(&zombie_secs_pages_lock);
> > +
> > + kfree(vepc);
> > +
> > + return 0;
> > +}
Powered by blists - more mailing lists