Thread (51 messages) 51 messages, 3 authors, 2012-02-28

Re: [PATCH 36/37] KVM: PPC: booke: expose guest registers on irq reinject

flat view

From: Scott Wood <hidden>
Date: 2012-02-24 23:40:27
Also in: kvm

On 02/24/2012 08:26 AM, Alexander Graf wrote:
quoted hunk ↗ jump to hunk
+static void kvmppc_fill_pt_regs(struct kvm_vcpu *vcpu, struct pt_regs *regs)
 {
-	int r = RESUME_HOST;
+	int i;
 
-	/* update before a new last_exit_type is rewritten */
-	kvmppc_update_timing_stats(vcpu);
+	for (i = 0; i < 32; i++)
+		regs->gpr[i] = kvmppc_get_gpr(vcpu, i);
+	regs->nip = vcpu->arch.pc;
+	regs->msr = vcpu->arch.shared->msr;
+	regs->ctr = vcpu->arch.ctr;
+	regs->link = vcpu->arch.lr;
+	regs->xer = kvmppc_get_xer(vcpu);
+	regs->ccr = kvmppc_get_cr(vcpu);
+	regs->dar = get_guest_dear(vcpu);
+	regs->dsisr = get_guest_esr(vcpu);
+}
How much overhead does this add to every interrupt?  Can't we keep this
to the minimum that perf cares about?
quoted hunk ↗ jump to hunk
+
+static void kvmppc_restart_interrupt(struct kvm_vcpu *vcpu,
+				     unsigned int exit_nr)
+{
+	struct pt_regs regs = *current->thread.regs;
 
+	kvmppc_fill_pt_regs(vcpu, &regs);
Why are you copying out of current->thread.regs?  That's old junk data,
set by some previous exception and possibly overwritten since.

-Scott
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help