Thread (13 messages) 13 messages, 2 authors, 2022-01-07

Re: [PATCH v2 5/7] KVM: PPC: mmio: Queue interrupt at kvmppc_emulate_mmio

From: Alexey Kardashevskiy <hidden>
Date: 2022-01-07 00:25:17


On 07/01/2022 07:03, Fabiano Rosas wrote:
quoted hunk ↗ jump to hunk
If MMIO emulation fails, we queue a Program interrupt to the
guest. Move that line up into kvmppc_emulate_mmio, which is where we
set RESUME_GUEST/HOST.

No functional change, just separation of responsibilities.

Signed-off-by: Fabiano Rosas <redacted>
---
  arch/powerpc/kvm/emulate_loadstore.c | 4 +---
  arch/powerpc/kvm/powerpc.c           | 2 +-
  2 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/kvm/emulate_loadstore.c b/arch/powerpc/kvm/emulate_loadstore.c
index 48272a9b9c30..ef50e8cfd988 100644
--- a/arch/powerpc/kvm/emulate_loadstore.c
+++ b/arch/powerpc/kvm/emulate_loadstore.c
@@ -355,10 +355,8 @@ int kvmppc_emulate_loadstore(struct kvm_vcpu *vcpu)
  		}
  	}
  
-	if (emulated == EMULATE_FAIL) {
+	if (emulated == EMULATE_FAIL)
  		advance = 0;

You can now drop @advance by moving the "if" few lines down.

quoted hunk ↗ jump to hunk
-		kvmppc_core_queue_program(vcpu, 0);
-	}
  
  	trace_kvm_ppc_instr(inst, kvmppc_get_pc(vcpu), emulated);
  
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index 3fc8057db4b4..a2e78229d645 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -307,7 +307,7 @@ int kvmppc_emulate_mmio(struct kvm_vcpu *vcpu)
  		u32 last_inst;
  
  		kvmppc_get_last_inst(vcpu, INST_GENERIC, &last_inst);
-		/* XXX Deliver Program interrupt to guest. */
+		kvmppc_core_queue_program(vcpu, 0);
  		pr_info("%s: emulation failed (%08x)\n", __func__, last_inst);
  		r = RESUME_HOST;
  		break;
-- 
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help