How to change android kernel config?

I use vim3, Has anyone changed the vim3 android pie kernel config.
such as,i want enable /dev/mem

I change the .config file in out/target/product/kvim3/obj/KERNEL_OBJ
but it will lost configs i changed when compile
Can anyone give some help? best regards, thanks

same problem when config ubuntu。。。

You need to change the config on path common

diff --git a/arch/arm/configs/kvim_a32_defconfig b/arch/arm/configs/kvim_a32_defconfig
index 3b6bf28..f97f884 100644
--- a/arch/arm/configs/kvim_a32_defconfig
+++ b/arch/arm/configs/kvim_a32_defconfig
@@ -468,7 +468,7 @@ CONFIG_INPUT_UINPUT=y
 CONFIG_INPUT_TOUCHSCREEN=y
 CONFIG_TOUCHSCREEN_KHADAS_FT5X06=y
 CONFIG_LEGACY_PTY_COUNT=32
-# CONFIG_DEVMEM is not set
+CONFIG_DEVMEM=y
 # CONFIG_DEVKMEM is not set
 CONFIG_HW_RANDOM=y
 # CONFIG_DEVPORT is not set

What is your problem?