From 784ac7d190080a3cf230995eedd3743bddfa4b5c Mon Sep 17 00:00:00 2001 From: Ingo Franzki Date: Thu, 18 Jul 2019 15:57:39 +0200 Subject: [PATCH] zcryptstats: Add note about loading kernel module chsc_sch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dependent on kernel config option CHSC_SCH the device node /dev/chsc may exist per default or not. In case the kernel is built with CHSC_SCH=M, then the device driver is built as separate kernel module, and must therefore be loaded using modprobe chsc_sch to make device node /dev/chsc available. Signed-off-by: Ingo Franzki Signed-off-by: Jan Höppner --- zconf/zcrypt/zcryptstats.8 | 5 +++++ zconf/zcrypt/zcryptstats.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/zconf/zcrypt/zcryptstats.8 b/zconf/zcrypt/zcryptstats.8 index 8c31c691..ef99809a 100644 --- a/zconf/zcrypt/zcryptstats.8 +++ b/zconf/zcrypt/zcryptstats.8 @@ -72,6 +72,11 @@ the parallel execution of cryptographic operations. Cryptographic performance measurement data might not be available when Linux is running as guest under z/VM or under KVM. \fBzcryptstats\fP then displays an error message and exits. +.PP +.B Note: +\fBzcryptstats\fP utilizes the device node \fB/dev/chsc\fP. When this device +node is not available, you might have to load kernel module \fBchsc_sch\fP using +\fBmodprobe chsc_sch\fP to make it available. . . . diff --git a/zconf/zcrypt/zcryptstats.c b/zconf/zcrypt/zcryptstats.c index 136d5ba5..1d2a6e97 100644 --- a/zconf/zcrypt/zcryptstats.c +++ b/zconf/zcrypt/zcryptstats.c @@ -2393,7 +2393,11 @@ int main(int argc, char *argv[]) g.chsc_fd = open(CHSC_DEVICE, O_RDWR); if (g.chsc_fd < 0) { + rc = errno; warnx("File '%s:' %s", CHSC_DEVICE, strerror(errno)); + if (rc == ENOENT) + warnx("You might have to load kernel module 'chsc_sch' " + "using 'modprobe chsc_sch'"); return EXIT_FAILURE; } pr_verbose("Device '%s' has been opened successfully", CHSC_DEVICE);