OpenCloudOS-Kernel/include
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
..
acpi x86/mce/zhaoxin: Enable mcelog to decode PCIE, ZDI/ZPI, and DRAM errors 2024-08-16 18:34:33 +08:00
asm-generic Merge linux 6.6.44 2024-08-05 17:22:57 +08:00
clocksource
crypto crypto: af_alg - Disallow multiple in-flight AIO requests 2024-01-25 15:35:16 -08:00
drm drm/mipi-dsi: Fix theoretical int overflow in mipi_dsi_generic_write_seq() 2024-08-03 08:53:45 +02:00
dt-bindings clk: renesas: r8a779g0: Correct PFC/GPIO parent clocks 2024-03-26 18:19:47 -04:00
keys
kunit
kvm KVM: arm64: Fix host-programmed guest events in nVHE 2024-04-10 16:35:48 +02:00
linux KVM: Introduce KVM_SET_USER_MEMORY_REGION2 2024-09-12 07:19:36 +00:00
math-emu
media media: cec: core: avoid recursive cec_claim_log_addrs 2024-06-12 11:12:43 +02:00
memory
misc
net Merge linux 6.6.46 2024-08-24 09:37:59 +08:00
pcmcia
ras
rdma RDMA/core: Fix umem iterator when PAGE_SIZE is greater then HCA pgsz 2023-12-13 18:45:16 +01:00
rv
scsi Merge linux 6.6.35 2024-06-25 15:00:53 +08:00
soc soc: qcom: rpmh-rsc: Enhance check for VRM in-flight request 2024-06-16 13:47:33 +02:00
sound Merge linux 6.6.44 2024-08-05 17:22:57 +08:00
target
trace Merge linux 6.6.45 2024-08-23 19:54:49 +08:00
uapi KVM: Introduce KVM_SET_USER_MEMORY_REGION2 2024-09-12 07:19:36 +00:00
ufs scsi: ufs: mcq: Fix missing argument 'hba' in MCQ_OPR_OFFSET_n 2024-08-03 08:53:56 +02:00
vdso
video fbdev: stifb: Make the STI next font pointer a 32-bit signed offset 2023-11-28 17:19:58 +00:00
xen xen/events: reduce externally visible helper functions 2024-03-01 13:34:57 +01:00