Merge tag 'acpi-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Sep 2021 20:29:04 +0000 (13:29 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 10 Sep 2021 20:29:04 +0000 (13:29 -0700)
Pull more ACPI updates from Rafael Wysocki:
 "These prevent a confusing PRMT-related message from being printed,
  drop an unnecessary header file include and update the list of ACPICA
  maintainers.

  Specifics:

   - Prevent a message about missing PRMT from being printed on systems
     that do not support PRM, which are the majority now (Aubrey Li).

   - Drop unnecessary header include from scan.c (Kari Argillander).

   - Update the list of ACPICA maintainers after recent departure of one
     of them (Rafael Wysocki)"

* tag 'acpi-5.15-rc1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPICA: Update the list of maintainers
  ACPI: PRM: Find PRMT table before parsing it
  ACPI: scan: Remove unneeded header linux/nls.h

363 files changed:
Documentation/ABI/stable/sysfs-driver-dma-idxd
Documentation/ABI/testing/debugfs-driver-habanalabs
Documentation/admin-guide/bootconfig.rst
Documentation/admin-guide/kernel-parameters.txt
Documentation/devicetree/bindings/dma/altr,msgdma.yaml
Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml [new file with mode: 0644]
Documentation/devicetree/bindings/dma/st,stm32-dma.yaml
Documentation/devicetree/bindings/sound/fsl,rpmsg.yaml
Documentation/devicetree/bindings/sound/mt8195-afe-pcm.yaml
Documentation/driver-api/cxl/memory-devices.rst
Documentation/gpu/drm-mm.rst
Documentation/power/energy-model.rst
MAINTAINERS
arch/arm/Kconfig
arch/arm/Makefile
arch/arm/boot/Makefile
arch/arm/boot/compressed/Makefile
arch/arm/include/asm/div64.h
arch/arm/include/asm/gpio.h
arch/arm/include/asm/ptrace.h
arch/arm/include/asm/syscall.h
arch/arm/include/asm/thread_info.h
arch/arm/include/asm/uaccess-asm.h
arch/arm/include/asm/uaccess.h
arch/arm/include/asm/unified.h
arch/arm/include/uapi/asm/unistd.h
arch/arm/kernel/asm-offsets.c
arch/arm/kernel/entry-common.S
arch/arm/kernel/process.c
arch/arm/kernel/ptrace.c
arch/arm/kernel/signal.c
arch/arm/kernel/sys_oabi-compat.c
arch/arm/kernel/traps.c
arch/arm/lib/copy_from_user.S
arch/arm/lib/copy_to_user.S
arch/arm/tools/syscall.tbl
arch/arm64/include/asm/compat.h
arch/arm64/include/asm/uaccess.h
arch/arm64/include/asm/unistd32.h
arch/arm64/lib/Makefile
arch/arm64/lib/copy_in_user.S [deleted file]
arch/arm64/mm/init.c
arch/mips/cavium-octeon/octeon-memcpy.S
arch/mips/include/asm/compat.h
arch/mips/include/asm/uaccess.h
arch/mips/kernel/syscalls/syscall_n32.tbl
arch/mips/kernel/syscalls/syscall_o32.tbl
arch/mips/lib/memcpy.S
arch/nds32/kernel/setup.c
arch/parisc/Kconfig
arch/parisc/boot/compressed/Makefile
arch/parisc/include/asm/compat.h
arch/parisc/include/asm/processor.h
arch/parisc/include/asm/rt_sigframe.h
arch/parisc/include/asm/thread_info.h
arch/parisc/include/asm/uaccess.h
arch/parisc/kernel/asm-offsets.c
arch/parisc/kernel/parisc_ksyms.c
arch/parisc/kernel/setup.c
arch/parisc/kernel/signal.c
arch/parisc/kernel/signal32.h
arch/parisc/kernel/syscalls/syscall.tbl
arch/parisc/kernel/time.c
arch/parisc/lib/lusercopy.S
arch/parisc/lib/memcpy.c
arch/powerpc/include/asm/compat.h
arch/powerpc/kernel/syscalls/syscall.tbl
arch/s390/Kconfig
arch/s390/configs/debug_defconfig
arch/s390/configs/defconfig
arch/s390/configs/zfcpdump_defconfig
arch/s390/include/asm/compat.h
arch/s390/include/asm/cpu_mcf.h
arch/s390/include/asm/smp.h
arch/s390/include/asm/stacktrace.h
arch/s390/include/asm/uaccess.h
arch/s390/include/asm/unwind.h
arch/s390/kernel/entry.S
arch/s390/kernel/ftrace.c
arch/s390/kernel/perf_cpum_cf.c
arch/s390/kernel/setup.c
arch/s390/kernel/smp.c
arch/s390/kernel/syscalls/syscall.tbl
arch/s390/kernel/topology.c
arch/s390/lib/uaccess.c
arch/s390/mm/gmap.c
arch/s390/mm/pgtable.c
arch/s390/pci/pci_clp.c
arch/sparc/include/asm/compat.h
arch/sparc/kernel/process_64.c
arch/sparc/kernel/signal32.c
arch/sparc/kernel/signal_64.c
arch/sparc/kernel/syscalls/syscall.tbl
arch/um/Kconfig
arch/um/drivers/virt-pci.c
arch/um/drivers/virtio_uml.c
arch/um/kernel/skas/clone.c
arch/x86/entry/syscalls/syscall_32.tbl
arch/x86/entry/syscalls/syscall_64.tbl
arch/x86/include/asm/compat.h
arch/x86/include/asm/uaccess_64.h
arch/x86/um/shared/sysdep/stub_32.h
arch/x86/um/shared/sysdep/stub_64.h
arch/x86/um/stub_segv.c
drivers/acpi/cppc_acpi.c
drivers/base/power/main.c
drivers/base/power/wakeirq.c
drivers/cpufreq/intel_pstate.c
drivers/cxl/Makefile
drivers/cxl/acpi.c
drivers/cxl/core.c [deleted file]
drivers/cxl/core/Makefile [new file with mode: 0644]
drivers/cxl/core/bus.c [new file with mode: 0644]
drivers/cxl/core/core.h [new file with mode: 0644]
drivers/cxl/core/memdev.c [new file with mode: 0644]
drivers/cxl/core/pmem.c [new file with mode: 0644]
drivers/cxl/core/regs.c [new file with mode: 0644]
drivers/cxl/cxl.h
drivers/cxl/cxlmem.h [new file with mode: 0644]
drivers/cxl/mem.h [deleted file]
drivers/cxl/pci.c
drivers/cxl/pci.h
drivers/cxl/pmem.c
drivers/dax/super.c
drivers/dma-buf/Kconfig
drivers/dma/Kconfig
drivers/dma/Makefile
drivers/dma/acpi-dma.c
drivers/dma/altera-msgdma.c
drivers/dma/at_xdmac.c
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
drivers/dma/dw-axi-dmac/dw-axi-dmac.h
drivers/dma/dw/idma32.c
drivers/dma/dw/internal.h
drivers/dma/dw/of.c
drivers/dma/dw/pci.c
drivers/dma/dw/platform.c
drivers/dma/ep93xx_dma.c
drivers/dma/fsl-dpaa2-qdma/dpaa2-qdma.c
drivers/dma/hisi_dma.c
drivers/dma/idxd/Makefile
drivers/dma/idxd/bus.c [new file with mode: 0644]
drivers/dma/idxd/cdev.c
drivers/dma/idxd/compat.c [new file with mode: 0644]
drivers/dma/idxd/device.c
drivers/dma/idxd/dma.c
drivers/dma/idxd/idxd.h
drivers/dma/idxd/init.c
drivers/dma/idxd/irq.c
drivers/dma/idxd/registers.h
drivers/dma/idxd/submit.c
drivers/dma/idxd/sysfs.c
drivers/dma/ppc4xx/adma.c
drivers/dma/ptdma/Kconfig [new file with mode: 0644]
drivers/dma/ptdma/Makefile [new file with mode: 0644]
drivers/dma/ptdma/ptdma-debugfs.c [new file with mode: 0644]
drivers/dma/ptdma/ptdma-dev.c [new file with mode: 0644]
drivers/dma/ptdma/ptdma-dmaengine.c [new file with mode: 0644]
drivers/dma/ptdma/ptdma-pci.c [new file with mode: 0644]
drivers/dma/ptdma/ptdma.h [new file with mode: 0644]
drivers/dma/sh/Kconfig
drivers/dma/sh/Makefile
drivers/dma/sh/rz-dmac.c [new file with mode: 0644]
drivers/dma/sh/usb-dmac.c
drivers/dma/sprd-dma.c
drivers/dma/stm32-dma.c
drivers/dma/tegra210-adma.c
drivers/dma/ti/k3-psil-j721e.c
drivers/dma/xilinx/xilinx_dma.c
drivers/dma/xilinx/zynqmp_dma.c
drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ras_eeprom.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
drivers/gpu/drm/amd/amdgpu/vi.c
drivers/gpu/drm/amd/amdkfd/kfd_svm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
drivers/gpu/drm/amd/display/dc/dcn303/dcn303_resource.c
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c
drivers/gpu/drm/amd/display/dc/dml/dcn20/display_mode_vba_20v2.c
drivers/gpu/drm/amd/pm/amdgpu_pm.c
drivers/gpu/drm/amd/pm/inc/amdgpu_smu.h
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c
drivers/gpu/drm/amd/pm/swsmu/smu11/arcturus_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/navi10_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/aldebaran_ppt.c
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
drivers/gpu/drm/i915/gt/intel_gt_requests.h
drivers/gpu/drm/mgag200/mgag200_pll.c
drivers/gpu/drm/panfrost/panfrost_mmu.c
drivers/gpu/drm/panfrost/panfrost_regs.h
drivers/gpu/drm/ttm/ttm_bo.c
drivers/gpu/drm/ttm/ttm_bo_util.c
drivers/gpu/drm/ttm/ttm_tt.c
drivers/gpu/drm/vc4/vc4_hdmi.c
drivers/infiniband/hw/bnxt_re/ib_verbs.c
drivers/infiniband/hw/hfi1/trace.c
drivers/infiniband/hw/mlx5/mr.c
drivers/infiniband/hw/qib/qib_sysfs.c
drivers/iommu/Kconfig
drivers/iommu/amd/init.c
drivers/iommu/intel/svm.c
drivers/md/dm-table.c
drivers/md/dm.c
drivers/misc/habanalabs/common/Makefile
drivers/misc/habanalabs/common/command_buffer.c
drivers/misc/habanalabs/common/command_submission.c
drivers/misc/habanalabs/common/context.c
drivers/misc/habanalabs/common/debugfs.c
drivers/misc/habanalabs/common/device.c
drivers/misc/habanalabs/common/firmware_if.c
drivers/misc/habanalabs/common/habanalabs.h
drivers/misc/habanalabs/common/habanalabs_drv.c
drivers/misc/habanalabs/common/habanalabs_ioctl.c
drivers/misc/habanalabs/common/hw_queue.c
drivers/misc/habanalabs/common/memory.c
drivers/misc/habanalabs/common/mmu/mmu_v1.c
drivers/misc/habanalabs/common/pci/pci.c
drivers/misc/habanalabs/common/state_dump.c [new file with mode: 0644]
drivers/misc/habanalabs/common/sysfs.c
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/gaudi/gaudiP.h
drivers/misc/habanalabs/gaudi/gaudi_coresight.c
drivers/misc/habanalabs/gaudi/gaudi_security.c
drivers/misc/habanalabs/goya/goya.c
drivers/misc/habanalabs/include/common/cpucp_if.h
drivers/misc/habanalabs/include/common/hl_boot_if.h
drivers/misc/habanalabs/include/gaudi/asic_reg/gaudi_regs.h
drivers/misc/habanalabs/include/gaudi/gaudi_masks.h
drivers/misc/habanalabs/include/gaudi/gaudi_reg_map.h
drivers/nvdimm/label.c
drivers/nvdimm/label.h
drivers/nvdimm/namespace_devs.c
drivers/nvdimm/nd.h
drivers/nvdimm/pmem.c
drivers/parisc/dino.c
drivers/platform/chrome/Makefile
drivers/platform/chrome/cros_ec_proto.c
drivers/platform/chrome/cros_ec_sensorhub_ring.c
drivers/platform/chrome/cros_ec_trace.h
drivers/platform/chrome/cros_ec_typec.c
drivers/s390/block/Kconfig
drivers/s390/block/Makefile
drivers/s390/block/xpram.c [deleted file]
drivers/s390/char/con3270.c
drivers/s390/char/ctrlchar.c
drivers/s390/char/hmcdrv_ftp.c
drivers/s390/char/sclp.c
drivers/s390/cio/blacklist.c
drivers/s390/cio/device.c
drivers/s390/cio/device_id.c
drivers/s390/crypto/zcrypt_api.c
drivers/s390/crypto/zcrypt_cex2a.c
drivers/s390/crypto/zcrypt_cex2c.c
drivers/s390/crypto/zcrypt_cex4.c
drivers/s390/crypto/zcrypt_msgtype50.c
drivers/s390/crypto/zcrypt_msgtype6.c
drivers/s390/scsi/zfcp_dbf.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_qdio.c
drivers/s390/scsi/zfcp_unit.c
drivers/video/fbdev/core/fbmem.c
fs/Kconfig
fs/attr.c
fs/btrfs/disk-io.c
fs/btrfs/ioctl.c
fs/btrfs/misc.h
fs/btrfs/ordered-data.c
fs/btrfs/volumes.c
fs/btrfs/volumes.h
fs/erofs/super.c
fs/eventpoll.c
fs/ext2/super.c
fs/ext4/super.c
fs/filesystems.c
fs/gfs2/inode.c
fs/hostfs/hostfs_kern.c
fs/io_uring.c
fs/ksmbd/ndr.c
fs/ksmbd/oplock.c
fs/ksmbd/smb2pdu.c
fs/ksmbd/smb_common.c
fs/ksmbd/smb_common.h
fs/ksmbd/smbacl.c
fs/ksmbd/smbacl.h
fs/ksmbd/transport_rdma.c
fs/ksmbd/vfs.c
fs/ksmbd/vfs.h
fs/ksmbd/vfs_cache.c
fs/ksmbd/vfs_cache.h
fs/notify/mark.c
fs/xfs/xfs_super.c
include/acpi/cppc_acpi.h
include/asm-generic/div64.h
include/drm/ttm/ttm_tt.h
include/linux/compat.h
include/linux/dax.h
include/linux/dmaengine.h
include/linux/energy_model.h
include/linux/eventpoll.h
include/linux/fs.h
include/linux/hugetlb.h
include/linux/mmap_lock.h
include/linux/platform_data/dma-dw.h
include/linux/syscalls.h
include/linux/uaccess.h
include/linux/uio.h
include/uapi/asm-generic/unistd.h
include/uapi/linux/cxl_mem.h
include/uapi/linux/idxd.h
include/uapi/linux/virtio_pcidev.h
include/uapi/misc/habanalabs.h
init/do_mounts.c
init/main.c
ipc/sem.c
kernel/compat.c
kernel/fork.c
kernel/kexec.c
kernel/sys_ni.c
kernel/trace/trace.c
kernel/trace/trace_boot.c
kernel/trace/trace_eprobe.c
kernel/trace/trace_events.c
kernel/trace/trace_events_hist.c
kernel/trace/trace_osnoise.c
kernel/trace/trace_output.c
kernel/trace/trace_synth.h
lib/logic_iomem.c
mm/hmm.c
mm/kmemleak.c
mm/maccess.c
mm/mempolicy.c
mm/migrate.c
mm/page_alloc.c
mm/vmscan.c
mm/vmstat.c
sound/isa/gus/gus_main.c
sound/isa/gus/interwave.c
sound/pci/vx222/vx222.c
sound/soc/codecs/rt5682.c
sound/soc/generic/audio-graph-card.c
sound/soc/intel/boards/Kconfig
sound/soc/mediatek/Kconfig
sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
sound/soc/rockchip/rockchip_i2s.c
sound/soc/samsung/s3c24xx_simtec.c
sound/usb/quirks.c
tools/bootconfig/main.c
tools/bootconfig/scripts/ftrace2bconf.sh
tools/bootconfig/test-bootconfig.sh
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc

index d431e2d..df4afbc 100644 (file)
@@ -128,6 +128,8 @@ Date:               Aug 28, 2020
 KernelVersion: 5.10.0
 Contact:       dmaengine@vger.kernel.org
 Description:   The last executed device administrative command's status/error.
+               Also last configuration error overloaded.
+               Writing to it will clear the status.
 
 What:          /sys/bus/dsa/devices/wq<m>.<n>/block_on_fault
 Date:          Oct 27, 2020
@@ -211,6 +213,13 @@ Contact:   dmaengine@vger.kernel.org
 Description:   Indicate whether ATS disable is turned on for the workqueue.
                0 indicates ATS is on, and 1 indicates ATS is off for the workqueue.
 
+What:          /sys/bus/dsa/devices/wq<m>.<n>/occupancy
+Date           May 25, 2021
+KernelVersion: 5.14.0
+Contact:       dmaengine@vger.kernel.org
+Description:   Show the current number of entries in this WQ if WQ Occupancy
+               Support bit WQ capabilities is 1.
+
 What:           /sys/bus/dsa/devices/engine<m>.<n>/group_id
 Date:           Oct 25, 2019
 KernelVersion:  5.6.0
index a5c28f6..284e2df 100644 (file)
@@ -215,6 +215,17 @@ Description:    Sets the skip reset on timeout option for the device. Value of
                 "0" means device will be reset in case some CS has timed out,
                 otherwise it will not be reset.
 
+What:           /sys/kernel/debug/habanalabs/hl<n>/state_dump
+Date:           Oct 2021
+KernelVersion:  5.15
+Contact:        ynudelman@habana.ai
+Description:    Gets the state dump occurring on a CS timeout or failure.
+                State dump is used for debug and is created each time in case of
+                a problem in a CS execution, before reset.
+                Reading from the node returns the newest state dump available.
+                Writing an integer X discards X state dumps, so that the
+                next read would return X+1-st newest state dump.
+
 What:           /sys/kernel/debug/habanalabs/hl<n>/stop_on_err
 Date:           Mar 2020
 KernelVersion:  5.6
@@ -230,6 +241,14 @@ Description:    Displays a list with information about the currently user
                 pointers (user virtual addresses) that are pinned and mapped
                 to DMA addresses
 
+What:           /sys/kernel/debug/habanalabs/hl<n>/userptr_lookup
+Date:           Aug 2021
+KernelVersion:  5.15
+Contact:        ogabbay@kernel.org
+Description:    Allows to search for specific user pointers (user virtual
+                addresses) that are pinned and mapped to DMA addresses, and see
+                their resolution to the specific dma address.
+
 What:           /sys/kernel/debug/habanalabs/hl<n>/vm
 Date:           Jan 2019
 KernelVersion:  5.1
index 6a79f2e..a1860fc 100644 (file)
@@ -178,7 +178,7 @@ update the boot loader and the kernel image itself as long as the boot
 loader passes the correct initrd file size. If by any chance, the boot
 loader passes a longer size, the kernel fails to find the bootconfig data.
 
-To do this operation, Linux kernel provides "bootconfig" command under
+To do this operation, Linux kernel provides ``bootconfig`` command under
 tools/bootconfig, which allows admin to apply or delete the config file
 to/from initrd image. You can build it by the following command::
 
@@ -196,6 +196,43 @@ To remove the config from the image, you can use -d option as below::
 Then add "bootconfig" on the normal kernel command line to tell the
 kernel to look for the bootconfig at the end of the initrd file.
 
+
+Kernel parameters via Boot Config
+=================================
+
+In addition to the kernel command line, the boot config can be used for
+passing the kernel parameters. All the key-value pairs under ``kernel``
+key will be passed to kernel cmdline directly. Moreover, the key-value
+pairs under ``init`` will be passed to init process via the cmdline.
+The parameters are concatinated with user-given kernel cmdline string
+as the following order, so that the command line parameter can override
+bootconfig parameters (this depends on how the subsystem handles parameters
+but in general, earlier parameter will be overwritten by later one.)::
+
+ [bootconfig params][cmdline params] -- [bootconfig init params][cmdline init params]
+
+Here is an example of the bootconfig file for kernel/init parameters.::
+
+ kernel {
+   root = 01234567-89ab-cdef-0123-456789abcd
+ }
+ init {
+  splash
+ }
+
+This will be copied into the kernel cmdline string as the following::
+
+ root="01234567-89ab-cdef-0123-456789abcd" -- splash
+
+If user gives some other command line like,::
+
+ ro bootconfig -- quiet
+
+The final kernel cmdline will be the following::
+
+ root="01234567-89ab-cdef-0123-456789abcd" ro bootconfig -- splash quiet
+
+
 Config File Limitation
 ======================
 
index 828d114..91ba391 100644 (file)
                        support for the idxd driver. By default it is set to
                        true (1).
 
+       idxd.tc_override= [HW]
+                       Format: <bool>
+                       Allow override of default traffic class configuration
+                       for the device. By default it is set to false (0).
+
        ieee754=        [MIPS] Select IEEE Std 754 conformance mode
                        Format: { strict | legacy | 2008 | relaxed }
                        Default: strict
index a4f9fe2..b193ee2 100644 (file)
@@ -24,13 +24,15 @@ properties:
     items:
       - description: Control and Status Register Slave Port
       - description: Descriptor Slave Port
-      - description: Response Slave Port
+      - description: Response Slave Port (Optional)
+    minItems: 2
 
   reg-names:
     items:
       - const: csr
       - const: desc
       - const: resp
+    minItems: 2
 
   interrupts:
     maxItems: 1
diff --git a/Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml b/Documentation/devicetree/bindings/dma/renesas,rz-dmac.yaml
new file mode 100644 (file)
index 0000000..7a4f415
--- /dev/null
@@ -0,0 +1,130 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/dma/renesas,rz-dmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/G2L DMA Controller
+
+maintainers:
+  - Biju Das <biju.das.jz@bp.renesas.com>
+
+allOf:
+  - $ref: "dma-controller.yaml#"
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r9a07g044-dmac # RZ/G2{L,LC}
+      - const: renesas,rz-dmac
+
+  reg:
+    items:
+      - description: Control and channel register block
+      - description: DMA extended resource selector block
+
+  interrupts:
+    maxItems: 17
+
+  interrupt-names:
+    items:
+      - const: error
+      - const: ch0
+      - const: ch1
+      - const: ch2
+      - const: ch3
+      - const: ch4
+      - const: ch5
+      - const: ch6
+      - const: ch7
+      - const: ch8
+      - const: ch9
+      - const: ch10
+      - const: ch11
+      - const: ch12
+      - const: ch13
+      - const: ch14
+      - const: ch15
+
+  clocks:
+    items:
+      - description: DMA main clock
+      - description: DMA register access clock
+
+  '#dma-cells':
+    const: 1
+    description:
+      The cell specifies the encoded MID/RID values of the DMAC port
+      connected to the DMA client and the slave channel configuration
+      parameters.
+      bits[0:9] - Specifies MID/RID value
+      bit[10] - Specifies DMA request high enable (HIEN)
+      bit[11] - Specifies DMA request detection type (LVL)
+      bits[12:14] - Specifies DMAACK output mode (AM)
+      bit[15] - Specifies Transfer Mode (TM)
+
+  dma-channels:
+    const: 16
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    items:
+      - description: Reset for DMA ARESETN reset terminal
+      - description: Reset for DMA RST_ASYNC reset terminal
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - interrupt-names
+  - clocks
+  - '#dma-cells'
+  - dma-channels
+  - power-domains
+  - resets
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/r9a07g044-cpg.h>
+
+    dmac: dma-controller@11820000 {
+        compatible = "renesas,r9a07g044-dmac",
+                     "renesas,rz-dmac";
+        reg = <0x11820000 0x10000>,
+              <0x11830000 0x10000>;
+        interrupts = <GIC_SPI 141 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 125 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 126 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 127 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 128 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 129 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 130 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 131 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 132 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 133 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 134 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 135 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 136 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 137 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 138 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 139 IRQ_TYPE_EDGE_RISING>,
+                     <GIC_SPI 140 IRQ_TYPE_EDGE_RISING>;
+        interrupt-names = "error",
+                          "ch0", "ch1", "ch2", "ch3",
+                          "ch4", "ch5", "ch6", "ch7",
+                          "ch8", "ch9", "ch10", "ch11",
+                          "ch12", "ch13", "ch14", "ch15";
+        clocks = <&cpg CPG_MOD R9A07G044_DMAC_ACLK>,
+                 <&cpg CPG_MOD R9A07G044_DMAC_PCLK>;
+        power-domains = <&cpg>;
+        resets = <&cpg R9A07G044_DMAC_ARESETN>,
+                 <&cpg R9A07G044_DMAC_RST_ASYNC>;
+        #dma-cells = <1>;
+        dma-channels = <16>;
+    };
index 2a5325f..4bf676f 100644 (file)
@@ -40,6 +40,13 @@ description: |
          0x0: FIFO mode with threshold selectable with bit 0-1
          0x1: Direct mode: each DMA request immediately initiates a transfer
               from/to the memory, FIFO is bypassed.
+       -bit 4: alternative DMA request/acknowledge protocol
+         0x0: Use standard DMA ACK management, where ACK signal is maintained
+              up to the removal of request and transfer completion
+         0x1: Use alternative DMA ACK management, where ACK de-assertion does
+              not wait for the de-assertion of the REQuest, ACK is only managed
+              by transfer completion. This must only be used on channels
+              managing transfers for STM32 USART/UART.
 
 
 maintainers:
index 61802a1..d370c98 100644 (file)
@@ -21,6 +21,7 @@ properties:
       - fsl,imx8mn-rpmsg-audio
       - fsl,imx8mm-rpmsg-audio
       - fsl,imx8mp-rpmsg-audio
+      - fsl,imx8ulp-rpmsg-audio
 
   model:
     $ref: /schemas/types.yaml#/definitions/string
index 53e9434..dcf790b 100644 (file)
@@ -130,36 +130,34 @@ additionalProperties: false
 
 examples:
   - |
-    #include <dt-bindings/clock/mt8195-clk.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
     #include <dt-bindings/interrupt-controller/irq.h>
-    #include <dt-bindings/power/mt8195-power.h>
 
     afe: mt8195-afe-pcm@10890000 {
         compatible = "mediatek,mt8195-audio";
         reg = <0x10890000 0x10000>;
         interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
         mediatek,topckgen = <&topckgen>;
-        power-domains = <&spm MT8195_POWER_DOMAIN_AUDIO>;
+        power-domains = <&spm 7>; //MT8195_POWER_DOMAIN_AUDIO
         clocks = <&clk26m>,
-                 <&topckgen CLK_TOP_APLL1>,
-                 <&topckgen CLK_TOP_APLL2>,
-                 <&topckgen CLK_TOP_APLL12_DIV0>,
-                 <&topckgen CLK_TOP_APLL12_DIV1>,
-                 <&topckgen CLK_TOP_APLL12_DIV2>,
-                 <&topckgen CLK_TOP_APLL12_DIV3>,
-                 <&topckgen CLK_TOP_APLL12_DIV9>,
-                 <&topckgen CLK_TOP_A1SYS_HP_SEL>,
-                 <&topckgen CLK_TOP_AUD_INTBUS_SEL>,
-                 <&topckgen CLK_TOP_AUDIO_H_SEL>,
-                 <&topckgen CLK_TOP_AUDIO_LOCAL_BUS_SEL>,
-                 <&topckgen CLK_TOP_DPTX_M_SEL>,
-                 <&topckgen CLK_TOP_I2SO1_M_SEL>,
-                 <&topckgen CLK_TOP_I2SO2_M_SEL>,
-                 <&topckgen CLK_TOP_I2SI1_M_SEL>,
-                 <&topckgen CLK_TOP_I2SI2_M_SEL>,
-                 <&infracfg_ao CLK_INFRA_AO_AUDIO_26M_B>,
-                 <&scp_adsp CLK_SCP_ADSP_AUDIODSP>;
+                 <&topckgen 163>, //CLK_TOP_APLL1
+                 <&topckgen 166>, //CLK_TOP_APLL2
+                 <&topckgen 233>, //CLK_TOP_APLL12_DIV0
+                 <&topckgen 234>, //CLK_TOP_APLL12_DIV1
+                 <&topckgen 235>, //CLK_TOP_APLL12_DIV2
+                 <&topckgen 236>, //CLK_TOP_APLL12_DIV3
+                 <&topckgen 238>, //CLK_TOP_APLL12_DIV9
+                 <&topckgen 100>, //CLK_TOP_A1SYS_HP_SEL
+                 <&topckgen 33>, //CLK_TOP_AUD_INTBUS_SEL
+                 <&topckgen 34>, //CLK_TOP_AUDIO_H_SEL
+                 <&topckgen 107>, //CLK_TOP_AUDIO_LOCAL_BUS_SEL
+                 <&topckgen 98>, //CLK_TOP_DPTX_M_SEL
+                 <&topckgen 94>, //CLK_TOP_I2SO1_M_SEL
+                 <&topckgen 95>, //CLK_TOP_I2SO2_M_SEL
+                 <&topckgen 96>, //CLK_TOP_I2SI1_M_SEL
+                 <&topckgen 97>, //CLK_TOP_I2SI2_M_SEL
+                 <&infracfg_ao 50>, //CLK_INFRA_AO_AUDIO_26M_B
+                 <&scp_adsp 0>; //CLK_SCP_ADSP_AUDIODSP
         clock-names = "clk26m",
                       "apll1_ck",
                       "apll2_ck",
index 487ce4f..50ebcda 100644 (file)
@@ -36,9 +36,15 @@ CXL Core
 .. kernel-doc:: drivers/cxl/cxl.h
    :internal:
 
-.. kernel-doc:: drivers/cxl/core.c
+.. kernel-doc:: drivers/cxl/core/bus.c
    :doc: cxl core
 
+.. kernel-doc:: drivers/cxl/core/pmem.c
+   :doc: cxl pmem
+
+.. kernel-doc:: drivers/cxl/core/regs.c
+   :doc: cxl registers
+
 External Interfaces
 ===================
 
index d5a73fa..8126bea 100644 (file)
@@ -37,7 +37,7 @@ TTM initialization
     This section is outdated.
 
 Drivers wishing to support TTM must pass a filled :c:type:`ttm_bo_driver
-<ttm_bo_driver>` structure to ttm_bo_device_init, together with an
+<ttm_bo_driver>` structure to ttm_device_init, together with an
 initialized global reference to the memory manager.  The ttm_bo_driver
 structure contains several fields with function pointers for
 initializing the TTM, allocating and freeing memory, waiting for command
index 60ac091..8a2788a 100644 (file)
@@ -101,8 +101,7 @@ subsystems which use EM might rely on this flag to check if all EM devices use
 the same scale. If there are different scales, these subsystems might decide
 to: return warning/error, stop working or panic.
 See Section 3. for an example of driver implementing this
-callback, and kernel/power/energy_model.c for further documentation on this
-API.
+callback, or Section 2.4 for further documentation on this API
 
 
 2.3 Accessing performance domains
@@ -123,7 +122,17 @@ em_cpu_energy() API. The estimation is performed assuming that the schedutil
 CPUfreq governor is in use in case of CPU device. Currently this calculation is
 not provided for other type of devices.
 
-More details about the above APIs can be found in include/linux/energy_model.h.
+More details about the above APIs can be found in ``<linux/energy_model.h>``
+or in Section 2.4
+
+
+2.4 Description details of this API
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+.. kernel-doc:: include/linux/energy_model.h
+   :internal:
+
+.. kernel-doc:: kernel/power/energy_model.c
+   :export:
 
 
 3. Example driver
index 0eaa69f..0590fe1 100644 (file)
@@ -333,7 +333,7 @@ S:  Maintained
 F:     drivers/platform/x86/acer-wmi.c
 
 ACPI
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Len Brown <lenb@kernel.org>
 L:     linux-acpi@vger.kernel.org
 S:     Supported
@@ -354,7 +354,7 @@ F:  include/linux/fwnode.h
 F:     tools/power/acpi/
 
 ACPI APEI
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Len Brown <lenb@kernel.org>
 R:     James Morse <james.morse@arm.com>
 R:     Tony Luck <tony.luck@intel.com>
@@ -402,7 +402,7 @@ S:  Maintained
 F:     drivers/platform/x86/i2c-multi-instantiate.c
 
 ACPI PMIC DRIVERS
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Len Brown <lenb@kernel.org>
 R:     Andy Shevchenko <andy@kernel.org>
 R:     Mika Westerberg <mika.westerberg@linux.intel.com>
@@ -984,6 +984,12 @@ S: Supported
 T:     git https://gitlab.freedesktop.org/agd5f/linux.git
 F:     drivers/gpu/drm/amd/pm/powerplay/
 
+AMD PTDMA DRIVER
+M:     Sanjay R Mehta <sanju.mehta@amd.com>
+L:     dmaengine@vger.kernel.org
+S:     Maintained
+F:     drivers/dma/ptdma/
+
 AMD SEATTLE DEVICE TREE SUPPORT
 M:     Brijesh Singh <brijeshkumar.singh@amd.com>
 M:     Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
@@ -2327,14 +2333,14 @@ N:      oxnas
 
 ARM/PALM TREO SUPPORT
 M:     Tomas Cech <sleep_walker@suse.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 W:     http://hackndev.com
 F:     arch/arm/mach-pxa/palmtreo.*
 
 ARM/PALMTX,PALMT5,PALMLD,PALMTE2,PALMTC SUPPORT
 M:     Marek Vasut <marek.vasut@gmail.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 W:     http://hackndev.com
 F:     arch/arm/mach-pxa/include/mach/palmld.h
@@ -2348,7 +2354,7 @@ F:        arch/arm/mach-pxa/palmtx.c
 
 ARM/PALMZ72 SUPPORT
 M:     Sergey Lapin <slapin@ossfans.org>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 W:     http://hackndev.com
 F:     arch/arm/mach-pxa/palmz72.*
@@ -2518,7 +2524,7 @@ N:        s5pv210
 
 ARM/SAMSUNG S5P SERIES 2D GRAPHICS ACCELERATION (G2D) SUPPORT
 M:     Andrzej Hajda <a.hajda@samsung.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/platform/s5p-g2d/
@@ -2535,14 +2541,14 @@ ARM/SAMSUNG S5P SERIES JPEG CODEC SUPPORT
 M:     Andrzej Pietrasiewicz <andrzejtp2010@gmail.com>
 M:     Jacek Anaszewski <jacek.anaszewski@gmail.com>
 M:     Sylwester Nawrocki <s.nawrocki@samsung.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/platform/s5p-jpeg/
 
 ARM/SAMSUNG S5P SERIES Multi Format Codec (MFC) SUPPORT
 M:     Andrzej Hajda <a.hajda@samsung.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-media@vger.kernel.org
 S:     Maintained
 F:     drivers/media/platform/s5p-mfc/
@@ -3561,7 +3567,7 @@ BROADCOM BCM5301X ARM ARCHITECTURE
 M:     Hauke Mehrtens <hauke@hauke-m.de>
 M:     Rafał Miłecki <zajec5@gmail.com>
 M:     bcm-kernel-feedback-list@broadcom.com
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm/boot/dts/bcm470*
 F:     arch/arm/boot/dts/bcm5301*
@@ -3571,7 +3577,7 @@ F:        arch/arm/mach-bcm/bcm_5301x.c
 BROADCOM BCM53573 ARM ARCHITECTURE
 M:     Rafał Miłecki <rafal@milecki.pl>
 L:     bcm-kernel-feedback-list@broadcom.com
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm/boot/dts/bcm47189*
 F:     arch/arm/boot/dts/bcm53573*
@@ -4820,7 +4826,7 @@ W:        http://www.arm.com/products/processors/technologies/biglittleprocessing.php
 F:     drivers/cpufreq/vexpress-spc-cpufreq.c
 
 CPU FREQUENCY SCALING FRAMEWORK
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Viresh Kumar <viresh.kumar@linaro.org>
 L:     linux-pm@vger.kernel.org
 S:     Maintained
@@ -4838,7 +4844,7 @@ F:        kernel/sched/cpufreq*.c
 F:     tools/testing/selftests/cpufreq/
 
 CPU IDLE TIME MANAGEMENT FRAMEWORK
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Daniel Lezcano <daniel.lezcano@linaro.org>
 L:     linux-pm@vger.kernel.org
 S:     Maintained
@@ -4867,7 +4873,7 @@ CPUIDLE DRIVER - ARM BIG LITTLE
 M:     Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 M:     Daniel Lezcano <daniel.lezcano@linaro.org>
 L:     linux-pm@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 T:     git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git
 F:     drivers/cpuidle/cpuidle-big_little.c
@@ -4887,14 +4893,14 @@ CPUIDLE DRIVER - ARM PSCI
 M:     Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 M:     Sudeep Holla <sudeep.holla@arm.com>
 L:     linux-pm@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Supported
 F:     drivers/cpuidle/cpuidle-psci.c
 
 CPUIDLE DRIVER - ARM PSCI PM DOMAIN
 M:     Ulf Hansson <ulf.hansson@linaro.org>
 L:     linux-pm@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Supported
 F:     drivers/cpuidle/cpuidle-psci.h
 F:     drivers/cpuidle/cpuidle-psci-domain.c
@@ -7265,7 +7271,7 @@ F:        tools/firewire/
 
 FIRMWARE FRAMEWORK FOR ARMV8-A
 M:     Sudeep Holla <sudeep.holla@arm.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     drivers/firmware/arm_ffa/
 F:     include/linux/arm_ffa.h
@@ -7444,7 +7450,7 @@ F:        include/linux/platform_data/video-imxfb.h
 
 FREESCALE IMX DDR PMU DRIVER
 M:     Frank Li <Frank.li@nxp.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/admin-guide/perf/imx-ddr.rst
 F:     Documentation/devicetree/bindings/perf/fsl-imx-ddr.yaml
@@ -7536,7 +7542,7 @@ F:        drivers/tty/serial/ucc_uart.c
 FREESCALE SOC DRIVERS
 M:     Li Yang <leoyang.li@nxp.com>
 L:     linuxppc-dev@lists.ozlabs.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/misc/fsl,dpaa2-console.yaml
 F:     Documentation/devicetree/bindings/soc/fsl/
@@ -7584,7 +7590,7 @@ W:        ftp://ftp.openlinux.org/pub/people/hch/vxfs
 F:     fs/freevxfs/
 
 FREEZER
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Pavel Machek <pavel@ucw.cz>
 L:     linux-pm@vger.kernel.org
 S:     Supported
@@ -7837,7 +7843,7 @@ S:        Supported
 F:     drivers/i2c/muxes/i2c-demux-pinctrl.c
 
 GENERIC PM DOMAINS
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Kevin Hilman <khilman@kernel.org>
 M:     Ulf Hansson <ulf.hansson@linaro.org>
 L:     linux-pm@vger.kernel.org
@@ -8303,7 +8309,7 @@ W:        http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
 F:     drivers/video/fbdev/hgafb.c
 
 HIBERNATION (aka Software Suspend, aka swsusp)
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Pavel Machek <pavel@ucw.cz>
 L:     linux-pm@vger.kernel.org
 S:     Supported
@@ -11184,7 +11190,7 @@ F:      drivers/net/wireless/marvell/libertas/
 
 MARVELL MACCHIATOBIN SUPPORT
 M:     Russell King <linux@armlinux.org.uk>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     arch/arm64/boot/dts/marvell/armada-8040-mcbin.dts
 
@@ -14265,7 +14271,7 @@ F:      drivers/pci/controller/pcie-altera.c
 PCI DRIVER FOR APPLIEDMICRO XGENE
 M:     Toan Le <toan@os.amperecomputing.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/pci/xgene-pci.txt
 F:     drivers/pci/controller/pci-xgene.c
@@ -14273,7 +14279,7 @@ F:      drivers/pci/controller/pci-xgene.c
 PCI DRIVER FOR ARM VERSATILE PLATFORM
 M:     Rob Herring <robh@kernel.org>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/pci/versatile.yaml
 F:     drivers/pci/controller/pci-versatile.c
@@ -14281,7 +14287,7 @@ F:      drivers/pci/controller/pci-versatile.c
 PCI DRIVER FOR ARMADA 8K
 M:     Thomas Petazzoni <thomas.petazzoni@bootlin.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/pci/pci-armada8k.txt
 F:     drivers/pci/controller/dwc/pcie-armada8k.c
@@ -14299,7 +14305,7 @@ M:      Mingkai Hu <mingkai.hu@nxp.com>
 M:     Roy Zang <roy.zang@nxp.com>
 L:     linuxppc-dev@lists.ozlabs.org
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     drivers/pci/controller/dwc/*layerscape*
 
@@ -14379,7 +14385,7 @@ F:      drivers/pci/controller/pci-tegra.c
 PCI DRIVER FOR NXP LAYERSCAPE GEN4 CONTROLLER
 M:     Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/pci/layerscape-pcie-gen4.txt
 F:     drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c
@@ -14414,7 +14420,7 @@ PCI DRIVER FOR TI DRA7XX/J721E
 M:     Kishon Vijay Abraham I <kishon@ti.com>
 L:     linux-omap@vger.kernel.org
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Supported
 F:     Documentation/devicetree/bindings/pci/ti-pci.txt
 F:     drivers/pci/controller/cadence/pci-j721e.c
@@ -14470,7 +14476,7 @@ F:      drivers/pci/controller/pcie-altera-msi.c
 PCI MSI DRIVER FOR APPLIEDMICRO XGENE
 M:     Toan Le <toan@os.amperecomputing.com>
 L:     linux-pci@vger.kernel.org
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/pci/xgene-pci-msi.txt
 F:     drivers/pci/controller/pci-xgene-msi.c
@@ -14962,7 +14968,7 @@ F:      kernel/time/*timer*
 F:     kernel/time/namespace.c
 
 POWER MANAGEMENT CORE
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 L:     linux-pm@vger.kernel.org
 S:     Supported
 B:     https://bugzilla.kernel.org
@@ -14987,7 +14993,7 @@ F:      include/linux/dtpm.h
 POWER STATE COORDINATION INTERFACE (PSCI)
 M:     Mark Rutland <mark.rutland@arm.com>
 M:     Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     drivers/firmware/psci/
 F:     include/linux/psci.h
@@ -15512,7 +15518,7 @@ F:      arch/hexagon/
 
 QUALCOMM HIDMA DRIVER
 M:     Sinan Kaya <okaya@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 L:     linux-arm-msm@vger.kernel.org
 L:     dmaengine@vger.kernel.org
 S:     Supported
@@ -17226,7 +17232,7 @@ SECURE MONITOR CALL(SMC) CALLING CONVENTION (SMCCC)
 M:     Mark Rutland <mark.rutland@arm.com>
 M:     Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
 M:     Sudeep Holla <sudeep.holla@arm.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     drivers/firmware/smccc/
 F:     include/linux/arm-smccc.h
@@ -17343,7 +17349,7 @@ F:      drivers/media/pci/solo6x10/
 
 SOFTWARE DELEGATED EXCEPTION INTERFACE (SDEI)
 M:     James Morse <james.morse@arm.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/arm/firmware/sdei.txt
 F:     drivers/firmware/arm_sdei.c
@@ -17940,7 +17946,7 @@ F:      arch/sh/
 F:     drivers/sh/
 
 SUSPEND TO RAM
-M:     "Rafael J. Wysocki" <rjw@rjwysocki.net>
+M:     "Rafael J. Wysocki" <rafael@kernel.org>
 M:     Len Brown <len.brown@intel.com>
 M:     Pavel Machek <pavel@ucw.cz>
 L:     linux-pm@vger.kernel.org
@@ -18130,7 +18136,7 @@ F:      drivers/mfd/syscon.c
 SYSTEM CONTROL & POWER/MANAGEMENT INTERFACE (SCPI/SCMI) Message Protocol drivers
 M:     Sudeep Holla <sudeep.holla@arm.com>
 R:     Cristian Marussi <cristian.marussi@arm.com>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/firmware/arm,sc[mp]i.yaml
 F:     drivers/clk/clk-sc[mp]i.c
@@ -18503,7 +18509,7 @@ TEXAS INSTRUMENTS' SYSTEM CONTROL INTERFACE (TISCI) PROTOCOL DRIVER
 M:     Nishanth Menon <nm@ti.com>
 M:     Tero Kristo <kristo@kernel.org>
 M:     Santosh Shilimkar <ssantosh@kernel.org>
-L:     linux-arm-kernel@lists.infradead.org
+L:     linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 S:     Maintained
 F:     Documentation/devicetree/bindings/arm/keystone/ti,k3-sci-common.yaml
 F:     Documentation/devicetree/bindings/arm/keystone/ti,sci.txt
index 9986302..fc19642 100644 (file)
@@ -124,7 +124,6 @@ config ARM
        select PCI_SYSCALL if PCI
        select PERF_USE_VMALLOC
        select RTC_LIB
-       select SET_FS
        select SYS_SUPPORTS_APM_EMULATION
        select TRACE_IRQFLAGS_SUPPORT if !CPU_V7M
        # Above selects are sorted alphabetically; please add new ones
index 173da68..847c31e 100644 (file)
@@ -308,7 +308,8 @@ $(BOOT_TARGETS): vmlinux
        @$(kecho) '  Kernel: $(boot)/$@ is ready'
 
 $(INSTALL_TARGETS):
-       $(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
+       $(CONFIG_SHELL) $(srctree)/$(boot)/install.sh "$(KERNELRELEASE)" \
+       $(boot)/$(patsubst %install,%Image,$@) System.map "$(INSTALL_PATH)"
 
 PHONY += vdso_install
 vdso_install:
index 0b3cd7a..54a09f9 100644 (file)
@@ -96,23 +96,11 @@ $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
 $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
        $(call if_changed,objcopy)
 
-PHONY += initrd install zinstall uinstall
+PHONY += initrd
 initrd:
        @test "$(INITRD_PHYS)" != "" || \
        (echo This machine does not support INITRD; exit -1)
        @test "$(INITRD)" != "" || \
        (echo You must specify INITRD; exit -1)
 
-install:
-       $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
-       $(obj)/Image System.map "$(INSTALL_PATH)"
-
-zinstall:
-       $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
-       $(obj)/zImage System.map "$(INSTALL_PATH)"
-
-uinstall:
-       $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
-       $(obj)/uImage System.map "$(INSTALL_PATH)"
-
 subdir-            := bootp compressed dts
index 9d91ae1..91265e7 100644 (file)
@@ -85,6 +85,8 @@ compress-$(CONFIG_KERNEL_LZ4)  = lz4
 libfdt_objs := fdt_rw.o fdt_ro.o fdt_wip.o fdt.o
 
 ifeq ($(CONFIG_ARM_ATAG_DTB_COMPAT),y)
+CFLAGS_REMOVE_atags_to_fdt.o += -Wframe-larger-than=${CONFIG_FRAME_WARN}
+CFLAGS_atags_to_fdt.o += -Wframe-larger-than=1280
 OBJS   += $(libfdt_objs) atags_to_fdt.o
 endif
 ifeq ($(CONFIG_USE_OF),y)
index 595e538..4b69cf8 100644 (file)
@@ -52,17 +52,6 @@ static inline uint32_t __div64_32(uint64_t *n, uint32_t base)
 
 #else
 
-/*
- * gcc versions earlier than 4.0 are simply too problematic for the
- * __div64_const32() code in asm-generic/div64.h. First there is
- * gcc PR 15089 that tend to trig on more complex constructs, spurious
- * .global __udivsi3 are inserted even if none of those symbols are
- * referenced in the generated code, and those gcc versions are not able
- * to do constant propagation on long long values anyway.
- */
-
-#define __div64_const32_is_OK (__GNUC__ >= 4)
-
 static inline uint64_t __arch_xprod_64(uint64_t m, uint64_t n, bool bias)
 {
        unsigned long long res;
index c50e383..f3bb8a2 100644 (file)
@@ -2,10 +2,6 @@
 #ifndef _ARCH_ARM_GPIO_H
 #define _ARCH_ARM_GPIO_H
 
-#if CONFIG_ARCH_NR_GPIO > 0
-#define ARCH_NR_GPIOS CONFIG_ARCH_NR_GPIO
-#endif
-
 /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */
 #include <asm-generic/gpio.h>
 
index 91d6b78..93051e2 100644 (file)
@@ -19,7 +19,6 @@ struct pt_regs {
 struct svc_pt_regs {
        struct pt_regs regs;
        u32 dacr;
-       u32 addr_limit;
 };
 
 #define to_svc_pt_regs(r) container_of(r, struct svc_pt_regs, regs)
index fd02761..24c19d6 100644 (file)
@@ -22,7 +22,21 @@ extern const unsigned long sys_call_table[];
 static inline int syscall_get_nr(struct task_struct *task,
                                 struct pt_regs *regs)
 {
-       return task_thread_info(task)->syscall;
+       if (IS_ENABLED(CONFIG_AEABI) && !IS_ENABLED(CONFIG_OABI_COMPAT))
+               return task_thread_info(task)->abi_syscall;
+
+       return task_thread_info(task)->abi_syscall & __NR_SYSCALL_MASK;
+}
+
+static inline bool __in_oabi_syscall(struct task_struct *task)
+{
+       return IS_ENABLED(CONFIG_OABI_COMPAT) &&
+               (task_thread_info(task)->abi_syscall & __NR_OABI_SYSCALL_BASE);
+}
+
+static inline bool in_oabi_syscall(void)
+{
+       return __in_oabi_syscall(current);
 }
 
 static inline void syscall_rollback(struct task_struct *task,
index a02799b..9a18da3 100644 (file)
@@ -31,8 +31,6 @@ struct task_struct;
 
 #include <asm/types.h>
 
-typedef unsigned long mm_segment_t;
-
 struct cpu_context_save {
        __u32   r4;
        __u32   r5;
@@ -54,7 +52,6 @@ struct cpu_context_save {
 struct thread_info {
        unsigned long           flags;          /* low level flags */
        int                     preempt_count;  /* 0 => preemptable, <0 => bug */
-       mm_segment_t            addr_limit;     /* address limit */
        struct task_struct      *task;          /* main task structure */
        __u32                   cpu;            /* cpu */
        __u32                   cpu_domain;     /* cpu domain */
@@ -62,7 +59,7 @@ struct thread_info {
        unsigned long           stack_canary;
 #endif
        struct cpu_context_save cpu_context;    /* cpu context */
-       __u32                   syscall;        /* syscall number */
+       __u32                   abi_syscall;    /* ABI type and syscall nr */
        __u8                    used_cp[16];    /* thread used copro */
        unsigned long           tp_value[2];    /* TLS registers */
        union fp_state          fpstate __attribute__((aligned(8)));
@@ -77,7 +74,6 @@ struct thread_info {
        .task           = &tsk,                                         \
        .flags          = 0,                                            \
        .preempt_count  = INIT_PREEMPT_COUNT,                           \
-       .addr_limit     = KERNEL_DS,                                    \
 }
 
 /*
index e6eb7a2..6451a43 100644 (file)
         * if \disable is set.
         */
        .macro  uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
-       ldr     \tmp1, [\tsk, #TI_ADDR_LIMIT]
-       ldr     \tmp2, =TASK_SIZE
-       str     \tmp2, [\tsk, #TI_ADDR_LIMIT]
  DACR( mrc     p15, 0, \tmp0, c3, c0, 0)
  DACR( str     \tmp0, [sp, #SVC_DACR])
-       str     \tmp1, [sp, #SVC_ADDR_LIMIT]
        .if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN)
        /* kernel=client, user=no access */
        mov     \tmp2, #DACR_UACCESS_DISABLE
 
        /* Restore the user access state previously saved by uaccess_entry */
        .macro  uaccess_exit, tsk, tmp0, tmp1
-       ldr     \tmp1, [sp, #SVC_ADDR_LIMIT]
  DACR( ldr     \tmp0, [sp, #SVC_DACR])
-       str     \tmp1, [\tsk, #TI_ADDR_LIMIT]
  DACR( mcr     p15, 0, \tmp0, c3, c0, 0)
        .endm
 
index a13d902..084d1c0 100644 (file)
@@ -52,32 +52,8 @@ static __always_inline void uaccess_restore(unsigned int flags)
 extern int __get_user_bad(void);
 extern int __put_user_bad(void);
 
-/*
- * Note that this is actually 0x1,0000,0000
- */
-#define KERNEL_DS      0x00000000
-
 #ifdef CONFIG_MMU
 
-#define USER_DS                TASK_SIZE
-#define get_fs()       (current_thread_info()->addr_limit)
-
-static inline void set_fs(mm_segment_t fs)
-{
-       current_thread_info()->addr_limit = fs;
-
-       /*
-        * Prevent a mispredicted conditional call to set_fs from forwarding
-        * the wrong address limit to access_ok under speculation.
-        */
-       dsb(nsh);
-       isb();
-
-       modify_domain(DOMAIN_KERNEL, fs ? DOMAIN_CLIENT : DOMAIN_MANAGER);
-}
-
-#define uaccess_kernel()       (get_fs() == KERNEL_DS)
-
 /*
  * We use 33-bit arithmetic here.  Success returns zero, failure returns
  * addr_limit.  We take advantage that addr_limit will be zero for KERNEL_DS,
@@ -89,7 +65,7 @@ static inline void set_fs(mm_segment_t fs)
        __asm__(".syntax unified\n" \
                "adds %1, %2, %3; sbcscc %1, %1, %0; movcc %0, #0" \
                : "=&r" (flag), "=&r" (roksum) \
-               : "r" (addr), "Ir" (size), "0" (current_thread_info()->addr_limit) \
+               : "r" (addr), "Ir" (size), "0" (TASK_SIZE) \
                : "cc"); \
        flag; })
 
@@ -120,7 +96,7 @@ static inline void __user *__uaccess_mask_range_ptr(const void __user *ptr,
        "       subshs  %1, %1, %2\n"
        "       movlo   %0, #0\n"
        : "+r" (safe_ptr), "=&r" (tmp)
-       : "r" (size), "r" (current_thread_info()->addr_limit)
+       : "r" (size), "r" (TASK_SIZE)
        : "cc");
 
        csdb();
@@ -194,7 +170,7 @@ extern int __get_user_64t_4(void *);
 
 #define __get_user_check(x, p)                                         \
        ({                                                              \
-               unsigned long __limit = current_thread_info()->addr_limit - 1; \
+               unsigned long __limit = TASK_SIZE - 1; \
                register typeof(*(p)) __user *__p asm("r0") = (p);      \
                register __inttype(x) __r2 asm("r2");                   \
                register unsigned long __l asm("r1") = __limit;         \
@@ -245,7 +221,7 @@ extern int __put_user_8(void *, unsigned long long);
 
 #define __put_user_check(__pu_val, __ptr, __err, __s)                  \
        ({                                                              \
-               unsigned long __limit = current_thread_info()->addr_limit - 1; \
+               unsigned long __limit = TASK_SIZE - 1; \
                register typeof(__pu_val) __r2 asm("r2") = __pu_val;    \
                register const void __user *__p asm("r0") = __ptr;      \
                register unsigned long __l asm("r1") = __limit;         \
@@ -262,19 +238,8 @@ extern int __put_user_8(void *, unsigned long long);
 
 #else /* CONFIG_MMU */
 
-/*
- * uClinux has only one addr space, so has simplified address limits.
- */
-#define USER_DS                        KERNEL_DS
-
-#define uaccess_kernel()       (true)
 #define __addr_ok(addr)                ((void)(addr), 1)
 #define __range_ok(addr, size) ((void)(addr), 0)
-#define get_fs()               (KERNEL_DS)
-
-static inline void set_fs(mm_segment_t fs)
-{
-}
 
 #define get_user(x, p) __get_user(x, p)
 #define __put_user_check __put_user_nocheck
@@ -283,9 +248,6 @@ static inline void set_fs(mm_segment_t fs)
 
 #define access_ok(addr, size)  (__range_ok(addr, size) == 0)
 
-#define user_addr_max() \
-       (uaccess_kernel() ? ~0UL : get_fs())
-
 #ifdef CONFIG_CPU_SPECTRE
 /*
  * When mitigating Spectre variant 1, it is not worth fixing the non-
@@ -308,11 +270,11 @@ static inline void set_fs(mm_segment_t fs)
 #define __get_user(x, ptr)                                             \
 ({                                                                     \
        long __gu_err = 0;                                              \
-       __get_user_err((x), (ptr), __gu_err);                           \
+       __get_user_err((x), (ptr), __gu_err, TUSER());                  \
        __gu_err;                                                       \
 })
 
-#define __get_user_err(x, ptr, err)                                    \
+#define __get_user_err(x, ptr, err, __t)                               \
 do {                                                                   \
        unsigned long __gu_addr = (unsigned long)(ptr);                 \
        unsigned long __gu_val;                                         \
@@ -321,18 +283,19 @@ do {                                                                      \
        might_fault();                                                  \
        __ua_flags = uaccess_save_and_enable();                         \
        switch (sizeof(*(ptr))) {                                       \
-       case 1: __get_user_asm_byte(__gu_val, __gu_addr, err);  break;  \
-       case 2: __get_user_asm_half(__gu_val, __gu_addr, err);  break;  \
-       case 4: __get_user_asm_word(__gu_val, __gu_addr, err);  break;  \
+       case 1: __get_user_asm_byte(__gu_val, __gu_addr, err, __t); break;      \
+       case 2: __get_user_asm_half(__gu_val, __gu_addr, err, __t); break;      \
+       case 4: __get_user_asm_word(__gu_val, __gu_addr, err, __t); break;      \
        default: (__gu_val) = __get_user_bad();                         \
        }                                                               \
        uaccess_restore(__ua_flags);                                    \
        (x) = (__typeof__(*(ptr)))__gu_val;                             \
 } while (0)
+#endif
 
 #define __get_user_asm(x, addr, err, instr)                    \
        __asm__ __volatile__(                                   \
-       "1:     " TUSER(instr) " %1, [%2], #0\n"                \
+       "1:     " instr " %1, [%2], #0\n"                       \
        "2:\n"                                                  \
        "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
@@ -348,40 +311,38 @@ do {                                                                      \
        : "r" (addr), "i" (-EFAULT)                             \
        : "cc")
 
-#define __get_user_asm_byte(x, addr, err)                      \
-       __get_user_asm(x, addr, err, ldrb)
+#define __get_user_asm_byte(x, addr, err, __t)                 \
+       __get_user_asm(x, addr, err, "ldrb" __t)
 
 #if __LINUX_ARM_ARCH__ >= 6
 
-#define __get_user_asm_half(x, addr, err)                      \
-       __get_user_asm(x, addr, err, ldrh)
+#define __get_user_asm_half(x, addr, err, __t)                 \
+       __get_user_asm(x, addr, err, "ldrh" __t)
 
 #else
 
 #ifndef __ARMEB__
-#define __get_user_asm_half(x, __gu_addr, err)                 \
+#define __get_user_asm_half(x, __gu_addr, err, __t)            \
 ({                                                             \
        unsigned long __b1, __b2;                               \
-       __get_user_asm_byte(__b1, __gu_addr, err);              \
-       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
+       __get_user_asm_byte(__b1, __gu_addr, err, __t);         \
+       __get_user_asm_byte(__b2, __gu_addr + 1, err, __t);     \
        (x) = __b1 | (__b2 << 8);                               \
 })
 #else
-#define __get_user_asm_half(x, __gu_addr, err)                 \
+#define __get_user_asm_half(x, __gu_addr, err, __t)            \
 ({                                                             \
        unsigned long __b1, __b2;                               \
-       __get_user_asm_byte(__b1, __gu_addr, err);              \
-       __get_user_asm_byte(__b2, __gu_addr + 1, err);          \
+       __get_user_asm_byte(__b1, __gu_addr, err, __t);         \
+       __get_user_asm_byte(__b2, __gu_addr + 1, err, __t);     \
        (x) = (__b1 << 8) | __b2;                               \
 })
 #endif
 
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
-#define __get_user_asm_word(x, addr, err)                      \
-       __get_user_asm(x, addr, err, ldr)
-#endif
-
+#define __get_user_asm_word(x, addr, err, __t)                 \
+       __get_user_asm(x, addr, err, "ldr" __t)
 
 #define __put_user_switch(x, ptr, __err, __fn)                         \
        do {                                                            \
@@ -425,7 +386,7 @@ do {                                                                        \
 #define __put_user_nocheck(x, __pu_ptr, __err, __size)                 \
        do {                                                            \
                unsigned long __pu_addr = (unsigned long)__pu_ptr;      \
-               __put_user_nocheck_##__size(x, __pu_addr, __err);       \
+               __put_user_nocheck_##__size(x, __pu_addr, __err, TUSER());\
        } while (0)
 
 #define __put_user_nocheck_1 __put_user_asm_byte
@@ -433,9 +394,11 @@ do {                                                                       \
 #define __put_user_nocheck_4 __put_user_asm_word
 #define __put_user_nocheck_8 __put_user_asm_dword
 
+#endif /* !CONFIG_CPU_SPECTRE */
+
 #define __put_user_asm(x, __pu_addr, err, instr)               \
        __asm__ __volatile__(                                   \
-       "1:     " TUSER(instr) " %1, [%2], #0\n"                \
+       "1:     " instr " %1, [%2], #0\n"               \
        "2:\n"                                                  \
        "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
@@ -450,36 +413,36 @@ do {                                                                      \
        : "r" (x), "r" (__pu_addr), "i" (-EFAULT)               \
        : "cc")
 
-#define __put_user_asm_byte(x, __pu_addr, err)                 \
-       __put_user_asm(x, __pu_addr, err, strb)
+#define __put_user_asm_byte(x, __pu_addr, err, __t)            \
+       __put_user_asm(x, __pu_addr, err, "strb" __t)
 
 #if __LINUX_ARM_ARCH__ >= 6
 
-#define __put_user_asm_half(x, __pu_addr, err)                 \
-       __put_user_asm(x, __pu_addr, err, strh)
+#define __put_user_asm_half(x, __pu_addr, err, __t)            \
+       __put_user_asm(x, __pu_addr, err, "strh" __t)
 
 #else
 
 #ifndef __ARMEB__
-#define __put_user_asm_half(x, __pu_addr, err)                 \
+#define __put_user_asm_half(x, __pu_addr, err, __t)            \
 ({                                                             \
        unsigned long __temp = (__force unsigned long)(x);      \
-       __put_user_asm_byte(__temp, __pu_addr, err);            \
-       __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err);   \
+       __put_user_asm_byte(__temp, __pu_addr, err, __t);       \
+       __put_user_asm_byte(__temp >> 8, __pu_addr + 1, err, __t);\
 })
 #else
-#define __put_user_asm_half(x, __pu_addr, err)                 \
+#define __put_user_asm_half(x, __pu_addr, err, __t)            \
 ({                                                             \
        unsigned long __temp = (__force unsigned long)(x);      \
-       __put_user_asm_byte(__temp >> 8, __pu_addr, err);       \
-       __put_user_asm_byte(__temp, __pu_addr + 1, err);        \
+       __put_user_asm_byte(__temp >> 8, __pu_addr, err, __t);  \
+       __put_user_asm_byte(__temp, __pu_addr + 1, err, __t);   \
 })
 #endif
 
 #endif /* __LINUX_ARM_ARCH__ >= 6 */
 
-#define __put_user_asm_word(x, __pu_addr, err)                 \
-       __put_user_asm(x, __pu_addr, err, str)
+#define __put_user_asm_word(x, __pu_addr, err, __t)            \
+       __put_user_asm(x, __pu_addr, err, "str" __t)
 
 #ifndef __ARMEB__
 #define        __reg_oper0     "%R2"
@@ -489,12 +452,12 @@ do {                                                                      \
 #define        __reg_oper1     "%R2"
 #endif
 
-#define __put_user_asm_dword(x, __pu_addr, err)                        \
+#define __put_user_asm_dword(x, __pu_addr, err, __t)           \
        __asm__ __volatile__(                                   \
- ARM(  "1:     " TUSER(str) "  " __reg_oper1 ", [%1], #4\n"    ) \
- ARM(  "2:     " TUSER(str) "  " __reg_oper0 ", [%1]\n"        ) \
- THUMB(        "1:     " TUSER(str) "  " __reg_oper1 ", [%1]\n"        ) \
- THUMB(        "2:     " TUSER(str) "  " __reg_oper0 ", [%1, #4]\n"    ) \
+ ARM(  "1:     str" __t "      " __reg_oper1 ", [%1], #4\n"  ) \
+ ARM(  "2:     str" __t "      " __reg_oper0 ", [%1]\n"      ) \
+ THUMB(        "1:     str" __t "      " __reg_oper1 ", [%1]\n"      ) \
+ THUMB(        "2:     str" __t "      " __reg_oper0 ", [%1, #4]\n"  ) \
        "3:\n"                                                  \
        "       .pushsection .text.fixup,\"ax\"\n"              \
        "       .align  2\n"                                    \
@@ -510,7 +473,49 @@ do {                                                                       \
        : "r" (x), "i" (-EFAULT)                                \
        : "cc")
 
-#endif /* !CONFIG_CPU_SPECTRE */
+#define HAVE_GET_KERNEL_NOFAULT
+
+#define __get_kernel_nofault(dst, src, type, err_label)                        \
+do {                                                                   \
+       const type *__pk_ptr = (src);                                   \
+       unsigned long __src = (unsigned long)(__pk_ptr);                \
+       type __val;                                                     \
+       int __err = 0;                                                  \
+       switch (sizeof(type)) {                                         \
+       case 1: __get_user_asm_byte(__val, __src, __err, ""); break;    \
+       case 2: __get_user_asm_half(__val, __src, __err, ""); break;    \
+       case 4: __get_user_asm_word(__val, __src, __err, ""); break;    \
+       case 8: {                                                       \
+               u32 *__v32 = (u32*)&__val;                              \
+               __get_user_asm_word(__v32[0], __src, __err, "");        \
+               if (__err)                                              \
+                       break;                                          \
+               __get_user_asm_word(__v32[1], __src+4, __err, "");      \
+               break;                                                  \
+       }                                                               \
+       default: __err = __get_user_bad(); break;                       \
+       }                                                               \
+       *(type *)(dst) = __val;                                         \
+       if (__err)                                                      \
+               goto err_label;                                         \
+} while (0)
+
+#define __put_kernel_nofault(dst, src, type, err_label)                        \
+do {                                                                   \
+       const type *__pk_ptr = (dst);                                   \
+       unsigned long __dst = (unsigned long)__pk_ptr;                  \
+       int __err = 0;                                                  \
+       type __val = *(type *)src;                                      \
+       switch (sizeof(type)) {                                         \
+       case 1: __put_user_asm_byte(__val, __dst, __err, ""); break;    \
+       case 2: __put_user_asm_half(__val, __dst, __err, ""); break;    \
+       case 4: __put_user_asm_word(__val, __dst, __err, ""); break;    \
+       case 8: __put_user_asm_dword(__val, __dst, __err, ""); break;   \
+       default: __err = __put_user_bad(); break;                       \
+       }                                                               \
+       if (__err)                                                      \
+               goto err_label;                                         \
+} while (0)
 
 #ifdef CONFIG_MMU
 extern unsigned long __must_check
index 1e2c3eb..ce96891 100644 (file)
@@ -24,10 +24,6 @@ __asm__(".syntax unified");
 
 #ifdef CONFIG_THUMB2_KERNEL
 
-#if __GNUC__ < 4
-#error Thumb-2 kernel requires gcc >= 4
-#endif
-
 /* The CPSR bit describing the instruction set (Thumb) */
 #define PSR_ISETSTATE  PSR_T_BIT
 
index ae7749e..a114991 100644 (file)
@@ -15,6 +15,7 @@
 #define _UAPI__ASM_ARM_UNISTD_H
 
 #define __NR_OABI_SYSCALL_BASE 0x900000
+#define __NR_SYSCALL_MASK      0x0fffff
 
 #if defined(__thumb__) || defined(__ARM_EABI__)
 #define __NR_SYSCALL_BASE      0
index 6494470..a646a3f 100644 (file)
@@ -43,11 +43,11 @@ int main(void)
   BLANK();
   DEFINE(TI_FLAGS,             offsetof(struct thread_info, flags));
   DEFINE(TI_PREEMPT,           offsetof(struct thread_info, preempt_count));
-  DEFINE(TI_ADDR_LIMIT,                offsetof(struct thread_info, addr_limit));
   DEFINE(TI_TASK,              offsetof(struct thread_info, task));
   DEFINE(TI_CPU,               offsetof(struct thread_info, cpu));
   DEFINE(TI_CPU_DOMAIN,                offsetof(struct thread_info, cpu_domain));
   DEFINE(TI_CPU_SAVE,          offsetof(struct thread_info, cpu_context));
+  DEFINE(TI_ABI_SYSCALL,       offsetof(struct thread_info, abi_syscall));
   DEFINE(TI_USED_CP,           offsetof(struct thread_info, used_cp));
   DEFINE(TI_TP_VALUE,          offsetof(struct thread_info, tp_value));
   DEFINE(TI_FPSTATE,           offsetof(struct thread_info, fpstate));
@@ -88,7 +88,6 @@ int main(void)
   DEFINE(S_OLD_R0,             offsetof(struct pt_regs, ARM_ORIG_r0));
   DEFINE(PT_REGS_SIZE,         sizeof(struct pt_regs));
   DEFINE(SVC_DACR,             offsetof(struct svc_pt_regs, dacr));
-  DEFINE(SVC_ADDR_LIMIT,       offsetof(struct svc_pt_regs, addr_limit));
   DEFINE(SVC_REGS_SIZE,                sizeof(struct svc_pt_regs));
   BLANK();
   DEFINE(SIGFRAME_RC3_OFFSET,  offsetof(struct sigframe, retcode[3]));
index 7f0b7ab..d9c99db 100644 (file)
@@ -49,10 +49,6 @@ __ret_fast_syscall:
  UNWIND(.fnstart       )
  UNWIND(.cantunwind    )
        disable_irq_notrace                     @ disable interrupts
-       ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       ldr     r1, =TASK_SIZE
-       cmp     r2, r1
-       blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]            @ re-check for syscall tracing
        movs    r1, r1, lsl #16
        bne     fast_work_pending
@@ -87,10 +83,6 @@ __ret_fast_syscall:
        bl      do_rseq_syscall
 #endif
        disable_irq_notrace                     @ disable interrupts
-       ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       ldr     r1, =TASK_SIZE
-       cmp     r2, r1
-       blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]            @ re-check for syscall tracing
        movs    r1, r1, lsl #16
        beq     no_work_pending
@@ -129,10 +121,6 @@ ret_slow_syscall:
 #endif
        disable_irq_notrace                     @ disable interrupts
 ENTRY(ret_to_user_from_irq)
-       ldr     r2, [tsk, #TI_ADDR_LIMIT]
-       ldr     r1, =TASK_SIZE
-       cmp     r2, r1
-       blne    addr_limit_check_failed
        ldr     r1, [tsk, #TI_FLAGS]
        movs    r1, r1, lsl #16
        bne     slow_work_pending
@@ -226,6 +214,7 @@ ENTRY(vector_swi)
        /* saved_psr and saved_pc are now dead */
 
        uaccess_disable tbl
+       get_thread_info tsk
 
        adr     tbl, sys_call_table             @ load syscall table pointer
 
@@ -237,13 +226,17 @@ ENTRY(vector_swi)
         * get the old ABI syscall table address.
         */
        bics    r10, r10, #0xff000000
+       strne   r10, [tsk, #TI_ABI_SYSCALL]
+       streq   scno, [tsk, #TI_ABI_SYSCALL]
        eorne   scno, r10, #__NR_OABI_SYSCALL_BASE
        ldrne   tbl, =sys_oabi_call_table
 #elif !defined(CONFIG_AEABI)
        bic     scno, scno, #0xff000000         @ mask off SWI op-code
+       str     scno, [tsk, #TI_ABI_SYSCALL]
        eor     scno, scno, #__NR_SYSCALL_BASE  @ check OS number
+#else
+       str     scno, [tsk, #TI_ABI_SYSCALL]
 #endif
-       get_thread_info tsk
        /*
         * Reload the registers that may have been corrupted on entry to
         * the syscall assembly (by tracing or context tracking.)
@@ -288,7 +281,6 @@ ENDPROC(vector_swi)
         * context switches, and waiting for our parent to respond.
         */
 __sys_trace:
-       mov     r1, scno
        add     r0, sp, #S_OFF
        bl      syscall_trace_enter
        mov     scno, r0
index bb5ad8a..0e2d305 100644 (file)
@@ -106,7 +106,7 @@ void __show_regs(struct pt_regs *regs)
        unsigned long flags;
        char buf[64];
 #ifndef CONFIG_CPU_V7M
-       unsigned int domain, fs;
+       unsigned int domain;
 #ifdef CONFIG_CPU_SW_DOMAIN_PAN
        /*
         * Get the domain register for the parent context. In user
@@ -115,14 +115,11 @@ void __show_regs(struct pt_regs *regs)
         */
        if (user_mode(regs)) {
                domain = DACR_UACCESS_ENABLE;
-               fs = get_fs();
        } else {
                domain = to_svc_pt_regs(regs)->dacr;
-               fs = to_svc_pt_regs(regs)->addr_limit;
        }
 #else
        domain = get_domain();
-       fs = get_fs();
 #endif
 #endif
 
@@ -158,8 +155,6 @@ void __show_regs(struct pt_regs *regs)
                if ((domain & domain_mask(DOMAIN_USER)) ==
                    domain_val(DOMAIN_USER, DOMAIN_NOACCESS))
                        segment = "none";
-               else if (fs == KERNEL_DS)
-                       segment = "kernel";
                else
                        segment = "user";
 
index b008859..43b963e 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/tracehook.h>
 #include <linux/unistd.h>
 
+#include <asm/syscall.h>
 #include <asm/traps.h>
 
 #define CREATE_TRACE_POINTS
@@ -785,7 +786,8 @@ long arch_ptrace(struct task_struct *child, long request,
                        break;
 
                case PTRACE_SET_SYSCALL:
-                       task_thread_info(child)->syscall = data;
+                       task_thread_info(child)->abi_syscall = data &
+                                                       __NR_SYSCALL_MASK;
                        ret = 0;
                        break;
 
@@ -844,14 +846,14 @@ static void tracehook_report_syscall(struct pt_regs *regs,
        if (dir == PTRACE_SYSCALL_EXIT)
                tracehook_report_syscall_exit(regs, 0);
        else if (tracehook_report_syscall_entry(regs))
-               current_thread_info()->syscall = -1;
+               current_thread_info()->abi_syscall = -1;
 
        regs->ARM_ip = ip;
 }
 
-asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
+asmlinkage int syscall_trace_enter(struct pt_regs *regs)
 {
-       current_thread_info()->syscall = scno;
+       int scno;
 
        if (test_thread_flag(TIF_SYSCALL_TRACE))
                tracehook_report_syscall(regs, PTRACE_SYSCALL_ENTER);
@@ -862,11 +864,11 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs, int scno)
                return -1;
 #else
        /* XXX: remove this once OABI gets fixed */
-       secure_computing_strict(current_thread_info()->syscall);
+       secure_computing_strict(syscall_get_nr(current, regs));
 #endif
 
        /* Tracer or seccomp may have changed syscall. */
-       scno = current_thread_info()->syscall;
+       scno = syscall_get_nr(current, regs);
 
        if (test_thread_flag(TIF_SYSCALL_TRACEPOINT))
                trace_sys_enter(regs, scno);
index 4e0dcff..d0a800b 100644 (file)
@@ -669,14 +669,6 @@ struct page *get_signal_page(void)
        return page;
 }
 
-/* Defer to generic check */
-asmlinkage void addr_limit_check_failed(void)
-{
-#ifdef CONFIG_MMU
-       addr_limit_user_check();
-#endif
-}
-
 #ifdef CONFIG_DEBUG_RSEQ
 asmlinkage void do_rseq_syscall(struct pt_regs *regs)
 {
index 075a2e0..68112c1 100644 (file)
 #include <linux/socket.h>
 #include <linux/net.h>
 #include <linux/ipc.h>
+#include <linux/ipc_namespace.h>
 #include <linux/uaccess.h>
 #include <linux/slab.h>
 
+#include <asm/syscall.h>
+
 struct oldabi_stat64 {
        unsigned long long st_dev;
        unsigned int    __pad1;
@@ -191,60 +194,87 @@ struct oabi_flock64 {
        pid_t   l_pid;
 } __attribute__ ((packed,aligned(4)));
 
-static long do_locks(unsigned int fd, unsigned int cmd,
-                                unsigned long arg)
+static int get_oabi_flock(struct flock64 *kernel, struct oabi_flock64 __user *arg)
 {
-       struct flock64 kernel;
        struct oabi_flock64 user;
-       mm_segment_t fs;
-       long ret;
 
        if (copy_from_user(&user, (struct oabi_flock64 __user *)arg,
                           sizeof(user)))
                return -EFAULT;
-       kernel.l_type   = user.l_type;
-       kernel.l_whence = user.l_whence;
-       kernel.l_start  = user.l_start;
-       kernel.l_len    = user.l_len;
-       kernel.l_pid    = user.l_pid;
-
-       fs = get_fs();
-       set_fs(KERNEL_DS);
-       ret = sys_fcntl64(fd, cmd, (unsigned long)&kernel);
-       set_fs(fs);
-
-       if (!ret && (cmd == F_GETLK64 || cmd == F_OFD_GETLK)) {
-               user.l_type     = kernel.l_type;
-               user.l_whence   = kernel.l_whence;
-               user.l_start    = kernel.l_start;
-               user.l_len      = kernel.l_len;
-               user.l_pid      = kernel.l_pid;
-               if (copy_to_user((struct oabi_flock64 __user *)arg,
-                                &user, sizeof(user)))
-                       ret = -EFAULT;
-       }
-       return ret;
+
+       kernel->l_type   = user.l_type;
+       kernel->l_whence = user.l_whence;
+       kernel->l_start  = user.l_start;
+       kernel->l_len    = user.l_len;
+       kernel->l_pid    = user.l_pid;
+
+       return 0;
+}
+
+static int put_oabi_flock(struct flock64 *kernel, struct oabi_flock64 __user *arg)
+{
+       struct oabi_flock64 user;
+
+       user.l_type     = kernel->l_type;
+       user.l_whence   = kernel->l_whence;
+       user.l_start    = kernel->l_start;
+       user.l_len      = kernel->l_len;
+       user.l_pid      = kernel->l_pid;
+
+       if (copy_to_user((struct oabi_flock64 __user *)arg,
+                        &user, sizeof(user)))
+               return -EFAULT;
+
+       return 0;
 }
 
 asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
                                 unsigned long arg)
 {
+       void __user *argp = (void __user *)arg;
+       struct fd f = fdget_raw(fd);
+       struct flock64 flock;
+       long err = -EBADF;
+
+       if (!f.file)
+               goto out;
+
        switch (cmd) {
-       case F_OFD_GETLK:
-       case F_OFD_SETLK:
-       case F_OFD_SETLKW:
        case F_GETLK64:
+       case F_OFD_GETLK:
+               err = security_file_fcntl(f.file, cmd, arg);
+               if (err)
+                       break;
+               err = get_oabi_flock(&flock, argp);
+               if (err)
+                       break;
+               err = fcntl_getlk64(f.file, cmd, &flock);
+               if (!err)
+                      err = put_oabi_flock(&flock, argp);
+               break;
        case F_SETLK64:
        case F_SETLKW64:
-               return do_locks(fd, cmd, arg);
-
+       case F_OFD_SETLK:
+       case F_OFD_SETLKW:
+               err = security_file_fcntl(f.file, cmd, arg);
+               if (err)
+                       break;
+               err = get_oabi_flock(&flock, argp);
+               if (err)
+                       break;
+               err = fcntl_setlk64(fd, f.file, cmd, &flock);
+               break;
        default:
-               return sys_fcntl64(fd, cmd, arg);
+               err = sys_fcntl64(fd, cmd, arg);
+               break;
        }
+       fdput(f);
+out:
+       return err;
 }
 
 struct oabi_epoll_event {
-       __u32 events;
+       __poll_t events;
        __u64 data;
 } __attribute__ ((packed,aligned(4)));
 
@@ -264,55 +294,34 @@ asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
 
        return do_epoll_ctl(epfd, op, fd, &kernel, false);
 }
-
-asmlinkage long sys_oabi_epoll_wait(int epfd,
-                                   struct oabi_epoll_event __user *events,
-                                   int maxevents, int timeout)
-{
-       struct epoll_event *kbuf;
-       struct oabi_epoll_event e;
-       mm_segment_t fs;
-       long ret, err, i;
-
-       if (maxevents <= 0 ||
-                       maxevents > (INT_MAX/sizeof(*kbuf)) ||
-                       maxevents > (INT_MAX/sizeof(*events)))
-               return -EINVAL;
-       if (!access_ok(events, sizeof(*events) * maxevents))
-               return -EFAULT;
-       kbuf = kmalloc_array(maxevents, sizeof(*kbuf), GFP_KERNEL);
-       if (!kbuf)
-               return -ENOMEM;
-       fs = get_fs();
-       set_fs(KERNEL_DS);
-       ret = sys_epoll_wait(epfd, kbuf, maxevents, timeout);
-       set_fs(fs);
-       err = 0;
-       for (i = 0; i < ret; i++) {
-               e.events = kbuf[i].events;
-               e.data = kbuf[i].data;
-               err = __copy_to_user(events, &e, sizeof(e));
-               if (err)
-                       break;
-               events++;
-       }
-       kfree(kbuf);
-       return err ? -EFAULT : ret;
-}
 #else
 asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
                                   struct oabi_epoll_event __user *event)
 {
        return -EINVAL;
 }
+#endif
 
-asmlinkage long sys_oabi_epoll_wait(int epfd,
-                                   struct oabi_epoll_event __user *events,
-                                   int maxevents, int timeout)
+struct epoll_event __user *
+epoll_put_uevent(__poll_t revents, __u64 data,
+                struct epoll_event __user *uevent)
 {
-       return -EINVAL;
+       if (in_oabi_syscall()) {
+               struct oabi_epoll_event __user *oevent = (void __user *)uevent;
+
+               if (__put_user(revents, &oevent->events) ||
+                   __put_user(data, &oevent->data))
+                       return NULL;
+
+               return (void __user *)(oevent+1);
+       }
+
+       if (__put_user(revents, &uevent->events) ||
+           __put_user(data, &uevent->data))
+               return NULL;
+
+       return uevent+1;
 }
-#endif
 
 struct oabi_sembuf {
        unsigned short  sem_num;
@@ -321,46 +330,52 @@ struct oabi_sembuf {
        unsigned short  __pad;
 };
 
+#define sc_semopm     sem_ctls[2]
+
+#ifdef CONFIG_SYSVIPC
 asmlinkage long sys_oabi_semtimedop(int semid,
                                    struct oabi_sembuf __user *tsops,
                                    unsigned nsops,
                                    const struct old_timespec32 __user *timeout)
 {
+       struct ipc_namespace *ns;
        struct sembuf *sops;
-       struct old_timespec32 local_timeout;
        long err;
        int i;
 
+       ns = current->nsproxy->ipc_ns;
+       if (nsops > ns->sc_semopm)
+               return -E2BIG;
        if (nsops < 1 || nsops > SEMOPM)
                return -EINVAL;
-       if (!access_ok(tsops, sizeof(*tsops) * nsops))
-               return -EFAULT;
-       sops = kmalloc_array(nsops, sizeof(*sops), GFP_KERNEL);
+       sops = kvmalloc_array(nsops, sizeof(*sops), GFP_KERNEL);
        if (!sops)
                return -ENOMEM;
        err = 0;
        for (i = 0; i < nsops; i++) {
                struct oabi_sembuf osb;
-               err |= __copy_from_user(&osb, tsops, sizeof(osb));
+               err |= copy_from_user(&osb, tsops, sizeof(osb));
                sops[i].sem_num = osb.sem_num;
                sops[i].sem_op = osb.sem_op;
                sops[i].sem_flg = osb.sem_flg;
                tsops++;
        }
-       if (timeout) {
-               /* copy this as well before changing domain protection */
-               err |= copy_from_user(&local_timeout, timeout, sizeof(*timeout));
-               timeout = &local_timeout;
-       }
        if (err) {
                err = -EFAULT;
-       } else {
-               mm_segment_t fs = get_fs();
-               set_fs(KERNEL_DS);
-               err = sys_semtimedop_time32(semid, sops, nsops, timeout);
-               set_fs(fs);
+               goto out;
        }
-       kfree(sops);
+
+       if (timeout) {
+               struct timespec64 ts;
+               err = get_old_timespec32(&ts, timeout);
+               if (err)
+                       goto out;
+               err = __do_semtimedop(semid, sops, nsops, &ts, ns);
+               goto out;
+       }
+       err = __do_semtimedop(semid, sops, nsops, NULL, ns);
+out:
+       kvfree(sops);
        return err;
 }
 
@@ -387,6 +402,27 @@ asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
                return sys_ipc(call, first, second, third, ptr, fifth);
        }
 }
+#else
+asmlinkage long sys_oabi_semtimedop(int semid,
+                                   struct oabi_sembuf __user *tsops,
+                                   unsigned nsops,
+                                   const struct old_timespec32 __user *timeout)
+{
+       return -ENOSYS;
+}
+
+asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops,
+                              unsigned nsops)
+{
+       return -ENOSYS;
+}
+
+asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
+                           void __user *ptr, long fifth)
+{
+       return -ENOSYS;
+}
+#endif
 
 asmlinkage long sys_oabi_bind(int fd, struct sockaddr __user *addr, int addrlen)
 {
index e9b4f2b..4a7edc6 100644 (file)
@@ -122,17 +122,8 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
                     unsigned long top)
 {
        unsigned long first;
-       mm_segment_t fs;
        int i;
 
-       /*
-        * We need to switch to kernel mode so that we can use __get_user
-        * to safely read from kernel space.  Note that we now dump the
-        * code first, just in case the backtrace kills us.
-        */
-       fs = get_fs();
-       set_fs(KERNEL_DS);
-
        printk("%s%s(0x%08lx to 0x%08lx)\n", lvl, str, bottom, top);
 
        for (first = bottom & ~31; first < top; first += 32) {
@@ -145,7 +136,7 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
                for (p = first, i = 0; i < 8 && p < top; i++, p += 4) {
                        if (p >= bottom && p < top) {
                                unsigned long val;
-                               if (__get_user(val, (unsigned long *)p) == 0)
+                               if (get_kernel_nofault(val, (unsigned long *)p))
                                        sprintf(str + i * 9, " %08lx", val);
                                else
                                        sprintf(str + i * 9, " ????????");
@@ -153,11 +144,9 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom,
                }
                printk("%s%04lx:%s\n", lvl, first & 0xffff, str);
        }
-
-       set_fs(fs);
 }
 
-static void __dump_instr(const char *lvl, struct pt_regs *regs)
+static void dump_instr(const char *lvl, struct pt_regs *regs)
 {
        unsigned long addr = instruction_pointer(regs);
        const int thumb = thumb_mode(regs);
@@ -173,10 +162,20 @@ static void __dump_instr(const char *lvl, struct pt_regs *regs)
        for (i = -4; i < 1 + !!thumb; i++) {
                unsigned int val, bad;
 
-               if (thumb)
-                       bad = get_user(val, &((u16 *)addr)[i]);
-               else
-                       bad = get_user(val, &((u32 *)addr)[i]);
+               if (!user_mode(regs)) {
+                       if (thumb) {
+                               u16 val16;
+                               bad = get_kernel_nofault(val16, &((u16 *)addr)[i]);
+                               val = val16;
+                       } else {
+                               bad = get_kernel_nofault(val, &((u32 *)addr)[i]);
+                       }
+               } else {
+                       if (thumb)
+                               bad = get_user(val, &((u16 *)addr)[i]);
+                       else
+                               bad = get_user(val, &((u32 *)addr)[i]);
+               }
 
                if (!bad)
                        p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ",
@@ -189,20 +188,6 @@ static void __dump_instr(const char *lvl, struct pt_regs *regs)
        printk("%sCode: %s\n", lvl, str);
 }
 
-static void dump_instr(const char *lvl, struct pt_regs *regs)
-{
-       mm_segment_t fs;
-
-       if (!user_mode(regs)) {
-               fs = get_fs();
-               set_fs(KERNEL_DS);
-               __dump_instr(lvl, regs);
-               set_fs(fs);
-       } else {
-               __dump_instr(lvl, regs);
-       }
-}
-
 #ifdef CONFIG_ARM_UNWIND
 static inline void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
                                  const char *loglvl)
index f8016e3..480a207 100644 (file)
 
 ENTRY(arm_copy_from_user)
 #ifdef CONFIG_CPU_SPECTRE
-       get_thread_info r3
-       ldr     r3, [r3, #TI_ADDR_LIMIT]
+       ldr     r3, =TASK_SIZE
        uaccess_mask_range_ptr r1, r2, r3, ip
 #endif
 
index ebfe4cb..842ea5e 100644 (file)
 ENTRY(__copy_to_user_std)
 WEAK(arm_copy_to_user)
 #ifdef CONFIG_CPU_SPECTRE
-       get_thread_info r3
-       ldr     r3, [r3, #TI_ADDR_LIMIT]
+       ldr     r3, =TASK_SIZE
        uaccess_mask_range_ptr r0, r2, r3, ip
 #endif
 
index 7e0a9b6..e842209 100644 (file)
 249    common  lookup_dcookie          sys_lookup_dcookie
 250    common  epoll_create            sys_epoll_create
 251    common  epoll_ctl               sys_epoll_ctl           sys_oabi_epoll_ctl
-252    common  epoll_wait              sys_epoll_wait          sys_oabi_epoll_wait
+252    common  epoll_wait              sys_epoll_wait
 253    common  remap_file_pages        sys_remap_file_pages
 # 254 for set_thread_area
 # 255 for get_thread_area
index 79c1a75..eaa6ca0 100644 (file)
@@ -107,11 +107,6 @@ struct compat_statfs {
 #define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
 #define COMPAT_MINSIGSTKSZ     2048
 
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       return (void __user *)compat_user_stack_pointer() - len;
-}
-
 struct compat_ipc64_perm {
        compat_key_t key;
        __compat_uid32_t uid;
index b5f0862..190b494 100644 (file)
@@ -430,17 +430,6 @@ extern unsigned long __must_check __arch_copy_to_user(void __user *to, const voi
        __actu_ret;                                                     \
 })
 
-extern unsigned long __must_check __arch_copy_in_user(void __user *to, const void __user *from, unsigned long n);
-#define raw_copy_in_user(to, from, n)                                  \
-({                                                                     \
-       unsigned long __aciu_ret;                                       \
-       uaccess_ttbr0_enable();                                         \
-       __aciu_ret = __arch_copy_in_user(__uaccess_mask_ptr(to),        \
-                                   __uaccess_mask_ptr(from), (n));     \
-       uaccess_ttbr0_disable();                                        \
-       __aciu_ret;                                                     \
-})
-
 #define INLINE_COPY_TO_USER
 #define INLINE_COPY_FROM_USER
 
index 4e99e4b..844f6ae 100644 (file)
@@ -649,11 +649,11 @@ __SYSCALL(__NR_inotify_add_watch, sys_inotify_add_watch)
 #define __NR_inotify_rm_watch 318
 __SYSCALL(__NR_inotify_rm_watch, sys_inotify_rm_watch)
 #define __NR_mbind 319
-__SYSCALL(__NR_mbind, compat_sys_mbind)
+__SYSCALL(__NR_mbind, sys_mbind)
 #define __NR_get_mempolicy 320
-__SYSCALL(__NR_get_mempolicy, compat_sys_get_mempolicy)
+__SYSCALL(__NR_get_mempolicy, sys_get_mempolicy)
 #define __NR_set_mempolicy 321
-__SYSCALL(__NR_set_mempolicy, compat_sys_set_mempolicy)
+__SYSCALL(__NR_set_mempolicy, sys_set_mempolicy)
 #define __NR_openat 322
 __SYSCALL(__NR_openat, compat_sys_openat)
 #define __NR_mkdirat 323
@@ -699,7 +699,7 @@ __SYSCALL(__NR_tee, sys_tee)
 #define __NR_vmsplice 343
 __SYSCALL(__NR_vmsplice, sys_vmsplice)
 #define __NR_move_pages 344
-__SYSCALL(__NR_move_pages, compat_sys_move_pages)
+__SYSCALL(__NR_move_pages, sys_move_pages)
 #define __NR_getcpu 345
 __SYSCALL(__NR_getcpu, sys_getcpu)
 #define __NR_epoll_pwait 346
@@ -811,7 +811,7 @@ __SYSCALL(__NR_rseq, sys_rseq)
 #define __NR_io_pgetevents 399
 __SYSCALL(__NR_io_pgetevents, compat_sys_io_pgetevents)
 #define __NR_migrate_pages 400
-__SYSCALL(__NR_migrate_pages, compat_sys_migrate_pages)
+__SYSCALL(__NR_migrate_pages, sys_migrate_pages)
 #define __NR_kexec_file_load 401
 __SYSCALL(__NR_kexec_file_load, sys_kexec_file_load)
 /* 402 is unused */
index 6dd56a4..0941180 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 lib-y          := clear_user.o delay.o copy_from_user.o                \
-                  copy_to_user.o copy_in_user.o copy_page.o            \
+                  copy_to_user.o copy_page.o                           \
                   clear_page.o csum.o insn.o memchr.o memcpy.o         \
                   memset.o memcmp.o strcmp.o strncmp.o strlen.o        \
                   strnlen.o strchr.o strrchr.o tishift.o
diff --git a/arch/arm64/lib/copy_in_user.S b/arch/arm64/lib/copy_in_user.S
deleted file mode 100644 (file)
index dbea379..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copy from user space to user space
- *
- * Copyright (C) 2012 ARM Ltd.
- */
-
-#include <linux/linkage.h>
-
-#include <asm/asm-uaccess.h>
-#include <asm/assembler.h>
-#include <asm/cache.h>
-
-/*
- * Copy from user space to user space (alignment handled by the hardware)
- *
- * Parameters:
- *     x0 - to
- *     x1 - from
- *     x2 - n
- * Returns:
- *     x0 - bytes not copied
- */
-       .macro ldrb1 reg, ptr, val
-       user_ldst 9998f, ldtrb, \reg, \ptr, \val
-       .endm
-
-       .macro strb1 reg, ptr, val
-       user_ldst 9998f, sttrb, \reg, \ptr, \val
-       .endm
-
-       .macro ldrh1 reg, ptr, val
-       user_ldst 9997f, ldtrh, \reg, \ptr, \val
-       .endm
-
-       .macro strh1 reg, ptr, val
-       user_ldst 9997f, sttrh, \reg, \ptr, \val
-       .endm
-
-       .macro ldr1 reg, ptr, val
-       user_ldst 9997f, ldtr, \reg, \ptr, \val
-       .endm
-
-       .macro str1 reg, ptr, val
-       user_ldst 9997f, sttr, \reg, \ptr, \val
-       .endm
-
-       .macro ldp1 reg1, reg2, ptr, val
-       user_ldp 9997f, \reg1, \reg2, \ptr, \val
-       .endm
-
-       .macro stp1 reg1, reg2, ptr, val
-       user_stp 9997f, \reg1, \reg2, \ptr, \val
-       .endm
-
-end    .req    x5
-srcin  .req    x15
-SYM_FUNC_START(__arch_copy_in_user)
-       add     end, x0, x2
-       mov     srcin, x1
-#include "copy_template.S"
-       mov     x0, #0
-       ret
-SYM_FUNC_END(__arch_copy_in_user)
-EXPORT_SYMBOL(__arch_copy_in_user)
-
-       .section .fixup,"ax"
-       .align  2
-9997:  cmp     dst, dstin
-       b.ne    9998f
-       // Before being absolutely sure we couldn't copy anything, try harder
-USER(9998f, ldtrb tmp1w, [srcin])
-USER(9998f, sttrb tmp1w, [dst])
-       add     dst, dst, #1
-9998:  sub     x0, end, dst                    // bytes not copied
-       ret
-       .previous
index b16be52..37a8175 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/crash_dump.h>
 #include <linux/hugetlb.h>
 #include <linux/acpi_iort.h>
+#include <linux/kmemleak.h>
 
 #include <asm/boot.h>
 #include <asm/fixmap.h>
@@ -101,6 +102,11 @@ static void __init reserve_crashkernel(void)
        pr_info("crashkernel reserved: 0x%016llx - 0x%016llx (%lld MB)\n",
                crash_base, crash_base + crash_size, crash_size >> 20);
 
+       /*
+        * The crashkernel memory will be removed from the kernel linear
+        * map. Inform kmemleak so that it won't try to access it.
+        */
+       kmemleak_ignore_phys(crash_base);
        crashk_res.start = crash_base;
        crashk_res.end = crash_base + crash_size - 1;
 }
@@ -222,7 +228,21 @@ early_param("mem", early_mem);
 
 void __init arm64_memblock_init(void)
 {
-       const s64 linear_region_size = PAGE_END - _PAGE_OFFSET(vabits_actual);
+       s64 linear_region_size = PAGE_END - _PAGE_OFFSET(vabits_actual);
+
+       /*
+        * Corner case: 52-bit VA capable systems running KVM in nVHE mode may
+        * be limited in their ability to support a linear map that exceeds 51
+        * bits of VA space, depending on the placement of the ID map. Given
+        * that the placement of the ID map may be randomized, let's simply
+        * limit the kernel's linear map to 51 bits as well if we detect this
+        * configuration.
+        */
+       if (IS_ENABLED(CONFIG_KVM) && vabits_actual == 52 &&
+           is_hyp_mode_available() && !is_kernel_in_hyp_mode()) {
+               pr_info("Capping linear region to 51 bits for KVM in nVHE mode on LVA capable hardware.\n");
+               linear_region_size = min_t(u64, linear_region_size, BIT(51));
+       }
 
        /* Remove memory above our supported physical address size */
        memblock_remove(1ULL << PHYS_MASK_SHIFT, ULLONG_MAX);
index 600d018..0a515cd 100644 (file)
@@ -154,8 +154,6 @@ FEXPORT(__raw_copy_from_user)
 EXPORT_SYMBOL(__raw_copy_from_user)
 FEXPORT(__raw_copy_to_user)
 EXPORT_SYMBOL(__raw_copy_to_user)
-FEXPORT(__raw_copy_in_user)
-EXPORT_SYMBOL(__raw_copy_in_user)
        /*
         * Note: dst & src may be unaligned, len may be 0
         * Temps
index 53f015a..bbb3bc5 100644 (file)
@@ -96,14 +96,6 @@ struct compat_statfs {
 
 #define COMPAT_OFF_T_MAX       0x7fffffff
 
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       struct pt_regs *regs = (struct pt_regs *)
-               ((unsigned long) current_thread_info() + THREAD_SIZE - 32) - 1;
-
-       return (void __user *) (regs->regs[29] - len);
-}
-
 struct compat_ipc64_perm {
        compat_key_t key;
        __compat_uid32_t uid;
index 783fecc..f8f74f9 100644 (file)
@@ -428,7 +428,6 @@ do {                                                                        \
 
 extern size_t __raw_copy_from_user(void *__to, const void *__from, size_t __n);
 extern size_t __raw_copy_to_user(void *__to, const void *__from, size_t __n);
-extern size_t __raw_copy_in_user(void *__to, const void *__from, size_t __n);
 
 static inline unsigned long
 raw_copy_from_user(void *to, const void __user *from, unsigned long n)
@@ -480,31 +479,6 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n)
 #define INLINE_COPY_FROM_USER
 #define INLINE_COPY_TO_USER
 
-static inline unsigned long
-raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
-{
-       register void __user *__cu_to_r __asm__("$4");
-       register const void __user *__cu_from_r __asm__("$5");
-       register long __cu_len_r __asm__("$6");
-
-       __cu_to_r = to;
-       __cu_from_r = from;
-       __cu_len_r = n;
-
-       __asm__ __volatile__(
-               ".set\tnoreorder\n\t"
-               __MODULE_JAL(__raw_copy_in_user)
-               ".set\tnoat\n\t"
-               __UA_ADDU "\t$1, %1, %2\n\t"
-               ".set\tat\n\t"
-               ".set\treorder"
-               : "+r" (__cu_to_r), "+r" (__cu_from_r), "+r" (__cu_len_r)
-               :
-               : "$8", "$9", "$10", "$11", "$12", "$14", "$15", "$24", "$31",
-                 DADDI_SCRATCH, "memory");
-       return __cu_len_r;
-}
-
 extern __kernel_size_t __bzero(void __user *addr, __kernel_size_t size);
 
 /*
index 56c8d3c..70e32de 100644 (file)
 228    n32     clock_nanosleep                 sys_clock_nanosleep_time32
 229    n32     tgkill                          sys_tgkill
 230    n32     utimes                          sys_utimes_time32
-231    n32     mbind                           compat_sys_mbind
-232    n32     get_mempolicy                   compat_sys_get_mempolicy
-233    n32     set_mempolicy                   compat_sys_set_mempolicy
+231    n32     mbind                           sys_mbind
+232    n32     get_mempolicy                   sys_get_mempolicy
+233    n32     set_mempolicy                   sys_set_mempolicy
 234    n32     mq_open                         compat_sys_mq_open
 235    n32     mq_unlink                       sys_mq_unlink
 236    n32     mq_timedsend                    sys_mq_timedsend_time32
 247    n32     inotify_init                    sys_inotify_init
 248    n32     inotify_add_watch               sys_inotify_add_watch
 249    n32     inotify_rm_watch                sys_inotify_rm_watch
-250    n32     migrate_pages                   compat_sys_migrate_pages
+250    n32     migrate_pages                   sys_migrate_pages
 251    n32     openat                          sys_openat
 252    n32     mkdirat                         sys_mkdirat
 253    n32     mknodat                         sys_mknodat
 268    n32     sync_file_range                 sys_sync_file_range
 269    n32     tee                             sys_tee
 270    n32     vmsplice                        sys_vmsplice
-271    n32     move_pages                      compat_sys_move_pages
+271    n32     move_pages                      sys_move_pages
 272    n32     set_robust_list                 compat_sys_set_robust_list
 273    n32     get_robust_list                 compat_sys_get_robust_list
 274    n32     kexec_load                      compat_sys_kexec_load
index 201237f..a61c35e 100644 (file)
 265    o32     clock_nanosleep                 sys_clock_nanosleep_time32
 266    o32     tgkill                          sys_tgkill
 267    o32     utimes                          sys_utimes_time32
-268    o32     mbind                           sys_mbind                       compat_sys_mbind
-269    o32     get_mempolicy                   sys_get_mempolicy               compat_sys_get_mempolicy
-270    o32     set_mempolicy                   sys_set_mempolicy               compat_sys_set_mempolicy
+268    o32     mbind                           sys_mbind
+269    o32     get_mempolicy                   sys_get_mempolicy
+270    o32     set_mempolicy                   sys_set_mempolicy
 271    o32     mq_open                         sys_mq_open                     compat_sys_mq_open
 272    o32     mq_unlink                       sys_mq_unlink
 273    o32     mq_timedsend                    sys_mq_timedsend_time32
 284    o32     inotify_init                    sys_inotify_init
 285    o32     inotify_add_watch               sys_inotify_add_watch
 286    o32     inotify_rm_watch                sys_inotify_rm_watch
-287    o32     migrate_pages                   sys_migrate_pages               compat_sys_migrate_pages
+287    o32     migrate_pages                   sys_migrate_pages
 288    o32     openat                          sys_openat                      compat_sys_openat
 289    o32     mkdirat                         sys_mkdirat
 290    o32     mknodat                         sys_mknodat
 305    o32     sync_file_range                 sys_sync_file_range             sys32_sync_file_range
 306    o32     tee                             sys_tee
 307    o32     vmsplice                        sys_vmsplice
-308    o32     move_pages                      sys_move_pages                  compat_sys_move_pages
+308    o32     move_pages                      sys_move_pages
 309    o32     set_robust_list                 sys_set_robust_list             compat_sys_set_robust_list
 310    o32     get_robust_list                 sys_get_robust_list             compat_sys_get_robust_list
 311    o32     kexec_load                      sys_kexec_load                  compat_sys_kexec_load
index e19fb98..277c322 100644 (file)
@@ -666,8 +666,6 @@ FEXPORT(__raw_copy_from_user)
 EXPORT_SYMBOL(__raw_copy_from_user)
 FEXPORT(__raw_copy_to_user)
 EXPORT_SYMBOL(__raw_copy_to_user)
-FEXPORT(__raw_copy_in_user)
-EXPORT_SYMBOL(__raw_copy_in_user)
 #endif
        /* Legacy Mode, user <-> user */
        __BUILD_COPY_USER LEGACY_MODE USEROP USEROP
@@ -703,13 +701,4 @@ EXPORT_SYMBOL(__raw_copy_to_user)
 __BUILD_COPY_USER EVA_MODE KERNELOP USEROP
 END(__raw_copy_to_user)
 
-/*
- * __copy_in_user (EVA)
- */
-
-LEAF(__raw_copy_in_user)
-EXPORT_SYMBOL(__raw_copy_in_user)
-__BUILD_COPY_USER EVA_MODE USEROP USEROP
-END(__raw_copy_in_user)
-
 #endif
index 41725ea..b3d34d6 100644 (file)
@@ -244,7 +244,6 @@ static void __init setup_memory(void)
        unsigned long ram_start_pfn;
        unsigned long free_ram_start_pfn;
        phys_addr_t memory_start, memory_end;
-       struct memblock_region *region;
 
        memory_end = memory_start = 0;
 
index 3001a7d..4742b6f 100644 (file)
@@ -10,7 +10,6 @@ config PARISC
        select ARCH_HAS_ELF_RANDOMIZE
        select ARCH_HAS_STRICT_KERNEL_RWX
        select ARCH_HAS_UBSAN_SANITIZE_ALL
-       select ARCH_HAS_STRNLEN_USER
        select ARCH_NO_SG_CHAIN
        select ARCH_SUPPORTS_HUGETLBFS if PA20
        select ARCH_SUPPORTS_MEMORY_FAILURE
@@ -65,7 +64,6 @@ config PARISC
        select HAVE_KPROBES_ON_FTRACE
        select HAVE_DYNAMIC_FTRACE_WITH_REGS
        select HAVE_SOFTIRQ_ON_OWN_STACK if IRQSTACKS
-       select SET_FS
        select TRACE_IRQFLAGS_SUPPORT
 
        help
index dff4536..9fe5487 100644 (file)
@@ -26,7 +26,7 @@ endif
 OBJECTS += $(obj)/head.o $(obj)/real2.o $(obj)/firmware.o $(obj)/misc.o $(obj)/piggy.o
 
 LDFLAGS_vmlinux := -X -e startup --as-needed -T
-$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC)
+$(obj)/vmlinux: $(obj)/vmlinux.lds $(OBJECTS) $(LIBGCC) FORCE
        $(call if_changed,ld)
 
 sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\)$$/\#define SZ\2 0x\1/p'
@@ -34,7 +34,7 @@ sed-sizes := -e 's/^\([0-9a-fA-F]*\) . \(__bss_start\|_end\|parisc_kernel_start\
 quiet_cmd_sizes = GEN $@
       cmd_sizes = $(NM) $< | sed -n $(sed-sizes) > $@
 
-$(obj)/sizes.h: vmlinux
+$(obj)/sizes.h: vmlinux FORCE
        $(call if_changed,sizes)
 
 AFLAGS_head.o += -I$(objtree)/$(obj) -DBOOTLOADER
@@ -70,19 +70,19 @@ suffix-$(CONFIG_KERNEL_LZMA)  := lzma
 suffix-$(CONFIG_KERNEL_LZO)  := lzo
 suffix-$(CONFIG_KERNEL_XZ)  := xz
 
-$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,gzip)
-$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,bzip2)
-$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,lz4)
-$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,lzma)
-$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,lzo)
-$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y)
+$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
        $(call if_changed,xzkern)
 
 LDFLAGS_piggy.o := -r --format binary --oformat $(LD_BFD) -T
-$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y)
+$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
        $(call if_changed,ld)
index b5d90e8..c04f5a6 100644 (file)
@@ -163,12 +163,6 @@ struct compat_shmid64_ds {
 #define COMPAT_ELF_NGREG 80
 typedef compat_ulong_t compat_elf_gregset_t[COMPAT_ELF_NGREG];
 
-static __inline__ void __user *arch_compat_alloc_user_space(long len)
-{
-       struct pt_regs *regs = &current->thread.regs;
-       return (void __user *)regs->gr[30];
-}
-
 static inline int __is_compat_task(struct task_struct *t)
 {
        return test_tsk_thread_flag(t, TIF_32BIT);
index b5fbcd2..eeb7da0 100644 (file)
@@ -101,10 +101,6 @@ DECLARE_PER_CPU(struct cpuinfo_parisc, cpu_data);
 
 #define CPU_HVERSION ((boot_cpu_data.hversion >> 4) & 0x0FFF)
 
-typedef struct {
-       int seg;  
-} mm_segment_t;
-
 #define ARCH_MIN_TASKALIGN     8
 
 struct thread_struct {
index 2b3010a..4b9e3d7 100644 (file)
@@ -2,7 +2,7 @@
 #ifndef _ASM_PARISC_RT_SIGFRAME_H
 #define _ASM_PARISC_RT_SIGFRAME_H
 
-#define SIGRETURN_TRAMP 4
+#define SIGRETURN_TRAMP 3
 #define SIGRESTARTBLOCK_TRAMP 5 
 #define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
 
index 0bd38a9..00ad50f 100644 (file)
@@ -11,7 +11,6 @@
 struct thread_info {
        struct task_struct *task;       /* main task structure */
        unsigned long flags;            /* thread_info flags (see TIF_*) */
-       mm_segment_t addr_limit;        /* user-level address space limit */
        __u32 cpu;                      /* current CPU */
        int preempt_count;              /* 0=premptable, <0=BUG; will also serve as bh-counter */
 };
@@ -21,7 +20,6 @@ struct thread_info {
        .task           = &tsk,                 \
        .flags          = 0,                    \
        .cpu            = 0,                    \
-       .addr_limit     = KERNEL_DS,            \
        .preempt_count  = INIT_PREEMPT_COUNT,   \
 }
 
index ed2cd4f..192ad9e 100644 (file)
 #include <linux/bug.h>
 #include <linux/string.h>
 
-#define KERNEL_DS      ((mm_segment_t){0})
-#define USER_DS        ((mm_segment_t){1})
-
-#define uaccess_kernel() (get_fs().seg == KERNEL_DS.seg)
-
-#define get_fs()       (current_thread_info()->addr_limit)
-#define set_fs(x)      (current_thread_info()->addr_limit = (x))
-
 /*
  * Note that since kernel addresses are in a separate address space on
  * parisc, we don't need to do anything for access_ok().
 #define get_user __get_user
 
 #if !defined(CONFIG_64BIT)
-#define LDD_USER(val, ptr)     __get_user_asm64(val, ptr)
-#define STD_USER(x, ptr)       __put_user_asm64(x, ptr)
+#define LDD_USER(sr, val, ptr) __get_user_asm64(sr, val, ptr)
+#define STD_USER(sr, x, ptr)   __put_user_asm64(sr, x, ptr)
 #else
-#define LDD_USER(val, ptr)     __get_user_asm(val, "ldd", ptr)
-#define STD_USER(x, ptr)       __put_user_asm("std", x, ptr)
+#define LDD_USER(sr, val, ptr) __get_user_asm(sr, val, "ldd", ptr)
+#define STD_USER(sr, x, ptr)   __put_user_asm(sr, "std", x, ptr)
 #endif
 
 /*
@@ -67,28 +59,15 @@ struct exception_table_entry {
 #define ASM_EXCEPTIONTABLE_ENTRY_EFAULT( fault_addr, except_addr )\
        ASM_EXCEPTIONTABLE_ENTRY( fault_addr, except_addr + 1)
 
-/*
- * load_sr2() preloads the space register %%sr2 - based on the value of
- * get_fs() - with either a value of 0 to access kernel space (KERNEL_DS which
- * is 0), or with the current value of %%sr3 to access user space (USER_DS)
- * memory. The following __get_user_asm() and __put_user_asm() functions have
- * %%sr2 hard-coded to access the requested memory.
- */
-#define load_sr2() \
-       __asm__(" or,=  %0,%%r0,%%r0\n\t"       \
-               " mfsp %%sr3,%0\n\t"            \
-               " mtsp %0,%%sr2\n\t"            \
-               : : "r"(get_fs()) : )
-
-#define __get_user_internal(val, ptr)                  \
+#define __get_user_internal(sr, val, ptr)              \
 ({                                                     \
        register long __gu_err __asm__ ("r8") = 0;      \
                                                        \
        switch (sizeof(*(ptr))) {                       \
-       case 1: __get_user_asm(val, "ldb", ptr); break; \
-       case 2: __get_user_asm(val, "ldh", ptr); break; \
-       case 4: __get_user_asm(val, "ldw", ptr); break; \
-       case 8: LDD_USER(val, ptr); break;              \
+       case 1: __get_user_asm(sr, val, "ldb", ptr); break; \
+       case 2: __get_user_asm(sr, val, "ldh", ptr); break; \
+       case 4: __get_user_asm(sr, val, "ldw", ptr); break; \
+       case 8: LDD_USER(sr, val, ptr); break;          \
        default: BUILD_BUG();                           \
        }                                               \
                                                        \
@@ -97,15 +76,14 @@ struct exception_table_entry {
 
 #define __get_user(val, ptr)                           \
 ({                                                     \
-       load_sr2();                                     \
-       __get_user_internal(val, ptr);                  \
+       __get_user_internal("%%sr3,", val, ptr);        \
 })
 
-#define __get_user_asm(val, ldx, ptr)                  \
+#define __get_user_asm(sr, val, ldx, ptr)              \
 {                                                      \
        register long __gu_val;                         \
                                                        \
-       __asm__("1: " ldx " 0(%%sr2,%2),%0\n"           \
+       __asm__("1: " ldx " 0(" sr "%2),%0\n"           \
                "9:\n"                                  \
                ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
                : "=r"(__gu_val), "=r"(__gu_err)        \
@@ -114,9 +92,22 @@ struct exception_table_entry {
        (val) = (__force __typeof__(*(ptr))) __gu_val;  \
 }
 
+#define HAVE_GET_KERNEL_NOFAULT
+#define __get_kernel_nofault(dst, src, type, err_label)        \
+{                                                      \
+       type __z;                                       \
+       long __err;                                     \
+       __err = __get_user_internal("%%sr0,", __z, (type *)(src)); \
+       if (unlikely(__err))                            \
+               goto err_label;                         \
+       else                                            \
+               *(type *)(dst) = __z;                   \
+}
+
+
 #if !defined(CONFIG_64BIT)
 
-#define __get_user_asm64(val, ptr)                     \
+#define __get_user_asm64(sr, val, ptr)                 \
 {                                                      \
        union {                                         \
                unsigned long long      l;              \
@@ -124,8 +115,8 @@ struct exception_table_entry {
        } __gu_tmp;                                     \
                                                        \
        __asm__("   copy %%r0,%R0\n"                    \
-               "1: ldw 0(%%sr2,%2),%0\n"               \
-               "2: ldw 4(%%sr2,%2),%R0\n"              \
+               "1: ldw 0(" sr "%2),%0\n"               \
+               "2: ldw 4(" sr "%2),%R0\n"              \
                "9:\n"                                  \
                ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b) \
                ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b) \
@@ -138,16 +129,16 @@ struct exception_table_entry {
 #endif /* !defined(CONFIG_64BIT) */
 
 
-#define __put_user_internal(x, ptr)                            \
+#define __put_user_internal(sr, x, ptr)                                \
 ({                                                             \
        register long __pu_err __asm__ ("r8") = 0;              \
         __typeof__(*(ptr)) __x = (__typeof__(*(ptr)))(x);      \
                                                                \
        switch (sizeof(*(ptr))) {                               \
-       case 1: __put_user_asm("stb", __x, ptr); break;         \
-       case 2: __put_user_asm("sth", __x, ptr); break;         \
-       case 4: __put_user_asm("stw", __x, ptr); break;         \
-       case 8: STD_USER(__x, ptr); break;                      \
+       case 1: __put_user_asm(sr, "stb", __x, ptr); break;     \
+       case 2: __put_user_asm(sr, "sth", __x, ptr); break;     \
+       case 4: __put_user_asm(sr, "stw", __x, ptr); break;     \
+       case 8: STD_USER(sr, __x, ptr); break;                  \
        default: BUILD_BUG();                                   \
        }                                                       \
                                                                \
@@ -156,10 +147,20 @@ struct exception_table_entry {
 
 #define __put_user(x, ptr)                                     \
 ({                                                             \
-       load_sr2();                                             \
-       __put_user_internal(x, ptr);                            \
+       __put_user_internal("%%sr3,", x, ptr);                  \
 })
 
+#define __put_kernel_nofault(dst, src, type, err_label)                \
+{                                                              \
+       type __z = *(type *)(src);                              \
+       long __err;                                             \
+       __err = __put_user_internal("%%sr0,", __z, (type *)(dst)); \
+       if (unlikely(__err))                                    \
+               goto err_label;                                 \
+}
+
+
+
 
 /*
  * The "__put_user/kernel_asm()" macros tell gcc they read from memory
@@ -170,26 +171,26 @@ struct exception_table_entry {
  * r8 is already listed as err.
  */
 
-#define __put_user_asm(stx, x, ptr)                         \
-       __asm__ __volatile__ (                              \
-               "1: " stx " %2,0(%%sr2,%1)\n"               \
-               "9:\n"                                      \
-               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b)     \
-               : "=r"(__pu_err)                            \
+#define __put_user_asm(sr, stx, x, ptr)                                \
+       __asm__ __volatile__ (                                  \
+               "1: " stx " %2,0(" sr "%1)\n"                   \
+               "9:\n"                                          \
+               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b)         \
+               : "=r"(__pu_err)                                \
                : "r"(ptr), "r"(x), "0"(__pu_err))
 
 
 #if !defined(CONFIG_64BIT)
 
-#define __put_user_asm64(__val, ptr) do {                  \
-       __asm__ __volatile__ (                              \
-               "1: stw %2,0(%%sr2,%1)\n"                   \
-               "2: stw %R2,4(%%sr2,%1)\n"                  \
-               "9:\n"                                      \
-               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b)     \
-               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b)     \
-               : "=r"(__pu_err)                            \
-               : "r"(ptr), "r"(__val), "0"(__pu_err));     \
+#define __put_user_asm64(sr, __val, ptr) do {                  \
+       __asm__ __volatile__ (                                  \
+               "1: stw %2,0(" sr "%1)\n"                       \
+               "2: stw %R2,4(" sr "%1)\n"                      \
+               "9:\n"                                          \
+               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(1b, 9b)         \
+               ASM_EXCEPTIONTABLE_ENTRY_EFAULT(2b, 9b)         \
+               : "=r"(__pu_err)                                \
+               : "r"(ptr), "r"(__val), "0"(__pu_err));         \
 } while (0)
 
 #endif /* !defined(CONFIG_64BIT) */
@@ -200,14 +201,12 @@ struct exception_table_entry {
  */
 
 extern long strncpy_from_user(char *, const char __user *, long);
-extern unsigned lclear_user(void __user *, unsigned long);
-extern long lstrnlen_user(const char __user *, long);
+extern __must_check unsigned lclear_user(void __user *, unsigned long);
+extern __must_check long strnlen_user(const char __user *src, long n);
 /*
  * Complex access routines -- macros
  */
-#define user_addr_max() (~0UL)
 
-#define strnlen_user lstrnlen_user
 #define clear_user lclear_user
 #define __clear_user lclear_user
 
@@ -215,8 +214,6 @@ unsigned long __must_check raw_copy_to_user(void __user *dst, const void *src,
                                            unsigned long len);
 unsigned long __must_check raw_copy_from_user(void *dst, const void __user *src,
                                            unsigned long len);
-unsigned long __must_check raw_copy_in_user(void __user *dst, const void __user *src,
-                                           unsigned long len);
 #define INLINE_COPY_TO_USER
 #define INLINE_COPY_FROM_USER
 
index 33113ba..22924a3 100644 (file)
@@ -230,7 +230,6 @@ int main(void)
        DEFINE(TI_TASK, offsetof(struct thread_info, task));
        DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
        DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
-       DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit));
        DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
        DEFINE(THREAD_SZ, sizeof(struct thread_info));
        /* THREAD_SZ_ALGN includes space for a stack frame. */
index e8a6a75..00297e8 100644 (file)
@@ -32,7 +32,6 @@ EXPORT_SYMBOL(__xchg64);
 
 #include <linux/uaccess.h>
 EXPORT_SYMBOL(lclear_user);
-EXPORT_SYMBOL(lstrnlen_user);
 
 #ifndef CONFIG_64BIT
 /* Needed so insmod can set dp value */
index 3fb86ee..cceb098 100644 (file)
@@ -150,8 +150,6 @@ void __init setup_arch(char **cmdline_p)
 #ifdef CONFIG_PA11
        dma_ops_init();
 #endif
-
-       clear_sched_clock_stable();
 }
 
 /*
index db1a47c..bbfe23c 100644 (file)
@@ -237,18 +237,22 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
 #endif
        
        usp = (regs->gr[30] & ~(0x01UL));
+       sigframe_size = PARISC_RT_SIGFRAME_SIZE;
 #ifdef CONFIG_64BIT
        if (is_compat_task()) {
                /* The gcc alloca implementation leaves garbage in the upper 32 bits of sp */
                usp = (compat_uint_t)usp;
+               sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
        }
 #endif
-       /*FIXME: frame_size parameter is unused, remove it. */
-       frame = get_sigframe(&ksig->ka, usp, sizeof(*frame));
+       frame = get_sigframe(&ksig->ka, usp, sigframe_size);
 
        DBG(1,"SETUP_RT_FRAME: START\n");
        DBG(1,"setup_rt_frame: frame %p info %p\n", frame, ksig->info);
 
+       start = (unsigned long) frame;
+       if (start >= user_addr_max() - sigframe_size)
+               return -EFAULT;
        
 #ifdef CONFIG_64BIT
 
@@ -284,32 +288,21 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
           already in userspace. The first words of tramp are used to
           save the previous sigrestartblock trampoline that might be
           on the stack. We start the sigreturn trampoline at 
-          SIGRESTARTBLOCK_TRAMP+X. */
+          SIGRESTARTBLOCK_TRAMP. */
        err |= __put_user(in_syscall ? INSN_LDI_R25_1 : INSN_LDI_R25_0,
                        &frame->tramp[SIGRESTARTBLOCK_TRAMP+0]);
-       err |= __put_user(INSN_LDI_R20, 
-                       &frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
        err |= __put_user(INSN_BLE_SR2_R0, 
+                       &frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
+       err |= __put_user(INSN_LDI_R20,
                        &frame->tramp[SIGRESTARTBLOCK_TRAMP+2]);
-       err |= __put_user(INSN_NOP, &frame->tramp[SIGRESTARTBLOCK_TRAMP+3]);
-
-#if DEBUG_SIG
-       /* Assert that we're flushing in the correct space... */
-       {
-               unsigned long sid;
-               asm ("mfsp %%sr3,%0" : "=r" (sid));
-               DBG(1,"setup_rt_frame: Flushing 64 bytes at space %#x offset %p\n",
-                      sid, frame->tramp);
-       }
-#endif
 
-       start = (unsigned long) &frame->tramp[0];
-       end = (unsigned long) &frame->tramp[TRAMP_SIZE];
+       start = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+0];
+       end = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+3];
        flush_user_dcache_range_asm(start, end);
        flush_user_icache_range_asm(start, end);
 
        /* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
-        * TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
+        * TRAMP Words 5-7, Length 3 = SIGRETURN_TRAMP
         * So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
         */
        rp = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP];
@@ -353,11 +346,6 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
 
        /* The syscall return path will create IAOQ values from r31.
         */
-       sigframe_size = PARISC_RT_SIGFRAME_SIZE;
-#ifdef CONFIG_64BIT
-       if (is_compat_task())
-               sigframe_size = PARISC_RT_SIGFRAME_SIZE32;
-#endif
        if (in_syscall) {
                regs->gr[31] = haddr;
 #ifdef CONFIG_64BIT
@@ -501,7 +489,6 @@ syscall_restart(struct pt_regs *regs, struct k_sigaction *ka)
                DBG(1,"ERESTARTNOHAND: returning -EINTR\n");
                regs->gr[28] = -EINTR;
                break;
-
        case -ERESTARTSYS:
                if (!(ka->sa.sa_flags & SA_RESTART)) {
                        DBG(1,"ERESTARTSYS: putting -EINTR\n");
@@ -529,6 +516,10 @@ insert_restart_trampoline(struct pt_regs *regs)
                unsigned long end  = (unsigned long) &usp[5];
                long err = 0;
 
+               /* check that we don't exceed the stack */
+               if (A(&usp[0]) >= user_addr_max() - 5 * sizeof(int))
+                       return;
+
                /* Setup a trampoline to restart the syscall
                 * with __NR_restart_syscall
                 *
@@ -569,10 +560,6 @@ insert_restart_trampoline(struct pt_regs *regs)
 }
 
 /*
- * Note that 'init' is a special process: it doesn't get signals it doesn't
- * want to handle. Thus you cannot kill init even with a SIGKILL even by
- * mistake.
- *
  * We need to be able to restore the syscall arguments (r21-r26) to
  * restart syscalls.  Thus, the syscall path should save them in the
  * pt_regs structure (it's okay to do so since they are caller-save
index f166250..a5bdbb5 100644 (file)
@@ -36,7 +36,7 @@ struct compat_regfile {
         compat_int_t rf_sar;
 };
 
-#define COMPAT_SIGRETURN_TRAMP 4
+#define COMPAT_SIGRETURN_TRAMP 3
 #define COMPAT_SIGRESTARTBLOCK_TRAMP 5
 #define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + \
                                COMPAT_SIGRESTARTBLOCK_TRAMP)
index 0bf854b..bf751e0 100644 (file)
 258    32      clock_nanosleep         sys_clock_nanosleep_time32
 258    64      clock_nanosleep         sys_clock_nanosleep
 259    common  tgkill                  sys_tgkill
-260    common  mbind                   sys_mbind                       compat_sys_mbind
-261    common  get_mempolicy           sys_get_mempolicy               compat_sys_get_mempolicy
-262    common  set_mempolicy           sys_set_mempolicy               compat_sys_set_mempolicy
+260    common  mbind                   sys_mbind
+261    common  get_mempolicy           sys_get_mempolicy
+262    common  set_mempolicy           sys_set_mempolicy
 # 263 was vserver
 264    common  add_key                 sys_add_key
 265    common  request_key             sys_request_key
 292    64      sync_file_range         sys_sync_file_range
 293    common  tee                     sys_tee
 294    common  vmsplice                sys_vmsplice
-295    common  move_pages              sys_move_pages                  compat_sys_move_pages
+295    common  move_pages              sys_move_pages
 296    common  getcpu                  sys_getcpu
 297    common  epoll_pwait             sys_epoll_pwait                 compat_sys_epoll_pwait
 298    common  statfs64                sys_statfs64                    compat_sys_statfs64
index 08e4d48..9fb1e79 100644 (file)
@@ -265,6 +265,9 @@ static int __init init_cr16_clocksource(void)
                            (cpu0_loc == per_cpu(cpu_data, cpu).cpu_loc))
                                continue;
 
+                       /* mark sched_clock unstable */
+                       clear_sched_clock_stable();
+
                        clocksource_cr16.name = "cr16_unstable";
                        clocksource_cr16.flags = CLOCK_SOURCE_UNSTABLE;
                        clocksource_cr16.rating = 0;
@@ -272,10 +275,6 @@ static int __init init_cr16_clocksource(void)
                }
        }
 
-       /* XXX: We may want to mark sched_clock stable here if cr16 clocks are
-        *      in sync:
-        *      (clocksource_cr16.flags == CLOCK_SOURCE_IS_CONTINUOUS) */
-
        /* register at clocksource framework */
        clocksource_register_hz(&clocksource_cr16,
                100 * PAGE0->mem_10msec);
index 36d6a86..b428d29 100644 (file)
 #include <asm/errno.h>
 #include <linux/linkage.h>
 
-       /*
-        * get_sr gets the appropriate space value into
-        * sr1 for kernel/user space access, depending
-        * on the flag stored in the task structure.
-        */
-
-       .macro  get_sr
-       mfctl       %cr30,%r1
-       ldw         TI_SEGMENT(%r1),%r22
-       mfsp        %sr3,%r1
-       or,<>       %r22,%r0,%r0
-       copy        %r0,%r1
-       mtsp        %r1,%sr1
-       .endm
-
        /*
         * unsigned long lclear_user(void *to, unsigned long n)
         *
 
 ENTRY_CFI(lclear_user)
        comib,=,n   0,%r25,$lclu_done
-       get_sr
 $lclu_loop:
        addib,<>    -1,%r25,$lclu_loop
-1:      stbs,ma     %r0,1(%sr1,%r26)
+1:     stbs,ma     %r0,1(%sr3,%r26)
 
 $lclu_done:
        bv          %r0(%r2)
@@ -67,40 +51,6 @@ $lclu_done:
 ENDPROC_CFI(lclear_user)
 
 
-       /*
-        * long lstrnlen_user(char *s, long n)
-        *
-        * Returns 0 if exception before zero byte or reaching N,
-        *         N+1 if N would be exceeded,
-        *         else strlen + 1 (i.e. includes zero byte).
-        */
-
-ENTRY_CFI(lstrnlen_user)
-       comib,=     0,%r25,$lslen_nzero
-       copy        %r26,%r24
-       get_sr
-1:      ldbs,ma     1(%sr1,%r26),%r1
-$lslen_loop:
-       comib,=,n   0,%r1,$lslen_done
-       addib,<>    -1,%r25,$lslen_loop
-2:      ldbs,ma     1(%sr1,%r26),%r1
-$lslen_done:
-       bv          %r0(%r2)
-       sub         %r26,%r24,%r28
-
-$lslen_nzero:
-       b           $lslen_done
-       ldo         1(%r26),%r26 /* special case for N == 0 */
-
-3:      b          $lslen_done
-       copy        %r24,%r26    /* reset r26 so 0 is returned on fault */
-
-       ASM_EXCEPTIONTABLE_ENTRY(1b,3b)
-       ASM_EXCEPTIONTABLE_ENTRY(2b,3b)
-
-ENDPROC_CFI(lstrnlen_user)
-
-
 /*
  * unsigned long pa_memcpy(void *dstp, const void *srcp, unsigned long len)
  *
index 4b75388..ea70a0e 100644 (file)
@@ -38,14 +38,6 @@ unsigned long raw_copy_from_user(void *dst, const void __user *src,
 }
 EXPORT_SYMBOL(raw_copy_from_user);
 
-unsigned long raw_copy_in_user(void __user *dst, const void __user *src, unsigned long len)
-{
-       mtsp(get_user_space(), 1);
-       mtsp(get_user_space(), 2);
-       return pa_memcpy((void __force *)dst, (void __force *)src, len);
-}
-
-
 void * memcpy(void * dst,const void *src, size_t count)
 {
        mtsp(get_kernel_space(), 1);
@@ -54,7 +46,6 @@ void * memcpy(void * dst,const void *src, size_t count)
        return dst;
 }
 
-EXPORT_SYMBOL(raw_copy_in_user);
 EXPORT_SYMBOL(memcpy);
 
 bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
index e33dcf1..7afc96f 100644 (file)
@@ -83,22 +83,6 @@ struct compat_statfs {
 
 #define COMPAT_OFF_T_MAX       0x7fffffff
 
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       struct pt_regs *regs = current->thread.regs;
-       unsigned long usp = regs->gpr[1];
-
-       /*
-        * We can't access below the stack pointer in the 32bit ABI and
-        * can access 288 bytes in the 64bit big-endian ABI,
-        * or 512 bytes with the new ELFv2 little-endian ABI.
-        */
-       if (!is_32bit_task())
-               usp -= USER_REDZONE_SIZE;
-
-       return (void __user *) (usp - len);
-}
-
 /*
  * ipc64_perm is actually 32/64bit clean but since the compat layer refers to
  * it we may as well define it.
index 29b55e2..7bef917 100644 (file)
 256    64      sys_debug_setcontext            sys_ni_syscall
 256    spu     sys_debug_setcontext            sys_ni_syscall
 # 257 reserved for vserver
-258    nospu   migrate_pages                   sys_migrate_pages               compat_sys_migrate_pages
-259    nospu   mbind                           sys_mbind                       compat_sys_mbind
-260    nospu   get_mempolicy                   sys_get_mempolicy               compat_sys_get_mempolicy
-261    nospu   set_mempolicy                   sys_set_mempolicy               compat_sys_set_mempolicy
+258    nospu   migrate_pages                   sys_migrate_pages
+259    nospu   mbind                           sys_mbind
+260    nospu   get_mempolicy                   sys_get_mempolicy
+261    nospu   set_mempolicy                   sys_set_mempolicy
 262    nospu   mq_open                         sys_mq_open                     compat_sys_mq_open
 263    nospu   mq_unlink                       sys_mq_unlink
 264    32      mq_timedsend                    sys_mq_timedsend_time32
 298    common  faccessat                       sys_faccessat
 299    common  get_robust_list                 sys_get_robust_list             compat_sys_get_robust_list
 300    common  set_robust_list                 sys_set_robust_list             compat_sys_set_robust_list
-301    common  move_pages                      sys_move_pages                  compat_sys_move_pages
+301    common  move_pages                      sys_move_pages
 302    common  getcpu                          sys_getcpu
 303    nospu   epoll_pwait                     sys_epoll_pwait                 compat_sys_epoll_pwait
 304    32      utimensat                       sys_utimensat_time32
index 5af51ac..2bd90c5 100644 (file)
@@ -110,6 +110,7 @@ config S390
        select ARCH_STACKWALK
        select ARCH_SUPPORTS_ATOMIC_RMW
        select ARCH_SUPPORTS_DEBUG_PAGEALLOC
+       select ARCH_SUPPORTS_HUGETLBFS
        select ARCH_SUPPORTS_NUMA_BALANCING
        select ARCH_USE_BUILTIN_BSWAP
        select ARCH_USE_CMPXCHG_LOCKREF
index 11ffc7c..37b6115 100644 (file)
@@ -804,6 +804,7 @@ CONFIG_DEBUG_VM_PGFLAGS=y
 CONFIG_DEBUG_MEMORY_INIT=y
 CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m
 CONFIG_DEBUG_PER_CPU_MAPS=y
+CONFIG_KFENCE=y
 CONFIG_DEBUG_SHIRQ=y
 CONFIG_PANIC_ON_OOPS=y
 CONFIG_DETECT_HUNG_TASK=y
index e1642d2..56a1cc8 100644 (file)
@@ -397,7 +397,6 @@ CONFIG_BLK_DEV_DRBD=m
 CONFIG_BLK_DEV_NBD=m
 CONFIG_BLK_DEV_RAM=y
 CONFIG_BLK_DEV_RAM_SIZE=32768
-# CONFIG_BLK_DEV_XPRAM is not set
 CONFIG_VIRTIO_BLK=y
 CONFIG_BLK_DEV_RBD=m
 CONFIG_BLK_DEV_NVME=m
index d576aaa..aceccf3 100644 (file)
@@ -35,7 +35,6 @@ CONFIG_NET=y
 # CONFIG_ETHTOOL_NETLINK is not set
 CONFIG_DEVTMPFS=y
 CONFIG_BLK_DEV_RAM=y
-# CONFIG_BLK_DEV_XPRAM is not set
 # CONFIG_DCSSBLK is not set
 # CONFIG_DASD is not set
 CONFIG_ENCLOSURE_SERVICES=y
index 8d49505..cdc7ae7 100644 (file)
@@ -176,16 +176,6 @@ static inline int is_compat_task(void)
        return test_thread_flag(TIF_31BIT);
 }
 
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       unsigned long stack;
-
-       stack = KSTK_ESP(current);
-       if (is_compat_task())
-               stack &= 0x7fffffffUL;
-       return (void __user *) (stack - len);
-}
-
 #endif
 
 struct compat_ipc64_perm {
index ca0e0e5..f87a478 100644 (file)
@@ -24,13 +24,6 @@ enum cpumf_ctr_set {
 
 #define CPUMF_LCCTL_ENABLE_SHIFT    16
 #define CPUMF_LCCTL_ACTCTL_SHIFT     0
-static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = {
-       [CPUMF_CTR_SET_BASIC]   = 0x02,
-       [CPUMF_CTR_SET_USER]    = 0x04,
-       [CPUMF_CTR_SET_CRYPTO]  = 0x08,
-       [CPUMF_CTR_SET_EXT]     = 0x01,
-       [CPUMF_CTR_SET_MT_DIAG] = 0x20,
-};
 
 static inline void ctr_set_enable(u64 *state, u64 ctrsets)
 {
index e317fd4..f16f4d0 100644 (file)
@@ -18,6 +18,7 @@ extern struct mutex smp_cpu_state_mutex;
 extern unsigned int smp_cpu_mt_shift;
 extern unsigned int smp_cpu_mtid;
 extern __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
+extern cpumask_t cpu_setup_mask;
 
 extern int __cpu_up(unsigned int cpu, struct task_struct *tidle);
 
index 3d8a4b9..dd00d98 100644 (file)
@@ -34,16 +34,6 @@ static inline bool on_stack(struct stack_info *info,
        return addr >= info->begin && addr + len <= info->end;
 }
 
-static __always_inline unsigned long get_stack_pointer(struct task_struct *task,
-                                                      struct pt_regs *regs)
-{
-       if (regs)
-               return (unsigned long) kernel_stack_pointer(regs);
-       if (task == current)
-               return current_stack_pointer();
-       return (unsigned long) task->thread.ksp;
-}
-
 /*
  * Stack layout of a C stack frame.
  */
@@ -74,6 +64,16 @@ struct stack_frame {
        ((unsigned long)__builtin_frame_address(0) -                    \
         offsetof(struct stack_frame, back_chain))
 
+static __always_inline unsigned long get_stack_pointer(struct task_struct *task,
+                                                      struct pt_regs *regs)
+{
+       if (regs)
+               return (unsigned long)kernel_stack_pointer(regs);
+       if (task == current)
+               return current_frame_address();
+       return (unsigned long)task->thread.ksp;
+}
+
 /*
  * To keep this simple mark register 2-6 as being changed (volatile)
  * by the called function, even though register 6 is saved/nonvolatile.
index 9ed9aa3..ce550d0 100644 (file)
@@ -227,9 +227,6 @@ static inline int __get_user_fn(void *x, const void __user *ptr, unsigned long s
        __get_user(x, ptr);                                     \
 })
 
-unsigned long __must_check
-raw_copy_in_user(void __user *to, const void __user *from, unsigned long n);
-
 /*
  * Copy a null terminated string from userspace.
  */
index de9006b..5ebf534 100644 (file)
@@ -55,10 +55,10 @@ static inline bool unwind_error(struct unwind_state *state)
        return state->error;
 }
 
-static inline void unwind_start(struct unwind_state *state,
-                               struct task_struct *task,
-                               struct pt_regs *regs,
-                               unsigned long first_frame)
+static __always_inline void unwind_start(struct unwind_state *state,
+                                        struct task_struct *task,
+                                        struct pt_regs *regs,
+                                        unsigned long first_frame)
 {
        task = task ?: current;
        first_frame = first_frame ?: get_stack_pointer(task, regs);
index b9716a7..4c9b967 100644 (file)
@@ -140,10 +140,10 @@ _LPP_OFFSET       = __LC_LPP
        TSTMSK  __LC_MCCK_CODE,(MCCK_CODE_STG_ERROR|MCCK_CODE_STG_KEY_ERROR)
        jnz     \errlabel
        TSTMSK  __LC_MCCK_CODE,MCCK_CODE_STG_DEGRAD
-       jz      oklabel\@
+       jz      .Loklabel\@
        TSTMSK  __LC_MCCK_CODE,MCCK_CODE_STG_FAIL_ADDR
        jnz     \errlabel
-oklabel\@:
+.Loklabel\@:
        .endm
 
 #if IS_ENABLED(CONFIG_KVM)
index 0a464d3..1d94ffd 100644 (file)
@@ -341,13 +341,13 @@ NOKPROBE_SYMBOL(prepare_ftrace_return);
  */
 int ftrace_enable_ftrace_graph_caller(void)
 {
-       brcl_disable(__va(ftrace_graph_caller));
+       brcl_disable(ftrace_graph_caller);
        return 0;
 }
 
 int ftrace_disable_ftrace_graph_caller(void)
 {
-       brcl_enable(__va(ftrace_graph_caller));
+       brcl_enable(ftrace_graph_caller);
        return 0;
 }
 
index 2e3bb63..4a99154 100644 (file)
@@ -158,6 +158,14 @@ static size_t cfdiag_getctrset(struct cf_ctrset_entry *ctrdata, int ctrset,
        return need;
 }
 
+static const u64 cpumf_ctr_ctl[CPUMF_CTR_SET_MAX] = {
+       [CPUMF_CTR_SET_BASIC]   = 0x02,
+       [CPUMF_CTR_SET_USER]    = 0x04,
+       [CPUMF_CTR_SET_CRYPTO]  = 0x08,
+       [CPUMF_CTR_SET_EXT]     = 0x01,
+       [CPUMF_CTR_SET_MT_DIAG] = 0x20,
+};
+
 /* Read out all counter sets and save them in the provided data buffer.
  * The last 64 byte host an artificial trailer entry.
  */
index 5a01872..67e5fff 100644 (file)
@@ -50,6 +50,7 @@
 #include <linux/compat.h>
 #include <linux/start_kernel.h>
 #include <linux/hugetlb.h>
+#include <linux/kmemleak.h>
 
 #include <asm/boot_data.h>
 #include <asm/ipl.h>
@@ -356,9 +357,12 @@ void *restart_stack;
 unsigned long stack_alloc(void)
 {
 #ifdef CONFIG_VMAP_STACK
-       return (unsigned long)__vmalloc_node(THREAD_SIZE, THREAD_SIZE,
-                       THREADINFO_GFP, NUMA_NO_NODE,
-                       __builtin_return_address(0));
+       void *ret;
+
+       ret = __vmalloc_node(THREAD_SIZE, THREAD_SIZE, THREADINFO_GFP,
+                            NUMA_NO_NODE, __builtin_return_address(0));
+       kmemleak_not_leak(ret);
+       return (unsigned long)ret;
 #else
        return __get_free_pages(GFP_KERNEL, THREAD_SIZE_ORDER);
 #endif
index 2a991e4..1a04e5b 100644 (file)
@@ -95,6 +95,7 @@ __vector128 __initdata boot_cpu_vector_save_area[__NUM_VXRS];
 #endif
 
 static unsigned int smp_max_threads __initdata = -1U;
+cpumask_t cpu_setup_mask;
 
 static int __init early_nosmt(char *s)
 {
@@ -902,13 +903,14 @@ static void smp_start_secondary(void *cpuvoid)
        vtime_init();
        vdso_getcpu_init();
        pfault_init();
+       cpumask_set_cpu(cpu, &cpu_setup_mask);
+       update_cpu_masks();
        notify_cpu_starting(cpu);
        if (topology_cpu_dedicated(cpu))
                set_cpu_flag(CIF_DEDICATED_CPU);
        else
                clear_cpu_flag(CIF_DEDICATED_CPU);
        set_cpu_online(cpu, true);
-       update_cpu_masks();
        inc_irq_stat(CPU_RST);
        local_irq_enable();
        cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
@@ -950,10 +952,13 @@ early_param("possible_cpus", _setup_possible_cpus);
 int __cpu_disable(void)
 {
        unsigned long cregs[16];
+       int cpu;
 
        /* Handle possible pending IPIs */
        smp_handle_ext_call();
-       set_cpu_online(smp_processor_id(), false);
+       cpu = smp_processor_id();
+       set_cpu_online(cpu, false);
+       cpumask_clear_cpu(cpu, &cpu_setup_mask);
        update_cpu_masks();
        /* Disable pseudo page faults on this cpu. */
        pfault_fini();
index aa9d68b..df5261e 100644 (file)
 265  common    statfs64                sys_statfs64                    compat_sys_statfs64
 266  common    fstatfs64               sys_fstatfs64                   compat_sys_fstatfs64
 267  common    remap_file_pages        sys_remap_file_pages            sys_remap_file_pages
-268  common    mbind                   sys_mbind                       compat_sys_mbind
-269  common    get_mempolicy           sys_get_mempolicy               compat_sys_get_mempolicy
-270  common    set_mempolicy           sys_set_mempolicy               compat_sys_set_mempolicy
+268  common    mbind                   sys_mbind                       sys_mbind
+269  common    get_mempolicy           sys_get_mempolicy               sys_get_mempolicy
+270  common    set_mempolicy           sys_set_mempolicy               sys_set_mempolicy
 271  common    mq_open                 sys_mq_open                     compat_sys_mq_open
 272  common    mq_unlink               sys_mq_unlink                   sys_mq_unlink
 273  common    mq_timedsend            sys_mq_timedsend                sys_mq_timedsend_time32
 284  common    inotify_init            sys_inotify_init                sys_inotify_init
 285  common    inotify_add_watch       sys_inotify_add_watch           sys_inotify_add_watch
 286  common    inotify_rm_watch        sys_inotify_rm_watch            sys_inotify_rm_watch
-287  common    migrate_pages           sys_migrate_pages               compat_sys_migrate_pages
+287  common    migrate_pages           sys_migrate_pages               sys_migrate_pages
 288  common    openat                  sys_openat                      compat_sys_openat
 289  common    mkdirat                 sys_mkdirat                     sys_mkdirat
 290  common    mknodat                 sys_mknodat                     sys_mknodat
 307  common    sync_file_range         sys_sync_file_range             compat_sys_s390_sync_file_range
 308  common    tee                     sys_tee                         sys_tee
 309  common    vmsplice                sys_vmsplice                    sys_vmsplice
-310  common    move_pages              sys_move_pages                  compat_sys_move_pages
+310  common    move_pages              sys_move_pages                  sys_move_pages
 311  common    getcpu                  sys_getcpu                      sys_getcpu
 312  common    epoll_pwait             sys_epoll_pwait                 compat_sys_epoll_pwait
 313  common    utimes                  sys_utimes                      sys_utimes_time32
index d2458a2..58f8291 100644 (file)
@@ -67,7 +67,7 @@ static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int c
        static cpumask_t mask;
 
        cpumask_clear(&mask);
-       if (!cpu_online(cpu))
+       if (!cpumask_test_cpu(cpu, &cpu_setup_mask))
                goto out;
        cpumask_set_cpu(cpu, &mask);
        switch (topology_mode) {
@@ -88,7 +88,7 @@ static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int c
        case TOPOLOGY_MODE_SINGLE:
                break;
        }
-       cpumask_and(&mask, &mask, cpu_online_mask);
+       cpumask_and(&mask, &mask, &cpu_setup_mask);
 out:
        cpumask_copy(dst, &mask);
 }
@@ -99,16 +99,16 @@ static void cpu_thread_map(cpumask_t *dst, unsigned int cpu)
        int i;
 
        cpumask_clear(&mask);
-       if (!cpu_online(cpu))
+       if (!cpumask_test_cpu(cpu, &cpu_setup_mask))
                goto out;
        cpumask_set_cpu(cpu, &mask);
        if (topology_mode != TOPOLOGY_MODE_HW)
                goto out;
        cpu -= cpu % (smp_cpu_mtid + 1);
-       for (i = 0; i <= smp_cpu_mtid; i++)
-               if (cpu_present(cpu + i))
+       for (i = 0; i <= smp_cpu_mtid; i++) {
+               if (cpumask_test_cpu(cpu + i, &cpu_setup_mask))
                        cpumask_set_cpu(cpu + i, &mask);
-       cpumask_and(&mask, &mask, cpu_online_mask);
+       }
 out:
        cpumask_copy(dst, &mask);
 }
@@ -569,6 +569,7 @@ void __init topology_init_early(void)
        alloc_masks(info, &book_info, 2);
        alloc_masks(info, &drawer_info, 3);
 out:
+       cpumask_set_cpu(0, &cpu_setup_mask);
        __arch_update_cpu_topology();
        __arch_update_dedicated_flag(NULL);
 }
index 94ca99b..a596e69 100644 (file)
@@ -204,69 +204,6 @@ unsigned long raw_copy_to_user(void __user *to, const void *from, unsigned long
 }
 EXPORT_SYMBOL(raw_copy_to_user);
 
-static inline unsigned long copy_in_user_mvcos(void __user *to, const void __user *from,
-                                              unsigned long size)
-{
-       unsigned long tmp1, tmp2;
-
-       tmp1 = -4096UL;
-       /* FIXME: copy with reduced length. */
-       asm volatile(
-               "   lgr   0,%[spec]\n"
-               "0: .insn ss,0xc80000000000,0(%0,%1),0(%2),0\n"
-               "   jz    2f\n"
-               "1: algr  %0,%3\n"
-               "   slgr  %1,%3\n"
-               "   slgr  %2,%3\n"
-               "   j     0b\n"
-               "2:slgr  %0,%0\n"
-               "3: \n"
-               EX_TABLE(0b,3b)
-               : "+a" (size), "+a" (to), "+a" (from), "+a" (tmp1), "=a" (tmp2)
-               : [spec] "d" (0x810081UL)
-               : "cc", "memory", "0");
-       return size;
-}
-
-static inline unsigned long copy_in_user_mvc(void __user *to, const void __user *from,
-                                            unsigned long size)
-{
-       unsigned long tmp1;
-
-       asm volatile(
-               "   sacf  256\n"
-               "   aghi  %0,-1\n"
-               "   jo    5f\n"
-               "   bras  %3,3f\n"
-               "0: aghi  %0,257\n"
-               "1: mvc   0(1,%1),0(%2)\n"
-               "   la    %1,1(%1)\n"
-               "   la    %2,1(%2)\n"
-               "   aghi  %0,-1\n"
-               "   jnz   1b\n"
-               "   j     5f\n"
-               "2: mvc   0(256,%1),0(%2)\n"
-               "   la    %1,256(%1)\n"
-               "   la    %2,256(%2)\n"
-               "3: aghi  %0,-256\n"
-               "   jnm   2b\n"
-               "4: ex    %0,1b-0b(%3)\n"
-               "5: slgr  %0,%0\n"
-               "6: sacf  768\n"
-               EX_TABLE(1b,6b) EX_TABLE(2b,0b) EX_TABLE(4b,0b)
-               : "+a" (size), "+a" (to), "+a" (from), "=a" (tmp1)
-               : : "cc", "memory");
-       return size;
-}
-
-unsigned long raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
-{
-       if (copy_with_mvcos())
-               return copy_in_user_mvcos(to, from, n);
-       return copy_in_user_mvc(to, from, n);
-}
-EXPORT_SYMBOL(raw_copy_in_user);
-
 static inline unsigned long clear_user_mvcos(void __user *to, unsigned long size)
 {
        unsigned long tmp1, tmp2;
index 9bb2c75..4d3b33c 100644 (file)
@@ -27,7 +27,6 @@
 
 /**
  * gmap_alloc - allocate and initialize a guest address space
- * @mm: pointer to the parent mm_struct
  * @limit: maximum address of the gmap address space
  *
  * Returns a guest address space structure.
@@ -504,7 +503,7 @@ EXPORT_SYMBOL_GPL(gmap_translate);
 
 /**
  * gmap_unlink - disconnect a page table from the gmap shadow tables
- * @gmap: pointer to guest mapping meta data structure
+ * @mm: pointer to the parent mm_struct
  * @table: pointer to the host page table
  * @vmaddr: vm address associated with the host page table
  */
@@ -527,7 +526,7 @@ static void gmap_pmdp_xchg(struct gmap *gmap, pmd_t *old, pmd_t new,
                           unsigned long gaddr);
 
 /**
- * gmap_link - set up shadow page tables to connect a host to a guest address
+ * __gmap_link - set up shadow page tables to connect a host to a guest address
  * @gmap: pointer to guest mapping meta data structure
  * @gaddr: guest address
  * @vmaddr: vm address
@@ -1971,7 +1970,7 @@ out_free:
 EXPORT_SYMBOL_GPL(gmap_shadow_sgt);
 
 /**
- * gmap_shadow_lookup_pgtable - find a shadow page table
+ * gmap_shadow_pgt_lookup - find a shadow page table
  * @sg: pointer to the shadow guest address space structure
  * @saddr: the address in the shadow aguest address space
  * @pgt: parent gmap address of the page table to get shadowed
@@ -2165,7 +2164,7 @@ int gmap_shadow_page(struct gmap *sg, unsigned long saddr, pte_t pte)
 }
 EXPORT_SYMBOL_GPL(gmap_shadow_page);
 
-/**
+/*
  * gmap_shadow_notify - handle notifications for shadow gmap
  *
  * Called with sg->parent->shadow_lock.
@@ -2225,7 +2224,7 @@ static void gmap_shadow_notify(struct gmap *sg, unsigned long vmaddr,
 /**
  * ptep_notify - call all invalidation callbacks for a specific pte.
  * @mm: pointer to the process mm_struct
- * @addr: virtual address in the process address space
+ * @vmaddr: virtual address in the process address space
  * @pte: pointer to the page table entry
  * @bits: bits from the pgste that caused the notify call
  *
index eec3a9d..034721a 100644 (file)
@@ -834,7 +834,7 @@ int set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
 }
 EXPORT_SYMBOL(set_guest_storage_key);
 
-/**
+/*
  * Conditionally set a guest storage key (handling csske).
  * oldkey will be updated when either mr or mc is set and a pointer is given.
  *
@@ -867,7 +867,7 @@ int cond_set_guest_storage_key(struct mm_struct *mm, unsigned long addr,
 }
 EXPORT_SYMBOL(cond_set_guest_storage_key);
 
-/**
+/*
  * Reset a guest reference bit (rrbe), returning the reference and changed bit.
  *
  * Returns < 0 in case of error, otherwise the cc to be reported to the guest.
index 51dc221..be077b3 100644 (file)
@@ -383,8 +383,8 @@ static int clp_find_pci(struct clp_req_rsp_list_pci *rrb, u32 fid,
                rc = clp_list_pci_req(rrb, &resume_token, &nentries);
                if (rc)
                        return rc;
+               fh_list = rrb->response.fh_list;
                for (i = 0; i < nentries; i++) {
-                       fh_list = rrb->response.fh_list;
                        if (fh_list[i].fid == fid) {
                                *entry = fh_list[i];
                                return 0;
@@ -449,14 +449,17 @@ int clp_get_state(u32 fid, enum zpci_state *state)
        struct clp_fh_list_entry entry;
        int rc;
 
-       *state = ZPCI_FN_STATE_RESERVED;
        rrb = clp_alloc_block(GFP_ATOMIC);
        if (!rrb)
                return -ENOMEM;
 
        rc = clp_find_pci(rrb, fid, &entry);
-       if (!rc)
+       if (!rc) {
                *state = entry.config_state;
+       } else if (rc == -ENODEV) {
+               *state = ZPCI_FN_STATE_RESERVED;
+               rc = 0;
+       }
 
        clp_free_block(rrb);
        return rc;
index 8b63410..bd949fc 100644 (file)
@@ -116,25 +116,6 @@ struct compat_statfs {
 
 #define COMPAT_OFF_T_MAX       0x7fffffff
 
-#ifdef CONFIG_COMPAT
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       struct pt_regs *regs = current_thread_info()->kregs;
-       unsigned long usp = regs->u_regs[UREG_I6];
-
-       if (test_thread_64bit_stack(usp))
-               usp += STACK_BIAS;
-
-       if (test_thread_flag(TIF_32BIT))
-               usp &= 0xffffffffUL;
-
-       usp -= len;
-       usp &= ~0x7UL;
-
-       return (void __user *) usp;
-}
-#endif
-
 struct compat_ipc64_perm {
        compat_key_t key;
        __compat_uid32_t uid;
index 093849b..d1cc410 100644 (file)
@@ -455,7 +455,7 @@ static unsigned long clone_stackframe(unsigned long csp, unsigned long psp)
 
        distance = fp - psp;
        rval = (csp - distance);
-       if (copy_in_user((void __user *) rval, (void __user *) psp, distance))
+       if (raw_copy_in_user((void __user *)rval, (void __user *)psp, distance))
                rval = 0;
        else if (!stack_64bit) {
                if (put_user(((u32)csp),
index 4276b9e..6cc124a 100644 (file)
@@ -435,9 +435,9 @@ static int setup_frame32(struct ksignal *ksig, struct pt_regs *regs,
                              (_COMPAT_NSIG_WORDS - 1) * sizeof(unsigned int));
 
        if (!wsaved) {
-               err |= copy_in_user((u32 __user *)sf,
-                                   (u32 __user *)(regs->u_regs[UREG_FP]),
-                                   sizeof(struct reg_window32));
+               err |= raw_copy_in_user((u32 __user *)sf,
+                                       (u32 __user *)(regs->u_regs[UREG_FP]),
+                                       sizeof(struct reg_window32));
        } else {
                struct reg_window *rp;
 
@@ -567,9 +567,9 @@ static int setup_rt_frame32(struct ksignal *ksig, struct pt_regs *regs,
        err |= put_compat_sigset(&sf->mask, oldset, sizeof(compat_sigset_t));
 
        if (!wsaved) {
-               err |= copy_in_user((u32 __user *)sf,
-                                   (u32 __user *)(regs->u_regs[UREG_FP]),
-                                   sizeof(struct reg_window32));
+               err |= raw_copy_in_user((u32 __user *)sf,
+                                       (u32 __user *)(regs->u_regs[UREG_FP]),
+                                       sizeof(struct reg_window32));
        } else {
                struct reg_window *rp;
 
index cea23cf..2a78d2a 100644 (file)
@@ -406,10 +406,10 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
        err |= copy_to_user(&sf->mask, sigmask_to_save(), sizeof(sigset_t));
 
        if (!wsaved) {
-               err |= copy_in_user((u64 __user *)sf,
-                                   (u64 __user *)(regs->u_regs[UREG_FP] +
-                                                  STACK_BIAS),
-                                   sizeof(struct reg_window));
+               err |= raw_copy_in_user((u64 __user *)sf,
+                                       (u64 __user *)(regs->u_regs[UREG_FP] +
+                                          STACK_BIAS),
+                                       sizeof(struct reg_window));
        } else {
                struct reg_window *rp;
 
index 7893104..c37764d 100644 (file)
 299    common  unshare                 sys_unshare
 300    common  set_robust_list         sys_set_robust_list             compat_sys_set_robust_list
 301    common  get_robust_list         sys_get_robust_list             compat_sys_get_robust_list
-302    common  migrate_pages           sys_migrate_pages               compat_sys_migrate_pages
-303    common  mbind                   sys_mbind                       compat_sys_mbind
-304    common  get_mempolicy           sys_get_mempolicy               compat_sys_get_mempolicy
-305    common  set_mempolicy           sys_set_mempolicy               compat_sys_set_mempolicy
+302    common  migrate_pages           sys_migrate_pages
+303    common  mbind                   sys_mbind
+304    common  get_mempolicy           sys_get_mempolicy
+305    common  set_mempolicy           sys_set_mempolicy
 306    common  kexec_load              sys_kexec_load                  compat_sys_kexec_load
-307    common  move_pages              sys_move_pages                  compat_sys_move_pages
+307    common  move_pages              sys_move_pages
 308    common  getcpu                  sys_getcpu
 309    common  epoll_pwait             sys_epoll_pwait                 compat_sys_epoll_pwait
 310    32      utimensat               sys_utimensat_time32
index 8de2646..c18b45f 100644 (file)
@@ -24,6 +24,7 @@ config UML
        select SET_FS
        select TRACE_IRQFLAGS_SUPPORT
        select TTY # Needed for line.c
+       select HAVE_ARCH_VMAP_STACK
 
 config MMU
        bool
index 0b80283..c080666 100644 (file)
@@ -56,6 +56,13 @@ static unsigned long um_pci_msi_used[BITS_TO_LONGS(MAX_MSI_VECTORS)];
 
 #define UM_VIRT_PCI_MAXDELAY 40000
 
+struct um_pci_message_buffer {
+       struct virtio_pcidev_msg hdr;
+       u8 data[8];
+};
+
+static struct um_pci_message_buffer __percpu *um_pci_msg_bufs;
+
 static int um_pci_send_cmd(struct um_pci_device *dev,
                           struct virtio_pcidev_msg *cmd,
                           unsigned int cmd_size,
@@ -68,11 +75,12 @@ static int um_pci_send_cmd(struct um_pci_device *dev,
                [1] = extra ? &extra_sg : &in_sg,
                [2] = extra ? &in_sg : NULL,
        };
+       struct um_pci_message_buffer *buf;
        int delay_count = 0;
        int ret, len;
        bool posted;
 
-       if (WARN_ON(cmd_size < sizeof(*cmd)))
+       if (WARN_ON(cmd_size < sizeof(*cmd) || cmd_size > sizeof(*buf)))
                return -EINVAL;
 
        switch (cmd->op) {
@@ -88,6 +96,9 @@ static int um_pci_send_cmd(struct um_pci_device *dev,
                break;
        }
 
+       buf = get_cpu_var(um_pci_msg_bufs);
+       memcpy(buf, cmd, cmd_size);
+
        if (posted) {
                u8 *ncmd = kmalloc(cmd_size + extra_size, GFP_ATOMIC);
 
@@ -102,7 +113,10 @@ static int um_pci_send_cmd(struct um_pci_device *dev,
                } else {
                        /* try without allocating memory */
                        posted = false;
+                       cmd = (void *)buf;
                }
+       } else {
+               cmd = (void *)buf;
        }
 
        sg_init_one(&out_sg, cmd, cmd_size);
@@ -118,11 +132,12 @@ static int um_pci_send_cmd(struct um_pci_device *dev,
                                posted ? cmd : HANDLE_NO_FREE(cmd),
                                GFP_ATOMIC);
        if (ret)
-               return ret;
+               goto out;
 
        if (posted) {
                virtqueue_kick(dev->cmd_vq);
-               return 0;
+               ret = 0;
+               goto out;
        }
 
        /* kick and poll for getting a response on the queue */
@@ -148,6 +163,8 @@ static int um_pci_send_cmd(struct um_pci_device *dev,
        }
        clear_bit(UM_PCI_STAT_WAITING, &dev->status);
 
+out:
+       put_cpu_var(um_pci_msg_bufs);
        return ret;
 }
 
@@ -161,12 +178,17 @@ static unsigned long um_pci_cfgspace_read(void *priv, unsigned int offset,
                .size = size,
                .addr = offset,
        };
-       /* maximum size - we may only use parts of it */
-       u8 data[8];
+       /* buf->data is maximum size - we may only use parts of it */
+       struct um_pci_message_buffer *buf;
+       u8 *data;
+       unsigned long ret = ~0ULL;
 
        if (!dev)
                return ~0ULL;
 
+       buf = get_cpu_var(um_pci_msg_bufs);
+       data = buf->data;
+
        memset(data, 0xff, sizeof(data));
 
        switch (size) {
@@ -179,27 +201,34 @@ static unsigned long um_pci_cfgspace_read(void *priv, unsigned int offset,
                break;
        default:
                WARN(1, "invalid config space read size %d\n", size);
-               return ~0ULL;
+               goto out;
        }
 
-       if (um_pci_send_cmd(dev, &hdr, sizeof(hdr), NULL, 0,
-                           data, sizeof(data)))
-               return ~0ULL;
+       if (um_pci_send_cmd(dev, &hdr, sizeof(hdr), NULL, 0, data, 8))
+               goto out;
 
        switch (size) {
        case 1:
-               return data[0];
+               ret = data[0];
+               break;
        case 2:
-               return le16_to_cpup((void *)data);
+               ret = le16_to_cpup((void *)data);
+               break;
        case 4:
-               return le32_to_cpup((void *)data);
+               ret = le32_to_cpup((void *)data);
+               break;
 #ifdef CONFIG_64BIT
        case 8:
-               return le64_to_cpup((void *)data);
+               ret = le64_to_cpup((void *)data);
+               break;
 #endif
        default:
-               return ~0ULL;
+               break;
        }
+
+out:
+       put_cpu_var(um_pci_msg_bufs);
+       return ret;
 }
 
 static void um_pci_cfgspace_write(void *priv, unsigned int offset, int size,
@@ -272,8 +301,13 @@ static void um_pci_bar_copy_from(void *priv, void *buffer,
 static unsigned long um_pci_bar_read(void *priv, unsigned int offset,
                                     int size)
 {
-       /* maximum size - we may only use parts of it */
-       u8 data[8];
+       /* buf->data is maximum size - we may only use parts of it */
+       struct um_pci_message_buffer *buf;
+       u8 *data;
+       unsigned long ret = ~0ULL;
+
+       buf = get_cpu_var(um_pci_msg_bufs);
+       data = buf->data;
 
        switch (size) {
        case 1:
@@ -285,25 +319,33 @@ static unsigned long um_pci_bar_read(void *priv, unsigned int offset,
                break;
        default:
                WARN(1, "invalid config space read size %d\n", size);
-               return ~0ULL;
+               goto out;
        }
 
        um_pci_bar_copy_from(priv, data, offset, size);
 
        switch (size) {
        case 1:
-               return data[0];
+               ret = data[0];
+               break;
        case 2:
-               return le16_to_cpup((void *)data);
+               ret = le16_to_cpup((void *)data);
+               break;
        case 4:
-               return le32_to_cpup((void *)data);
+               ret = le32_to_cpup((void *)data);
+               break;
 #ifdef CONFIG_64BIT
        case 8:
-               return le64_to_cpup((void *)data);
+               ret = le64_to_cpup((void *)data);
+               break;
 #endif
        default:
-               return ~0ULL;
+               break;
        }
+
+out:
+       put_cpu_var(um_pci_msg_bufs);
+       return ret;
 }
 
 static void um_pci_bar_copy_to(void *priv, unsigned int offset,
@@ -810,7 +852,7 @@ void *pci_root_bus_fwnode(struct pci_bus *bus)
        return um_pci_fwnode;
 }
 
-int um_pci_init(void)
+static int um_pci_init(void)
 {
        int err, i;
 
@@ -823,10 +865,16 @@ int um_pci_init(void)
                 "No virtio device ID configured for PCI - no PCI support\n"))
                return 0;
 
-       bridge = pci_alloc_host_bridge(0);
-       if (!bridge)
+       um_pci_msg_bufs = alloc_percpu(struct um_pci_message_buffer);
+       if (!um_pci_msg_bufs)
                return -ENOMEM;
 
+       bridge = pci_alloc_host_bridge(0);
+       if (!bridge) {
+               err = -ENOMEM;
+               goto free;
+       }
+
        um_pci_fwnode = irq_domain_alloc_named_fwnode("um-pci");
        if (!um_pci_fwnode) {
                err = -ENOMEM;
@@ -878,18 +926,22 @@ free:
                irq_domain_remove(um_pci_inner_domain);
        if (um_pci_fwnode)
                irq_domain_free_fwnode(um_pci_fwnode);
-       pci_free_resource_list(&bridge->windows);
-       pci_free_host_bridge(bridge);
+       if (bridge) {
+               pci_free_resource_list(&bridge->windows);
+               pci_free_host_bridge(bridge);
+       }
+       free_percpu(um_pci_msg_bufs);
        return err;
 }
 module_init(um_pci_init);
 
-void um_pci_exit(void)
+static void um_pci_exit(void)
 {
        unregister_virtio_driver(&um_pci_virtio_driver);
        irq_domain_remove(um_pci_msi_domain);
        irq_domain_remove(um_pci_inner_domain);
        pci_free_resource_list(&bridge->windows);
        pci_free_host_bridge(bridge);
+       free_percpu(um_pci_msg_bufs);
 }
 module_exit(um_pci_exit);
index 4412d6f..d51e445 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/virtio_config.h>
 #include <linux/virtio_ring.h>
 #include <linux/time-internal.h>
+#include <linux/virtio-uml.h>
 #include <shared/as-layout.h>
 #include <irq_kern.h>
 #include <init.h>
@@ -1139,7 +1140,7 @@ static int virtio_uml_probe(struct platform_device *pdev)
                rc = os_connect_socket(pdata->socket_path);
        } while (rc == -EINTR);
        if (rc < 0)
-               return rc;
+               goto error_free;
        vu_dev->sock = rc;
 
        spin_lock_init(&vu_dev->sock_lock);
@@ -1160,6 +1161,8 @@ static int virtio_uml_probe(struct platform_device *pdev)
 
 error_init:
        os_close_file(vu_dev->sock);
+error_free:
+       kfree(vu_dev);
        return rc;
 }
 
index 5afac0f..ff5061f 100644 (file)
@@ -24,8 +24,7 @@
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_clone_handler(void)
 {
-       int stack;
-       struct stub_data *data = (void *) ((unsigned long)&stack & ~(UM_KERN_PAGE_SIZE - 1));
+       struct stub_data *data = get_stub_page();
        long err;
 
        err = stub_syscall2(__NR_clone, CLONE_PARENT | CLONE_FILES | SIGCHLD,
index 61f18b7..960a021 100644 (file)
 272    i386    fadvise64_64            sys_ia32_fadvise64_64
 273    i386    vserver
 274    i386    mbind                   sys_mbind
-275    i386    get_mempolicy           sys_get_mempolicy               compat_sys_get_mempolicy
+275    i386    get_mempolicy           sys_get_mempolicy
 276    i386    set_mempolicy           sys_set_mempolicy
 277    i386    mq_open                 sys_mq_open                     compat_sys_mq_open
 278    i386    mq_unlink               sys_mq_unlink
 314    i386    sync_file_range         sys_ia32_sync_file_range
 315    i386    tee                     sys_tee
 316    i386    vmsplice                sys_vmsplice
-317    i386    move_pages              sys_move_pages                  compat_sys_move_pages
+317    i386    move_pages              sys_move_pages
 318    i386    getcpu                  sys_getcpu
 319    i386    epoll_pwait             sys_epoll_pwait
 320    i386    utimensat               sys_utimensat_time32
index 807b6a1..18b5500 100644 (file)
 530    x32     set_robust_list         compat_sys_set_robust_list
 531    x32     get_robust_list         compat_sys_get_robust_list
 532    x32     vmsplice                sys_vmsplice
-533    x32     move_pages              compat_sys_move_pages
+533    x32     move_pages              sys_move_pages
 534    x32     preadv                  compat_sys_preadv64
 535    x32     pwritev                 compat_sys_pwritev64
 536    x32     rt_tgsigqueueinfo       compat_sys_rt_tgsigqueueinfo
index 4ae01cd..7516e41 100644 (file)
@@ -156,19 +156,6 @@ struct compat_shmid64_ds {
        (!!(task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT))
 #endif
 
-static inline void __user *arch_compat_alloc_user_space(long len)
-{
-       compat_uptr_t sp = task_pt_regs(current)->sp;
-
-       /*
-        * -128 for the x32 ABI redzone.  For IA32, it is not strictly
-        * necessary, but not harmful.
-        */
-       sp -= 128;
-
-       return (void __user *)round_down(sp - len, 16);
-}
-
 static inline bool in_x32_syscall(void)
 {
 #ifdef CONFIG_X86_X32_ABI
index e7265a5..45697e0 100644 (file)
@@ -58,13 +58,6 @@ raw_copy_to_user(void __user *dst, const void *src, unsigned long size)
        return copy_user_generic((__force void *)dst, src, size);
 }
 
-static __always_inline __must_check
-unsigned long raw_copy_in_user(void __user *dst, const void __user *src, unsigned long size)
-{
-       return copy_user_generic((__force void *)dst,
-                                (__force void *)src, size);
-}
-
 extern long __copy_user_nocache(void *dst, const void __user *src,
                                unsigned size, int zerorest);
 
index b95db9d..4c6c2be 100644 (file)
@@ -101,4 +101,16 @@ static inline void remap_stack_and_trap(void)
                "memory");
 }
 
+static __always_inline void *get_stub_page(void)
+{
+       unsigned long ret;
+
+       asm volatile (
+               "movl %%esp,%0 ;"
+               "andl %1,%0"
+               : "=a" (ret)
+               : "g" (~(UM_KERN_PAGE_SIZE - 1)));
+
+       return (void *)ret;
+}
 #endif
index 6e2626b..e9c4b2b 100644 (file)
@@ -108,4 +108,16 @@ static inline void remap_stack_and_trap(void)
                __syscall_clobber, "r10", "r8", "r9");
 }
 
+static __always_inline void *get_stub_page(void)
+{
+       unsigned long ret;
+
+       asm volatile (
+               "movq %%rsp,%0 ;"
+               "andq %1,%0"
+               : "=a" (ret)
+               : "g" (~(UM_KERN_PAGE_SIZE - 1)));
+
+       return (void *)ret;
+}
 #endif
index 21836ea..f7eefba 100644 (file)
@@ -11,9 +11,8 @@
 void __attribute__ ((__section__ (".__syscall_stub")))
 stub_segv_handler(int sig, siginfo_t *info, void *p)
 {
-       int stack;
+       struct faultinfo *f = get_stub_page();
        ucontext_t *uc = p;
-       struct faultinfo *f = (void *)(((unsigned long)&stack) & ~(UM_KERN_PAGE_SIZE - 1));
 
        GET_FAULTINFO_FROM_MC(*f, &uc->uc_mcontext);
        trap_myself();
index a4d4eeb..bd48210 100644 (file)
@@ -1008,23 +1008,14 @@ static int cpc_write(int cpu, struct cpc_register_resource *reg_res, u64 val)
        return ret_val;
 }
 
-/**
- * cppc_get_desired_perf - Get the value of desired performance register.
- * @cpunum: CPU from which to get desired performance.
- * @desired_perf: address of a variab