@@ -287,6 +287,7 @@ struct kvm_reinject_control {
#define KVM_VCPUEVENT_VALID_SIPI_VECTOR 0x00000002
#define KVM_VCPUEVENT_VALID_SHADOW 0x00000004
#define KVM_VCPUEVENT_VALID_SMM 0x00000008
+#define KVM_VCPUEVENT_VALID_ASYNC_PF 0x00000010
/* Interrupt shadow states */
#define KVM_X86_SHADOW_INT_MOV_SS 0x01
@@ -298,7 +299,7 @@ struct kvm_vcpu_events {
__u8 injected;
__u8 nr;
__u8 has_error_code;
- __u8 pad;
+ __u8 async_page_fault;
__u32 error_code;
} exception;
struct {
@@ -1105,6 +1105,7 @@ typedef struct CPUX86State {
/* exception/interrupt handling */
int error_code;
+ uint8_t async_page_fault;
int exception_is_int;
target_ulong exception_next_eip;
target_ulong dr[8]; /* debug registers; note dr4 and dr5 are unused */
@@ -2491,8 +2491,8 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level)
events.exception.injected = (env->exception_injected >= 0);
events.exception.nr = env->exception_injected;
events.exception.has_error_code = env->has_error_code;
+ events.exception.async_page_fault = env->async_page_fault;
events.exception.error_code = env->error_code;
- events.exception.pad = 0;
events.interrupt.injected = (env->interrupt_injected >= 0);
events.interrupt.nr = env->interrupt_injected;
@@ -2531,7 +2531,8 @@ static int kvm_put_vcpu_events(X86CPU *cpu, int level)
if (level >= KVM_PUT_RESET_STATE) {
events.flags |=
- KVM_VCPUEVENT_VALID_NMI_PENDING | KVM_VCPUEVENT_VALID_SIPI_VECTOR;
+ KVM_VCPUEVENT_VALID_NMI_PENDING | KVM_VCPUEVENT_VALID_SIPI_VECTOR |
+ KVM_VCPUEVENT_VALID_ASYNC_PF;
}
return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_VCPU_EVENTS, &events);
@@ -2555,6 +2556,9 @@ static int kvm_get_vcpu_events(X86CPU *cpu)
env->exception_injected =
events.exception.injected ? events.exception.nr : -1;
env->has_error_code = events.exception.has_error_code;
+ if (events.flags & KVM_VCPUEVENT_VALID_ASYNC_PF) {
+ env->async_page_fault = events.exception.async_page_fault;
+ }
env->error_code = events.exception.error_code;
env->interrupt_injected =