Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

KVM: arm64: Add documentation for KVM_EXIT_ARM_LDST64B

Add a bit of documentation for KVM_EXIT_ARM_LDST64B so that userspace
knows what to expect.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Oliver Upton <oupton@kernel.org>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com>
Signed-off-by: Will Deacon <will@kernel.org>

authored by

Marc Zyngier and committed by
Will Deacon
902eebac f174a9ff

+36 -7
+36 -7
Documentation/virt/kvm/api.rst
··· 1303 1303 information or because there is no device mapped at the accessed IPA, then 1304 1304 userspace can ask the kernel to inject an external abort using the address 1305 1305 from the exiting fault on the VCPU. It is a programming error to set 1306 - ext_dabt_pending after an exit which was not either KVM_EXIT_MMIO or 1307 - KVM_EXIT_ARM_NISV. This feature is only available if the system supports 1308 - KVM_CAP_ARM_INJECT_EXT_DABT. This is a helper which provides commonality in 1309 - how userspace reports accesses for the above cases to guests, across different 1310 - userspace implementations. Nevertheless, userspace can still emulate all Arm 1311 - exceptions by manipulating individual registers using the KVM_SET_ONE_REG API. 1306 + ext_dabt_pending after an exit which was not either KVM_EXIT_MMIO, 1307 + KVM_EXIT_ARM_NISV, or KVM_EXIT_ARM_LDST64B. This feature is only available if 1308 + the system supports KVM_CAP_ARM_INJECT_EXT_DABT. This is a helper which 1309 + provides commonality in how userspace reports accesses for the above cases to 1310 + guests, across different userspace implementations. Nevertheless, userspace 1311 + can still emulate all Arm exceptions by manipulating individual registers 1312 + using the KVM_SET_ONE_REG API. 1312 1313 1313 1314 See KVM_GET_VCPU_EVENTS for the data structure. 1314 1315 ··· 7051 7050 7052 7051 :: 7053 7052 7054 - /* KVM_EXIT_ARM_NISV */ 7053 + /* KVM_EXIT_ARM_NISV / KVM_EXIT_ARM_LDST64B */ 7055 7054 struct { 7056 7055 __u64 esr_iss; 7057 7056 __u64 fault_ipa; 7058 7057 } arm_nisv; 7058 + 7059 + - KVM_EXIT_ARM_NISV: 7059 7060 7060 7061 Used on arm64 systems. If a guest accesses memory not in a memslot, 7061 7062 KVM will typically return to userspace and ask it to do MMIO emulation on its ··· 7091 7088 Note that although KVM_CAP_ARM_NISV_TO_USER will be reported if 7092 7089 queried outside of a protected VM context, the feature will not be 7093 7090 exposed if queried on a protected VM file descriptor. 7091 + 7092 + - KVM_EXIT_ARM_LDST64B: 7093 + 7094 + Used on arm64 systems. When a guest using a LD64B, ST64B, ST64BV, ST64BV0, 7095 + outside of a memslot, KVM will return to userspace with KVM_EXIT_ARM_LDST64B, 7096 + exposing the relevant ESR_EL2 information and faulting IPA, similarly to 7097 + KVM_EXIT_ARM_NISV. 7098 + 7099 + Userspace is supposed to fully emulate the instructions, which includes: 7100 + 7101 + - fetch of the operands for a store, including ACCDATA_EL1 in the case 7102 + of a ST64BV0 instruction 7103 + - deal with the endianness if the guest is big-endian 7104 + - emulate the access, including the delivery of an exception if the 7105 + access didn't succeed 7106 + - provide a return value in the case of ST64BV/ST64BV0 7107 + - return the data in the case of a load 7108 + - increment PC if the instruction was successfully executed 7109 + 7110 + Note that there is no expectation of performance for this emulation, as it 7111 + involves a large number of interaction with the guest state. It is, however, 7112 + expected that the instruction's semantics are preserved, specially the 7113 + single-copy atomicity property of the 64 byte access. 7114 + 7115 + This exit reason must be handled if userspace sets ID_AA64ISAR1_EL1.LS64 to a 7116 + non-zero value, indicating that FEAT_LS64* is enabled. 7094 7117 7095 7118 :: 7096 7119