mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-05 19:31:57 -04:00
Compare commits
6487 changed files with 35382 additions and 1778466 deletions
|
|
@ -1,203 +0,0 @@
|
|||
USE_NEW_DLKM_MK := false
|
||||
|
||||
ifeq ($(call is-board-platform-in-list,taro kalama parrot crow pineapple), true)
|
||||
#Taro and beyond are using a new mechanisim to build kernel modules
|
||||
USE_NEW_DLKM_MK := true
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_BOARD_PLATFORM), bengal)
|
||||
ifeq ($(TARGET_KERNEL_VERSION), 5.15)
|
||||
#new bengal uses new mechanisim to build kernel modules
|
||||
USE_NEW_DLKM_MK := true
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(USE_NEW_DLKM_MK), true)
|
||||
ifneq (,$(findstring $(LOCAL_MODULE),$(BOARD_VENDOR_KERNEL_MODULES)))
|
||||
#Taro and beyond are using a new mechanisim to build kernel modules
|
||||
include device/qcom/common/dlkm/Build_external_kernelmodule.mk
|
||||
endif
|
||||
else
|
||||
ifneq (,$(findstring gki,$(KERNEL_DEFCONFIG)))
|
||||
#GKI product should use Qcom latest dlkm compile file
|
||||
include device/qcom/common/dlkm/AndroidKernelModule.mk
|
||||
else
|
||||
DISABLE_THIS_DLKM := $(strip $(TARGET_KERNEL_DLKM_DISABLE))
|
||||
|
||||
ifeq ($(DISABLE_THIS_DLKM),true)
|
||||
ifneq (,$(filter $(LOCAL_MODULE),$(TARGET_KERNEL_DLKM_OVERRIDE)))
|
||||
DISABLE_THIS_DLKM = false
|
||||
else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(DISABLE_THIS_DLKM),true)
|
||||
$(warning DLKM '$(LOCAL_MODULE)' disabled for target)
|
||||
else
|
||||
|
||||
# Assign external kernel modules to the DLKM class
|
||||
LOCAL_MODULE_CLASS := DLKM
|
||||
|
||||
# Set the default install path to vendor/lib/modules
|
||||
LOCAL_MODULE_PATH := $(strip $(LOCAL_MODULE_PATH))
|
||||
ifeq ($(LOCAL_MODULE_PATH),)
|
||||
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib/modules
|
||||
endif
|
||||
|
||||
# Set the default Kbuild file path to LOCAL_PATH
|
||||
KBUILD_FILE := $(strip $(KBUILD_FILE))
|
||||
ifeq ($(KBUILD_FILE),)
|
||||
KBUILD_FILE := $(LOCAL_PATH)/Kbuild
|
||||
endif
|
||||
|
||||
# Get rid of any whitespace
|
||||
LOCAL_MODULE_KBUILD_NAME := $(strip $(LOCAL_MODULE_KBUILD_NAME))
|
||||
|
||||
include $(BUILD_SYSTEM)/base_rules.mk
|
||||
|
||||
|
||||
# The kernel build system doesn't support parallel kernel module builds
|
||||
# that share the same output directory. Thus, in order to build multiple
|
||||
# kernel modules that reside in a single directory (and therefore have
|
||||
# the same output directory), there must be just one invocation of the
|
||||
# kernel build system that builds all the modules of a given directory.
|
||||
#
|
||||
# Therefore, all kernel modules must depend on the same, unique target
|
||||
# that invokes the kernel build system and builds all of the modules
|
||||
# for the directory. The $(KBUILD_TARGET) target serves this purpose.
|
||||
# To ensure the value of KBUILD_TARGET is unique, it is essentially set
|
||||
# to the path of the source directory, i.e. LOCAL_PATH.
|
||||
#
|
||||
# Since KBUILD_TARGET is used as a target and a variable name, it should
|
||||
# not contain characters other than letters, numbers, and underscores.
|
||||
KBUILD_TARGET := $(strip \
|
||||
$(subst .,_, \
|
||||
$(subst -,_, \
|
||||
$(subst :,_, \
|
||||
$(subst /,_,$(LOCAL_PATH))))))
|
||||
|
||||
# Intermediate directory where the kernel modules are created
|
||||
# by the kernel build system. Ideally this would be the same
|
||||
# directory as LOCAL_BUILT_MODULE, but because we're using
|
||||
# relative paths for both O= and M=, we don't have much choice
|
||||
KBUILD_OUT_DIR := $(TARGET_OUT_INTERMEDIATES)/$(LOCAL_PATH)
|
||||
|
||||
# Path to the intermediate location where the kernel build
|
||||
# system creates the kernel module.
|
||||
KBUILD_MODULE := $(KBUILD_OUT_DIR)/$(LOCAL_MODULE)
|
||||
|
||||
# Since we only invoke the kernel build system once per directory,
|
||||
# each kernel module must depend on the same target.
|
||||
$(KBUILD_MODULE): kbuild_out := $(KBUILD_OUT_DIR)/$(LOCAL_MODULE_KBUILD_NAME)
|
||||
$(KBUILD_MODULE): $(KBUILD_TARGET)
|
||||
ifneq "$(LOCAL_MODULE_KBUILD_NAME)" ""
|
||||
mv -f $(kbuild_out) $@
|
||||
endif
|
||||
|
||||
|
||||
# To ensure KERNEL_OUT and TARGET_PREBUILT_INT_KERNEL are defined,
|
||||
# kernel/AndroidKernel.mk (kernel_definitions.mk) must be included. While m and regular
|
||||
# make builds will include kernel/AndroidKernel.mk, mm and mmm builds
|
||||
# do not. Therefore, we need to explicitly include kernel/AndroidKernel.mk (kernel_definitions.mk).
|
||||
# It is safe to include it more than once because the entire file is
|
||||
# guarded by "ifeq ($(TARGET_PREBUILT_KERNEL),) ... endif".
|
||||
# If AndroidKernel.mk is not found, fall back to use the kernel_definitions.mk
|
||||
ifneq ($(wildcard $(TARGET_KERNEL_SOURCE)/AndroidKernel.mk),)
|
||||
TARGET_KERNEL_PATH := $(TARGET_KERNEL_SOURCE)/AndroidKernel.mk
|
||||
else
|
||||
TARGET_KERNEL_PATH := device/qcom/kernelscripts/kernel_definitions.mk
|
||||
endif
|
||||
include $(TARGET_KERNEL_PATH)
|
||||
|
||||
# Simply copy the kernel module from where the kernel build system
|
||||
# created it to the location where the Android build system expects it.
|
||||
# If LOCAL_MODULE_DEBUG_ENABLE is set, strip debug symbols. So that,
|
||||
# the final images generated by ABS will have the stripped version of
|
||||
# the modules
|
||||
ifeq ($(TARGET_KERNEL_VERSION),3.18)
|
||||
MODULE_SIGN_FILE := perl ./$(TARGET_KERNEL_SOURCE)/scripts/sign-file
|
||||
MODSECKEY := $(KERNEL_OUT)/signing_key.priv
|
||||
MODPUBKEY := $(KERNEL_OUT)/signing_key.x509
|
||||
else
|
||||
MODULE_SIGN_FILE := $(KERNEL_OUT)/scripts/sign-file
|
||||
MODSECKEY := $(KERNEL_OUT)/certs/signing_key.pem
|
||||
MODPUBKEY := $(KERNEL_OUT)/certs/signing_key.x509
|
||||
endif
|
||||
|
||||
$(LOCAL_BUILT_MODULE): $(KBUILD_MODULE) | $(ACP)
|
||||
ifneq "$(LOCAL_MODULE_DEBUG_ENABLE)" ""
|
||||
mkdir -p $(dir $@)
|
||||
cp $< $<.unstripped
|
||||
$(TARGET_STRIP) --strip-debug $<
|
||||
cp $< $<.stripped
|
||||
endif
|
||||
@sh -c "\
|
||||
KMOD_SIG_ALL=`cat $(KERNEL_OUT)/.config | grep CONFIG_MODULE_SIG_ALL | cut -d'=' -f2`; \
|
||||
KMOD_SIG_HASH=`cat $(KERNEL_OUT)/.config | grep CONFIG_MODULE_SIG_HASH | cut -d'=' -f2 | sed 's/\"//g'`; \
|
||||
if [ \"\$$KMOD_SIG_ALL\" = \"y\" ] && [ -n \"\$$KMOD_SIG_HASH\" ]; then \
|
||||
echo \"Signing kernel module: \" `basename $<`; \
|
||||
cp $< $<.unsigned; \
|
||||
$(MODULE_SIGN_FILE) \$$KMOD_SIG_HASH $(MODSECKEY) $(MODPUBKEY) $<; \
|
||||
fi; \
|
||||
"
|
||||
$(transform-prebuilt-to-target)
|
||||
|
||||
# This should really be cleared in build/core/clear-vars.mk, but for
|
||||
# the time being, we need to clear it ourselves
|
||||
LOCAL_MODULE_KBUILD_NAME :=
|
||||
LOCAL_MODULE_DEBUG_ENABLE :=
|
||||
|
||||
# Ensure the kernel module created by the kernel build system, as
|
||||
# well as all the other intermediate files, are removed during a clean.
|
||||
$(cleantarget): PRIVATE_CLEAN_FILES := $(PRIVATE_CLEAN_FILES) $(KBUILD_OUT_DIR)
|
||||
|
||||
|
||||
# Since this file will be included more than once for directories
|
||||
# with more than one kernel module, the shared KBUILD_TARGET rule should
|
||||
# only be defined once to avoid "overriding commands ..." warnings.
|
||||
ifndef $(KBUILD_TARGET)_RULE
|
||||
$(KBUILD_TARGET)_RULE := 1
|
||||
|
||||
# Kernel modules have to be built after:
|
||||
# * the kernel config has been created
|
||||
# * host executables, like scripts/basic/fixdep, have been built
|
||||
# (otherwise parallel invocations of the kernel build system will
|
||||
# fail as they all try to compile these executables at the same time)
|
||||
# * a full kernel build (to make module versioning work)
|
||||
#
|
||||
# For these reasons, kernel modules are dependent on
|
||||
# TARGET_PREBUILT_INT_KERNEL which will ensure all of the above.
|
||||
#
|
||||
# NOTE: Due to a bug in the kernel build system when using a Kbuild file
|
||||
# and relative paths for both O= and M=, the Kbuild file must
|
||||
# be copied to the output directory.
|
||||
#
|
||||
# NOTE: The following paths are equivalent:
|
||||
# $(KBUILD_OUT_DIR)
|
||||
# $(KERNEL_OUT)/../$(LOCAL_PATH)
|
||||
.PHONY: $(KBUILD_TARGET)
|
||||
$(KBUILD_TARGET): local_path := $(LOCAL_PATH)
|
||||
$(KBUILD_TARGET): kbuild_out_dir := $(KBUILD_OUT_DIR)
|
||||
$(KBUILD_TARGET): kbuild_options := $(KBUILD_OPTIONS)
|
||||
ifneq ($(USE_CLANG_FOR_MODULES),)
|
||||
$(KBUILD_TARGET): $(TARGET_PREBUILT_INT_KERNEL)
|
||||
@mkdir -p $(kbuild_out_dir)
|
||||
$(hide) cp -f $(local_path)/Kbuild $(kbuild_out_dir)/Kbuild
|
||||
$(MAKE) -C $(TARGET_KERNEL_SOURCE) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) O=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(real_cc) $(KERNEL_CFLAGS) modules $(kbuild_options) ANDROID_BUILD_TOP=$$(pwd) TOP=$$(pwd)
|
||||
else
|
||||
$(KBUILD_TARGET): $(TARGET_PREBUILT_INT_KERNEL)
|
||||
@mkdir -p $(kbuild_out_dir)
|
||||
$(hide) cp -f $(local_path)/Kbuild $(kbuild_out_dir)/Kbuild
|
||||
$(MAKE) -C $(TARGET_KERNEL_SOURCE) M=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(local_path) O=$(KERNEL_TO_BUILD_ROOT_OFFSET)$(KERNEL_OUT) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(KERNEL_CROSS_COMPILE) $(KERNEL_CFLAGS) modules $(kbuild_options) TOP=$$(pwd)
|
||||
endif
|
||||
|
||||
# Once the KBUILD_OPTIONS variable has been used for the target
|
||||
# that's specific to the LOCAL_PATH, clear it. If this isn't done,
|
||||
# then every kernel module would need to explicitly set KBUILD_OPTIONS,
|
||||
# or the variable would have to be cleared in 'include $(CLEAR_VARS)'
|
||||
# which would require a change to build/core.
|
||||
KBUILD_OPTIONS :=
|
||||
endif
|
||||
endif
|
||||
endif #(findstring gki,$(KERNEL_DEFCONFIG))
|
||||
endif #(is-board-platform-in-list,taro....)
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
What: /sys/fs/selinux/disable
|
||||
Date: April 2005 (predates git)
|
||||
KernelVersion: 2.6.12-rc2 (predates git)
|
||||
Contact: selinux@vger.kernel.org
|
||||
Description:
|
||||
|
||||
The selinuxfs "disable" node allows SELinux to be disabled at runtime
|
||||
prior to a policy being loaded into the kernel. If disabled via this
|
||||
mechanism, SELinux will remain disabled until the system is rebooted.
|
||||
|
||||
The preferred method of disabling SELinux is via the "selinux=0" boot
|
||||
parameter, but the selinuxfs "disable" node was created to make it
|
||||
easier for systems with primitive bootloaders that did not allow for
|
||||
easy modification of the kernel command line. Unfortunately, allowing
|
||||
for SELinux to be disabled at runtime makes it difficult to secure the
|
||||
kernel's LSM hooks using the "__ro_after_init" feature.
|
||||
|
||||
Thankfully, the need for the SELinux runtime disable appears to be
|
||||
gone, the default Kconfig configuration disables this selinuxfs node,
|
||||
and only one of the major distributions, Fedora, supports disabling
|
||||
SELinux at runtime. Fedora is in the process of removing the
|
||||
selinuxfs "disable" node and once that is complete we will start the
|
||||
slow process of removing this code from the kernel.
|
||||
|
||||
More information on /sys/fs/selinux/disable can be found under the
|
||||
CONFIG_SECURITY_SELINUX_DISABLE Kconfig option.
|
||||
|
|
@ -265,71 +265,6 @@ Description: Specific uncompressed frame descriptors
|
|||
bmCapabilities - still image support, fixed frame-rate
|
||||
support
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Framebased format descriptors
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name
|
||||
Date: Oct 2025
|
||||
KernelVersion: 5.4
|
||||
Description: Specific framebased format descriptors
|
||||
|
||||
================== =======================================
|
||||
bFormatIndex unique id for this format descriptor;
|
||||
only defined after parent header is
|
||||
linked into the streaming class;
|
||||
read-only
|
||||
bmaControls this format's data for bmaControls in
|
||||
the streaming header
|
||||
bmInterlaceFlags specifies interlace information,
|
||||
read-only
|
||||
bAspectRatioY the X dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bAspectRatioX the Y dimension of the picture aspect
|
||||
ratio, read-only
|
||||
bDefaultFrameIndex optimum frame index for this stream
|
||||
bBitsPerPixel number of bits per pixel used to
|
||||
specify color in the decoded video
|
||||
frame
|
||||
guidFormat globally unique id used to identify
|
||||
stream-encoding format
|
||||
================== =======================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/framebased/name/name
|
||||
Date: Sept 2024
|
||||
KernelVersion: 5.15
|
||||
Description: Specific framebased frame descriptors
|
||||
|
||||
========================= =====================================
|
||||
bFrameIndex unique id for this framedescriptor;
|
||||
only defined after parent format is
|
||||
linked into the streaming header;
|
||||
read-only
|
||||
dwFrameInterval indicates how frame interval can be
|
||||
programmed; a number of values
|
||||
separated by newline can be specified
|
||||
dwDefaultFrameInterval the frame interval the device would
|
||||
like to use as default
|
||||
dwBytesPerLine Specifies the number of bytes per line
|
||||
|
||||
of video for packed fixed frame size
|
||||
formats, allowing the receiver to
|
||||
perform stride alignment of the video.
|
||||
If the bVariableSize value (above) is
|
||||
TRUE (1), or if the format does not
|
||||
permit such alignment, this value shall
|
||||
be set to zero (0).
|
||||
dwMaxBitRate the maximum bit rate at the shortest
|
||||
frame interval in bps
|
||||
dwMinBitRate the minimum bit rate at the longest
|
||||
frame interval in bps
|
||||
wHeight height of decoded bitmap frame in px
|
||||
wWidth width of decoded bitmam frame in px
|
||||
bmCapabilities still image support, fixed frame-rate
|
||||
support
|
||||
========================= =====================================
|
||||
|
||||
What: /config/usb-gadget/gadget/functions/uvc.name/streaming/header
|
||||
Date: Dec 2014
|
||||
KernelVersion: 4.0
|
||||
|
|
|
|||
|
|
@ -125,17 +125,6 @@ Description:
|
|||
will be present in sysfs. Writing 1 to this file
|
||||
will perform reset.
|
||||
|
||||
What: /sys/bus/pci/devices/.../reset_subordinate
|
||||
Date: October 2024
|
||||
Contact: linux-pci@vger.kernel.org
|
||||
Description:
|
||||
This is visible only for bridge devices. If you want to reset
|
||||
all devices attached through the subordinate bus of a specific
|
||||
bridge device, writing 1 to this will try to do it. This will
|
||||
affect all devices attached to the system through this bridge
|
||||
similiar to writing 1 to their individual "reset" file, so use
|
||||
with caution.
|
||||
|
||||
What: /sys/bus/pci/devices/.../vpd
|
||||
Date: February 2008
|
||||
Contact: Ben Hutchings <bwh@kernel.org>
|
||||
|
|
|
|||
|
|
@ -589,7 +589,7 @@ Description: This file shows the thin provisioning type. This is one of
|
|||
about the descriptor could be found at UFS specifications 2.1.
|
||||
The file is read only.
|
||||
|
||||
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resource_count
|
||||
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resourse_count
|
||||
Date: February 2018
|
||||
Contact: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
|
||||
Description: This file shows the total physical memory resources. This is
|
||||
|
|
|
|||
|
|
@ -1,19 +0,0 @@
|
|||
What: /sys/fs/fuse/features/fuse_bpf
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
Read-only file that contains the word 'supported' if fuse-bpf is
|
||||
supported, does not exist otherwise
|
||||
|
||||
What: /sys/fs/fuse/bpf_prog_type_fuse
|
||||
Date: December 2022
|
||||
Contact: Paul Lawrence <paullawrence@google.com>
|
||||
Description:
|
||||
bpf_prog_type_fuse defines the program type of bpf programs that
|
||||
may be passed to fuse-bpf. For upstream bpf program types, this
|
||||
is a constant defined in a contiguous array of constants.
|
||||
bpf_prog_type_fuse is appended to the end of the list, so it may
|
||||
change and therefore its value must be read from this file.
|
||||
|
||||
Contents is ASCII decimal representation of bpf_prog_type_fuse
|
||||
|
||||
|
|
@ -186,17 +186,6 @@ cgroup v2 currently supports the following mount options.
|
|||
modified through remount from the init namespace. The mount
|
||||
option is ignored on non-init namespace mounts.
|
||||
|
||||
memory_recursiveprot
|
||||
|
||||
Recursively apply memory.min and memory.low protection to
|
||||
entire subtrees, without requiring explicit downward
|
||||
propagation into leaf cgroups. This allows protecting entire
|
||||
subtrees from one another, while retaining free competition
|
||||
within those subtrees. This should have been the default
|
||||
behavior but is a mount-option to avoid regressing setups
|
||||
relying on the original semantics (e.g. specifying bogusly
|
||||
high 'bypass' protection values at higher tree levels).
|
||||
|
||||
|
||||
Organizing Processes and Threads
|
||||
--------------------------------
|
||||
|
|
|
|||
|
|
@ -526,7 +526,7 @@
|
|||
1 -- check protection requested by application.
|
||||
Default value is set via a kernel config option.
|
||||
Value can be changed at runtime via
|
||||
/sys/fs/selinux/checkreqprot.
|
||||
/selinux/checkreqprot.
|
||||
|
||||
cio_ignore= [S390]
|
||||
See Documentation/s390/common_io.rst for details.
|
||||
|
|
@ -1251,8 +1251,7 @@
|
|||
0 -- permissive (log only, no denials).
|
||||
1 -- enforcing (deny and log).
|
||||
Default value is 0.
|
||||
Value can be changed at runtime via
|
||||
/sys/fs/selinux/enforce.
|
||||
Value can be changed at runtime via /selinux/enforce.
|
||||
|
||||
erst_disable [ACPI]
|
||||
Disable Error Record Serialization Table (ERST)
|
||||
|
|
@ -3187,21 +3186,6 @@
|
|||
in certain environments such as networked servers or
|
||||
real-time systems.
|
||||
|
||||
no_hash_pointers
|
||||
Force pointers printed to the console or buffers to be
|
||||
unhashed. By default, when a pointer is printed via %p
|
||||
format string, that pointer is "hashed", i.e. obscured
|
||||
by hashing the pointer value. This is a security feature
|
||||
that hides actual kernel addresses from unprivileged
|
||||
users, but it also makes debugging the kernel more
|
||||
difficult since unequal pointers can no longer be
|
||||
compared. However, if this command-line option is
|
||||
specified, then all normal pointers will have their true
|
||||
value printed. Pointers printed via %pK may still be
|
||||
hashed. This option should only be specified when
|
||||
debugging the kernel. Please do not use on production
|
||||
kernels.
|
||||
|
||||
nohibernate [HIBERNATION] Disable hibernation and resume.
|
||||
|
||||
nohz= [KNL] Boottime enable/disable dynamic ticks
|
||||
|
|
@ -4296,13 +4280,6 @@
|
|||
only normal grace-period primitives. No effect
|
||||
on CONFIG_TINY_RCU kernels.
|
||||
|
||||
rcupdate.rcu_task_ipi_delay= [KNL]
|
||||
Set time in jiffies during which RCU tasks will
|
||||
avoid sending IPIs, starting with the beginning
|
||||
of a given grace period. Setting a large
|
||||
number avoids disturbing real-time workloads,
|
||||
but lengthens grace periods.
|
||||
|
||||
rcupdate.rcu_task_stall_timeout= [KNL]
|
||||
Set timeout in jiffies for RCU task stall warning
|
||||
messages. Disable with a value less than or equal
|
||||
|
|
@ -4447,9 +4424,6 @@
|
|||
|
||||
rootflags= [KNL] Set root filesystem mount option string
|
||||
|
||||
initramfs_options= [KNL]
|
||||
Specify mount options for for the initramfs mount.
|
||||
|
||||
rootfstype= [KNL] Set root filesystem type
|
||||
|
||||
rootwait [KNL] Wait (indefinitely) for root device to show up.
|
||||
|
|
@ -4502,7 +4476,9 @@
|
|||
See security/selinux/Kconfig help text.
|
||||
0 -- disable.
|
||||
1 -- enable.
|
||||
Default value is 1.
|
||||
Default value is set via kernel config option.
|
||||
If enabled at boot time, /selinux/disable can be used
|
||||
later to disable prior to initial policy load.
|
||||
|
||||
apparmor= [APPARMOR] Disable or enable AppArmor at boot time
|
||||
Format: { "0" | "1" }
|
||||
|
|
|
|||
|
|
@ -63,37 +63,36 @@ the generic ioctl available.
|
|||
|
||||
The uffdio_api.features bitmask returned by the UFFDIO_API ioctl
|
||||
defines what memory types are supported by the userfaultfd and what
|
||||
events, except page fault notifications, may be generated:
|
||||
events, except page fault notifications, may be generated.
|
||||
|
||||
- The UFFD_FEATURE_EVENT_* flags indicate that various other events
|
||||
other than page faults are supported. These events are described in more
|
||||
detail below in the Non-cooperative userfaultfd section.
|
||||
If the kernel supports registering userfaultfd ranges on hugetlbfs
|
||||
virtual memory areas, UFFD_FEATURE_MISSING_HUGETLBFS will be set in
|
||||
uffdio_api.features. Similarly, UFFD_FEATURE_MISSING_SHMEM will be
|
||||
set if the kernel supports registering userfaultfd ranges on shared
|
||||
memory (covering all shmem APIs, i.e. tmpfs, IPCSHM, /dev/zero
|
||||
MAP_SHARED, memfd_create, etc).
|
||||
|
||||
- UFFD_FEATURE_MISSING_HUGETLBFS and UFFD_FEATURE_MISSING_SHMEM
|
||||
indicate that the kernel supports UFFDIO_REGISTER_MODE_MISSING
|
||||
registrations for hugetlbfs and shared memory (covering all shmem APIs,
|
||||
i.e. tmpfs, IPCSHM, /dev/zero, MAP_SHARED, memfd_create,
|
||||
etc) virtual memory areas, respectively.
|
||||
The userland application that wants to use userfaultfd with hugetlbfs
|
||||
or shared memory need to set the corresponding flag in
|
||||
uffdio_api.features to enable those features.
|
||||
|
||||
- UFFD_FEATURE_MINOR_HUGETLBFS indicates that the kernel supports
|
||||
UFFDIO_REGISTER_MODE_MINOR registration for hugetlbfs virtual memory
|
||||
areas. UFFD_FEATURE_MINOR_SHMEM is the analogous feature indicating
|
||||
support for shmem virtual memory areas.
|
||||
If the userland desires to receive notifications for events other than
|
||||
page faults, it has to verify that uffdio_api.features has appropriate
|
||||
UFFD_FEATURE_EVENT_* bits set. These events are described in more
|
||||
detail below in "Non-cooperative userfaultfd" section.
|
||||
|
||||
The userland application should set the feature flags it intends to use
|
||||
when invoking the UFFDIO_API ioctl, to request that those features be
|
||||
enabled if supported.
|
||||
|
||||
Once the userfaultfd API has been enabled the UFFDIO_REGISTER
|
||||
ioctl should be invoked (if present in the returned uffdio_api.ioctls
|
||||
bitmask) to register a memory range in the userfaultfd by setting the
|
||||
Once the userfaultfd has been enabled the UFFDIO_REGISTER ioctl should
|
||||
be invoked (if present in the returned uffdio_api.ioctls bitmask) to
|
||||
register a memory range in the userfaultfd by setting the
|
||||
uffdio_register structure accordingly. The uffdio_register.mode
|
||||
bitmask will specify to the kernel which kind of faults to track for
|
||||
the range. The UFFDIO_REGISTER ioctl will return the
|
||||
the range (UFFDIO_REGISTER_MODE_MISSING would track missing
|
||||
pages). The UFFDIO_REGISTER ioctl will return the
|
||||
uffdio_register.ioctls bitmask of ioctls that are suitable to resolve
|
||||
userfaults on the range registered. Not all ioctls will necessarily be
|
||||
supported for all memory types (e.g. anonymous memory vs. shmem vs.
|
||||
hugetlbfs), or all types of intercepted faults.
|
||||
supported for all memory types depending on the underlying virtual
|
||||
memory backend (anonymous memory vs tmpfs vs real filebacked
|
||||
mappings).
|
||||
|
||||
Userland can use the uffdio_register.ioctls to manage the virtual
|
||||
address space in the background (to add or potentially also remove
|
||||
|
|
@ -101,60 +100,13 @@ memory from the userfaultfd registered range). This means a userfault
|
|||
could be triggering just before userland maps in the background the
|
||||
user-faulted page.
|
||||
|
||||
Resolving Userfaults
|
||||
--------------------
|
||||
|
||||
There are three basic ways to resolve userfaults:
|
||||
|
||||
- UFFDIO_COPY atomically copies some existing page contents from
|
||||
userspace.
|
||||
|
||||
- UFFDIO_ZEROPAGE atomically zeros the new page.
|
||||
|
||||
- UFFDIO_CONTINUE maps an existing, previously-populated page.
|
||||
|
||||
These operations are atomic in the sense that they guarantee nothing can
|
||||
see a half-populated page, since readers will keep userfaulting until the
|
||||
operation has finished.
|
||||
|
||||
By default, these wake up userfaults blocked on the range in question.
|
||||
They support a UFFDIO_*_MODE_DONTWAKE mode flag, which indicates
|
||||
that waking will be done separately at some later time.
|
||||
|
||||
Which ioctl to choose depends on the kind of page fault, and what we'd
|
||||
like to do to resolve it:
|
||||
|
||||
- For UFFDIO_REGISTER_MODE_MISSING faults, the fault needs to be
|
||||
resolved by either providing a new page (UFFDIO_COPY), or mapping
|
||||
the zero page (UFFDIO_ZEROPAGE). By default, the kernel would map
|
||||
the zero page for a missing fault. With userfaultfd, userspace can
|
||||
decide what content to provide before the faulting thread continues.
|
||||
|
||||
- For UFFDIO_REGISTER_MODE_MINOR faults, there is an existing page (in
|
||||
the page cache). Userspace has the option of modifying the page's
|
||||
contents before resolving the fault. Once the contents are correct
|
||||
(modified or not), userspace asks the kernel to map the page and let the
|
||||
faulting thread continue with UFFDIO_CONTINUE.
|
||||
|
||||
Notes:
|
||||
|
||||
- You can tell which kind of fault occurred by examining
|
||||
pagefault.flags within the uffd_msg, checking for the
|
||||
UFFD_PAGEFAULT_FLAG_* flags.
|
||||
|
||||
- None of the page-delivering ioctls default to the range that you
|
||||
registered with. You must fill in all fields for the appropriate
|
||||
ioctl struct including the range.
|
||||
|
||||
- You get the address of the access that triggered the missing page
|
||||
event out of a struct uffd_msg that you read in the thread from the
|
||||
uffd. You can supply as many pages as you want with these IOCTLs.
|
||||
Keep in mind that unless you used DONTWAKE then the first of any of
|
||||
those IOCTLs wakes up the faulting thread.
|
||||
|
||||
- Be sure to test for all errors including
|
||||
(pollfd[0].revents & POLLERR). This can happen, e.g. when ranges
|
||||
supplied were incorrect.
|
||||
The primary ioctl to resolve userfaults is UFFDIO_COPY. That
|
||||
atomically copies a page into the userfault registered range and wakes
|
||||
up the blocked userfaults (unless uffdio_copy.mode &
|
||||
UFFDIO_COPY_MODE_DONTWAKE is set). Other ioctl works similarly to
|
||||
UFFDIO_COPY. They're atomic as in guaranteeing that nothing can see an
|
||||
half copied page since it'll keep userfaulting until the copy has
|
||||
finished.
|
||||
|
||||
QEMU/KVM
|
||||
========
|
||||
|
|
|
|||
|
|
@ -902,17 +902,12 @@ The default value is 60.
|
|||
unprivileged_userfaultfd
|
||||
========================
|
||||
|
||||
This flag controls the mode in which unprivileged users can use the
|
||||
userfaultfd system calls. Set this to 0 to restrict unprivileged users
|
||||
to handle page faults in user mode only. In this case, users without
|
||||
SYS_CAP_PTRACE must pass UFFD_USER_MODE_ONLY in order for userfaultfd to
|
||||
succeed. Prohibiting use of userfaultfd for handling faults from kernel
|
||||
mode may make certain vulnerabilities more difficult to exploit.
|
||||
This flag controls whether unprivileged users can use the userfaultfd
|
||||
system calls. Set this to 1 to allow unprivileged users to use the
|
||||
userfaultfd system calls, or set this to 0 to restrict userfaultfd to only
|
||||
privileged users (with SYS_CAP_PTRACE capability).
|
||||
|
||||
Set this to 1 to allow unprivileged users to use the userfaultfd system
|
||||
calls without any restrictions.
|
||||
|
||||
The default value is 0.
|
||||
The default value is 1.
|
||||
|
||||
|
||||
user_reserve_kbytes
|
||||
|
|
|
|||
|
|
@ -134,8 +134,6 @@ stable kernels.
|
|||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3 | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | Neoverse-V3AE | #3312417 | ARM64_ERRATUM_3194386 |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
| ARM | MMU-500 | #841119,826419 | N/A |
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
+----------------+-----------------+-----------------+-----------------------------+
|
||||
|
|
|
|||
|
|
@ -142,6 +142,3 @@ BPF flow dissector doesn't support exporting all the metadata that in-kernel
|
|||
C-based implementation can export. Notable example is single VLAN (802.1Q)
|
||||
and double VLAN (802.1AD) tags. Please refer to the ``struct bpf_flow_keys``
|
||||
for a set of information that's currently can be exported from the BPF context.
|
||||
|
||||
When BPF flow dissector is attached to the root network namespace (machine-wide
|
||||
policy), users can't override it in their child network namespaces.
|
||||
|
|
|
|||
|
|
@ -110,20 +110,6 @@ used when printing stack backtraces. The specifier takes into
|
|||
consideration the effect of compiler optimisations which may occur
|
||||
when tail-calls are used and marked with the noreturn GCC attribute.
|
||||
|
||||
Probed Pointers from BPF / tracing
|
||||
----------------------------------
|
||||
|
||||
::
|
||||
|
||||
%pks kernel string
|
||||
%pus user string
|
||||
|
||||
The ``k`` and ``u`` specifiers are used for printing prior probed memory from
|
||||
either kernel memory (k) or user memory (u). The subsequent ``s`` specifier
|
||||
results in printing a string. For direct use in regular vsnprintf() the (k)
|
||||
and (u) annotation is ignored, however, when used out of BPF's bpf_trace_printk(),
|
||||
for example, it reads the memory it is pointing to without faulting.
|
||||
|
||||
Kernel Pointers
|
||||
---------------
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ whole; patches welcome!
|
|||
kasan
|
||||
ubsan
|
||||
kmemleak
|
||||
kfence
|
||||
gdb-kernel-debugging
|
||||
kgdb
|
||||
kselftest
|
||||
|
|
|
|||
|
|
@ -1,298 +0,0 @@
|
|||
.. SPDX-License-Identifier: GPL-2.0
|
||||
.. Copyright (C) 2020, Google LLC.
|
||||
|
||||
Kernel Electric-Fence (KFENCE)
|
||||
==============================
|
||||
|
||||
Kernel Electric-Fence (KFENCE) is a low-overhead sampling-based memory safety
|
||||
error detector. KFENCE detects heap out-of-bounds access, use-after-free, and
|
||||
invalid-free errors.
|
||||
|
||||
KFENCE is designed to be enabled in production kernels, and has near zero
|
||||
performance overhead. Compared to KASAN, KFENCE trades performance for
|
||||
precision. The main motivation behind KFENCE's design, is that with enough
|
||||
total uptime KFENCE will detect bugs in code paths not typically exercised by
|
||||
non-production test workloads. One way to quickly achieve a large enough total
|
||||
uptime is when the tool is deployed across a large fleet of machines.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To enable KFENCE, configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
|
||||
To build a kernel with KFENCE support, but disabled by default (to enable, set
|
||||
``kfence.sample_interval`` to non-zero value), configure the kernel with::
|
||||
|
||||
CONFIG_KFENCE=y
|
||||
CONFIG_KFENCE_SAMPLE_INTERVAL=0
|
||||
|
||||
KFENCE provides several other configuration options to customize behaviour (see
|
||||
the respective help text in ``lib/Kconfig.kfence`` for more info).
|
||||
|
||||
Tuning performance
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The most important parameter is KFENCE's sample interval, which can be set via
|
||||
the kernel boot parameter ``kfence.sample_interval`` in milliseconds. The
|
||||
sample interval determines the frequency with which heap allocations will be
|
||||
guarded by KFENCE. The default is configurable via the Kconfig option
|
||||
``CONFIG_KFENCE_SAMPLE_INTERVAL``. Setting ``kfence.sample_interval=0``
|
||||
disables KFENCE.
|
||||
|
||||
The KFENCE memory pool is of fixed size, and if the pool is exhausted, no
|
||||
further KFENCE allocations occur. With ``CONFIG_KFENCE_NUM_OBJECTS`` (default
|
||||
255), the number of available guarded objects can be controlled. Each object
|
||||
requires 2 pages, one for the object itself and the other one used as a guard
|
||||
page; object pages are interleaved with guard pages, and every object page is
|
||||
therefore surrounded by two guard pages.
|
||||
|
||||
The total memory dedicated to the KFENCE memory pool can be computed as::
|
||||
|
||||
( #objects + 1 ) * 2 * PAGE_SIZE
|
||||
|
||||
Using the default config, and assuming a page size of 4 KiB, results in
|
||||
dedicating 2 MiB to the KFENCE memory pool.
|
||||
|
||||
Note: On architectures that support huge pages, KFENCE will ensure that the
|
||||
pool is using pages of size ``PAGE_SIZE``. This will result in additional page
|
||||
tables being allocated.
|
||||
|
||||
Error reports
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
A typical out-of-bounds access looks like this::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: out-of-bounds read in test_out_of_bounds_read+0xa3/0x22b
|
||||
|
||||
Out-of-bounds read at 0xffffffffb672efff (1B left of kfence-#17):
|
||||
test_out_of_bounds_read+0xa3/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#17 [0xffffffffb672f000-0xffffffffb672f01f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_out_of_bounds_read+0x98/0x22b
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 107 Comm: kunit_try_catch Not tainted 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
The header of the report provides a short summary of the function involved in
|
||||
the access. It is followed by more detailed information about the access and
|
||||
its origin. Note that, real kernel addresses are only shown when using the
|
||||
kernel command line option ``no_hash_pointers``.
|
||||
|
||||
Use-after-free accesses are reported as::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: use-after-free read in test_use_after_free_read+0xb3/0x143
|
||||
|
||||
Use-after-free read at 0xffffffffb673dfe0 (in kfence-#24):
|
||||
test_use_after_free_read+0xb3/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#24 [0xffffffffb673dfe0-0xffffffffb673dfff, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_use_after_free_read+0x76/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_use_after_free_read+0xa8/0x143
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 109 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also reports on invalid frees, such as double-frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid free in test_double_free+0xdc/0x171
|
||||
|
||||
Invalid free of 0xffffffffb6741000:
|
||||
test_double_free+0xdc/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#26 [0xffffffffb6741000-0xffffffffb674101f, size=32, cache=kmalloc-32] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_double_free+0x76/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
freed by task 507:
|
||||
test_double_free+0xa8/0x171
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 111 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
KFENCE also uses pattern-based redzones on the other side of an object's guard
|
||||
page, to detect out-of-bounds writes on the unprotected side of the object.
|
||||
These are reported on frees::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: memory corruption in test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
|
||||
Corrupted memory at 0xffffffffb6797ff9 [ 0xac . . . . . . ] (in kfence-#69):
|
||||
test_kmalloc_aligned_oob_write+0xef/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
kfence-#69 [0xffffffffb6797fb0-0xffffffffb6797ff8, size=73, cache=kmalloc-96] allocated by task 507:
|
||||
test_alloc+0xf3/0x25b
|
||||
test_kmalloc_aligned_oob_write+0x57/0x184
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 120 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
For such errors, the address where the corruption occurred as well as the
|
||||
invalidly written bytes (offset from the address) are shown; in this
|
||||
representation, '.' denote untouched bytes. In the example above ``0xac`` is
|
||||
the value written to the invalid address at offset 0, and the remaining '.'
|
||||
denote that no following bytes have been touched. Note that, real values are
|
||||
only shown if the kernel was booted with ``no_hash_pointers``; to avoid
|
||||
information disclosure otherwise, '!' is used instead to denote invalidly
|
||||
written bytes.
|
||||
|
||||
And finally, KFENCE may also report on invalid accesses to any protected page
|
||||
where it was not possible to determine an associated object, e.g. if adjacent
|
||||
object pages had not yet been allocated::
|
||||
|
||||
==================================================================
|
||||
BUG: KFENCE: invalid read in test_invalid_access+0x26/0xe0
|
||||
|
||||
Invalid read at 0xffffffffb670b00a:
|
||||
test_invalid_access+0x26/0xe0
|
||||
kunit_try_run_case+0x51/0x85
|
||||
kunit_generic_run_threadfn_adapter+0x16/0x30
|
||||
kthread+0x137/0x160
|
||||
ret_from_fork+0x22/0x30
|
||||
|
||||
CPU: 4 PID: 124 Comm: kunit_try_catch Tainted: G W 5.8.0-rc6+ #7
|
||||
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1 04/01/2014
|
||||
==================================================================
|
||||
|
||||
DebugFS interface
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Some debugging information is exposed via debugfs:
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/stats`` provides runtime statistics.
|
||||
|
||||
* The file ``/sys/kernel/debug/kfence/objects`` provides a list of objects
|
||||
allocated via KFENCE, including those already freed but protected.
|
||||
|
||||
Implementation Details
|
||||
----------------------
|
||||
|
||||
Guarded allocations are set up based on the sample interval. After expiration
|
||||
of the sample interval, the next allocation through the main allocator (SLAB or
|
||||
SLUB) returns a guarded allocation from the KFENCE object pool (allocation
|
||||
sizes up to PAGE_SIZE are supported). At this point, the timer is reset, and
|
||||
the next allocation is set up after the expiration of the interval. To "gate" a
|
||||
KFENCE allocation through the main allocator's fast-path without overhead,
|
||||
KFENCE relies on static branches via the static keys infrastructure. The static
|
||||
branch is toggled to redirect the allocation to KFENCE.
|
||||
|
||||
KFENCE objects each reside on a dedicated page, at either the left or right
|
||||
page boundaries selected at random. The pages to the left and right of the
|
||||
object page are "guard pages", whose attributes are changed to a protected
|
||||
state, and cause page faults on any attempted access. Such page faults are then
|
||||
intercepted by KFENCE, which handles the fault gracefully by reporting an
|
||||
out-of-bounds access, and marking the page as accessible so that the faulting
|
||||
code can (wrongly) continue executing (set ``panic_on_warn`` to panic instead).
|
||||
|
||||
To detect out-of-bounds writes to memory within the object's page itself,
|
||||
KFENCE also uses pattern-based redzones. For each object page, a redzone is set
|
||||
up for all non-object memory. For typical alignments, the redzone is only
|
||||
required on the unguarded side of an object. Because KFENCE must honor the
|
||||
cache's requested alignment, special alignments may result in unprotected gaps
|
||||
on either side of an object, all of which are redzoned.
|
||||
|
||||
The following figure illustrates the page layout::
|
||||
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
| xxxxxxxxx | O : | xxxxxxxxx | : O | xxxxxxxxx |
|
||||
| xxxxxxxxx | B : | xxxxxxxxx | : B | xxxxxxxxx |
|
||||
| x GUARD x | J : RED- | x GUARD x | RED- : J | x GUARD x |
|
||||
| xxxxxxxxx | E : ZONE | xxxxxxxxx | ZONE : E | xxxxxxxxx |
|
||||
| xxxxxxxxx | C : | xxxxxxxxx | : C | xxxxxxxxx |
|
||||
| xxxxxxxxx | T : | xxxxxxxxx | : T | xxxxxxxxx |
|
||||
---+-----------+-----------+-----------+-----------+-----------+---
|
||||
|
||||
Upon deallocation of a KFENCE object, the object's page is again protected and
|
||||
the object is marked as freed. Any further access to the object causes a fault
|
||||
and KFENCE reports a use-after-free access. Freed objects are inserted at the
|
||||
tail of KFENCE's freelist, so that the least recently freed objects are reused
|
||||
first, and the chances of detecting use-after-frees of recently freed objects
|
||||
is increased.
|
||||
|
||||
Interface
|
||||
---------
|
||||
|
||||
The following describes the functions which are used by allocators as well as
|
||||
page handling code to set up and deal with KFENCE allocations.
|
||||
|
||||
.. kernel-doc:: include/linux/kfence.h
|
||||
:functions: is_kfence_address
|
||||
kfence_shutdown_cache
|
||||
kfence_alloc kfence_free __kfence_free
|
||||
kfence_ksize kfence_object_start
|
||||
kfence_handle_page_fault
|
||||
|
||||
Related Tools
|
||||
-------------
|
||||
|
||||
In userspace, a similar approach is taken by `GWP-ASan
|
||||
<http://llvm.org/docs/GwpAsan.html>`_. GWP-ASan also relies on guard pages and
|
||||
a sampling strategy to detect memory unsafety bugs at scale. KFENCE's design is
|
||||
directly influenced by GWP-ASan, and can be seen as its kernel sibling. Another
|
||||
similar but non-sampling approach, that also inspired the name "KFENCE", can be
|
||||
found in the userspace `Electric Fence Malloc Debugger
|
||||
<https://linux.die.net/man/3/efence>`_.
|
||||
|
||||
In the kernel, several tools exist to debug memory access errors, and in
|
||||
particular KASAN can detect all bug classes that KFENCE can detect. While KASAN
|
||||
is more precise, relying on compiler instrumentation, this comes at a
|
||||
performance cost.
|
||||
|
||||
It is worth highlighting that KASAN and KFENCE are complementary, with
|
||||
different target environments. For instance, KASAN is the better debugging-aid,
|
||||
where test cases or reproducers exists: due to the lower chance to detect the
|
||||
error, it would require more effort using KFENCE to debug. Deployments at scale
|
||||
that cannot afford to enable KASAN, however, would benefit from using KFENCE to
|
||||
discover bugs due to code paths not exercised by test cases or fuzzers.
|
||||
|
|
@ -46,8 +46,10 @@ non-privileged mounts. This opens up new possibilities for the use of
|
|||
filesystems. A good example is sshfs: a secure network filesystem
|
||||
using the sftp protocol.
|
||||
|
||||
The userspace library and utilities are available from the
|
||||
`FUSE homepage: <https://github.com/libfuse/>`_
|
||||
The userspace library and utilities are available from the FUSE
|
||||
homepage:
|
||||
|
||||
http://fuse.sourceforge.net/
|
||||
|
||||
Filesystem type
|
||||
~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -1823,20 +1823,18 @@ if precise results are needed.
|
|||
3.8 /proc/<pid>/fdinfo/<fd> - Information about opened file
|
||||
---------------------------------------------------------------
|
||||
This file provides information associated with an opened file. The regular
|
||||
files have at least four fields -- 'pos', 'flags', 'mnt_id' and 'ino'.
|
||||
The 'pos' represents the current offset of the opened file in decimal
|
||||
form [see lseek(2) for details], 'flags' denotes the octal O_xxx mask the
|
||||
file has been created with [see open(2) for details] and 'mnt_id' represents
|
||||
mount ID of the file system containing the opened file [see 3.5
|
||||
/proc/<pid>/mountinfo for details]. 'ino' represents the inode number of
|
||||
the file.
|
||||
files have at least three fields -- 'pos', 'flags' and mnt_id. The 'pos'
|
||||
represents the current offset of the opened file in decimal form [see lseek(2)
|
||||
for details], 'flags' denotes the octal O_xxx mask the file has been
|
||||
created with [see open(2) for details] and 'mnt_id' represents mount ID of
|
||||
the file system containing the opened file [see 3.5 /proc/<pid>/mountinfo
|
||||
for details].
|
||||
|
||||
A typical output is
|
||||
|
||||
pos: 0
|
||||
flags: 0100002
|
||||
mnt_id: 19
|
||||
ino: 63107
|
||||
|
||||
All locks associated with a file descriptor are shown in its fdinfo too.
|
||||
|
||||
|
|
@ -1850,7 +1848,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
eventfd-count: 5a
|
||||
|
||||
where 'eventfd-count' is hex value of a counter.
|
||||
|
|
@ -1860,7 +1857,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
sigmask: 0000000000000200
|
||||
|
||||
where 'sigmask' is hex value of the signal mask associated
|
||||
|
|
@ -1871,7 +1867,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
tfd: 5 events: 1d data: ffffffffffffffff pos:0 ino:61af sdev:7
|
||||
|
||||
where 'tfd' is a target file descriptor number in decimal form,
|
||||
|
|
@ -1888,8 +1883,6 @@ pair provide additional information particular to the objects they represent.
|
|||
|
||||
pos: 0
|
||||
flags: 02000000
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
inotify wd:3 ino:9e7e sdev:800013 mask:800afce ignored_mask:0 fhandle-bytes:8 fhandle-type:1 f_handle:7e9e0000640d1b6d
|
||||
|
||||
where 'wd' is a watch descriptor in decimal form, ie a target file
|
||||
|
|
@ -1912,7 +1905,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
fanotify flags:10 event-flags:0
|
||||
fanotify mnt_id:12 mflags:40 mask:38 ignored_mask:40000003
|
||||
fanotify ino:4f969 sdev:800013 mflags:0 mask:3b ignored_mask:40000000 fhandle-bytes:8 fhandle-type:1 f_handle:69f90400c275b5b4
|
||||
|
|
@ -1935,7 +1927,6 @@ pair provide additional information particular to the objects they represent.
|
|||
pos: 0
|
||||
flags: 02
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
clockid: 0
|
||||
ticks: 0
|
||||
settime flags: 01
|
||||
|
|
@ -1950,22 +1941,6 @@ pair provide additional information particular to the objects they represent.
|
|||
with TIMER_ABSTIME option which will be shown in 'settime flags', but 'it_value'
|
||||
still exhibits timer's remaining time.
|
||||
|
||||
DMA Buffer files
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
pos: 0
|
||||
flags: 04002
|
||||
mnt_id: 9
|
||||
ino: 63107
|
||||
size: 32768
|
||||
count: 2
|
||||
exp_name: system-heap
|
||||
|
||||
where 'size' is the size of the DMA buffer in bytes. 'count' is the file count of
|
||||
the DMA buffer file. 'exp_name' is the name of the DMA buffer exporter.
|
||||
|
||||
3.9 /proc/<pid>/map_files - Information about memory mapped files
|
||||
---------------------------------------------------------------------
|
||||
This directory contains symbolic links which represent memory mapped files
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Consider this topology::
|
|||
| | | 0x70 |--CH01--> i2c client B (0x50)
|
||||
+------+ +------+
|
||||
|
||||
which corresponds to the following ASL (in the scope of \_SB)::
|
||||
which corresponds to the following ASL::
|
||||
|
||||
Device (SMB1)
|
||||
{
|
||||
|
|
@ -24,7 +24,7 @@ which corresponds to the following ASL (in the scope of \_SB)::
|
|||
Name (_HID, ...)
|
||||
Name (_CRS, ResourceTemplate () {
|
||||
I2cSerialBus (0x70, ControllerInitiated, I2C_SPEED,
|
||||
AddressingMode7Bit, "\\_SB.SMB1", 0x00,
|
||||
AddressingMode7Bit, "^SMB1", 0x00,
|
||||
ResourceConsumer,,)
|
||||
}
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ which corresponds to the following ASL (in the scope of \_SB)::
|
|||
Name (_HID, ...)
|
||||
Name (_CRS, ResourceTemplate () {
|
||||
I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
|
||||
AddressingMode7Bit, "\\_SB.SMB1.CH00", 0x00,
|
||||
AddressingMode7Bit, "^CH00", 0x00,
|
||||
ResourceConsumer,,)
|
||||
}
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ which corresponds to the following ASL (in the scope of \_SB)::
|
|||
Name (_HID, ...)
|
||||
Name (_CRS, ResourceTemplate () {
|
||||
I2cSerialBus (0x50, ControllerInitiated, I2C_SPEED,
|
||||
AddressingMode7Bit, "\\_SB.SMB1.CH01", 0x00,
|
||||
AddressingMode7Bit, "^CH01", 0x00,
|
||||
ResourceConsumer,,)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,17 +77,6 @@ HOSTLDLIBS
|
|||
----------
|
||||
Additional libraries to link against when building host programs.
|
||||
|
||||
.. _userkbuildflags:
|
||||
|
||||
USERCFLAGS
|
||||
----------
|
||||
Additional options used for $(CC) when compiling userprogs.
|
||||
|
||||
USERLDFLAGS
|
||||
-----------
|
||||
Additional options used for $(LD) when linking userprogs. userprogs are linked
|
||||
with CC, so $(USERLDFLAGS) should include "-Wl," prefix as applicable.
|
||||
|
||||
KBUILD_KCONFIG
|
||||
--------------
|
||||
Set the top-level Kconfig file to the value of this environment
|
||||
|
|
|
|||
|
|
@ -1,90 +0,0 @@
|
|||
================================
|
||||
Sign-of-life LED trigger
|
||||
================================
|
||||
|
||||
Description
|
||||
===========
|
||||
|
||||
This is a Sign-of-life LED trigger for QCOM Tri-led Driver.
|
||||
Refer -> kernel_platform/qcom/proprietary/devicetree/bindings/leds/leds-qti-tri-led.txt
|
||||
This trigger will register with LED core framework to individually
|
||||
get activated or deactivated.
|
||||
The trigger will be registered with the power_supply_class to get charging/discharging
|
||||
state and battery capacity.
|
||||
|
||||
Handle power-supply states for Charging/Discharging
|
||||
===================================================
|
||||
|
||||
Set blink/solid Led settings as below
|
||||
|
||||
LED Brighness depend on Device Charging State
|
||||
----------------------------------------------
|
||||
Full while Device Charging
|
||||
Half Brighness while not Charging
|
||||
|
||||
Led Functional Mode Depend on the Battery capacity
|
||||
--------------------------------------------------
|
||||
Battery Level < LOW_CAP_THRESHOLD_DEFAULT
|
||||
Fast Blink "charging_low" led node(s)
|
||||
|
||||
LOW_CAP_THRESHOLD_DEFAULT < Battery Level < BATT_CAP_THRESHOLD_HIGH
|
||||
Slow Blink "charging" led node(s) (If device charging)
|
||||
Enable Solid 50% brightness for "charging" led node(s) (If device not charging)
|
||||
|
||||
BATT_CAP_THRESHOLD_HIGH < Battery Level < BATT_CAP_THRESHOLD_FULL
|
||||
Slow Blink "charging_full" led node(s) (If device charging)
|
||||
Enable Solid 50% brightness for "charging_full" led node(s) (If device not charging)
|
||||
|
||||
Battery Level == BATT_CAP_THRESHOLD_FULL
|
||||
Enable Solid 100% brightness for "charging_full" led node(s)
|
||||
|
||||
Label each node with corresponding colour in device tree
|
||||
======================================================
|
||||
|
||||
Qcom Tri-Led will have settings for each Led (R,G,B).
|
||||
The trigger driver will control with blink or solid pattern via labels nodes like
|
||||
charging_low node: Charging/Discharging and Low battery state
|
||||
charging node: Charging/Discharging state with medium battery
|
||||
charging_full node: Charging/Discharging state while battery near to Full.
|
||||
|
||||
Example of device tree setting
|
||||
=============================
|
||||
|
||||
::
|
||||
|
||||
&pm8550_rgb {
|
||||
red {
|
||||
status = "ok";
|
||||
label = "charging_low";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
|
||||
green {
|
||||
status = "ok";
|
||||
label = "charging_full";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
|
||||
blue {
|
||||
status = "ok";
|
||||
label = "charging";
|
||||
linux,default-trigger = "sign-of-life";
|
||||
};
|
||||
};
|
||||
|
||||
List of Methods in Sol trigger driver
|
||||
====================================
|
||||
static int sol_trig_activate(struct led_classdev *led_cdev)
|
||||
{
|
||||
/* Set default sol data register with power_supply notifier */
|
||||
}
|
||||
|
||||
static void sol_trig_deactivate(struct led_classdev *led_cdev)
|
||||
{
|
||||
/* Unregister with power_supply notifier and Free sol data */
|
||||
}
|
||||
|
||||
static int sol_led_update_status(led_name, blink, brightness, sol_data)
|
||||
{
|
||||
/* API to set sol led colour, brightness etc based on battery status */
|
||||
}
|
||||
|
|
@ -1660,14 +1660,6 @@ accept_ra_min_hop_limit - INTEGER
|
|||
|
||||
Default: 1
|
||||
|
||||
accept_ra_min_lft - INTEGER
|
||||
Minimum acceptable lifetime value in Router Advertisement.
|
||||
|
||||
RA sections with a lifetime less than this value shall be
|
||||
ignored. Zero lifetimes stay unaffected.
|
||||
|
||||
Default: 0
|
||||
|
||||
accept_ra_pinfo - BOOLEAN
|
||||
Learn Prefix Information in Router Advertisement.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ SipHash - a short input PRF
|
|||
SipHash is a cryptographically secure PRF -- a keyed hash function -- that
|
||||
performs very well for short inputs, hence the name. It was designed by
|
||||
cryptographers Daniel J. Bernstein and Jean-Philippe Aumasson. It is intended
|
||||
as a replacement for some uses of: `jhash`, `md5_transform`, `sha1_transform`,
|
||||
as a replacement for some uses of: `jhash`, `md5_transform`, `sha_transform`,
|
||||
and so forth.
|
||||
|
||||
SipHash takes a secret key filled with randomly generated numbers and either
|
||||
|
|
|
|||
|
|
@ -129,8 +129,11 @@ adaptive-tick CPUs: At least one non-adaptive-tick CPU must remain
|
|||
online to handle timekeeping tasks in order to ensure that system
|
||||
calls like gettimeofday() returns accurate values on adaptive-tick CPUs.
|
||||
(This is not an issue for CONFIG_NO_HZ_IDLE=y because there are no running
|
||||
user processes to observe slight drifts in clock rate.) Note that this
|
||||
means that your system must have at least two CPUs in order for
|
||||
user processes to observe slight drifts in clock rate.) Therefore, the
|
||||
boot CPU is prohibited from entering adaptive-ticks mode. Specifying a
|
||||
"nohz_full=" mask that includes the boot CPU will result in a boot-time
|
||||
error message, and the boot CPU will be removed from the mask. Note that
|
||||
this means that your system must have at least two CPUs in order for
|
||||
CONFIG_NO_HZ_FULL=y to do anything for you.
|
||||
|
||||
Finally, adaptive-ticks CPUs must have their RCU callbacks offloaded.
|
||||
|
|
|
|||
|
|
@ -170,14 +170,6 @@ FTRACE_OPS_FL_RCU
|
|||
a callback may be executed and RCU synchronization will not protect
|
||||
it.
|
||||
|
||||
FTRACE_OPS_FL_PERMANENT
|
||||
If this is set on any ftrace ops, then the tracing cannot disabled by
|
||||
writing 0 to the proc sysctl ftrace_enabled. Equally, a callback with
|
||||
the flag set cannot be registered if ftrace_enabled is 0.
|
||||
|
||||
Livepatch uses it not to lose the function redirection, so the system
|
||||
stays protected.
|
||||
|
||||
|
||||
Filtering which functions to trace
|
||||
==================================
|
||||
|
|
|
|||
|
|
@ -2976,9 +2976,7 @@ Note, the proc sysctl ftrace_enable is a big on/off switch for the
|
|||
function tracer. By default it is enabled (when function tracing is
|
||||
enabled in the kernel). If it is disabled, all function tracing is
|
||||
disabled. This includes not only the function tracers for ftrace, but
|
||||
also for any other uses (perf, kprobes, stack tracing, profiling, etc). It
|
||||
cannot be disabled if there is a callback with FTRACE_OPS_FL_PERMANENT set
|
||||
registered.
|
||||
also for any other uses (perf, kprobes, stack tracing, profiling, etc).
|
||||
|
||||
Please disable this with care.
|
||||
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ The ECM function provides these attributes in its function directory:
|
|||
|
||||
and after creating the functions/ecm.<instance name> they contain default
|
||||
values: qmult is 5, dev_addr and host_addr are randomly selected.
|
||||
The ifname can be written to if the function is not bound. A write must be an
|
||||
interface pattern such as "usb%d", which will cause the net core to choose the
|
||||
next free usbX interface. By default, it is set to "usb%d".
|
||||
Except for ifname they can be written to until the function is linked to a
|
||||
configuration. The ifname is read-only and contains the name of the interface
|
||||
which was assigned by the net core, e. g. usb0.
|
||||
|
||||
Testing the ECM function
|
||||
------------------------
|
||||
|
|
@ -131,9 +131,9 @@ The ECM subset function provides these attributes in its function directory:
|
|||
|
||||
and after creating the functions/ecm.<instance name> they contain default
|
||||
values: qmult is 5, dev_addr and host_addr are randomly selected.
|
||||
The ifname can be written to if the function is not bound. A write must be an
|
||||
interface pattern such as "usb%d", which will cause the net core to choose the
|
||||
next free usbX interface. By default, it is set to "usb%d".
|
||||
Except for ifname they can be written to until the function is linked to a
|
||||
configuration. The ifname is read-only and contains the name of the interface
|
||||
which was assigned by the net core, e. g. usb0.
|
||||
|
||||
Testing the ECM subset function
|
||||
-------------------------------
|
||||
|
|
@ -171,9 +171,9 @@ The EEM function provides these attributes in its function directory:
|
|||
|
||||
and after creating the functions/eem.<instance name> they contain default
|
||||
values: qmult is 5, dev_addr and host_addr are randomly selected.
|
||||
The ifname can be written to if the function is not bound. A write must be an
|
||||
interface pattern such as "usb%d", which will cause the net core to choose the
|
||||
next free usbX interface. By default, it is set to "usb%d".
|
||||
Except for ifname they can be written to until the function is linked to a
|
||||
configuration. The ifname is read-only and contains the name of the interface
|
||||
which was assigned by the net core, e. g. usb0.
|
||||
|
||||
Testing the EEM function
|
||||
------------------------
|
||||
|
|
@ -453,9 +453,9 @@ The NCM function provides these attributes in its function directory:
|
|||
|
||||
and after creating the functions/ncm.<instance name> they contain default
|
||||
values: qmult is 5, dev_addr and host_addr are randomly selected.
|
||||
The ifname can be written to if the function is not bound. A write must be an
|
||||
interface pattern such as "usb%d", which will cause the net core to choose the
|
||||
next free usbX interface. By default, it is set to "usb%d".
|
||||
Except for ifname they can be written to until the function is linked to a
|
||||
configuration. The ifname is read-only and contains the name of the interface
|
||||
which was assigned by the net core, e. g. usb0.
|
||||
|
||||
Testing the NCM function
|
||||
------------------------
|
||||
|
|
@ -591,9 +591,9 @@ The RNDIS function provides these attributes in its function directory:
|
|||
|
||||
and after creating the functions/rndis.<instance name> they contain default
|
||||
values: qmult is 5, dev_addr and host_addr are randomly selected.
|
||||
The ifname can be written to if the function is not bound. A write must be an
|
||||
interface pattern such as "usb%d", which will cause the net core to choose the
|
||||
next free usbX interface. By default, it is set to "usb%d".
|
||||
Except for ifname they can be written to until the function is linked to a
|
||||
configuration. The ifname is read-only and contains the name of the interface
|
||||
which was assigned by the net core, e. g. usb0.
|
||||
|
||||
Testing the RNDIS function
|
||||
--------------------------
|
||||
|
|
|
|||
24
MAINTAINERS
24
MAINTAINERS
|
|
@ -3054,7 +3054,6 @@ R: Martin KaFai Lau <kafai@fb.com>
|
|||
R: Song Liu <songliubraving@fb.com>
|
||||
R: Yonghong Song <yhs@fb.com>
|
||||
R: Andrii Nakryiko <andriin@fb.com>
|
||||
R: KP Singh <kpsingh@chromium.org>
|
||||
L: netdev@vger.kernel.org
|
||||
L: bpf@vger.kernel.org
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf.git
|
||||
|
|
@ -6742,8 +6741,7 @@ F: drivers/platform/x86/fujitsu-tablet.c
|
|||
FUSE: FILESYSTEM IN USERSPACE
|
||||
M: Miklos Szeredi <miklos@szeredi.hu>
|
||||
L: linux-fsdevel@vger.kernel.org
|
||||
S: Maintained
|
||||
W: https://github.com/libfuse/
|
||||
W: http://fuse.sourceforge.net/
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git
|
||||
S: Maintained
|
||||
F: fs/fuse/
|
||||
|
|
@ -9141,7 +9139,6 @@ F: include/linux/skmsg.h
|
|||
F: net/core/skmsg.c
|
||||
F: net/core/sock_map.c
|
||||
F: net/ipv4/tcp_bpf.c
|
||||
F: net/ipv4/udp_bpf.c
|
||||
|
||||
LANTIQ / INTEL Ethernet drivers
|
||||
M: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
|
|
@ -10823,15 +10820,6 @@ L: netdev@vger.kernel.org
|
|||
S: Supported
|
||||
F: drivers/net/ethernet/mscc/
|
||||
|
||||
MICROSOFT SURFACE HARDWARE PLATFORM SUPPORT
|
||||
M: Hans de Goede <hdegoede@redhat.com>
|
||||
M: Mark Gross <mgross@linux.intel.com>
|
||||
M: Maximilian Luz <luzmaximilian@gmail.com>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
S: Maintained
|
||||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git
|
||||
F: drivers/platform/surface/
|
||||
|
||||
MICROSOFT SURFACE PRO 3 BUTTON DRIVER
|
||||
M: Chen Yu <yu.c.chen@intel.com>
|
||||
L: platform-driver-x86@vger.kernel.org
|
||||
|
|
@ -12851,7 +12839,6 @@ S: Maintained
|
|||
T: git git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux.git
|
||||
F: samples/pidfd/
|
||||
F: tools/testing/selftests/pidfd/
|
||||
F: tools/testing/selftests/clone3/
|
||||
K: (?i)pidfd
|
||||
K: (?i)clone3
|
||||
K: \b(clone_args|kernel_clone_args)\b
|
||||
|
|
@ -14626,7 +14613,6 @@ F: include/uapi/linux/selinux_netlink.h
|
|||
F: security/selinux/
|
||||
F: scripts/selinux/
|
||||
F: Documentation/admin-guide/LSM/SELinux.rst
|
||||
F: Documentation/ABI/obsolete/sysfs-selinux-disable
|
||||
|
||||
SENSABLE PHANTOM
|
||||
M: Jiri Slaby <jirislaby@gmail.com>
|
||||
|
|
@ -17600,14 +17586,6 @@ L: linux-gpio@vger.kernel.org
|
|||
S: Maintained
|
||||
F: drivers/gpio/gpio-ws16c48.c
|
||||
|
||||
WIREGUARD SECURE NETWORK TUNNEL
|
||||
M: Jason A. Donenfeld <Jason@zx2c4.com>
|
||||
S: Maintained
|
||||
F: drivers/net/wireguard/
|
||||
F: tools/testing/selftests/wireguard/
|
||||
L: wireguard@lists.zx2c4.com
|
||||
L: netdev@vger.kernel.org
|
||||
|
||||
WISTRON LAPTOP BUTTON DRIVER
|
||||
M: Miloslav Trmac <mitr@volny.cz>
|
||||
S: Maintained
|
||||
|
|
|
|||
68
Makefile
68
Makefile
|
|
@ -1,7 +1,7 @@
|
|||
# SPDX-License-Identifier: GPL-2.0
|
||||
VERSION = 5
|
||||
PATCHLEVEL = 4
|
||||
SUBLEVEL = 302
|
||||
SUBLEVEL = 286
|
||||
EXTRAVERSION =
|
||||
NAME = Kleptomaniac Octopus
|
||||
|
||||
|
|
@ -412,14 +412,10 @@ else
|
|||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
endif
|
||||
|
||||
KBUILD_USERHOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
-O2 -fomit-frame-pointer -std=gnu89
|
||||
KBUILD_USERCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(USERCFLAGS)
|
||||
KBUILD_USERLDFLAGS := $(USERLDFLAGS)
|
||||
|
||||
KBUILD_HOSTCFLAGS := $(KBUILD_USERHOSTCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
|
||||
KBUILD_HOSTCXXFLAGS := -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
|
||||
KBUILD_HOSTCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 \
|
||||
-fomit-frame-pointer -std=gnu89 $(HOST_LFS_CFLAGS) \
|
||||
$(HOSTCFLAGS)
|
||||
KBUILD_HOSTCXXFLAGS := -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS)
|
||||
KBUILD_HOSTLDFLAGS := $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS)
|
||||
KBUILD_HOSTLDLIBS := $(HOST_LFS_LIBS) $(HOSTLDLIBS)
|
||||
|
||||
|
|
@ -447,7 +443,6 @@ OBJSIZE = $(CROSS_COMPILE)size
|
|||
STRIP = $(CROSS_COMPILE)strip
|
||||
endif
|
||||
PAHOLE = pahole
|
||||
RESOLVE_BTFIDS = $(objtree)/tools/bpf/resolve_btfids/resolve_btfids
|
||||
LEX = flex
|
||||
YACC = bison
|
||||
AWK = awk
|
||||
|
|
@ -510,11 +505,10 @@ GCC_PLUGINS_CFLAGS :=
|
|||
CLANG_FLAGS :=
|
||||
|
||||
export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE RESOLVE_BTFIDS LEX YACC AWK INSTALLKERNEL
|
||||
export CPP AR NM STRIP OBJCOPY OBJDUMP OBJSIZE READELF PAHOLE LEX YACC AWK INSTALLKERNEL
|
||||
export PERL PYTHON PYTHON3 CHECK CHECKFLAGS MAKE UTS_MACHINE HOSTCXX
|
||||
export KGZIP KBZIP2 KLZOP LZMA LZ4 XZ
|
||||
export KBUILD_HOSTCXXFLAGS KBUILD_HOSTLDFLAGS KBUILD_HOSTLDLIBS LDFLAGS_MODULE
|
||||
export KBUILD_USERCFLAGS KBUILD_USERLDFLAGS
|
||||
|
||||
export KBUILD_CPPFLAGS NOSTDINC_FLAGS LINUXINCLUDE OBJCOPYFLAGS KBUILD_LDFLAGS
|
||||
export KBUILD_CFLAGS CFLAGS_KERNEL CFLAGS_MODULE
|
||||
|
|
@ -596,14 +590,13 @@ CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
|
|||
endif # CROSS_COMPILE
|
||||
|
||||
ifeq ($(LLVM_IAS),0)
|
||||
CLANG_FLAGS += -fno-integrated-as
|
||||
CLANG_FLAGS += -no-integrated-as
|
||||
GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit))
|
||||
CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE))
|
||||
else
|
||||
CLANG_FLAGS += -fintegrated-as
|
||||
endif
|
||||
CLANG_FLAGS += -Werror=unknown-warning-option
|
||||
KBUILD_CPPFLAGS += $(CLANG_FLAGS)
|
||||
KBUILD_CFLAGS += $(CLANG_FLAGS)
|
||||
KBUILD_AFLAGS += $(CLANG_FLAGS)
|
||||
export CLANG_FLAGS
|
||||
endif
|
||||
|
||||
|
|
@ -809,18 +802,6 @@ KBUILD_CFLAGS += -Wno-gnu
|
|||
# Quiet clang warning: comparison of unsigned expression < 0 is always false
|
||||
KBUILD_CFLAGS += -Wno-tautological-compare
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, undefined-optimized)
|
||||
|
||||
# Clang may emit a warning when a const variable, such as the dummy variables
|
||||
# in typecheck(), or const member of an aggregate type are not initialized,
|
||||
# which can result in unexpected behavior. However, in many audited cases of
|
||||
# the "field" variant of the warning, this is intentional because the field is
|
||||
# never used within a particular call path, the field is within a union with
|
||||
# other non-const members, or the containing object is not const so the field
|
||||
# can be modified via memcpy() / memset(). While the variable warning also gets
|
||||
# disabled with this same switch, there should not be too much coverage lost
|
||||
# because -Wuninitialized will still flag when an uninitialized const variable
|
||||
# is used.
|
||||
KBUILD_CFLAGS += $(call cc-disable-warning, default-const-init-unsafe)
|
||||
else
|
||||
|
||||
# Warn about unmarked fall-throughs in switch statement.
|
||||
|
|
@ -873,8 +854,7 @@ DEBUG_CFLAGS += -gsplit-dwarf
|
|||
else
|
||||
DEBUG_CFLAGS += -g
|
||||
endif
|
||||
|
||||
ifdef CONFIG_AS_IS_LLVM
|
||||
ifeq ($(LLVM_IAS),1)
|
||||
KBUILD_AFLAGS += -g
|
||||
else
|
||||
KBUILD_AFLAGS += -Wa,-gdwarf-2
|
||||
|
|
@ -947,6 +927,7 @@ endif
|
|||
ifdef CONFIG_LTO_CLANG
|
||||
ifdef CONFIG_THINLTO
|
||||
CC_FLAGS_LTO_CLANG := -flto=thin $(call cc-option, -fsplit-lto-unit)
|
||||
KBUILD_LDFLAGS += --thinlto-cache-dir=.thinlto-cache
|
||||
else
|
||||
CC_FLAGS_LTO_CLANG := -flto
|
||||
endif
|
||||
|
|
@ -963,8 +944,7 @@ endif
|
|||
|
||||
ifdef CONFIG_LTO
|
||||
CC_FLAGS_LTO := $(CC_FLAGS_LTO_CLANG)
|
||||
KBUILD_CFLAGS += -fno-lto $(CC_FLAGS_LTO)
|
||||
KBUILD_AFLAGS += -fno-lto
|
||||
KBUILD_CFLAGS += $(CC_FLAGS_LTO)
|
||||
export CC_FLAGS_LTO
|
||||
endif
|
||||
|
||||
|
|
@ -1017,6 +997,15 @@ KBUILD_CFLAGS += $(call cc-disable-warning, maybe-uninitialized)
|
|||
# disable invalid "can't wrap" optimizations for signed / pointers
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
|
||||
|
||||
# clang sets -fmerge-all-constants by default as optimization, but this
|
||||
# is non-conforming behavior for C and in fact breaks the kernel, so we
|
||||
# need to disable it here generally.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-merge-all-constants)
|
||||
|
||||
# for gcc -fno-merge-all-constants disables everything, but it is fine
|
||||
# to have actual conforming behavior enabled.
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmerge-constants)
|
||||
|
||||
# Make sure -fstack-check isn't enabled (like gentoo apparently did)
|
||||
KBUILD_CFLAGS += $(call cc-option,-fno-stack-check,)
|
||||
|
||||
|
|
@ -1032,9 +1021,6 @@ KBUILD_CFLAGS += $(call cc-option,-Werror=incompatible-pointer-types)
|
|||
# Require designated initializers for all marked structures
|
||||
KBUILD_CFLAGS += $(call cc-option,-Werror=designated-init)
|
||||
|
||||
# Ensure compilers do not transform certain loops into calls to wcslen()
|
||||
KBUILD_CFLAGS += -fno-builtin-wcslen
|
||||
|
||||
# change __FILE__ to the relative path from the srctree
|
||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||
|
||||
|
|
@ -1058,19 +1044,9 @@ LDFLAGS_vmlinux += $(call ld-option, -X,)
|
|||
endif
|
||||
|
||||
ifeq ($(CONFIG_RELR),y)
|
||||
# ld.lld before 15 did not support -z pack-relative-relocs.
|
||||
LDFLAGS_vmlinux += $(call ld-option,--pack-dyn-relocs=relr,-z pack-relative-relocs)
|
||||
LDFLAGS_vmlinux += --pack-dyn-relocs=relr --use-android-relr-tags
|
||||
endif
|
||||
|
||||
# userspace programs are linked via the compiler, use the correct linker
|
||||
ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_LD_IS_LLD),yy)
|
||||
KBUILD_USERLDFLAGS += $(call cc-option, --ld-path=$(LD))
|
||||
endif
|
||||
|
||||
# Align the bit size of userspace programs with the kernel
|
||||
KBUILD_USERCFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
|
||||
KBUILD_USERLDFLAGS += $(filter -m32 -m64, $(KBUILD_CFLAGS))
|
||||
|
||||
# make the checker run with the right architecture
|
||||
CHECKFLAGS += --arch=$(ARCH)
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
LTS_5.4.302_91d385eb2a41
|
||||
LTS_5.4.274_564901bd7f5d
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -230,6 +230,7 @@
|
|||
vring_del_virtqueue
|
||||
vring_interrupt
|
||||
vring_transport_features
|
||||
wait_for_completion
|
||||
wait_woken
|
||||
__wake_up
|
||||
__warn_printk
|
||||
|
|
@ -738,13 +739,11 @@
|
|||
blk_mq_complete_request
|
||||
blk_mq_end_request
|
||||
blk_mq_free_tag_set
|
||||
blk_mq_freeze_queue
|
||||
blk_mq_init_queue
|
||||
blk_mq_quiesce_queue_nowait
|
||||
blk_mq_quiesce_queue
|
||||
blk_mq_start_request
|
||||
blk_mq_start_stopped_hw_queues
|
||||
blk_mq_stop_hw_queue
|
||||
blk_mq_unfreeze_queue
|
||||
blk_mq_unquiesce_queue
|
||||
blk_mq_virtio_map_queues
|
||||
blk_put_request
|
||||
|
|
@ -801,7 +800,6 @@
|
|||
__splice_from_pipe
|
||||
system_freezing_cnt
|
||||
__unregister_chrdev
|
||||
wait_for_completion
|
||||
|
||||
# required by virtio_input.ko
|
||||
input_alloc_absinfo
|
||||
|
|
@ -815,10 +813,14 @@
|
|||
|
||||
# required by virtio_mmio.ko
|
||||
device_for_each_child
|
||||
devm_platform_ioremap_resource
|
||||
devm_ioremap
|
||||
devm_kfree
|
||||
__devm_request_region
|
||||
iomem_resource
|
||||
memparse
|
||||
platform_device_register_full
|
||||
platform_get_irq
|
||||
platform_get_resource
|
||||
sscanf
|
||||
|
||||
# required by virtio_net.ko
|
||||
|
|
@ -954,12 +956,6 @@
|
|||
sock_i_ino
|
||||
|
||||
# preserved by --additions-only
|
||||
blk_mq_quiesce_queue
|
||||
devm_ioremap
|
||||
devm_kfree
|
||||
__devm_request_region
|
||||
generic_shutdown_super
|
||||
iomem_resource
|
||||
platform_get_resource
|
||||
refcount_dec_and_test_checked
|
||||
refcount_inc_checked
|
||||
|
|
|
|||
|
|
@ -2604,7 +2604,6 @@
|
|||
usb_disabled
|
||||
usb_driver_claim_interface
|
||||
usb_driver_release_interface
|
||||
usb_driver_set_configuration
|
||||
usb_enable_autosuspend
|
||||
usb_enable_intel_xhci_ports
|
||||
usb_ep_alloc_request
|
||||
|
|
|
|||
|
|
@ -103,11 +103,9 @@
|
|||
blk_status_to_errno
|
||||
blk_update_request
|
||||
blk_verify_command
|
||||
__blockdev_direct_IO
|
||||
blocking_notifier_call_chain
|
||||
blocking_notifier_chain_register
|
||||
blocking_notifier_chain_unregister
|
||||
block_write_full_page
|
||||
bpf_prog_add
|
||||
bpf_prog_put
|
||||
bpf_prog_sub
|
||||
|
|
@ -126,8 +124,6 @@
|
|||
bpf_warn_invalid_xdp_action
|
||||
bprm_change_interp
|
||||
__break_lease
|
||||
__bread_gfp
|
||||
__brelse
|
||||
build_skb
|
||||
bus_find_device
|
||||
bus_for_each_dev
|
||||
|
|
@ -186,9 +182,6 @@
|
|||
__class_create
|
||||
class_destroy
|
||||
class_find_device
|
||||
class_for_each_device
|
||||
class_create_file_ns
|
||||
class_remove_file_ns
|
||||
class_interface_unregister
|
||||
__class_register
|
||||
class_unregister
|
||||
|
|
@ -259,7 +252,6 @@
|
|||
__const_udelay
|
||||
consume_skb
|
||||
contig_page_data
|
||||
cont_write_begin
|
||||
_copy_from_iter_full
|
||||
copy_page
|
||||
copy_strings_kernel
|
||||
|
|
@ -390,9 +382,7 @@
|
|||
device_property_read_u32_array
|
||||
device_property_read_u8_array
|
||||
device_register
|
||||
device_remove_bin_file
|
||||
device_remove_file
|
||||
device_set_of_node_from_dev
|
||||
device_set_wakeup_capable
|
||||
device_show_int
|
||||
device_store_int
|
||||
|
|
@ -428,7 +418,6 @@
|
|||
devm_gpio_request_one
|
||||
devm_iio_channel_get
|
||||
devm_iio_device_alloc
|
||||
devm_gpio_free
|
||||
__devm_iio_device_register
|
||||
devm_input_allocate_device
|
||||
devm_ioremap
|
||||
|
|
@ -462,7 +451,6 @@
|
|||
devm_platform_ioremap_resource
|
||||
devm_power_supply_get_by_phandle
|
||||
devm_power_supply_register
|
||||
devm_pwm_get
|
||||
devm_pwm_put
|
||||
devm_regmap_add_irq_chip
|
||||
devm_regmap_del_irq_chip
|
||||
|
|
@ -526,7 +514,6 @@
|
|||
dev_uc_sync_multiple
|
||||
dev_uc_unsync
|
||||
_dev_warn
|
||||
d_find_alias
|
||||
dget_parent
|
||||
d_instantiate
|
||||
disable_irq
|
||||
|
|
@ -607,13 +594,11 @@
|
|||
dma_resv_wait_timeout_rcu
|
||||
dma_set_coherent_mask
|
||||
dma_set_mask
|
||||
d_move
|
||||
do_exit
|
||||
do_wait_intr
|
||||
down
|
||||
down_read
|
||||
down_write
|
||||
d_path
|
||||
dput
|
||||
drain_workqueue
|
||||
driver_find_device
|
||||
|
|
@ -906,7 +891,6 @@
|
|||
dump_stack
|
||||
enable_irq
|
||||
enable_percpu_irq
|
||||
end_buffer_write_sync
|
||||
eth_commit_mac_addr_change
|
||||
ether_setup
|
||||
eth_mac_addr
|
||||
|
|
@ -932,11 +916,7 @@
|
|||
fasync_helper
|
||||
fd_install
|
||||
fget
|
||||
filemap_fdatawait_range
|
||||
filemap_fdatawrite_range
|
||||
file_path
|
||||
filp_close
|
||||
filp_open
|
||||
find_last_bit
|
||||
find_next_bit
|
||||
find_next_zero_bit
|
||||
|
|
@ -981,25 +961,17 @@
|
|||
fwnode_property_read_u32_array
|
||||
fwnode_usb_role_switch_get
|
||||
gcd
|
||||
generic_block_bmap
|
||||
generic_cont_expand_simple
|
||||
generic_delete_inode
|
||||
generic_device_group
|
||||
generic_fh_to_dentry
|
||||
generic_fh_to_parent
|
||||
generic_file_llseek
|
||||
generic_file_mmap
|
||||
generic_file_read_iter
|
||||
generic_file_splice_read
|
||||
generic_fillattr
|
||||
generic_handle_irq
|
||||
generic_mii_ioctl
|
||||
generic_permission
|
||||
generic_read_dir
|
||||
generic_shutdown_super
|
||||
generic_write_end
|
||||
generic_file_fsync
|
||||
generic_file_write_iter
|
||||
genlmsg_put
|
||||
genl_register_family
|
||||
genl_unregister_family
|
||||
|
|
@ -1037,10 +1009,7 @@
|
|||
get_random_bytes
|
||||
get_random_u32
|
||||
__get_task_comm
|
||||
get_task_exe_file
|
||||
get_task_mm
|
||||
get_task_pid
|
||||
__getblk_gfp
|
||||
get_tree_single
|
||||
get_unmapped_area
|
||||
get_unused_fd_flags
|
||||
|
|
@ -1136,12 +1105,10 @@
|
|||
i2c_smbus_read_byte_data
|
||||
i2c_smbus_read_byte_data
|
||||
i2c_smbus_read_i2c_block_data
|
||||
i2c_smbus_read_word_data
|
||||
i2c_smbus_write_byte
|
||||
i2c_smbus_write_byte_data
|
||||
i2c_smbus_write_byte_data
|
||||
i2c_smbus_write_i2c_block_data
|
||||
i2c_smbus_write_word_data
|
||||
__i2c_smbus_xfer
|
||||
i2c_smbus_xfer
|
||||
__i2c_transfer
|
||||
|
|
@ -1182,16 +1149,12 @@
|
|||
iio_channel_release
|
||||
iio_read_channel_processed
|
||||
iio_write_channel_raw
|
||||
ilookup
|
||||
import_iovec
|
||||
in_egroup_p
|
||||
inc_nlink
|
||||
init_dummy_netdev
|
||||
init_net
|
||||
in_group_p
|
||||
__init_rwsem
|
||||
init_srcu_struct
|
||||
init_task
|
||||
init_timer_key
|
||||
init_uts_ns
|
||||
init_wait_entry
|
||||
|
|
@ -1208,7 +1171,6 @@
|
|||
input_mt_init_slots
|
||||
input_mt_report_pointer_emulation
|
||||
input_mt_report_slot_state
|
||||
input_mt_sync_frame
|
||||
input_open_device
|
||||
input_register_device
|
||||
input_register_handle
|
||||
|
|
@ -1218,15 +1180,12 @@
|
|||
input_unregister_device
|
||||
input_unregister_handle
|
||||
input_unregister_handler
|
||||
__insert_inode_hash
|
||||
interval_tree_insert
|
||||
interval_tree_iter_first
|
||||
interval_tree_iter_next
|
||||
interval_tree_remove
|
||||
int_to_scsilun
|
||||
invalidate_mapping_pages
|
||||
invalidate_bdev
|
||||
invalidate_inode_buffers
|
||||
iomem_resource
|
||||
iommu_alloc_resv_region
|
||||
iommu_attach_device
|
||||
|
|
@ -1323,7 +1282,6 @@
|
|||
irq_work_queue
|
||||
iterate_dir
|
||||
iterate_fd
|
||||
iunique
|
||||
jiffies
|
||||
jiffies_to_msecs
|
||||
jiffies_to_usecs
|
||||
|
|
@ -1332,7 +1290,6 @@
|
|||
kernel_connect
|
||||
kernel_getsockname
|
||||
kernel_kobj
|
||||
kernel_power_off
|
||||
kernel_read
|
||||
kernel_recvmsg
|
||||
kernel_restart
|
||||
|
|
@ -1355,7 +1312,6 @@
|
|||
kfree_skb
|
||||
kfree_skb_list
|
||||
kill_anon_super
|
||||
kill_block_super
|
||||
kill_fasync
|
||||
kill_litter_super
|
||||
kimage_vaddr
|
||||
|
|
@ -1372,7 +1328,6 @@
|
|||
kmemdup_nul
|
||||
kobject_create_and_add
|
||||
kobject_del
|
||||
kobject_get_path
|
||||
kobject_init_and_add
|
||||
kobject_put
|
||||
kobject_uevent
|
||||
|
|
@ -1420,7 +1375,6 @@
|
|||
ktime_add_safe
|
||||
ktime_get
|
||||
ktime_get_mono_fast_ns
|
||||
ktime_get_raw_ts64
|
||||
ktime_get_real_seconds
|
||||
ktime_get_real_ts64
|
||||
ktime_get_ts64
|
||||
|
|
@ -1445,22 +1399,16 @@
|
|||
list_sort
|
||||
llist_add_batch
|
||||
llist_reverse_order
|
||||
load_nls
|
||||
__local_bh_enable_ip
|
||||
lockref_get
|
||||
__lock_buffer
|
||||
lock_rename
|
||||
lock_sock_nested
|
||||
lookup_one_len
|
||||
LZ4_decompress_safe
|
||||
mac_pton
|
||||
mark_buffer_dirty
|
||||
__mark_inode_dirty
|
||||
mark_page_accessed
|
||||
match_int
|
||||
match_octal
|
||||
match_string
|
||||
match_strdup
|
||||
match_token
|
||||
mbox_chan_received_data
|
||||
mbox_chan_txdone
|
||||
|
|
@ -1505,12 +1453,9 @@
|
|||
mempool_free_slab
|
||||
memremap
|
||||
memset
|
||||
memset32
|
||||
__memset_io
|
||||
memunmap
|
||||
memweight
|
||||
mfd_add_devices
|
||||
mfd_remove_devices
|
||||
mii_check_media
|
||||
mii_ethtool_get_link_ksettings
|
||||
mii_ethtool_gset
|
||||
|
|
@ -1527,17 +1472,12 @@
|
|||
mmc_cqe_request_done
|
||||
mmc_of_parse
|
||||
mmc_send_tuning
|
||||
mmput
|
||||
mod_delayed_work_on
|
||||
mod_node_page_state
|
||||
mod_timer
|
||||
__module_get
|
||||
module_layout
|
||||
module_put
|
||||
mount_bdev
|
||||
mpage_readpage
|
||||
mpage_readpages
|
||||
mpage_writepages
|
||||
__msecs_to_jiffies
|
||||
msleep
|
||||
msleep_interruptible
|
||||
|
|
@ -1725,7 +1665,6 @@
|
|||
of_usb_host_tpl_support
|
||||
oops_in_progress
|
||||
override_creds
|
||||
orderly_poweroff
|
||||
pagecache_get_page
|
||||
panic
|
||||
panic_notifier_list
|
||||
|
|
@ -1734,7 +1673,6 @@
|
|||
param_get_int
|
||||
param_get_string
|
||||
param_get_ullong
|
||||
param_get_uint
|
||||
param_ops_bool
|
||||
param_ops_byte
|
||||
param_ops_charp
|
||||
|
|
@ -1747,7 +1685,6 @@
|
|||
param_set_bool
|
||||
param_set_copystring
|
||||
param_set_int
|
||||
param_set_uint
|
||||
passthru_features_check
|
||||
path_get
|
||||
path_put
|
||||
|
|
@ -1860,7 +1797,6 @@
|
|||
platform_get_irq
|
||||
platform_get_irq_byname
|
||||
platform_get_irq_byname_optional
|
||||
platform_get_irq_optional
|
||||
platform_get_resource
|
||||
platform_get_resource_byname
|
||||
platform_irq_count
|
||||
|
|
@ -1913,10 +1849,8 @@
|
|||
power_supply_get_property
|
||||
power_supply_put
|
||||
power_supply_reg_notifier
|
||||
power_supply_register
|
||||
power_supply_set_property
|
||||
power_supply_unreg_notifier
|
||||
power_supply_unregister
|
||||
prandom_u32
|
||||
preempt_schedule
|
||||
preempt_schedule_notrace
|
||||
|
|
@ -2004,7 +1938,6 @@
|
|||
__rcu_read_lock
|
||||
__rcu_read_unlock
|
||||
rdev_get_drvdata
|
||||
rdev_get_id
|
||||
reboot_mode
|
||||
refcount_dec_and_lock
|
||||
refcount_dec_and_test_checked
|
||||
|
|
@ -2046,11 +1979,9 @@
|
|||
regmap_field_read
|
||||
regmap_field_update_bits_base
|
||||
__regmap_init
|
||||
__regmap_init_i2c
|
||||
regmap_irq_get_virq
|
||||
regmap_mmio_detach_clk
|
||||
regmap_raw_read
|
||||
regmap_raw_write
|
||||
regmap_read
|
||||
regmap_register_patch
|
||||
regmap_update_bits_base
|
||||
|
|
@ -2059,22 +1990,17 @@
|
|||
regulator_count_voltages
|
||||
regulator_disable
|
||||
regulator_disable_deferred
|
||||
regulator_disable_regmap
|
||||
regulator_enable
|
||||
regulator_enable_regmap
|
||||
regulator_get
|
||||
regulator_get_current_limit
|
||||
regulator_get_drvdata
|
||||
regulator_get_mode
|
||||
regulator_get_voltage
|
||||
regulator_get_voltage_sel_regmap
|
||||
regulator_is_enabled
|
||||
regulator_is_enabled_regmap
|
||||
regulator_is_supported_voltage
|
||||
regulator_list_voltage
|
||||
regulator_list_voltage_linear
|
||||
regulator_lock
|
||||
regulator_map_voltage_linear
|
||||
regulator_notifier_call_chain
|
||||
regulator_put
|
||||
regulator_register
|
||||
|
|
@ -2083,21 +2009,17 @@
|
|||
regulator_set_load
|
||||
regulator_set_mode
|
||||
regulator_set_voltage
|
||||
regulator_set_voltage_sel_regmap
|
||||
regulator_unlock
|
||||
regulator_unregister
|
||||
regulator_unregister_notifier
|
||||
regulatory_set_wiphy_regd
|
||||
release_firmware
|
||||
release_pages
|
||||
__release_region
|
||||
release_sock
|
||||
remap_pfn_range
|
||||
remap_vmalloc_range
|
||||
remove_arg_zero
|
||||
__remove_inode_hash
|
||||
remove_proc_entry
|
||||
remove_proc_subtree
|
||||
remove_wait_queue
|
||||
report_iommu_fault
|
||||
request_firmware
|
||||
|
|
@ -2151,8 +2073,8 @@
|
|||
rtc_update_irq
|
||||
rtc_valid_tm
|
||||
rt_mutex_lock
|
||||
rt_mutex_unlock
|
||||
rt_mutex_trylock
|
||||
rt_mutex_unlock
|
||||
rtnl_is_locked
|
||||
rtnl_link_register
|
||||
rtnl_link_unregister
|
||||
|
|
@ -2164,8 +2086,6 @@
|
|||
rtnl_unregister_all
|
||||
save_stack_trace
|
||||
save_stack_trace_tsk
|
||||
sb_min_blocksize
|
||||
sb_set_blocksize
|
||||
sched_clock
|
||||
sched_setattr
|
||||
sched_setscheduler
|
||||
|
|
@ -2246,7 +2166,6 @@
|
|||
serial8250_suspend_port
|
||||
serial8250_unregister_port
|
||||
set_anon_super
|
||||
setattr_copy
|
||||
set_cpus_allowed_ptr
|
||||
set_disk_ro
|
||||
set_freezable
|
||||
|
|
@ -2365,7 +2284,6 @@
|
|||
snd_pcm_stop
|
||||
_snd_pcm_stream_lock_irqsave
|
||||
snd_pcm_stream_unlock_irqrestore
|
||||
snd_soc_add_card_controls
|
||||
snd_soc_add_component_controls
|
||||
snd_soc_bytes_tlv_callback
|
||||
snd_soc_card_get_kcontrol
|
||||
|
|
@ -2481,7 +2399,6 @@
|
|||
__stack_chk_guard
|
||||
stack_trace_print
|
||||
strcasecmp
|
||||
strcat
|
||||
strchr
|
||||
strchrnul
|
||||
strcmp
|
||||
|
|
@ -2495,7 +2412,6 @@
|
|||
strlcpy
|
||||
strlen
|
||||
strncasecmp
|
||||
strncat
|
||||
strnchr
|
||||
strncmp
|
||||
strncpy
|
||||
|
|
@ -2509,17 +2425,13 @@
|
|||
strscpy_pad
|
||||
strsep
|
||||
strstr
|
||||
submit_bh
|
||||
__sw_hweight32
|
||||
__sw_hweight64
|
||||
__sw_hweight8
|
||||
swiotlb_max_segment
|
||||
sync_blockdev
|
||||
sync_dirty_buffer
|
||||
sync_file_create
|
||||
sync_file_get_fence
|
||||
sync_filesystem
|
||||
sync_mapping_buffers
|
||||
synchronize_hardirq
|
||||
synchronize_irq
|
||||
synchronize_net
|
||||
|
|
@ -2561,7 +2473,6 @@
|
|||
thermal_cooling_device_unregister
|
||||
thermal_of_cooling_device_register
|
||||
thermal_zone_device_register
|
||||
thermal_zone_device_unregister
|
||||
thermal_zone_device_update
|
||||
thermal_zone_get_temp
|
||||
thermal_zone_get_zone_by_name
|
||||
|
|
@ -2571,7 +2482,6 @@
|
|||
timer_unstable_counter_workaround
|
||||
timespec64_to_jiffies
|
||||
_totalram_pages
|
||||
touch_buffer
|
||||
trace_array_create
|
||||
trace_array_destroy
|
||||
__trace_bprintk
|
||||
|
|
@ -2593,7 +2503,6 @@
|
|||
trace_seq_printf
|
||||
tracing_off
|
||||
truncate_inode_pages
|
||||
truncate_pagecache
|
||||
try_module_get
|
||||
try_wait_for_completion
|
||||
tty_flip_buffer_push
|
||||
|
|
@ -2606,7 +2515,6 @@
|
|||
typec_altmode_vdm
|
||||
typec_get_drvdata
|
||||
typec_partner_register_altmode
|
||||
typec_partner_set_identity
|
||||
typec_port_register_altmode
|
||||
typec_register_partner
|
||||
typec_register_port
|
||||
|
|
@ -2660,8 +2568,6 @@
|
|||
__uio_register_device
|
||||
uhid_hid_driver
|
||||
uio_unregister_device
|
||||
unload_nls
|
||||
unlock_buffer
|
||||
unlock_new_inode
|
||||
unlock_page
|
||||
unlock_rename
|
||||
|
|
@ -2846,8 +2752,6 @@
|
|||
__usecs_to_jiffies
|
||||
user_path_at_empty
|
||||
usleep_range
|
||||
utf16s_to_utf8s
|
||||
utf8s_to_utf16s
|
||||
v4l2_ctrl_find
|
||||
v4l2_ctrl_g_ctrl
|
||||
v4l2_ctrl_get_name
|
||||
|
|
@ -3000,13 +2904,9 @@
|
|||
wait_for_completion_killable
|
||||
wait_for_completion_timeout
|
||||
wait_woken
|
||||
__wait_on_buffer
|
||||
__wake_up
|
||||
__wake_up_locked
|
||||
wake_up_process
|
||||
wakeup_source_add
|
||||
wakeup_source_create
|
||||
wakeup_source_remove
|
||||
wakeup_source_register
|
||||
wakeup_source_unregister
|
||||
__warn_printk
|
||||
|
|
@ -3018,7 +2918,6 @@
|
|||
woken_wake_function
|
||||
work_busy
|
||||
would_dump
|
||||
write_inode_now
|
||||
ww_mutex_lock
|
||||
ww_mutex_lock_interruptible
|
||||
ww_mutex_unlock
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
[abi_symbol_list]
|
||||
# required by cdc_mbim.ko
|
||||
in6_dev_finish_destroy
|
||||
cdc_ncm_select_altsetting
|
||||
cdc_ncm_bind_common
|
||||
cdc_ncm_unbind
|
||||
cdc_ncm_change_mtu
|
||||
cdc_ncm_rx_verify_nth16
|
||||
cdc_ncm_rx_verify_ndp16
|
||||
cdc_ncm_fill_tx_frame
|
||||
# required by qmi_wwan.ko
|
||||
netdev_stats_to_stats64
|
||||
netdev_upper_get_next_dev_rcu
|
||||
# required by qcserial
|
||||
usb_disable_autosuspend
|
||||
|
|
@ -15,6 +15,3 @@
|
|||
dev_change_flags
|
||||
netdev_master_upper_dev_get
|
||||
prandom_bytes
|
||||
drm_client_dev_hotplug
|
||||
drm_edid_to_sad
|
||||
drm_edid_to_speaker_allocation
|
||||
|
|
|
|||
|
|
@ -697,13 +697,6 @@ config HAVE_IRQ_TIME_ACCOUNTING
|
|||
Archs need to ensure they use a high enough resolution clock to
|
||||
support irq time accounting and then call enable_sched_clock_irqtime().
|
||||
|
||||
config HAVE_MOVE_PUD
|
||||
bool
|
||||
help
|
||||
Architectures that select this are able to move page tables at the
|
||||
PUD level. If there are only 3 page table levels, the move effectively
|
||||
happens at the PGD level.
|
||||
|
||||
config HAVE_MOVE_PMD
|
||||
bool
|
||||
help
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ struct pt_regs {
|
|||
unsigned long trap_a0;
|
||||
unsigned long trap_a1;
|
||||
unsigned long trap_a2;
|
||||
/* This makes the stack 16-byte aligned as GCC expects */
|
||||
unsigned long __pad0;
|
||||
/* These are saved by PAL-code: */
|
||||
unsigned long ps;
|
||||
unsigned long pc;
|
||||
|
|
|
|||
|
|
@ -124,8 +124,6 @@
|
|||
|
||||
#define SO_DETACH_REUSEPORT_BPF 68
|
||||
|
||||
#define SO_NETNS_COOKIE 71
|
||||
|
||||
#if !defined(__KERNEL__)
|
||||
|
||||
#if __BITS_PER_LONG == 64
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ void foo(void)
|
|||
DEFINE(CRED_EGID, offsetof(struct cred, egid));
|
||||
BLANK();
|
||||
|
||||
DEFINE(SP_OFF, offsetof(struct pt_regs, ps));
|
||||
DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
|
||||
DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack));
|
||||
DEFINE(PT_PTRACED, PT_PTRACED);
|
||||
DEFINE(CLONE_VM, CLONE_VM);
|
||||
DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@
|
|||
.set noat
|
||||
.cfi_sections .debug_frame
|
||||
|
||||
/* Stack offsets. */
|
||||
#define SP_OFF 184
|
||||
#define SWITCH_STACK_SIZE 320
|
||||
|
||||
.macro CFI_START_OSF_FRAME func
|
||||
.align 4
|
||||
.globl \func
|
||||
|
|
@ -195,8 +199,8 @@ CFI_END_OSF_FRAME entArith
|
|||
CFI_START_OSF_FRAME entMM
|
||||
SAVE_ALL
|
||||
/* save $9 - $15 so the inline exception code can manipulate them. */
|
||||
subq $sp, 64, $sp
|
||||
.cfi_adjust_cfa_offset 64
|
||||
subq $sp, 56, $sp
|
||||
.cfi_adjust_cfa_offset 56
|
||||
stq $9, 0($sp)
|
||||
stq $10, 8($sp)
|
||||
stq $11, 16($sp)
|
||||
|
|
@ -211,7 +215,7 @@ CFI_START_OSF_FRAME entMM
|
|||
.cfi_rel_offset $13, 32
|
||||
.cfi_rel_offset $14, 40
|
||||
.cfi_rel_offset $15, 48
|
||||
addq $sp, 64, $19
|
||||
addq $sp, 56, $19
|
||||
/* handle the fault */
|
||||
lda $8, 0x3fff
|
||||
bic $sp, $8, $8
|
||||
|
|
@ -224,7 +228,7 @@ CFI_START_OSF_FRAME entMM
|
|||
ldq $13, 32($sp)
|
||||
ldq $14, 40($sp)
|
||||
ldq $15, 48($sp)
|
||||
addq $sp, 64, $sp
|
||||
addq $sp, 56, $sp
|
||||
.cfi_restore $9
|
||||
.cfi_restore $10
|
||||
.cfi_restore $11
|
||||
|
|
@ -232,7 +236,7 @@ CFI_START_OSF_FRAME entMM
|
|||
.cfi_restore $13
|
||||
.cfi_restore $14
|
||||
.cfi_restore $15
|
||||
.cfi_adjust_cfa_offset -64
|
||||
.cfi_adjust_cfa_offset -56
|
||||
/* finish up the syscall as normal. */
|
||||
br ret_from_sys_call
|
||||
CFI_END_OSF_FRAME entMM
|
||||
|
|
@ -379,8 +383,8 @@ entUnaUser:
|
|||
.cfi_restore $0
|
||||
.cfi_adjust_cfa_offset -256
|
||||
SAVE_ALL /* setup normal kernel stack */
|
||||
lda $sp, -64($sp)
|
||||
.cfi_adjust_cfa_offset 64
|
||||
lda $sp, -56($sp)
|
||||
.cfi_adjust_cfa_offset 56
|
||||
stq $9, 0($sp)
|
||||
stq $10, 8($sp)
|
||||
stq $11, 16($sp)
|
||||
|
|
@ -396,7 +400,7 @@ entUnaUser:
|
|||
.cfi_rel_offset $14, 40
|
||||
.cfi_rel_offset $15, 48
|
||||
lda $8, 0x3fff
|
||||
addq $sp, 64, $19
|
||||
addq $sp, 56, $19
|
||||
bic $sp, $8, $8
|
||||
jsr $26, do_entUnaUser
|
||||
ldq $9, 0($sp)
|
||||
|
|
@ -406,7 +410,7 @@ entUnaUser:
|
|||
ldq $13, 32($sp)
|
||||
ldq $14, 40($sp)
|
||||
ldq $15, 48($sp)
|
||||
lda $sp, 64($sp)
|
||||
lda $sp, 56($sp)
|
||||
.cfi_restore $9
|
||||
.cfi_restore $10
|
||||
.cfi_restore $11
|
||||
|
|
@ -414,7 +418,7 @@ entUnaUser:
|
|||
.cfi_restore $13
|
||||
.cfi_restore $14
|
||||
.cfi_restore $15
|
||||
.cfi_adjust_cfa_offset -64
|
||||
.cfi_adjust_cfa_offset -56
|
||||
br ret_from_sys_call
|
||||
CFI_END_OSF_FRAME entUna
|
||||
|
||||
|
|
|
|||
|
|
@ -475,9 +475,8 @@
|
|||
543 common fspick sys_fspick
|
||||
544 common pidfd_open sys_pidfd_open
|
||||
# 545 reserved for clone3
|
||||
546 common close_range sys_close_range
|
||||
# 546 reserved for close_range
|
||||
# 547 reserved for openat2
|
||||
# 548 reserved for pidfd_getfd
|
||||
# 549 reserved for faccessat2
|
||||
550 common process_madvise sys_process_madvise
|
||||
551 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ s_reg_to_mem (unsigned long s_reg)
|
|||
static int unauser_reg_offsets[32] = {
|
||||
R(r0), R(r1), R(r2), R(r3), R(r4), R(r5), R(r6), R(r7), R(r8),
|
||||
/* r9 ... r15 are stored in front of regs. */
|
||||
-64, -56, -48, -40, -32, -24, -16, /* padding at -8 */
|
||||
-56, -48, -40, -32, -24, -16, -8,
|
||||
R(r16), R(r17), R(r18),
|
||||
R(r19), R(r20), R(r21), R(r22), R(r23), R(r24), R(r25), R(r26),
|
||||
R(r27), R(r28), R(gp),
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ __load_new_mm_context(struct mm_struct *next_mm)
|
|||
|
||||
/* Macro for exception fixup code to access integer registers. */
|
||||
#define dpf_reg(r) \
|
||||
(((unsigned long *)regs)[(r) <= 8 ? (r) : (r) <= 15 ? (r)-17 : \
|
||||
(r) <= 18 ? (r)+11 : (r)-10])
|
||||
(((unsigned long *)regs)[(r) <= 8 ? (r) : (r) <= 15 ? (r)-16 : \
|
||||
(r) <= 18 ? (r)+10 : (r)-10])
|
||||
|
||||
asmlinkage void
|
||||
do_page_fault(unsigned long address, unsigned long mmcsr,
|
||||
|
|
@ -89,7 +89,7 @@ do_page_fault(unsigned long address, unsigned long mmcsr,
|
|||
const struct exception_table_entry *fixup;
|
||||
int si_code = SEGV_MAPERR;
|
||||
vm_fault_t fault;
|
||||
unsigned int flags = FAULT_FLAG_DEFAULT;
|
||||
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
|
||||
|
||||
/* As of EV6, a load into $31/$f31 is a prefetch, and never faults
|
||||
(or is suppressed by the PALcode). Support that for older CPUs
|
||||
|
|
@ -150,7 +150,7 @@ retry:
|
|||
the fault. */
|
||||
fault = handle_mm_fault(vma, address, flags);
|
||||
|
||||
if (fault_signal_pending(fault, regs))
|
||||
if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current))
|
||||
return;
|
||||
|
||||
if (unlikely(fault & VM_FAULT_ERROR)) {
|
||||
|
|
@ -169,7 +169,7 @@ retry:
|
|||
else
|
||||
current->min_flt++;
|
||||
if (fault & VM_FAULT_RETRY) {
|
||||
flags |= FAULT_FLAG_TRIED;
|
||||
flags &= ~FAULT_FLAG_ALLOW_RETRY;
|
||||
|
||||
/* No need to up_read(&mm->mmap_sem) as we would
|
||||
* have already released it in __lock_page_or_retry
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
KBUILD_DEFCONFIG := nsim_hs_defconfig
|
||||
|
||||
ifeq ($(CROSS_COMPILE),)
|
||||
CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux- arc-linux-gnu-)
|
||||
CROSS_COMPILE := $(call cc-cross-prefix, arc-linux- arceb-linux-)
|
||||
endif
|
||||
|
||||
cflags-y += -fno-common -pipe -fno-builtin -mmedium-calls -D__linux__
|
||||
|
|
|
|||
|
|
@ -371,8 +371,6 @@ static inline __attribute__ ((const)) int fls(unsigned long x)
|
|||
*/
|
||||
static inline __attribute__ ((const)) int __fls(unsigned long x)
|
||||
{
|
||||
if (__builtin_constant_p(x))
|
||||
return x ? BITS_PER_LONG - 1 - __builtin_clzl(x) : 0;
|
||||
/* FLS insn has exactly same semantics as the API */
|
||||
return __builtin_arc_fls(x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ void do_page_fault(unsigned long address, struct pt_regs *regs)
|
|||
(regs->ecr_cause == ECR_C_PROTV_INST_FETCH))
|
||||
exec = 1;
|
||||
|
||||
flags = FAULT_FLAG_DEFAULT;
|
||||
flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
|
||||
if (user_mode(regs))
|
||||
flags |= FAULT_FLAG_USER;
|
||||
if (write)
|
||||
|
|
@ -127,20 +127,29 @@ retry:
|
|||
|
||||
fault = handle_mm_fault(vma, address, flags);
|
||||
|
||||
/* Quick path to respond to signals */
|
||||
if (fault_signal_pending(fault, regs)) {
|
||||
if (!user_mode(regs))
|
||||
goto no_context;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fault retry nuances, mmap_sem already relinquished by core mm
|
||||
* Fault retry nuances
|
||||
*/
|
||||
if (unlikely((fault & VM_FAULT_RETRY) &&
|
||||
(flags & FAULT_FLAG_ALLOW_RETRY))) {
|
||||
flags |= FAULT_FLAG_TRIED;
|
||||
goto retry;
|
||||
if (unlikely(fault & VM_FAULT_RETRY)) {
|
||||
|
||||
/*
|
||||
* If fault needs to be retried, handle any pending signals
|
||||
* first (by returning to user mode).
|
||||
* mmap_sem already relinquished by core mm for RETRY case
|
||||
*/
|
||||
if (fatal_signal_pending(current)) {
|
||||
if (!user_mode(regs))
|
||||
goto no_context;
|
||||
return;
|
||||
}
|
||||
/*
|
||||
* retry state machine
|
||||
*/
|
||||
if (flags & FAULT_FLAG_ALLOW_RETRY) {
|
||||
flags &= ~FAULT_FLAG_ALLOW_RETRY;
|
||||
flags |= FAULT_FLAG_TRIED;
|
||||
goto retry;
|
||||
}
|
||||
}
|
||||
|
||||
bad_area:
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ config ARM
|
|||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_SPECIAL if ARM_LPAE
|
||||
select ARCH_HAS_PHYS_TO_DMA
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ endif
|
|||
|
||||
# Need -Uarm for gcc < 3.x
|
||||
KBUILD_CFLAGS +=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
|
||||
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include $(srctree)/arch/arm/include/asm/unified.h -msoft-float
|
||||
KBUILD_AFLAGS +=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
|
||||
|
||||
CHECKFLAGS += -D__arm__
|
||||
|
||||
|
|
|
|||
|
|
@ -145,8 +145,6 @@
|
|||
/* MDIO */
|
||||
AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLUP | SLEWCTRL_FAST, MUX_MODE0)
|
||||
AM33XX_PADCONF(AM335X_PIN_MDC, PIN_OUTPUT_PULLUP, MUX_MODE0)
|
||||
/* Added to support GPIO controlled PHY reset */
|
||||
AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_OUTPUT_PULLUP, MUX_MODE7)
|
||||
>;
|
||||
};
|
||||
|
||||
|
|
@ -155,8 +153,6 @@
|
|||
/* MDIO reset value */
|
||||
AM33XX_PADCONF(AM335X_PIN_MDIO, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
AM33XX_PADCONF(AM335X_PIN_MDC, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
/* Added to support GPIO controlled PHY reset */
|
||||
AM33XX_PADCONF(AM335X_PIN_UART0_CTSN, PIN_INPUT_PULLDOWN, MUX_MODE7)
|
||||
>;
|
||||
};
|
||||
|
||||
|
|
@ -400,10 +396,6 @@
|
|||
|
||||
ethphy0: ethernet-phy@0 {
|
||||
reg = <0>;
|
||||
/* Support GPIO reset on revision C3 boards */
|
||||
reset-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
|
||||
reset-assert-us = <300>;
|
||||
reset-deassert-us = <50000>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@
|
|||
nand@3 {
|
||||
reg = <0x3 0x0 0x800000>;
|
||||
rb-gpios = <&pioA 22 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioA 15 GPIO_ACTIVE_HIGH>;
|
||||
nand-bus-width = <8>;
|
||||
nand-ecc-mode = "soft";
|
||||
nand-on-flash-bbt;
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@
|
|||
pinctrl-0 = <&pinctrl_uart2>;
|
||||
linux,rs485-enabled-at-boot-time;
|
||||
rs485-rx-during-tx;
|
||||
rs485-rts-active-low;
|
||||
uart-has-rtscts;
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@
|
|||
clock-names = "spi", "wrap";
|
||||
};
|
||||
|
||||
cir: ir-receiver@10013000 {
|
||||
cir: cir@10013000 {
|
||||
compatible = "mediatek,mt7623-cir";
|
||||
reg = <0 0x10013000 0 0x1000>;
|
||||
interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_LOW>;
|
||||
|
|
|
|||
|
|
@ -211,6 +211,12 @@
|
|||
};
|
||||
};
|
||||
|
||||
sfpb_mutex: hwmutex {
|
||||
compatible = "qcom,sfpb-mutex";
|
||||
syscon = <&sfpb_wrapper_mutex 0x604 0x4>;
|
||||
#hwlock-cells = <1>;
|
||||
};
|
||||
|
||||
smem {
|
||||
compatible = "qcom,smem";
|
||||
memory-region = <&smem_region>;
|
||||
|
|
@ -353,10 +359,9 @@
|
|||
pinctrl-0 = <&ps_hold>;
|
||||
};
|
||||
|
||||
sfpb_mutex: hwmutex@1200600 {
|
||||
compatible = "qcom,sfpb-mutex";
|
||||
reg = <0x01200600 0x100>;
|
||||
#hwlock-cells = <1>;
|
||||
sfpb_wrapper_mutex: syscon@1200000 {
|
||||
compatible = "syscon";
|
||||
reg = <0x01200000 0x8000>;
|
||||
};
|
||||
|
||||
intc: interrupt-controller@2000000 {
|
||||
|
|
|
|||
|
|
@ -280,8 +280,8 @@
|
|||
|
||||
reg_dcdc5: dcdc5 {
|
||||
regulator-always-on;
|
||||
regulator-min-microvolt = <1450000>;
|
||||
regulator-max-microvolt = <1550000>;
|
||||
regulator-min-microvolt = <1425000>;
|
||||
regulator-max-microvolt = <1575000>;
|
||||
regulator-name = "vcc-dram";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@
|
|||
reg = <0x54400000 0x00040000>;
|
||||
clocks = <&tegra_car TEGRA114_CLK_DSIB>,
|
||||
<&tegra_car TEGRA114_CLK_DSIBLP>,
|
||||
<&tegra_car TEGRA114_CLK_PLL_D_OUT0>;
|
||||
<&tegra_car TEGRA114_CLK_PLL_D2_OUT0>;
|
||||
clock-names = "dsi", "lp", "parent";
|
||||
resets = <&tegra_car 82>;
|
||||
reset-names = "dsi";
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
nand@3 {
|
||||
reg = <0x3 0x0 0x800000>;
|
||||
rb-gpios = <&pioA 22 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioA 15 GPIO_ACTIVE_HIGH>;
|
||||
nand-bus-width = <8>;
|
||||
nand-ecc-mode = "soft";
|
||||
nand-on-flash-bbt;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
};
|
||||
|
||||
spi0: spi@fffa4000 {
|
||||
cs-gpios = <&pioA 5 GPIO_ACTIVE_LOW>;
|
||||
cs-gpios = <&pioB 15 GPIO_ACTIVE_HIGH>;
|
||||
status = "okay";
|
||||
mtd_dataflash@0 {
|
||||
compatible = "atmel,at45", "atmel,dataflash";
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
nand@3 {
|
||||
reg = <0x3 0x0 0x800000>;
|
||||
rb-gpios = <&pioA 22 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioD 15 GPIO_ACTIVE_HIGH>;
|
||||
cs-gpios = <&pioA 15 GPIO_ACTIVE_HIGH>;
|
||||
nand-bus-width = <8>;
|
||||
nand-ecc-mode = "soft";
|
||||
nand-on-flash-bbt;
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@
|
|||
|
||||
ftm: ftm@400b8000 {
|
||||
compatible = "fsl,ftm-timer";
|
||||
reg = <0x400b8000 0x1000>, <0x400b9000 0x1000>;
|
||||
reg = <0x400b8000 0x1000 0x400b9000 0x1000>;
|
||||
interrupts = <44 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clock-names = "ftm-evt", "ftm-src",
|
||||
"ftm-evt-counter-en", "ftm-src-counter-en";
|
||||
|
|
|
|||
5
arch/arm/configs/vendor/sdxlemur.config
vendored
5
arch/arm/configs/vendor/sdxlemur.config
vendored
|
|
@ -51,10 +51,6 @@ CONFIG_CNSS_ASYNC=y
|
|||
CONFIG_CNSS_QCA6490=y
|
||||
CONFIG_CNSS_UTILS=y
|
||||
# CONFIG_CNSS_GENL is not set
|
||||
CONFIG_CNSS=m
|
||||
CONFIG_CNSS_CRYPTO=y
|
||||
CONFIG_CNSS_PCI=y
|
||||
CONFIG_CNSS_LOGGER=m
|
||||
CONFIG_QCOM_MEMORY_DUMP_V2=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
|
|
@ -254,7 +250,6 @@ CONFIG_USB_CONFIGFS_F_UAC2=y
|
|||
CONFIG_USB_CONFIGFS_F_CCID=y
|
||||
CONFIG_USB_G_QTI=y
|
||||
CONFIG_USB_BAM=y
|
||||
CONFIG_USB_R8152_RTL=m
|
||||
CONFIG_USB_NET_SMSC75XX=y
|
||||
CONFIG_USB_NET_SMSC95XX=y
|
||||
CONFIG_ARM_PSCI=y
|
||||
|
|
|
|||
1
arch/arm/crypto/.gitignore
vendored
1
arch/arm/crypto/.gitignore
vendored
|
|
@ -1,4 +1,3 @@
|
|||
aesbs-core.S
|
||||
sha256-core.S
|
||||
sha512-core.S
|
||||
poly1305-core.S
|
||||
|
|
|
|||
|
|
@ -148,24 +148,14 @@ config CRYPTO_CRC32_ARM_CE
|
|||
select CRYPTO_HASH
|
||||
|
||||
config CRYPTO_CHACHA20_NEON
|
||||
tristate "NEON and scalar accelerated ChaCha stream cipher algorithms"
|
||||
tristate "NEON accelerated ChaCha stream cipher algorithms"
|
||||
depends on KERNEL_MODE_NEON
|
||||
select CRYPTO_BLKCIPHER
|
||||
select CRYPTO_ARCH_HAVE_LIB_CHACHA
|
||||
|
||||
config CRYPTO_POLY1305_ARM
|
||||
tristate "Accelerated scalar and SIMD Poly1305 hash implementations"
|
||||
select CRYPTO_HASH
|
||||
select CRYPTO_ARCH_HAVE_LIB_POLY1305
|
||||
select CRYPTO_CHACHA20
|
||||
|
||||
config CRYPTO_NHPOLY1305_NEON
|
||||
tristate "NEON accelerated NHPoly1305 hash function (for Adiantum)"
|
||||
depends on KERNEL_MODE_NEON
|
||||
select CRYPTO_NHPOLY1305
|
||||
|
||||
config CRYPTO_CURVE25519_NEON
|
||||
tristate "NEON accelerated Curve25519 scalar multiplication library"
|
||||
depends on KERNEL_MODE_NEON
|
||||
select CRYPTO_LIB_CURVE25519_GENERIC
|
||||
select CRYPTO_ARCH_HAVE_LIB_CURVE25519
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -13,9 +13,7 @@ obj-$(CONFIG_CRYPTO_BLAKE2S_ARM) += blake2s-arm.o
|
|||
obj-$(if $(CONFIG_CRYPTO_BLAKE2S_ARM),y) += libblake2s-arm.o
|
||||
obj-$(CONFIG_CRYPTO_BLAKE2B_NEON) += blake2b-neon.o
|
||||
obj-$(CONFIG_CRYPTO_CHACHA20_NEON) += chacha-neon.o
|
||||
obj-$(CONFIG_CRYPTO_POLY1305_ARM) += poly1305-arm.o
|
||||
obj-$(CONFIG_CRYPTO_NHPOLY1305_NEON) += nhpoly1305-neon.o
|
||||
obj-$(CONFIG_CRYPTO_CURVE25519_NEON) += curve25519-neon.o
|
||||
|
||||
obj-$(CONFIG_CRYPTO_AES_ARM_CE) += aes-arm-ce.o
|
||||
obj-$(CONFIG_CRYPTO_SHA1_ARM_CE) += sha1-arm-ce.o
|
||||
|
|
@ -41,19 +39,13 @@ aes-arm-ce-y := aes-ce-core.o aes-ce-glue.o
|
|||
ghash-arm-ce-y := ghash-ce-core.o ghash-ce-glue.o
|
||||
crct10dif-arm-ce-y := crct10dif-ce-core.o crct10dif-ce-glue.o
|
||||
crc32-arm-ce-y:= crc32-ce-core.o crc32-ce-glue.o
|
||||
chacha-neon-y := chacha-scalar-core.o chacha-glue.o
|
||||
chacha-neon-$(CONFIG_KERNEL_MODE_NEON) += chacha-neon-core.o
|
||||
poly1305-arm-y := poly1305-core.o poly1305-glue.o
|
||||
chacha-neon-y := chacha-neon-core.o chacha-neon-glue.o
|
||||
nhpoly1305-neon-y := nh-neon-core.o nhpoly1305-neon-glue.o
|
||||
curve25519-neon-y := curve25519-core.o curve25519-glue.o
|
||||
|
||||
ifdef REGENERATE_ARM_CRYPTO
|
||||
quiet_cmd_perl = PERL $@
|
||||
cmd_perl = $(PERL) $(<) > $(@)
|
||||
|
||||
$(src)/poly1305-core.S_shipped: $(src)/poly1305-armv4.pl
|
||||
$(call cmd,perl)
|
||||
|
||||
$(src)/sha256-core.S_shipped: $(src)/sha256-armv4.pl
|
||||
$(call cmd,perl)
|
||||
|
||||
|
|
@ -61,9 +53,4 @@ $(src)/sha512-core.S_shipped: $(src)/sha512-armv4.pl
|
|||
$(call cmd,perl)
|
||||
endif
|
||||
|
||||
clean-files += poly1305-core.S sha256-core.S sha512-core.S
|
||||
|
||||
# massage the perlasm code a bit so we only get the NEON routine if we need it
|
||||
poly1305-aflags-$(CONFIG_CPU_V7) := -U__LINUX_ARM_ARCH__ -D__LINUX_ARM_ARCH__=5
|
||||
poly1305-aflags-$(CONFIG_KERNEL_MODE_NEON) := -U__LINUX_ARM_ARCH__ -D__LINUX_ARM_ARCH__=7
|
||||
AFLAGS_poly1305-core.o += $(poly1305-aflags-y)
|
||||
clean-files += sha256-core.S sha512-core.S
|
||||
|
|
|
|||
|
|
@ -1,357 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* ARM NEON accelerated ChaCha and XChaCha stream ciphers,
|
||||
* including ChaCha20 (RFC7539)
|
||||
*
|
||||
* Copyright (C) 2016-2019 Linaro, Ltd. <ard.biesheuvel@linaro.org>
|
||||
* Copyright (C) 2015 Martin Willi
|
||||
*/
|
||||
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/internal/chacha.h>
|
||||
#include <crypto/internal/simd.h>
|
||||
#include <crypto/internal/skcipher.h>
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/cputype.h>
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
asmlinkage void chacha_block_xor_neon(const u32 *state, u8 *dst, const u8 *src,
|
||||
int nrounds);
|
||||
asmlinkage void chacha_4block_xor_neon(const u32 *state, u8 *dst, const u8 *src,
|
||||
int nrounds);
|
||||
asmlinkage void hchacha_block_arm(const u32 *state, u32 *out, int nrounds);
|
||||
asmlinkage void hchacha_block_neon(const u32 *state, u32 *out, int nrounds);
|
||||
|
||||
asmlinkage void chacha_doarm(u8 *dst, const u8 *src, unsigned int bytes,
|
||||
const u32 *state, int nrounds);
|
||||
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(use_neon);
|
||||
|
||||
static inline bool neon_usable(void)
|
||||
{
|
||||
return static_branch_likely(&use_neon) && crypto_simd_usable();
|
||||
}
|
||||
|
||||
static void chacha_doneon(u32 *state, u8 *dst, const u8 *src,
|
||||
unsigned int bytes, int nrounds)
|
||||
{
|
||||
u8 buf[CHACHA_BLOCK_SIZE];
|
||||
|
||||
while (bytes >= CHACHA_BLOCK_SIZE * 4) {
|
||||
chacha_4block_xor_neon(state, dst, src, nrounds);
|
||||
bytes -= CHACHA_BLOCK_SIZE * 4;
|
||||
src += CHACHA_BLOCK_SIZE * 4;
|
||||
dst += CHACHA_BLOCK_SIZE * 4;
|
||||
state[12] += 4;
|
||||
}
|
||||
while (bytes >= CHACHA_BLOCK_SIZE) {
|
||||
chacha_block_xor_neon(state, dst, src, nrounds);
|
||||
bytes -= CHACHA_BLOCK_SIZE;
|
||||
src += CHACHA_BLOCK_SIZE;
|
||||
dst += CHACHA_BLOCK_SIZE;
|
||||
state[12]++;
|
||||
}
|
||||
if (bytes) {
|
||||
memcpy(buf, src, bytes);
|
||||
chacha_block_xor_neon(state, buf, buf, nrounds);
|
||||
memcpy(dst, buf, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
void hchacha_block_arch(const u32 *state, u32 *stream, int nrounds)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon_usable()) {
|
||||
hchacha_block_arm(state, stream, nrounds);
|
||||
} else {
|
||||
kernel_neon_begin();
|
||||
hchacha_block_neon(state, stream, nrounds);
|
||||
kernel_neon_end();
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(hchacha_block_arch);
|
||||
|
||||
void chacha_init_arch(u32 *state, const u32 *key, const u8 *iv)
|
||||
{
|
||||
chacha_init_generic(state, key, iv);
|
||||
}
|
||||
EXPORT_SYMBOL(chacha_init_arch);
|
||||
|
||||
void chacha_crypt_arch(u32 *state, u8 *dst, const u8 *src, unsigned int bytes,
|
||||
int nrounds)
|
||||
{
|
||||
if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon_usable() ||
|
||||
bytes <= CHACHA_BLOCK_SIZE) {
|
||||
chacha_doarm(dst, src, bytes, state, nrounds);
|
||||
state[12] += DIV_ROUND_UP(bytes, CHACHA_BLOCK_SIZE);
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, bytes, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
chacha_doneon(state, dst, src, todo, nrounds);
|
||||
kernel_neon_end();
|
||||
|
||||
bytes -= todo;
|
||||
src += todo;
|
||||
dst += todo;
|
||||
} while (bytes);
|
||||
}
|
||||
EXPORT_SYMBOL(chacha_crypt_arch);
|
||||
|
||||
static int chacha_stream_xor(struct skcipher_request *req,
|
||||
const struct chacha_ctx *ctx, const u8 *iv,
|
||||
bool neon)
|
||||
{
|
||||
struct skcipher_walk walk;
|
||||
u32 state[16];
|
||||
int err;
|
||||
|
||||
err = skcipher_walk_virt(&walk, req, false);
|
||||
|
||||
chacha_init_generic(state, ctx->key, iv);
|
||||
|
||||
while (walk.nbytes > 0) {
|
||||
unsigned int nbytes = walk.nbytes;
|
||||
|
||||
if (nbytes < walk.total)
|
||||
nbytes = round_down(nbytes, walk.stride);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon) {
|
||||
chacha_doarm(walk.dst.virt.addr, walk.src.virt.addr,
|
||||
nbytes, state, ctx->nrounds);
|
||||
state[12] += DIV_ROUND_UP(nbytes, CHACHA_BLOCK_SIZE);
|
||||
} else {
|
||||
kernel_neon_begin();
|
||||
chacha_doneon(state, walk.dst.virt.addr,
|
||||
walk.src.virt.addr, nbytes, ctx->nrounds);
|
||||
kernel_neon_end();
|
||||
}
|
||||
err = skcipher_walk_done(&walk, walk.nbytes - nbytes);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int do_chacha(struct skcipher_request *req, bool neon)
|
||||
{
|
||||
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
|
||||
return chacha_stream_xor(req, ctx, req->iv, neon);
|
||||
}
|
||||
|
||||
static int chacha_arm(struct skcipher_request *req)
|
||||
{
|
||||
return do_chacha(req, false);
|
||||
}
|
||||
|
||||
static int chacha_neon(struct skcipher_request *req)
|
||||
{
|
||||
return do_chacha(req, neon_usable());
|
||||
}
|
||||
|
||||
static int do_xchacha(struct skcipher_request *req, bool neon)
|
||||
{
|
||||
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct chacha_ctx subctx;
|
||||
u32 state[16];
|
||||
u8 real_iv[16];
|
||||
|
||||
chacha_init_generic(state, ctx->key, req->iv);
|
||||
|
||||
if (!IS_ENABLED(CONFIG_KERNEL_MODE_NEON) || !neon) {
|
||||
hchacha_block_arm(state, subctx.key, ctx->nrounds);
|
||||
} else {
|
||||
kernel_neon_begin();
|
||||
hchacha_block_neon(state, subctx.key, ctx->nrounds);
|
||||
kernel_neon_end();
|
||||
}
|
||||
subctx.nrounds = ctx->nrounds;
|
||||
|
||||
memcpy(&real_iv[0], req->iv + 24, 8);
|
||||
memcpy(&real_iv[8], req->iv + 16, 8);
|
||||
return chacha_stream_xor(req, &subctx, real_iv, neon);
|
||||
}
|
||||
|
||||
static int xchacha_arm(struct skcipher_request *req)
|
||||
{
|
||||
return do_xchacha(req, false);
|
||||
}
|
||||
|
||||
static int xchacha_neon(struct skcipher_request *req)
|
||||
{
|
||||
return do_xchacha(req, neon_usable());
|
||||
}
|
||||
|
||||
static struct skcipher_alg arm_algs[] = {
|
||||
{
|
||||
.base.cra_name = "chacha20",
|
||||
.base.cra_driver_name = "chacha20-arm",
|
||||
.base.cra_priority = 200,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = CHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha20_setkey,
|
||||
.encrypt = chacha_arm,
|
||||
.decrypt = chacha_arm,
|
||||
}, {
|
||||
.base.cra_name = "xchacha20",
|
||||
.base.cra_driver_name = "xchacha20-arm",
|
||||
.base.cra_priority = 200,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha20_setkey,
|
||||
.encrypt = xchacha_arm,
|
||||
.decrypt = xchacha_arm,
|
||||
}, {
|
||||
.base.cra_name = "xchacha12",
|
||||
.base.cra_driver_name = "xchacha12-arm",
|
||||
.base.cra_priority = 200,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha12_setkey,
|
||||
.encrypt = xchacha_arm,
|
||||
.decrypt = xchacha_arm,
|
||||
},
|
||||
};
|
||||
|
||||
static struct skcipher_alg neon_algs[] = {
|
||||
{
|
||||
.base.cra_name = "chacha20",
|
||||
.base.cra_driver_name = "chacha20-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = CHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha20_setkey,
|
||||
.encrypt = chacha_neon,
|
||||
.decrypt = chacha_neon,
|
||||
}, {
|
||||
.base.cra_name = "xchacha20",
|
||||
.base.cra_driver_name = "xchacha20-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha20_setkey,
|
||||
.encrypt = xchacha_neon,
|
||||
.decrypt = xchacha_neon,
|
||||
}, {
|
||||
.base.cra_name = "xchacha12",
|
||||
.base.cra_driver_name = "xchacha12-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = chacha12_setkey,
|
||||
.encrypt = xchacha_neon,
|
||||
.decrypt = xchacha_neon,
|
||||
}
|
||||
};
|
||||
|
||||
static int __init chacha_simd_mod_init(void)
|
||||
{
|
||||
int err = 0;
|
||||
|
||||
if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) {
|
||||
err = crypto_register_skciphers(arm_algs, ARRAY_SIZE(arm_algs));
|
||||
if (err)
|
||||
return err;
|
||||
}
|
||||
|
||||
if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && (elf_hwcap & HWCAP_NEON)) {
|
||||
int i;
|
||||
|
||||
switch (read_cpuid_part()) {
|
||||
case ARM_CPU_PART_CORTEX_A7:
|
||||
case ARM_CPU_PART_CORTEX_A5:
|
||||
/*
|
||||
* The Cortex-A7 and Cortex-A5 do not perform well with
|
||||
* the NEON implementation but do incredibly with the
|
||||
* scalar one and use less power.
|
||||
*/
|
||||
for (i = 0; i < ARRAY_SIZE(neon_algs); i++)
|
||||
neon_algs[i].base.cra_priority = 0;
|
||||
break;
|
||||
default:
|
||||
static_branch_enable(&use_neon);
|
||||
}
|
||||
|
||||
if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) {
|
||||
err = crypto_register_skciphers(neon_algs, ARRAY_SIZE(neon_algs));
|
||||
if (err)
|
||||
crypto_unregister_skciphers(arm_algs, ARRAY_SIZE(arm_algs));
|
||||
}
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
||||
static void __exit chacha_simd_mod_fini(void)
|
||||
{
|
||||
if (IS_REACHABLE(CONFIG_CRYPTO_BLKCIPHER)) {
|
||||
crypto_unregister_skciphers(arm_algs, ARRAY_SIZE(arm_algs));
|
||||
if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && (elf_hwcap & HWCAP_NEON))
|
||||
crypto_unregister_skciphers(neon_algs, ARRAY_SIZE(neon_algs));
|
||||
}
|
||||
}
|
||||
|
||||
module_init(chacha_simd_mod_init);
|
||||
module_exit(chacha_simd_mod_fini);
|
||||
|
||||
MODULE_DESCRIPTION("ChaCha and XChaCha stream ciphers (scalar and NEON accelerated)");
|
||||
MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_ALIAS_CRYPTO("chacha20");
|
||||
MODULE_ALIAS_CRYPTO("chacha20-arm");
|
||||
MODULE_ALIAS_CRYPTO("xchacha20");
|
||||
MODULE_ALIAS_CRYPTO("xchacha20-arm");
|
||||
MODULE_ALIAS_CRYPTO("xchacha12");
|
||||
MODULE_ALIAS_CRYPTO("xchacha12-arm");
|
||||
#ifdef CONFIG_KERNEL_MODE_NEON
|
||||
MODULE_ALIAS_CRYPTO("chacha20-neon");
|
||||
MODULE_ALIAS_CRYPTO("xchacha20-neon");
|
||||
MODULE_ALIAS_CRYPTO("xchacha12-neon");
|
||||
#endif
|
||||
202
arch/arm/crypto/chacha-neon-glue.c
Normal file
202
arch/arm/crypto/chacha-neon-glue.c
Normal file
|
|
@ -0,0 +1,202 @@
|
|||
/*
|
||||
* ARM NEON accelerated ChaCha and XChaCha stream ciphers,
|
||||
* including ChaCha20 (RFC7539)
|
||||
*
|
||||
* Copyright (C) 2016 Linaro, Ltd. <ard.biesheuvel@linaro.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Based on:
|
||||
* ChaCha20 256-bit cipher algorithm, RFC7539, SIMD glue code
|
||||
*
|
||||
* Copyright (C) 2015 Martin Willi
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/chacha.h>
|
||||
#include <crypto/internal/simd.h>
|
||||
#include <crypto/internal/skcipher.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
|
||||
asmlinkage void chacha_block_xor_neon(const u32 *state, u8 *dst, const u8 *src,
|
||||
int nrounds);
|
||||
asmlinkage void chacha_4block_xor_neon(const u32 *state, u8 *dst, const u8 *src,
|
||||
int nrounds);
|
||||
asmlinkage void hchacha_block_neon(const u32 *state, u32 *out, int nrounds);
|
||||
|
||||
static void chacha_doneon(u32 *state, u8 *dst, const u8 *src,
|
||||
unsigned int bytes, int nrounds)
|
||||
{
|
||||
u8 buf[CHACHA_BLOCK_SIZE];
|
||||
|
||||
while (bytes >= CHACHA_BLOCK_SIZE * 4) {
|
||||
chacha_4block_xor_neon(state, dst, src, nrounds);
|
||||
bytes -= CHACHA_BLOCK_SIZE * 4;
|
||||
src += CHACHA_BLOCK_SIZE * 4;
|
||||
dst += CHACHA_BLOCK_SIZE * 4;
|
||||
state[12] += 4;
|
||||
}
|
||||
while (bytes >= CHACHA_BLOCK_SIZE) {
|
||||
chacha_block_xor_neon(state, dst, src, nrounds);
|
||||
bytes -= CHACHA_BLOCK_SIZE;
|
||||
src += CHACHA_BLOCK_SIZE;
|
||||
dst += CHACHA_BLOCK_SIZE;
|
||||
state[12]++;
|
||||
}
|
||||
if (bytes) {
|
||||
memcpy(buf, src, bytes);
|
||||
chacha_block_xor_neon(state, buf, buf, nrounds);
|
||||
memcpy(dst, buf, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
static int chacha_neon_stream_xor(struct skcipher_request *req,
|
||||
const struct chacha_ctx *ctx, const u8 *iv)
|
||||
{
|
||||
struct skcipher_walk walk;
|
||||
u32 state[16];
|
||||
int err;
|
||||
|
||||
err = skcipher_walk_virt(&walk, req, false);
|
||||
|
||||
crypto_chacha_init(state, ctx, iv);
|
||||
|
||||
while (walk.nbytes > 0) {
|
||||
unsigned int nbytes = walk.nbytes;
|
||||
|
||||
if (nbytes < walk.total)
|
||||
nbytes = round_down(nbytes, walk.stride);
|
||||
|
||||
kernel_neon_begin();
|
||||
chacha_doneon(state, walk.dst.virt.addr, walk.src.virt.addr,
|
||||
nbytes, ctx->nrounds);
|
||||
kernel_neon_end();
|
||||
err = skcipher_walk_done(&walk, walk.nbytes - nbytes);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int chacha_neon(struct skcipher_request *req)
|
||||
{
|
||||
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
|
||||
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !crypto_simd_usable())
|
||||
return crypto_chacha_crypt(req);
|
||||
|
||||
return chacha_neon_stream_xor(req, ctx, req->iv);
|
||||
}
|
||||
|
||||
static int xchacha_neon(struct skcipher_request *req)
|
||||
{
|
||||
struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
|
||||
struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
|
||||
struct chacha_ctx subctx;
|
||||
u32 state[16];
|
||||
u8 real_iv[16];
|
||||
|
||||
if (req->cryptlen <= CHACHA_BLOCK_SIZE || !crypto_simd_usable())
|
||||
return crypto_xchacha_crypt(req);
|
||||
|
||||
crypto_chacha_init(state, ctx, req->iv);
|
||||
|
||||
kernel_neon_begin();
|
||||
hchacha_block_neon(state, subctx.key, ctx->nrounds);
|
||||
kernel_neon_end();
|
||||
subctx.nrounds = ctx->nrounds;
|
||||
|
||||
memcpy(&real_iv[0], req->iv + 24, 8);
|
||||
memcpy(&real_iv[8], req->iv + 16, 8);
|
||||
return chacha_neon_stream_xor(req, &subctx, real_iv);
|
||||
}
|
||||
|
||||
static struct skcipher_alg algs[] = {
|
||||
{
|
||||
.base.cra_name = "chacha20",
|
||||
.base.cra_driver_name = "chacha20-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = CHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = crypto_chacha20_setkey,
|
||||
.encrypt = chacha_neon,
|
||||
.decrypt = chacha_neon,
|
||||
}, {
|
||||
.base.cra_name = "xchacha20",
|
||||
.base.cra_driver_name = "xchacha20-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = crypto_chacha20_setkey,
|
||||
.encrypt = xchacha_neon,
|
||||
.decrypt = xchacha_neon,
|
||||
}, {
|
||||
.base.cra_name = "xchacha12",
|
||||
.base.cra_driver_name = "xchacha12-neon",
|
||||
.base.cra_priority = 300,
|
||||
.base.cra_blocksize = 1,
|
||||
.base.cra_ctxsize = sizeof(struct chacha_ctx),
|
||||
.base.cra_module = THIS_MODULE,
|
||||
|
||||
.min_keysize = CHACHA_KEY_SIZE,
|
||||
.max_keysize = CHACHA_KEY_SIZE,
|
||||
.ivsize = XCHACHA_IV_SIZE,
|
||||
.chunksize = CHACHA_BLOCK_SIZE,
|
||||
.walksize = 4 * CHACHA_BLOCK_SIZE,
|
||||
.setkey = crypto_chacha12_setkey,
|
||||
.encrypt = xchacha_neon,
|
||||
.decrypt = xchacha_neon,
|
||||
}
|
||||
};
|
||||
|
||||
static int __init chacha_simd_mod_init(void)
|
||||
{
|
||||
if (!(elf_hwcap & HWCAP_NEON))
|
||||
return -ENODEV;
|
||||
|
||||
return crypto_register_skciphers(algs, ARRAY_SIZE(algs));
|
||||
}
|
||||
|
||||
static void __exit chacha_simd_mod_fini(void)
|
||||
{
|
||||
crypto_unregister_skciphers(algs, ARRAY_SIZE(algs));
|
||||
}
|
||||
|
||||
module_init(chacha_simd_mod_init);
|
||||
module_exit(chacha_simd_mod_fini);
|
||||
|
||||
MODULE_DESCRIPTION("ChaCha and XChaCha stream ciphers (NEON accelerated)");
|
||||
MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_ALIAS_CRYPTO("chacha20");
|
||||
MODULE_ALIAS_CRYPTO("chacha20-neon");
|
||||
MODULE_ALIAS_CRYPTO("xchacha20");
|
||||
MODULE_ALIAS_CRYPTO("xchacha20-neon");
|
||||
MODULE_ALIAS_CRYPTO("xchacha12");
|
||||
MODULE_ALIAS_CRYPTO("xchacha12-neon");
|
||||
|
|
@ -1,460 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
/*
|
||||
* Copyright (C) 2018 Google, Inc.
|
||||
*/
|
||||
|
||||
#include <linux/linkage.h>
|
||||
#include <asm/assembler.h>
|
||||
|
||||
/*
|
||||
* Design notes:
|
||||
*
|
||||
* 16 registers would be needed to hold the state matrix, but only 14 are
|
||||
* available because 'sp' and 'pc' cannot be used. So we spill the elements
|
||||
* (x8, x9) to the stack and swap them out with (x10, x11). This adds one
|
||||
* 'ldrd' and one 'strd' instruction per round.
|
||||
*
|
||||
* All rotates are performed using the implicit rotate operand accepted by the
|
||||
* 'add' and 'eor' instructions. This is faster than using explicit rotate
|
||||
* instructions. To make this work, we allow the values in the second and last
|
||||
* rows of the ChaCha state matrix (rows 'b' and 'd') to temporarily have the
|
||||
* wrong rotation amount. The rotation amount is then fixed up just in time
|
||||
* when the values are used. 'brot' is the number of bits the values in row 'b'
|
||||
* need to be rotated right to arrive at the correct values, and 'drot'
|
||||
* similarly for row 'd'. (brot, drot) start out as (0, 0) but we make it such
|
||||
* that they end up as (25, 24) after every round.
|
||||
*/
|
||||
|
||||
// ChaCha state registers
|
||||
X0 .req r0
|
||||
X1 .req r1
|
||||
X2 .req r2
|
||||
X3 .req r3
|
||||
X4 .req r4
|
||||
X5 .req r5
|
||||
X6 .req r6
|
||||
X7 .req r7
|
||||
X8_X10 .req r8 // shared by x8 and x10
|
||||
X9_X11 .req r9 // shared by x9 and x11
|
||||
X12 .req r10
|
||||
X13 .req r11
|
||||
X14 .req r12
|
||||
X15 .req r14
|
||||
|
||||
.macro __rev out, in, t0, t1, t2
|
||||
.if __LINUX_ARM_ARCH__ >= 6
|
||||
rev \out, \in
|
||||
.else
|
||||
lsl \t0, \in, #24
|
||||
and \t1, \in, #0xff00
|
||||
and \t2, \in, #0xff0000
|
||||
orr \out, \t0, \in, lsr #24
|
||||
orr \out, \out, \t1, lsl #8
|
||||
orr \out, \out, \t2, lsr #8
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro _le32_bswap x, t0, t1, t2
|
||||
#ifdef __ARMEB__
|
||||
__rev \x, \x, \t0, \t1, \t2
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro _le32_bswap_4x a, b, c, d, t0, t1, t2
|
||||
_le32_bswap \a, \t0, \t1, \t2
|
||||
_le32_bswap \b, \t0, \t1, \t2
|
||||
_le32_bswap \c, \t0, \t1, \t2
|
||||
_le32_bswap \d, \t0, \t1, \t2
|
||||
.endm
|
||||
|
||||
.macro __ldrd a, b, src, offset
|
||||
#if __LINUX_ARM_ARCH__ >= 6
|
||||
ldrd \a, \b, [\src, #\offset]
|
||||
#else
|
||||
ldr \a, [\src, #\offset]
|
||||
ldr \b, [\src, #\offset + 4]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro __strd a, b, dst, offset
|
||||
#if __LINUX_ARM_ARCH__ >= 6
|
||||
strd \a, \b, [\dst, #\offset]
|
||||
#else
|
||||
str \a, [\dst, #\offset]
|
||||
str \b, [\dst, #\offset + 4]
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro _halfround a1, b1, c1, d1, a2, b2, c2, d2
|
||||
|
||||
// a += b; d ^= a; d = rol(d, 16);
|
||||
add \a1, \a1, \b1, ror #brot
|
||||
add \a2, \a2, \b2, ror #brot
|
||||
eor \d1, \a1, \d1, ror #drot
|
||||
eor \d2, \a2, \d2, ror #drot
|
||||
// drot == 32 - 16 == 16
|
||||
|
||||
// c += d; b ^= c; b = rol(b, 12);
|
||||
add \c1, \c1, \d1, ror #16
|
||||
add \c2, \c2, \d2, ror #16
|
||||
eor \b1, \c1, \b1, ror #brot
|
||||
eor \b2, \c2, \b2, ror #brot
|
||||
// brot == 32 - 12 == 20
|
||||
|
||||
// a += b; d ^= a; d = rol(d, 8);
|
||||
add \a1, \a1, \b1, ror #20
|
||||
add \a2, \a2, \b2, ror #20
|
||||
eor \d1, \a1, \d1, ror #16
|
||||
eor \d2, \a2, \d2, ror #16
|
||||
// drot == 32 - 8 == 24
|
||||
|
||||
// c += d; b ^= c; b = rol(b, 7);
|
||||
add \c1, \c1, \d1, ror #24
|
||||
add \c2, \c2, \d2, ror #24
|
||||
eor \b1, \c1, \b1, ror #20
|
||||
eor \b2, \c2, \b2, ror #20
|
||||
// brot == 32 - 7 == 25
|
||||
.endm
|
||||
|
||||
.macro _doubleround
|
||||
|
||||
// column round
|
||||
|
||||
// quarterrounds: (x0, x4, x8, x12) and (x1, x5, x9, x13)
|
||||
_halfround X0, X4, X8_X10, X12, X1, X5, X9_X11, X13
|
||||
|
||||
// save (x8, x9); restore (x10, x11)
|
||||
__strd X8_X10, X9_X11, sp, 0
|
||||
__ldrd X8_X10, X9_X11, sp, 8
|
||||
|
||||
// quarterrounds: (x2, x6, x10, x14) and (x3, x7, x11, x15)
|
||||
_halfround X2, X6, X8_X10, X14, X3, X7, X9_X11, X15
|
||||
|
||||
.set brot, 25
|
||||
.set drot, 24
|
||||
|
||||
// diagonal round
|
||||
|
||||
// quarterrounds: (x0, x5, x10, x15) and (x1, x6, x11, x12)
|
||||
_halfround X0, X5, X8_X10, X15, X1, X6, X9_X11, X12
|
||||
|
||||
// save (x10, x11); restore (x8, x9)
|
||||
__strd X8_X10, X9_X11, sp, 8
|
||||
__ldrd X8_X10, X9_X11, sp, 0
|
||||
|
||||
// quarterrounds: (x2, x7, x8, x13) and (x3, x4, x9, x14)
|
||||
_halfround X2, X7, X8_X10, X13, X3, X4, X9_X11, X14
|
||||
.endm
|
||||
|
||||
.macro _chacha_permute nrounds
|
||||
.set brot, 0
|
||||
.set drot, 0
|
||||
.rept \nrounds / 2
|
||||
_doubleround
|
||||
.endr
|
||||
.endm
|
||||
|
||||
.macro _chacha nrounds
|
||||
|
||||
.Lnext_block\@:
|
||||
// Stack: unused0-unused1 x10-x11 x0-x15 OUT IN LEN
|
||||
// Registers contain x0-x9,x12-x15.
|
||||
|
||||
// Do the core ChaCha permutation to update x0-x15.
|
||||
_chacha_permute \nrounds
|
||||
|
||||
add sp, #8
|
||||
// Stack: x10-x11 orig_x0-orig_x15 OUT IN LEN
|
||||
// Registers contain x0-x9,x12-x15.
|
||||
// x4-x7 are rotated by 'brot'; x12-x15 are rotated by 'drot'.
|
||||
|
||||
// Free up some registers (r8-r12,r14) by pushing (x8-x9,x12-x15).
|
||||
push {X8_X10, X9_X11, X12, X13, X14, X15}
|
||||
|
||||
// Load (OUT, IN, LEN).
|
||||
ldr r14, [sp, #96]
|
||||
ldr r12, [sp, #100]
|
||||
ldr r11, [sp, #104]
|
||||
|
||||
orr r10, r14, r12
|
||||
|
||||
// Use slow path if fewer than 64 bytes remain.
|
||||
cmp r11, #64
|
||||
blt .Lxor_slowpath\@
|
||||
|
||||
// Use slow path if IN and/or OUT isn't 4-byte aligned. Needed even on
|
||||
// ARMv6+, since ldmia and stmia (used below) still require alignment.
|
||||
tst r10, #3
|
||||
bne .Lxor_slowpath\@
|
||||
|
||||
// Fast path: XOR 64 bytes of aligned data.
|
||||
|
||||
// Stack: x8-x9 x12-x15 x10-x11 orig_x0-orig_x15 OUT IN LEN
|
||||
// Registers: r0-r7 are x0-x7; r8-r11 are free; r12 is IN; r14 is OUT.
|
||||
// x4-x7 are rotated by 'brot'; x12-x15 are rotated by 'drot'.
|
||||
|
||||
// x0-x3
|
||||
__ldrd r8, r9, sp, 32
|
||||
__ldrd r10, r11, sp, 40
|
||||
add X0, X0, r8
|
||||
add X1, X1, r9
|
||||
add X2, X2, r10
|
||||
add X3, X3, r11
|
||||
_le32_bswap_4x X0, X1, X2, X3, r8, r9, r10
|
||||
ldmia r12!, {r8-r11}
|
||||
eor X0, X0, r8
|
||||
eor X1, X1, r9
|
||||
eor X2, X2, r10
|
||||
eor X3, X3, r11
|
||||
stmia r14!, {X0-X3}
|
||||
|
||||
// x4-x7
|
||||
__ldrd r8, r9, sp, 48
|
||||
__ldrd r10, r11, sp, 56
|
||||
add X4, r8, X4, ror #brot
|
||||
add X5, r9, X5, ror #brot
|
||||
ldmia r12!, {X0-X3}
|
||||
add X6, r10, X6, ror #brot
|
||||
add X7, r11, X7, ror #brot
|
||||
_le32_bswap_4x X4, X5, X6, X7, r8, r9, r10
|
||||
eor X4, X4, X0
|
||||
eor X5, X5, X1
|
||||
eor X6, X6, X2
|
||||
eor X7, X7, X3
|
||||
stmia r14!, {X4-X7}
|
||||
|
||||
// x8-x15
|
||||
pop {r0-r7} // (x8-x9,x12-x15,x10-x11)
|
||||
__ldrd r8, r9, sp, 32
|
||||
__ldrd r10, r11, sp, 40
|
||||
add r0, r0, r8 // x8
|
||||
add r1, r1, r9 // x9
|
||||
add r6, r6, r10 // x10
|
||||
add r7, r7, r11 // x11
|
||||
_le32_bswap_4x r0, r1, r6, r7, r8, r9, r10
|
||||
ldmia r12!, {r8-r11}
|
||||
eor r0, r0, r8 // x8
|
||||
eor r1, r1, r9 // x9
|
||||
eor r6, r6, r10 // x10
|
||||
eor r7, r7, r11 // x11
|
||||
stmia r14!, {r0,r1,r6,r7}
|
||||
ldmia r12!, {r0,r1,r6,r7}
|
||||
__ldrd r8, r9, sp, 48
|
||||
__ldrd r10, r11, sp, 56
|
||||
add r2, r8, r2, ror #drot // x12
|
||||
add r3, r9, r3, ror #drot // x13
|
||||
add r4, r10, r4, ror #drot // x14
|
||||
add r5, r11, r5, ror #drot // x15
|
||||
_le32_bswap_4x r2, r3, r4, r5, r9, r10, r11
|
||||
ldr r9, [sp, #72] // load LEN
|
||||
eor r2, r2, r0 // x12
|
||||
eor r3, r3, r1 // x13
|
||||
eor r4, r4, r6 // x14
|
||||
eor r5, r5, r7 // x15
|
||||
subs r9, #64 // decrement and check LEN
|
||||
stmia r14!, {r2-r5}
|
||||
|
||||
beq .Ldone\@
|
||||
|
||||
.Lprepare_for_next_block\@:
|
||||
|
||||
// Stack: x0-x15 OUT IN LEN
|
||||
|
||||
// Increment block counter (x12)
|
||||
add r8, #1
|
||||
|
||||
// Store updated (OUT, IN, LEN)
|
||||
str r14, [sp, #64]
|
||||
str r12, [sp, #68]
|
||||
str r9, [sp, #72]
|
||||
|
||||
mov r14, sp
|
||||
|
||||
// Store updated block counter (x12)
|
||||
str r8, [sp, #48]
|
||||
|
||||
sub sp, #16
|
||||
|
||||
// Reload state and do next block
|
||||
ldmia r14!, {r0-r11} // load x0-x11
|
||||
__strd r10, r11, sp, 8 // store x10-x11 before state
|
||||
ldmia r14, {r10-r12,r14} // load x12-x15
|
||||
b .Lnext_block\@
|
||||
|
||||
.Lxor_slowpath\@:
|
||||
// Slow path: < 64 bytes remaining, or unaligned input or output buffer.
|
||||
// We handle it by storing the 64 bytes of keystream to the stack, then
|
||||
// XOR-ing the needed portion with the data.
|
||||
|
||||
// Allocate keystream buffer
|
||||
sub sp, #64
|
||||
mov r14, sp
|
||||
|
||||
// Stack: ks0-ks15 x8-x9 x12-x15 x10-x11 orig_x0-orig_x15 OUT IN LEN
|
||||
// Registers: r0-r7 are x0-x7; r8-r11 are free; r12 is IN; r14 is &ks0.
|
||||
// x4-x7 are rotated by 'brot'; x12-x15 are rotated by 'drot'.
|
||||
|
||||
// Save keystream for x0-x3
|
||||
__ldrd r8, r9, sp, 96
|
||||
__ldrd r10, r11, sp, 104
|
||||
add X0, X0, r8
|
||||
add X1, X1, r9
|
||||
add X2, X2, r10
|
||||
add X3, X3, r11
|
||||
_le32_bswap_4x X0, X1, X2, X3, r8, r9, r10
|
||||
stmia r14!, {X0-X3}
|
||||
|
||||
// Save keystream for x4-x7
|
||||
__ldrd r8, r9, sp, 112
|
||||
__ldrd r10, r11, sp, 120
|
||||
add X4, r8, X4, ror #brot
|
||||
add X5, r9, X5, ror #brot
|
||||
add X6, r10, X6, ror #brot
|
||||
add X7, r11, X7, ror #brot
|
||||
_le32_bswap_4x X4, X5, X6, X7, r8, r9, r10
|
||||
add r8, sp, #64
|
||||
stmia r14!, {X4-X7}
|
||||
|
||||
// Save keystream for x8-x15
|
||||
ldm r8, {r0-r7} // (x8-x9,x12-x15,x10-x11)
|
||||
__ldrd r8, r9, sp, 128
|
||||
__ldrd r10, r11, sp, 136
|
||||
add r0, r0, r8 // x8
|
||||
add r1, r1, r9 // x9
|
||||
add r6, r6, r10 // x10
|
||||
add r7, r7, r11 // x11
|
||||
_le32_bswap_4x r0, r1, r6, r7, r8, r9, r10
|
||||
stmia r14!, {r0,r1,r6,r7}
|
||||
__ldrd r8, r9, sp, 144
|
||||
__ldrd r10, r11, sp, 152
|
||||
add r2, r8, r2, ror #drot // x12
|
||||
add r3, r9, r3, ror #drot // x13
|
||||
add r4, r10, r4, ror #drot // x14
|
||||
add r5, r11, r5, ror #drot // x15
|
||||
_le32_bswap_4x r2, r3, r4, r5, r9, r10, r11
|
||||
stmia r14, {r2-r5}
|
||||
|
||||
// Stack: ks0-ks15 unused0-unused7 x0-x15 OUT IN LEN
|
||||
// Registers: r8 is block counter, r12 is IN.
|
||||
|
||||
ldr r9, [sp, #168] // LEN
|
||||
ldr r14, [sp, #160] // OUT
|
||||
cmp r9, #64
|
||||
mov r0, sp
|
||||
movle r1, r9
|
||||
movgt r1, #64
|
||||
// r1 is number of bytes to XOR, in range [1, 64]
|
||||
|
||||
.if __LINUX_ARM_ARCH__ < 6
|
||||
orr r2, r12, r14
|
||||
tst r2, #3 // IN or OUT misaligned?
|
||||
bne .Lxor_next_byte\@
|
||||
.endif
|
||||
|
||||
// XOR a word at a time
|
||||
.rept 16
|
||||
subs r1, #4
|
||||
blt .Lxor_words_done\@
|
||||
ldr r2, [r12], #4
|
||||
ldr r3, [r0], #4
|
||||
eor r2, r2, r3
|
||||
str r2, [r14], #4
|
||||
.endr
|
||||
b .Lxor_slowpath_done\@
|
||||
.Lxor_words_done\@:
|
||||
ands r1, r1, #3
|
||||
beq .Lxor_slowpath_done\@
|
||||
|
||||
// XOR a byte at a time
|
||||
.Lxor_next_byte\@:
|
||||
ldrb r2, [r12], #1
|
||||
ldrb r3, [r0], #1
|
||||
eor r2, r2, r3
|
||||
strb r2, [r14], #1
|
||||
subs r1, #1
|
||||
bne .Lxor_next_byte\@
|
||||
|
||||
.Lxor_slowpath_done\@:
|
||||
subs r9, #64
|
||||
add sp, #96
|
||||
bgt .Lprepare_for_next_block\@
|
||||
|
||||
.Ldone\@:
|
||||
.endm // _chacha
|
||||
|
||||
/*
|
||||
* void chacha_doarm(u8 *dst, const u8 *src, unsigned int bytes,
|
||||
* const u32 *state, int nrounds);
|
||||
*/
|
||||
ENTRY(chacha_doarm)
|
||||
cmp r2, #0 // len == 0?
|
||||
reteq lr
|
||||
|
||||
ldr ip, [sp]
|
||||
cmp ip, #12
|
||||
|
||||
push {r0-r2,r4-r11,lr}
|
||||
|
||||
// Push state x0-x15 onto stack.
|
||||
// Also store an extra copy of x10-x11 just before the state.
|
||||
|
||||
add X12, r3, #48
|
||||
ldm X12, {X12,X13,X14,X15}
|
||||
push {X12,X13,X14,X15}
|
||||
sub sp, sp, #64
|
||||
|
||||
__ldrd X8_X10, X9_X11, r3, 40
|
||||
__strd X8_X10, X9_X11, sp, 8
|
||||
__strd X8_X10, X9_X11, sp, 56
|
||||
ldm r3, {X0-X9_X11}
|
||||
__strd X0, X1, sp, 16
|
||||
__strd X2, X3, sp, 24
|
||||
__strd X4, X5, sp, 32
|
||||
__strd X6, X7, sp, 40
|
||||
__strd X8_X10, X9_X11, sp, 48
|
||||
|
||||
beq 1f
|
||||
_chacha 20
|
||||
|
||||
0: add sp, #76
|
||||
pop {r4-r11, pc}
|
||||
|
||||
1: _chacha 12
|
||||
b 0b
|
||||
ENDPROC(chacha_doarm)
|
||||
|
||||
/*
|
||||
* void hchacha_block_arm(const u32 state[16], u32 out[8], int nrounds);
|
||||
*/
|
||||
ENTRY(hchacha_block_arm)
|
||||
push {r1,r4-r11,lr}
|
||||
|
||||
cmp r2, #12 // ChaCha12 ?
|
||||
|
||||
mov r14, r0
|
||||
ldmia r14!, {r0-r11} // load x0-x11
|
||||
push {r10-r11} // store x10-x11 to stack
|
||||
ldm r14, {r10-r12,r14} // load x12-x15
|
||||
sub sp, #8
|
||||
|
||||
beq 1f
|
||||
_chacha_permute 20
|
||||
|
||||
// Skip over (unused0-unused1, x10-x11)
|
||||
0: add sp, #16
|
||||
|
||||
// Fix up rotations of x12-x15
|
||||
ror X12, X12, #drot
|
||||
ror X13, X13, #drot
|
||||
pop {r4} // load 'out'
|
||||
ror X14, X14, #drot
|
||||
ror X15, X15, #drot
|
||||
|
||||
// Store (x0-x3,x12-x15) to 'out'
|
||||
stm r4, {X0,X1,X2,X3,X12,X13,X14,X15}
|
||||
|
||||
pop {r4-r11,pc}
|
||||
|
||||
1: _chacha_permute 12
|
||||
b 0b
|
||||
ENDPROC(hchacha_block_arm)
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,136 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0 OR MIT
|
||||
/*
|
||||
* Copyright (C) 2015-2019 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
||||
*
|
||||
* Based on public domain code from Daniel J. Bernstein and Peter Schwabe. This
|
||||
* began from SUPERCOP's curve25519/neon2/scalarmult.s, but has subsequently been
|
||||
* manually reworked for use in kernel space.
|
||||
*/
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
#include <crypto/internal/kpp.h>
|
||||
#include <crypto/internal/simd.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <crypto/curve25519.h>
|
||||
|
||||
asmlinkage void curve25519_neon(u8 mypublic[CURVE25519_KEY_SIZE],
|
||||
const u8 secret[CURVE25519_KEY_SIZE],
|
||||
const u8 basepoint[CURVE25519_KEY_SIZE]);
|
||||
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
|
||||
|
||||
void curve25519_arch(u8 out[CURVE25519_KEY_SIZE],
|
||||
const u8 scalar[CURVE25519_KEY_SIZE],
|
||||
const u8 point[CURVE25519_KEY_SIZE])
|
||||
{
|
||||
if (static_branch_likely(&have_neon) && crypto_simd_usable()) {
|
||||
kernel_neon_begin();
|
||||
curve25519_neon(out, scalar, point);
|
||||
kernel_neon_end();
|
||||
} else {
|
||||
curve25519_generic(out, scalar, point);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(curve25519_arch);
|
||||
|
||||
void curve25519_base_arch(u8 pub[CURVE25519_KEY_SIZE],
|
||||
const u8 secret[CURVE25519_KEY_SIZE])
|
||||
{
|
||||
return curve25519_arch(pub, secret, curve25519_base_point);
|
||||
}
|
||||
EXPORT_SYMBOL(curve25519_base_arch);
|
||||
|
||||
static int curve25519_set_secret(struct crypto_kpp *tfm, const void *buf,
|
||||
unsigned int len)
|
||||
{
|
||||
u8 *secret = kpp_tfm_ctx(tfm);
|
||||
|
||||
if (!len)
|
||||
curve25519_generate_secret(secret);
|
||||
else if (len == CURVE25519_KEY_SIZE &&
|
||||
crypto_memneq(buf, curve25519_null_point, CURVE25519_KEY_SIZE))
|
||||
memcpy(secret, buf, CURVE25519_KEY_SIZE);
|
||||
else
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int curve25519_compute_value(struct kpp_request *req)
|
||||
{
|
||||
struct crypto_kpp *tfm = crypto_kpp_reqtfm(req);
|
||||
const u8 *secret = kpp_tfm_ctx(tfm);
|
||||
u8 public_key[CURVE25519_KEY_SIZE];
|
||||
u8 buf[CURVE25519_KEY_SIZE];
|
||||
int copied, nbytes;
|
||||
u8 const *bp;
|
||||
|
||||
if (req->src) {
|
||||
copied = sg_copy_to_buffer(req->src,
|
||||
sg_nents_for_len(req->src,
|
||||
CURVE25519_KEY_SIZE),
|
||||
public_key, CURVE25519_KEY_SIZE);
|
||||
if (copied != CURVE25519_KEY_SIZE)
|
||||
return -EINVAL;
|
||||
bp = public_key;
|
||||
} else {
|
||||
bp = curve25519_base_point;
|
||||
}
|
||||
|
||||
curve25519_arch(buf, secret, bp);
|
||||
|
||||
/* might want less than we've got */
|
||||
nbytes = min_t(size_t, CURVE25519_KEY_SIZE, req->dst_len);
|
||||
copied = sg_copy_from_buffer(req->dst, sg_nents_for_len(req->dst,
|
||||
nbytes),
|
||||
buf, nbytes);
|
||||
if (copied != nbytes)
|
||||
return -EINVAL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int curve25519_max_size(struct crypto_kpp *tfm)
|
||||
{
|
||||
return CURVE25519_KEY_SIZE;
|
||||
}
|
||||
|
||||
static struct kpp_alg curve25519_alg = {
|
||||
.base.cra_name = "curve25519",
|
||||
.base.cra_driver_name = "curve25519-neon",
|
||||
.base.cra_priority = 200,
|
||||
.base.cra_module = THIS_MODULE,
|
||||
.base.cra_ctxsize = CURVE25519_KEY_SIZE,
|
||||
|
||||
.set_secret = curve25519_set_secret,
|
||||
.generate_public_key = curve25519_compute_value,
|
||||
.compute_shared_secret = curve25519_compute_value,
|
||||
.max_size = curve25519_max_size,
|
||||
};
|
||||
|
||||
static int __init mod_init(void)
|
||||
{
|
||||
if (elf_hwcap & HWCAP_NEON) {
|
||||
static_branch_enable(&have_neon);
|
||||
return IS_REACHABLE(CONFIG_CRYPTO_KPP) ?
|
||||
crypto_register_kpp(&curve25519_alg) : 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void __exit mod_exit(void)
|
||||
{
|
||||
if (IS_REACHABLE(CONFIG_CRYPTO_KPP) && elf_hwcap & HWCAP_NEON)
|
||||
crypto_unregister_kpp(&curve25519_alg);
|
||||
}
|
||||
|
||||
module_init(mod_init);
|
||||
module_exit(mod_exit);
|
||||
|
||||
MODULE_ALIAS_CRYPTO("curve25519");
|
||||
MODULE_ALIAS_CRYPTO("curve25519-neon");
|
||||
MODULE_LICENSE("GPL v2");
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,273 +0,0 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
/*
|
||||
* OpenSSL/Cryptogams accelerated Poly1305 transform for ARM
|
||||
*
|
||||
* Copyright (C) 2019 Linaro Ltd. <ard.biesheuvel@linaro.org>
|
||||
*/
|
||||
|
||||
#include <asm/hwcap.h>
|
||||
#include <asm/neon.h>
|
||||
#include <asm/simd.h>
|
||||
#include <asm/unaligned.h>
|
||||
#include <crypto/algapi.h>
|
||||
#include <crypto/internal/hash.h>
|
||||
#include <crypto/internal/poly1305.h>
|
||||
#include <crypto/internal/simd.h>
|
||||
#include <linux/cpufeature.h>
|
||||
#include <linux/crypto.h>
|
||||
#include <linux/jump_label.h>
|
||||
#include <linux/module.h>
|
||||
|
||||
void poly1305_init_arm(void *state, const u8 *key);
|
||||
void poly1305_blocks_arm(void *state, const u8 *src, u32 len, u32 hibit);
|
||||
void poly1305_blocks_neon(void *state, const u8 *src, u32 len, u32 hibit);
|
||||
void poly1305_emit_arm(void *state, u8 *digest, const u32 *nonce);
|
||||
|
||||
void __weak poly1305_blocks_neon(void *state, const u8 *src, u32 len, u32 hibit)
|
||||
{
|
||||
}
|
||||
|
||||
static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon);
|
||||
|
||||
void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE])
|
||||
{
|
||||
poly1305_init_arm(&dctx->h, key);
|
||||
dctx->s[0] = get_unaligned_le32(key + 16);
|
||||
dctx->s[1] = get_unaligned_le32(key + 20);
|
||||
dctx->s[2] = get_unaligned_le32(key + 24);
|
||||
dctx->s[3] = get_unaligned_le32(key + 28);
|
||||
dctx->buflen = 0;
|
||||
}
|
||||
EXPORT_SYMBOL(poly1305_init_arch);
|
||||
|
||||
static int arm_poly1305_init(struct shash_desc *desc)
|
||||
{
|
||||
struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
dctx->buflen = 0;
|
||||
dctx->rset = 0;
|
||||
dctx->sset = false;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void arm_poly1305_blocks(struct poly1305_desc_ctx *dctx, const u8 *src,
|
||||
u32 len, u32 hibit, bool do_neon)
|
||||
{
|
||||
if (unlikely(!dctx->sset)) {
|
||||
if (!dctx->rset) {
|
||||
poly1305_init_arm(&dctx->h, src);
|
||||
src += POLY1305_BLOCK_SIZE;
|
||||
len -= POLY1305_BLOCK_SIZE;
|
||||
dctx->rset = 1;
|
||||
}
|
||||
if (len >= POLY1305_BLOCK_SIZE) {
|
||||
dctx->s[0] = get_unaligned_le32(src + 0);
|
||||
dctx->s[1] = get_unaligned_le32(src + 4);
|
||||
dctx->s[2] = get_unaligned_le32(src + 8);
|
||||
dctx->s[3] = get_unaligned_le32(src + 12);
|
||||
src += POLY1305_BLOCK_SIZE;
|
||||
len -= POLY1305_BLOCK_SIZE;
|
||||
dctx->sset = true;
|
||||
}
|
||||
if (len < POLY1305_BLOCK_SIZE)
|
||||
return;
|
||||
}
|
||||
|
||||
len &= ~(POLY1305_BLOCK_SIZE - 1);
|
||||
|
||||
if (static_branch_likely(&have_neon) && likely(do_neon))
|
||||
poly1305_blocks_neon(&dctx->h, src, len, hibit);
|
||||
else
|
||||
poly1305_blocks_arm(&dctx->h, src, len, hibit);
|
||||
}
|
||||
|
||||
static void arm_poly1305_do_update(struct poly1305_desc_ctx *dctx,
|
||||
const u8 *src, u32 len, bool do_neon)
|
||||
{
|
||||
if (unlikely(dctx->buflen)) {
|
||||
u32 bytes = min(len, POLY1305_BLOCK_SIZE - dctx->buflen);
|
||||
|
||||
memcpy(dctx->buf + dctx->buflen, src, bytes);
|
||||
src += bytes;
|
||||
len -= bytes;
|
||||
dctx->buflen += bytes;
|
||||
|
||||
if (dctx->buflen == POLY1305_BLOCK_SIZE) {
|
||||
arm_poly1305_blocks(dctx, dctx->buf,
|
||||
POLY1305_BLOCK_SIZE, 1, false);
|
||||
dctx->buflen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (likely(len >= POLY1305_BLOCK_SIZE)) {
|
||||
arm_poly1305_blocks(dctx, src, len, 1, do_neon);
|
||||
src += round_down(len, POLY1305_BLOCK_SIZE);
|
||||
len %= POLY1305_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
if (unlikely(len)) {
|
||||
dctx->buflen = len;
|
||||
memcpy(dctx->buf, src, len);
|
||||
}
|
||||
}
|
||||
|
||||
static int arm_poly1305_update(struct shash_desc *desc,
|
||||
const u8 *src, unsigned int srclen)
|
||||
{
|
||||
struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
arm_poly1305_do_update(dctx, src, srclen, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __maybe_unused arm_poly1305_update_neon(struct shash_desc *desc,
|
||||
const u8 *src,
|
||||
unsigned int srclen)
|
||||
{
|
||||
struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
bool do_neon = crypto_simd_usable() && srclen > 128;
|
||||
|
||||
if (static_branch_likely(&have_neon) && do_neon)
|
||||
kernel_neon_begin();
|
||||
arm_poly1305_do_update(dctx, src, srclen, do_neon);
|
||||
if (static_branch_likely(&have_neon) && do_neon)
|
||||
kernel_neon_end();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void poly1305_update_arch(struct poly1305_desc_ctx *dctx, const u8 *src,
|
||||
unsigned int nbytes)
|
||||
{
|
||||
bool do_neon = IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
|
||||
crypto_simd_usable();
|
||||
|
||||
if (unlikely(dctx->buflen)) {
|
||||
u32 bytes = min(nbytes, POLY1305_BLOCK_SIZE - dctx->buflen);
|
||||
|
||||
memcpy(dctx->buf + dctx->buflen, src, bytes);
|
||||
src += bytes;
|
||||
nbytes -= bytes;
|
||||
dctx->buflen += bytes;
|
||||
|
||||
if (dctx->buflen == POLY1305_BLOCK_SIZE) {
|
||||
poly1305_blocks_arm(&dctx->h, dctx->buf,
|
||||
POLY1305_BLOCK_SIZE, 1);
|
||||
dctx->buflen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (likely(nbytes >= POLY1305_BLOCK_SIZE)) {
|
||||
unsigned int len = round_down(nbytes, POLY1305_BLOCK_SIZE);
|
||||
|
||||
if (static_branch_likely(&have_neon) && do_neon) {
|
||||
do {
|
||||
unsigned int todo = min_t(unsigned int, len, SZ_4K);
|
||||
|
||||
kernel_neon_begin();
|
||||
poly1305_blocks_neon(&dctx->h, src, todo, 1);
|
||||
kernel_neon_end();
|
||||
|
||||
len -= todo;
|
||||
src += todo;
|
||||
} while (len);
|
||||
} else {
|
||||
poly1305_blocks_arm(&dctx->h, src, len, 1);
|
||||
src += len;
|
||||
}
|
||||
nbytes %= POLY1305_BLOCK_SIZE;
|
||||
}
|
||||
|
||||
if (unlikely(nbytes)) {
|
||||
dctx->buflen = nbytes;
|
||||
memcpy(dctx->buf, src, nbytes);
|
||||
}
|
||||
}
|
||||
EXPORT_SYMBOL(poly1305_update_arch);
|
||||
|
||||
void poly1305_final_arch(struct poly1305_desc_ctx *dctx, u8 *dst)
|
||||
{
|
||||
if (unlikely(dctx->buflen)) {
|
||||
dctx->buf[dctx->buflen++] = 1;
|
||||
memset(dctx->buf + dctx->buflen, 0,
|
||||
POLY1305_BLOCK_SIZE - dctx->buflen);
|
||||
poly1305_blocks_arm(&dctx->h, dctx->buf, POLY1305_BLOCK_SIZE, 0);
|
||||
}
|
||||
|
||||
poly1305_emit_arm(&dctx->h, dst, dctx->s);
|
||||
*dctx = (struct poly1305_desc_ctx){};
|
||||
}
|
||||
EXPORT_SYMBOL(poly1305_final_arch);
|
||||
|
||||
static int arm_poly1305_final(struct shash_desc *desc, u8 *dst)
|
||||
{
|
||||
struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc);
|
||||
|
||||
if (unlikely(!dctx->sset))
|
||||
return -ENOKEY;
|
||||
|
||||
poly1305_final_arch(dctx, dst);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct shash_alg arm_poly1305_algs[] = {{
|
||||
.init = arm_poly1305_init,
|
||||
.update = arm_poly1305_update,
|
||||
.final = arm_poly1305_final,
|
||||
.digestsize = POLY1305_DIGEST_SIZE,
|
||||
.descsize = sizeof(struct poly1305_desc_ctx),
|
||||
|
||||
.base.cra_name = "poly1305",
|
||||
.base.cra_driver_name = "poly1305-arm",
|
||||
.base.cra_priority = 150,
|
||||
.base.cra_blocksize = POLY1305_BLOCK_SIZE,
|
||||
.base.cra_module = THIS_MODULE,
|
||||
#ifdef CONFIG_KERNEL_MODE_NEON
|
||||
}, {
|
||||
.init = arm_poly1305_init,
|
||||
.update = arm_poly1305_update_neon,
|
||||
.final = arm_poly1305_final,
|
||||
.digestsize = POLY1305_DIGEST_SIZE,
|
||||
.descsize = sizeof(struct poly1305_desc_ctx),
|
||||
|
||||
.base.cra_name = "poly1305",
|
||||
.base.cra_driver_name = "poly1305-neon",
|
||||
.base.cra_priority = 200,
|
||||
.base.cra_blocksize = POLY1305_BLOCK_SIZE,
|
||||
.base.cra_module = THIS_MODULE,
|
||||
#endif
|
||||
}};
|
||||
|
||||
static int __init arm_poly1305_mod_init(void)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
|
||||
(elf_hwcap & HWCAP_NEON))
|
||||
static_branch_enable(&have_neon);
|
||||
else if (IS_REACHABLE(CONFIG_CRYPTO_HASH))
|
||||
/* register only the first entry */
|
||||
return crypto_register_shash(&arm_poly1305_algs[0]);
|
||||
|
||||
return IS_REACHABLE(CONFIG_CRYPTO_HASH) ?
|
||||
crypto_register_shashes(arm_poly1305_algs,
|
||||
ARRAY_SIZE(arm_poly1305_algs)) : 0;
|
||||
}
|
||||
|
||||
static void __exit arm_poly1305_mod_exit(void)
|
||||
{
|
||||
if (!IS_REACHABLE(CONFIG_CRYPTO_HASH))
|
||||
return;
|
||||
if (!static_branch_likely(&have_neon)) {
|
||||
crypto_unregister_shash(&arm_poly1305_algs[0]);
|
||||
return;
|
||||
}
|
||||
crypto_unregister_shashes(arm_poly1305_algs,
|
||||
ARRAY_SIZE(arm_poly1305_algs));
|
||||
}
|
||||
|
||||
module_init(arm_poly1305_mod_init);
|
||||
module_exit(arm_poly1305_mod_exit);
|
||||
|
||||
MODULE_LICENSE("GPL v2");
|
||||
MODULE_ALIAS_CRYPTO("poly1305");
|
||||
MODULE_ALIAS_CRYPTO("poly1305-arm");
|
||||
MODULE_ALIAS_CRYPTO("poly1305-neon");
|
||||
|
|
@ -15,6 +15,7 @@ generic-y += mmiowb.h
|
|||
generic-y += msi.h
|
||||
generic-y += parport.h
|
||||
generic-y += preempt.h
|
||||
generic-y += seccomp.h
|
||||
generic-y += serial.h
|
||||
generic-y += trace_clock.h
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef _ASM_SECCOMP_H
|
||||
#define _ASM_SECCOMP_H
|
||||
|
||||
#include <asm-generic/seccomp.h>
|
||||
|
||||
#define SECCOMP_ARCH_NATIVE AUDIT_ARCH_ARM
|
||||
#define SECCOMP_ARCH_NATIVE_NR NR_syscalls
|
||||
#define SECCOMP_ARCH_NATIVE_NAME "arm"
|
||||
|
||||
#endif /* _ASM_SECCOMP_H */
|
||||
|
|
@ -91,8 +91,7 @@ static int ftrace_modify_code(unsigned long pc, unsigned long old,
|
|||
}
|
||||
|
||||
if (validate) {
|
||||
if (copy_from_kernel_nofault(&replaced, (void *)pc,
|
||||
MCOUNT_INSN_SIZE))
|
||||
if (probe_kernel_read(&replaced, (void *)pc, MCOUNT_INSN_SIZE))
|
||||
return -EFAULT;
|
||||
|
||||
if (replaced != old)
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt)
|
|||
/* patch_text() only supports int-sized breakpoints */
|
||||
BUILD_BUG_ON(sizeof(int) != BREAK_INSTR_SIZE);
|
||||
|
||||
err = copy_from_kernel_nofault(bpt->saved_instr, (char *)bpt->bpt_addr,
|
||||
err = probe_kernel_read(bpt->saved_instr, (char *)bpt->bpt_addr,
|
||||
BREAK_INSTR_SIZE);
|
||||
if (err)
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -391,7 +391,7 @@ int is_valid_bugaddr(unsigned long pc)
|
|||
u32 insn = __opcode_to_mem_arm(BUG_INSTR_VALUE);
|
||||
#endif
|
||||
|
||||
if (get_kernel_nofault(bkpt, (unsigned *)pc))
|
||||
if (probe_kernel_address((unsigned *)pc, bkpt))
|
||||
return 0;
|
||||
|
||||
return bkpt == insn;
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@
|
|||
#define CLKDM_NO_AUTODEPS (1 << 4)
|
||||
#define CLKDM_ACTIVE_WITH_MPU (1 << 5)
|
||||
#define CLKDM_MISSING_IDLE_REPORTING (1 << 6)
|
||||
#define CLKDM_STANDBY_FORCE_WAKEUP BIT(7)
|
||||
|
||||
#define CLKDM_CAN_HWSUP (CLKDM_CAN_ENABLE_AUTO | CLKDM_CAN_DISABLE_AUTO)
|
||||
#define CLKDM_CAN_SWSUP (CLKDM_CAN_FORCE_SLEEP | CLKDM_CAN_FORCE_WAKEUP)
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ static struct clockdomain l4ls_am33xx_clkdm = {
|
|||
.pwrdm = { .name = "per_pwrdm" },
|
||||
.cm_inst = AM33XX_CM_PER_MOD,
|
||||
.clkdm_offs = AM33XX_CM_PER_L4LS_CLKSTCTRL_OFFSET,
|
||||
.flags = CLKDM_CAN_SWSUP | CLKDM_STANDBY_FORCE_WAKEUP,
|
||||
.flags = CLKDM_CAN_SWSUP,
|
||||
};
|
||||
|
||||
static struct clockdomain l3s_am33xx_clkdm = {
|
||||
|
|
|
|||
|
|
@ -28,9 +28,6 @@
|
|||
#include "cm-regbits-34xx.h"
|
||||
#include "cm-regbits-33xx.h"
|
||||
#include "prm33xx.h"
|
||||
#if IS_ENABLED(CONFIG_SUSPEND)
|
||||
#include <linux/suspend.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield:
|
||||
|
|
@ -339,17 +336,8 @@ static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm)
|
|||
{
|
||||
bool hwsup = false;
|
||||
|
||||
#if IS_ENABLED(CONFIG_SUSPEND)
|
||||
/*
|
||||
* In case of standby, Don't put the l4ls clk domain to sleep.
|
||||
* Since CM3 PM FW doesn't wake-up/enable the l4ls clk domain
|
||||
* upon wake-up, CM3 PM FW fails to wake-up th MPU.
|
||||
*/
|
||||
if (pm_suspend_target_state == PM_SUSPEND_STANDBY &&
|
||||
(clkdm->flags & CLKDM_STANDBY_FORCE_WAKEUP))
|
||||
return 0;
|
||||
#endif
|
||||
hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
|
||||
|
||||
if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP))
|
||||
am33xx_clkdm_sleep(clkdm);
|
||||
|
||||
|
|
|
|||
|
|
@ -279,6 +279,11 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
|
|||
}
|
||||
|
||||
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
|
||||
if (rockchip_smp_prepare_sram(node)) {
|
||||
of_node_put(node);
|
||||
return;
|
||||
}
|
||||
|
||||
/* enable the SCU power domain */
|
||||
pmu_set_power_domain(PMU_PWRDN_SCU, true);
|
||||
|
||||
|
|
@ -311,19 +316,11 @@ static void __init rockchip_smp_prepare_cpus(unsigned int max_cpus)
|
|||
asm ("mrc p15, 1, %0, c9, c0, 2\n" : "=r" (l2ctlr));
|
||||
ncores = ((l2ctlr >> 24) & 0x3) + 1;
|
||||
}
|
||||
of_node_put(node);
|
||||
|
||||
/* Make sure that all cores except the first are really off */
|
||||
for (i = 1; i < ncores; i++)
|
||||
pmu_set_power_domain(0 + i, false);
|
||||
|
||||
if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A9) {
|
||||
if (rockchip_smp_prepare_sram(node)) {
|
||||
of_node_put(node);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
of_node_put(node);
|
||||
}
|
||||
|
||||
static void __init rk3036_smp_prepare_cpus(unsigned int max_cpus)
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ ENDPROC(shmobile_smp_sleep)
|
|||
.long shmobile_smp_arg - 1b
|
||||
|
||||
.bss
|
||||
.align 2
|
||||
.globl shmobile_smp_mpidr
|
||||
shmobile_smp_mpidr:
|
||||
.space NR_CPUS * 4
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static void __init tegra_cpu_reset_handler_enable(void)
|
|||
BUG_ON(is_enabled);
|
||||
BUG_ON(tegra_cpu_reset_handler_size > TEGRA_IRAM_RESET_HANDLER_SIZE);
|
||||
|
||||
memcpy_toio(iram_base, (void *)__tegra_cpu_reset_handler_start,
|
||||
memcpy(iram_base, (void *)__tegra_cpu_reset_handler_start,
|
||||
tegra_cpu_reset_handler_size);
|
||||
|
||||
err = call_firmware_op(set_cpu_boot_addr, 0, reset_address);
|
||||
|
|
|
|||
|
|
@ -774,7 +774,7 @@ static int alignment_get_arm(struct pt_regs *regs, u32 *ip, u32 *inst)
|
|||
if (user_mode(regs))
|
||||
fault = get_user(instr, ip);
|
||||
else
|
||||
fault = get_kernel_nofault(instr, ip);
|
||||
fault = probe_kernel_address(ip, instr);
|
||||
|
||||
*inst = __mem_to_opcode_arm(instr);
|
||||
|
||||
|
|
@ -789,7 +789,7 @@ static int alignment_get_thumb(struct pt_regs *regs, u16 *ip, u16 *inst)
|
|||
if (user_mode(regs))
|
||||
fault = get_user(instr, ip);
|
||||
else
|
||||
fault = get_kernel_nofault(instr, ip);
|
||||
fault = probe_kernel_address(ip, instr);
|
||||
|
||||
*inst = __mem_to_opcode_thumb16(instr);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,6 @@
|
|||
|
||||
#ifdef CONFIG_MMU
|
||||
|
||||
bool copy_from_kernel_nofault_allowed(const void *unsafe_src, size_t size)
|
||||
{
|
||||
unsigned long addr = (unsigned long)unsafe_src;
|
||||
|
||||
return addr >= TASK_SIZE && ULONG_MAX - addr >= size;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is useful to dump out the page tables associated with
|
||||
* 'addr' in mm 'mm'.
|
||||
|
|
@ -248,7 +241,7 @@ do_page_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
|
|||
struct mm_struct *mm;
|
||||
int sig, code;
|
||||
vm_fault_t fault;
|
||||
unsigned int flags = FAULT_FLAG_DEFAULT;
|
||||
unsigned int flags = FAULT_FLAG_ALLOW_RETRY | FAULT_FLAG_KILLABLE;
|
||||
|
||||
if (kprobe_page_fault(regs, fsr))
|
||||
return 0;
|
||||
|
|
@ -302,7 +295,7 @@ retry:
|
|||
* signal first. We do not need to release the mmap_sem because
|
||||
* it would already be released in __lock_page_or_retry in
|
||||
* mm/filemap.c. */
|
||||
if (fault_signal_pending(fault, regs)) {
|
||||
if ((fault & VM_FAULT_RETRY) && fatal_signal_pending(current)) {
|
||||
if (!user_mode(regs))
|
||||
goto no_context;
|
||||
return 0;
|
||||
|
|
@ -326,6 +319,9 @@ retry:
|
|||
regs, addr);
|
||||
}
|
||||
if (fault & VM_FAULT_RETRY) {
|
||||
/* Clear FAULT_FLAG_ALLOW_RETRY to avoid any risk
|
||||
* of starvation. */
|
||||
flags &= ~FAULT_FLAG_ALLOW_RETRY;
|
||||
flags |= FAULT_FLAG_TRIED;
|
||||
goto retry;
|
||||
}
|
||||
|
|
@ -567,7 +563,6 @@ do_PrefetchAbort(unsigned long addr, unsigned int ifsr, struct pt_regs *regs)
|
|||
if (!inf->fn(addr, ifsr | FSR_LNX_PF, regs))
|
||||
return;
|
||||
|
||||
pr_alert("8<--- cut here ---\n");
|
||||
pr_alert("Unhandled prefetch abort: %s (0x%03x) at 0x%08lx\n",
|
||||
inf->name, ifsr, addr);
|
||||
|
||||
|
|
|
|||
|
|
@ -512,5 +512,7 @@ void __init early_ioremap_init(void)
|
|||
bool arch_memremap_can_ram_remap(resource_size_t offset, size_t size,
|
||||
unsigned long flags)
|
||||
{
|
||||
return memblock_is_map_memory(offset);
|
||||
unsigned long pfn = PHYS_PFN(offset);
|
||||
|
||||
return memblock_is_map_memory(pfn);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -449,9 +449,8 @@
|
|||
433 common fspick sys_fspick
|
||||
434 common pidfd_open sys_pidfd_open
|
||||
435 common clone3 sys_clone3
|
||||
436 common close_range sys_close_range
|
||||
# 436 reserved for close_range
|
||||
# 437 reserved for openat2
|
||||
# 438 reserved for pidfd_getfd
|
||||
# 439 reserved for faccessat2
|
||||
440 common process_madvise sys_process_madvise
|
||||
441 common epoll_pwait2 sys_epoll_pwait2
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ config ARM64
|
|||
select ARCH_HAS_KCOV
|
||||
select ARCH_HAS_KEEPINITRD
|
||||
select ARCH_HAS_MEMBARRIER_SYNC_CORE
|
||||
select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE
|
||||
select ARCH_HAS_PTE_DEVMAP
|
||||
select ARCH_HAS_PTE_SPECIAL
|
||||
select ARCH_HAS_SETUP_DMA_OPS
|
||||
|
|
@ -74,7 +73,6 @@ config ARM64
|
|||
select ARCH_SUPPORTS_INT128 if GCC_VERSION >= 50000 || CC_IS_CLANG
|
||||
select ARCH_SUPPORTS_NUMA_BALANCING
|
||||
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION if COMPAT
|
||||
select ARCH_WANT_DEFAULT_BPF_JIT
|
||||
select ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
|
||||
select ARCH_WANT_FRAME_POINTERS
|
||||
select ARCH_WANT_HUGE_PMD_SHARE if ARM64_4K_PAGES || (ARM64_16K_PAGES && !ARM64_VA_BITS_36)
|
||||
|
|
@ -117,8 +115,6 @@ config ARM64
|
|||
select GENERIC_GETTIMEOFDAY
|
||||
select HANDLE_DOMAIN_IRQ
|
||||
select HARDIRQS_SW_RESEND
|
||||
select HAVE_MOVE_PMD
|
||||
select HAVE_MOVE_PUD
|
||||
select HAVE_PCI
|
||||
select HAVE_ACPI_APEI if (ACPI && EFI)
|
||||
select HAVE_ALIGNED_STRUCT_PAGE if SLUB
|
||||
|
|
@ -129,7 +125,6 @@ config ARM64
|
|||
select HAVE_ARCH_JUMP_LABEL_RELATIVE
|
||||
select HAVE_ARCH_KASAN if !(ARM64_16K_PAGES && ARM64_VA_BITS_48)
|
||||
select HAVE_ARCH_KASAN_SW_TAGS if HAVE_ARCH_KASAN
|
||||
select HAVE_ARCH_KFENCE
|
||||
select HAVE_ARCH_KGDB
|
||||
select HAVE_ARCH_MMAP_RND_BITS
|
||||
select HAVE_ARCH_MMAP_RND_COMPAT_BITS if COMPAT
|
||||
|
|
@ -193,7 +188,7 @@ config ARM64
|
|||
select SWIOTLB
|
||||
select SYSCTL_EXCEPTION_TRACE
|
||||
select THREAD_INFO_IN_TASK
|
||||
select HAVE_ARCH_USERFAULTFD_MINOR if USERFAULTFD
|
||||
select ARCH_SUPPORTS_SPECULATIVE_PAGE_FAULT
|
||||
help
|
||||
ARM 64-bit (AArch64) Linux support.
|
||||
|
||||
|
|
@ -646,7 +641,6 @@ config ARM64_ERRATUM_3194386
|
|||
* ARM Neoverse-V1 erratum 3324341
|
||||
* ARM Neoverse V2 erratum 3324336
|
||||
* ARM Neoverse-V3 erratum 3312417
|
||||
* ARM Neoverse-V3AE erratum 3312417
|
||||
|
||||
On affected cores "MSR SSBS, #0" instructions may not affect
|
||||
subsequent speculative instructions, which may permit unexepected
|
||||
|
|
@ -1749,7 +1743,7 @@ config RANDOMIZE_MODULE_REGION_FULL
|
|||
core kernel, so branch relocations are always in range.
|
||||
|
||||
config CC_HAVE_STACKPROTECTOR_SYSREG
|
||||
def_bool CC_IS_GCC && $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
|
||||
def_bool $(cc-option,-mstack-protector-guard=sysreg -mstack-protector-guard-reg=sp_el0 -mstack-protector-guard-offset=0)
|
||||
|
||||
config STACKPROTECTOR_PER_TASK
|
||||
def_bool y
|
||||
|
|
@ -1922,109 +1916,3 @@ source "arch/arm64/kvm/Kconfig"
|
|||
if CRYPTO
|
||||
source "arch/arm64/crypto/Kconfig"
|
||||
endif
|
||||
|
||||
config AF_NOISE_ELIMINATION
|
||||
bool "For elimnating AF resonance noise"
|
||||
default n
|
||||
help
|
||||
Enable it only for produts that suffering AF resonance noise.
|
||||
|
||||
config AW882XX_PARAMS_FROM_BIN
|
||||
bool "params is stored in bin file"
|
||||
default n
|
||||
help
|
||||
Enable it only for params of smartPA is stored in bin file.
|
||||
|
||||
config AW882XX_STEREO_SMARTPA
|
||||
bool "aw dual smart pa"
|
||||
default n
|
||||
help
|
||||
Enable it only for dual smart pa.
|
||||
|
||||
config AW882XX_MAPSIZE_16K
|
||||
bool "aw afe mapsize 16k"
|
||||
default n
|
||||
help
|
||||
Enable it only for use 16k mapsize.
|
||||
|
||||
config AW882XX_STEREO_SMARTPA_PRI
|
||||
bool "aw dual smart pa pri i2s"
|
||||
default n
|
||||
help
|
||||
Enable it only for dual smart pa.
|
||||
|
||||
config SND_SOC_AW87XXX
|
||||
tristate "SoC Audio for awinic AW87XXX Smart K PA"
|
||||
depends on I2C
|
||||
help
|
||||
This option enables support for AW87XXX Smart K PA.
|
||||
|
||||
config SND_SOC_FS1815
|
||||
tristate "SoC Audio for fs1815 Smart K PA"
|
||||
depends on I2C
|
||||
help
|
||||
This option enables support for fs1815 K PA.
|
||||
|
||||
config SND_SOC_AW8838
|
||||
bool "aw8838 for hac"
|
||||
default n
|
||||
help
|
||||
Enable it only for hac on.
|
||||
|
||||
config CAMERA_FLASH_PWM
|
||||
bool "control flash"
|
||||
default n
|
||||
help
|
||||
Enable it only for produts that control flash.
|
||||
|
||||
config CAMERA_DISABLE_VSYNC_IRQ
|
||||
bool "For cam disable vsync irq"
|
||||
default n
|
||||
help
|
||||
Enable it to disable cam vsync irq.
|
||||
|
||||
config CAM_SENSOR_PROBE_RETRY
|
||||
bool "For sensor probe fail"
|
||||
default n
|
||||
help
|
||||
Add retries for sensor id matching
|
||||
|
||||
config CAMERA_CCI_MASTER_CHANGE
|
||||
bool "For cam cci master chance"
|
||||
default y
|
||||
help
|
||||
Enable it to switch cci master i2c address.
|
||||
|
||||
config CAMERA_CCI_ADDR_SWITCH
|
||||
bool "For cam switch i2c address"
|
||||
default n
|
||||
help
|
||||
Enable it to switch i2c address.
|
||||
|
||||
config CAMERA_FLASH_IIC_COMPATIBLE
|
||||
bool "auto select iic flash suppliers"
|
||||
default n
|
||||
help
|
||||
Enable it, this is automatically selected flash supplers.
|
||||
|
||||
config MOT_DONGWOON_OIS_AF_DRIFT
|
||||
bool "dongwoon ois af drift"
|
||||
default n
|
||||
help
|
||||
Enable it will support dongwoon ois af drift.
|
||||
|
||||
config MOT_SENSOR_PRE_POWERUP
|
||||
bool "For sensor power up and initialization early"
|
||||
default n
|
||||
help
|
||||
Enable it to power up and initialise early.
|
||||
|
||||
config MOT_SECURE_CAMERA
|
||||
bool "For switch secure mode successfully"
|
||||
default n
|
||||
help
|
||||
Enable it to fix switch secure mode error.
|
||||
|
||||
config MOT_USB_DEBUG_LOG
|
||||
bool "For usb debug log in factiry SW"
|
||||
default n
|
||||
|
|
|
|||
|
|
@ -303,10 +303,11 @@
|
|||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
|
||||
regulators {
|
||||
mt6397regulator: mt6397regulator {
|
||||
compatible = "mediatek,mt6397-regulator";
|
||||
|
||||
mt6397_vpca15_reg: buck_vpca15 {
|
||||
regulator-compatible = "buck_vpca15";
|
||||
regulator-name = "vpca15";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -315,6 +316,7 @@
|
|||
};
|
||||
|
||||
mt6397_vpca7_reg: buck_vpca7 {
|
||||
regulator-compatible = "buck_vpca7";
|
||||
regulator-name = "vpca7";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -323,6 +325,7 @@
|
|||
};
|
||||
|
||||
mt6397_vsramca15_reg: buck_vsramca15 {
|
||||
regulator-compatible = "buck_vsramca15";
|
||||
regulator-name = "vsramca15";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -331,6 +334,7 @@
|
|||
};
|
||||
|
||||
mt6397_vsramca7_reg: buck_vsramca7 {
|
||||
regulator-compatible = "buck_vsramca7";
|
||||
regulator-name = "vsramca7";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -339,6 +343,7 @@
|
|||
};
|
||||
|
||||
mt6397_vcore_reg: buck_vcore {
|
||||
regulator-compatible = "buck_vcore";
|
||||
regulator-name = "vcore";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -347,6 +352,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgpu_reg: buck_vgpu {
|
||||
regulator-compatible = "buck_vgpu";
|
||||
regulator-name = "vgpu";
|
||||
regulator-min-microvolt = < 700000>;
|
||||
regulator-max-microvolt = <1350000>;
|
||||
|
|
@ -355,6 +361,7 @@
|
|||
};
|
||||
|
||||
mt6397_vdrm_reg: buck_vdrm {
|
||||
regulator-compatible = "buck_vdrm";
|
||||
regulator-name = "vdrm";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <1400000>;
|
||||
|
|
@ -363,6 +370,7 @@
|
|||
};
|
||||
|
||||
mt6397_vio18_reg: buck_vio18 {
|
||||
regulator-compatible = "buck_vio18";
|
||||
regulator-name = "vio18";
|
||||
regulator-min-microvolt = <1620000>;
|
||||
regulator-max-microvolt = <1980000>;
|
||||
|
|
@ -371,16 +379,19 @@
|
|||
};
|
||||
|
||||
mt6397_vtcxo_reg: ldo_vtcxo {
|
||||
regulator-compatible = "ldo_vtcxo";
|
||||
regulator-name = "vtcxo";
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
mt6397_va28_reg: ldo_va28 {
|
||||
regulator-compatible = "ldo_va28";
|
||||
regulator-name = "va28";
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
mt6397_vcama_reg: ldo_vcama {
|
||||
regulator-compatible = "ldo_vcama";
|
||||
regulator-name = "vcama";
|
||||
regulator-min-microvolt = <1500000>;
|
||||
regulator-max-microvolt = <2800000>;
|
||||
|
|
@ -388,15 +399,18 @@
|
|||
};
|
||||
|
||||
mt6397_vio28_reg: ldo_vio28 {
|
||||
regulator-compatible = "ldo_vio28";
|
||||
regulator-name = "vio28";
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
mt6397_vusb_reg: ldo_vusb {
|
||||
regulator-compatible = "ldo_vusb";
|
||||
regulator-name = "vusb";
|
||||
};
|
||||
|
||||
mt6397_vmc_reg: ldo_vmc {
|
||||
regulator-compatible = "ldo_vmc";
|
||||
regulator-name = "vmc";
|
||||
regulator-min-microvolt = <1800000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -404,6 +418,7 @@
|
|||
};
|
||||
|
||||
mt6397_vmch_reg: ldo_vmch {
|
||||
regulator-compatible = "ldo_vmch";
|
||||
regulator-name = "vmch";
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -411,6 +426,7 @@
|
|||
};
|
||||
|
||||
mt6397_vemc_3v3_reg: ldo_vemc3v3 {
|
||||
regulator-compatible = "ldo_vemc3v3";
|
||||
regulator-name = "vemc_3v3";
|
||||
regulator-min-microvolt = <3000000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -418,6 +434,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp1_reg: ldo_vgp1 {
|
||||
regulator-compatible = "ldo_vgp1";
|
||||
regulator-name = "vcamd";
|
||||
regulator-min-microvolt = <1220000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -425,6 +442,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp2_reg: ldo_vgp2 {
|
||||
regulator-compatible = "ldo_vgp2";
|
||||
regulator-name = "vcamio";
|
||||
regulator-min-microvolt = <1000000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -432,6 +450,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp3_reg: ldo_vgp3 {
|
||||
regulator-compatible = "ldo_vgp3";
|
||||
regulator-name = "vcamaf";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -439,6 +458,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp4_reg: ldo_vgp4 {
|
||||
regulator-compatible = "ldo_vgp4";
|
||||
regulator-name = "vgp4";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -446,6 +466,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp5_reg: ldo_vgp5 {
|
||||
regulator-compatible = "ldo_vgp5";
|
||||
regulator-name = "vgp5";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <3000000>;
|
||||
|
|
@ -453,6 +474,7 @@
|
|||
};
|
||||
|
||||
mt6397_vgp6_reg: ldo_vgp6 {
|
||||
regulator-compatible = "ldo_vgp6";
|
||||
regulator-name = "vgp6";
|
||||
regulator-min-microvolt = <1200000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
@ -460,6 +482,7 @@
|
|||
};
|
||||
|
||||
mt6397_vibr_reg: ldo_vibr {
|
||||
regulator-compatible = "ldo_vibr";
|
||||
regulator-name = "vibr";
|
||||
regulator-min-microvolt = <1300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
|
|
|
|||
|
|
@ -1161,7 +1161,8 @@
|
|||
};
|
||||
|
||||
pwm0: pwm@1401e000 {
|
||||
compatible = "mediatek,mt8173-disp-pwm";
|
||||
compatible = "mediatek,mt8173-disp-pwm",
|
||||
"mediatek,mt6595-disp-pwm";
|
||||
reg = <0 0x1401e000 0 0x1000>;
|
||||
#pwm-cells = <2>;
|
||||
clocks = <&mmsys CLK_MM_DISP_PWM026M>,
|
||||
|
|
@ -1171,7 +1172,8 @@
|
|||
};
|
||||
|
||||
pwm1: pwm@1401f000 {
|
||||
compatible = "mediatek,mt8173-disp-pwm";
|
||||
compatible = "mediatek,mt8173-disp-pwm",
|
||||
"mediatek,mt6595-disp-pwm";
|
||||
reg = <0 0x1401f000 0 0x1000>;
|
||||
#pwm-cells = <2>;
|
||||
clocks = <&mmsys CLK_MM_DISP_PWM126M>,
|
||||
|
|
|
|||
|
|
@ -1599,8 +1599,6 @@
|
|||
hexagon_smp2p_in: slave-kernel {
|
||||
qcom,entry-name = "slave-kernel";
|
||||
|
||||
resets = <&gcc GCC_MDSS_BCR>;
|
||||
|
||||
interrupt-controller;
|
||||
#interrupt-cells = <2>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -219,14 +219,12 @@
|
|||
<&cru HCLK_OTG>,
|
||||
<&cru SCLK_OTG_ADP>;
|
||||
pm_qos = <&qos_usb_host>, <&qos_usb_otg>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_SDCARD {
|
||||
reg = <PX30_PD_SDCARD>;
|
||||
clocks = <&cru HCLK_SDMMC>,
|
||||
<&cru SCLK_SDMMC>;
|
||||
pm_qos = <&qos_sdmmc>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_GMAC {
|
||||
reg = <PX30_PD_GMAC>;
|
||||
|
|
@ -235,7 +233,6 @@
|
|||
<&cru SCLK_MAC_REF>,
|
||||
<&cru SCLK_GMAC_RX_TX>;
|
||||
pm_qos = <&qos_gmac>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_MMC_NAND {
|
||||
reg = <PX30_PD_MMC_NAND>;
|
||||
|
|
@ -249,7 +246,6 @@
|
|||
<&cru SCLK_SFC>;
|
||||
pm_qos = <&qos_emmc>, <&qos_nand>,
|
||||
<&qos_sdio>, <&qos_sfc>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_VPU {
|
||||
reg = <PX30_PD_VPU>;
|
||||
|
|
@ -257,7 +253,6 @@
|
|||
<&cru HCLK_VPU>,
|
||||
<&cru SCLK_CORE_VPU>;
|
||||
pm_qos = <&qos_vpu>, <&qos_vpu_r128>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_VO {
|
||||
reg = <PX30_PD_VO>;
|
||||
|
|
@ -274,7 +269,6 @@
|
|||
<&cru SCLK_VOPB_PWM>;
|
||||
pm_qos = <&qos_rga_rd>, <&qos_rga_wr>,
|
||||
<&qos_vop_m0>, <&qos_vop_m1>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_VI {
|
||||
reg = <PX30_PD_VI>;
|
||||
|
|
@ -286,13 +280,11 @@
|
|||
pm_qos = <&qos_isp_128>, <&qos_isp_rd>,
|
||||
<&qos_isp_wr>, <&qos_isp_m1>,
|
||||
<&qos_vip>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@PX30_PD_GPU {
|
||||
reg = <PX30_PD_GPU>;
|
||||
clocks = <&cru SCLK_GPU>;
|
||||
pm_qos = <&qos_gpu>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
@ -839,7 +831,7 @@
|
|||
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "vopb_mmu";
|
||||
clocks = <&cru ACLK_VOPB>, <&cru HCLK_VOPB>;
|
||||
clock-names = "aclk", "iface";
|
||||
clock-names = "aclk", "hclk";
|
||||
power-domains = <&power PX30_PD_VO>;
|
||||
#iommu-cells = <0>;
|
||||
status = "disabled";
|
||||
|
|
@ -871,7 +863,7 @@
|
|||
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
|
||||
interrupt-names = "vopl_mmu";
|
||||
clocks = <&cru ACLK_VOPL>, <&cru HCLK_VOPL>;
|
||||
clock-names = "aclk", "iface";
|
||||
clock-names = "aclk", "hclk";
|
||||
power-domains = <&power PX30_PD_VO>;
|
||||
#iommu-cells = <0>;
|
||||
status = "disabled";
|
||||
|
|
|
|||
|
|
@ -272,17 +272,13 @@
|
|||
|
||||
power-domain@RK3328_PD_HEVC {
|
||||
reg = <RK3328_PD_HEVC>;
|
||||
clocks = <&cru SCLK_VENC_CORE>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@RK3328_PD_VIDEO {
|
||||
reg = <RK3328_PD_VIDEO>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
power-domain@RK3328_PD_VPU {
|
||||
reg = <RK3328_PD_VPU>;
|
||||
clocks = <&cru ACLK_VPU>, <&cru HCLK_VPU>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -246,6 +246,14 @@
|
|||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host0_ehci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb_host0_ohci {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&vopb {
|
||||
status = "okay";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@
|
|||
snps,reset-active-low;
|
||||
snps,reset-delays-us = <0 10000 50000>;
|
||||
tx_delay = <0x10>;
|
||||
rx_delay = <0x23>;
|
||||
rx_delay = <0x10>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1001,7 +1001,6 @@
|
|||
clocks = <&cru ACLK_IEP>,
|
||||
<&cru HCLK_IEP>;
|
||||
pm_qos = <&qos_iep>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_rga@RK3399_PD_RGA {
|
||||
reg = <RK3399_PD_RGA>;
|
||||
|
|
@ -1009,14 +1008,12 @@
|
|||
<&cru HCLK_RGA>;
|
||||
pm_qos = <&qos_rga_r>,
|
||||
<&qos_rga_w>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_vcodec@RK3399_PD_VCODEC {
|
||||
reg = <RK3399_PD_VCODEC>;
|
||||
clocks = <&cru ACLK_VCODEC>,
|
||||
<&cru HCLK_VCODEC>;
|
||||
pm_qos = <&qos_video_m0>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_vdu@RK3399_PD_VDU {
|
||||
reg = <RK3399_PD_VDU>;
|
||||
|
|
@ -1024,7 +1021,6 @@
|
|||
<&cru HCLK_VDU>;
|
||||
pm_qos = <&qos_video_m1_r>,
|
||||
<&qos_video_m1_w>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
|
||||
/* These power domains are grouped by VD_GPU */
|
||||
|
|
@ -1032,63 +1028,43 @@
|
|||
reg = <RK3399_PD_GPU>;
|
||||
clocks = <&cru ACLK_GPU>;
|
||||
pm_qos = <&qos_gpu>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
|
||||
/* These power domains are grouped by VD_LOGIC */
|
||||
pd_edp@RK3399_PD_EDP {
|
||||
reg = <RK3399_PD_EDP>;
|
||||
clocks = <&cru PCLK_EDP_CTRL>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_emmc@RK3399_PD_EMMC {
|
||||
reg = <RK3399_PD_EMMC>;
|
||||
clocks = <&cru ACLK_EMMC>;
|
||||
pm_qos = <&qos_emmc>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_gmac@RK3399_PD_GMAC {
|
||||
reg = <RK3399_PD_GMAC>;
|
||||
clocks = <&cru ACLK_GMAC>,
|
||||
<&cru PCLK_GMAC>;
|
||||
pm_qos = <&qos_gmac>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_sd@RK3399_PD_SD {
|
||||
reg = <RK3399_PD_SD>;
|
||||
clocks = <&cru HCLK_SDMMC>,
|
||||
<&cru SCLK_SDMMC>;
|
||||
pm_qos = <&qos_sd>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_sdioaudio@RK3399_PD_SDIOAUDIO {
|
||||
reg = <RK3399_PD_SDIOAUDIO>;
|
||||
clocks = <&cru HCLK_SDIO>;
|
||||
pm_qos = <&qos_sdioaudio>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_tcpc0@RK3399_PD_TCPD0 {
|
||||
reg = <RK3399_PD_TCPD0>;
|
||||
clocks = <&cru SCLK_UPHY0_TCPDCORE>,
|
||||
<&cru SCLK_UPHY0_TCPDPHY_REF>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_tcpc1@RK3399_PD_TCPD1 {
|
||||
reg = <RK3399_PD_TCPD1>;
|
||||
clocks = <&cru SCLK_UPHY1_TCPDCORE>,
|
||||
<&cru SCLK_UPHY1_TCPDPHY_REF>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_usb3@RK3399_PD_USB3 {
|
||||
reg = <RK3399_PD_USB3>;
|
||||
clocks = <&cru ACLK_USB3>;
|
||||
pm_qos = <&qos_usb_otg0>,
|
||||
<&qos_usb_otg1>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_vio@RK3399_PD_VIO {
|
||||
reg = <RK3399_PD_VIO>;
|
||||
#power-domain-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
|
@ -1098,7 +1074,6 @@
|
|||
<&cru HCLK_HDCP>,
|
||||
<&cru PCLK_HDCP>;
|
||||
pm_qos = <&qos_hdcp>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_isp0@RK3399_PD_ISP0 {
|
||||
reg = <RK3399_PD_ISP0>;
|
||||
|
|
@ -1106,7 +1081,6 @@
|
|||
<&cru HCLK_ISP0>;
|
||||
pm_qos = <&qos_isp0_m0>,
|
||||
<&qos_isp0_m1>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_isp1@RK3399_PD_ISP1 {
|
||||
reg = <RK3399_PD_ISP1>;
|
||||
|
|
@ -1114,11 +1088,19 @@
|
|||
<&cru HCLK_ISP1>;
|
||||
pm_qos = <&qos_isp1_m0>,
|
||||
<&qos_isp1_m1>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_tcpc0@RK3399_PD_TCPC0 {
|
||||
reg = <RK3399_PD_TCPD0>;
|
||||
clocks = <&cru SCLK_UPHY0_TCPDCORE>,
|
||||
<&cru SCLK_UPHY0_TCPDPHY_REF>;
|
||||
};
|
||||
pd_tcpc1@RK3399_PD_TCPC1 {
|
||||
reg = <RK3399_PD_TCPD1>;
|
||||
clocks = <&cru SCLK_UPHY1_TCPDCORE>,
|
||||
<&cru SCLK_UPHY1_TCPDPHY_REF>;
|
||||
};
|
||||
pd_vo@RK3399_PD_VO {
|
||||
reg = <RK3399_PD_VO>;
|
||||
#power-domain-cells = <1>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
|
|
@ -1128,14 +1110,12 @@
|
|||
<&cru HCLK_VOP0>;
|
||||
pm_qos = <&qos_vop_big_r>,
|
||||
<&qos_vop_big_w>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
pd_vopl@RK3399_PD_VOPL {
|
||||
reg = <RK3399_PD_VOPL>;
|
||||
clocks = <&cru ACLK_VOP1>,
|
||||
<&cru HCLK_VOP1>;
|
||||
pm_qos = <&qos_vop_little>;
|
||||
#power-domain-cells = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,67 +0,0 @@
|
|||
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||
%YAML 1.2
|
||||
---
|
||||
$id: http://devicetree.org/schemas/clock/adi,axi-clkgen.yaml#
|
||||
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||
|
||||
title: Binding for Analog Devices AXI clkgen pcore clock generator
|
||||
|
||||
maintainers:
|
||||
- Lars-Peter Clausen <lars@metafoo.de>
|
||||
- Michael Hennerich <michael.hennerich@analog.com>
|
||||
|
||||
description: |
|
||||
The axi_clkgen IP core is a software programmable clock generator,
|
||||
that can be synthesized on various FPGA platforms.
|
||||
|
||||
Link: https://wiki.analog.com/resources/fpga/docs/axi_clkgen
|
||||
|
||||
properties:
|
||||
compatible:
|
||||
enum:
|
||||
- adi,axi-clkgen-2.00.a
|
||||
|
||||
clocks:
|
||||
description:
|
||||
Specifies the reference clock(s) from which the output frequency is
|
||||
derived. This must either reference one clock if only the first clock
|
||||
input is connected or two if both clock inputs are connected. The last
|
||||
clock is the AXI bus clock that needs to be enabled so we can access the
|
||||
core registers.
|
||||
minItems: 2
|
||||
maxItems: 3
|
||||
|
||||
clock-names:
|
||||
oneOf:
|
||||
- items:
|
||||
- const: clkin1
|
||||
- const: s_axi_aclk
|
||||
- items:
|
||||
- const: clkin1
|
||||
- const: clkin2
|
||||
- const: s_axi_aclk
|
||||
|
||||
'#clock-cells':
|
||||
const: 0
|
||||
|
||||
reg:
|
||||
maxItems: 1
|
||||
|
||||
required:
|
||||
- compatible
|
||||
- reg
|
||||
- clocks
|
||||
- clock-names
|
||||
- '#clock-cells'
|
||||
|
||||
additionalProperties: false
|
||||
|
||||
examples:
|
||||
- |
|
||||
clock-controller@ff000000 {
|
||||
compatible = "adi,axi-clkgen-2.00.a";
|
||||
#clock-cells = <0>;
|
||||
reg = <0xff000000 0x1000>;
|
||||
clocks = <&osc 1>, <&clkc 15>;
|
||||
clock-names = "clkin1", "s_axi_aclk";
|
||||
};
|
||||
25
arch/arm64/boot/dts/vendor/bindings/clock/axi-clkgen.txt
vendored
Normal file
25
arch/arm64/boot/dts/vendor/bindings/clock/axi-clkgen.txt
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
Binding for the axi-clkgen clock generator
|
||||
|
||||
This binding uses the common clock binding[1].
|
||||
|
||||
[1] Documentation/devicetree/bindings/clock/clock-bindings.txt
|
||||
|
||||
Required properties:
|
||||
- compatible : shall be "adi,axi-clkgen-1.00.a" or "adi,axi-clkgen-2.00.a".
|
||||
- #clock-cells : from common clock binding; Should always be set to 0.
|
||||
- reg : Address and length of the axi-clkgen register set.
|
||||
- clocks : Phandle and clock specifier for the parent clock(s). This must
|
||||
either reference one clock if only the first clock input is connected or two
|
||||
if both clock inputs are connected. For the later case the clock connected
|
||||
to the first input must be specified first.
|
||||
|
||||
Optional properties:
|
||||
- clock-output-names : From common clock binding.
|
||||
|
||||
Example:
|
||||
clock@ff000000 {
|
||||
compatible = "adi,axi-clkgen";
|
||||
#clock-cells = <0>;
|
||||
reg = <0xff000000 0x1000>;
|
||||
clocks = <&osc 1>;
|
||||
};
|
||||
119
arch/arm64/boot/dts/vendor/bindings/cs40l2x.txt
vendored
119
arch/arm64/boot/dts/vendor/bindings/cs40l2x.txt
vendored
|
|
@ -1,119 +0,0 @@
|
|||
CS40L20 Boosted Haptics Driver
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible : One of "cirrus,cs40l20", "cirrus,cs40l25", "cirrus,cs40l25a"
|
||||
or "cirrus,cs40l25b".
|
||||
|
||||
- reg : The I2C slave address of the device.
|
||||
|
||||
- VA-supply, VP-supply : Regulators for the device's VA and VP supplies,
|
||||
respectively. See the following:
|
||||
Documentation/devicetree/bindings/regulator/regulator.txt
|
||||
|
||||
- cirrus,boost-ind-nanohenry : Boost inductor value, expressed in nH. Valid
|
||||
values include 1000, 1200, 1500 and 2200.
|
||||
|
||||
- cirrus,boost-cap-microfarad : Total equivalent boost capacitance on the VBST
|
||||
and VAMP pins, derated at 11 volts DC. The value must be rounded to the
|
||||
nearest integer and expressed in uF.
|
||||
|
||||
- cirrus,boost-ipk-milliamp : Boost inductor peak current, expressed in mA.
|
||||
Valid values range from 1600 to 4500 (inclusive) in steps of 50.
|
||||
|
||||
Optional properties:
|
||||
|
||||
- reset-gpios : GPIO used for resetting the device.
|
||||
|
||||
- cirrus,refclk-gpio2 : Boolean for configuring the device to expect its
|
||||
32.768-kHz reference clock on the REFCLK/GPIO2 pin. If this property is
|
||||
omitted, the device expects its 32.768-kHz reference clock on the
|
||||
ASP_BCLK/REFCLK pin. This property is ignored for CS40L25A and CS40L25B
|
||||
devices as reference clock selection is configured automatically.
|
||||
|
||||
- cirrus,f0-default : Default LRA resonant frequency (f0), expressed as
|
||||
follows: cirrus,f0-default = f0 (Hz) * 2^14. This value represents the
|
||||
frequency used during playback of PWLE segments specified with frequency
|
||||
equal to f0; it also serves as the unit-specific f0 input to the click
|
||||
compensation algorithm. It can be overwritten at a later time by writing
|
||||
to the f0_stored sysfs control.
|
||||
|
||||
If this value is omitted or specified as zero, the measurement recorded in
|
||||
the f0_measured sysfs control is used. If LRA diagnostics has not been
|
||||
administered and f0_measured is uninitialized, 2621440 (160 Hz) is used.
|
||||
|
||||
- cirrus,f0-min : Minimum LRA resonant frequency (f0) that may be written to
|
||||
the f0_stored sysfs control, expressed using the same numerical format as
|
||||
cirrus,f0-default. If this value is omitted or specified as zero, no lower-
|
||||
bound validation is performed.
|
||||
|
||||
- cirrus,f0-max : Maximum LRA resonant frequency (f0) that may be written to
|
||||
the f0_stored sysfs control, expressed using the same numerical format as
|
||||
cirrus,f0-default. If this value is omitted or specified as zero, no upper-
|
||||
bound validation is performed.
|
||||
|
||||
- cirrus,redc-default : Default LRA series resistance (ReDC), expressed as
|
||||
follows: cirrus,redc-default = ReDC (ohms) / 5.857 * 2^17. This value
|
||||
represents the unit-specific ReDC input to the click compensation algorithm.
|
||||
It can be overwritten at a later time by writing to the redc_stored sysfs
|
||||
control.
|
||||
|
||||
If this value is omitted or specified as zero, the measurement recorded in
|
||||
the redc_measured sysfs control is used. If LRA diagnostics has not been
|
||||
administered and redc_measured is uninitialized, 340787 (15.2 ohms) is used.
|
||||
|
||||
- cirrus,redc-min : Minimum LRA series resistance (ReDC) that may be written
|
||||
to the redc_stored sysfs control, expressed using the same numerical format
|
||||
as cirrus,redc-default. If this value is omitted or specified as zero, no
|
||||
lower-bound validation is performed.
|
||||
|
||||
- cirrus,redc-max : Maximum LRA series resistance (ReDC) that may be written
|
||||
to the redc_stored sysfs control, expressed using the same numerical format
|
||||
as cirrus,redc-default. If this value is omitted or specified as zero, no
|
||||
upper-bound validation is performed.
|
||||
|
||||
- cirrus,gpio1-rise-index : Specifies the wavetable index mapped to GPIO1
|
||||
rising edges. If this value is omitted, specified as zero or exceeds the
|
||||
maximum available index in the wavetable, GPIO1 rising edges are mapped to
|
||||
index 1.
|
||||
|
||||
- cirrus,gpio1-fall-index : Specifies the wavetable index mapped to GPIO1
|
||||
falling edges. If this value is omitted, specified as zero or exceeds the
|
||||
maximum available index in the wavetable, GPIO1 falling edges are mapped to
|
||||
index 2.
|
||||
|
||||
- cirrus,gpio1-fall-timeout : Specifies the number of 48-kHz periods for
|
||||
which the device remains in the active state in search of a GPIO1 falling
|
||||
edge, following a GPIO1 rising edge (the latter of which renders the device
|
||||
active). If a GPIO1 falling edge does not arrive within this timeout, the
|
||||
device automatically returns to the standby state and the subsequent GPIO1
|
||||
falling edge is ignored. If this value is omitted or exceeds the maximum
|
||||
timeout (8388607) then a default of 240000 is assumed (corresponding to
|
||||
240000 / 48000 = 5 seconds). If this value is specified as zero, the timeout
|
||||
is effectively disabled.
|
||||
|
||||
- cirrus,gpio1-mode : Specifies the operating mode of the GPIO1 pin, equal to
|
||||
one of the following.
|
||||
|
||||
0 = enabled by default
|
||||
1 = disabled by default
|
||||
2 = disabled by default, but automatically enabled and disabled upon suspend
|
||||
and resume, respectively
|
||||
|
||||
If this value is omitted or given an invalid value, mode 0 (enabled by
|
||||
default) is assumed. Regardless of mode, the GPIO1 pin can be enabled or
|
||||
disabled at will from user space using the gpio1_enable sysfs control.
|
||||
|
||||
Example:
|
||||
|
||||
cs40l20: cs40l20@43 {
|
||||
compatible = "cirrus,cs40l20";
|
||||
reg = <0x43>;
|
||||
reset-gpios = <&gpio0 54 0>;
|
||||
VA-supply = <&dummy_vreg>;
|
||||
VP-supply = <&dummy_vreg>;
|
||||
cirrus,boost-ind-nanohenry = <1000>;
|
||||
cirrus,boost-cap-microfarad = <4>;
|
||||
cirrus,boost-ipk-milliamp = <4500>;
|
||||
cirrus,refclk-gpio2;
|
||||
};
|
||||
63
arch/arm64/boot/dts/vendor/bindings/drv8424.txt
vendored
63
arch/arm64/boot/dts/vendor/bindings/drv8424.txt
vendored
|
|
@ -1,63 +0,0 @@
|
|||
DRV8424 stepper motor driver from Texas Instruments
|
||||
|
||||
Motor driver is a platform device. Motorola specific HW layout
|
||||
allows for the following controllable GPIOs:
|
||||
|
||||
- MOTOR_POWER_EN
|
||||
- MOTOR_FAULT_INT
|
||||
- MOTOR_STEP
|
||||
- MOTOR_DIR
|
||||
- MOTOR_EN
|
||||
- MOTOR_SLEEP
|
||||
- MOTOR_ACTIVE
|
||||
|
||||
There is no kernel configuration option associated with DRV8424 DLKM
|
||||
|
||||
Required properties:
|
||||
- compatible: only one supported "moto,drv8424"
|
||||
- drv8424-gpio-cells: number of elements allocated for gpio array in the driver
|
||||
- MOTOR_POWER_EN-gpio: gpio enabling power to the motor
|
||||
- MOTOR_FAULT_INT-gpio: gpio used as IRQ to indicate motor fault
|
||||
- MOTOR_STEP-gpio: gpio used as input for pulse generator
|
||||
- MOTOR_DIR-gpio: gpio to control motor direction
|
||||
- MOTOR_EN-gpio: gpio to control drv8424 EN state
|
||||
- MOTOR_SLEEP-gpio: gpio to control drv8424 SLEEP state
|
||||
- MOTOR_ACTIVE-gpio: gpio to control hall effect sensor measurements
|
||||
- pinctrl-names: pinctrl state "drv8424_int_default" required for motor fault IRQ
|
||||
|
||||
Optional properties:
|
||||
- pinctrl-names: list of pre-defined name (currently only "init_state" supported)
|
||||
- power-default-off: keep power off when not in use
|
||||
- support-mode: driver supports MODE0 and MODE1 setup
|
||||
- support-torque: driver supports T0 and T1 setup
|
||||
- no-sensors: ignore sensors data (mostly debug option)
|
||||
|
||||
Note:
|
||||
Only following pinctrl state names are valid!!!
|
||||
"m0_low", "m0_high", "m0_disable",
|
||||
"m1_low", "m1_high", "m1_disable",
|
||||
"t0_low", "t0_high", "t0_disable",
|
||||
"t1_low", "t1_high", "t1_disable",
|
||||
"drv8424_int_default",
|
||||
"drv8424_clk_active",
|
||||
"drv8424_clk_sleep",
|
||||
"init_state"
|
||||
|
||||
Example:
|
||||
|
||||
moto_drv8424_support {
|
||||
compatible = "moto,drv8424";
|
||||
drv8424-gpios-cells = <11>;
|
||||
pinctrl-names = "drv8424_int_default", "init_state";
|
||||
pinctrl-0 = <&drv8424_int_default>;
|
||||
pinctrl-1 = <&drv8424_pwr_en_init &drv8424_step_init &drv8424_dir_init
|
||||
&drv8424_sleep_init &drv8424_en_init &drv8424_step_init &drv8424_active_init>;
|
||||
MOTOR_POWER_EN-gpio = <&tlmm 102>;
|
||||
MOTOR_FAULT_INT-gpio = <&tlmm 112>;
|
||||
MOTOR_STEP-gpio = <&tlmm 182>;
|
||||
MOTOR_DIR-gpio = <&tlmm 183>;
|
||||
MOTOR_SLEEP-gpio = <&tlmm 184>;
|
||||
MOTOR_ACTIVE-gpio = <&tlmm 185>;
|
||||
vdd-supply = <&S10B>;
|
||||
power-default-off;
|
||||
};
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
|
||||
Egis Technology Inc fingerprint driver
|
||||
et320 is a fps sensor in front of the phone, it connects to mainboard via SPI.
|
||||
et516 is a fps sensor on the back of the phone, it connects to mainboard via SPI.
|
||||
Required properties:
|
||||
- compatible: Should be "egistec,et516" or "egistec,et320"
|
||||
- gpio_irq : GPIO used for interrupt
|
||||
- gpio_rst: GPIO used for ets sensor reset
|
||||
- gpio_ldo1p8_en : GPIO used to enable vdd 1.8v
|
||||
- gpio_ldo3p3_en : GPIO used to enable vcc 3.3v
|
||||
- pinctrl-names,pinctrl-0: the pincontrol setting to configure muxing properly
|
||||
for pins that connect to ets fps sensor.
|
||||
|
||||
Example:
|
||||
ets_fps: ets_fps{
|
||||
compatible = "egistec,et320","egistec,et516";
|
||||
status = "ok";
|
||||
reg = <0>;
|
||||
interrupt-parent = <&tlmm>;
|
||||
interrupts = <128 0x0>;
|
||||
egistec,gpio_irq = <&tlmm 128 0x1>;
|
||||
egistec,gpio_rst = <&tlmm 127 0x2>;
|
||||
egistec,gpio_ldo1p8_en = <&tlmm 132 0x0>;
|
||||
egistec,gpio_ldo3p3_en = <&tlmm 133 0x0>;
|
||||
pinctrl-names = "default", "suspend";
|
||||
pinctrl-0 = <&rst_active &int_active &ldo_en_active &ldo3_en_active>;
|
||||
pinctrl-1 = <&rst_suspend &int_suspend &ldo_en_suspend &ldo3_en_suspend>;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue