On Fri, Aug 26, 2022 at 04:41:26AM +0300, Jarkko Sakkinen wrote: > In sgx_init(), if misc_register() for the provision device fails, and > neither sgx_drv_init() nor sgx_vepc_init() succeeds, then ksgxd will be > prematurely stopped. > > This triggers WARN_ON() because sgx_dirty_page_list ends up being > non-empty. Ultimately this can crash the kernel, depending on the kernel > command line, which is not correct behavior because SGX driver is not > working incorrectly. > > Print simple warning instead, and improve the output by printing the > number of unsanitized pages. > > Link: https://lore.kernel.org/linux-sgx/20220825051827.246698-1-jarkko@xxxxxxxxxx/T/#u > Reported-by: Paul Menzel <pmenzel@xxxxxxxxxxxxx> > Fixes: 51ab30eb2ad4 ("x86/sgx: Replace section->init_laundry_list with sgx_dirty_page_list") > Signed-off-by: Jarkko Sakkinen <jarkko@xxxxxxxxxx> Speaking of non-inlining __eremove(). On a second thought, I think it would make sense to non-inline all of __e*(). Then you can attach kprobe to any of e-opcodes, which would be also sometimes useful for user space debugging. You can attach kprobe and kretprobe for each of them, and grab all the info required. Thoughts? BR, Jarkko