Skip to contentSkip to conversation

KVM: PPC: Book3S HV: Simplify real-mode interrupt handling

RFC PATCH Superseded Paul Mackerras 1 participant 1 message Sep 21, 2018

Subsystems (2)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 5/32 KVM: PPC: Book3S HV: Simplify real-mode interrupt handling

This streamlines the first part of the code that handles a hypervisor interrupt that occurred in the guest. With this, all of the real-mode handling that occurs is done before the "guest_exit_cont" label; once we get to that label we are committed to exiting to host virtual mode. Thus the machine check and HMI real-mode handling is moved before that label.

Also, the code to handle external interrupts is moved out of line, as is the code that calls kvmppc_realmode_hmi_handler().

---
 arch/powerpc/kvm/book3s_hv_ras.c        |   8 ++
 arch/powerpc/kvm/book3s_hv_rmhandlers.S | 220 ++++++++++++++++----------------
 2 files changed, 119 insertions(+), 109 deletions(-)
arch/powerpc/kvm/book3s_hv_ras.c +8 -0
index b11043b..ee564b6 100644
@@ -331,5 +331,13 @@ long kvmppc_realmode_hmi_handler(void)
 	} else {
 		wait_for_tb_resync();
 	}
+
+	/*
+	 * Reset tb_offset_applied so the guest exit code won't try
+	 * to subtract the previous timebase offset from the timebase.
+	 */
+	if (local_paca->kvm_hstate.kvm_vcore)
+		local_paca->kvm_hstate.kvm_vcore->tb_offset_applied = 0;
+
 	return 0;
 }
arch/powerpc/kvm/book3s_hv_rmhandlers.S +111 -109

294 lines not on this page · raw message

Signature · 1 line
2.7.4