On Tue, Jun 29, 2021 at 12:19:22AM -0700, John Hubbard wrote: > > +SYSCALL_DEFINE2(refpage_create, const void *__user, content, unsigned long, > > + flags) > > From the API discussion (and using a simpler syntax to illustrate this), it > seems like the following would be close: > > enum content_type { > BYTE_PATTERN, > FOUR_BYTE_PATTERN, > ... > FULL_4KB_PAGE > }; > > int refpage_create(const void *__user content, enum content_type, unsigned long flags); > > ...and if content_type == BYTE_PATTERN, then content is a pointer to just one byte of > data, and so forth for the other enum values. That seems a little more complicated and non-extensible. int refpage_create(const void *__user content, unsigned int size, unsigned long flags);