[PATCH 1/3] kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid

2013-02-13 Thread Scott Wood
Add one to esel values in h2g_tlb1_rmap, so that no mapping can be distinguished from esel 0. Note that we're not saved by the fact that host esel 0 is reserved for non-KVM use, because KVM host esel numbering is not the raw host numbering (see to_htlb1_esel). Signed-off-by: Scott Wood

[PATCH 3/3] kvm/ppc/e500: eliminate tlb_refs

2013-02-13 Thread Scott Wood
Commit 523f0e5421c12610527c620b983b443f329e3a32 (KVM: PPC: E500: Explicitly mark shadow maps invalid) began using E500_TLB_VALID for guest TLB1 entries, and skipping invalidations if it's not set. However, when E500_TLB_VALID was set for such entries, it was on a fake local ref, and so the

[PATCH 2/3] kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit

2013-02-13 Thread Scott Wood
It's possible that we're using the same host TLB1 slot to map (a presumably different portion of) the same guest TLB1 entry. Clear the bit in the map before setting it, so that if the esels are the same the bit will remain set. Signed-off-by: Scott Wood scottw...@freescale.com ---

[RFC PATCH 5/6] kvm/ppc/mpic: adapt to kernel style and environment

2013-02-13 Thread Scott Wood
Remove braces that Linux style doesn't permit, remove space after '*' that Lindent added, keep error/debug strings contiguous, etc. Substitute type names, debug prints, etc. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/mpic.c | 445

[RFC PATCH 1/6] kvm: add device control API

2013-02-13 Thread Scott Wood
Currently, devices that are emulated inside KVM are configured in a hardcoded manner based on an assumption that any given architecture only has one way to do it. If there's any need to access device state, it is done through inflexible one-purpose-only IOCTLs (e.g. KVM_GET/SET_LAPIC). Defining

[RFC PATCH 3/6] kvm/ppc/mpic: import hw/openpic.c from QEMU

2013-02-13 Thread Scott Wood
This is QEMU's hw/openpic.c from commit abd8d4a4d6dfea7ddea72f095f993e1de941614e (Update version for 1.4.0-rc0), run through Lindent with no other changes to ease merging future changes between Linux and QEMU. Remaining style issues (including those introduced by Lindent) will be fixed in a later

[RFC PATCH 4/6] kvm/ppc/mpic: remove some obviously unneeded code

2013-02-13 Thread Scott Wood
Remove some parts of the code that are obviously QEMU or Raven specific before fixing style issues, to reduce the style issues that need to be fixed. Signed-off-by: Scott Wood scottw...@freescale.com --- arch/powerpc/kvm/mpic.c | 344 --- 1 file

[RFC PATCH 6/6] kvm/ppc/mpic: in-kernel MPIC emulation

2013-02-13 Thread Scott Wood
Hook the MPIC code up to the KVM interfaces, add locking, etc. TODO: irqfd support Signed-off-by: Scott Wood scottw...@freescale.com --- Documentation/virtual/kvm/devices/mpic.txt | 36 ++ arch/powerpc/include/asm/kvm_host.h|9 +- arch/powerpc/include/asm/kvm_ppc.h |4

[RFC PATCH 2/6] kvm/ppc: add a notifier chain for vcpu creation/destruction.

2013-02-13 Thread Scott Wood
This will be used by the in-kernel MPIC to update its per-vcpu data structures, and other vcpu init actions may benefit from migrating to this over fixed initialization. The notifier itself is kept in the non-arch-specific struct, and initialized from non-arch-specific code. I was hoping to make

Re: [PATCH 0/3] kvm/ppc/e500: TLB bugfixes

2013-02-13 Thread Scott Wood
On 02/13/2013 11:37:47 PM, Scott Wood wrote: Scott Wood (3): kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit kvm/ppc/e500: eliminate tlb_refs arch/powerpc/kvm/e500.h | 24 ---