Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ac0a48c3 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: x86: rename EMULATE_DO_MMIO



The next patch will reuse it for other userspace exits than MMIO,
namely debug events.

Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent a343c9b7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -804,7 +804,7 @@ extern u32 kvm_max_guest_tsc_khz;


enum emulation_result {
enum emulation_result {
	EMULATE_DONE,         /* no further processing */
	EMULATE_DONE,         /* no further processing */
	EMULATE_DO_MMIO,      /* kvm_run filled with mmio request */
	EMULATE_USER_EXIT,    /* kvm_run ready for userspace exit */
	EMULATE_FAIL,         /* can't emulate this instruction */
	EMULATE_FAIL,         /* can't emulate this instruction */
};
};


+1 −1
Original line number Original line Diff line number Diff line
@@ -4182,7 +4182,7 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t cr2, u32 error_code,
	switch (er) {
	switch (er) {
	case EMULATE_DONE:
	case EMULATE_DONE:
		return 1;
		return 1;
	case EMULATE_DO_MMIO:
	case EMULATE_USER_EXIT:
		++vcpu->stat.mmio_exits;
		++vcpu->stat.mmio_exits;
		/* fall through */
		/* fall through */
	case EMULATE_FAIL:
	case EMULATE_FAIL:
+1 −1
Original line number Original line Diff line number Diff line
@@ -5452,7 +5452,7 @@ static int handle_invalid_guest_state(struct kvm_vcpu *vcpu)


		err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE);
		err = emulate_instruction(vcpu, EMULTYPE_NO_REEXECUTE);


		if (err == EMULATE_DO_MMIO) {
		if (err == EMULATE_USER_EXIT) {
			ret = 0;
			ret = 0;
			goto out;
			goto out;
		}
		}
+2 −2
Original line number Original line Diff line number Diff line
@@ -5038,11 +5038,11 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu,
			writeback = false;
			writeback = false;
			vcpu->arch.complete_userspace_io = complete_emulated_pio;
			vcpu->arch.complete_userspace_io = complete_emulated_pio;
		}
		}
		r = EMULATE_DO_MMIO;
		r = EMULATE_USER_EXIT;
	} else if (vcpu->mmio_needed) {
	} else if (vcpu->mmio_needed) {
		if (!vcpu->mmio_is_write)
		if (!vcpu->mmio_is_write)
			writeback = false;
			writeback = false;
		r = EMULATE_DO_MMIO;
		r = EMULATE_USER_EXIT;
		vcpu->arch.complete_userspace_io = complete_emulated_mmio;
		vcpu->arch.complete_userspace_io = complete_emulated_mmio;
	} else if (r == EMULATION_RESTART)
	} else if (r == EMULATION_RESTART)
		goto restart;
		goto restart;