What you should know about the z/VM CP interface

6.10 z/VM guest

The z/VM® CP interface driver (vmcp) uses the CP diagnose X'08' to send commands to CP and to receive responses. The behavior is similar but not identical to #CP on a 3270 or 3215 console.

Using the z/VM CP interface

There are two ways of using the z/VM CP interface device driver:

  • As a device node (usually /dev/vmcp)
  • As a user space tool (the vmcp command)

Differences between vmcp and a 3270 or 3215 console

Most CP commands behave identically with vmcp and on a 3270 or 3215 console. However, some commands show a different behavior:

  • Diagnose X'08' (see z/VM: CP Programming Services, SC24-6272) requires you to specify a response buffer with the command. Because the response size is not known in advance, the default response buffer of vmcp might be too small and the response truncated.
  • On a 3270 or 3215 console, the CP command is executed on virtual CPU 0. The vmcp device driver uses the CPU that is scheduled by the Linux® kernel. For CP commands that depend on the CPU number (like trace), specify the CPU, for example: cpu 3 trace count.
  • Some CP commands do not return specific error or status messages through diagnose X'08'. These messages are returned only on a 3270 or 3215 console. For example, the command vmcp link user1 1234 123 mw might return the message DASD 123 LINKED R/W in a 3270 or 3215 console. This message is not displayed if the CP command is issued with vmcp. For details, see the z/VM help system or z/VM: CP Commands and Utilities Reference, SC24-6268.

Creating device nodes

User space programs access vmcp devices through device nodes. Your distribution might create these device nodes for you.

If no device nodes are created for you, you need to create them yourself, for example, with the mknod command. See the mknod man page for further details.

The /dev/vmcp device node is a character device node (major number 10) with a dynamic minor number. During load, a sysfs folder,class/misc/vmcp/, is created. This folder contains the dev attribute for getting the major and minor number of vmcp.