upgrade to fedora-2.6.12-1.1398.FC4 + vserver 2.0.rc7
[linux-2.6.git] / arch / ppc64 / kernel / pSeries_lpar.c
index 21e8a27..6534812 100644 (file)
@@ -33,7 +33,6 @@
 #include <asm/mmu_context.h>
 #include <asm/ppcdebug.h>
 #include <asm/iommu.h>
-#include <asm/naca.h>
 #include <asm/tlbflush.h>
 #include <asm/tlb.h>
 #include <asm/prom.h>
@@ -336,7 +335,7 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
        return (slot & 7) | (secondary << 3);
 }
 
-static spinlock_t pSeries_lpar_tlbie_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(pSeries_lpar_tlbie_lock);
 
 static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
 {
@@ -368,7 +367,7 @@ static long pSeries_lpar_hpte_remove(unsigned long hpte_group)
 
 static void pSeries_lpar_hptab_clear(void)
 {
-       unsigned long size_bytes = 1UL << naca->pftSize;
+       unsigned long size_bytes = 1UL << ppc64_pft_size;
        unsigned long hpte_count = size_bytes >> 4;
        unsigned long dummy1, dummy2;
        int i;
@@ -437,7 +436,7 @@ static long pSeries_lpar_hpte_find(unsigned long vpn)
        hash = hpt_hash(vpn, 0);
 
        for (j = 0; j < 2; j++) {
-               slot = (hash & htab_data.htab_hash_mask) * HPTES_PER_GROUP;
+               slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
                for (i = 0; i < HPTES_PER_GROUP; i++) {
                        hpte_dw0.dword0 = pSeries_lpar_hpte_getword0(slot);
                        dw0 = hpte_dw0.dw0;
@@ -471,7 +470,7 @@ static void pSeries_lpar_hpte_updateboltedpp(unsigned long newpp,
        slot = pSeries_lpar_hpte_find(vpn);
        BUG_ON(slot == -1);
 
-       flags = newpp & 3;
+       flags = newpp & 7;
        lpar_rc = plpar_pte_protect(flags, slot, 0);
 
        BUG_ON(lpar_rc != H_Success);
@@ -504,9 +503,9 @@ void pSeries_lpar_flush_hash_range(unsigned long context, unsigned long number,
                                   int local)
 {
        int i;
-       unsigned long flags;
+       unsigned long flags = 0;
        struct ppc64_tlb_batch *batch = &__get_cpu_var(ppc64_tlb_batch);
-       int lock_tlbie = !(cur_cpu_spec->cpu_features & CPU_FTR_LOCKLESS_TLBIE);
+       int lock_tlbie = !cpu_has_feature(CPU_FTR_LOCKLESS_TLBIE);
 
        if (lock_tlbie)
                spin_lock_irqsave(&pSeries_lpar_tlbie_lock, flags);