OpenCloudOS-Kernel/include/uapi
Sean Christopherson 7287b19950 KVM: Introduce KVM_SET_USER_MEMORY_REGION2
commit bb58b90b1a8f753b582055adaf448214a8e22c31 upstream.

Introduce a "version 2" of KVM_SET_USER_MEMORY_REGION so that additional
information can be supplied without setting userspace up to fail.  The
padding in the new kvm_userspace_memory_region2 structure will be used to
pass a file descriptor in addition to the userspace_addr, i.e. allow
userspace to point at a file descriptor and map memory into a guest that
is NOT mapped into host userspace.

Alternatively, KVM could simply add "struct kvm_userspace_memory_region2"
without a new ioctl(), but as Paolo pointed out, adding a new ioctl()
makes detection of bad flags a bit more robust, e.g. if the new fd field
is guarded only by a flag and not a new ioctl(), then a userspace bug
(setting a "bad" flag) would generate out-of-bounds access instead of an
-EINVAL error.

Cc: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Message-Id: <20231027182217.3615211-9-seanjc@google.com>
Acked-by: Kai Huang <kai.huang@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Like Xu <likexu@tencent.com>
2024-09-12 07:19:36 +00:00
..
asm-generic Merge branch 'dev/toa' into 'master' (merge request !154) 2024-08-14 07:35:37 +00:00
drm drm/nouveau: use tile_mode and pte_kind for VM_BIND bo allocations 2024-06-12 11:12:45 +02:00
linux KVM: Introduce KVM_SET_USER_MEMORY_REGION2 2024-09-12 07:19:36 +00:00
misc misc: fastrpc: Restrict untrusted app to attach to privileged PD 2024-07-18 13:21:24 +02:00
mtd This pull request contains updates for UBI and UBIFS 2022-10-14 18:23:23 -07:00
rdma RDMA/bnxt_re: Adds MSN table capability for Gen P7 adapters 2024-06-12 11:12:10 +02:00
scsi scsi: mpi3mr: Avoid memcpy field-spanning write WARNING 2024-05-17 12:02:11 +02:00
sound ASoC: SOF: topology: Add a token for dropping widget name in kcontrol name 2023-08-15 13:25:56 +01:00
video
xen xen: irqfd: Use _IOW instead of the internal _IOC() macro 2023-11-20 11:59:12 +01:00
Kbuild