Skip to content

Commit

Permalink
KVM: PPC: booke: add booke-level vcpu load/put
Browse files Browse the repository at this point in the history
This gives us a place to put load/put actions that correspond to
code that is booke-specific but not specific to a particular core.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>
  • Loading branch information
Scott Wood authored and Avi Kivity committed Apr 8, 2012
1 parent 043cc4d commit 94fa9d9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/powerpc/kvm/44x.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@
#include <asm/kvm_ppc.h>

#include "44x_tlb.h"
#include "booke.h"

void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
kvmppc_booke_vcpu_load(vcpu, cpu);
kvmppc_44x_tlb_load(vcpu);
}

void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
{
kvmppc_44x_tlb_put(vcpu);
kvmppc_booke_vcpu_put(vcpu);
}

int kvmppc_core_check_processor_compat(void)
Expand Down
8 changes: 8 additions & 0 deletions arch/powerpc/kvm/booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,14 @@ void kvmppc_decrementer_func(unsigned long data)
kvmppc_set_tsr_bits(vcpu, TSR_DIS);
}

void kvmppc_booke_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
}

void kvmppc_booke_vcpu_put(struct kvm_vcpu *vcpu)
{
}

int __init kvmppc_booke_init(void)
{
unsigned long ivor[16];
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kvm/booke.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ void kvmppc_save_guest_spe(struct kvm_vcpu *vcpu);
/* high-level function, manages flags, host state */
void kvmppc_vcpu_disable_spe(struct kvm_vcpu *vcpu);

void kvmppc_booke_vcpu_load(struct kvm_vcpu *vcpu, int cpu);
void kvmppc_booke_vcpu_put(struct kvm_vcpu *vcpu);

#endif /* __KVM_BOOKE_H__ */
3 changes: 3 additions & 0 deletions arch/powerpc/kvm/e500.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ void kvmppc_core_load_guest_debugstate(struct kvm_vcpu *vcpu)

void kvmppc_core_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
{
kvmppc_booke_vcpu_load(vcpu, cpu);
kvmppc_e500_tlb_load(vcpu, cpu);
}

Expand All @@ -47,6 +48,8 @@ void kvmppc_core_vcpu_put(struct kvm_vcpu *vcpu)
if (vcpu->arch.shadow_msr & MSR_SPE)
kvmppc_vcpu_disable_spe(vcpu);
#endif

kvmppc_booke_vcpu_put(vcpu);
}

int kvmppc_core_check_processor_compat(void)
Expand Down

0 comments on commit 94fa9d9

Please sign in to comment.