Commit ec1cc55d authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'powerpc-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
 - Wire up copy_file_range() syscall from Chandan Rajendra
 - Simplify module TOC handling from Alan Modra
 - Remove newly added extra definition of pmd_dirty from Stephen Rothwell
 - Allow user space to map rtas_rmo_buf from Vasant Hegde
 - Fix PE location code from Gavin Shan
 - Remove PPMU_HAS_SSLOT flag for Power8 from Madhavan Srinivasan
 - Fixup _HPAGE_CHG_MASK from Aneesh Kumar K.V

* tag 'powerpc-4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/mm: Fixup _HPAGE_CHG_MASK
  powerpc/perf: Remove PPMU_HAS_SSLOT flag for Power8
  powerpc/eeh: Fix PE location code
  powerpc/mm: Allow user space to map rtas_rmo_buf
  powerpc: Remove newly added extra definition of pmd_dirty
  powerpc: Simplify module TOC handling
  powerpc: Wire up copy_file_range() syscall
parents 6b292a8a 2d19fc63
...@@ -50,7 +50,9 @@ ...@@ -50,7 +50,9 @@
* set of bits not changed in pmd_modify. * set of bits not changed in pmd_modify.
*/ */
#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \ #define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
_PAGE_ACCESSED | _PAGE_THP_HUGE) _PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE | \
_PAGE_SOFT_DIRTY)
#ifdef CONFIG_PPC_64K_PAGES #ifdef CONFIG_PPC_64K_PAGES
#include <asm/book3s/64/hash-64k.h> #include <asm/book3s/64/hash-64k.h>
......
...@@ -223,7 +223,6 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd) ...@@ -223,7 +223,6 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd)
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd)) #define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd))
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd)) #define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
#define pmd_young(pmd) pte_young(pmd_pte(pmd)) #define pmd_young(pmd) pte_young(pmd_pte(pmd))
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
#define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd))) #define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd)))
#define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd))) #define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd)))
#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd))) #define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd)))
......
...@@ -383,3 +383,4 @@ SYSCALL(ni_syscall) ...@@ -383,3 +383,4 @@ SYSCALL(ni_syscall)
SYSCALL(ni_syscall) SYSCALL(ni_syscall)
SYSCALL(ni_syscall) SYSCALL(ni_syscall)
SYSCALL(mlock2) SYSCALL(mlock2)
SYSCALL(copy_file_range)
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define NR_syscalls 379 #define NR_syscalls 380
#define __NR__exit __NR_exit #define __NR__exit __NR_exit
......
...@@ -389,5 +389,6 @@ ...@@ -389,5 +389,6 @@
#define __NR_userfaultfd 364 #define __NR_userfaultfd 364
#define __NR_membarrier 365 #define __NR_membarrier 365
#define __NR_mlock2 378 #define __NR_mlock2 378
#define __NR_copy_file_range 379
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
...@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe) ...@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)
const char *eeh_pe_loc_get(struct eeh_pe *pe) const char *eeh_pe_loc_get(struct eeh_pe *pe)
{ {
struct pci_bus *bus = eeh_pe_bus_get(pe); struct pci_bus *bus = eeh_pe_bus_get(pe);
struct device_node *dn = pci_bus_to_OF_node(bus); struct device_node *dn;
const char *loc = NULL; const char *loc = NULL;
if (!dn) while (bus) {
goto out; dn = pci_bus_to_OF_node(bus);
if (!dn) {
bus = bus->parent;
continue;
}
/* PHB PE or root PE ? */ if (pci_is_root_bus(bus))
if (pci_is_root_bus(bus)) {
loc = of_get_property(dn, "ibm,loc-code", NULL);
if (!loc)
loc = of_get_property(dn, "ibm,io-base-loc-code", NULL); loc = of_get_property(dn, "ibm,io-base-loc-code", NULL);
else
loc = of_get_property(dn, "ibm,slot-location-code",
NULL);
if (loc) if (loc)
goto out; return loc;
/* Check the root port */ bus = bus->parent;
dn = dn->child;
if (!dn)
goto out;
} }
loc = of_get_property(dn, "ibm,loc-code", NULL); return "N/A";
if (!loc)
loc = of_get_property(dn, "ibm,slot-location-code", NULL);
out:
return loc ? loc : "N/A";
} }
/** /**
......
...@@ -701,31 +701,3 @@ _GLOBAL(kexec_sequence) ...@@ -701,31 +701,3 @@ _GLOBAL(kexec_sequence)
li r5,0 li r5,0
blr /* image->start(physid, image->start, 0); */ blr /* image->start(physid, image->start, 0); */
#endif /* CONFIG_KEXEC */ #endif /* CONFIG_KEXEC */
#ifdef CONFIG_MODULES
#if defined(_CALL_ELF) && _CALL_ELF == 2
#ifdef CONFIG_MODVERSIONS
.weak __crc_TOC.
.section "___kcrctab+TOC.","a"
.globl __kcrctab_TOC.
__kcrctab_TOC.:
.llong __crc_TOC.
#endif
/*
* Export a fake .TOC. since both modpost and depmod will complain otherwise.
* Both modpost and depmod strip the leading . so we do the same here.
*/
.section "__ksymtab_strings","a"
__kstrtab_TOC.:
.asciz "TOC."
.section "___ksymtab+TOC.","a"
/* This symbol name is important: it's used by modpost to find exported syms */
.globl __ksymtab_TOC.
__ksymtab_TOC.:
.llong 0 /* .value */
.llong __kstrtab_TOC.
#endif /* ELFv2 */
#endif /* MODULES */
...@@ -326,7 +326,10 @@ static void dedotify_versions(struct modversion_info *vers, ...@@ -326,7 +326,10 @@ static void dedotify_versions(struct modversion_info *vers,
} }
} }
/* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */ /*
* Undefined symbols which refer to .funcname, hack to funcname. Make .TOC.
* seem to be defined (value set later).
*/
static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab) static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
{ {
unsigned int i; unsigned int i;
...@@ -334,8 +337,11 @@ static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab) ...@@ -334,8 +337,11 @@ static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
for (i = 1; i < numsyms; i++) { for (i = 1; i < numsyms; i++) {
if (syms[i].st_shndx == SHN_UNDEF) { if (syms[i].st_shndx == SHN_UNDEF) {
char *name = strtab + syms[i].st_name; char *name = strtab + syms[i].st_name;
if (name[0] == '.') if (name[0] == '.') {
if (strcmp(name+1, "TOC.") == 0)
syms[i].st_shndx = SHN_ABS;
memmove(name, name+1, strlen(name)); memmove(name, name+1, strlen(name));
}
} }
} }
} }
...@@ -351,7 +357,7 @@ static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs, ...@@ -351,7 +357,7 @@ static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs,
numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym); numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym);
for (i = 1; i < numsyms; i++) { for (i = 1; i < numsyms; i++) {
if (syms[i].st_shndx == SHN_UNDEF if (syms[i].st_shndx == SHN_ABS
&& strcmp(strtab + syms[i].st_name, "TOC.") == 0) && strcmp(strtab + syms[i].st_name, "TOC.") == 0)
return &syms[i]; return &syms[i];
} }
......
...@@ -560,12 +560,12 @@ subsys_initcall(add_system_ram_resources); ...@@ -560,12 +560,12 @@ subsys_initcall(add_system_ram_resources);
*/ */
int devmem_is_allowed(unsigned long pfn) int devmem_is_allowed(unsigned long pfn)
{ {
if (page_is_rtas_user_buf(pfn))
return 1;
if (iomem_is_exclusive(PFN_PHYS(pfn))) if (iomem_is_exclusive(PFN_PHYS(pfn)))
return 0; return 0;
if (!page_is_ram(pfn)) if (!page_is_ram(pfn))
return 1; return 1;
if (page_is_rtas_user_buf(pfn))
return 1;
return 0; return 0;
} }
#endif /* CONFIG_STRICT_DEVMEM */ #endif /* CONFIG_STRICT_DEVMEM */
...@@ -816,7 +816,7 @@ static struct power_pmu power8_pmu = { ...@@ -816,7 +816,7 @@ static struct power_pmu power8_pmu = {
.get_constraint = power8_get_constraint, .get_constraint = power8_get_constraint,
.get_alternatives = power8_get_alternatives, .get_alternatives = power8_get_alternatives,
.disable_pmc = power8_disable_pmc, .disable_pmc = power8_disable_pmc,
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S, .flags = PPMU_HAS_SIER | PPMU_ARCH_207S,
.n_generic = ARRAY_SIZE(power8_generic_events), .n_generic = ARRAY_SIZE(power8_generic_events),
.generic_events = power8_generic_events, .generic_events = power8_generic_events,
.cache_events = &power8_cache_events, .cache_events = &power8_cache_events,
......
...@@ -594,7 +594,8 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname) ...@@ -594,7 +594,8 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 || if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 ||
strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0 || strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0 ||
strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 || strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 ||
strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0) strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0 ||
strcmp(symname, ".TOC.") == 0)
return 1; return 1;
/* Do not ignore this symbol */ /* Do not ignore this symbol */
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment