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

Commit 082decf2 authored by Hollis Blanchard's avatar Hollis Blanchard Committed by Avi Kivity
Browse files

KVM: PPC: initialize IVORs in addition to IVPR



Developers can now tell at a glace the exact type of the premature interrupt,
instead of just knowing that there was some premature interrupt.

Signed-off-by: default avatarHollis Blanchard <hollis_blanchard@mentor.com>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 296c19d0
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -497,15 +497,19 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
/* Initial guest state: 16MB mapping 0 -> 0, PC = 0, MSR = 0, R1 = 16MB */
/* Initial guest state: 16MB mapping 0 -> 0, PC = 0, MSR = 0, R1 = 16MB */
int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
{
{
	int i;

	vcpu->arch.pc = 0;
	vcpu->arch.pc = 0;
	vcpu->arch.shared->msr = 0;
	vcpu->arch.shared->msr = 0;
	kvmppc_set_gpr(vcpu, 1, (16<<20) - 8); /* -8 for the callee-save LR slot */
	kvmppc_set_gpr(vcpu, 1, (16<<20) - 8); /* -8 for the callee-save LR slot */


	vcpu->arch.shadow_pid = 1;
	vcpu->arch.shadow_pid = 1;


	/* Eye-catching number so we know if the guest takes an interrupt
	/* Eye-catching numbers so we know if the guest takes an interrupt
	 * before it's programmed its own IVPR. */
	 * before it's programmed its own IVPR/IVORs. */
	vcpu->arch.ivpr = 0x55550000;
	vcpu->arch.ivpr = 0x55550000;
	for (i = 0; i < BOOKE_IRQPRIO_MAX; i++)
		vcpu->arch.ivor[i] = 0x7700 | i * 4;


	kvmppc_init_timing_stats(vcpu);
	kvmppc_init_timing_stats(vcpu);