Skip to content
Snippets Groups Projects
Commit d38c07af authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc updates from Michael Ellerman:
 "Slightly late as I had to rebase mid-week to insert a bug fix:

   - A large series from Nick for 64-bit to further rework our exception
     vectors, and rewrite portions of the syscall entry/exit and
     interrupt return in C. The result is much easier to follow code
     that is also faster in general.

   - Cleanup of our ptrace code to split various parts out that had
     become badly intertwined with #ifdefs over the years.

   - Changes to our NUMA setup under the PowerVM hypervisor which should
     hopefully avoid non-sensical topologies which can lead to warnings
     from the workqueue code and other problems.

   - MAINTAINERS updates to remove some of our old orphan entries and
     update the status of others.

   - Quite a few other small changes and fixes all over the map.

  Thanks to: Abdul Haleem, afzal mohammed, Alexey Kardashevskiy, Andrew
  Donnellan, Aneesh Kumar K.V, Balamuruhan S, Cédric Le Goater, Chen
  Zhou, Christophe JAILLET, Christophe Leroy, Christoph Hellwig, Clement
  Courbet, Daniel Axtens, David Gibson, Douglas Miller, Fabiano Rosas,
  Fangrui Song, Ganesh Goudar, Gautham R. Shenoy, Greg Kroah-Hartman,
  Greg Kurz, Gustavo Luiz Duarte, Hari Bathini, Ilie Halip, Jan Kara,
  Joe Lawrence, Joe Perches, Kajol Jain, Larry Finger, Laurentiu Tudor,
  Leonardo Bras, Libor Pechacek, Madhavan Srinivasan, Mahesh Salgaonkar,
  Masahiro Yamada, Masami Hiramatsu, Mauricio Faria de Oliveira, Michael
  Neuling, Michal Suchanek, Mike Rapoport, Nageswara R Sastry, Nathan
  Chancellor, Nathan Lynch, Naveen N. Rao, Nicholas Piggin, Nick
  Desaulniers, Oliver O'Halloran, Po-Hsu Lin, Pratik Rajesh Sampat,
  Rasmus Villemoes, Ravi Bangoria, Roman Bolshakov, Sam Bobroff,
  Sandipan Das, Santosh S, Sedat Dilek, Segher Boessenkool, Shilpasri G
  Bhat, Sourabh Jain, Srikar Dronamraju, Stephen Rothwell, Tyrel
  Datwyler, Vaibhav Jain, YueHaibing"

* tag 'powerpc-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (158 commits)
  powerpc: Make setjmp/longjmp signature standard
  powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
  powerpc: Suppress .eh_frame generation
  powerpc: Drop -fno-dwarf2-cfi-asm
  powerpc/32: drop unused ISA_DMA_THRESHOLD
  powerpc/powernv: Add documentation for the opal sensor_groups sysfs interfaces
  selftests/powerpc: Fix try-run when source tree is not writable
  powerpc/vmlinux.lds: Explicitly retain .gnu.hash
  powerpc/ptrace: move ptrace_triggered() into hw_breakpoint.c
  powerpc/ptrace: create ppc_gethwdinfo()
  powerpc/ptrace: create ptrace_get_debugreg()
  powerpc/ptrace: split out ADV_DEBUG_REGS related functions.
  powerpc/ptrace: move register viewing functions out of ptrace.c
  powerpc/ptrace: split out TRANSACTIONAL_MEM related functions.
  powerpc/ptrace: split out SPE related functions.
  powerpc/ptrace: split out ALTIVEC related functions.
  powerpc/ptrace: split out VSX related functions.
  powerpc/ptrace: drop PARAMETER_SAVE_AREA_OFFSET
  powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64
  powerpc/ptrace: remove unused header includes
  ...
parents 31c0aa87 c17eb4dc
No related branches found
No related tags found
No related merge requests found
Showing
with 200 additions and 75 deletions
This ABI is renamed and moved to a new location /sys/kernel/fadump/enabled.
What: /sys/kernel/fadump_enabled
Date: Feb 2012
Contact: linuxppc-dev@lists.ozlabs.org
Description: read only
Primarily used to identify whether the FADump is enabled in
the kernel or not.
User: Kdump service
This ABI is renamed and moved to a new location /sys/kernel/fadump/registered.¬
What: /sys/kernel/fadump_registered
Date: Feb 2012
Contact: linuxppc-dev@lists.ozlabs.org
Description: read/write
Helps to control the dump collect feature from userspace.
Setting 1 to this file enables the system to collect the
dump and 0 to disable it.
User: Kdump service
This ABI is renamed and moved to a new location /sys/kernel/fadump/release_mem.¬
What: /sys/kernel/fadump_release_mem
Date: Feb 2012
Contact: linuxppc-dev@lists.ozlabs.org
Description: write only
This is a special sysfs file and only available when
the system is booted to capture the vmcore using FADump.
It is used to release the memory reserved by FADump to
save the crash dump.
This ABI is moved to /sys/firmware/opal/mpipl/release_core.
What: /sys/kernel/fadump_release_opalcore
Date: Sep 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description: write only
The sysfs file is available when the system is booted to
collect the dump on OPAL based machine. It used to release
the memory used to collect the opalcore.
What: /sys/firmware/opal/sensor_groups
Date: August 2017
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
Description: Sensor groups directory for POWER9 powernv servers
Each folder in this directory contains a sensor group
which are classified based on type of the sensor
like power, temperature, frequency, current, etc. They
can also indicate the group of sensors belonging to
different owners like CSM, Profiler, Job-Scheduler
What: /sys/firmware/opal/sensor_groups/<sensor_group_name>/clear
Date: August 2017
Contact: Linux for PowerPC mailing list <linuxppc-dev@ozlabs.org>
Description: Sysfs file to clear the min-max of all the sensors
belonging to the group.
Writing 1 to this file will clear the minimum and
maximum values of all the sensors in the group.
In POWER9, the min-max of a sensor is the historical minimum
and maximum value of the sensor cached by OCC.
What: /sys/kernel/fadump/*
Date: Dec 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description:
The /sys/kernel/fadump/* is a collection of FADump sysfs
file provide information about the configuration status
of Firmware Assisted Dump (FADump).
What: /sys/kernel/fadump/enabled
Date: Dec 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description: read only
Primarily used to identify whether the FADump is enabled in
the kernel or not.
User: Kdump service
What: /sys/kernel/fadump/registered
Date: Dec 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description: read/write
Helps to control the dump collect feature from userspace.
Setting 1 to this file enables the system to collect the
dump and 0 to disable it.
User: Kdump service
What: /sys/kernel/fadump/release_mem
Date: Dec 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description: write only
This is a special sysfs file and only available when
the system is booted to capture the vmcore using FADump.
It is used to release the memory reserved by FADump to
save the crash dump.
What: /sys/kernel/fadump/mem_reserved
Date: Dec 2019
Contact: linuxppc-dev@lists.ozlabs.org
Description: read only
Provide information about the amount of memory reserved by
FADump to save the crash dump in bytes.
...@@ -112,13 +112,13 @@ to ensure that crash data is preserved to process later. ...@@ -112,13 +112,13 @@ to ensure that crash data is preserved to process later.
-- On OPAL based machines (PowerNV), if the kernel is build with -- On OPAL based machines (PowerNV), if the kernel is build with
CONFIG_OPAL_CORE=y, OPAL memory at the time of crash is also CONFIG_OPAL_CORE=y, OPAL memory at the time of crash is also
exported as /sys/firmware/opal/core file. This procfs file is exported as /sys/firmware/opal/mpipl/core file. This procfs file is
helpful in debugging OPAL crashes with GDB. The kernel memory helpful in debugging OPAL crashes with GDB. The kernel memory
used for exporting this procfs file can be released by echo'ing used for exporting this procfs file can be released by echo'ing
'1' to /sys/kernel/fadump_release_opalcore node. '1' to /sys/firmware/opal/mpipl/release_core node.
e.g. e.g.
# echo 1 > /sys/kernel/fadump_release_opalcore # echo 1 > /sys/firmware/opal/mpipl/release_core
Implementation details: Implementation details:
----------------------- -----------------------
...@@ -268,6 +268,11 @@ Here is the list of files under kernel sysfs: ...@@ -268,6 +268,11 @@ Here is the list of files under kernel sysfs:
be handled and vmcore will not be captured. This interface can be be handled and vmcore will not be captured. This interface can be
easily integrated with kdump service start/stop. easily integrated with kdump service start/stop.
/sys/kernel/fadump/mem_reserved
This is used to display the memory reserved by FADump for saving the
crash dump.
/sys/kernel/fadump_release_mem /sys/kernel/fadump_release_mem
This file is available only when FADump is active during This file is available only when FADump is active during
second kernel. This is used to release the reserved memory second kernel. This is used to release the reserved memory
...@@ -283,14 +288,29 @@ Here is the list of files under kernel sysfs: ...@@ -283,14 +288,29 @@ Here is the list of files under kernel sysfs:
enhanced to use this interface to release the memory reserved for enhanced to use this interface to release the memory reserved for
dump and continue without 2nd reboot. dump and continue without 2nd reboot.
/sys/kernel/fadump_release_opalcore Note: /sys/kernel/fadump_release_opalcore sysfs has moved to
/sys/firmware/opal/mpipl/release_core
/sys/firmware/opal/mpipl/release_core
This file is available only on OPAL based machines when FADump is This file is available only on OPAL based machines when FADump is
active during capture kernel. This is used to release the memory active during capture kernel. This is used to release the memory
used by the kernel to export /sys/firmware/opal/core file. To used by the kernel to export /sys/firmware/opal/mpipl/core file. To
release this memory, echo '1' to it: release this memory, echo '1' to it:
echo 1 > /sys/kernel/fadump_release_opalcore echo 1 > /sys/firmware/opal/mpipl/release_core
Note: The following FADump sysfs files are deprecated.
+----------------------------------+--------------------------------+
| Deprecated | Alternative |
+----------------------------------+--------------------------------+
| /sys/kernel/fadump_enabled | /sys/kernel/fadump/enabled |
+----------------------------------+--------------------------------+
| /sys/kernel/fadump_registered | /sys/kernel/fadump/registered |
+----------------------------------+--------------------------------+
| /sys/kernel/fadump_release_mem | /sys/kernel/fadump/release_mem |
+----------------------------------+--------------------------------+
Here is the list of files under powerpc debugfs: Here is the list of files under powerpc debugfs:
(Assuming debugfs is mounted on /sys/kernel/debug directory.) (Assuming debugfs is mounted on /sys/kernel/debug directory.)
......
...@@ -9692,17 +9692,16 @@ F: include/uapi/linux/lightnvm.h ...@@ -9692,17 +9692,16 @@ F: include/uapi/linux/lightnvm.h
   
LINUX FOR POWER MACINTOSH LINUX FOR POWER MACINTOSH
M: Benjamin Herrenschmidt <benh@kernel.crashing.org> M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
S: Maintained S: Odd Fixes
F: arch/powerpc/platforms/powermac/ F: arch/powerpc/platforms/powermac/
F: drivers/macintosh/ F: drivers/macintosh/
   
LINUX FOR POWERPC (32-BIT AND 64-BIT) LINUX FOR POWERPC (32-BIT AND 64-BIT)
M: Benjamin Herrenschmidt <benh@kernel.crashing.org>
M: Paul Mackerras <paulus@samba.org>
M: Michael Ellerman <mpe@ellerman.id.au> M: Michael Ellerman <mpe@ellerman.id.au>
W: https://github.com/linuxppc/linux/wiki R: Benjamin Herrenschmidt <benh@kernel.crashing.org>
R: Paul Mackerras <paulus@samba.org>
W: https://github.com/linuxppc/wiki/wiki
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
Q: http://patchwork.ozlabs.org/project/linuxppc-dev/list/ Q: http://patchwork.ozlabs.org/project/linuxppc-dev/list/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
...@@ -9719,6 +9718,8 @@ F: drivers/crypto/vmx/ ...@@ -9719,6 +9718,8 @@ F: drivers/crypto/vmx/
F: drivers/i2c/busses/i2c-opal.c F: drivers/i2c/busses/i2c-opal.c
F: drivers/net/ethernet/ibm/ibmveth.* F: drivers/net/ethernet/ibm/ibmveth.*
F: drivers/net/ethernet/ibm/ibmvnic.* F: drivers/net/ethernet/ibm/ibmvnic.*
F: drivers/*/*/*pasemi*
F: drivers/*/*pasemi*
F: drivers/pci/hotplug/pnv_php.c F: drivers/pci/hotplug/pnv_php.c
F: drivers/pci/hotplug/rpa* F: drivers/pci/hotplug/rpa*
F: drivers/rtc/rtc-opal.c F: drivers/rtc/rtc-opal.c
...@@ -9735,51 +9736,31 @@ N: pseries ...@@ -9735,51 +9736,31 @@ N: pseries
LINUX FOR POWERPC EMBEDDED MPC5XXX LINUX FOR POWERPC EMBEDDED MPC5XXX
M: Anatolij Gustschin <agust@denx.de> M: Anatolij Gustschin <agust@denx.de>
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
T: git git://git.denx.de/linux-denx-agust.git S: Odd Fixes
S: Maintained
F: arch/powerpc/platforms/512x/ F: arch/powerpc/platforms/512x/
F: arch/powerpc/platforms/52xx/ F: arch/powerpc/platforms/52xx/
   
LINUX FOR POWERPC EMBEDDED PPC4XX LINUX FOR POWERPC EMBEDDED PPC4XX
M: Alistair Popple <alistair@popple.id.au>
M: Matt Porter <mporter@kernel.crashing.org>
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
S: Maintained S: Orphan
F: arch/powerpc/platforms/40x/ F: arch/powerpc/platforms/40x/
F: arch/powerpc/platforms/44x/ F: arch/powerpc/platforms/44x/
   
LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
M: Scott Wood <oss@buserror.net> M: Scott Wood <oss@buserror.net>
M: Kumar Gala <galak@kernel.crashing.org>
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux.git
S: Maintained S: Odd fixes
F: arch/powerpc/platforms/83xx/ F: arch/powerpc/platforms/83xx/
F: arch/powerpc/platforms/85xx/ F: arch/powerpc/platforms/85xx/
F: Documentation/devicetree/bindings/powerpc/fsl/ F: Documentation/devicetree/bindings/powerpc/fsl/
   
LINUX FOR POWERPC EMBEDDED PPC8XX LINUX FOR POWERPC EMBEDDED PPC8XX
M: Vitaly Bordug <vitb@kernel.crashing.org> M: Christophe Leroy <christophe.leroy@c-s.fr>
W: http://www.penguinppc.org/
L: linuxppc-dev@lists.ozlabs.org L: linuxppc-dev@lists.ozlabs.org
S: Maintained S: Maintained
F: arch/powerpc/platforms/8xx/ F: arch/powerpc/platforms/8xx/
   
LINUX FOR POWERPC EMBEDDED XILINX VIRTEX
L: linuxppc-dev@lists.ozlabs.org
S: Orphan
F: arch/powerpc/*/*virtex*
F: arch/powerpc/*/*/*virtex*
LINUX FOR POWERPC PA SEMI PWRFICIENT
L: linuxppc-dev@lists.ozlabs.org
S: Orphan
F: arch/powerpc/platforms/pasemi/
F: drivers/*/*pasemi*
F: drivers/*/*/*pasemi*
LINUX KERNEL DUMP TEST MODULE (LKDTM) LINUX KERNEL DUMP TEST MODULE (LKDTM)
M: Kees Cook <keescook@chromium.org> M: Kees Cook <keescook@chromium.org>
S: Maintained S: Maintained
...@@ -12667,16 +12648,6 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 ...@@ -12667,16 +12648,6 @@ W: http://wireless.kernel.org/en/users/Drivers/p54
S: Maintained S: Maintained
F: drivers/net/wireless/intersil/p54/ F: drivers/net/wireless/intersil/p54/
   
PA SEMI ETHERNET DRIVER
L: netdev@vger.kernel.org
S: Orphan
F: drivers/net/ethernet/pasemi/*
PA SEMI SMBUS DRIVER
L: linux-i2c@vger.kernel.org
S: Orphan
F: drivers/i2c/busses/i2c-pasemi.c
PACKING PACKING
M: Vladimir Oltean <olteanv@gmail.com> M: Vladimir Oltean <olteanv@gmail.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
......
...@@ -239,10 +239,8 @@ KBUILD_CFLAGS += $(call cc-option,-mno-vsx) ...@@ -239,10 +239,8 @@ KBUILD_CFLAGS += $(call cc-option,-mno-vsx)
KBUILD_CFLAGS += $(call cc-option,-mno-spe) KBUILD_CFLAGS += $(call cc-option,-mno-spe)
KBUILD_CFLAGS += $(call cc-option,-mspe=no) KBUILD_CFLAGS += $(call cc-option,-mspe=no)
# FIXME: the module load should be taught about the additional relocs # Don't emit .eh_frame since we have no use for it
# generated by this. KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
# revert to pre-gcc-4.4 behaviour of .eh_frame
KBUILD_CFLAGS += $(call cc-option,-fno-dwarf2-cfi-asm)
# Never use string load/store instructions as they are # Never use string load/store instructions as they are
# often slow when they are implemented at all # often slow when they are implemented at all
...@@ -298,6 +296,7 @@ $(BOOT_TARGETS2): vmlinux ...@@ -298,6 +296,7 @@ $(BOOT_TARGETS2): vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
PHONY += bootwrapper_install
bootwrapper_install: bootwrapper_install:
$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@) $(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
...@@ -403,9 +402,11 @@ define archhelp ...@@ -403,9 +402,11 @@ define archhelp
@echo ' (minus the .dts extension).' @echo ' (minus the .dts extension).'
endef endef
PHONY += install
install: install:
$(Q)$(MAKE) $(build)=$(boot) install $(Q)$(MAKE) $(build)=$(boot) install
PHONY += vdso_install
vdso_install: vdso_install:
ifdef CONFIG_PPC64 ifdef CONFIG_PPC64
$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
...@@ -425,6 +426,7 @@ archheaders: ...@@ -425,6 +426,7 @@ archheaders:
ifdef CONFIG_STACKPROTECTOR ifdef CONFIG_STACKPROTECTOR
prepare: stack_protector_prepare prepare: stack_protector_prepare
PHONY += stack_protector_prepare
stack_protector_prepare: prepare0 stack_protector_prepare: prepare0
ifdef CONFIG_PPC64 ifdef CONFIG_PPC64
$(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h)) $(eval KBUILD_CFLAGS += -mstack-protector-guard-offset=$(shell awk '{if ($$2 == "PACA_CANARY") print $$3;}' include/generated/asm-offsets.h))
...@@ -436,10 +438,12 @@ endif ...@@ -436,10 +438,12 @@ endif
ifdef CONFIG_SMP ifdef CONFIG_SMP
prepare: task_cpu_prepare prepare: task_cpu_prepare
PHONY += task_cpu_prepare
task_cpu_prepare: prepare0 task_cpu_prepare: prepare0
$(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TASK_CPU") print $$3;}' include/generated/asm-offsets.h)) $(eval KBUILD_CFLAGS += -D_TASK_CPU=$(shell awk '{if ($$2 == "TASK_CPU") print $$3;}' include/generated/asm-offsets.h))
endif endif
PHONY += checkbin
# Check toolchain versions: # Check toolchain versions:
# - gcc-4.6 is the minimum kernel-wide version so nothing required. # - gcc-4.6 is the minimum kernel-wide version so nothing required.
checkbin: checkbin:
......
...@@ -445,6 +445,8 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) ...@@ -445,6 +445,8 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^ sh -x $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" vmlinux System.map "$(INSTALL_PATH)" $^
PHONY += install zInstall
# anything not in $(targets) # anything not in $(targets)
clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \ clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \ zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
......
...@@ -44,9 +44,6 @@ p_end: .long _end ...@@ -44,9 +44,6 @@ p_end: .long _end
p_pstack: .long _platform_stack_top p_pstack: .long _platform_stack_top
#endif #endif
.globl _zimage_start
/* Clang appears to require the .weak directive to be after the symbol
* is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */
.weak _zimage_start .weak _zimage_start
_zimage_start: _zimage_start:
.globl _zimage_start_lib .globl _zimage_start_lib
......
...@@ -97,6 +97,10 @@ ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp, ...@@ -97,6 +97,10 @@ ppc_select(int n, fd_set __user *inp, fd_set __user *outp, fd_set __user *exp,
unsigned long __init early_init(unsigned long dt_ptr); unsigned long __init early_init(unsigned long dt_ptr);
void __init machine_init(u64 dt_ptr); void __init machine_init(u64 dt_ptr);
#endif #endif
long system_call_exception(long r3, long r4, long r5, long r6, long r7, long r8, unsigned long r0, struct pt_regs *regs);
notrace unsigned long syscall_exit_prepare(unsigned long r3, struct pt_regs *regs);
notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned long msr);
notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr);
long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
u32 len_high, u32 len_low); u32 len_high, u32 len_low);
...@@ -104,14 +108,6 @@ long sys_switch_endian(void); ...@@ -104,14 +108,6 @@ long sys_switch_endian(void);
notrace unsigned int __check_irq_replay(void); notrace unsigned int __check_irq_replay(void);
void notrace restore_interrupts(void); void notrace restore_interrupts(void);
/* ptrace */
long do_syscall_trace_enter(struct pt_regs *regs);
void do_syscall_trace_leave(struct pt_regs *regs);
/* process */
void restore_math(struct pt_regs *regs);
void restore_tm_state(struct pt_regs *regs);
/* prom_init (OpenFirmware) */ /* prom_init (OpenFirmware) */
unsigned long __init prom_init(unsigned long r3, unsigned long r4, unsigned long __init prom_init(unsigned long r3, unsigned long r4,
unsigned long pp, unsigned long pp,
...@@ -122,9 +118,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4, ...@@ -122,9 +118,6 @@ unsigned long __init prom_init(unsigned long r3, unsigned long r4,
void __init early_setup(unsigned long dt_ptr); void __init early_setup(unsigned long dt_ptr);
void early_setup_secondary(void); void early_setup_secondary(void);
/* time */
void accumulate_stolen_time(void);
/* misc runtime */ /* misc runtime */
extern u64 __bswapdi2(u64); extern u64 __bswapdi2(u64);
extern s64 __lshrdi3(s64, int); extern s64 __lshrdi3(s64, int);
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
* updating the accessed and modified bits in the page table tree. * updating the accessed and modified bits in the page table tree.
*/ */
#define _PAGE_PRESENT 0x001 /* software: pte contains a translation */ #define _PAGE_USER 0x001 /* usermode access allowed */
#define _PAGE_HASHPTE 0x002 /* hash_page has made an HPTE for this pte */ #define _PAGE_RW 0x002 /* software: user write access allowed */
#define _PAGE_USER 0x004 /* usermode access allowed */ #define _PAGE_PRESENT 0x004 /* software: pte contains a translation */
#define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */ #define _PAGE_GUARDED 0x008 /* G: prohibit speculative access */
#define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */ #define _PAGE_COHERENT 0x010 /* M: enforce memory coherence (SMP systems) */
#define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */ #define _PAGE_NO_CACHE 0x020 /* I: cache inhibit */
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define _PAGE_DIRTY 0x080 /* C: page changed */ #define _PAGE_DIRTY 0x080 /* C: page changed */
#define _PAGE_ACCESSED 0x100 /* R: page referenced */ #define _PAGE_ACCESSED 0x100 /* R: page referenced */
#define _PAGE_EXEC 0x200 /* software: exec allowed */ #define _PAGE_EXEC 0x200 /* software: exec allowed */
#define _PAGE_RW 0x400 /* software: user write access allowed */ #define _PAGE_HASHPTE 0x400 /* hash_page has made an HPTE for this pte */
#define _PAGE_SPECIAL 0x800 /* software: Special page */ #define _PAGE_SPECIAL 0x800 /* software: Special page */
#ifdef CONFIG_PTE_64BIT #ifdef CONFIG_PTE_64BIT
......
...@@ -366,10 +366,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma, ...@@ -366,10 +366,8 @@ static inline void __ptep_set_access_flags(struct vm_area_struct *vma,
(((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) (((address) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))
#define pte_offset_kernel(dir, addr) \ #define pte_offset_kernel(dir, addr) \
((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr)) ((pte_t *) pmd_page_vaddr(*(dir)) + pte_index(addr))
#define pte_offset_map(dir, addr) \ #define pte_offset_map(dir, addr) pte_offset_kernel((dir), (addr))
((pte_t *)(kmap_atomic(pmd_page(*(dir))) + \ static inline void pte_unmap(pte_t *pte) { }
(pmd_page_vaddr(*(dir)) & ~PAGE_MASK)) + pte_index(addr))
#define pte_unmap(pte) kunmap_atomic(pte)
/* /*
* Encode and decode a swap entry. * Encode and decode a swap entry.
......
...@@ -156,6 +156,12 @@ extern pmd_t hash__pmdp_huge_get_and_clear(struct mm_struct *mm, ...@@ -156,6 +156,12 @@ extern pmd_t hash__pmdp_huge_get_and_clear(struct mm_struct *mm,
extern int hash__has_transparent_hugepage(void); extern int hash__has_transparent_hugepage(void);
#endif #endif
static inline pmd_t hash__pmd_mkdevmap(pmd_t pmd)
{
BUG();
return pmd;
}
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_POWERPC_BOOK3S_64_HASH_4K_H */ #endif /* _ASM_POWERPC_BOOK3S_64_HASH_4K_H */
...@@ -246,7 +246,7 @@ static inline void mark_hpte_slot_valid(unsigned char *hpte_slot_array, ...@@ -246,7 +246,7 @@ static inline void mark_hpte_slot_valid(unsigned char *hpte_slot_array,
*/ */
static inline int hash__pmd_trans_huge(pmd_t pmd) static inline int hash__pmd_trans_huge(pmd_t pmd)
{ {
return !!((pmd_val(pmd) & (_PAGE_PTE | H_PAGE_THP_HUGE)) == return !!((pmd_val(pmd) & (_PAGE_PTE | H_PAGE_THP_HUGE | _PAGE_DEVMAP)) ==
(_PAGE_PTE | H_PAGE_THP_HUGE)); (_PAGE_PTE | H_PAGE_THP_HUGE));
} }
...@@ -272,6 +272,12 @@ extern pmd_t hash__pmdp_huge_get_and_clear(struct mm_struct *mm, ...@@ -272,6 +272,12 @@ extern pmd_t hash__pmdp_huge_get_and_clear(struct mm_struct *mm,
unsigned long addr, pmd_t *pmdp); unsigned long addr, pmd_t *pmdp);
extern int hash__has_transparent_hugepage(void); extern int hash__has_transparent_hugepage(void);
#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
static inline pmd_t hash__pmd_mkdevmap(pmd_t pmd)
{
return __pmd(pmd_val(pmd) | (_PAGE_PTE | H_PAGE_THP_HUGE | _PAGE_DEVMAP));
}
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* _ASM_POWERPC_BOOK3S_64_HASH_64K_H */ #endif /* _ASM_POWERPC_BOOK3S_64_HASH_64K_H */
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#define _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H #define _ASM_POWERPC_BOOK3S_64_KUP_RADIX_H
#include <linux/const.h> #include <linux/const.h>
#include <asm/reg.h>
#define AMR_KUAP_BLOCK_READ UL(0x4000000000000000) #define AMR_KUAP_BLOCK_READ UL(0x4000000000000000)
#define AMR_KUAP_BLOCK_WRITE UL(0x8000000000000000) #define AMR_KUAP_BLOCK_WRITE UL(0x8000000000000000)
...@@ -56,7 +57,20 @@ ...@@ -56,7 +57,20 @@
#ifdef CONFIG_PPC_KUAP #ifdef CONFIG_PPC_KUAP
#include <asm/reg.h> #include <asm/mmu.h>
#include <asm/ptrace.h>
static inline void kuap_restore_amr(struct pt_regs *regs)
{
if (mmu_has_feature(MMU_FTR_RADIX_KUAP))
mtspr(SPRN_AMR, regs->kuap);
}
static inline void kuap_check_amr(void)
{
if (IS_ENABLED(CONFIG_PPC_KUAP_DEBUG) && mmu_has_feature(MMU_FTR_RADIX_KUAP))
WARN_ON_ONCE(mfspr(SPRN_AMR) != AMR_KUAP_BLOCKED);
}
/* /*
* We support individually allowing read or write, but we don't support nesting * We support individually allowing read or write, but we don't support nesting
...@@ -127,6 +141,14 @@ bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write) ...@@ -127,6 +141,14 @@ bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)
(regs->kuap & (is_write ? AMR_KUAP_BLOCK_WRITE : AMR_KUAP_BLOCK_READ)), (regs->kuap & (is_write ? AMR_KUAP_BLOCK_WRITE : AMR_KUAP_BLOCK_READ)),
"Bug: %s fault blocked by AMR!", is_write ? "Write" : "Read"); "Bug: %s fault blocked by AMR!", is_write ? "Write" : "Read");
} }
#else /* CONFIG_PPC_KUAP */
static inline void kuap_restore_amr(struct pt_regs *regs)
{
}
static inline void kuap_check_amr(void)
{
}
#endif /* CONFIG_PPC_KUAP */ #endif /* CONFIG_PPC_KUAP */
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
......
...@@ -1303,7 +1303,9 @@ extern void serialize_against_pte_lookup(struct mm_struct *mm); ...@@ -1303,7 +1303,9 @@ extern void serialize_against_pte_lookup(struct mm_struct *mm);
static inline pmd_t pmd_mkdevmap(pmd_t pmd) static inline pmd_t pmd_mkdevmap(pmd_t pmd)
{ {
return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_DEVMAP)); if (radix_enabled())
return radix__pmd_mkdevmap(pmd);
return hash__pmd_mkdevmap(pmd);
} }
static inline int pmd_devmap(pmd_t pmd) static inline int pmd_devmap(pmd_t pmd)
......
...@@ -263,6 +263,11 @@ static inline int radix__has_transparent_hugepage(void) ...@@ -263,6 +263,11 @@ static inline int radix__has_transparent_hugepage(void)
} }
#endif #endif
static inline pmd_t radix__pmd_mkdevmap(pmd_t pmd)
{
return __pmd(pmd_val(pmd) | (_PAGE_PTE | _PAGE_DEVMAP));
}
extern int __meminit radix__vmemmap_create_mapping(unsigned long start, extern int __meminit radix__vmemmap_create_mapping(unsigned long start,
unsigned long page_size, unsigned long page_size,
unsigned long phys); unsigned long phys);
......
...@@ -97,7 +97,7 @@ static inline u32 l1_icache_bytes(void) ...@@ -97,7 +97,7 @@ static inline u32 l1_icache_bytes(void)
#endif #endif
#define __read_mostly __attribute__((__section__(".data..read_mostly"))) #define __read_mostly __section(.data..read_mostly)
#ifdef CONFIG_PPC_BOOK3S_32 #ifdef CONFIG_PPC_BOOK3S_32
extern long _get_L2CR(void); extern long _get_L2CR(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment