[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC v2 PATCH 02/13] KVM: Add KVM_EXIT_MEMORY_ERROR exit
From: |
Chao Peng |
Subject: |
[RFC v2 PATCH 02/13] KVM: Add KVM_EXIT_MEMORY_ERROR exit |
Date: |
Fri, 19 Nov 2021 21:47:28 +0800 |
This new exit allows userspace to handle memory related error. It will
be used for shared memory <-->private memory conversion.
Signed-off-by: Yu Zhang <yu.c.zhang@linux.intel.com>
Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
---
include/uapi/linux/kvm.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 7c93d61cb19e..7e3a8935534b 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -285,6 +285,18 @@ struct kvm_tdx_exit {
} u;
};
+struct kvm_memory_exit {
+#define KVM_EXIT_MEM_MAP_SHARED 1
+#define KVM_EXIT_MEM_MAP_PRIVATE 2
+ __u32 type;
+ union {
+ struct {
+ __u64 gpa;
+ __u64 size;
+ } map;
+ } u;
+};
+
#define KVM_S390_GET_SKEYS_NONE 1
#define KVM_S390_SKEYS_MAX 1048576
@@ -324,6 +336,7 @@ struct kvm_tdx_exit {
#define KVM_EXIT_X86_BUS_LOCK 33
#define KVM_EXIT_XEN 34
#define KVM_EXIT_RISCV_SBI 35
+#define KVM_EXIT_MEMORY_ERROR 36
#define KVM_EXIT_TDX 50 /* dump number to avoid conflict. */
/* For KVM_EXIT_INTERNAL_ERROR */
@@ -542,6 +555,8 @@ struct kvm_run {
unsigned long args[6];
unsigned long ret[2];
} riscv_sbi;
+ /* KVM_EXIT_MEMORY_ERROR */
+ struct kvm_memory_exit mem;
/* KVM_EXIT_TDX_VMCALL */
struct kvm_tdx_exit tdx;
/* Fix the size of the union. */
--
2.17.1
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, (continued)
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Jason Gunthorpe, 2021/11/19
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Sean Christopherson, 2021/11/19
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Jason Gunthorpe, 2021/11/19
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Sean Christopherson, 2021/11/19
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Jason Gunthorpe, 2021/11/20
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Paolo Bonzini, 2021/11/23
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Chao Peng, 2021/11/23
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, David Hildenbrand, 2021/11/23
- Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Jason Gunthorpe, 2021/11/23
Re: [RFC v2 PATCH 01/13] mm/shmem: Introduce F_SEAL_GUEST, Paolo Bonzini, 2021/11/23
[RFC v2 PATCH 02/13] KVM: Add KVM_EXIT_MEMORY_ERROR exit,
Chao Peng <=
[RFC v2 PATCH 03/13] KVM: Extend kvm_userspace_memory_region to support fd based memslot, Chao Peng, 2021/11/19
[RFC v2 PATCH 04/13] KVM: Add fd-based memslot data structure and utils, Chao Peng, 2021/11/19
[RFC v2 PATCH 05/13] KVM: Implement fd-based memory using new memfd interfaces, Chao Peng, 2021/11/19
[RFC v2 PATCH 06/13] KVM: Register/unregister memfd backed memslot, Chao Peng, 2021/11/19
[RFC v2 PATCH 07/13] KVM: Handle page fault for fd based memslot, Chao Peng, 2021/11/19