Message ID | 20170404072938.4800-7-kai.huang@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Apr 04, 2017 at 07:29:37PM +1200, Kai Huang wrote: > Which is more generic. Sometimes KVM needs to add EPC page to a temporary > list. > > Signed-off-by: Kai Huang <kai.huang@linux.intel.com> Is this really a mandatory change at this point? /Jarkko > --- > arch/x86/include/asm/sgx.h | 2 +- > drivers/platform/x86/intel_sgx_page_cache.c | 12 ++++++------ > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h > index 063ff8f..4ad580f 100644 > --- a/arch/x86/include/asm/sgx.h > +++ b/arch/x86/include/asm/sgx.h > @@ -364,7 +364,7 @@ static inline int __emodt(struct sgx_secinfo *secinfo, void *epc) > } > > struct sgx_epc_page { > - struct list_head free_list; > + struct list_head list; > }; > > struct sgx_epc_page *sgx_epc_pfn_to_page(unsigned long pfn); > diff --git a/drivers/platform/x86/intel_sgx_page_cache.c b/drivers/platform/x86/intel_sgx_page_cache.c > index 71569e7..11be52e 100644 > --- a/drivers/platform/x86/intel_sgx_page_cache.c > +++ b/drivers/platform/x86/intel_sgx_page_cache.c > @@ -448,7 +448,7 @@ static int sgx_epc_bank_init(struct sgx_epc_bank *bank) > struct sgx_epc_page *entry = bank->epgtbl + i; > > spin_lock(&sgx_free_list_lock); > - list_add_tail(&entry->free_list, &sgx_free_list); > + list_add_tail(&entry->list, &sgx_free_list); > sgx_nr_total_epc_pages++; > sgx_nr_free_pages++; > spin_unlock(&sgx_free_list_lock); > @@ -521,8 +521,8 @@ void sgx_page_cache_teardown(struct sgx_epc_bank *banks, int nr_banks) > */ > spin_lock(&sgx_free_list_lock); > list_for_each_safe(parser, temp, &sgx_free_list) { > - entry = list_entry(parser, struct sgx_epc_page, free_list); > - list_del(&entry->free_list); > + entry = list_entry(parser, struct sgx_epc_page, list); > + list_del(&entry->list); > } > spin_unlock(&sgx_free_list_lock); > > @@ -538,8 +538,8 @@ static struct sgx_epc_page *sgx_alloc_page_fast(void) > > if (!list_empty(&sgx_free_list)) { > entry = list_first_entry(&sgx_free_list, struct sgx_epc_page, > - free_list); > - list_del(&entry->free_list); > + list); > + list_del(&entry->list); > sgx_nr_free_pages--; > } > > @@ -614,7 +614,7 @@ int sgx_free_page(struct sgx_epc_page *entry, unsigned int flags) > } > > spin_lock(&sgx_free_list_lock); > - list_add(&entry->free_list, &sgx_free_list); > + list_add(&entry->list, &sgx_free_list); > sgx_nr_free_pages++; > spin_unlock(&sgx_free_list_lock); > > -- > 2.9.3 >
On 4/5/2017 2:52 AM, Jarkko Sakkinen wrote: > On Tue, Apr 04, 2017 at 07:29:37PM +1200, Kai Huang wrote: >> Which is more generic. Sometimes KVM needs to add EPC page to a temporary >> list. >> >> Signed-off-by: Kai Huang <kai.huang@linux.intel.com> > > Is this really a mandatory change at this point? I'll drop this. Thanks, -Kai > > /Jarkko > >> --- >> arch/x86/include/asm/sgx.h | 2 +- >> drivers/platform/x86/intel_sgx_page_cache.c | 12 ++++++------ >> 2 files changed, 7 insertions(+), 7 deletions(-) >> >> diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h >> index 063ff8f..4ad580f 100644 >> --- a/arch/x86/include/asm/sgx.h >> +++ b/arch/x86/include/asm/sgx.h >> @@ -364,7 +364,7 @@ static inline int __emodt(struct sgx_secinfo *secinfo, void *epc) >> } >> >> struct sgx_epc_page { >> - struct list_head free_list; >> + struct list_head list; >> }; >> >> struct sgx_epc_page *sgx_epc_pfn_to_page(unsigned long pfn); >> diff --git a/drivers/platform/x86/intel_sgx_page_cache.c b/drivers/platform/x86/intel_sgx_page_cache.c >> index 71569e7..11be52e 100644 >> --- a/drivers/platform/x86/intel_sgx_page_cache.c >> +++ b/drivers/platform/x86/intel_sgx_page_cache.c >> @@ -448,7 +448,7 @@ static int sgx_epc_bank_init(struct sgx_epc_bank *bank) >> struct sgx_epc_page *entry = bank->epgtbl + i; >> >> spin_lock(&sgx_free_list_lock); >> - list_add_tail(&entry->free_list, &sgx_free_list); >> + list_add_tail(&entry->list, &sgx_free_list); >> sgx_nr_total_epc_pages++; >> sgx_nr_free_pages++; >> spin_unlock(&sgx_free_list_lock); >> @@ -521,8 +521,8 @@ void sgx_page_cache_teardown(struct sgx_epc_bank *banks, int nr_banks) >> */ >> spin_lock(&sgx_free_list_lock); >> list_for_each_safe(parser, temp, &sgx_free_list) { >> - entry = list_entry(parser, struct sgx_epc_page, free_list); >> - list_del(&entry->free_list); >> + entry = list_entry(parser, struct sgx_epc_page, list); >> + list_del(&entry->list); >> } >> spin_unlock(&sgx_free_list_lock); >> >> @@ -538,8 +538,8 @@ static struct sgx_epc_page *sgx_alloc_page_fast(void) >> >> if (!list_empty(&sgx_free_list)) { >> entry = list_first_entry(&sgx_free_list, struct sgx_epc_page, >> - free_list); >> - list_del(&entry->free_list); >> + list); >> + list_del(&entry->list); >> sgx_nr_free_pages--; >> } >> >> @@ -614,7 +614,7 @@ int sgx_free_page(struct sgx_epc_page *entry, unsigned int flags) >> } >> >> spin_lock(&sgx_free_list_lock); >> - list_add(&entry->free_list, &sgx_free_list); >> + list_add(&entry->list, &sgx_free_list); >> sgx_nr_free_pages++; >> spin_unlock(&sgx_free_list_lock); >> >> -- >> 2.9.3 >> > _______________________________________________ > intel-sgx-kernel-dev mailing list > intel-sgx-kernel-dev@lists.01.org > https://lists.01.org/mailman/listinfo/intel-sgx-kernel-dev >
diff --git a/arch/x86/include/asm/sgx.h b/arch/x86/include/asm/sgx.h index 063ff8f..4ad580f 100644 --- a/arch/x86/include/asm/sgx.h +++ b/arch/x86/include/asm/sgx.h @@ -364,7 +364,7 @@ static inline int __emodt(struct sgx_secinfo *secinfo, void *epc) } struct sgx_epc_page { - struct list_head free_list; + struct list_head list; }; struct sgx_epc_page *sgx_epc_pfn_to_page(unsigned long pfn); diff --git a/drivers/platform/x86/intel_sgx_page_cache.c b/drivers/platform/x86/intel_sgx_page_cache.c index 71569e7..11be52e 100644 --- a/drivers/platform/x86/intel_sgx_page_cache.c +++ b/drivers/platform/x86/intel_sgx_page_cache.c @@ -448,7 +448,7 @@ static int sgx_epc_bank_init(struct sgx_epc_bank *bank) struct sgx_epc_page *entry = bank->epgtbl + i; spin_lock(&sgx_free_list_lock); - list_add_tail(&entry->free_list, &sgx_free_list); + list_add_tail(&entry->list, &sgx_free_list); sgx_nr_total_epc_pages++; sgx_nr_free_pages++; spin_unlock(&sgx_free_list_lock); @@ -521,8 +521,8 @@ void sgx_page_cache_teardown(struct sgx_epc_bank *banks, int nr_banks) */ spin_lock(&sgx_free_list_lock); list_for_each_safe(parser, temp, &sgx_free_list) { - entry = list_entry(parser, struct sgx_epc_page, free_list); - list_del(&entry->free_list); + entry = list_entry(parser, struct sgx_epc_page, list); + list_del(&entry->list); } spin_unlock(&sgx_free_list_lock); @@ -538,8 +538,8 @@ static struct sgx_epc_page *sgx_alloc_page_fast(void) if (!list_empty(&sgx_free_list)) { entry = list_first_entry(&sgx_free_list, struct sgx_epc_page, - free_list); - list_del(&entry->free_list); + list); + list_del(&entry->list); sgx_nr_free_pages--; } @@ -614,7 +614,7 @@ int sgx_free_page(struct sgx_epc_page *entry, unsigned int flags) } spin_lock(&sgx_free_list_lock); - list_add(&entry->free_list, &sgx_free_list); + list_add(&entry->list, &sgx_free_list); sgx_nr_free_pages++; spin_unlock(&sgx_free_list_lock);
Which is more generic. Sometimes KVM needs to add EPC page to a temporary list. Signed-off-by: Kai Huang <kai.huang@linux.intel.com> --- arch/x86/include/asm/sgx.h | 2 +- drivers/platform/x86/intel_sgx_page_cache.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)