kvm/e500: Add shadow ID mapping support
Subsystems (2)
PATCH 2/5 kvm/e500: Add shadow ID mapping support
Based on Hollis's idea,
this patch map (vcpu, as, pid) to individual shadow id.
Every vcpu has a mapping table,
which keep the mapping from guest (as, id) to shadow id.
Every hardware core has a shadow id reference table, which keep the mapping from shadow id to (vcpu, as, pid).
When mapping is created, both vcpu and core need to update their tables. But they can destroy the mapping one-sided.
When shadow id get exhausted,
a flush is needed for shadow id reference table.
Signed-off-by Liu Yu <[email protected]>
--- arch/powerpc/include/asm/kvm_e500.h | 3 + arch/powerpc/kvm/e500_tlb.c | 96 +++++++++++++++++++++++++++++++++++ arch/powerpc/kvm/e500_tlb.h | 4 +- 3 files changed, 102 insertions(+), 1 deletions(-)
arch/powerpc/include/asm/kvm_e500.h +3 -0
@@ -42,6 +42,9 @@ struct kvmppc_vcpu_e500 {/* Pages which are referenced in the shadow TLB. */ struct kvmppc_e500_shadow_ref *shadow_refs[E500_TLB_NUM ]; +/* MMU id mapping */ +void *id_mapping; +unsigned int guest_tlb_size[E500_TLB_NUM ];unsigned int shadow_tlb_size[E500_TLB_NUM ];unsigned int guest_tlb_nv[E500_TLB_NUM ];
arch/powerpc/kvm/e500_tlb.c +96 -0
116 lines not on this page · raw message
arch/powerpc/kvm/e500_tlb.h +3 -1
@@ -1,5 +1,5 @@/* -* Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved. +* Copyright (C) 2008 - 2009 Freescale Semiconductor, Inc. All rights reserved. * * Author: Yu Liu, [email protected] *
@@ -55,6 +55,8 @@ extern void kvmppc_e500_tlb_load(struct kvm_vcpu *, int);extern int kvmppc_e500_tlb_init (struct kvmppc_vcpu_e500 *);extern void kvmppc_e500_tlb_uninit (struct kvmppc_vcpu_e500 *);extern void kvmppc_e500_tlb_setup (struct kvmppc_vcpu_e500 *); +extern unsigned int kvmppc_e500_get_sid (struct kvmppc_vcpu_e500 *vcpu_e500, +int as,int gid);/* TLB helper functions */ static inline unsigned int get_tlb_size (const struct tlbe *tlbe)
Signature · 1 line
1.5.4