Skip to content

Commit 0eca353

Browse files
bglygregkh
authored andcommitted
misc: IBM Virtual Management Channel Driver (VMC)
This driver is a logical device which provides an interface between the hypervisor and a management partition. This interface is like a message passing interface. This management partition is intended to provide an alternative to HMC-based system management. VMC enables the Management LPAR to provide basic logical partition functions: - Logical Partition Configuration - Boot, start, and stop actions for individual partitions - Display of partition status - Management of virtual Ethernet - Management of virtual Storage - Basic system management This driver is to be used for the POWER Virtual Management Channel Virtual Adapter on the PowerPC platform. It provides a character device which allows for both request/response and async message support through the /dev/ibmvmc node. Signed-off-by: Bryant G. Ly <[email protected]> Reviewed-by: Steven Royer <[email protected]> Reviewed-by: Adam Reznechek <[email protected]> Reviewed-by: Randy Dunlap <[email protected]> Tested-by: Taylor Jakobson <[email protected]> Tested-by: Brad Warrum <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Michael Ellerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5b7d127 commit 0eca353

File tree

8 files changed

+2876
-0
lines changed

8 files changed

+2876
-0
lines changed

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ Code Seq#(hex) Include File Comments
327327
0xCA 80-BF uapi/scsi/cxlflash_ioctl.h
328328
0xCB 00-1F CBM serial IEC bus in development:
329329
330+
0xCC 00-0F drivers/misc/ibmvmc.h pseries VMC driver
330331
0xCD 01 linux/reiserfs_fs.h
331332
0xCF 02 fs/cifs/ioctl.c
332333
0xDB 00-0F drivers/char/mwave/mwavepub.h

Documentation/misc-devices/ibmvmc.rst

Lines changed: 226 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
======================================================
3+
IBM Virtual Management Channel Kernel Driver (IBMVMC)
4+
======================================================
5+
6+
:Authors:
7+
Dave Engebretsen <[email protected]>,
8+
Adam Reznechek <[email protected]>,
9+
Steven Royer <[email protected]>,
10+
Bryant G. Ly <[email protected]>,
11+
12+
Introduction
13+
============
14+
15+
Note: Knowledge of virtualization technology is required to understand
16+
this document.
17+
18+
A good reference document would be:
19+
20+
https://openpowerfoundation.org/wp-content/uploads/2016/05/LoPAPR_DRAFT_v11_24March2016_cmt1.pdf
21+
22+
The Virtual Management Channel (VMC) is a logical device which provides an
23+
interface between the hypervisor and a management partition. This interface
24+
is like a message passing interface. This management partition is intended
25+
to provide an alternative to systems that use a Hardware Management
26+
Console (HMC) - based system management.
27+
28+
The primary hardware management solution that is developed by IBM relies
29+
on an appliance server named the Hardware Management Console (HMC),
30+
packaged as an external tower or rack-mounted personal computer. In a
31+
Power Systems environment, a single HMC can manage multiple POWER
32+
processor-based systems.
33+
34+
Management Application
35+
----------------------
36+
37+
In the management partition, a management application exists which enables
38+
a system administrator to configure the system’s partitioning
39+
characteristics via a command line interface (CLI) or Representational
40+
State Transfer Application (REST API's).
41+
42+
The management application runs on a Linux logical partition on a
43+
POWER8 or newer processor-based server that is virtualized by PowerVM.
44+
System configuration, maintenance, and control functions which
45+
traditionally require an HMC can be implemented in the management
46+
application using a combination of HMC to hypervisor interfaces and
47+
existing operating system methods. This tool provides a subset of the
48+
functions implemented by the HMC and enables basic partition configuration.
49+
The set of HMC to hypervisor messages supported by the management
50+
application component are passed to the hypervisor over a VMC interface,
51+
which is defined below.
52+
53+
The VMC enables the management partition to provide basic partitioning
54+
functions:
55+
56+
- Logical Partitioning Configuration
57+
- Start, and stop actions for individual partitions
58+
- Display of partition status
59+
- Management of virtual Ethernet
60+
- Management of virtual Storage
61+
- Basic system management
62+
63+
Virtual Management Channel (VMC)
64+
--------------------------------
65+
66+
A logical device, called the Virtual Management Channel (VMC), is defined
67+
for communicating between the management application and the hypervisor. It
68+
basically creates the pipes that enable virtualization management
69+
software. This device is presented to a designated management partition as
70+
a virtual device.
71+
72+
This communication device uses Command/Response Queue (CRQ) and the
73+
Remote Direct Memory Access (RDMA) interfaces. A three-way handshake is
74+
defined that must take place to establish that both the hypervisor and
75+
management partition sides of the channel are running prior to
76+
sending/receiving any of the protocol messages.
77+
78+
This driver also utilizes Transport Event CRQs. CRQ messages are sent
79+
when the hypervisor detects one of the peer partitions has abnormally
80+
terminated, or one side has called H_FREE_CRQ to close their CRQ.
81+
Two new classes of CRQ messages are introduced for the VMC device. VMC
82+
Administrative messages are used for each partition using the VMC to
83+
communicate capabilities to their partner. HMC Interface messages are used
84+
for the actual flow of HMC messages between the management partition and
85+
the hypervisor. As most HMC messages far exceed the size of a CRQ buffer,
86+
a virtual DMA (RMDA) of the HMC message data is done prior to each HMC
87+
Interface CRQ message. Only the management partition drives RDMA
88+
operations; hypervisors never directly cause the movement of message data.
89+
90+
91+
Terminology
92+
-----------
93+
RDMA
94+
Remote Direct Memory Access is DMA transfer from the server to its
95+
client or from the server to its partner partition. DMA refers
96+
to both physical I/O to and from memory operations and to memory
97+
to memory move operations.
98+
CRQ
99+
Command/Response Queue a facility which is used to communicate
100+
between partner partitions. Transport events which are signaled
101+
from the hypervisor to partition are also reported in this queue.
102+
103+
Example Management Partition VMC Driver Interface
104+
=================================================
105+
106+
This section provides an example for the management application
107+
implementation where a device driver is used to interface to the VMC
108+
device. This driver consists of a new device, for example /dev/ibmvmc,
109+
which provides interfaces to open, close, read, write, and perform
110+
ioctl’s against the VMC device.
111+
112+
VMC Interface Initialization
113+
----------------------------
114+
115+
The device driver is responsible for initializing the VMC when the driver
116+
is loaded. It first creates and initializes the CRQ. Next, an exchange of
117+
VMC capabilities is performed to indicate the code version and number of
118+
resources available in both the management partition and the hypervisor.
119+
Finally, the hypervisor requests that the management partition create an
120+
initial pool of VMC buffers, one buffer for each possible HMC connection,
121+
which will be used for management application session initialization.
122+
Prior to completion of this initialization sequence, the device returns
123+
EBUSY to open() calls. EIO is returned for all open() failures.
124+
125+
::
126+
127+
Management Partition Hypervisor
128+
CRQ INIT
129+
---------------------------------------->
130+
CRQ INIT COMPLETE
131+
<----------------------------------------
132+
CAPABILITIES
133+
---------------------------------------->
134+
CAPABILITIES RESPONSE
135+
<----------------------------------------
136+
ADD BUFFER (HMC IDX=0,1,..) _
137+
<---------------------------------------- |
138+
ADD BUFFER RESPONSE | - Perform # HMCs Iterations
139+
----------------------------------------> -
140+
141+
VMC Interface Open
142+
------------------
143+
144+
After the basic VMC channel has been initialized, an HMC session level
145+
connection can be established. The application layer performs an open() to
146+
the VMC device and executes an ioctl() against it, indicating the HMC ID
147+
(32 bytes of data) for this session. If the VMC device is in an invalid
148+
state, EIO will be returned for the ioctl(). The device driver creates a
149+
new HMC session value (ranging from 1 to 255) and HMC index value (starting
150+
at index 0 and ranging to 254) for this HMC ID. The driver then does an
151+
RDMA of the HMC ID to the hypervisor, and then sends an Interface Open
152+
message to the hypervisor to establish the session over the VMC. After the
153+
hypervisor receives this information, it sends Add Buffer messages to the
154+
management partition to seed an initial pool of buffers for the new HMC
155+
connection. Finally, the hypervisor sends an Interface Open Response
156+
message, to indicate that it is ready for normal runtime messaging. The
157+
following illustrates this VMC flow:
158+
159+
::
160+
161+
Management Partition Hypervisor
162+
RDMA HMC ID
163+
---------------------------------------->
164+
Interface Open
165+
---------------------------------------->
166+
Add Buffer _
167+
<---------------------------------------- |
168+
Add Buffer Response | - Perform N Iterations
169+
----------------------------------------> -
170+
Interface Open Response
171+
<----------------------------------------
172+
173+
VMC Interface Runtime
174+
---------------------
175+
176+
During normal runtime, the management application and the hypervisor
177+
exchange HMC messages via the Signal VMC message and RDMA operations. When
178+
sending data to the hypervisor, the management application performs a
179+
write() to the VMC device, and the driver RDMA’s the data to the hypervisor
180+
and then sends a Signal Message. If a write() is attempted before VMC
181+
device buffers have been made available by the hypervisor, or no buffers
182+
are currently available, EBUSY is returned in response to the write(). A
183+
write() will return EIO for all other errors, such as an invalid device
184+
state. When the hypervisor sends a message to the management, the data is
185+
put into a VMC buffer and an Signal Message is sent to the VMC driver in
186+
the management partition. The driver RDMA’s the buffer into the partition
187+
and passes the data up to the appropriate management application via a
188+
read() to the VMC device. The read() request blocks if there is no buffer
189+
available to read. The management application may use select() to wait for
190+
the VMC device to become ready with data to read.
191+
192+
::
193+
194+
Management Partition Hypervisor
195+
MSG RDMA
196+
---------------------------------------->
197+
SIGNAL MSG
198+
---------------------------------------->
199+
SIGNAL MSG
200+
<----------------------------------------
201+
MSG RDMA
202+
<----------------------------------------
203+
204+
VMC Interface Close
205+
-------------------
206+
207+
HMC session level connections are closed by the management partition when
208+
the application layer performs a close() against the device. This action
209+
results in an Interface Close message flowing to the hypervisor, which
210+
causes the session to be terminated. The device driver must free any
211+
storage allocated for buffers for this HMC connection.
212+
213+
::
214+
215+
Management Partition Hypervisor
216+
INTERFACE CLOSE
217+
---------------------------------------->
218+
INTERFACE CLOSE RESPONSE
219+
<----------------------------------------
220+
221+
Additional Information
222+
======================
223+
224+
For more information on the documentation for CRQ Messages, VMC Messages,
225+
HMC interface Buffers, and signal messages please refer to the Linux on
226+
Power Architecture Platform Reference. Section F.

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6757,6 +6757,12 @@ L: [email protected]
67576757
S: Supported
67586758
F: drivers/scsi/ibmvscsi/ibmvfc*
67596759

6760+
IBM Power Virtual Management Channel Driver
6761+
M: Bryant G. Ly <[email protected]>
6762+
M: Steven Royer <[email protected]>
6763+
S: Supported
6764+
F: drivers/misc/ibmvmc.*
6765+
67606766
IBM Power Virtual SCSI Device Drivers
67616767
M: Tyrel Datwyler <[email protected]>
67626768

arch/powerpc/include/asm/hvcall.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@
279279
#define H_GET_MPP_X 0x314
280280
#define H_SET_MODE 0x31C
281281
#define H_CLEAR_HPT 0x358
282+
#define H_REQUEST_VMC 0x360
282283
#define H_RESIZE_HPT_PREPARE 0x36C
283284
#define H_RESIZE_HPT_COMMIT 0x370
284285
#define H_REGISTER_PROC_TBL 0x37C

drivers/misc/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,20 @@ config IBM_ASM
113113
for information on the specific driver level and support statement
114114
for your IBM server.
115115

116+
config IBMVMC
117+
tristate "IBM Virtual Management Channel support"
118+
depends on PPC_PSERIES
119+
help
120+
This is the IBM POWER Virtual Management Channel
121+
122+
This driver is to be used for the POWER Virtual
123+
Management Channel virtual adapter on the PowerVM
124+
platform. It provides both request/response and
125+
async message support through the /dev/ibmvmc node.
126+
127+
To compile this driver as a module, choose M here: the
128+
module will be called ibmvmc.
129+
116130
config PHANTOM
117131
tristate "Sensable PHANToM (PCI)"
118132
depends on PCI

drivers/misc/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#
55

66
obj-$(CONFIG_IBM_ASM) += ibmasm/
7+
obj-$(CONFIG_IBMVMC) += ibmvmc.o
78
obj-$(CONFIG_AD525X_DPOT) += ad525x_dpot.o
89
obj-$(CONFIG_AD525X_DPOT_I2C) += ad525x_dpot-i2c.o
910
obj-$(CONFIG_AD525X_DPOT_SPI) += ad525x_dpot-spi.o

0 commit comments

Comments
 (0)