Skip to content

Commit ec1cc55

Browse files
committed
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
2 parents 6b292a8 + 2d19fc6 commit ec1cc55

File tree

11 files changed

+35
-56
lines changed

11 files changed

+35
-56
lines changed

arch/powerpc/include/asm/book3s/64/hash.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
* set of bits not changed in pmd_modify.
5151
*/
5252
#define _HPAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HPTEFLAGS | _PAGE_DIRTY | \
53-
_PAGE_ACCESSED | _PAGE_THP_HUGE)
53+
_PAGE_ACCESSED | _PAGE_THP_HUGE | _PAGE_PTE | \
54+
_PAGE_SOFT_DIRTY)
55+
5456

5557
#ifdef CONFIG_PPC_64K_PAGES
5658
#include <asm/book3s/64/hash-64k.h>

arch/powerpc/include/asm/book3s/64/pgtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ static inline pte_t *pmdp_ptep(pmd_t *pmd)
223223
#define pmd_pfn(pmd) pte_pfn(pmd_pte(pmd))
224224
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
225225
#define pmd_young(pmd) pte_young(pmd_pte(pmd))
226-
#define pmd_dirty(pmd) pte_dirty(pmd_pte(pmd))
227226
#define pmd_mkold(pmd) pte_pmd(pte_mkold(pmd_pte(pmd)))
228227
#define pmd_wrprotect(pmd) pte_pmd(pte_wrprotect(pmd_pte(pmd)))
229228
#define pmd_mkdirty(pmd) pte_pmd(pte_mkdirty(pmd_pte(pmd)))

arch/powerpc/include/asm/systbl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,3 +383,4 @@ SYSCALL(ni_syscall)
383383
SYSCALL(ni_syscall)
384384
SYSCALL(ni_syscall)
385385
SYSCALL(mlock2)
386+
SYSCALL(copy_file_range)

arch/powerpc/include/asm/unistd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <uapi/asm/unistd.h>
1313

1414

15-
#define NR_syscalls 379
15+
#define NR_syscalls 380
1616

1717
#define __NR__exit __NR_exit
1818

arch/powerpc/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,5 +389,6 @@
389389
#define __NR_userfaultfd 364
390390
#define __NR_membarrier 365
391391
#define __NR_mlock2 378
392+
#define __NR_copy_file_range 379
392393

393394
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */

arch/powerpc/kernel/eeh_pe.c

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -883,32 +883,29 @@ void eeh_pe_restore_bars(struct eeh_pe *pe)
883883
const char *eeh_pe_loc_get(struct eeh_pe *pe)
884884
{
885885
struct pci_bus *bus = eeh_pe_bus_get(pe);
886-
struct device_node *dn = pci_bus_to_OF_node(bus);
886+
struct device_node *dn;
887887
const char *loc = NULL;
888888

889-
if (!dn)
890-
goto out;
889+
while (bus) {
890+
dn = pci_bus_to_OF_node(bus);
891+
if (!dn) {
892+
bus = bus->parent;
893+
continue;
894+
}
891895

892-
/* PHB PE or root PE ? */
893-
if (pci_is_root_bus(bus)) {
894-
loc = of_get_property(dn, "ibm,loc-code", NULL);
895-
if (!loc)
896+
if (pci_is_root_bus(bus))
896897
loc = of_get_property(dn, "ibm,io-base-loc-code", NULL);
898+
else
899+
loc = of_get_property(dn, "ibm,slot-location-code",
900+
NULL);
901+
897902
if (loc)
898-
goto out;
903+
return loc;
899904

900-
/* Check the root port */
901-
dn = dn->child;
902-
if (!dn)
903-
goto out;
905+
bus = bus->parent;
904906
}
905907

906-
loc = of_get_property(dn, "ibm,loc-code", NULL);
907-
if (!loc)
908-
loc = of_get_property(dn, "ibm,slot-location-code", NULL);
909-
910-
out:
911-
return loc ? loc : "N/A";
908+
return "N/A";
912909
}
913910

914911
/**

arch/powerpc/kernel/misc_64.S

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -701,31 +701,3 @@ _GLOBAL(kexec_sequence)
701701
li r5,0
702702
blr /* image->start(physid, image->start, 0); */
703703
#endif /* CONFIG_KEXEC */
704-
705-
#ifdef CONFIG_MODULES
706-
#if defined(_CALL_ELF) && _CALL_ELF == 2
707-
708-
#ifdef CONFIG_MODVERSIONS
709-
.weak __crc_TOC.
710-
.section "___kcrctab+TOC.","a"
711-
.globl __kcrctab_TOC.
712-
__kcrctab_TOC.:
713-
.llong __crc_TOC.
714-
#endif
715-
716-
/*
717-
* Export a fake .TOC. since both modpost and depmod will complain otherwise.
718-
* Both modpost and depmod strip the leading . so we do the same here.
719-
*/
720-
.section "__ksymtab_strings","a"
721-
__kstrtab_TOC.:
722-
.asciz "TOC."
723-
724-
.section "___ksymtab+TOC.","a"
725-
/* This symbol name is important: it's used by modpost to find exported syms */
726-
.globl __ksymtab_TOC.
727-
__ksymtab_TOC.:
728-
.llong 0 /* .value */
729-
.llong __kstrtab_TOC.
730-
#endif /* ELFv2 */
731-
#endif /* MODULES */

arch/powerpc/kernel/module_64.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,22 @@ static void dedotify_versions(struct modversion_info *vers,
326326
}
327327
}
328328

329-
/* Undefined symbols which refer to .funcname, hack to funcname (or .TOC.) */
329+
/*
330+
* Undefined symbols which refer to .funcname, hack to funcname. Make .TOC.
331+
* seem to be defined (value set later).
332+
*/
330333
static void dedotify(Elf64_Sym *syms, unsigned int numsyms, char *strtab)
331334
{
332335
unsigned int i;
333336

334337
for (i = 1; i < numsyms; i++) {
335338
if (syms[i].st_shndx == SHN_UNDEF) {
336339
char *name = strtab + syms[i].st_name;
337-
if (name[0] == '.')
340+
if (name[0] == '.') {
341+
if (strcmp(name+1, "TOC.") == 0)
342+
syms[i].st_shndx = SHN_ABS;
338343
memmove(name, name+1, strlen(name));
344+
}
339345
}
340346
}
341347
}
@@ -351,7 +357,7 @@ static Elf64_Sym *find_dot_toc(Elf64_Shdr *sechdrs,
351357
numsyms = sechdrs[symindex].sh_size / sizeof(Elf64_Sym);
352358

353359
for (i = 1; i < numsyms; i++) {
354-
if (syms[i].st_shndx == SHN_UNDEF
360+
if (syms[i].st_shndx == SHN_ABS
355361
&& strcmp(strtab + syms[i].st_name, "TOC.") == 0)
356362
return &syms[i];
357363
}

arch/powerpc/mm/mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,12 @@ subsys_initcall(add_system_ram_resources);
560560
*/
561561
int devmem_is_allowed(unsigned long pfn)
562562
{
563+
if (page_is_rtas_user_buf(pfn))
564+
return 1;
563565
if (iomem_is_exclusive(PFN_PHYS(pfn)))
564566
return 0;
565567
if (!page_is_ram(pfn))
566568
return 1;
567-
if (page_is_rtas_user_buf(pfn))
568-
return 1;
569569
return 0;
570570
}
571571
#endif /* CONFIG_STRICT_DEVMEM */

arch/powerpc/perf/power8-pmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static struct power_pmu power8_pmu = {
816816
.get_constraint = power8_get_constraint,
817817
.get_alternatives = power8_get_alternatives,
818818
.disable_pmc = power8_disable_pmc,
819-
.flags = PPMU_HAS_SSLOT | PPMU_HAS_SIER | PPMU_ARCH_207S,
819+
.flags = PPMU_HAS_SIER | PPMU_ARCH_207S,
820820
.n_generic = ARRAY_SIZE(power8_generic_events),
821821
.generic_events = power8_generic_events,
822822
.cache_events = &power8_cache_events,

scripts/mod/modpost.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,8 @@ static int ignore_undef_symbol(struct elf_info *info, const char *symname)
594594
if (strncmp(symname, "_restgpr0_", sizeof("_restgpr0_") - 1) == 0 ||
595595
strncmp(symname, "_savegpr0_", sizeof("_savegpr0_") - 1) == 0 ||
596596
strncmp(symname, "_restvr_", sizeof("_restvr_") - 1) == 0 ||
597-
strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0)
597+
strncmp(symname, "_savevr_", sizeof("_savevr_") - 1) == 0 ||
598+
strcmp(symname, ".TOC.") == 0)
598599
return 1;
599600
/* Do not ignore this symbol */
600601
return 0;

0 commit comments

Comments
 (0)