Currently, KVM may return a variety of internal errors to VMM when
accessing MMIO, and some of them could be gracefully handled on the KVM
level instead. Moreover, some of the MMIO-related errors are handled
differently in VMX in comparison with SVM, which produces certain
inconsistency and should be fixed. This patch series introduces
KVM-level handling for the following situations:
1) Guest is accessing MMIO during event delivery: triple fault instead
of internal error on VMX and infinite loop on SVM
2) Guest fetches an instruction from MMIO: inject #UD and resume guest
execution without internal error
Additionaly, this patch series includes a KVM selftest which covers
different cases of MMIO misuse.
Also, update the set_memory_region_test to expect the triple fault when
starting VM with no RAM.
Ivan Orlov (4):
KVM: vmx, svm, mmu: Fix MMIO during event delivery handling
KVM: x86: Inject UD when fetching from MMIO
selftests: KVM: Change expected exit code in test_zero_memory_regions
selftests: KVM: Add new test for faulty mmio usage
arch/x86/include/asm/kvm_host.h | 6 +
arch/x86/kvm/emulate.c | 3 +
arch/x86/kvm/kvm_emulate.h | 1 +
arch/x86/kvm/mmu/mmu.c | 13 +-
arch/x86/kvm/svm/svm.c | 4 +
arch/x86/kvm/vmx/vmx.c | 21 +-
arch/x86/kvm/x86.c | 7 +-
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/set_memory_region_test.c | 3 +-
.../selftests/kvm/x86_64/faulty_mmio.c | 199 ++++++++++++++++++
10 files changed, 242 insertions(+), 16 deletions(-)
create mode 100644 tools/testing/selftests/kvm/x86_64/faulty_mmio.c
--
2.43.0
The first patch in this two patch fixes warn_unused_result compile
time warning in posix_timers test.
The second patch removes local NSEC_PER_SEC and USEC_PER_SEC defines.
NSEC_PER_SEC and USEC_PER_SEC are defines in several timers tests.
These defines are inconsistent with variations of ULL, LL, etc. without
any explanation why it is necessary.
These defines can be picked up from include/vdso/time64.h header
file. In the interest of making it easier to maintain, remove the
local defines. Include include/vdso/time64.h instead. This change
will also make the defines consistent.
Shuah Khan (2):
selftests:timers: posix_timers: Fix warn_unused_result in
__fatal_error()
selftests: timers: Remove local NSEC_PER_SEC and USEC_PER_SEC defines
tools/testing/selftests/timers/Makefile | 2 +-
tools/testing/selftests/timers/adjtick.c | 4 +--
.../selftests/timers/alarmtimer-suspend.c | 2 +-
.../selftests/timers/inconsistency-check.c | 2 +-
tools/testing/selftests/timers/leap-a-day.c | 2 +-
tools/testing/selftests/timers/mqueue-lat.c | 2 +-
tools/testing/selftests/timers/nanosleep.c | 3 +--
tools/testing/selftests/timers/posix_timers.c | 27 ++++++++++---------
tools/testing/selftests/timers/raw_skew.c | 2 +-
tools/testing/selftests/timers/set-2038.c | 3 +--
.../testing/selftests/timers/set-timer-lat.c | 3 +--
.../testing/selftests/timers/valid-adjtimex.c | 4 +--
12 files changed, 26 insertions(+), 30 deletions(-)
--
2.40.1
Trivial patches to update the gitignore files unders selftests, and a
little addition to EXTRA_CLEAN under net/rds to account for the
automatically generated include.sh.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
---
Changes in v2:
- [PATCH 4/4] add excepction for load_address.c (must be tracked).
- Link to v1: https://lore.kernel.org/r/20240924-selftests-gitignore-v1-0-9755ac883388@gm…
---
Javier Carrasco (4):
selftests: add unshare_test and msg_oob to gitignore
selftests: rds: add include.sh to EXTRA_CLEAN
selftests: rds: add gitignore file for include.sh
selftests: exec: update gitignore for load_address
tools/testing/selftests/core/.gitignore | 1 +
tools/testing/selftests/exec/.gitignore | 3 ++-
tools/testing/selftests/net/.gitignore | 1 +
tools/testing/selftests/net/rds/.gitignore | 1 +
tools/testing/selftests/net/rds/Makefile | 2 +-
5 files changed, 6 insertions(+), 2 deletions(-)
---
base-commit: 4d0326b60bb753627437fff0f76bf1525bcda422
change-id: 20240924-selftests-gitignore-e41133e6c5bd
Best regards,
--
Javier Carrasco <javier.carrasco.cruz(a)gmail.com>
Currently the RAS feature bit is not writable in ID_AA64PFR0EL1, this makes
migration fail when migration from the machine which RAS is 1 to another machine
which RAS is 2.
Allow RAS writable from userspace would make the migration possible between two
machines which RAS is different.
Shaoqin Huang (2):
KVM: arm64: Use kvm_has_feat() to check if FEAT_RAS is advertised to
the guest
KVM: arm64: Allow the RAS feature bit in ID_AA64PFR0_EL1 writable from
userspace
arch/arm64/kvm/guest.c | 4 ++--
arch/arm64/kvm/handle_exit.c | 2 +-
arch/arm64/kvm/hyp/include/hyp/switch.h | 2 +-
arch/arm64/kvm/hyp/include/hyp/sysreg-sr.h | 7 +++++--
arch/arm64/kvm/sys_regs.c | 3 +--
tools/testing/selftests/kvm/aarch64/set_id_regs.c | 1 +
6 files changed, 11 insertions(+), 8 deletions(-)
--
2.40.1