OrangePi_CM5/Documentation
Nico Boehr 2bf8b1c111 KVM: s390: pv: don't allow userspace to set the clock under PV
[ Upstream commit 6973091d1b50ab4042f6a2d495f59e9db3662ab8 ]

When running under PV, the guest's TOD clock is under control of the
ultravisor and the hypervisor isn't allowed to change it. Hence, don't
allow userspace to change the guest's TOD clock by returning
-EOPNOTSUPP.

When userspace changes the guest's TOD clock, KVM updates its
kvm.arch.epoch field and, in addition, the epoch field in all state
descriptions of all VCPUs.

But, under PV, the ultravisor will ignore the epoch field in the state
description and simply overwrite it on next SIE exit with the actual
guest epoch. This leads to KVM having an incorrect view of the guest's
TOD clock: it has updated its internal kvm.arch.epoch field, but the
ultravisor ignores the field in the state description.

Whenever a guest is now waiting for a clock comparator, KVM will
incorrectly calculate the time when the guest should wake up, possibly
causing the guest to sleep for much longer than expected.

With this change, kvm_s390_set_tod() will now take the kvm->lock to be
able to call kvm_s390_pv_is_protected(). Since kvm_s390_set_tod_clock()
also takes kvm->lock, use __kvm_s390_set_tod_clock() instead.

The function kvm_s390_set_tod_clock is now unused, hence remove it.
Update the documentation to indicate the TOD clock attr calls can now
return -EOPNOTSUPP.

Fixes: 0f30350471 ("KVM: s390: protvirt: Do only reset registers that are accessible")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Nico Boehr <nrb@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Link: https://lore.kernel.org/r/20221011160712.928239-2-nrb@linux.ibm.com
Message-Id: <20221011160712.928239-2-nrb@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-11-16 09:57:10 +01:00
..
ABI iio: ABI: Fix wrong format of differential capacitance channel ABI. 2022-10-26 13:25:30 +02:00
PCI
…
RCU
…
accounting psi: Fix uaf issue when psi trigger is destroyed while being polled 2022-02-05 12:37:55 +01:00
admin-guide x86/bugs: Add "unknown" reporting for MMIO Stale Data 2022-08-31 17:15:22 +02:00
arm ARM: 9012/1: move device tree mapping out of linear region 2021-05-19 10:13:18 +02:00
arm64 arm64: errata: Remove AES hwcap for COMPAT tasks 2022-10-30 09:41:16 +01:00
block
…
bpf
…
cdrom
…
core-api Revert "swiotlb: fix info leak with DMA_FROM_DEVICE" 2022-05-25 09:17:55 +02:00
cpu-freq
…
crypto
…
dev-tools
…
devicetree ARM: dts: fix Moxa SDIO 'compatible', remove 'sdhci' misnomer 2022-10-15 07:55:52 +02:00
doc-guide
…
driver-api vfio: Split creation of a vfio_device into init and register ops 2022-08-21 15:16:07 +02:00
fault-injection lkdtm: replace SCSI_DISPATCH_CMD with SCSI_QUEUE_RQ 2021-09-15 09:50:42 +02:00
fb
…
features
…
filesystems ext4, doc: fix incorrect h_reserved size 2022-04-27 13:53:57 +02:00
firmware-guide Documentation: ACPI: EINJ: Fix obsolete example 2022-08-25 11:37:53 +02:00
firmware_class
…
fpga
…
gpu Revert "fbcon: Disable accelerated scrolling" 2022-02-08 18:30:40 +01:00
hid
…
hwmon hwmon: (lm90) Add basic support for TI TMP461 2021-12-29 12:25:59 +01:00
i2c
…
ia64
…
ide
…
iio
…
infiniband
…
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-09-20 12:38:32 +02:00
isdn
…
kbuild Documentation/Kbuild: Remove references to gcc-plugin.sh 2021-12-14 11:32:46 +01:00
kernel-hacking
…
leds
…
litmus-tests
…
livepatch
…
locking Documentation/locking/locktypes: Update migrate_disable() bits. 2021-12-14 11:32:42 +01:00
m68k
…
maintainer
…
mhi
…
mips
…
misc-devices
…
netlabel
…
networking Documentation: fix sctp_wmem in ip-sysctl.rst 2022-08-03 12:00:47 +02:00
nios2
…
nvdimm
…
openrisc
…
parisc
…
pcmcia
…
power
…
powerpc powerpc/64s/syscall: Use pt_regs.trap to distinguish syscall ABI difference between sc and scv syscalls 2021-05-26 12:06:53 +02:00
process docs: update mediator information in CoC docs 2022-10-15 07:55:50 +02:00
riscv
…
s390
…
scheduler
…
scsi scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-03-25 09:04:11 +01:00
security
…
sh
…
sound ALSA: hda/realtek: Add alc256-samsung-headphone fixup 2022-04-08 14:40:36 +02:00
sparc
…
sphinx tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
sphinx-static
…
spi
…
staging
…
target tweewide: Fix most Shebang lines 2021-05-22 11:40:55 +02:00
timers
…
trace tracing/histogram: Update document for KEYS_MAX size 2022-11-10 18:14:26 +01:00
translations
…
usb
…
userspace-api media: hevc: Fix dependent slice segment flags 2021-07-14 16:55:51 +02:00
virt KVM: s390: pv: don't allow userspace to set the clock under PV 2022-11-16 09:57:10 +01:00
vm arm: remove CONFIG_ARCH_HAS_HOLES_MEMORYMODEL 2022-05-15 20:00:09 +02:00
w1
…
watchdog
…
x86
…
xtensa
…
.gitignore
…
COPYING-logo
…
Changes
…
CodingStyle
…
Kconfig
…
Makefile
…
SubmittingPatches
…
asm-annotations.rst
…
atomic_bitops.txt locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-25 11:38:10 +02:00
atomic_t.txt
…
conf.py docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 2022-06-09 10:21:28 +02:00
docutils.conf
…
dontdiff kbuild: generate Module.symvers only when vmlinux exists 2021-05-19 10:12:59 +02:00
index.rst
…
logo.gif
…
memory-barriers.txt
…
watch_queue.rst
…