use cfg mechanism for kernel too