Commit 1758fedd authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 's390-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux

Pull s390 updates from Vasily Gorbik:

 - Improve stop_machine wait logic: replace cpu_relax_yield call in
   generic stop_machine function with a weak stop_machine_yield
   function. This is overridden on s390, which yields the current cpu to
   the neighbouring cpu after a couple of retries, instead of blindly
   giving up the cpu to the hipervisor. This significantly improves
   stop_machine performance on s390 in overcommitted scenarios.

   This includes common code changes which have been Acked by Peter
   Zijlstra and Thomas Gleixner.

 - Improve jump label transformation speed: transform jump labels
   without using stop_machine.

 - Refactoring of the vfio-ccw cp handling, simplifying the code and
   avoiding unneeded allocating/copying.

 - Various vfio-ccw fixes (ccw translation, state machine).

 - Add support for vfio-ap queue interrupt control in the guest. This
   includes s390 kvm changes which have been Acked by Christian
   Borntraeger.

 - Add protected virtualization support for virtio-ccw.

 - Enforce both CONFIG_SMP and CONFIG_HOTPLUG_CPU, which allows to
   remove some code which most likely isn't working at all, besides that
   s390 didn't even compile for !CONFIG_SMP.

 - Support for special flagged EP11 CPRBs for zcrypt.

 - Handle PCI devices with no support for new MIO instructions.

 - Avoid KASAN false positives in reworked stack unwinder.

 - Couple of fixes for the QDIO layer.

 - Convert s390 specific documentation to ReST format.

 - Let s390 crypto modules return -ENODEV instead of -EOPNOTSUPP if
   hardware is missing. This way our modules behave like most other
   modules and which is also what systemd's systemd-modules-load.service
   expects.

 - Replace defconfig with performance_defconfig, so there is one config
   file less to maintain.

 - Remove the SCLP call home device driver, which was never useful.

 - Cleanups all over the place.

* tag 's390-5.3-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (83 commits)
  docs: s390: s390dbf: typos and formatting, update crash command
  docs: s390: unify and update s390dbf kdocs at debug.c
  docs: s390: restore important non-kdoc parts of s390dbf.rst
  vfio-ccw: Fix the conversion of Format-0 CCWs to Format-1
  s390/pci: correctly handle MIO opt-out
  s390/pci: deal with devices that have no support for MIO instructions
  s390: ap: kvm: Enable PQAP/AQIC facility for the guest
  s390: ap: implement PAPQ AQIC interception in kernel
  vfio: ap: register IOMMU VFIO notifier
  s390: ap: kvm: add PQAP interception for AQIC
  s390/unwind: cleanup unused READ_ONCE_TASK_STACK
  s390/kasan: avoid false positives during stack unwind
  s390/qdio: don't touch the dsci in tiqdio_add_input_queues()
  s390/qdio: (re-)initialize tiqdio list entries
  s390/dasd: Fix a precision vs width bug in dasd_feature_list()
  s390/cio: introduce driver_override on the css bus
  vfio-ccw: make convert_ccw0_to_ccw1 static
  vfio-ccw: Remove copy_ccw_from_iova()
  vfio-ccw: Factor out the ccw0-to-ccw1 transition
  vfio-ccw: Copy CCW data outside length calculation
  ...
parents 278ecbf0 499723d1
...@@ -33,3 +33,26 @@ Description: Contains the PIM/PAM/POM values, as reported by the ...@@ -33,3 +33,26 @@ Description: Contains the PIM/PAM/POM values, as reported by the
in sync with the values current in the channel subsystem). in sync with the values current in the channel subsystem).
Note: This is an I/O-subchannel specific attribute. Note: This is an I/O-subchannel specific attribute.
Users: s390-tools, HAL Users: s390-tools, HAL
What: /sys/bus/css/devices/.../driver_override
Date: June 2019
Contact: Cornelia Huck <cohuck@redhat.com>
linux-s390@vger.kernel.org
Description: This file allows the driver for a device to be specified. When
specified, only a driver with a name matching the value written
to driver_override will have an opportunity to bind to the
device. The override is specified by writing a string to the
driver_override file (echo vfio-ccw > driver_override) and
may be cleared with an empty string (echo > driver_override).
This returns the device to standard matching rules binding.
Writing to driver_override does not automatically unbind the
device from its current driver or make any attempt to
automatically load the specified driver. If no driver with a
matching name is currently loaded in the kernel, the device
will not bind to any driver. This also allows devices to
opt-out of driver binding using a driver_override name such as
"none". Only a single driver may be specified in the override,
there is no support for parsing delimiters.
Note that unlike the mechanism of the same name for pci, this
file does not allow to override basic matching rules. I.e.,
the driver must still match the subchannel type of the device.
...@@ -478,7 +478,7 @@ ...@@ -478,7 +478,7 @@
others). others).
ccw_timeout_log [S390] ccw_timeout_log [S390]
See Documentation/s390/CommonIO for details. See Documentation/s390/common_io.rst for details.
cgroup_disable= [KNL] Disable a particular controller cgroup_disable= [KNL] Disable a particular controller
Format: {name of the controller(s) to disable} Format: {name of the controller(s) to disable}
...@@ -516,7 +516,7 @@ ...@@ -516,7 +516,7 @@
/selinux/checkreqprot. /selinux/checkreqprot.
cio_ignore= [S390] cio_ignore= [S390]
See Documentation/s390/CommonIO for details. See Documentation/s390/common_io.rst for details.
clk_ignore_unused clk_ignore_unused
[CLK] [CLK]
Prevents the clock framework from automatically gating Prevents the clock framework from automatically gating
......
...@@ -27,7 +27,7 @@ not strictly considered I/O devices. They are considered here as well, ...@@ -27,7 +27,7 @@ not strictly considered I/O devices. They are considered here as well,
although they are not the focus of this document. although they are not the focus of this document.
Some additional information can also be found in the kernel source under Some additional information can also be found in the kernel source under
Documentation/s390/driver-model.txt. Documentation/s390/driver-model.rst.
The css bus The css bus
=========== ===========
...@@ -38,7 +38,7 @@ into several categories: ...@@ -38,7 +38,7 @@ into several categories:
* Standard I/O subchannels, for use by the system. They have a child * Standard I/O subchannels, for use by the system. They have a child
device on the ccw bus and are described below. device on the ccw bus and are described below.
* I/O subchannels bound to the vfio-ccw driver. See * I/O subchannels bound to the vfio-ccw driver. See
Documentation/s390/vfio-ccw.txt. Documentation/s390/vfio-ccw.rst.
* Message subchannels. No Linux driver currently exists. * Message subchannels. No Linux driver currently exists.
* CHSC subchannels (at most one). The chsc subchannel driver can be used * CHSC subchannels (at most one). The chsc subchannel driver can be used
to send asynchronous chsc commands. to send asynchronous chsc commands.
......
===============================
IBM 3270 Display System support IBM 3270 Display System support
===============================
This file describes the driver that supports local channel attachment This file describes the driver that supports local channel attachment
of IBM 3270 devices. It consists of three sections: of IBM 3270 devices. It consists of three sections:
* Introduction * Introduction
* Installation * Installation
* Operation * Operation
INTRODUCTION. Introduction
============
This paper describes installing and operating 3270 devices under This paper describes installing and operating 3270 devices under
Linux/390. A 3270 device is a block-mode rows-and-columns terminal of Linux/390. A 3270 device is a block-mode rows-and-columns terminal of
...@@ -17,12 +21,12 @@ twenty and thirty years ago. ...@@ -17,12 +21,12 @@ twenty and thirty years ago.
You may have 3270s in-house and not know it. If you're using the You may have 3270s in-house and not know it. If you're using the
VM-ESA operating system, define a 3270 to your virtual machine by using VM-ESA operating system, define a 3270 to your virtual machine by using
the command "DEF GRAF <hex-address>" This paper presumes you will be the command "DEF GRAF <hex-address>" This paper presumes you will be
defining four 3270s with the CP/CMS commands defining four 3270s with the CP/CMS commands:
DEF GRAF 620 - DEF GRAF 620
DEF GRAF 621 - DEF GRAF 621
DEF GRAF 622 - DEF GRAF 622
DEF GRAF 623 - DEF GRAF 623
Your network connection from VM-ESA allows you to use x3270, tn3270, or Your network connection from VM-ESA allows you to use x3270, tn3270, or
another 3270 emulator, started from an xterm window on your PC or another 3270 emulator, started from an xterm window on your PC or
...@@ -34,7 +38,8 @@ This paper covers installation of the driver and operation of a ...@@ -34,7 +38,8 @@ This paper covers installation of the driver and operation of a
dialed-in x3270. dialed-in x3270.
INSTALLATION. Installation
============
You install the driver by installing a patch, doing a kernel build, and You install the driver by installing a patch, doing a kernel build, and
running the configuration script (config3270.sh, in this directory). running the configuration script (config3270.sh, in this directory).
...@@ -59,13 +64,15 @@ Use #CP TERM CONMODE 3270 to change it to 3270. If you generate only ...@@ -59,13 +64,15 @@ Use #CP TERM CONMODE 3270 to change it to 3270. If you generate only
at boot time to a 3270 if it is a 3215. at boot time to a 3270 if it is a 3215.
In brief, these are the steps: In brief, these are the steps:
1. Install the tub3270 patch 1. Install the tub3270 patch
2. (If a module) add a line to a file in /etc/modprobe.d/*.conf 2. (If a module) add a line to a file in `/etc/modprobe.d/*.conf`
3. (If VM) define devices with DEF GRAF 3. (If VM) define devices with DEF GRAF
4. Reboot 4. Reboot
5. Configure 5. Configure
To test that everything works, assuming VM and x3270, To test that everything works, assuming VM and x3270,
1. Bring up an x3270 window. 1. Bring up an x3270 window.
2. Use the DIAL command in that window. 2. Use the DIAL command in that window.
3. You should immediately see a Linux login screen. 3. You should immediately see a Linux login screen.
...@@ -74,7 +81,8 @@ Here are the installation steps in detail: ...@@ -74,7 +81,8 @@ Here are the installation steps in detail:
1. The 3270 driver is a part of the official Linux kernel 1. The 3270 driver is a part of the official Linux kernel
source. Build a tree with the kernel source and any necessary source. Build a tree with the kernel source and any necessary
patches. Then do patches. Then do::
make oldconfig make oldconfig
(If you wish to disable 3215 console support, edit (If you wish to disable 3215 console support, edit
.config; change CONFIG_TN3215's value to "n"; .config; change CONFIG_TN3215's value to "n";
...@@ -84,20 +92,22 @@ Here are the installation steps in detail: ...@@ -84,20 +92,22 @@ Here are the installation steps in detail:
make modules_install make modules_install
2. (Perform this step only if you have configured tub3270 as a 2. (Perform this step only if you have configured tub3270 as a
module.) Add a line to a file /etc/modprobe.d/*.conf to automatically module.) Add a line to a file `/etc/modprobe.d/*.conf` to automatically
load the driver when it's needed. With this line added, you will see load the driver when it's needed. With this line added, you will see
login prompts appear on your 3270s as soon as boot is complete (or login prompts appear on your 3270s as soon as boot is complete (or
with emulated 3270s, as soon as you dial into your vm guest using the with emulated 3270s, as soon as you dial into your vm guest using the
command "DIAL <vmguestname>"). Since the line-mode major number is command "DIAL <vmguestname>"). Since the line-mode major number is
227, the line to add should be: 227, the line to add should be::
alias char-major-227 tub3270 alias char-major-227 tub3270
3. Define graphic devices to your vm guest machine, if you 3. Define graphic devices to your vm guest machine, if you
haven't already. Define them before you reboot (reipl): haven't already. Define them before you reboot (reipl):
DEFINE GRAF 620
DEFINE GRAF 621 - DEFINE GRAF 620
DEFINE GRAF 622 - DEFINE GRAF 621
DEFINE GRAF 623 - DEFINE GRAF 622
- DEFINE GRAF 623
4. Reboot. The reboot process scans hardware devices, including 4. Reboot. The reboot process scans hardware devices, including
3270s, and this enables the tub3270 driver once loaded to respond 3270s, and this enables the tub3270 driver once loaded to respond
...@@ -107,21 +117,23 @@ Here are the installation steps in detail: ...@@ -107,21 +117,23 @@ Here are the installation steps in detail:
5. Run the 3270 configuration script config3270. It is 5. Run the 3270 configuration script config3270. It is
distributed in this same directory, Documentation/s390, as distributed in this same directory, Documentation/s390, as
config3270.sh. Inspect the output script it produces, config3270.sh. Inspect the output script it produces,
/tmp/mkdev3270, and then run that script. This will create the /tmp/mkdev3270, and then run that script. This will create the
necessary character special device files and make the necessary necessary character special device files and make the necessary
changes to /etc/inittab. changes to /etc/inittab.
Then notify /sbin/init that /etc/inittab has changed, by issuing Then notify /sbin/init that /etc/inittab has changed, by issuing
the telinit command with the q operand: the telinit command with the q operand::
cd Documentation/s390 cd Documentation/s390
sh config3270.sh sh config3270.sh
sh /tmp/mkdev3270 sh /tmp/mkdev3270
telinit q telinit q
This should be sufficient for your first time. If your 3270 This should be sufficient for your first time. If your 3270
configuration has changed and you're reusing config3270, you configuration has changed and you're reusing config3270, you
should follow these steps: should follow these steps::
Change 3270 configuration Change 3270 configuration
Reboot Reboot
Run config3270 and /tmp/mkdev3270 Run config3270 and /tmp/mkdev3270
...@@ -132,8 +144,10 @@ Here are the testing steps in detail: ...@@ -132,8 +144,10 @@ Here are the testing steps in detail:
1. Bring up an x3270 window, or use an actual hardware 3278 or 1. Bring up an x3270 window, or use an actual hardware 3278 or
3279, or use the 3270 emulator of your choice. You would be 3279, or use the 3270 emulator of your choice. You would be
running the emulator on your PC or workstation. You would use running the emulator on your PC or workstation. You would use
the command, for example, the command, for example::
x3270 vm-esa-domain-name & x3270 vm-esa-domain-name &
if you wanted a 3278 Model 4 with 43 rows of 80 columns, the if you wanted a 3278 Model 4 with 43 rows of 80 columns, the
default model number. The driver does not take advantage of default model number. The driver does not take advantage of
extended attributes. extended attributes.
...@@ -144,7 +158,8 @@ Here are the testing steps in detail: ...@@ -144,7 +158,8 @@ Here are the testing steps in detail:
2. Use the DIAL command instead of the LOGIN command to connect 2. Use the DIAL command instead of the LOGIN command to connect
to one of the virtual 3270s you defined with the DEF GRAF to one of the virtual 3270s you defined with the DEF GRAF
commands: commands::
dial my-vm-guest-name dial my-vm-guest-name
3. You should immediately see a login prompt from your 3. You should immediately see a login prompt from your
...@@ -171,14 +186,17 @@ Here are the testing steps in detail: ...@@ -171,14 +186,17 @@ Here are the testing steps in detail:
Wrong major number? Wrong minor number? There's your Wrong major number? Wrong minor number? There's your
problem! problem!
D. Do you get the message D. Do you get the message::
"HCPDIA047E my-vm-guest-name 0620 does not exist"? "HCPDIA047E my-vm-guest-name 0620 does not exist"?
If so, you must issue the command "DEF GRAF 620" from your VM If so, you must issue the command "DEF GRAF 620" from your VM
3215 console and then reboot the system. 3215 console and then reboot the system.
OPERATION. OPERATION.
==========
The driver defines three areas on the 3270 screen: the log area, the The driver defines three areas on the 3270 screen: the log area, the
input area, and the status area. input area, and the status area.
...@@ -203,8 +221,10 @@ which indicates no scrolling will occur. (If you hit ENTER with "Linux ...@@ -203,8 +221,10 @@ which indicates no scrolling will occur. (If you hit ENTER with "Linux
Running" and nothing typed, the application receives a newline.) Running" and nothing typed, the application receives a newline.)
You may change the scrolling timeout value. For example, the following You may change the scrolling timeout value. For example, the following
command line: command line::
echo scrolltime=60 > /proc/tty/driver/tty3270 echo scrolltime=60 > /proc/tty/driver/tty3270
changes the scrolling timeout value to 60 sec. Set scrolltime to 0 if changes the scrolling timeout value to 60 sec. Set scrolltime to 0 if
you wish to prevent scrolling entirely. you wish to prevent scrolling entirely.
...@@ -228,7 +248,8 @@ cause an EOF also by typing "^D" and hitting ENTER. ...@@ -228,7 +248,8 @@ cause an EOF also by typing "^D" and hitting ENTER.
No PF key is preassigned to cause a job suspension, but you may cause a No PF key is preassigned to cause a job suspension, but you may cause a
job suspension by typing "^Z" and hitting ENTER. You may wish to job suspension by typing "^Z" and hitting ENTER. You may wish to
assign this function to a PF key. To make PF7 cause job suspension, assign this function to a PF key. To make PF7 cause job suspension,
execute the command: execute the command::
echo pf7=^z > /proc/tty/driver/tty3270 echo pf7=^z > /proc/tty/driver/tty3270
If the input you type does not end with the two characters "^n", the If the input you type does not end with the two characters "^n", the
...@@ -243,8 +264,10 @@ command is entered into the stack only when the input area is not made ...@@ -243,8 +264,10 @@ command is entered into the stack only when the input area is not made
invisible (such as for password entry) and it is not identical to the invisible (such as for password entry) and it is not identical to the
current top entry. PF10 rotates backward through the command stack; current top entry. PF10 rotates backward through the command stack;
PF11 rotates forward. You may assign the backward function to any PF PF11 rotates forward. You may assign the backward function to any PF
key (or PA key, for that matter), say, PA3, with the command: key (or PA key, for that matter), say, PA3, with the command::
echo -e pa3=\\033k > /proc/tty/driver/tty3270 echo -e pa3=\\033k > /proc/tty/driver/tty3270
This assigns the string ESC-k to PA3. Similarly, the string ESC-j This assigns the string ESC-k to PA3. Similarly, the string ESC-j
performs the forward function. (Rationale: In bash with vi-mode line performs the forward function. (Rationale: In bash with vi-mode line
editing, ESC-k and ESC-j retrieve backward and forward history. editing, ESC-k and ESC-j retrieve backward and forward history.
...@@ -252,15 +275,19 @@ Suggestions welcome.) ...@@ -252,15 +275,19 @@ Suggestions welcome.)
Is a stack size of twenty commands not to your liking? Change it on Is a stack size of twenty commands not to your liking? Change it on
the fly. To change to saving the last 100 commands, execute the the fly. To change to saving the last 100 commands, execute the
command: command::
echo recallsize=100 > /proc/tty/driver/tty3270 echo recallsize=100 > /proc/tty/driver/tty3270
Have a command you issue frequently? Assign it to a PF or PA key! Use Have a command you issue frequently? Assign it to a PF or PA key! Use
the command the command::
echo pf24="mkdir foobar; cd foobar" > /proc/tty/driver/tty3270
echo pf24="mkdir foobar; cd foobar" > /proc/tty/driver/tty3270
to execute the commands mkdir foobar and cd foobar immediately when you to execute the commands mkdir foobar and cd foobar immediately when you
hit PF24. Want to see the command line first, before you execute it? hit PF24. Want to see the command line first, before you execute it?
Use the -n option of the echo command: Use the -n option of the echo command::
echo -n pf24="mkdir foo; cd foo" > /proc/tty/driver/tty3270 echo -n pf24="mkdir foo; cd foo" > /proc/tty/driver/tty3270
......
S/390 common I/O-Layer - command line parameters, procfs and debugfs entries ======================
============================================================================ S/390 common I/O-Layer
======================
command line parameters, procfs and debugfs entries
===================================================
Command line parameters Command line parameters
----------------------- -----------------------
...@@ -13,7 +17,7 @@ Command line parameters ...@@ -13,7 +17,7 @@ Command line parameters
device := {all | [!]ipldev | [!]condev | [!]<devno> | [!]<devno>-<devno>} device := {all | [!]ipldev | [!]condev | [!]<devno> | [!]<devno>-<devno>}
The given devices will be ignored by the common I/O-layer; no detection The given devices will be ignored by the common I/O-layer; no detection
and device sensing will be done on any of those devices. The subchannel to and device sensing will be done on any of those devices. The subchannel to
which the device in question is attached will be treated as if no device was which the device in question is attached will be treated as if no device was
attached. attached.
...@@ -28,14 +32,20 @@ Command line parameters ...@@ -28,14 +32,20 @@ Command line parameters
keywords can be used to refer to the CCW based boot device and CCW console keywords can be used to refer to the CCW based boot device and CCW console
device respectively (these are probably useful only when combined with the '!' device respectively (these are probably useful only when combined with the '!'
operator). The '!' operator will cause the I/O-layer to _not_ ignore a device. operator). The '!' operator will cause the I/O-layer to _not_ ignore a device.
The command line is parsed from left to right. The command line
is parsed from left to right.
For example::
For example,
cio_ignore=0.0.0023-0.0.0042,0.0.4711 cio_ignore=0.0.0023-0.0.0042,0.0.4711
will ignore all devices ranging from 0.0.0023 to 0.0.0042 and the device will ignore all devices ranging from 0.0.0023 to 0.0.0042 and the device
0.0.4711, if detected. 0.0.4711, if detected.
As another example,
As another example::
cio_ignore=all,!0.0.4711,!0.0.fd00-0.0.fd02 cio_ignore=all,!0.0.4711,!0.0.fd00-0.0.fd02
will ignore all devices but 0.0.4711, 0.0.fd00, 0.0.fd01, 0.0.fd02. will ignore all devices but 0.0.4711, 0.0.fd00, 0.0.fd01, 0.0.fd02.
By default, no devices are ignored. By default, no devices are ignored.
...@@ -48,40 +58,45 @@ Command line parameters ...@@ -48,40 +58,45 @@ Command line parameters
Lists the ranges of devices (by bus id) which are ignored by common I/O. Lists the ranges of devices (by bus id) which are ignored by common I/O.
You can un-ignore certain or all devices by piping to /proc/cio_ignore. You can un-ignore certain or all devices by piping to /proc/cio_ignore.
"free all" will un-ignore all ignored devices, "free all" will un-ignore all ignored devices,
"free <device range>, <device range>, ..." will un-ignore the specified "free <device range>, <device range>, ..." will un-ignore the specified
devices. devices.
For example, if devices 0.0.0023 to 0.0.0042 and 0.0.4711 are ignored, For example, if devices 0.0.0023 to 0.0.0042 and 0.0.4711 are ignored,
- echo free 0.0.0030-0.0.0032 > /proc/cio_ignore - echo free 0.0.0030-0.0.0032 > /proc/cio_ignore
will un-ignore devices 0.0.0030 to 0.0.0032 and will leave devices 0.0.0023 will un-ignore devices 0.0.0030 to 0.0.0032 and will leave devices 0.0.0023
to 0.0.002f, 0.0.0033 to 0.0.0042 and 0.0.4711 ignored; to 0.0.002f, 0.0.0033 to 0.0.0042 and 0.0.4711 ignored;
- echo free 0.0.0041 > /proc/cio_ignore will furthermore un-ignore device - echo free 0.0.0041 > /proc/cio_ignore will furthermore un-ignore device
0.0.0041; 0.0.0041;
- echo free all > /proc/cio_ignore will un-ignore all remaining ignored - echo free all > /proc/cio_ignore will un-ignore all remaining ignored
devices. devices.
When a device is un-ignored, device recognition and sensing is performed and When a device is un-ignored, device recognition and sensing is performed and
the device driver will be notified if possible, so the device will become the device driver will be notified if possible, so the device will become
available to the system. Note that un-ignoring is performed asynchronously. available to the system. Note that un-ignoring is performed asynchronously.
You can also add ranges of devices to be ignored by piping to You can also add ranges of devices to be ignored by piping to
/proc/cio_ignore; "add <device range>, <device range>, ..." will ignore the /proc/cio_ignore; "add <device range>, <device range>, ..." will ignore the
specified devices. specified devices.
Note: While already known devices can be added to the list of devices to be Note: While already known devices can be added to the list of devices to be
ignored, there will be no effect on then. However, if such a device ignored, there will be no effect on then. However, if such a device
disappears and then reappears, it will then be ignored. To make disappears and then reappears, it will then be ignored. To make
known devices go away, you need the "purge" command (see below). known devices go away, you need the "purge" command (see below).
For example, For example::
"echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore" "echo add 0.0.a000-0.0.accc, 0.0.af00-0.0.afff > /proc/cio_ignore"
will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored
devices. devices.
You can remove already known but now ignored devices via You can remove already known but now ignored devices via::
"echo purge > /proc/cio_ignore" "echo purge > /proc/cio_ignore"
All devices ignored but still registered and not online (= not in use) All devices ignored but still registered and not online (= not in use)
will be deregistered and thus removed from the system. will be deregistered and thus removed from the system.
...@@ -115,11 +130,11 @@ debugfs entries ...@@ -115,11 +130,11 @@ debugfs entries
Various debug messages from the common I/O-layer. Various debug messages from the common I/O-layer.
- /sys/kernel/debug/s390dbf/cio_trace/hex_ascii - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii
Logs the calling of functions in the common I/O-layer and, if applicable, Logs the calling of functions in the common I/O-layer and, if applicable,
which subchannel they were called for, as well as dumps of some data which subchannel they were called for, as well as dumps of some data
structures (like irb in an error case). structures (like irb in an error case).
The level of logging can be changed to be more or less verbose by piping to The level of logging can be changed to be more or less verbose by piping to
/sys/kernel/debug/s390dbf/cio_*/level a number between 0 and 6; see the /sys/kernel/debug/s390dbf/cio_*/level a number between 0 and 6; see the
documentation on the S/390 debug feature (Documentation/s390/s390dbf.txt) documentation on the S/390 debug feature (Documentation/s390/s390dbf.rst)
for details. for details.
==================
DASD device driver DASD device driver
==================
S/390's disk devices (DASDs) are managed by Linux via the DASD device S/390's disk devices (DASDs) are managed by Linux via the DASD device
driver. It is valid for all types of DASDs and represents them to driver. It is valid for all types of DASDs and represents them to
...@@ -14,14 +16,14 @@ parameters are to be given in hexadecimal notation without a leading ...@@ -14,14 +16,14 @@ parameters are to be given in hexadecimal notation without a leading
If you supply kernel parameters the different instances are processed If you supply kernel parameters the different instances are processed
in order of appearance and a minor number is reserved for any device in order of appearance and a minor number is reserved for any device
covered by the supplied range up to 64 volumes. Additional DASDs are covered by the supplied range up to 64 volumes. Additional DASDs are
ignored. If you do not supply the 'dasd=' kernel parameter at all, the ignored. If you do not supply the 'dasd=' kernel parameter at all, the
DASD driver registers all supported DASDs of your system to a minor DASD driver registers all supported DASDs of your system to a minor
number in ascending order of the subchannel number. number in ascending order of the subchannel number.
The driver currently supports ECKD-devices and there are stubs for The driver currently supports ECKD-devices and there are stubs for
support of the FBA and CKD architectures. For the FBA architecture support of the FBA and CKD architectures. For the FBA architecture
only some smart data structures are missing to make the support only some smart data structures are missing to make the support
complete. complete.
We performed our testing on 3380 and 3390 type disks of different We performed our testing on 3380 and 3390 type disks of different
sizes, under VM and on the bare hardware (LPAR), using internal disks sizes, under VM and on the bare hardware (LPAR), using internal disks
of the multiprise as well as a RAMAC virtual array. Disks exported by of the multiprise as well as a RAMAC virtual array. Disks exported by
...@@ -34,19 +36,22 @@ accessibility of the DASD from other OSs. In a later stage we will ...@@ -34,19 +36,22 @@ accessibility of the DASD from other OSs. In a later stage we will
provide support of partitions, maybe VTOC oriented or using a kind of provide support of partitions, maybe VTOC oriented or using a kind of
partition table in the label record. partition table in the label record.
USAGE Usage
=====
-Low-level format (?CKD only) -Low-level format (?CKD only)
For using an ECKD-DASD as a Linux harddisk you have to low-level For using an ECKD-DASD as a Linux harddisk you have to low-level
format the tracks by issuing the BLKDASDFORMAT-ioctl on that format the tracks by issuing the BLKDASDFORMAT-ioctl on that
device. This will erase any data on that volume including IBM volume device. This will erase any data on that volume including IBM volume
labels, VTOCs etc. The ioctl may take a 'struct format_data *' or labels, VTOCs etc. The ioctl may take a `struct format_data *` or
'NULL' as an argument. 'NULL' as an argument::
typedef struct {
typedef struct {
int start_unit; int start_unit;
int stop_unit; int stop_unit;
int blksize; int blksize;
} format_data_t; } format_data_t;
When a NULL argument is passed to the BLKDASDFORMAT ioctl the whole When a NULL argument is passed to the BLKDASDFORMAT ioctl the whole
disk is formatted to a blocksize of 1024 bytes. Otherwise start_unit disk is formatted to a blocksize of 1024 bytes. Otherwise start_unit
and stop_unit are the first and last track to be formatted. If and stop_unit are the first and last track to be formatted. If
...@@ -56,17 +61,23 @@ up to the last track. blksize can be any power of two between 512 and ...@@ -56,17 +61,23 @@ up to the last track. blksize can be any power of two between 512 and
1kB blocks anyway and you gain approx. 50% of capacity increasing your 1kB blocks anyway and you gain approx. 50% of capacity increasing your
blksize from 512 byte to 1kB. blksize from 512 byte to 1kB.
-Make a filesystem Make a filesystem
=================
Then you can mk??fs the filesystem of your choice on that volume or Then you can mk??fs the filesystem of your choice on that volume or
partition. For reasons of sanity you should build your filesystem on partition. For reasons of sanity you should build your filesystem on
the partition /dev/dd?1 instead of the whole volume. You only lose 3kB the partition /dev/dd?1 instead of the whole volume. You only lose 3kB
but may be sure that you can reuse your data after introduction of a but may be sure that you can reuse your data after introduction of a
real partition table. real partition table.
BUGS: Bugs
====
- Performance sometimes is rather low because we don't fully exploit clustering - Performance sometimes is rather low because we don't fully exploit clustering
TODO-List: TODO-List
=========
- Add IBM'S Disk layout to genhd - Add IBM'S Disk layout to genhd
- Enhance driver to use more than one major number - Enhance driver to use more than one major number
- Enable usage as a module - Enable usage as a module
......
This source diff could not be displayed because it is too large. You can view the blob instead.
:orphan:
=================
s390 Architecture
=================
.. toctree::
:maxdepth: 1
cds
3270
debugging390
driver-model
monreader
qeth
s390dbf
vfio-ap
vfio-ccw
zfcpdump
dasd
common_io
text_files
.. only:: subproject and html
Indices
=======
* :ref:`genindex`
=================================================
Linux API for read access to z/VM Monitor Records
=================================================
Date : 2004-Nov-26 Date : 2004-Nov-26
Author: Gerald Schaefer (geraldsc@de.ibm.com) Author: Gerald Schaefer (geraldsc@de.ibm.com)
Linux API for read access to z/VM Monitor Records
=================================================
Description Description
=========== ===========
This item delivers a new Linux API in the form of a misc char device that is This item delivers a new Linux API in the form of a misc char device that is
usable from user space and allows read access to the z/VM Monitor Records usable from user space and allows read access to the z/VM Monitor Records
collected by the *MONITOR System Service of z/VM. collected by the `*MONITOR` System Service of z/VM.
User Requirements User Requirements
================= =================
The z/VM guest on which you want to access this API needs to be configured in The z/VM guest on which you want to access this API needs to be configured in
order to allow IUCV connections to the *MONITOR service, i.e. it needs the order to allow IUCV connections to the `*MONITOR` service, i.e. it needs the
IUCV *MONITOR statement in its user entry. If the monitor DCSS to be used is IUCV `*MONITOR` statement in its user entry. If the monitor DCSS to be used is
restricted (likely), you also need the NAMESAVE <DCSS NAME> statement. restricted (likely), you also need the NAMESAVE <DCSS NAME> statement.
This item will use the IUCV device driver to access the z/VM services, so you This item will use the IUCV device driver to access the z/VM services, so you
need a kernel with IUCV support. You also need z/VM version 4.4 or 5.1. need a kernel with IUCV support. You also need z/VM version 4.4 or 5.1.
...@@ -50,7 +52,9 @@ Your guest virtual storage has to end below the starting address of the DCSS ...@@ -50,7 +52,9 @@ Your guest virtual storage has to end below the starting address of the DCSS
and you have to specify the "mem=" kernel parameter in your parmfile with a and you have to specify the "mem=" kernel parameter in your parmfile with a
value greater than the ending address of the DCSS. value greater than the ending address of the DCSS.
Example: DEF STOR 140M Example::
DEF STOR 140M
This defines 140MB storage size for your guest, the parameter "mem=160M" is This defines 140MB storage size for your guest, the parameter "mem=160M" is
added to the parmfile. added to the parmfile.
...@@ -66,24 +70,27 @@ kernel, the kernel parameter "monreader.mondcss=<DCSS NAME>" can be specified ...@@ -66,24 +70,27 @@ kernel, the kernel parameter "monreader.mondcss=<DCSS NAME>" can be specified
in the parmfile. in the parmfile.
The default name for the DCSS is "MONDCSS" if none is specified. In case that The default name for the DCSS is "MONDCSS" if none is specified. In case that
there are other users already connected to the *MONITOR service (e.g. there are other users already connected to the `*MONITOR` service (e.g.
Performance Toolkit), the monitor DCSS is already defined and you have to use Performance Toolkit), the monitor DCSS is already defined and you have to use
the same DCSS. The CP command Q MONITOR (Class E privileged) shows the name the same DCSS. The CP command Q MONITOR (Class E privileged) shows the name
of the monitor DCSS, if already defined, and the users connected to the of the monitor DCSS, if already defined, and the users connected to the
*MONITOR service. `*MONITOR` service.
Refer to the "z/VM Performance" book (SC24-6109-00) on how to create a monitor Refer to the "z/VM Performance" book (SC24-6109-00) on how to create a monitor
DCSS if your z/VM doesn't have one already, you need Class E privileges to DCSS if your z/VM doesn't have one already, you need Class E privileges to
define and save a DCSS. define and save a DCSS.
Example: Example:
-------- --------
modprobe monreader mondcss=MYDCSS
::
modprobe monreader mondcss=MYDCSS
This loads the module and sets the DCSS name to "MYDCSS". This loads the module and sets the DCSS name to "MYDCSS".
NOTE: NOTE:
----- -----
This API provides no interface to control the *MONITOR service, e.g. specify This API provides no interface to control the `*MONITOR` service, e.g. specify
which data should be collected. This can be done by the CP command MONITOR which data should be collected. This can be done by the CP command MONITOR
(Class E privileged), see "CP Command and Utility Reference". (Class E privileged), see "CP Command and Utility Reference".
...@@ -98,6 +105,7 @@ If your distribution does not support udev, a device node will not be created ...@@ -98,6 +105,7 @@ If your distribution does not support udev, a device node will not be created
automatically and you have to create it manually after loading the module. automatically and you have to create it manually after loading the module.
Therefore you need to know the major and minor numbers of the device. These Therefore you need to know the major and minor numbers of the device. These
numbers can be found in /sys/class/misc/monreader/dev. numbers can be found in /sys/class/misc/monreader/dev.
Typing cat /sys/class/misc/monreader/dev will give an output of the form Typing cat /sys/class/misc/monreader/dev will give an output of the form
<major>:<minor>. The device node can be created via the mknod command, enter <major>:<minor>. The device node can be created via the mknod command, enter
mknod <name> c <major> <minor>, where <name> is the name of the device node mknod <name> c <major> <minor>, where <name> is the name of the device node
...@@ -105,10 +113,13 @@ to be created. ...@@ -105,10 +113,13 @@ to be created.
Example: Example:
-------- --------
# modprobe monreader
# cat /sys/class/misc/monreader/dev ::
10:63
# mknod /dev/monreader c 10 63 # modprobe monreader
# cat /sys/class/misc/monreader/dev
10:63
# mknod /dev/monreader c 10 63
This loads the module with the default monitor DCSS (MONDCSS) and creates a This loads the module with the default monitor DCSS (MONDCSS) and creates a
device node. device node.
...@@ -133,20 +144,21 @@ last byte of data. The start address is needed to handle "end-of-frame" records ...@@ -133,20 +144,21 @@ last byte of data. The start address is needed to handle "end-of-frame" records
correctly (domain 1, record 13), i.e. it can be used to determine the record correctly (domain 1, record 13), i.e. it can be used to determine the record
start offset relative to a 4K page (frame) boundary. start offset relative to a 4K page (frame) boundary.
See "Appendix A: *MONITOR" in the "z/VM Performance" document for a description See "Appendix A: `*MONITOR`" in the "z/VM Performance" document for a description
of the monitor control element layout. The layout of the monitor records can of the monitor control element layout. The layout of the monitor records can
be found here (z/VM 5.1): http://www.vm.ibm.com/pubs/mon510/index.html be found here (z/VM 5.1): http://www.vm.ibm.com/pubs/mon510/index.html
The layout of the data stream provided by the monreader device is as follows: The layout of the data stream provided by the monreader device is as follows::
...
<0 byte read> ...
<first MCE> \ <0 byte read>
<first set of records> | <first MCE> \
... |- data set <first set of records> |
<last MCE> | ... |- data set
<last set of records> / <last MCE> |
<0 byte read> <last set of records> /
... <0 byte read>
...
There may be more than one combination of MCE and corresponding record set There may be more than one combination of MCE and corresponding record set
within one data set and the end of each data set is indicated by a successful within one data set and the end of each data set is indicated by a successful
...@@ -165,15 +177,19 @@ As with most char devices, error conditions are indicated by returning a ...@@ -165,15 +177,19 @@ As with most char devices, error conditions are indicated by returning a
negative value for the number of bytes read. In this case, the errno variable negative value for the number of bytes read. In this case, the errno variable
indicates the error condition: indicates the error condition:
EIO: reply failed, read data is invalid and the application EIO:
reply failed, read data is invalid and the application
should discard the data read since the last successful read with 0 size. should discard the data read since the last successful read with 0 size.
EFAULT: copy_to_user failed, read data is invalid and the application should EFAULT:
discard the data read since the last successful read with 0 size. copy_to_user failed, read data is invalid and the application should
EAGAIN: occurs on a non-blocking read if there is no data available at the discard the data read since the last successful read with 0 size.
moment. There is no data missing or corrupted, just try again or rather EAGAIN:
use polling for non-blocking reads. occurs on a non-blocking read if there is no data available at the
EOVERFLOW: message limit reached, the data read since the last successful moment. There is no data missing or corrupted, just try again or rather
read with 0 size is valid but subsequent records may be missing. use polling for non-blocking reads.
EOVERFLOW:
message limit reached, the data read since the last successful
read with 0 size is valid but subsequent records may be missing.
In the last case (EOVERFLOW) there may be missing data, in the first two cases In the last case (EOVERFLOW) there may be missing data, in the first two cases
(EIO, EFAULT) there will be missing data. It's up to the application if it will (EIO, EFAULT) there will be missing data. It's up to the application if it will
...@@ -183,7 +199,7 @@ Open: ...@@ -183,7 +199,7 @@ Open:
----- -----
Only one user is allowed to open the char device. If it is already in use, the Only one user is allowed to open the char device. If it is already in use, the
open function will fail (return a negative value) and set errno to EBUSY. open function will fail (return a negative value) and set errno to EBUSY.
The open function may also fail if an IUCV connection to the *MONITOR service The open function may also fail if an IUCV connection to the `*MONITOR` service
cannot be established. In this case errno will be set to EIO and an error cannot be established. In this case errno will be set to EIO and an error
message with an IPUSER SEVER code will be printed into syslog. The IPUSER SEVER message with an IPUSER SEVER code will be printed into syslog. The IPUSER SEVER
codes are described in the "z/VM Performance" book, Appendix A. codes are described in the "z/VM Performance" book, Appendix A.
...@@ -194,4 +210,3 @@ As soon as the device is opened, incoming messages will be accepted and they ...@@ -194,4 +210,3 @@ As soon as the device is opened, incoming messages will be accepted and they
will account for the message limit, i.e. opening the device without reading will account for the message limit, i.e. opening the device without reading
from it will provoke the "message limit reached" error (EOVERFLOW error code) from it will provoke the "message limit reached" error (EOVERFLOW error code)
eventually. eventually.
=============================
IBM s390 QDIO Ethernet Driver IBM s390 QDIO Ethernet Driver
=============================
OSA and HiperSockets Bridge Port Support OSA and HiperSockets Bridge Port Support
========================================
Uevents Uevents
-------
To generate the events the device must be assigned a role of either To generate the events the device must be assigned a role of either
a primary or a secondary Bridge Port. For more information, see a primary or a secondary Bridge Port. For more information, see
...@@ -13,12 +17,15 @@ of some configured Bridge Port device on the channel changes, a udev ...@@ -13,12 +17,15 @@ of some configured Bridge Port device on the channel changes, a udev
event with ACTION=CHANGE is emitted on behalf of the corresponding event with ACTION=CHANGE is emitted on behalf of the corresponding
ccwgroup device. The event has the following attributes: ccwgroup device. The event has the following attributes:
BRIDGEPORT=statechange - indicates that the Bridge Port device changed BRIDGEPORT=statechange
indicates that the Bridge Port device changed
its state. its state.
ROLE={primary|secondary|none} - the role assigned to the port. ROLE={primary|secondary|none}
the role assigned to the port.
STATE={active|standby|inactive} - the newly assumed state of the port. STATE={active|standby|inactive}
the newly assumed state of the port.
When run on HiperSockets Bridge Capable Port hardware with host address When run on HiperSockets Bridge Capable Port hardware with host address
notifications enabled, a udev event with ACTION=CHANGE is emitted. notifications enabled, a udev event with ACTION=CHANGE is emitted.
...@@ -26,25 +33,32 @@ It is emitted on behalf of the corresponding ccwgroup device when a host ...@@ -26,25 +33,32 @@ It is emitted on behalf of the corresponding ccwgroup device when a host
or a VLAN is registered or unregistered on the network served by the device. or a VLAN is registered or unregistered on the network served by the device.
The event has the following attributes: The event has the following attributes:
BRIDGEDHOST={reset|register|deregister|abort} - host address BRIDGEDHOST={reset|register|deregister|abort}
host address
notifications are started afresh, a new host or VLAN is registered or notifications are started afresh, a new host or VLAN is registered or
deregistered on the Bridge Port HiperSockets channel, or address deregistered on the Bridge Port HiperSockets channel, or address
notifications are aborted. notifications are aborted.
VLAN=numeric-vlan-id - VLAN ID on which the event occurred. Not included VLAN=numeric-vlan-id
VLAN ID on which the event occurred. Not included
if no VLAN is involved in the event. if no VLAN is involved in the event.
MAC=xx:xx:xx:xx:xx:xx - MAC address of the host that is being registered MAC=xx:xx:xx:xx:xx:xx
MAC address of the host that is being registered
or deregistered from the HiperSockets channel. Not reported if the or deregistered from the HiperSockets channel. Not reported if the
event reports the creation or destruction of a VLAN. event reports the creation or destruction of a VLAN.
NTOK_BUSID=x.y.zzzz - device bus ID (CSSID, SSID and device number). NTOK_BUSID=x.y.zzzz
device bus ID (CSSID, SSID and device number).
NTOK_IID=xx - device IID. NTOK_IID=xx
device IID.
NTOK_CHPID=xx - device CHPID. NTOK_CHPID=xx
device CHPID.
NTOK_CHID=xxxx - device channel ID. NTOK_CHID=xxxx
device channel ID.
Note that the NTOK_* attributes refer to devices other than the one Note that the `NTOK_*` attributes refer to devices other than the one
connected to the system on which the OS is running. connected to the system on which the OS is running.
This diff is collapsed.
This diff is collapsed.
ibm 3270 changelog
------------------
.. include:: 3270.ChangeLog
:literal:
ibm 3270 config3270.sh
----------------------
.. literalinclude:: config3270.sh
:language: shell
==================================
vfio-ccw: the basic infrastructure vfio-ccw: the basic infrastructure
================================== ==================================
...@@ -11,9 +12,11 @@ virtual machine, while vfio is the means. ...@@ -11,9 +12,11 @@ virtual machine, while vfio is the means.
Different than other hardware architectures, s390 has defined a unified Different than other hardware architectures, s390 has defined a unified
I/O access method, which is so called Channel I/O. It has its own access I/O access method, which is so called Channel I/O. It has its own access
patterns: patterns:
- Channel programs run asynchronously on a separate (co)processor. - Channel programs run asynchronously on a separate (co)processor.
- The channel subsystem will access any memory designated by the caller - The channel subsystem will access any memory designated by the caller
in the channel program directly, i.e. there is no iommu involved. in the channel program directly, i.e. there is no iommu involved.
Thus when we introduce vfio support for these devices, we realize it Thus when we introduce vfio support for these devices, we realize it
with a mediated device (mdev) implementation. The vfio mdev will be with a mediated device (mdev) implementation. The vfio mdev will be
added to an iommu group, so as to make itself able to be managed by the added to an iommu group, so as to make itself able to be managed by the
...@@ -24,6 +27,7 @@ to perform I/O instructions. ...@@ -24,6 +27,7 @@ to perform I/O instructions.
This document does not intend to explain the s390 I/O architecture in This document does not intend to explain the s390 I/O architecture in
every detail. More information/reference could be found here: every detail. More information/reference could be found here:
- A good start to know Channel I/O in general: - A good start to know Channel I/O in general:
https://en.wikipedia.org/wiki/Channel_I/O https://en.wikipedia.org/wiki/Channel_I/O
- s390 architecture: - s390 architecture:
...@@ -80,6 +84,7 @@ until interrupted. The I/O completion result is received by the ...@@ -80,6 +84,7 @@ until interrupted. The I/O completion result is received by the
interrupt handler in the form of interrupt response block (IRB). interrupt handler in the form of interrupt response block (IRB).
Back to vfio-ccw, in short: Back to vfio-ccw, in short:
- ORBs and channel programs are built in guest kernel (with guest - ORBs and channel programs are built in guest kernel (with guest
physical addresses). physical addresses).
- ORBs and channel programs are passed to the host kernel. - ORBs and channel programs are passed to the host kernel.
...@@ -106,6 +111,7 @@ it gets sent to hardware. ...@@ -106,6 +111,7 @@ it gets sent to hardware.
Within this implementation, we have two drivers for two types of Within this implementation, we have two drivers for two types of
devices: devices:
- The vfio_ccw driver for the physical subchannel device. - The vfio_ccw driver for the physical subchannel device.
This is an I/O subchannel driver for the real subchannel device. It This is an I/O subchannel driver for the real subchannel device. It
realizes a group of callbacks and registers to the mdev framework as a realizes a group of callbacks and registers to the mdev framework as a
...@@ -137,7 +143,7 @@ devices: ...@@ -137,7 +143,7 @@ devices:
vfio_pin_pages and a vfio_unpin_pages interfaces from the vfio iommu vfio_pin_pages and a vfio_unpin_pages interfaces from the vfio iommu
backend for the physical devices to pin and unpin pages by demand. backend for the physical devices to pin and unpin pages by demand.
Below is a high Level block diagram. Below is a high Level block diagram::
+-------------+ +-------------+
| | | |
...@@ -158,6 +164,7 @@ Below is a high Level block diagram. ...@@ -158,6 +164,7 @@ Below is a high Level block diagram.
+-------------+ +-------------+
The process of how these work together. The process of how these work together.
1. vfio_ccw.ko drives the physical I/O subchannel, and registers the 1. vfio_ccw.ko drives the physical I/O subchannel, and registers the
physical device (with callbacks) to mdev framework. physical device (with callbacks) to mdev framework.
When vfio_ccw probing the subchannel device, it registers device When vfio_ccw probing the subchannel device, it registers device
...@@ -178,17 +185,17 @@ vfio-ccw I/O region ...@@ -178,17 +185,17 @@ vfio-ccw I/O region
An I/O region is used to accept channel program request from user An I/O region is used to accept channel program request from user
space and store I/O interrupt result for user space to retrieve. The space and store I/O interrupt result for user space to retrieve. The
definition of the region is: definition of the region is::
struct ccw_io_region { struct ccw_io_region {
#define ORB_AREA_SIZE 12 #define ORB_AREA_SIZE 12
__u8 orb_area[ORB_AREA_SIZE]; __u8 orb_area[ORB_AREA_SIZE];
#define SCSW_AREA_SIZE 12 #define SCSW_AREA_SIZE 12
__u8 scsw_area[SCSW_AREA_SIZE]; __u8 scsw_area[SCSW_AREA_SIZE];
#define IRB_AREA_SIZE 96 #define IRB_AREA_SIZE 96
__u8 irb_area[IRB_AREA_SIZE]; __u8 irb_area[IRB_AREA_SIZE];
__u32 ret_code; __u32 ret_code;
} __packed; } __packed;
While starting an I/O request, orb_area should be filled with the While starting an I/O request, orb_area should be filled with the
guest ORB, and scsw_area should be filled with the SCSW of the Virtual guest ORB, and scsw_area should be filled with the SCSW of the Virtual
...@@ -205,7 +212,7 @@ vfio-ccw follows what vfio-pci did on the s390 platform and uses ...@@ -205,7 +212,7 @@ vfio-ccw follows what vfio-pci did on the s390 platform and uses
vfio-iommu-type1 as the vfio iommu backend. vfio-iommu-type1 as the vfio iommu backend.
* CCW translation APIs * CCW translation APIs
A group of APIs (start with 'cp_') to do CCW translation. The CCWs A group of APIs (start with `cp_`) to do CCW translation. The CCWs
passed in by a user space program are organized with their guest passed in by a user space program are organized with their guest
physical memory addresses. These APIs will copy the CCWs into kernel physical memory addresses. These APIs will copy the CCWs into kernel
space, and assemble a runnable kernel channel program by updating the space, and assemble a runnable kernel channel program by updating the
...@@ -217,12 +224,14 @@ vfio-iommu-type1 as the vfio iommu backend. ...@@ -217,12 +224,14 @@ vfio-iommu-type1 as the vfio iommu backend.
This driver utilizes the CCW translation APIs and introduces This driver utilizes the CCW translation APIs and introduces
vfio_ccw, which is the driver for the I/O subchannel devices you want vfio_ccw, which is the driver for the I/O subchannel devices you want
to pass through. to pass through.
vfio_ccw implements the following vfio ioctls: vfio_ccw implements the following vfio ioctls::
VFIO_DEVICE_GET_INFO VFIO_DEVICE_GET_INFO
VFIO_DEVICE_GET_IRQ_INFO VFIO_DEVICE_GET_IRQ_INFO
VFIO_DEVICE_GET_REGION_INFO VFIO_DEVICE_GET_REGION_INFO
VFIO_DEVICE_RESET VFIO_DEVICE_RESET
VFIO_DEVICE_SET_IRQS VFIO_DEVICE_SET_IRQS
This provides an I/O region, so that the user space program can pass a This provides an I/O region, so that the user space program can pass a
channel program to the kernel, to do further CCW translation before channel program to the kernel, to do further CCW translation before
issuing them to a real device. issuing them to a real device.
...@@ -236,32 +245,49 @@ bit more detail how an I/O request triggered by the QEMU guest will be ...@@ -236,32 +245,49 @@ bit more detail how an I/O request triggered by the QEMU guest will be
handled (without error handling). handled (without error handling).
Explanation: Explanation:
Q1-Q7: QEMU side process.
K1-K5: Kernel side process.
Q1. Get I/O region info during initialization. - Q1-Q7: QEMU side process.
Q2. Setup event notifier and handler to handle I/O completion. - K1-K5: Kernel side process.
Q1.
Get I/O region info during initialization.
Q2.
Setup event notifier and handler to handle I/O completion.
... ... ... ...
Q3. Intercept a ssch instruction. Q3.
Q4. Write the guest channel program and ORB to the I/O region. Intercept a ssch instruction.
K1. Copy from guest to kernel. Q4.
K2. Translate the guest channel program to a host kernel space Write the guest channel program and ORB to the I/O region.
channel program, which becomes runnable for a real device.
K3. With the necessary information contained in the orb passed in K1.
by QEMU, issue the ccwchain to the device. Copy from guest to kernel.
K4. Return the ssch CC code. K2.
Q5. Return the CC code to the guest. Translate the guest channel program to a host kernel space
channel program, which becomes runnable for a real device.
K3.
With the necessary information contained in the orb passed in
by QEMU, issue the ccwchain to the device.
K4.
Return the ssch CC code.
Q5.
Return the CC code to the guest.
... ... ... ...
K5. Interrupt handler gets the I/O result and write the result to K5.
the I/O region. Interrupt handler gets the I/O result and write the result to
K6. Signal QEMU to retrieve the result. the I/O region.
Q6. Get the signal and event handler reads out the result from the I/O K6.
Signal QEMU to retrieve the result.
Q6.
Get the signal and event handler reads out the result from the I/O
region. region.
Q7. Update the irb for the guest. Q7.
Update the irb for the guest.
Limitations Limitations
----------- -----------
...@@ -295,6 +321,6 @@ Reference ...@@ -295,6 +321,6 @@ Reference
1. ESA/s390 Principles of Operation manual (IBM Form. No. SA22-7832) 1. ESA/s390 Principles of Operation manual (IBM Form. No. SA22-7832)
2. ESA/390 Common I/O Device Commands manual (IBM Form. No. SA22-7204) 2. ESA/390 Common I/O Device Commands manual (IBM Form. No. SA22-7204)
3. https://en.wikipedia.org/wiki/Channel_I/O 3. https://en.wikipedia.org/wiki/Channel_I/O
4. Documentation/s390/cds.txt 4. Documentation/s390/cds.rst
5. Documentation/vfio.txt 5. Documentation/vfio.txt
6. Documentation/vfio-mediated-device.txt 6. Documentation/vfio-mediated-device.txt
==================================
The s390 SCSI dump tool (zfcpdump) The s390 SCSI dump tool (zfcpdump)
==================================
System z machines (z900 or higher) provide hardware support for creating system System z machines (z900 or higher) provide hardware support for creating system
dumps on SCSI disks. The dump process is initiated by booting a dump tool, which dumps on SCSI disks. The dump process is initiated by booting a dump tool, which
......
...@@ -23,7 +23,6 @@ show up in /proc/sys/kernel: ...@@ -23,7 +23,6 @@ show up in /proc/sys/kernel:
- auto_msgmni - auto_msgmni
- bootloader_type [ X86 only ] - bootloader_type [ X86 only ]
- bootloader_version [ X86 only ] - bootloader_version [ X86 only ]
- callhome [ S390 only ]
- cap_last_cap - cap_last_cap
- core_pattern - core_pattern
- core_pipe_limit - core_pipe_limit
...@@ -171,21 +170,6 @@ Documentation/x86/boot.txt for additional information. ...@@ -171,21 +170,6 @@ Documentation/x86/boot.txt for additional information.
============================================================== ==============================================================
callhome:
Controls the kernel's callhome behavior in case of a kernel panic.
The s390 hardware allows an operating system to send a notification
to a service organization (callhome) in case of an operating system panic.
When the value in this file is 0 (which is the default behavior)
nothing happens in case of a kernel panic. If this value is set to "1"
the complete kernel oops message is send to the IBM customer service
organization in case the mainframe the Linux operating system is running
on has a service contract with IBM.
==============================================================
cap_last_cap cap_last_cap
Highest valid capability of the running kernel. Exports Highest valid capability of the running kernel. Exports
......
...@@ -13718,7 +13718,7 @@ L: linux-s390@vger.kernel.org ...@@ -13718,7 +13718,7 @@ L: linux-s390@vger.kernel.org
L: kvm@vger.kernel.org L: kvm@vger.kernel.org
S: Supported S: Supported
F: drivers/s390/cio/vfio_ccw* F: drivers/s390/cio/vfio_ccw*
F: Documentation/s390/vfio-ccw.txt F: Documentation/s390/vfio-ccw.rst
F: include/uapi/linux/vfio_ccw.h F: include/uapi/linux/vfio_ccw.h
S390 ZCRYPT DRIVER S390 ZCRYPT DRIVER
...@@ -13738,7 +13738,7 @@ S: Supported ...@@ -13738,7 +13738,7 @@ S: Supported
F: drivers/s390/crypto/vfio_ap_drv.c F: drivers/s390/crypto/vfio_ap_drv.c
F: drivers/s390/crypto/vfio_ap_private.h F: drivers/s390/crypto/vfio_ap_private.h
F: drivers/s390/crypto/vfio_ap_ops.c F: drivers/s390/crypto/vfio_ap_ops.c
F: Documentation/s390/vfio-ap.txt F: Documentation/s390/vfio-ap.rst
S390 ZFCP DRIVER S390 ZFCP DRIVER
M: Steffen Maier <maier@linux.ibm.com> M: Steffen Maier <maier@linux.ibm.com>
......
...@@ -346,8 +346,6 @@ static inline unsigned long __pack_fe01(unsigned int fpmode) ...@@ -346,8 +346,6 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
#define spin_cpu_relax() barrier() #define spin_cpu_relax() barrier()
#define spin_cpu_yield() spin_cpu_relax()
#define spin_end() HMT_medium() #define spin_end() HMT_medium()
#define spin_until_cond(cond) \ #define spin_until_cond(cond) \
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
config ARCH_HAS_MEM_ENCRYPT
def_bool y
config MMU config MMU
def_bool y def_bool y
...@@ -30,7 +33,7 @@ config GENERIC_BUG_RELATIVE_POINTERS ...@@ -30,7 +33,7 @@ config GENERIC_BUG_RELATIVE_POINTERS
def_bool y def_bool y
config GENERIC_LOCKBREAK config GENERIC_LOCKBREAK
def_bool y if SMP && PREEMPT def_bool y if PREEMPT
config PGSTE config PGSTE
def_bool y if KVM def_bool y if KVM
...@@ -113,7 +116,6 @@ config S390 ...@@ -113,7 +116,6 @@ config S390
select DYNAMIC_FTRACE if FUNCTION_TRACER select DYNAMIC_FTRACE if FUNCTION_TRACER
select GENERIC_CLOCKEVENTS select GENERIC_CLOCKEVENTS
select GENERIC_CPU_AUTOPROBE select GENERIC_CPU_AUTOPROBE
select GENERIC_CPU_DEVICES if !SMP
select GENERIC_CPU_VULNERABILITIES select GENERIC_CPU_VULNERABILITIES
select GENERIC_FIND_FIRST_BIT select GENERIC_FIND_FIRST_BIT
select GENERIC_SMP_IDLE_THREAD select GENERIC_SMP_IDLE_THREAD
...@@ -187,6 +189,8 @@ config S390 ...@@ -187,6 +189,8 @@ config S390
select VIRT_CPU_ACCOUNTING select VIRT_CPU_ACCOUNTING
select ARCH_HAS_SCALED_CPUTIME select ARCH_HAS_SCALED_CPUTIME
select HAVE_NMI select HAVE_NMI
select SWIOTLB
select GENERIC_ALLOCATOR
config SCHED_OMIT_FRAME_POINTER config SCHED_OMIT_FRAME_POINTER
...@@ -399,27 +403,10 @@ config SYSVIPC_COMPAT ...@@ -399,27 +403,10 @@ config SYSVIPC_COMPAT
config SMP config SMP
def_bool y def_bool y
prompt "Symmetric multi-processing support"
---help---
This enables support for systems with more than one CPU. If you have
a system with only one CPU, like most personal computers, say N. If
you have a system with more than one CPU, say Y.
If you say N here, the kernel will run on uni- and multiprocessor
machines, but will use only one CPU of a multiprocessor machine. If
you say Y here, the kernel will run on many, but not all,
uniprocessor machines. On a uniprocessor machine, the kernel
will run faster if you say N here.
See also the SMP-HOWTO available at
<http://www.tldp.org/docs.html#howto>.
Even if you don't know what to do here, say Y.
config NR_CPUS config NR_CPUS
int "Maximum number of CPUs (2-512)" int "Maximum number of CPUs (2-512)"
range 2 512 range 2 512
depends on SMP
default "64" default "64"
help help
This allows you to specify the maximum number of CPUs which this This allows you to specify the maximum number of CPUs which this
...@@ -431,12 +418,6 @@ config NR_CPUS ...@@ -431,12 +418,6 @@ config NR_CPUS
config HOTPLUG_CPU config HOTPLUG_CPU
def_bool y def_bool y
prompt "Support for hot-pluggable CPUs"
depends on SMP
help
Say Y here to be able to turn CPUs off and on. CPUs
can be controlled through /sys/devices/system/cpu/cpu#.
Say N if you want to disable CPU hotplug.
# Some NUMA nodes have memory ranges that span # Some NUMA nodes have memory ranges that span
# other nodes. Even though a pfn is valid and # other nodes. Even though a pfn is valid and
...@@ -448,7 +429,7 @@ config NODES_SPAN_OTHER_NODES ...@@ -448,7 +429,7 @@ config NODES_SPAN_OTHER_NODES
config NUMA config NUMA
bool "NUMA support" bool "NUMA support"
depends on SMP && SCHED_TOPOLOGY depends on SCHED_TOPOLOGY
default n default n
help help
Enable NUMA support Enable NUMA support
...@@ -523,7 +504,6 @@ config SCHED_DRAWER ...@@ -523,7 +504,6 @@ config SCHED_DRAWER
config SCHED_TOPOLOGY config SCHED_TOPOLOGY
def_bool y def_bool y
prompt "Topology scheduler support" prompt "Topology scheduler support"
depends on SMP
select SCHED_SMT select SCHED_SMT
select SCHED_MC select SCHED_MC
select SCHED_BOOK select SCHED_BOOK
...@@ -763,7 +743,7 @@ config PCI_NR_FUNCTIONS ...@@ -763,7 +743,7 @@ config PCI_NR_FUNCTIONS
This allows you to specify the maximum number of PCI functions which This allows you to specify the maximum number of PCI functions which
this kernel will support. this kernel will support.
endif # PCI endif # PCI
config HAS_IOMEM config HAS_IOMEM
def_bool PCI def_bool PCI
...@@ -829,16 +809,15 @@ menu "Dump support" ...@@ -829,16 +809,15 @@ menu "Dump support"
config CRASH_DUMP config CRASH_DUMP
bool "kernel crash dumps" bool "kernel crash dumps"
depends on SMP
select KEXEC select KEXEC
help help
Generate crash dump after being started by kexec. Generate crash dump after being started by kexec.
Crash dump kernels are loaded in the main kernel with kexec-tools Crash dump kernels are loaded in the main kernel with kexec-tools
into a specially reserved region and then later executed after into a specially reserved region and then later executed after
a crash by kdump/kexec. a crash by kdump/kexec.
Refer to <file:Documentation/s390/zfcpdump.txt> for more details on this. Refer to <file:Documentation/s390/zfcpdump.rst> for more details on this.
This option also enables s390 zfcpdump. This option also enables s390 zfcpdump.
See also <file:Documentation/s390/zfcpdump.txt> See also <file:Documentation/s390/zfcpdump.rst>
endmenu endmenu
......
...@@ -88,6 +88,7 @@ CONFIG_HOTPLUG_PCI=y ...@@ -88,6 +88,7 @@ CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_S390=y CONFIG_HOTPLUG_PCI_S390=y
CONFIG_CHSC_SCH=y CONFIG_CHSC_SCH=y
CONFIG_VFIO_AP=m CONFIG_VFIO_AP=m
CONFIG_VFIO_CCW=m
CONFIG_CRASH_DUMP=y CONFIG_CRASH_DUMP=y
CONFIG_BINFMT_MISC=m CONFIG_BINFMT_MISC=m
CONFIG_HIBERNATION=y CONFIG_HIBERNATION=y
...@@ -498,6 +499,7 @@ CONFIG_VIRTIO_PCI=m ...@@ -498,6 +499,7 @@ CONFIG_VIRTIO_PCI=m
CONFIG_VIRTIO_BALLOON=m CONFIG_VIRTIO_BALLOON=m
CONFIG_VIRTIO_INPUT=y CONFIG_VIRTIO_INPUT=y
CONFIG_S390_AP_IOMMU=y CONFIG_S390_AP_IOMMU=y
CONFIG_S390_CCW_IOMMU=y
CONFIG_EXT4_FS=y CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y CONFIG_EXT4_FS_SECURITY=y
......
This diff is collapsed.
This diff is collapsed.
...@@ -24,7 +24,6 @@ CONFIG_CRASH_DUMP=y ...@@ -24,7 +24,6 @@ CONFIG_CRASH_DUMP=y
# CONFIG_SECCOMP is not set # CONFIG_SECCOMP is not set
CONFIG_NET=y CONFIG_NET=y
# CONFIG_IUCV is not set # CONFIG_IUCV is not set
CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS=y
CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM=y
# CONFIG_BLK_DEV_XPRAM is not set # CONFIG_BLK_DEV_XPRAM is not set
......
...@@ -137,7 +137,7 @@ static struct shash_alg ghash_alg = { ...@@ -137,7 +137,7 @@ static struct shash_alg ghash_alg = {
static int __init ghash_mod_init(void) static int __init ghash_mod_init(void)
{ {
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_GHASH)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_GHASH))
return -EOPNOTSUPP; return -ENODEV;
return crypto_register_shash(&ghash_alg); return crypto_register_shash(&ghash_alg);
} }
......
...@@ -824,7 +824,7 @@ static int __init prng_init(void) ...@@ -824,7 +824,7 @@ static int __init prng_init(void)
/* check if the CPU has a PRNG */ /* check if the CPU has a PRNG */
if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG)) if (!cpacf_query_func(CPACF_KMC, CPACF_KMC_PRNG))
return -EOPNOTSUPP; return -ENODEV;
/* check if TRNG subfunction is available */ /* check if TRNG subfunction is available */
if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG)) if (cpacf_query_func(CPACF_PRNO, CPACF_PRNO_TRNG))
...@@ -837,7 +837,7 @@ static int __init prng_init(void) ...@@ -837,7 +837,7 @@ static int __init prng_init(void)
if (prng_mode == PRNG_MODE_SHA512) { if (prng_mode == PRNG_MODE_SHA512) {
pr_err("The prng module cannot " pr_err("The prng module cannot "
"start in SHA-512 mode\n"); "start in SHA-512 mode\n");
return -EOPNOTSUPP; return -ENODEV;
} }
prng_mode = PRNG_MODE_TDES; prng_mode = PRNG_MODE_TDES;
} else } else
......
...@@ -86,7 +86,7 @@ static struct shash_alg alg = { ...@@ -86,7 +86,7 @@ static struct shash_alg alg = {
static int __init sha1_s390_init(void) static int __init sha1_s390_init(void)
{ {
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_1)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_1))
return -EOPNOTSUPP; return -ENODEV;
return crypto_register_shash(&alg); return crypto_register_shash(&alg);
} }
......
...@@ -117,7 +117,7 @@ static int __init sha256_s390_init(void) ...@@ -117,7 +117,7 @@ static int __init sha256_s390_init(void)
int ret; int ret;
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_256)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_256))
return -EOPNOTSUPP; return -ENODEV;
ret = crypto_register_shash(&sha256_alg); ret = crypto_register_shash(&sha256_alg);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
...@@ -127,7 +127,7 @@ static int __init init(void) ...@@ -127,7 +127,7 @@ static int __init init(void)
int ret; int ret;
if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512)) if (!cpacf_query_func(CPACF_KIMD, CPACF_KIMD_SHA_512))
return -EOPNOTSUPP; return -ENODEV;
if ((ret = crypto_register_shash(&sha512_alg)) < 0) if ((ret = crypto_register_shash(&sha512_alg)) < 0)
goto out; goto out;
if ((ret = crypto_register_shash(&sha384_alg)) < 0) if ((ret = crypto_register_shash(&sha384_alg)) < 0)
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#define _ASM_S390_AIRQ_H #define _ASM_S390_AIRQ_H
#include <linux/bit_spinlock.h> #include <linux/bit_spinlock.h>
#include <linux/dma-mapping.h>
struct airq_struct { struct airq_struct {
struct hlist_node list; /* Handler queueing. */ struct hlist_node list; /* Handler queueing. */
...@@ -29,6 +30,7 @@ void unregister_adapter_interrupt(struct airq_struct *airq); ...@@ -29,6 +30,7 @@ void unregister_adapter_interrupt(struct airq_struct *airq);
/* Adapter interrupt bit vector */ /* Adapter interrupt bit vector */
struct airq_iv { struct airq_iv {
unsigned long *vector; /* Adapter interrupt bit vector */ unsigned long *vector; /* Adapter interrupt bit vector */
dma_addr_t vector_dma; /* Adapter interrupt bit vector dma */
unsigned long *avail; /* Allocation bit mask for the bit vector */ unsigned long *avail; /* Allocation bit mask for the bit vector */
unsigned long *bitlock; /* Lock bit mask for the bit vector */ unsigned long *bitlock; /* Lock bit mask for the bit vector */
unsigned long *ptr; /* Pointer associated with each bit */ unsigned long *ptr; /* Pointer associated with each bit */
......
...@@ -226,6 +226,10 @@ extern int ccw_device_enable_console(struct ccw_device *); ...@@ -226,6 +226,10 @@ extern int ccw_device_enable_console(struct ccw_device *);
extern void ccw_device_wait_idle(struct ccw_device *); extern void ccw_device_wait_idle(struct ccw_device *);
extern int ccw_device_force_console(struct ccw_device *); extern int ccw_device_force_console(struct ccw_device *);
extern void *ccw_device_dma_zalloc(struct ccw_device *cdev, size_t size);
extern void ccw_device_dma_free(struct ccw_device *cdev,
void *cpu_addr, size_t size);
int ccw_device_siosl(struct ccw_device *); int ccw_device_siosl(struct ccw_device *);
extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *); extern void ccw_device_get_schid(struct ccw_device *, struct subchannel_id *);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/genalloc.h>
#include <asm/types.h> #include <asm/types.h>
#define LPM_ANYPATH 0xff #define LPM_ANYPATH 0xff
...@@ -263,6 +264,36 @@ struct ciw { ...@@ -263,6 +264,36 @@ struct ciw {
#define CIW_TYPE_SII 0x1 /* set interface identifier */ #define CIW_TYPE_SII 0x1 /* set interface identifier */
#define CIW_TYPE_RNI 0x2 /* read node identifier */ #define CIW_TYPE_RNI 0x2 /* read node identifier */
/*
* Node Descriptor as defined in SA22-7204, "Common I/O-Device Commands"
*/
#define ND_VALIDITY_VALID 0
#define ND_VALIDITY_OUTDATED 1
#define ND_VALIDITY_INVALID 2
struct node_descriptor {
/* Flags. */
union {
struct {
u32 validity:3;
u32 reserved:5;
} __packed;
u8 byte0;
} __packed;
/* Node parameters. */
u32 params:24;
/* Node ID. */
char type[6];
char model[3];
char manufacturer[3];
char plant[2];
char seq[12];
u16 tag;
} __packed;
/* /*
* Flags used as input parameters for do_IO() * Flags used as input parameters for do_IO()
*/ */
...@@ -328,6 +359,16 @@ static inline u8 pathmask_to_pos(u8 mask) ...@@ -328,6 +359,16 @@ static inline u8 pathmask_to_pos(u8 mask)
void channel_subsystem_reinit(void); void channel_subsystem_reinit(void);
extern void css_schedule_reprobe(void); extern void css_schedule_reprobe(void);
extern void *cio_dma_zalloc(size_t size);
extern void cio_dma_free(void *cpu_addr, size_t size);
extern struct device *cio_get_dma_css_dev(void);
void *cio_gp_dma_zalloc(struct gen_pool *gp_dma, struct device *dma_dev,
size_t size);
void cio_gp_dma_free(struct gen_pool *gp_dma, void *cpu_addr, size_t size);
void cio_gp_dma_destroy(struct gen_pool *gp_dma, struct device *dma_dev);
struct gen_pool *cio_gp_dma_create(struct device *dma_dev, int nr_pages);
/* Function from drivers/s390/cio/chsc.c */ /* Function from drivers/s390/cio/chsc.c */
int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta); int chsc_sstpc(void *page, unsigned int op, u16 ctrl, u64 *clock_delta);
int chsc_sstpi(void *page, void *result, size_t size); int chsc_sstpi(void *page, void *result, size_t size);
......
...@@ -112,13 +112,8 @@ union ctlreg2 { ...@@ -112,13 +112,8 @@ union ctlreg2 {
}; };
}; };
#ifdef CONFIG_SMP #define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit)
# define ctl_set_bit(cr, bit) smp_ctl_set_bit(cr, bit) #define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
# define ctl_clear_bit(cr, bit) smp_ctl_clear_bit(cr, bit)
#else
# define ctl_set_bit(cr, bit) __ctl_set_bit(cr, bit)
# define ctl_clear_bit(cr, bit) __ctl_clear_bit(cr, bit)
#endif
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __ASM_CTL_REG_H */ #endif /* __ASM_CTL_REG_H */
This diff is collapsed.
...@@ -59,6 +59,18 @@ static inline int test_facility(unsigned long nr) ...@@ -59,6 +59,18 @@ static inline int test_facility(unsigned long nr)
return __test_facility(nr, &S390_lowcore.stfle_fac_list); return __test_facility(nr, &S390_lowcore.stfle_fac_list);
} }
static inline unsigned long __stfle_asm(u64 *stfle_fac_list, int size)
{
register unsigned long reg0 asm("0") = size - 1;
asm volatile(
".insn s,0xb2b00000,0(%1)" /* stfle */
: "+d" (reg0)
: "a" (stfle_fac_list)
: "memory", "cc");
return reg0;
}
/** /**
* stfle - Store facility list extended * stfle - Store facility list extended
* @stfle_fac_list: array where facility list can be stored * @stfle_fac_list: array where facility list can be stored
...@@ -75,13 +87,8 @@ static inline void __stfle(u64 *stfle_fac_list, int size) ...@@ -75,13 +87,8 @@ static inline void __stfle(u64 *stfle_fac_list, int size)
memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4); memcpy(stfle_fac_list, &S390_lowcore.stfl_fac_list, 4);
if (S390_lowcore.stfl_fac_list & 0x01000000) { if (S390_lowcore.stfl_fac_list & 0x01000000) {
/* More facility bits available with stfle */ /* More facility bits available with stfle */
register unsigned long reg0 asm("0") = size - 1; nr = __stfle_asm(stfle_fac_list, size);
nr = min_t(unsigned long, (nr + 1) * 8, size * 8);
asm volatile(".insn s,0xb2b00000,0(%1)" /* stfle */
: "+d" (reg0)
: "a" (stfle_fac_list)
: "memory", "cc");
nr = (reg0 + 1) * 8; /* # bytes stored by stfle */
} }
memset((char *) stfle_fac_list + nr, 0, size * 8 - nr); memset((char *) stfle_fac_list + nr, 0, size * 8 - nr);
} }
......
...@@ -122,8 +122,7 @@ idal_buffer_alloc(size_t size, int page_order) ...@@ -122,8 +122,7 @@ idal_buffer_alloc(size_t size, int page_order)
nr_ptrs = (size + IDA_BLOCK_SIZE - 1) >> IDA_SIZE_LOG; nr_ptrs = (size + IDA_BLOCK_SIZE - 1) >> IDA_SIZE_LOG;
nr_chunks = (4096 << page_order) >> IDA_SIZE_LOG; nr_chunks = (4096 << page_order) >> IDA_SIZE_LOG;
ib = kmalloc(sizeof(struct idal_buffer) + nr_ptrs*sizeof(void *), ib = kmalloc(struct_size(ib, data, nr_ptrs), GFP_DMA | GFP_KERNEL);
GFP_DMA | GFP_KERNEL);
if (ib == NULL) if (ib == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
ib->size = size; ib->size = size;
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/kvm_host.h> #include <linux/kvm_host.h>
#include <linux/kvm.h> #include <linux/kvm.h>
#include <linux/seqlock.h> #include <linux/seqlock.h>
#include <linux/module.h>
#include <asm/debug.h> #include <asm/debug.h>
#include <asm/cpu.h> #include <asm/cpu.h>
#include <asm/fpu/api.h> #include <asm/fpu/api.h>
...@@ -720,8 +721,14 @@ struct kvm_s390_cpu_model { ...@@ -720,8 +721,14 @@ struct kvm_s390_cpu_model {
unsigned short ibc; unsigned short ibc;
}; };
struct kvm_s390_module_hook {
int (*hook)(struct kvm_vcpu *vcpu);
struct module *owner;
};
struct kvm_s390_crypto { struct kvm_s390_crypto {
struct kvm_s390_crypto_cb *crycb; struct kvm_s390_crypto_cb *crycb;
struct kvm_s390_module_hook *pqap_hook;
__u32 crycbd; __u32 crycbd;
__u8 aes_kw; __u8 aes_kw;
__u8 dea_kw; __u8 dea_kw;
......
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef S390_MEM_ENCRYPT_H__
#define S390_MEM_ENCRYPT_H__
#ifndef __ASSEMBLY__
#define sme_me_mask 0ULL
static inline bool sme_active(void) { return false; }
extern bool sev_active(void);
int set_memory_encrypted(unsigned long addr, int numpages);
int set_memory_decrypted(unsigned long addr, int numpages);
#endif /* __ASSEMBLY__ */
#endif /* S390_MEM_ENCRYPT_H__ */
...@@ -194,6 +194,11 @@ int zpci_init_iommu(struct zpci_dev *zdev); ...@@ -194,6 +194,11 @@ int zpci_init_iommu(struct zpci_dev *zdev);
void zpci_destroy_iommu(struct zpci_dev *zdev); void zpci_destroy_iommu(struct zpci_dev *zdev);
#ifdef CONFIG_PCI #ifdef CONFIG_PCI
static inline bool zpci_use_mio(struct zpci_dev *zdev)
{
return static_branch_likely(&have_mio) && zdev->mio_capable;
}
/* Error handling and recovery */ /* Error handling and recovery */
void zpci_event_error(void *); void zpci_event_error(void *);
void zpci_event_availability(void *); void zpci_event_availability(void *);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* per cpu area, use weak definitions to force the compiler to * per cpu area, use weak definitions to force the compiler to
* generate external references. * generate external references.
*/ */
#if defined(CONFIG_SMP) && defined(MODULE) #if defined(MODULE)
#define ARCH_NEEDS_WEAK_PER_CPU #define ARCH_NEEDS_WEAK_PER_CPU
#endif #endif
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
#include <linux/cpumask.h>
#include <linux/linkage.h> #include <linux/linkage.h>
#include <linux/irqflags.h> #include <linux/irqflags.h>
#include <asm/cpu.h> #include <asm/cpu.h>
...@@ -221,12 +222,6 @@ static __no_kasan_or_inline unsigned short stap(void) ...@@ -221,12 +222,6 @@ static __no_kasan_or_inline unsigned short stap(void)
return cpu_address; return cpu_address;
} }
/*
* Give up the time slice of the virtual PU.
*/
#define cpu_relax_yield cpu_relax_yield
void cpu_relax_yield(void);
#define cpu_relax() barrier() #define cpu_relax() barrier()
#define ECAG_CACHE_ATTRIBUTE 0 #define ECAG_CACHE_ATTRIBUTE 0
......
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
#define __ASM_SMP_H #define __ASM_SMP_H
#include <asm/sigp.h> #include <asm/sigp.h>
#ifdef CONFIG_SMP
#include <asm/lowcore.h> #include <asm/lowcore.h>
#define raw_smp_processor_id() (S390_lowcore.cpu_nr) #define raw_smp_processor_id() (S390_lowcore.cpu_nr)
...@@ -40,33 +37,6 @@ extern int smp_cpu_get_polarization(int cpu); ...@@ -40,33 +37,6 @@ extern int smp_cpu_get_polarization(int cpu);
extern void smp_fill_possible_mask(void); extern void smp_fill_possible_mask(void);
extern void smp_detect_cpus(void); extern void smp_detect_cpus(void);
#else /* CONFIG_SMP */
#define smp_cpu_mtid 0
static inline void smp_call_ipl_cpu(void (*func)(void *), void *data)
{
func(data);
}
static inline void smp_call_online_cpu(void (*func)(void *), void *data)
{
func(data);
}
static inline void smp_emergency_stop(void)
{
}
static inline int smp_find_processor_id(u16 address) { return 0; }
static inline int smp_store_status(int cpu) { return 0; }
static inline int smp_vcpu_scheduled(int cpu) { return 1; }
static inline void smp_yield_cpu(int cpu) { }
static inline void smp_fill_possible_mask(void) { }
static inline void smp_detect_cpus(void) { }
#endif /* CONFIG_SMP */
static inline void smp_stop_cpu(void) static inline void smp_stop_cpu(void)
{ {
u16 pcpu = stap(); u16 pcpu = stap();
...@@ -83,14 +53,9 @@ static inline int smp_get_base_cpu(int cpu) ...@@ -83,14 +53,9 @@ static inline int smp_get_base_cpu(int cpu)
return cpu - (cpu % (smp_cpu_mtid + 1)); return cpu - (cpu % (smp_cpu_mtid + 1));
} }
#ifdef CONFIG_HOTPLUG_CPU
extern int smp_rescan_cpus(void); extern int smp_rescan_cpus(void);
extern void __noreturn cpu_die(void); extern void __noreturn cpu_die(void);
extern void __cpu_die(unsigned int cpu); extern void __cpu_die(unsigned int cpu);
extern int __cpu_disable(void); extern int __cpu_disable(void);
#else
static inline int smp_rescan_cpus(void) { return 0; }
static inline void cpu_die(void) { }
#endif
#endif /* __ASM_SMP_H */ #endif /* __ASM_SMP_H */
...@@ -20,11 +20,7 @@ ...@@ -20,11 +20,7 @@
extern int spin_retry; extern int spin_retry;
#ifndef CONFIG_SMP
static inline bool arch_vcpu_is_preempted(int cpu) { return false; }
#else
bool arch_vcpu_is_preempted(int cpu); bool arch_vcpu_is_preempted(int cpu);
#endif
#define vcpu_is_preempted arch_vcpu_is_preempted #define vcpu_is_preempted arch_vcpu_is_preempted
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment