[SPARC64]: Initial sun4v TLB miss handling infrastructure.

Things are a little tricky because, unlike sun4u, we have
to:

1) do a hypervisor trap to do the TLB load.
2) do the TSB lookup calculations by hand

Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David S. Miller
2006-02-06 23:44:37 -08:00
förälder 840aaef8db
incheckning d257d5da39
8 ändrade filer med 349 tillägg och 18 borttagningar

Visa fil

@@ -1050,8 +1050,25 @@ unsigned long __init find_ecache_flush_span(unsigned long size)
static void __init tsb_phys_patch(void)
{
struct tsb_ldquad_phys_patch_entry *pquad;
struct tsb_phys_patch_entry *p;
pquad = &__tsb_ldquad_phys_patch;
while (pquad < &__tsb_ldquad_phys_patch_end) {
unsigned long addr = pquad->addr;
if (tlb_type == hypervisor)
*(unsigned int *) addr = pquad->sun4v_insn;
else
*(unsigned int *) addr = pquad->sun4u_insn;
wmb();
__asm__ __volatile__("flush %0"
: /* no outputs */
: "r" (addr));
pquad++;
}
p = &__tsb_phys_patch;
while (p < &__tsb_phys_patch_end) {
unsigned long addr = p->addr;
@@ -1069,6 +1086,7 @@ static void __init tsb_phys_patch(void)
/* paging_init() sets up the page tables */
extern void cheetah_ecache_flush_init(void);
extern void sun4v_patch_tlb_handlers(void);
static unsigned long last_valid_pfn;
pgd_t swapper_pg_dir[2048];
@@ -1078,9 +1096,13 @@ void __init paging_init(void)
unsigned long end_pfn, pages_avail, shift;
unsigned long real_end, i;
if (tlb_type == cheetah_plus)
if (tlb_type == cheetah_plus ||
tlb_type == hypervisor)
tsb_phys_patch();
if (tlb_type == hypervisor)
sun4v_patch_tlb_handlers();
/* Find available physical memory... */
read_obp_memory("available", &pavail[0], &pavail_ents);