qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [ppc-kvm] a question about kvm interrupts handle


From: Alexander Graf
Subject: Re: [Qemu-ppc] [ppc-kvm] a question about kvm interrupts handle
Date: Fri, 1 Feb 2013 09:02:04 +0100


On 01.02.2013, at 08:47, Wangkai (Kevin,C) wrote:

Dear
 
I find the new version of kvm, for kvmppc_handle_exit function, new function
kvmppc_restart_interrupt was added to process the interrupts of host.
 
I think when the interrupt was enable by calling local_irq_enable(), the
Interrupts can occur and execute from the host interrupt vector again,
So is that needed to call kvmppc_restart_interrupt?

Imagine you have EPR enabled. With EPR, the vector is automatically accepted as soon as the interrupt handler gets invoked. But our interrupt handler merely exits from guest context.

So this is here to prevent these type of problems. We want to make sure we never lose any interrupts that could potentially only occur once. This way kvm is a shiny nice black box from Linux's perspective. From Linux's point of view, the interrupt simply occured a few cycles later.

 
int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
                       unsigned int exit_nr)
{
         int r = RESUME_HOST;
 
         /* update before a new last_exit_type is rewritten */
         kvmppc_update_timing_stats(vcpu);
 
         /* restart interrupts if they were meant for the host */
         kvmppc_restart_interrupt(vcpu, exit_nr);
 
         if (likely(exit_nr != BOOKE_INTERRUPT_MACHINE_CHECK))
                   local_irq_enable();

What version of kvm are you looking at here? This is not the upstream one ;).


Alex


reply via email to

[Prev in Thread] Current Thread [Next in Thread]