Skip to content

Commit b8f8d19

Browse files
author
Marc Zyngier
committed
KVM: arm64: Document the behaviour of S1PTW faults on RO memslots
Although the KVM API says that a write to a RO memslot must result in a KVM_EXIT_MMIO describing the write, the arm64 architecture doesn't provide the *data* written by a Stage-1 page table walk (we only get the address). Since there isn't much userspace can do with so little information anyway, document the fact that such an access results in a guest exception, not an exit. This is consistent with the guest being terminally broken anyway. Reviewed-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]>
1 parent 406504c commit b8f8d19

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Documentation/virt/kvm/api.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,14 @@ the memory region are automatically reflected into the guest. For example, an
13541354
mmap() that affects the region will be made visible immediately. Another
13551355
example is madvise(MADV_DROP).
13561356

1357+
Note: On arm64, a write generated by the page-table walker (to update
1358+
the Access and Dirty flags, for example) never results in a
1359+
KVM_EXIT_MMIO exit when the slot has the KVM_MEM_READONLY flag. This
1360+
is because KVM cannot provide the data that would be written by the
1361+
page-table walker, making it impossible to emulate the access.
1362+
Instead, an abort (data abort if the cause of the page-table update
1363+
was a load or a store, instruction abort if it was an instruction
1364+
fetch) is injected in the guest.
13571365

13581366
4.36 KVM_SET_TSS_ADDR
13591367
---------------------

0 commit comments

Comments
 (0)