This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
This converts the plain text documentation to reStructuredText format
and adds it to Sphinx TOC tree.
No essential content change.
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
Add below index.rst files for ACPI subsystem. More docs will be added later.
o admin-guide/acpi/index.rst
o driver-api/acpi/index.rst
o firmware-guide/index.rst
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
The Memory Controller (MC) clock rate can't be simply changed and nothing
in kernel need to change the rate, hence let's make the clock read-only.
This id also needed for the EMC driver because timing configuration may
require the MC clock diver to be disabled, that is handled by the EMC
clock / EMC driver integration and CLK framework shall not touch the
MC divider configuration on the EMC clock rate change.
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
There is no justification for the BUG() in this code.
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
When a clk user requests rate that is higher than the maximum possible,
the rate shall be clamped to the maximum and not to the current value.
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The timings parser doesn't append timings, but instead it parses only
the first timing and hence doesn't store all of the timings when
device-tree has timings for multiple RAM codes. In a result EMC scaling
doesn't work if timings are missing.
Tested-by: Steev Klimaszewski <[email protected]>
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The EMC clock marked as critical, hence it is already enabled at the
registration time.
Signed-off-by: Dmitry Osipenko <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Daniel Borkmann says:
====================
Two small fixes in relation to global data handling. Thanks!
====================
Acked-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Ran into it while testing; in bpf_object__init_maps() data can be NULL
in the case where no map section is present. Therefore we simply cannot
access data->d_size before NULL test. Move the pr_debug() where it's
safe to access.
Fixes: d859900c4c ("bpf, libbpf: support global data/bss/rodata sections")
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Andrii reported a corner case where e.g. global static data is present
in the BPF ELF file in form of .data/.bss/.rodata section, but without
any relocations to it. Such programs could be loaded before commit
d859900c4c ("bpf, libbpf: support global data/bss/rodata sections"),
whereas afterwards if kernel lacks support then loading would fail.
Add a probing mechanism which skips setting up libbpf internal maps
in case of missing kernel support. In presence of relocation entries,
we abort the load attempt.
Fixes: d859900c4c ("bpf, libbpf: support global data/bss/rodata sections")
Reported-by: Andrii Nakryiko <[email protected]>
Signed-off-by: Daniel Borkmann <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
In case platform_device_alloc fails, the fix returns an error
code to avoid the NULL pointer dereference.
Signed-off-by: Kangjie Lu <[email protected]>
Signed-off-by: Srinivas Kandagatla <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There is an out-of-bounds access to "config[len - 1]" array when the
variable "len" is zero.
See commit dada6a43b0 ("kgdboc: fix KASAN global-out-of-bounds bug
in param_set_kgdboc_var()") for details.
Signed-off-by: Young Xiao <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Platform core is using pdev->name as the platform device name to do
the binding of the devices with the drivers. But, when the platform
driver overrides the platform device name with dev_set_name(),
the pdev->name is pointing to a location which is freed and becomes
an invalid parameter to do the binding match.
use-after-free instance:
[ 33.325013] BUG: KASAN: use-after-free in strcmp+0x8c/0xb0
[ 33.330646] Read of size 1 at addr ffffffc10beae600 by task modprobe
[ 33.339068] CPU: 5 PID: 518 Comm: modprobe Tainted:
G S W O 4.19.30+ #3
[ 33.346835] Hardware name: MTP (DT)
[ 33.350419] Call trace:
[ 33.352941] dump_backtrace+0x0/0x3b8
[ 33.356713] show_stack+0x24/0x30
[ 33.360119] dump_stack+0x160/0x1d8
[ 33.363709] print_address_description+0x84/0x2e0
[ 33.368549] kasan_report+0x26c/0x2d0
[ 33.372322] __asan_report_load1_noabort+0x2c/0x38
[ 33.377248] strcmp+0x8c/0xb0
[ 33.380306] platform_match+0x70/0x1f8
[ 33.384168] __driver_attach+0x78/0x3a0
[ 33.388111] bus_for_each_dev+0x13c/0x1b8
[ 33.392237] driver_attach+0x4c/0x58
[ 33.395910] bus_add_driver+0x350/0x560
[ 33.399854] driver_register+0x23c/0x328
[ 33.403886] __platform_driver_register+0xd0/0xe0
So, use dev_name(&pdev->dev), which fetches the platform device name from
the kobject(dev->kobj->name) of the device instead of the pdev->name.
Signed-off-by: Venkata Narendra Kumar Gutta <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace klp_ktype_patch's default_attrs field
with default_groups and use the ATTRIBUTE_GROUPS macro to create
klp_patch_groups.
This patch was tested by loading the livepatch-sample module and
verifying that the sysfs files for the attributes in the default groups
were created.
Signed-off-by: Kimberly Brown <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Acked-by: Miroslav Benes <[email protected]>
Acked-by: Petr Mladek <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace sugov_tunables_ktype's default_attrs field
with default groups. Change "sugov_attributes" to "sugov_attrs" and use
the ATTRIBUTE_GROUPS macro to create sugov_groups.
This patch was tested by setting the scaling governor to schedutil and
verifying that the sysfs files for the attributes in the default groups
were created.
Signed-off-by: Kimberly Brown <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace padata_attr_type's default_attrs field
with default_groups and use the ATTRIBUTE_GROUPS macro to create
padata_default_groups.
This patch was tested by loading the pcrypt module and verifying that
the sysfs files for the attributes in the default groups were created.
Signed-off-by: Kimberly Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace irq_kobj_type's default_attrs field with
default_groups and use the ATTRIBUTE_GROUPS macro to create irq_groups.
This patch was tested by verifying that the sysfs files for the
attributes in the default groups were created.
Signed-off-by: Kimberly Brown <[email protected]>
Reviewed-by: Thomas Gleixner <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace the default_attrs fields in rx_queue_ktype
and netdev_queue_ktype with default_groups. Use the ATTRIBUTE_GROUPS
macro to create rx_queue_default_groups and netdev_queue_default_groups.
This patch was tested by verifying that the sysfs files for the
attributes in the default groups were created.
Signed-off-by: Kimberly Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace all of the ktype default_attrs fields in
the block subsystem with default_groups and use the ATTRIBUTE_GROUPS
macro to create the default groups.
Remove default_ctx_attrs[] because it doesn't contain any attributes.
This patch was tested by verifying that the sysfs files for the
attributes in the default groups were created.
Signed-off-by: Kimberly Brown <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
The kobj_type default_attrs field is being replaced by the
default_groups field. Replace foo_ktype's default_attrs field with
default_groups and use the ATTRIBUTE_GROUPS macro to create
foo_default_groups.
This patch was tested by loading the kset-example module and verifying
that the sysfs files for the attributes in the default group were
created.
Signed-off-by: Kimberly Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
kobj_type currently uses a list of individual attributes to store
default attributes. Attribute groups are more flexible than a list of
attributes because groups provide support for attribute visibility. So,
add support for default attribute groups to kobj_type.
In future patches, the existing uses of kobj_type’s attribute list will
be converted to attribute groups. When that is complete, kobj_type’s
attribute list, “default_attrs”, will be removed.
Signed-off-by: Kimberly Brown <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds support for CPU-wide trace scenarios by making sure that
only the sources monitoring the same process have access to a common sink.
Because the sink is shared between sources, the first source to use the
sink switches it on while the last one does the cleanup. Any attempt to
modify the HW is overlooked for as long as more than one source is using
a sink.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds support for CPU-wide trace scenarios by making sure that
only the sources monitoring the same process have access to a common sink.
Because the sink is shared between sources, the first source to use the
sink switches it on while the last one does the cleanup. Any attempt to
modify the HW is overlooked for as long as more than one source is using
a sink.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds support for CPU-wide trace scenarios by making sure that
only the sources monitoring the same process have access to a common sink.
Because the sink is shared between sources, the first source to use the
sink switches it on while the last one does the cleanup. Any attempt to
modify the HW is overlooked for as long as more than one source is using
a sink.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch uses the PID of the process being traced to allocate and free
ETR memory buffers for CPU-wide scenarios. The implementation is tailored
to handle both N:1 and 1:1 source/sink HW topologies.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In CPU-wide scenarios with an N:1 source/sink topology, sources share
the same sink. In order to reuse the same sink for all sources an
IDR is needed to archive events that have already been accounted for.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This patch adds reference counting to struct etr_buf so that, in CPU-wide
trace scenarios, shared buffers can be disposed of when no longer used.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation to support CPU-wide trace scenarios, introduce the notion
of process ID to ETR devices. That way events monitoring the same process
can use the same etr_buf, allowing multiple CPUs to use the same sink.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Buffer allocation is different when dealing with per-thread and
CPU-wide sessions. In preparation to support CPU-wide trace scenarios
simplify things by keeping allocation functions for both type separate.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Refactoring function tmc_etr_setup_perf_buf() so that it only deals
with the high level etr_perf_buffer, leaving the allocation of the
backend buffer (i.e etr_buf) to another function.
That way the backend buffer allocation function can decide if it wants
to reuse an existing buffer (CPU-wide trace scenarios) or simply create
a new one.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Make struct perf_event available to sink buffer allocation functions in
order to use the pid they carry to allocate and free buffer memory along
with regimenting access to what source a sink can collect data for.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Function free_event_data() is already busy and is bound to become
worse with the addition of CPU-wide trace scenarios. As such spin
off a new function to strickly take care of the sink buffers.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
There is no point in allocating sink memory for a trace session if
there is not a way to free it once it is no longer needed. As such make
sure the sink API function to allocate and free memory have been
implemented before moving ahead with the establishment of a trace
session.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When operating in CPU-wide trace scenarios and working with an N:1
source/sink HW topology, update() functions need to be made atomic
in order to avoid racing with start and stop operations.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When disabling a sink the reference counter ensures the operation goes
through if nobody else is using it. As such if drvdata::mode is already
set do CS_MODE_DISABLED, it is an error and should be reported as such.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
When operating in CPU-wide mode with an N:1 source/sink HW topology,
multiple CPUs can access a sink concurrently. As such reference counting
needs to happen when the device's spinlock is held to avoid racing with
other operations (start(), update(), stop()), such as:
session A Session B
----- -------
enable_sink
atomic_inc(refcount) = 1
...
atomic_dec(refcount) = 0 enable_sink
if (refcount == 0) disable_sink
atomic_inc()
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
In preparation to handle device reference counting inside of the sink
drivers, add a return code to the sink::disable() operation so that
proper action can be taken if a sink has not been disabled.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Configure timestamps to be emitted at regular intervals in the trace
stream to temporally correlate instructions executed on different CPUs.
Signed-off-by: Mathieu Poirier <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Resource selector pair 0 is always implemented and reserved. As such
it should not be explicitly programmed.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Set the proper bit in the configuration register when contextID tracing
has been requested by user space. That way PE_CONTEXT elements are
generated by the tracers when a process is installed on a CPU.
Signed-off-by: Mathieu Poirier <[email protected]>
Reviewed-by: Suzuki K Poulose <[email protected]>
Tested-by: Leo Yan <[email protected]>
Tested-by: Robert Walker <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>