This change adds KASAN-KUnit tests support for the async HW_TAGS mode.
In async mode, tag fault aren't being generated synchronously when a
bad access happens, but are instead explicitly checked for by the kernel.
As each KASAN-KUnit test expect a fault to happen before the test is over,
check for faults as a part of the test handler.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-10-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit e80a76aa1a
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I45a6bc351bce937797b1b08e9220a137225f9d55
When MTE async mode is enabled TFSR_EL1 contains the accumulative
asynchronous tag check faults for EL1 and EL0.
During the suspend/resume operations the firmware might perform some
operations that could change the state of the register resulting in
a spurious tag check fault report.
Report asynchronous tag faults before suspend and clear the TFSR_EL1
register after resume to prevent this to happen.
Cc: Will Deacon <will@kernel.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-9-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit eab0e6e17d
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I16efc3a886e57ac2f0a4f8a1bc70afcf17a86f26
MTE provides a mode that asynchronously updates the TFSR_EL1 register
when a tag check exception is detected.
To take advantage of this mode the kernel has to verify the status of
the register at:
1. Context switching
2. Return to user/EL0 (Not required in entry from EL0 since the kernel
did not run)
3. Kernel entry from EL1
4. Kernel exit to EL1
If the register is non-zero a trace is reported.
Add the required features for EL1 detection and reporting.
Note: ITFSB bit is set in the SCTLR_EL1 register hence it guaranties that
the indirect writes to TFSR_EL1 are synchronized at exception entry to
EL1. On the context switch path the synchronization is guarantied by the
dsb() in __switch_to().
The dsb(nsh) in mte_check_tfsr_exit() is provisional pending
confirmation by the architects.
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-8-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit 65812c6921
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Ia3e8df665b1fd88a50c649a6eda6ee790e28a7d4
Add vendor hook for selinux_state, so we can know
if the selinux_state is initialized
Bug: 186363840
Signed-off-by: Kuan-Ying Lee <Kuan-Ying.Lee@mediatek.com>
Change-Id: Ideed051a1d53ed1bce7d7915e38366264a7d77eb
load_unaligned_zeropad() and __get/put_kernel_nofault() functions can
read past some buffer limits which may include some MTE granule with a
different tag.
When MTE async mode is enabled, the load operation crosses the boundaries
and the next granule has a different tag the PE sets the TFSR_EL1.TF1 bit
as if an asynchronous tag fault is happened.
Enable Tag Check Override (TCO) in these functions before the load and
disable it afterwards to prevent this to happen.
Note: The same condition can be hit in MTE sync mode but we deal with it
through the exception handling.
In the current implementation, mte_async_mode flag is set only at boot
time but in future kasan might acquire some runtime features that
that change the mode dynamically, hence we disable it when sync mode is
selected for future proof.
Cc: Will Deacon <will@kernel.org>
Reported-by: Branislav Rankov <Branislav.Rankov@arm.com>
Tested-by: Branislav Rankov <Branislav.Rankov@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-6-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit e60beb95c0
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: Id1bf44c5f41bd6de4b2ddf286939cd35712f2299
Add vh before and after __update_load_avg_se
in order to collect load change of tasks.
Bug: 185557444
Change-Id: I210973f7e388164b68ed766074d1420cdf9d4c32
Signed-off-by: JianMin Liu <jian-min.liu@mediatek.com>
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I63789145dcfb0ab9d8411b236d797dc35a36b287
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I616df9b718f50a7ab261de9d9b1186aaee1b17fa
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Id7efe0cee50d3969182b965ed51b8c1803c4b41a
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: Id7f96b205c9daf9f4a1507a670cf351442bc5815
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I9fabda88f22c364e4a6963638f2cb01d3e70e5ff
The extract_symbols script has also been updated to make sure
__traceiter*() symbols are added to the list automatically in subsequent
updates.
Bug: 185777726
Signed-off-by: Quentin Perret <qperret@google.com>
Change-Id: I7481aec17bfa7c85f3f8f626d5c9baba472d251b
Architectures supported by KASAN_HW_TAGS can provide a sync or async mode
of execution. On an MTE enabled arm64 hw for example this can be identified
with the synchronous or asynchronous tagging mode of execution.
In synchronous mode, an exception is triggered if a tag check fault occurs.
In asynchronous mode, if a tag check fault occurs, the TFSR_EL1 register is
updated asynchronously. The kernel checks the corresponding bits
periodically.
KASAN requires a specific kernel command line parameter to make use of this
hw features.
Add KASAN HW execution mode kernel command line parameter.
Note: This patch adds the kasan.mode kernel parameter and the
sync/async kernel command line options to enable the described features.
[ Add a new var instead of exposing kasan_arg_mode to be consistent with
flags for other command line arguments. ]
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Andrey Konovalov <andreyknvl@google.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Signed-off-by: Andrey Konovalov <andreyknvl@google.com>
Link: https://lore.kernel.org/r/20210315132019.33202-3-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit 2603f8a78d
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I193e9eb0c016abc525ef69a1b9b2bb7254856162
MTE provides an asynchronous mode for detecting tag exceptions. In
particular instead of triggering a fault the arm64 core updates a
register which is checked by the kernel after the asynchronous tag
check fault has occurred.
Add support for MTE asynchronous mode.
The exception handling mechanism will be added with a future patch.
Note: KASAN HW activates async mode via kasan.mode kernel parameter.
The default mode is set to synchronous.
The code that verifies the status of TFSR_EL1 will be added with a
future patch.
Cc: Will Deacon <will@kernel.org>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Andrey Konovalov <andreyknvl@google.com>
Acked-by: Andrey Konovalov <andreyknvl@google.com>
Tested-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://lore.kernel.org/r/20210315132019.33202-2-vincenzo.frascino@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Bug: 170327579
Bug: 172318110
(cherry picked from commit f3b7deef8d
git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/
for-next/mte-async-kernel-mode)
Signed-off-by: Alexander Potapenko <glider@google.com>
Change-Id: I5a2778bbb03595c24eb6cddb6c2b2dcb383b7907
Update ABI description in prperation for 4/23 KMI update
Leaf changes summary: 3103 artifacts changed
Changed leaf types summary: 15 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 3030 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 58 Changed, 0 Added variable
3030 functions with some sub-type change:
[C] 'function int dev_pm_genpd_set_next_wakeup(device*, ktime_t)' at domain.c:441:1 has some sub-type changes:
CRC (modversions) changed from 0x5f5fcb7c to 0xf61e0895
return type changed:
type name changed from 'int' to 'void'
type size changed from 32 to 0 (in bits)
[C] 'function void* PDE_DATA(const inode*)' at generic.c:799:1 has some sub-type changes:
CRC (modversions) changed from 0x44ca679 to 0xcab3cd66
[C] 'function void __ClearPageMovable(page*)' at compaction.c:138:1 has some sub-type changes:
CRC (modversions) changed from 0x44484f05 to 0x9fa7085b
[C] 'function void __SetPageMovable(page*, address_space*)' at compaction.c:130:1 has some sub-type changes:
CRC (modversions) changed from 0x8978c2df to 0x41b1ba1a
... 3026 omitted; 3029 symbols have only CRC changes
58 Changed variables:
[C] 'static_key_false cpu_hwcap_keys[61]' was changed to 'static_key_false cpu_hwcap_keys[76]' at cpufeature.c:150:1:
size of symbol changed from 976 to 1216
CRC (modversions) changed from 0x4c98d79b to 0xec2fc692
type of variable changed:
type name changed from 'static_key_false[61]' to 'static_key_false[76]'
array type size changed from 7808 to 9728
array type subrange 1 changed length from 61 to 76
[C] 'unsigned long int cpu_hwcaps[1]' was changed to 'unsigned long int cpu_hwcaps[2]' at cpufeature.c:100:1:
size of symbol changed from 8 to 16
CRC (modversions) changed from 0xaebd1b18 to 0x8b9f70c7
type of variable changed:
type name changed from 'unsigned long int[1]' to 'unsigned long int[2]'
array type size changed from 64 to 128
array type subrange 1 changed length from 1 to 2
[C] 'const vm_operations_struct drm_gem_cma_vm_ops' was changed at drm_gem_cma_helper.c:263:1:
size of symbol changed from 136 to 144
CRC (modversions) changed from 0xafd38045 to 0xc092767b
type of variable changed:
[C] 'net init_net' was changed at net_namespace.c:47:1:
CRC (modversions) changed from 0x75836cf9 to 0x8c00edd2
type of variable changed:
type size hasn't changed
there are data member changes:
type 'struct netns_xfrm' of 'net::xfrm' changed:
type size hasn't changed
1 data member insertion:
'seqcount_t xfrm_state_hash_generation', at offset 6176 (in bits) at xfrm.h:76:1
there are data member changes:
'spinlock_t xfrm_policy_lock' offset changed (by +32 bits)
'mutex xfrm_cfg_mutex' offset changed (by +64 bits)
3361 impacted interfaces
3361 impacted interfaces
[C] 'rq runqueues' was changed at core.c:49:1:
size of symbol changed from 4160 to 4416
CRC (modversions) changed from 0xfbaeea47 to 0x5137fc66
type of variable changed:
type size changed from 33280 to 35328 (in bits)
there are data member changes:
'uclamp_rq uclamp[2]' size changed from 768 to 2688 (in bits) (by +1920 bits)
'unsigned int uclamp_flags' offset changed (by +1920 bits)
61 ('cfs_rq cfs' .. 'u64 android_kabi_reserved4') offsets changed (by +2048 bits)
3361 impacted interfaces
[C] 'const vm_operations_struct vb2_common_vm_ops' was changed at videobuf2-memops.c:122:1:
size of symbol changed from 136 to 144
CRC (modversions) changed from 0x18a6cc01 to 0xfde2ba08
type of variable changed:
[C] 'vm_event_state vm_event_states' was changed at vmstat.c:108:1:
size of symbol changed from 720 to 728
CRC (modversions) changed from 0x85d767b0 to 0x62cac127
type of variable changed:
type size changed from 5760 to 5824 (in bits)
there are data member changes:
type 'unsigned long int[90]' of 'vm_event_state::event' changed:
type name changed from 'unsigned long int[90]' to 'unsigned long int[91]'
array type size changed from 5760 to 5824
array type subrange 1 changed length from 90 to 91
one impacted interface
[C] 'bus_type amba_bustype' was changed at bus.c:215:1:
CRC (modversions) changed from 0xbbb1e519 to 0x84856996
[C] 'const address_space_operations balloon_aops' was changed at balloon_compaction.c:253:1:
CRC (modversions) changed from 0x7769d265 to 0x807e3fab
[C] 'const clk_ops clk_fixed_factor_ops' was changed at clk-fixed-factor.c:60:1:
CRC (modversions) changed from 0x8a6ece13 to 0x26b088f0
... 48 omitted; 51 symbols have only CRC changes
'struct dma_buf at dma-buf.h:397:1' changed (indirectly):
type size changed from 3328 to 3392 (in bits)
there are data member changes:
type 'struct vm_operations_struct' of 'dma_buf::vm_ops' changed:
type size changed from 1088 to 1152 (in bits)
1 data member insertion:
'typedef bool ()* allow_speculation', at offset 832 (in bits) at mm.h:651:1
there are data member changes:
4 ('u64 android_kabi_reserved1' .. 'u64 android_kabi_reserved4') offsets changed (by +64 bits)
3361 impacted interfaces
421 impacted interfaces
'struct dma_slave_config at dmaengine.h:434:1' changed:
type size changed from 448 to 576 (in bits)
2 data member insertions:
'void* peripheral_config', at offset 448 (in bits) at dmaengine.h:449:1
'size_t peripheral_size', at offset 512 (in bits) at dmaengine.h:450:1
33 impacted interfaces
'struct dwc3 at core.h:1079:1' changed:
type size hasn't changed
1 data member insertion:
'unsigned int usb2_gadget_lpm_disable', at offset 16 (in bits) at core.h:1250:1
there are data member changes:
21 ('unsigned int dis_tx_ipgap_linecheck_quirk' .. 'unsigned int dis_u2_freeclk_exists_quirk') offsets changed (by +1 bits)
'unsigned int dis_del_phy_power_chg_quirk' offset changed (by -31 bits)
2 impacted interfaces
'struct net at net_namespace.h:56:1' changed (indirectly):
details were reported earlier
'struct netns_xfrm at xfrm.h:32:1' changed:
details were reported earlier
'struct rq at sched.h:907:1' changed (indirectly):
details were reported earlier
'struct snd_soc_component_driver at soc-component.h:67:1' changed:
type size changed from 2752 to 2816 (in bits)
1 data member insertion:
'int (snd_soc_component*, snd_pcm_substream*)* ack', at offset 2304 (in bits) at soc-component.h:149:1
there are data member changes:
8 ('const snd_compress_ops* compress_ops' .. 'int be_pcm_base') offsets changed (by +64 bits)
65 impacted interfaces
'struct snd_soc_dai_link at soc.h:749:1' changed:
type size changed from 1088 to 1600 (in bits)
1 data member insertion:
'snd_soc_dobj dobj', at offset 1088 (in bits) at soc.h:847:1
65 impacted interfaces
'struct soc_enum at soc.h:1257:1' changed:
type size changed from 320 to 832 (in bits)
1 data member insertion:
'snd_soc_dobj dobj', at offset 320 (in bits) at soc.h:1267:1
one impacted interface
'struct tcpm_port at tcpm.c:297:1' changed:
type size hasn't changed
1 data member insertion:
'bool slow_charger_loop', at offset 32080 (in bits) at tcpm.c:471:1
13 impacted interfaces
'struct uclamp_rq at sched.h:892:1' changed:
type size changed from 384 to 1344 (in bits)
there are data member changes:
type 'uclamp_bucket[5]' of 'uclamp_rq::bucket' changed:
type name changed from 'uclamp_bucket[5]' to 'uclamp_bucket[20]'
array type size changed from 320 to 1280
array type subrange 1 changed length from 5 to 20
3361 impacted interfaces
'struct uclamp_se at sched.h:623:1' changed (indirectly):
type size hasn't changed
there are data member changes:
2 ('unsigned int active' .. 'unsigned int user_defined') offsets changed (by +2 bits)
3361 impacted interfaces
'struct user_struct at user.h:13:1' changed:
type size changed from 960 to 1088 (in bits)
1 data member insertion:
'u64 android_oem_data1[2]', at offset 960 (in bits) at user.h:45:1
3361 impacted interfaces
'struct vm_event_state at vmstat.h:54:1' changed:
details were reported earlier
'struct vm_operations_struct at mm.h:589:1' changed:
details were reported earlier
Bug: 186241007
Signed-off-by: Todd Kjos <tkjos@google.com>
Change-Id: I9725b5164da30547176b67b96cb1cef66ef2bfdc
When cdev_add is called after device_add has been called there is no
way for the userspace to know about the addition of a cdev as cdev_add
itself doesn't trigger a uevent notification, or for the kernel to
know about the change to devt. This results in two problems:
- mknod is never called for the cdev and hence no cdev appears on
devtmpfs.
- sysfs links to the new cdev are not established.
Based on how cdev_device_add[1] is written, it appears that the correct
way to use these APIs is to call cdev_add before device_add is called.
Since the cdev is an optional feature for remoteproc we cannot directly
use the existing API. Hence moving rproc_char_device_add() before
device_add() in rproc_add().
[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/char_dev.c#n537
Signed-off-by: Siddharth Gupta <sidgup@codeaurora.org>
Bug: 185924092
Change-Id: Iad8a45f564996d73cd3f33ed124427cb73497dad
Link: https://lore.kernel.org/linux-remoteproc/1618946805-26970-1-git-send-email-sidgup@codeaurora.org/
Signed-off-by: Siddharth Gupta <quic_sidgup@quicinc.com>
Right now only anonymous page faults are speculatively handled,
thus leaving out a large percentage of faults still requiring to
take mmap_sem. These were left out since there can be fault
handlers mainly in the fs layer which may use vma in unknown ways.
This patch enables speculative fault for ext4, f2fs and shmem. The
feature is disabled by default and enabled via allow_file_spec_access
kernel param.
Bug: 171954515
Change-Id: I0d23ebf299000e4ac5e2c71bc0b7fc9006e98da9
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
add vendor hooks to compute new cpu freq for oem feature.
Bug: 183674818
Signed-off-by: lijianzhong <lijianzhong@xiaomi.com>
Change-Id: I232d2e1ae885d6736eca9e4709870f4272b4873d
This reverts commit 1aff922933 as we are
free to update the ABI at this point in time.
Bug: 161946584
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iba293953586fd78503ef5f47db40ccdc03b098f5
When a PD charger advertising Rp-3.0 is connected to a sink port, the
sink port current limit would 3A, during SNK_DISCOVERY, till power
negotiation starts. Once the negotiation starts the power limit needs
to drop down to pSnkStby(500mA @ 5V) and to negotiated current limit
once the explicit contract is in place. Not all charging loops can ramp
up to 3A and drop down to 500mA within tSnkStdby which is 15ms. The port
partner might hard reset if tSnkStdby is not met.
To solve this problem, this patch introduces slow-charger-loop which
when set makes the port request PD_P_SNK_STDBY_MW upon entering
SNK_DISCOVERY(instead of 3A or the 1.5A during SNK_DISCOVERY) and the
actual currrent limit after RX of PD_CTRL_PSRDY for PD link or during
SNK_READY for non-pd link.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210414024000.4175263-2-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 1373fefc62https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I811b7f9ec732da0cab715837737ea09ea4a5bbbf
Since cpu_hwcaps and cpu_hwcap_keys are exported symbols, reserve
space in them for any future cpu capabilities or erratas.
Bug: 183169515
Change-Id: I85ebab5ee0eaeabaa2f2856aaae8730c77b16177
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
The CRC calculation done by genksyms is triggered when the parser hits
EXPORT_SYMBOL*() macros. At this point, genksyms recursively expands the
types, and uses that as the input for the CRC calculation. In the case
of forward-declared structs, the type expands to 'UNKNOWN'. Next, the
result of the expansion of each type is cached, and is re-used when/if
the same type is seen again for another exported symbol in the file.
Unfortunately, this can cause CRC 'stability' issues when a struct
definition becomes visible in the middle of a C file. For example, let's
assume code with the following pattern:
struct foo;
int bar(struct foo *arg)
{
/* Do work ... */
}
EXPORT_SYMBOL_GPL(bar);
/* This contains struct foo's definition */
#include "foo.h"
int baz(struct foo *arg)
{
/* Do more work ... */
}
EXPORT_SYMBOL_GPL(baz);
Here, baz's CRC will be computed using the expansion of struct foo that
was cached after bar's CRC calculation ('UNKOWN' here). But if
EXPORT_SYMBOL_GPL(bar) is removed from the file (because of e.g. symbol
trimming using CONFIG_TRIM_UNUSED_KSYMS), struct foo will be expanded
late, during baz's CRC calculation, which now has visibility over the
full struct definition, hence resulting in a different CRC for baz.
This can cause annoying issues for distro kernel (such as the Android
Generic Kernel Image) which use CONFIG_UNUSED_KSYMS_WHITELIST. Indeed,
as per the above, adding a symbol to the whitelist can change the CRC of
symbols that are already kept exported. As such, modules built against a
kernel with a trimmed ABI may not load against the same kernel built
with an extended whitelist, even though they are still strictly binary
compatible. While rebuilding the modules would obviously solve the
issue, I believe this classifies as an odd genksyms corner case, and it
gets in the way of kernel updates in the GKI context.
To work around the issue, make sure to keep issuing the
__GENKSYMS_EXPORT_SYMBOL macros for all trimmed symbols, hence making
the genksyms parsing insensitive to symbol trimming.
Bug: 184275771
Bug: 167230325
Signed-off-by: Quentin Perret <qperret@google.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20210408180105.2496212-1-qperret@google.com
Change-Id: Id94085d446d5648943d4fe4f79e3177bc4f98093
Enable hidden config SND_SOC_TOPOLOGY need by SND_SOC=m
Bug: 153682187
Change-Id: I47dabfaa6f0d138f78fbc1c9fc0d4ac3c7c73986
Signed-off-by: Gyeongtaek Lee <gt82.lee@samsung.com>
Using the default setting 5 means the first bucket contains the
uclamp values from 0 to 19 (in percentage), in this case, if the
uclamp.min setting of a group is under 20, it will fall into this
bucket with other groups that have uclamp.min set to 0, which
increase the possibility of over boost. By setting the bucket
count to 20 will ease this situation, while a uclamp.min greater
than 4 will fall into a different bucket.
Bug: 170487162
Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: Ife96b199bee36faedc8e129ade17e475cdbe44e0
Add snd_soc_pcm_component_ack back, which can be used to get an
updated buffer pointer in the platform driver.
On Asymmetric multiprocessor, this pointer can be sent to Cortex-M
core for audio processing.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1615516725-4975-2-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bug: 159736148
(cherry picked from commit 8bdfc0455e
https: //git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git sound/for-5.13)
Change-Id: I16f49ea140b9b9185313814fce3f3d9ef4c1a44a
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
The commit e7bbb7acab ("dmaengine: add peripheral configuration")
adds peripheral configuration for dma_slave_config.
This configuration is useful for some audio peripherals, for
example, the peripheral supports multi fifos, we can
let the DMA know which fifos are selected. So also add
this configuration for snd_dmaengine_dai_dma_data.
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Link: https://lore.kernel.org/r/1612509985-11063-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Bug: 159736148
(cherry picked from commit 500c9f8c58)
Change-Id: Ib8fd722b382e8d605db9edee65ab16df014d63db
Signed-off-by: Jindong Yue <jindong.yue@nxp.com>
Currently, a PM domain's idle state is determined based on whether the
QoS requirements are met. However, even entering an idle state may waste
power if the minimum residency requirements aren't fulfilled.
CPU PM domains use the next timer wakeup for the CPUs in the domain to
determine the sleep duration of the domain. This is compared with the
idle state residencies to determine the optimal idle state. For other PM
domains, determining the sleep length is not that straight forward. But
if the device's next_event is available, we can use that to determine
the sleep duration of the PM domain.
Let's update the domain governor logic to check for idle state residency
based on the next wakeup of devices as well as QoS constraints. But
since, not all domains may contain devices capable of specifying the
next wakeup, let's enable this additional check only if specified by the
domain's flags when initializing the domain.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit c79aa080fb)
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I70714c4d5840034771b2b4a6b1d38eb4c73d1f85
Some devices may have a predictable interrupt pattern while executing
usecases. An example would be the VSYNC interrupt associated with
display devices. A 60 Hz display could cause a interrupt every 16 ms. If
the device were in a PM domain, the domain would need to be powered up
for device to resume and handle the interrupt.
Entering a domain idle state saves power, only if the residency of the
idle state is met. Without knowing the idle duration of the domain, the
governor would just choose the deepest idle state that matches the QoS
requirements. The domain might be powered off just as the device is
expecting to wake up. If devices could inform PM frameworks of their
next event, the parent PM domain's idle duration can be determined.
So let's add the dev_pm_genpd_set_next_wakeup() API for the device to
inform PM domains of the impending wakeup. This information will be the
domain governor to determine the best idle state given the wakeup.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
(cherry picked from commit 67e3242ee2)
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Id0b4c3a3d0f6223a24d94ae953777ff8c8f160f3
This reverts commit e6c313525b.
Drop [v6] patches in favor of upstream backports.
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Iafa2cb1397ff033efe1c6d1c963e58d0478eed23
This reverts commit 7a9d53c2ea.
Drop [v6] patches in favor of upstream backports.
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I1ed4debfe724940b4c11c18f87ef97d046975918
This reverts commit 283e327164.
Drop [v6] patches in favor of upstream backports.
Bug: 170654157
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: I82b8117cc6c6bf6b28af666f34257775ade428fa
Guard isolate_and_split_free_page() with CONFIG_COMPACTION. This fixes
the follwoing build error as the function collides with its inline stub
from the header file:
mm/compaction.c:766:15: error: redefinition of ‘isolate_and_split_free_page’
766 | unsigned long isolate_and_split_free_page(struct page *page,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from mm/compaction.c:14:
./include/linux/compaction.h:241:29: note: previous definition of ‘isolate_and_split_free_page’ was here
241 | static inline unsigned long isolate_and_split_free_page(struct page *page,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Bug: 186243330
Fixes: 8cd9aa93b7 ("ANDROID: implement wrapper for reverse migration")
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Carlos Llamas <cmllamas@google.com>
Change-Id: Ie8f3fedcc9d4af5cfdcfd5829377671745ab77d6
Enable CONFIG_HIST_TRIGGERS which will be useful
in various perf evaluations.
Bug: 185890730
Change-Id: Ia4c140863ce248fea0dd235ca8a9cdee1176f8ed
Signed-off-by: Vijayanand Jitta <vjitta@codeaurora.org>