On Tue, 2009-04-07 at 17:51 +0800, Liu Yu wrote: > Hi guys, > > Thanks to Hollis's idea. > This patch help to make KVMPPC be more friendly to OSes other than Linux. Wow, that was quick. :) Have you tested this code? Doesn't this break the assumption in kvmppc_e500_tlb1_invalidate() (and probably elsewhere) that stid == gtid? > Any (ts,tid) combination will be mapped to an individual shadow tid(stid). > Whenever the stid is exhausted, it needs to reset of stid and flush host TLB. What I was thinking was that KVM would participate in the host's normal PID allocation policy. Specifically, guest activity could cause the host to invoke steal_context_up/smp() (see switch_mmu_context() for reference). When you do that, there is no need for KVM to explicitly flush the TLB ever -- it's done as needed by steal_context*(). That's actually better than what we do today, because today we must flush all guest mappings every time we de-schedule a guest. In the new scheme, when (guest PIDs + host PIDs) < 255, we would never need to flush the TLB due to PID pressure. (Also, rather than an array, I would have created a hash table using include/linux/hash.h and include/linux/list.h. I haven't thought it through all the way though... I mean the tradeoffs of an array vs hash table here.) -- Hollis Blanchard IBM Linux Technology Center -- 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