On Thu, Sep 30, 2021 at 09:05:39AM -0400, Tianyu Lan wrote: > @@ -1980,15 +1982,11 @@ int set_memory_global(unsigned long addr, int numpages) > __pgprot(_PAGE_GLOBAL), 0); > } > > -static int __set_memory_enc_dec(unsigned long addr, int numpages, bool enc) > +static int __set_memory_enc_pgtable(unsigned long addr, int numpages, bool enc) What exactly is that "pgtable" at the end of the name supposed to mean? So if you want to have different indirections here, I'd suggest you do this: set_memory_encrypted/decrypted() is the external API. It calls _set_memory_enc_dec() which does your hv_* checks. Note the single underscore "_" prefix. Then, the workhorse remains __set_memory_enc_dec(). Ok? Also, we're reworking the mem_encrypt_active() accessors: https://lkml.kernel.org/r/20210928191009.32551-1-bp@xxxxxxxxx so some synchronization when juggling patchsets will be needed. JFYI anyway. Also 2, building your set triggers this, dunno if I'm missing some patches on my local branch for that. In file included from ./arch/x86/include/asm/mshyperv.h:240, from ./include/clocksource/hyperv_timer.h:18, from ./arch/x86/include/asm/vdso/gettimeofday.h:21, from ./include/vdso/datapage.h:137, from ./arch/x86/include/asm/vgtod.h:12, from arch/x86/entry/vdso/vma.c:20: ./include/asm-generic/mshyperv.h: In function ‘vmbus_signal_eom’: ./include/asm-generic/mshyperv.h:153:3: error: implicit declaration of function ‘hv_set_register’; did you mean ‘kset_register’? [-Werror=implicit-function-declaration] 153 | hv_set_register(HV_REGISTER_EOM, 0); | ^~~~~~~~~~~~~~~ | kset_register In file included from ./arch/x86/include/asm/mshyperv.h:240, from arch/x86/mm/pat/set_memory.c:34: ./include/asm-generic/mshyperv.h: In function ‘vmbus_signal_eom’: ... -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette