···13961396Memory for the region is taken starting at the address denoted by the13971397field userspace_addr, which must point at user addressable memory for13981398the entire memory slot size. Any object may back this memory, including13991399-anonymous memory, ordinary files, and hugetlbfs.13991399+anonymous memory, ordinary files, and hugetlbfs. Changes in the backing14001400+of the memory region are automatically reflected into the guest.14011401+For example, an mmap() that affects the region will be made visible14021402+immediately. Another example is madvise(MADV_DROP).1400140314011404On architectures that support a form of address tagging, userspace_addr must14021405be an untagged address.···14141411use it. The latter can be set, if KVM_CAP_READONLY_MEM capability allows it,14151412to make a new slot read-only. In this case, writes to this memory will be14161413posted to userspace as KVM_EXIT_MMIO exits.14171417-14181418-When the KVM_CAP_SYNC_MMU capability is available, changes in the backing of14191419-the memory region are automatically reflected into the guest. For example, an14201420-mmap() that affects the region will be made visible immediately. Another14211421-example is madvise(MADV_DROP).1422141414231415For TDX guest, deleting/moving memory region loses guest memory contents.14241416Read only region isn't supported. Only as-id 0 is supported.
-1
arch/arm64/kvm/arm.c
···358358 break;359359 case KVM_CAP_IOEVENTFD:360360 case KVM_CAP_USER_MEMORY:361361- case KVM_CAP_SYNC_MMU:362361 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:363362 case KVM_CAP_ONE_REG:364363 case KVM_CAP_ARM_PSCI:
-1
arch/loongarch/kvm/vm.c
···118118 case KVM_CAP_ONE_REG:119119 case KVM_CAP_ENABLE_CAP:120120 case KVM_CAP_READONLY_MEM:121121- case KVM_CAP_SYNC_MMU:122121 case KVM_CAP_IMMEDIATE_EXIT:123122 case KVM_CAP_IOEVENTFD:124123 case KVM_CAP_MP_STATE:
···623623 r = !!(hv_enabled && kvmppc_hv_ops->enable_nested &&624624 !kvmppc_hv_ops->enable_nested(NULL));625625 break;626626-#endif627627- case KVM_CAP_SYNC_MMU:628628- r = 1;629629- break;630630-#ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE631626 case KVM_CAP_PPC_HTAB_FD:632627 r = hv_enabled;633628 break;
-1
arch/riscv/kvm/vm.c
···181181 break;182182 case KVM_CAP_IOEVENTFD:183183 case KVM_CAP_USER_MEMORY:184184- case KVM_CAP_SYNC_MMU:185184 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS:186185 case KVM_CAP_ONE_REG:187186 case KVM_CAP_READONLY_MEM:
-1
arch/s390/kvm/kvm-s390.c
···601601 switch (ext) {602602 case KVM_CAP_S390_PSW:603603 case KVM_CAP_S390_GMAP:604604- case KVM_CAP_SYNC_MMU:605604#ifdef CONFIG_KVM_S390_UCONTROL606605 case KVM_CAP_S390_UCONTROL:607606#endif
-1
arch/x86/kvm/x86.c
···48054805#endif48064806 case KVM_CAP_NOP_IO_DELAY:48074807 case KVM_CAP_MP_STATE:48084808- case KVM_CAP_SYNC_MMU:48094808 case KVM_CAP_USER_NMI:48104809 case KVM_CAP_IRQ_INJECT_STATUS:48114810 case KVM_CAP_IOEVENTFD:
+1
virt/kvm/kvm_main.c
···48704870static int kvm_vm_ioctl_check_extension_generic(struct kvm *kvm, long arg)48714871{48724872 switch (arg) {48734873+ case KVM_CAP_SYNC_MMU:48734874 case KVM_CAP_USER_MEMORY:48744875 case KVM_CAP_USER_MEMORY2:48754876 case KVM_CAP_DESTROY_MEMORY_REGION_WORKS: