Re: Ubuntu

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

 



> Hum, that would defer DEC interrupts to "the next exit". So if your  
> guest is sitting in a spin lock for example, it wouldn't get a DEC  
> because it doesn't exit from the guest context to actually check if  
> TARGET_DEC < TB.

Ah no, you still set a target..

> I think the only really good way of doing this is to use the hrtimer  
> to trigger the interrupt, not clear the interrupt injection bit, but  
> only clear it on mtdec.
> 
> That way we get the interrupt to actually interrupt the guest context,  
> but instantly trigger the DEC in the guest when it sets IF=1.
> 
> I think I had a define for an "alternative" DEC method in book3s.c,  
> that basically checks mfdec() against 0 on every exit. Feel free to  
> try out of that one helps :-).

I saw that. My idea was more low-level:

 - Guest set DEC, you calculate & cache target
 - On exit to guest, you check target against TB, if passed, then a DEC
   interrupt is pending for guest. If EE is set, you "deliver" it.
 - If not passed, the substraction give you a DEC value (time to next
   DEC expected by guest). You set the DEC to min(DEC,value), ie, you
   make it fire the soonest of the guest DEC target vs. linux host guest
   target. Linux can cope just fine with spurrious DEC interrupts btw.

You have to do some modulo 32 bit etc... but basically, it should work
and it sounds simpler to me and will avoid the churn with timers etc...

Cheers,
Ben.

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux