Re: [PATCH v4 03/25] x86/sgx: Wipe out EREMOVE from sgx_free_epc_page()
From: Kai Huang
Date: Fri Mar 26 2021 - 16:39:35 EST
> > diff --git a/arch/x86/kernel/cpu/sgx/sgx.h b/arch/x86/kernel/cpu/sgx/sgx.h
> > index 653af8ca1a25..6b21a165500e 100644
> > --- a/arch/x86/kernel/cpu/sgx/sgx.h
> > +++ b/arch/x86/kernel/cpu/sgx/sgx.h
> > @@ -13,6 +13,11 @@
> > #undef pr_fmt
> > #define pr_fmt(fmt) "sgx: " fmt
> >
> > +/* Error message for EREMOVE failure, when kernel is about to leak EPC page */
> > +#define EREMOVE_ERROR_MESSAGE \
> > + "EREMOVE returned %d (0x%x) and an EPC page was leaked. SGX may become unusuable. " \
> > + "This is likely a kernel bug. Refer to Documentation/x86/sgx.rst for more information."
>
>
> Why this needs to be here and not open coded where it is used?
>
I want to use it in sgx/virt.c as well. Please see my reply to patch 5.