On 03/26/2013 05:05:08 PM, Mihai Caraman wrote:
diff --git a/arch/powerpc/kvm/e500.h b/arch/powerpc/kvm/e500.h
index b73ca7a..795934d 100644
--- a/arch/powerpc/kvm/e500.h
+++ b/arch/powerpc/kvm/e500.h
@@ -23,6 +23,8 @@
#include <asm/mmu-book3e.h>
#include <asm/tlb.h>
+#define VCPU_FTR_MMU_V2 0
enum? We don't care about the actual value here.
#define E500_PID_NUM 3
#define E500_TLB_NUM 2
@@ -299,4 +301,18 @@ static inline unsigned int
get_tlbmiss_tid(struct kvm_vcpu *vcpu)
#define get_tlb_sts(gtlbe) (MAS1_TS)
#endif /* !BOOKE_HV */
+static inline bool has_feature(const struct kvm_vcpu *vcpu,
+ unsigned long vcpu_ftr)
+{
+ bool has_ftr;
+ switch (vcpu_ftr) {
+ case VCPU_FTR_MMU_V2:
+ has_ftr = ((vcpu->arch.mmucfg & MMUCFG_MAVN) ==
MMUCFG_MAVN_V2);
+ break;
+ default:
+ has_ftr = false;
+ }
+ return has_ftr;
+}
vcpu_has_feature()
Can simplify by replacing has_ftr with "return true" and "return false".
-Scott
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html