aboutsummaryrefslogtreecommitdiff
path: root/linux-headers/linux/kvm.h
diff options
context:
space:
mode:
authorBibo Mao <maobibo@loongson.cn>2024-10-28 10:38:09 +0800
committerSong Gao <gaosong@loongson.cn>2024-11-02 15:20:41 +0800
commit0d2eeef77a33315187df8519491a900bde4a3d83 (patch)
treeaf5533e7ffb7790a5ef75f10da06c22e987577d1 /linux-headers/linux/kvm.h
parentd394a09cc1f25d6945f05182946a043b8d06c499 (diff)
downloadqemu-0d2eeef77a33315187df8519491a900bde4a3d83.zip
qemu-0d2eeef77a33315187df8519491a900bde4a3d83.tar.gz
qemu-0d2eeef77a33315187df8519491a900bde4a3d83.tar.bz2
linux-headers: Update to Linux v6.12-rc5
update linux-headers to v6.12-rc5. Pass to compile on aarch64, arm, loongarch64, x86_64, i386, riscv64,riscv32 softmmu and linux-user. Signed-off-by: Bibo Mao <maobibo@loongson.cn> Acked-by: Song Gao <gaosong@loongson.cn> Message-Id: <20241028023809.1554405-4-maobibo@loongson.cn> Signed-off-by: Song Gao <gaosong@loongson.cn>
Diffstat (limited to 'linux-headers/linux/kvm.h')
-rw-r--r--linux-headers/linux/kvm.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
index c93876c..49dd1b3 100644
--- a/linux-headers/linux/kvm.h
+++ b/linux-headers/linux/kvm.h
@@ -192,11 +192,20 @@ struct kvm_xen_exit {
/* Flags that describe what fields in emulation_failure hold valid data. */
#define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0)
+/*
+ * struct kvm_run can be modified by userspace at any time, so KVM must be
+ * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM()
+ * renames fields in struct kvm_run from <symbol> to <symbol>__unsafe when
+ * compiled into the kernel, ensuring that any use within KVM is obvious and
+ * gets extra scrutiny.
+ */
+#define HINT_UNSAFE_IN_KVM(_symbol) _symbol
+
/* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */
struct kvm_run {
/* in */
__u8 request_interrupt_window;
- __u8 immediate_exit;
+ __u8 HINT_UNSAFE_IN_KVM(immediate_exit);
__u8 padding1[6];
/* out */
@@ -913,6 +922,9 @@ struct kvm_enable_cap {
#define KVM_CAP_MEMORY_ATTRIBUTES 233
#define KVM_CAP_GUEST_MEMFD 234
#define KVM_CAP_VM_TYPES 235
+#define KVM_CAP_PRE_FAULT_MEMORY 236
+#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237
+#define KVM_CAP_X86_GUEST_MODE 238
struct kvm_irq_routing_irqchip {
__u32 irqchip;
@@ -1544,4 +1556,13 @@ struct kvm_create_guest_memfd {
__u64 reserved[6];
};
+#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory)
+
+struct kvm_pre_fault_memory {
+ __u64 gpa;
+ __u64 size;
+ __u64 flags;
+ __u64 padding[5];
+};
+
#endif /* __LINUX_KVM_H */