On Tue, Oct 11, 2022 at 7:52 PM Lulu Cheng wrote: > > 在 2022/10/12 上午4:57, Caroline Tice 写道: > > I think that if VTV_PAGE_SIZE is not set to the actual size being used by > the system, it could result in some unexpected failures. I believe the > right thing to do in this case, since the size may vary, is to get the > actual size being used by the system and use that in the definition of > VTV_PAGE_SIZE. So in include/vtv-permission.h you would have something > like: > > +#elif defined(__loongarch_lp64) > +#define VTV_PAGE_SIZE sysconf(_SC_PAGE_SIZE) > > Then you would have the accurate, correct size for the current system, and > there would be no need to update the > check in vtv_malloc.cc at all. > > > /* Page-aligned symbol to mark beginning of .vtable_map_vars section. > */ > char _vtable_map_vars_start [] > __attribute__ ((__visibility__ ("protected"), used, > aligned(VTV_PAGE_SIZE), > section(".vtable_map_vars"))) > = { }; > > The above code is in the libgcc/vtv_start.c file. Alignment (aligned > (alignment) ) must be an > integer constant power of 2. So setting VTV_PAGE_SIZE as a variable is not > advisable. > > > As xiruoyao notes, the default value for the LoongArch Linux kernel > configuration is 16KB. > > So let's set VTV_PAGE_SIZE to 16KB first and I will indicate in the > submission information > > that only 16KB pages are supported. > > > OK, that would work if you want to go that way.