History

KVM: arm64: Add exit to userspace on {LD,ST}64B* outside of memslots

The main use of {LD,ST}64B* is to talk to a device, which is hopefully directly assigned to the guest and requires no additional handling. However, this does not preclude a VMM from exposing a virtual device to the guest, and to allow 64 byte accesses as part of the programming interface. A direct consequence of this is that we need to be able to forward such access to userspace. Given that such a contraption is very unlikely to ever exist, we choose to offer a limited service: userspace gets (as part of a new exit reason) the ESR, the IPA, and that's it. It is fully expected to handle the full semantics of the instructions, deal with ACCDATA, the return values and increment PC. Much fun. A canonical implementation can also simply inject an abort and be done with it. Frankly, don't try to do anything else unless you have time to waste.

Marc Zyngier committed 10 months ago

Commit f174a9f1 parent 018a2312 files · +28 −2Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/kvm.h+2−1
@@ -180,6 +180,7 @@ struct kvm_xen_exit { · 179 unmodified lines
180180 #define KVM_EXIT_MEMORY_FAULT 39
181181 #define KVM_EXIT_TDX 40
182182 #define KVM_EXIT_ARM_SEA 41
183+#define KVM_EXIT_ARM_LDST64B 42
183184
184185 /* For KVM_EXIT_INTERNAL_ERROR */
185186 /* Emulate instruction failed. */
@@ -402,7 +403,7 @@ struct kvm_run { · 216 unmodified lines
402403 } eoi;
403404 /* KVM_EXIT_HYPERV */
404405 struct kvm_hyperv_exit hyperv;
405− /* KVM_EXIT_ARM_NISV */
406+ /* KVM_EXIT_ARM_NISV / KVM_EXIT_ARM_LDST64B */
406407 struct {
407408 __u64 esr_iss;
408409 __u64 fault_ipa;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t