The ioremap hook can be called before slab is initialised, at which time
calling into kmalloc() is not allowed.
Signed-off-by: Keir Fraser <keirf@google.com>
Bug: 232894028
Fixes: 078e81b0c1 ("ANDROID: arm64: Implement ioremap/iounmap hooks calling into KVM's MMIO guard")
Change-Id: Ieaf5adbdacdb196e37f4629998164a015e15c6d8
Some of the platforms might be still expecting dedicated memory region
for ramoops node. So add logic to detect the start and size of the
ramoops memory region by looking up reserved memory region with
of_reserved_mem_lookup() when platform_get_resource() failed.
Bug: 191636717
Change-Id: Idc479b45fb3f637f7235efd6eabac62059d5e92b
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
(cherry picked from commit 9b136eab76)
The reserved memory region for ramoops is assumed to be at a fixed
and known location when read from the devicetree. This is not desirable
in environments where it is preferred for the region to be dynamically
allocated at runtime, as opposed to it being fixed at compile time.
Change the logic for detecting the start and size of the ramoops
memory region by looking up the reserved memory region instead of
using platform_get_resource(), which assumes that the location
of the memory is known ahead of time.
Bug: 191636717
Link: https://lore.kernel.org/patchwork/patch/1451704/
Change-Id: I24066de9f4fe1f1575cb1bbb1687c37a2b1938a4
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
(cherry picked from commit bd2ca0ba5b)
When console is disabled we are returning in probe
leaving the gpio pinctrl configuration untouched.
Since the pinctrl configuration is active(default)
while returning in probe, its leading to 1.8V pad
leakage during system suspend later.
Configure the pinctrl configuration to sleep state
when console is disabled to avoid leakage.
Bug: 232769754
Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
Change-Id: Icc56d40f72d368bb0b80b348aa5d19ba4c4278a6
Disable CFI on trace hooks, as this improves some lmbench
microbenchmarks by as much as 12%.
Bug: 200542217
Change-Id: I6ad1d12047c4e69743ff94cf0ea8f70f5023c7da
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
CFI has additional overhead on indirect branches to modules as the
target is not known at kernel compile-time. This has been demonstrated
to cause problematic performance regressions on benchmarks using GKI
together with modularized scheduler callbacks attached to restricted
vendor hooks.
To restore some of the performance back, let's disable CFI around the
restricted hook call sites and issue a raw indirect call in fast paths.
We should be able to drop this patch when/if the arm64 static_call
port lands upstream [1] as this would make tracepoints circumvent some
of the CFI checks using text patching, but that still remain to be
proven.
[1] https://lore.kernel.org/linux-arm-kernel/20201028184114.6834-1-ardb@kernel.org/
Bug: 168521642
Change-Id: I7cd59f582b12fed15be64059f08122f96786e650
Signed-off-by: Quentin Perret <qperret@google.com>
If a different vcpu from the same vm is loaded on the same
physical CPU, we must flush the CPU context.
This patch ensures that by tracking the vcpu that was last loaded
on this CPU, and flushes if that changes. This could lead to
over-invalidation, which could affect performance but not
correctness.
Bug: 228810735
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: I70976007165ca3b8d293089dbf9c2111b01ca2f7
This field is stale and not being used. Remove it.
Bug: 228810735
Signed-off-by: Fuad Tabba <tabba@google.com>
Change-Id: I5a734c22f246186b81ffd7bc73b46e0b60518306
According to the databook ep0 should be in setup phase during reset.
If host issues reset between control transfers, ep0 will be in an
invalid state. Fix this by issuing stall and restart on ep0 if it
is not in setup phase.
Also SW needs to complete pending control transfer and setup core for
next setup stage as per data book. Hence check ep0 state during reset
interrupt handling and make sure active transfers on ep0 out/in
endpoint are stopped by queuing ENDXFER command for that endpoint and
restart ep0 out again to receive next setup packet.
Link: https://lore.kernel.org/lkml/1651693001-29891-1-git-send-email-quic_mrana@quicinc.com/
Bug: 232209416
Change-Id: I921e36e2f81e0b0854d59531d8537a1b6118f26c
Signed-off-by: Mayank Rana <quic_mrana@quicinc.com>
Compile time warning is observed with firmware_param_path_set()
for using the __setup() macro when firmware_loader enabled as module.
drivers/base/firmware_loader/main.c:428:19: warning: 'firmware_param_path_set'
defined but not used [-Wunused-function]
Fix the above warning by using the module_param_cb instead of __setup for
firmware_class.path commandline.
Bug: 202192667
Fixes: d551647f3b ("ANDROID: firmware_loader: Add support for customer firmware paths")
Change-Id: I73cdee9815e84a507ac886e6e181d4a489fd2e5f
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
This reverts commit 92a6dd3865.
Reason for revert: Suspected cause of hyp panic when running suite/user/pkvm_test
Bug: 232390891
Change-Id: Ie644c5484d8f1dde9630b9510a80988446ebbcdd
Signed-off-by: Will Deacon <willdeacon@google.com>
Kleaf replaces build.sh. Define db845c target in Bazel
so it may be built with the following command.
Kleaf requires the list of in-tree kernel modules to be
listed explicitly.
Test: tools/bazel run //common:db845c_dist
Bug: 232284531
Signed-off-by: Yifan Hong <elsk@google.com>
Change-Id: I6ffd111574ffa012fa4d4c8241e06af08a5887e1
This reverts commit fe25fc5375.
Reason for revert: test regressions
Bug: 232427425
Bug: 232421416
Change-Id: If7006fe6c3f1a55361099ef24927d4bc7c821b9c
Signed-off-by: Steve Muckle <smuckle@google.com>
Disable MMIO tracing for geni serial driver to prevent excessive
logging. Any access over serial console would involve a lot of
TX and RX register accesses (and few others), so these MMIO
read/write trace events in these drivers cause a lot of unwanted
noise because of the high frequency of such operations and it is
not very useful tracing these events for such drivers.
Given we want to enable these trace events on development devices
(maybe not production devices) where performance also really matters
so that we don't regress other components by wasting CPU cycles and
memory collecting these traces, it makes more sense to disable these
traces from such drivers.
Also another reason to disable these traces would be to prevent
recursive tracing when we display the trace buffer containing
these MMIO trace events since writing onto serial console would
further record MMIO traces.
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Sai Prakash Ranjan <quic_saipraka@quicinc.com>
Bug: 229834709
Link: https://lore.kernel.org/lkml/282f2d8fb795e8b1961693ed4184b8136c3520db.1651663123.git.quic_saipraka@quicinc.com/
Change-Id: Ifac104dceae688b83b15e6a6fd0a0c55eb7b43e5
Signed-off-by: Visweswara Tanuku <quic_vtanuku@quicinc.com>
If write string to /sys/module/debug_kinfo/parameters/build_info
twice, kernel will crash. fix by removing vunmap in build_info_set.
Bug: 213120696
Signed-off-by: Chunhui Li <chunhui.li@mediatek.com>
Change-Id: I683859067a31068de0006be8490efa4b0107044f
(cherry picked from commit bdc772adbd)
Add V4L2_COLORFX_SET_RGB color effects control, V4L2_CID_COLORFX_RGB
for RGB color setting.
with two mirror changes:
- change 0xFFFFFF to 0xffffff
- fix comments 2^24 to 2^24 - 1
[hverkuil: dropped spaces around + with V4L2_CID_BASE for consistency]
Bug: 232332132
(cherry picked from commit ef9f18a9e3a04126cf017216193166abe03dedef)
Signed-off-by: Dillon Min <dillon.minfei@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Lecopzer Chen <lecopzer.chen@mediatek.com>
Change-Id: I68151757540cff896ff5a727412e1ed9aa95d9da
Export dwc3_complete_trb tracepoint so that
vendor modules can use it.
Bug: 189130101
Change-Id: I1efeaf2a29267ee647fda83d5f18b7a5fae16b96
Signed-off-by: fengmingli <mingli.feng@vivo.com>
(cherry picked from commit e3e4ee0e9f)
Currently the code has single hook for tracking irqs. However
modules need to deduce start and end of the irq.
Create separate hooks for irq start and end since the
cputime has already figured it out.
Bug: 231341763
Change-Id: Ie0dd503b283d83f69d01171ebd1cd6127c3bafd0
Signed-off-by: Shaleen Agrawal <quic_shalagra@quicinc.com>
Signed-off-by: Ashay Jaiswal <quic_ashayj@quicinc.com>
When a file-backed vma is being released, the userspace can have an
expectation that the vma and the file it's pinning will be released
synchronously. This does not happen when SPF is enabled because vma
and associated file are released asynchronously after RCU grace
period. This is done to prevent pagefault handler from stepping on
a deleted object. Fix this issue by synchronously waiting for RCU
grace period during file-backed vma tear-down.
Fixes: 48e35d053f "FROMLIST: mm: rcu safe vma->vm_file freeing"
Bug: 231394031
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I9f672d5bd947763c7d180a8c1b1f964600d407f3
icc_sync_state symbol is required for interconnect providers so they can
make use of framework icc_sync_state. Add it to the symbol list.
Bug: 231996551
Change-Id: I5b79601f8d8b7993efe9741e2a7be54fd33883ec
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Signed-off-by: Giuliano Procida <gprocida@google.com>
prb_next_seq() always iterates from the first known sequence number.
In the worst case, it might loop 8k times for 256kB buffer,
15k times for 512kB buffer, and 64k times for 2MB buffer.
It was reported that polling and reading using syslog interface
might occupy 50% of CPU.
Speedup the search by storing @id of the last finalized descriptor.
The loop is still needed because the @id is stored and read in the best
effort way. An atomic variable is used to keep the @id consistent.
But the stores and reads are not serialized against each other.
The descriptor could get reused in the meantime. The related sequence
number will be used only when it is still valid.
An invalid value should be read _only_ when there is a flood of messages
and the ringbuffer is rapidly reused. The performance is the least
problem in this case.
Bug: 216238044
(cherry picked from commit ef244b4dc53e520d4570b2610436aba0593ce6f55)
Reported-by: Chunlei Wang <chunlei.wang@mediatek.com>
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/1642770388-17327-1-git-send-email-quic_mojha@quicinc.com
Link: https://lore.kernel.org/lkml/YXlddJxLh77DKfIO@alley/T/#m43062e8b2a17f8dbc8c6ccdb8851fb0dbaabbb14
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
Change-Id: Ie6b1276eca791a891e42d5635ca1f116ae7cadef
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
Currently firmware_class.patch commandline can take a single path for
loading firmwares on custom paths. SoC vendors and oems can have
firmwares in multiple file system paths. So add support for paassing
multiple paths through command line for firmware loader.
For example - firmware_class.path="/vendor,/vendor/firmware_mnt,
/oem/firmware". firmware_class.path can take upto 10 file system
paths with ',' separation.
Bug: 202192667
Change-Id: I31d1470d7dd0255c7aefd856f3c129bdb4b7f2e8
Signed-off-by: Prasad Sodagudi <quic_psodagud@quicinc.com>
There could be a scenario where there is too much load on a core
(n number of tasks which is affined) or in a case when multiple
rproc subsystem is going for a recovery and they queued recovery
work to one core so even though subsystem are independent there
recovery will be delayed if one of the subsystem recovery work
is taking more time in completing.
If we make this queue unbounded, the recovery work could be picked
on any cpu. This patch try to address this.
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Bug: 228429683
Change-Id: If18b39db6c0861989a6a3b36d9efde5f488b9b73
Link: https://lore.kernel.org/lkml/1649313998-1086-1-git-send-email-quic_mojha@quicinc.com/
Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
(cherry picked from commit 9608dc38a0d051efad3932ed5e9d604a70917be3)
ld and ar support @file, which command-line options are read from.
Now that *.mod lists the member objects in the correct order, without
duplication, it is ready to be passed to ld and ar.
By using the @file syntax, people will not be worried about the pitfall
described in the NOTE.
Bug: 175420575
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
(cherry picked from commit 9170b27757d21460755254045bad4933cb631776
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
[eberman: Fix conflicts with commit 557054d]
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Change-Id: Id5bbd99ce940dc5eb40e2f9e75182a50a2eeff47
The dependency
$(obj)/%.mod: $(obj)/%$(mod-prelink-ext).o
... exists because *.mod files previously contained undefined symbols,
which are computed from *.o files when CONFIG_TRIM_UNUSED_KSYMS=y.
Now that the undefined symbols are put into separate *.usyms files,
there is no reason to make *.mod depend on *.o files.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Bug: 175420575
(cherry picked from commit 21b526ad634448369bbadc2f112ed2c716805e63
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Change-Id: I7f0e7872ccb54467a33c951d0551fe49be9a36fd
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
It is allowed to add the same objects multiple times to obj-y / obj-m:
obj-y += foo.o foo.o foo.o
obj-m += bar.o bar.o bar.o
It is also allowed to add the same objects multiple times to a composite
module:
obj-m += foo.o
foo-y := foo1.o foo2.o foo2.o foo1.o
This flexibility is useful because the same object might be selected by
different CONFIG options, like this:
obj-m += foo.o
foo-y := foo1.o
foo-$(CONFIG_FOO_X) += foo2.o
foo-$(CONFIG_FOO_Y) += foo2.o
The duplicated objects are omitted at link time. It works naturally in
Makefiles because GNU Make removes duplication in $^ without changing
the order.
It is working well, almost...
A small flaw I notice is, *.mod contains duplication in such a case.
This is probably not a big deal. As far as I know, the only small
problem is scripts/mod/sumversion.c parses the same file multiple
times.
I am fixing this because I plan to reuse *.mod for other purposes,
where the duplication can be problematic.
The code change is quite simple. We already use awk to drop duplicated
lines in modules.order (see cmd_modules_order in the same file).
I copied the code, but changed RS to use spaces as record separators.
I also changed the file format to list one object per line.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Bug: 175420575
(cherry picked from commit 62d88fd6ef3e52c355ec82e1aef530e72cf690e5
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Change-Id: Icd83764f7064c7abf4f8bcf9cf784c8c25c52192
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
The *.mod files have two lines; the first line lists the member objects
of the module, and the second line, if CONFIG_TRIM_UNUSED_KSYMS=y, lists
the undefined symbols.
Currently, we generate *.mod after constructing composite modules,
otherwise, we cannot compute the second line. No prerequisite is
required to print the first line.
They are orthogonal. Splitting them into separate commands will ease
further cleanups.
This commit splits the list of undefined symbols out to *.usyms files.
Previously, the list of undefined symbols ended up with a very long
line, but now it has one symbol per line.
Use sed like we did before commit 7d32358be8 ("kbuild: avoid split
lines in .mod files").
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Bug: 175420575
(cherry picked from commit 2f6b64906adf99b4c5ea9356df793766d290cfb4
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Change-Id: Ic801d2bf085aff6e50d15d196c43da4df3aa88c8
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
Precisely speaking, when you get the stem of the path, you should use
$(patsubst $(obj)/%,%,...) instead of $(notdir ...).
I do not see this usecase, but if you create a composite object in a
subdirectory, the Makefile should look like this:
obj-$(CONFIG_FOO) += dir/foo.o
dir/foo-objs := dir/foo1.o dir/foo2.o
The member objects should be assigned to dir/foo-objs instead of
foo-objs.
This syntax is more consistent with commit 54b8ae66ae ("kbuild:
change *FLAGS_<basetarget>.o to take the path relative to $(obj)").
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Bug: 175420575
(cherry picked from commit 1fe9c5794b2b57b33c84ffaa0eb56254f310ed54
https://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild.git kbuild)
Change-Id: I541fb600d05ae9be847718c869e0b95c0b540ff9
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
In order to reconstruct frame for MBSSID feature, per the description of
the Reduced Neighbor Report(RNR) element about MLD parameters subfield in
section 9.4.2.170 of Draft P802.11be_D1.4, the RNR IE is modified:
1\ If the reported AP is affiliated with the same MLD of the reporting AP,
the TBTT information is skipped;
2\ If the reported AP is affiliated with the same MLD of the nontransmitted
BSSID, the TBTT information is copied and the MLD ID is changed to 0.
Signed-off-by: Paul Zhang <quic_paulz@quicinc.com>
Bug: 231937090
Link: https://lore.kernel.org/linux-wireless/1649335871-9173-1-git-send-email-quic_paulz@quicinc.com
Change-Id: I2bae85b813a2351a62d2788f0e76f13407d11645
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
When clatd starts with ebpf offloaing, and NETIF_F_GRO_FRAGLIST is enable,
several skbs are gathered in skb_shinfo(skb)->frag_list. The first skb's
ipv6 header will be changed to ipv4 after bpf_skb_proto_6_to_4,
network_header\transport_header\mac_header have been updated as ipv4 acts,
but other skbs in frag_list didnot update anything, just ipv6 packets.
udp_queue_rcv_skb will call skb_segment_list to traverse other skbs in
frag_list and make sure right udp payload is delivered to user space.
Unfortunately, other skbs in frag_list who are still ipv6 packets are
updated like the first skb and will have wrong transport header length.
e.g.before bpf_skb_proto_6_to_4,the first skb and other skbs in frag_list
has the same network_header(24)& transport_header(64), after
bpf_skb_proto_6_to_4, ipv6 protocol has been changed to ipv4, the first
skb's network_header is 44,transport_header is 64, other skbs in frag_list
didnot change.After skb_segment_list, the other skbs in frag_list has
different network_header(24) and transport_header(44), so there will be 20
bytes different from original,that is difference between ipv6 header and
ipv4 header. Just change transport_header to be the same with original.
Actually, there are two solutions to fix it, one is traversing all skbs
and changing every skb header in bpf_skb_proto_6_to_4, the other is
modifying frag_list skb's header in skb_segment_list. Considering
efficiency, adopt the second one--- when the first skb and other skbs in
frag_list has different network_header length, restore them to make sure
right udp payload is delivered to user space.
Signed-off-by: Lina Wang <lina.wang@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit cf3ab8d4a797960b4be20565abb3bcd227b18a68 https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master)
Bug: 218157620
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I36f2f329ec1a56bb0742141a7fa482cafa183ad3