Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14991
b: refs/heads/master
c: 8d1ca69
h: refs/heads/master
i:
  14989: 80682b8
  14987: de4002b
  14983: 057316b
  14975: fb6151e
v: v3
  • Loading branch information
Pablo Neira Ayuso authored and David S. Miller committed Dec 5, 2005
1 parent 2e8d621 commit ec9790f
Show file tree
Hide file tree
Showing 18 changed files with 111 additions and 153 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe3f2053fd42148b3ebb7b90de5f20eaf3393860
refs/heads/master: 8d1ca69984ed1e5930c0537b8f606c54007d7319
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ config SMP
If you don't know what to do here, say N.

config NR_CPUS
int "Maximum number of CPUs (2-128)"
int "Maximum number of CPUs (2-32)"
range 2 128
depends on SMP
default "32" if PPC64
Expand Down
10 changes: 1 addition & 9 deletions trunk/arch/powerpc/kernel/setup_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,7 @@ int boot_cpuid_phys = 0;
dev_t boot_dev;
u64 ppc64_pft_size;

/* Pick defaults since we might want to patch instructions
* before we've read this from the device tree.
*/
struct ppc64_caches ppc64_caches = {
.dline_size = 0x80,
.log_dline_size = 7,
.iline_size = 0x80,
.log_iline_size = 7
};
struct ppc64_caches ppc64_caches;
EXPORT_SYMBOL_GPL(ppc64_caches);

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/hash_utils_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
/* Handle hugepage regions */
if (unlikely(in_hugepage_area(mm->context, ea))) {
DBG_LOW(" -> huge page !\n");
return hash_huge_page(mm, access, ea, vsid, local, trap);
return hash_huge_page(mm, access, ea, vsid, local);
}

/* Get PTE and page size from page tables */
Expand Down
95 changes: 18 additions & 77 deletions trunk/arch/powerpc/mm/hugetlbpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,63 +148,43 @@ int is_aligned_hugepage_range(unsigned long addr, unsigned long len)
return 0;
}

struct slb_flush_info {
struct mm_struct *mm;
u16 newareas;
};

static void flush_low_segments(void *parm)
{
struct slb_flush_info *fi = parm;
u16 areas = (unsigned long) parm;
unsigned long i;

BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_LOW_AREAS);

if (current->active_mm != fi->mm)
return;

/* Only need to do anything if this CPU is working in the same
* mm as the one which has changed */
asm volatile("isync" : : : "memory");

/* update the paca copy of the context struct */
get_paca()->context = current->active_mm->context;
BUILD_BUG_ON((sizeof(areas)*8) != NUM_LOW_AREAS);

asm volatile("isync" : : : "memory");
for (i = 0; i < NUM_LOW_AREAS; i++) {
if (! (fi->newareas & (1U << i)))
if (! (areas & (1U << i)))
continue;
asm volatile("slbie %0"
: : "r" ((i << SID_SHIFT) | SLBIE_C));
}

asm volatile("isync" : : : "memory");
}

static void flush_high_segments(void *parm)
{
struct slb_flush_info *fi = parm;
u16 areas = (unsigned long) parm;
unsigned long i, j;

asm volatile("isync" : : : "memory");

BUILD_BUG_ON((sizeof(fi->newareas)*8) != NUM_HIGH_AREAS);

if (current->active_mm != fi->mm)
return;

/* Only need to do anything if this CPU is working in the same
* mm as the one which has changed */

/* update the paca copy of the context struct */
get_paca()->context = current->active_mm->context;
BUILD_BUG_ON((sizeof(areas)*8) != NUM_HIGH_AREAS);

asm volatile("isync" : : : "memory");
for (i = 0; i < NUM_HIGH_AREAS; i++) {
if (! (fi->newareas & (1U << i)))
if (! (areas & (1U << i)))
continue;
for (j = 0; j < (1UL << (HTLB_AREA_SHIFT-SID_SHIFT)); j++)
asm volatile("slbie %0"
:: "r" (((i << HTLB_AREA_SHIFT)
+ (j << SID_SHIFT)) | SLBIE_C));
+ (j << SID_SHIFT)) | SLBIE_C));
}

asm volatile("isync" : : : "memory");
}

Expand Down Expand Up @@ -249,7 +229,6 @@ static int prepare_high_area_for_htlb(struct mm_struct *mm, unsigned long area)
static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)
{
unsigned long i;
struct slb_flush_info fi;

BUILD_BUG_ON((sizeof(newareas)*8) != NUM_LOW_AREAS);
BUILD_BUG_ON((sizeof(mm->context.low_htlb_areas)*8) != NUM_LOW_AREAS);
Expand All @@ -265,20 +244,19 @@ static int open_low_hpage_areas(struct mm_struct *mm, u16 newareas)

mm->context.low_htlb_areas |= newareas;

/* update the paca copy of the context struct */
get_paca()->context = mm->context;

/* the context change must make it to memory before the flush,
* so that further SLB misses do the right thing. */
mb();

fi.mm = mm;
fi.newareas = newareas;
on_each_cpu(flush_low_segments, &fi, 0, 1);
on_each_cpu(flush_low_segments, (void *)(unsigned long)newareas, 0, 1);

return 0;
}

static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
{
struct slb_flush_info fi;
unsigned long i;

BUILD_BUG_ON((sizeof(newareas)*8) != NUM_HIGH_AREAS);
Expand All @@ -302,10 +280,7 @@ static int open_high_hpage_areas(struct mm_struct *mm, u16 newareas)
/* the context change must make it to memory before the flush,
* so that further SLB misses do the right thing. */
mb();

fi.mm = mm;
fi.newareas = newareas;
on_each_cpu(flush_high_segments, &fi, 0, 1);
on_each_cpu(flush_high_segments, (void *)(unsigned long)newareas, 0, 1);

return 0;
}
Expand Down Expand Up @@ -664,36 +639,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
return -ENOMEM;
}

/*
* Called by asm hashtable.S for doing lazy icache flush
*/
static unsigned int hash_huge_page_do_lazy_icache(unsigned long rflags,
pte_t pte, int trap)
{
struct page *page;
int i;

if (!pfn_valid(pte_pfn(pte)))
return rflags;

page = pte_page(pte);

/* page is dirty */
if (!test_bit(PG_arch_1, &page->flags) && !PageReserved(page)) {
if (trap == 0x400) {
for (i = 0; i < (HPAGE_SIZE / PAGE_SIZE); i++)
__flush_dcache_icache(page_address(page+i));
set_bit(PG_arch_1, &page->flags);
} else {
rflags |= HPTE_R_N;
}
}
return rflags;
}

int hash_huge_page(struct mm_struct *mm, unsigned long access,
unsigned long ea, unsigned long vsid, int local,
unsigned long trap)
unsigned long ea, unsigned long vsid, int local)
{
pte_t *ptep;
unsigned long old_pte, new_pte;
Expand Down Expand Up @@ -744,11 +691,6 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
rflags = 0x2 | (!(new_pte & _PAGE_RW));
/* _PAGE_EXEC -> HW_NO_EXEC since it's inverted */
rflags |= ((new_pte & _PAGE_EXEC) ? 0 : HPTE_R_N);
if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE))
/* No CPU has hugepages but lacks no execute, so we
* don't need to worry about that case */
rflags = hash_huge_page_do_lazy_icache(rflags, __pte(old_pte),
trap);

/* Check if pte already has an hpte (case 2) */
if (unlikely(old_pte & _PAGE_HASHPTE)) {
Expand All @@ -761,8 +703,7 @@ int hash_huge_page(struct mm_struct *mm, unsigned long access,
slot = (hash & htab_hash_mask) * HPTES_PER_GROUP;
slot += (old_pte & _PAGE_F_GIX) >> 12;

if (ppc_md.hpte_updatepp(slot, rflags, va, mmu_huge_psize,
local) == -1)
if (ppc_md.hpte_updatepp(slot, rflags, va, 1, local) == -1)
old_pte &= ~_PAGE_HPTEFLAGS;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/mm/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void __init get_region(unsigned int nid, unsigned long *start_pfn,

/* We didnt find a matching region, return start/end as 0 */
if (*start_pfn == -1UL)
*start_pfn = 0;
start_pfn = 0;
}

static inline void map_cpu_to_node(int cpu, int node)
Expand Down
7 changes: 6 additions & 1 deletion trunk/arch/powerpc/mm/stab.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ void stab_initialize(unsigned long stab)
return;
}
#endif /* CONFIG_PPC_ISERIES */

#ifdef CONFIG_PPC_PSERIES
if (platform_is_lpar()) {
plpar_hcall_norets(H_SET_ASR, stabreal);
return;
}
#endif
mtspr(SPRN_ASR, stabreal);
}
21 changes: 5 additions & 16 deletions trunk/arch/powerpc/platforms/powermac/feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -1650,19 +1650,11 @@ void pmac_tweak_clock_spreading(int enable)
*/

if (macio->type == macio_intrepid) {
struct device_node *clock =
of_find_node_by_path("/uni-n@f8000000/hw-clock");
if (clock && get_property(clock, "platform-do-clockspreading",
NULL)) {
printk(KERN_INFO "%sabling clock spreading on Intrepid"
" ASIC\n", enable ? "En" : "Dis");
if (enable)
UN_OUT(UNI_N_CLOCK_SPREADING, 2);
else
UN_OUT(UNI_N_CLOCK_SPREADING, 0);
mdelay(40);
}
of_node_put(clock);
if (enable)
UN_OUT(UNI_N_CLOCK_SPREADING, 2);
else
UN_OUT(UNI_N_CLOCK_SPREADING, 0);
mdelay(40);
}

while (machine_is_compatible("PowerBook5,2") ||
Expand Down Expand Up @@ -1732,9 +1724,6 @@ void pmac_tweak_clock_spreading(int enable)
pmac_low_i2c_close(ui2c);
break;
}
printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
enable ? "En" : "Dis");

pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
DBG("write result: %d,", rc);
Expand Down
11 changes: 4 additions & 7 deletions trunk/arch/powerpc/platforms/pseries/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ static void tce_build_pSeriesLP(struct iommu_table *tbl, long tcenum,
u64 rc;
union tce_entry tce;

tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;

tce.te_word = 0;
tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
tce.te_rdwr = 1;
Expand Down Expand Up @@ -146,7 +143,10 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
union tce_entry tce, *tcep;
long l, limit;

if (TCE_PAGE_FACTOR == 0 && npages == 1)
tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;

if (npages == 1)
return tce_build_pSeriesLP(tbl, tcenum, npages, uaddr,
direction);

Expand All @@ -164,9 +164,6 @@ static void tce_buildmulti_pSeriesLP(struct iommu_table *tbl, long tcenum,
__get_cpu_var(tce_page) = tcep;
}

tcenum <<= TCE_PAGE_FACTOR;
npages <<= TCE_PAGE_FACTOR;

tce.te_word = 0;
tce.te_rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT;
tce.te_rdwr = 1;
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/powerpc/platforms/pseries/lpar.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ long pSeries_lpar_hpte_insert(unsigned long hpte_group,
if (!(vflags & HPTE_V_BOLTED))
DBG_LOW(" hpte_v=%016lx, hpte_r=%016lx\n", hpte_v, hpte_r);

#if 1
{
int i;
for (i=0;i<8;i++) {
unsigned long w0, w1;
plpar_pte_read(0, hpte_group, &w0, &w1);
BUG_ON (HPTE_V_COMPARE(hpte_v, w0)
&& (w0 & HPTE_V_VALID));
}
}
#endif

/* Now fill in the actual HPTE */
/* Set CEC cookie to 0 */
/* Zero page = 0 */
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/ppc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -767,14 +767,14 @@ config CPM2
on it (826x, 827x, 8560).

config PPC_CHRP
bool
bool " Common Hardware Reference Platform (CHRP) based machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
default y

config PPC_PMAC
bool
bool " Apple PowerMac based machines"
depends on PPC_MULTIPLATFORM
select PPC_INDIRECT_PCI
default y
Expand All @@ -785,7 +785,7 @@ config PPC_PMAC64
default y

config PPC_PREP
bool
bool " PowerPC Reference Platform (PReP) based machines"
depends on PPC_MULTIPLATFORM
select PPC_I8259
select PPC_INDIRECT_PCI
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/ppc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,6 @@ void __init smp_prepare_cpus(unsigned int max_cpus)

/* Probe platform for CPUs: always linear. */
num_cpus = smp_ops->probe();

if (num_cpus < 2)
smp_tb_synchronized = 1;

for (i = 0; i < num_cpus; ++i)
cpu_set(i, cpu_possible_map);

Expand Down
20 changes: 5 additions & 15 deletions trunk/arch/ppc/platforms/pmac_feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -1606,19 +1606,11 @@ void pmac_tweak_clock_spreading(int enable)
*/

if (macio->type == macio_intrepid) {
struct device_node *clock =
of_find_node_by_path("/uni-n@f8000000/hw-clock");
if (clock && get_property(clock, "platform-do-clockspreading",
NULL)) {
printk(KERN_INFO "%sabling clock spreading on Intrepid"
" ASIC\n", enable ? "En" : "Dis");
if (enable)
UN_OUT(UNI_N_CLOCK_SPREADING, 2);
else
UN_OUT(UNI_N_CLOCK_SPREADING, 0);
mdelay(40);
}
of_node_put(clock);
if (enable)
UN_OUT(UNI_N_CLOCK_SPREADING, 2);
else
UN_OUT(UNI_N_CLOCK_SPREADING, 0);
mdelay(40);
}

while (machine_is_compatible("PowerBook5,2") ||
Expand Down Expand Up @@ -1688,8 +1680,6 @@ void pmac_tweak_clock_spreading(int enable)
pmac_low_i2c_close(ui2c);
break;
}
printk(KERN_INFO "%sabling clock spreading on i2c clock chip\n",
enable ? "En" : "Dis");
pmac_low_i2c_setmode(ui2c, pmac_low_i2c_mode_stdsub);
rc = pmac_low_i2c_xfer(ui2c, 0xd2 | pmac_low_i2c_write, 0x80, buffer, 9);
DBG("write result: %d,", rc);
Expand Down
Loading

0 comments on commit ec9790f

Please sign in to comment.