On Thu, 2021-09-23 at 22:11 +0000, Luck, Tony wrote: > > That's nice. It avoids having to create a fictitious owner for > > the dirty pages, and for the sgx_alloc_va_page() case. Which > > in turn means that the owner field in struct sgx_epc_page can > > remain as "struct sgx_encl_page *owner;" (neatly avoiding DaveH's > > request that it be an anonymous union of all the possible types, > > because it is back to just being one type). > > > > Thanks! Will include in next version. > > Also avoids a bunch of refactoring to make sure to set the owner field > while holding zone->lock. > > I roughly coded it up and the old part 0001 was: > > arch/x86/kernel/cpu/sgx/encl.c | 5 +++-- > arch/x86/kernel/cpu/sgx/encl.h | 2 +- > arch/x86/kernel/cpu/sgx/ioctl.c | 2 +- > arch/x86/kernel/cpu/sgx/main.c | 21 +++++++++++---------- > arch/x86/kernel/cpu/sgx/sgx.h | 4 ++-- > 5 files changed, 18 insertions(+), 16 deletions(-) > > which is by no means huge, but the new part 0001 is > > arch/x86/kernel/cpu/sgx/main.c | 4 +++- > arch/x86/kernel/cpu/sgx/sgx.h | 3 +++ > 2 files changed, 6 insertions(+), 1 deletion(-) > > -Tony This is good to hear. I guess it is then a no brainer to move into this direction then. /Jarkko