[PATCH v14 07/22] selftests/vm: generic function to handle shadow key register