Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
CONFIG_LOG_BUF_SHIFT=14
|
||||
@@ -23,7 +22,6 @@ CONFIG_IP_PNP_DHCP=y
|
||||
CONFIG_INET_AH=y
|
||||
CONFIG_INET_ESP=y
|
||||
CONFIG_INET_IPCOMP=y
|
||||
# CONFIG_INET_LRO is not set
|
||||
CONFIG_INET6_AH=m
|
||||
CONFIG_INET6_ESP=m
|
||||
CONFIG_INET6_IPCOMP=m
|
||||
@@ -69,7 +67,6 @@ CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT2_FS_XATTR=y
|
||||
CONFIG_EXT2_FS_POSIX_ACL=y
|
||||
CONFIG_EXT2_FS_SECURITY=y
|
||||
CONFIG_AUTOFS_FS=m
|
||||
CONFIG_AUTOFS4_FS=m
|
||||
CONFIG_ISO9660_FS=m
|
||||
CONFIG_PROC_KCORE=y
|
||||
@@ -82,7 +79,6 @@ CONFIG_NLS=y
|
||||
CONFIG_DEBUG_KERNEL=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_SCHED_DEBUG is not set
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
CONFIG_KGDB=y
|
||||
CONFIG_KGDB_TESTS=y
|
||||
CONFIG_CRYPTO_NULL=m
|
||||
|
@@ -1,5 +1,4 @@
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_EXPERIMENTAL=y
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_POSIX_MQUEUE=y
|
||||
@@ -184,7 +183,6 @@ CONFIG_HID_TOPSEED=y
|
||||
CONFIG_HID_THRUSTMASTER=y
|
||||
CONFIG_HID_ZEROPLUS=y
|
||||
CONFIG_USB=y
|
||||
# CONFIG_USB_DEVICE_CLASS is not set
|
||||
CONFIG_USB_EHCI_HCD=m
|
||||
# CONFIG_USB_EHCI_TT_NEWSCHED is not set
|
||||
CONFIG_USB_OHCI_HCD=y
|
||||
@@ -210,8 +208,6 @@ CONFIG_LOCKUP_DETECTOR=y
|
||||
CONFIG_DETECT_HUNG_TASK=y
|
||||
# CONFIG_SCHED_DEBUG is not set
|
||||
CONFIG_SCHEDSTATS=y
|
||||
# CONFIG_RCU_CPU_STALL_DETECTOR is not set
|
||||
CONFIG_SYSCTL_SYSCALL_CHECK=y
|
||||
CONFIG_BLK_DEV_IO_TRACE=y
|
||||
CONFIG_UPROBE_EVENTS=y
|
||||
CONFIG_KEYS=y
|
||||
|
@@ -27,9 +27,11 @@ void destroy_context(struct mm_struct *mm);
|
||||
void __tsb_context_switch(unsigned long pgd_pa,
|
||||
struct tsb_config *tsb_base,
|
||||
struct tsb_config *tsb_huge,
|
||||
unsigned long tsb_descr_pa);
|
||||
unsigned long tsb_descr_pa,
|
||||
unsigned long secondary_ctx);
|
||||
|
||||
static inline void tsb_context_switch(struct mm_struct *mm)
|
||||
static inline void tsb_context_switch_ctx(struct mm_struct *mm,
|
||||
unsigned long ctx)
|
||||
{
|
||||
__tsb_context_switch(__pa(mm->pgd),
|
||||
&mm->context.tsb_block[MM_TSB_BASE],
|
||||
@@ -40,9 +42,12 @@ static inline void tsb_context_switch(struct mm_struct *mm)
|
||||
#else
|
||||
NULL
|
||||
#endif
|
||||
, __pa(&mm->context.tsb_descr[MM_TSB_BASE]));
|
||||
, __pa(&mm->context.tsb_descr[MM_TSB_BASE]),
|
||||
ctx);
|
||||
}
|
||||
|
||||
#define tsb_context_switch(X) tsb_context_switch_ctx(X, 0)
|
||||
|
||||
void tsb_grow(struct mm_struct *mm,
|
||||
unsigned long tsb_index,
|
||||
unsigned long mm_rss);
|
||||
@@ -112,8 +117,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str
|
||||
* cpu0 to update it's TSB because at that point the cpu_vm_mask
|
||||
* only had cpu1 set in it.
|
||||
*/
|
||||
load_secondary_context(mm);
|
||||
tsb_context_switch(mm);
|
||||
tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context));
|
||||
|
||||
/* Any time a processor runs a context on an address space
|
||||
* for the first time, we must flush that context out of the
|
||||
|
@@ -47,10 +47,26 @@
|
||||
#define SUN4V_CHIP_NIAGARA5 0x05
|
||||
#define SUN4V_CHIP_SPARC_M6 0x06
|
||||
#define SUN4V_CHIP_SPARC_M7 0x07
|
||||
#define SUN4V_CHIP_SPARC_M8 0x08
|
||||
#define SUN4V_CHIP_SPARC64X 0x8a
|
||||
#define SUN4V_CHIP_SPARC_SN 0x8b
|
||||
#define SUN4V_CHIP_UNKNOWN 0xff
|
||||
|
||||
/*
|
||||
* The following CPU_ID_xxx constants are used
|
||||
* to identify the CPU type in the setup phase
|
||||
* (see head_64.S)
|
||||
*/
|
||||
#define CPU_ID_NIAGARA1 ('1')
|
||||
#define CPU_ID_NIAGARA2 ('2')
|
||||
#define CPU_ID_NIAGARA3 ('3')
|
||||
#define CPU_ID_NIAGARA4 ('4')
|
||||
#define CPU_ID_NIAGARA5 ('5')
|
||||
#define CPU_ID_M6 ('6')
|
||||
#define CPU_ID_M7 ('7')
|
||||
#define CPU_ID_M8 ('8')
|
||||
#define CPU_ID_SONOMA1 ('N')
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
enum ultra_tlb_layout {
|
||||
|
@@ -88,7 +88,7 @@
|
||||
#define TIOCGPTN _IOR('t', 134, unsigned int) /* Get Pty Number */
|
||||
#define TIOCSPTLCK _IOW('t', 135, int) /* Lock/unlock PTY */
|
||||
#define TIOCSIG _IOW('t', 136, int) /* Generate signal on Pty slave */
|
||||
#define TIOCGPTPEER _IOR('t', 137, int) /* Safely open the slave */
|
||||
#define TIOCGPTPEER _IO('t', 137) /* Safely open the slave */
|
||||
|
||||
/* Little f */
|
||||
#define FIOCLEX _IO('f', 1)
|
||||
|
@@ -506,6 +506,12 @@ static void __init sun4v_cpu_probe(void)
|
||||
sparc_pmu_type = "sparc-m7";
|
||||
break;
|
||||
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
sparc_cpu_type = "SPARC-M8";
|
||||
sparc_fpu_type = "SPARC-M8 integrated FPU";
|
||||
sparc_pmu_type = "sparc-m8";
|
||||
break;
|
||||
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
sparc_cpu_type = "SPARC-SN";
|
||||
sparc_fpu_type = "SPARC-SN integrated FPU";
|
||||
|
@@ -328,6 +328,7 @@ static int iterate_cpu(struct cpuinfo_tree *t, unsigned int root_index)
|
||||
case SUN4V_CHIP_NIAGARA5:
|
||||
case SUN4V_CHIP_SPARC_M6:
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
case SUN4V_CHIP_SPARC64X:
|
||||
rover_inc_table = niagara_iterate_method;
|
||||
|
@@ -424,22 +424,25 @@ EXPORT_SYMBOL(sun4v_chip_type)
|
||||
nop
|
||||
|
||||
70: ldub [%g1 + 7], %g2
|
||||
cmp %g2, '3'
|
||||
cmp %g2, CPU_ID_NIAGARA3
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA3, %g4
|
||||
cmp %g2, '4'
|
||||
cmp %g2, CPU_ID_NIAGARA4
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA4, %g4
|
||||
cmp %g2, '5'
|
||||
cmp %g2, CPU_ID_NIAGARA5
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA5, %g4
|
||||
cmp %g2, '6'
|
||||
cmp %g2, CPU_ID_M6
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M6, %g4
|
||||
cmp %g2, '7'
|
||||
cmp %g2, CPU_ID_M7
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M7, %g4
|
||||
cmp %g2, 'N'
|
||||
cmp %g2, CPU_ID_M8
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_M8, %g4
|
||||
cmp %g2, CPU_ID_SONOMA1
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_SPARC_SN, %g4
|
||||
ba,pt %xcc, 49f
|
||||
@@ -448,10 +451,10 @@ EXPORT_SYMBOL(sun4v_chip_type)
|
||||
91: sethi %hi(prom_cpu_compatible), %g1
|
||||
or %g1, %lo(prom_cpu_compatible), %g1
|
||||
ldub [%g1 + 17], %g2
|
||||
cmp %g2, '1'
|
||||
cmp %g2, CPU_ID_NIAGARA1
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA1, %g4
|
||||
cmp %g2, '2'
|
||||
cmp %g2, CPU_ID_NIAGARA2
|
||||
be,pt %xcc, 5f
|
||||
mov SUN4V_CHIP_NIAGARA2, %g4
|
||||
|
||||
@@ -600,6 +603,9 @@ niagara_tlb_fixup:
|
||||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_M7
|
||||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_M8
|
||||
be,pt %xcc, niagara4_patch
|
||||
nop
|
||||
cmp %g1, SUN4V_CHIP_SPARC_SN
|
||||
|
@@ -288,10 +288,17 @@ static void __init sun4v_patch(void)
|
||||
|
||||
sun4v_patch_2insn_range(&__sun4v_2insn_patch,
|
||||
&__sun4v_2insn_patch_end);
|
||||
if (sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN)
|
||||
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
sun_m7_patch_2insn_range(&__sun_m7_2insn_patch,
|
||||
&__sun_m7_2insn_patch_end);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
sun4v_hvapi_init();
|
||||
}
|
||||
@@ -530,6 +537,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
||||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= HWCAP_SPARC_BLKINIT;
|
||||
@@ -539,6 +547,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
||||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= HWCAP_SPARC_N2;
|
||||
@@ -569,6 +578,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
||||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= (AV_SPARC_VIS | AV_SPARC_VIS2 |
|
||||
@@ -579,6 +589,7 @@ static void __init init_sparc64_elf_hwcap(void)
|
||||
sun4v_chip_type == SUN4V_CHIP_NIAGARA5 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M6 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M7 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_M8 ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC_SN ||
|
||||
sun4v_chip_type == SUN4V_CHIP_SPARC64X)
|
||||
cap |= (AV_SPARC_VIS3 | AV_SPARC_HPC |
|
||||
|
@@ -360,6 +360,7 @@ tsb_flush:
|
||||
* %o1: TSB base config pointer
|
||||
* %o2: TSB huge config pointer, or NULL if none
|
||||
* %o3: Hypervisor TSB descriptor physical address
|
||||
* %o4: Secondary context to load, if non-zero
|
||||
*
|
||||
* We have to run this whole thing with interrupts
|
||||
* disabled so that the current cpu doesn't change
|
||||
@@ -372,6 +373,17 @@ __tsb_context_switch:
|
||||
rdpr %pstate, %g1
|
||||
wrpr %g1, PSTATE_IE, %pstate
|
||||
|
||||
brz,pn %o4, 1f
|
||||
mov SECONDARY_CONTEXT, %o5
|
||||
|
||||
661: stxa %o4, [%o5] ASI_DMMU
|
||||
.section .sun4v_1insn_patch, "ax"
|
||||
.word 661b
|
||||
stxa %o4, [%o5] ASI_MMU
|
||||
.previous
|
||||
flush %g6
|
||||
|
||||
1:
|
||||
TRAP_LOAD_TRAP_BLOCK(%g2, %g3)
|
||||
|
||||
stx %o0, [%g2 + TRAP_PER_CPU_PGD_PADDR]
|
||||
|
@@ -145,13 +145,13 @@ ENDPROC(U3_retl_o2_plus_GS_plus_0x08)
|
||||
ENTRY(U3_retl_o2_and_7_plus_GS)
|
||||
and %o2, 7, %o2
|
||||
retl
|
||||
add %o2, GLOBAL_SPARE, %o2
|
||||
add %o2, GLOBAL_SPARE, %o0
|
||||
ENDPROC(U3_retl_o2_and_7_plus_GS)
|
||||
ENTRY(U3_retl_o2_and_7_plus_GS_plus_8)
|
||||
add GLOBAL_SPARE, 8, GLOBAL_SPARE
|
||||
and %o2, 7, %o2
|
||||
retl
|
||||
add %o2, GLOBAL_SPARE, %o2
|
||||
add %o2, GLOBAL_SPARE, %o0
|
||||
ENDPROC(U3_retl_o2_and_7_plus_GS_plus_8)
|
||||
#endif
|
||||
|
||||
|
@@ -325,6 +325,29 @@ static void __update_mmu_tsb_insert(struct mm_struct *mm, unsigned long tsb_inde
|
||||
}
|
||||
|
||||
#ifdef CONFIG_HUGETLB_PAGE
|
||||
static void __init add_huge_page_size(unsigned long size)
|
||||
{
|
||||
unsigned int order;
|
||||
|
||||
if (size_to_hstate(size))
|
||||
return;
|
||||
|
||||
order = ilog2(size) - PAGE_SHIFT;
|
||||
hugetlb_add_hstate(order);
|
||||
}
|
||||
|
||||
static int __init hugetlbpage_init(void)
|
||||
{
|
||||
add_huge_page_size(1UL << HPAGE_64K_SHIFT);
|
||||
add_huge_page_size(1UL << HPAGE_SHIFT);
|
||||
add_huge_page_size(1UL << HPAGE_256MB_SHIFT);
|
||||
add_huge_page_size(1UL << HPAGE_2GB_SHIFT);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
arch_initcall(hugetlbpage_init);
|
||||
|
||||
static int __init setup_hugepagesz(char *string)
|
||||
{
|
||||
unsigned long long hugepage_size;
|
||||
@@ -364,7 +387,7 @@ static int __init setup_hugepagesz(char *string)
|
||||
goto out;
|
||||
}
|
||||
|
||||
hugetlb_add_hstate(hugepage_shift - PAGE_SHIFT);
|
||||
add_huge_page_size(hugepage_size);
|
||||
rc = 1;
|
||||
|
||||
out:
|
||||
@@ -1921,12 +1944,22 @@ static void __init setup_page_offset(void)
|
||||
break;
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
default:
|
||||
/* M7 and later support 52-bit virtual addresses. */
|
||||
sparc64_va_hole_top = 0xfff8000000000000UL;
|
||||
sparc64_va_hole_bottom = 0x0008000000000000UL;
|
||||
max_phys_bits = 49;
|
||||
break;
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
default:
|
||||
/* M8 and later support 54-bit virtual addresses.
|
||||
* However, restricting M8 and above VA bits to 53
|
||||
* as 4-level page table cannot support more than
|
||||
* 53 VA bits.
|
||||
*/
|
||||
sparc64_va_hole_top = 0xfff0000000000000UL;
|
||||
sparc64_va_hole_bottom = 0x0010000000000000UL;
|
||||
max_phys_bits = 51;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2138,6 +2171,7 @@ static void __init sun4v_linear_pte_xor_finalize(void)
|
||||
*/
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
pagecv_flag = 0x00;
|
||||
break;
|
||||
@@ -2290,6 +2324,7 @@ void __init paging_init(void)
|
||||
*/
|
||||
switch (sun4v_chip_type) {
|
||||
case SUN4V_CHIP_SPARC_M7:
|
||||
case SUN4V_CHIP_SPARC_M8:
|
||||
case SUN4V_CHIP_SPARC_SN:
|
||||
page_cache4v_flag = _PAGE_CP_4V;
|
||||
break;
|
||||
|
@@ -35,6 +35,5 @@ void restore_processor_state(void)
|
||||
{
|
||||
struct mm_struct *mm = current->active_mm;
|
||||
|
||||
load_secondary_context(mm);
|
||||
tsb_context_switch(mm);
|
||||
tsb_context_switch_ctx(mm, CTX_HWBITS(mm->context));
|
||||
}
|
||||
|
Reference in New Issue
Block a user