14 Jul, 2020
1 commit
-
The resolve_btfids tool will be used during the vmlinux linking,
so it's necessary it's ready for it.Signed-off-by: Jiri Olsa
Signed-off-by: Alexei Starovoitov
Tested-by: Andrii Nakryiko
Acked-by: Andrii Nakryiko
Link: https://lore.kernel.org/bpf/20200711215329.41165-3-jolsa@kernel.org
14 Jan, 2020
1 commit
-
Add "bootconfig" command which operates the bootconfig
config-data on initrd image.User can add/delete/verify the boot config on initrd
image using this command.e.g.
Add a boot config to initrd image
# bootconfig -a myboot.conf /boot/initrd.imgRemove it.
# bootconfig -d /boot/initrd.imgOr verify (and show) it.
# bootconfig /boot/initrd.imgLink: http://lkml.kernel.org/r/157867223582.17873.14342161849213219982.stgit@devnote2
Signed-off-by: Masami Hiramatsu
[ Removed extra blank line at end of bootconfig.c ]
Signed-off-by: Steven Rostedt (VMware)
14 Aug, 2019
1 commit
-
When `make help` is executed it lists the possible tools to build,
though couple of entries is kept unordered. Fix it here.Signed-off-by: Andy Shevchenko
Acked-by: Song Liu
Cc: Alexei Starovoitov
Cc: Daniel Borkmann
Cc: Martin KaFai Lau
Cc: Yonghong Song
Link: https://lkml.kernel.org/n/tip-0ke3p64ksa0hnbueh52n3v3q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo
03 Jul, 2019
1 commit
-
The Intel(R) Speed select technologies contains four features.
Performance profile:An non architectural mechanism that allows multiple
optimized performance profiles per system via static and/or dynamic
adjustment of core count, workload, Tjmax, and TDP, etc. aka ISS
in the documentation.Base Frequency: Enables users to increase guaranteed base frequency on
certain cores (high priority cores) in exchange for lower base frequency
on remaining cores (low priority cores). aka PBF in the documenation.Turbo frequency: Enables the ability to set different turbo ratio limits
to cores based on priority. aka FACT in the documentation.Core power: An Interface that allows user to define per core/tile
priority.There is a multi level help for commands and options. This can be used
to check required arguments for each feature and commands for the
feature.To start navigating the features start with
$sudo intel-speed-select --help
For help on a specific feature for example
$sudo intel-speed-select perf-profile --helpTo get help for a command for a feature for example
$sudo intel-speed-select perf-profile get-lock-status --helpSigned-off-by: Srinivas Pandruvada
Acked-by: Len Brown
Acked-by: Rafael J. Wysocki
Signed-off-by: Andy Shevchenko
09 Jan, 2019
2 commits
-
Add a script to the tools/ directory that shows if or why the running
kernel was tainted. The script was mostly written by Randy Dunlap; I
enhanced the script a bit. There does not appear to be a good home for
this script. so create tools/debugging for tools of this nature.Signed-off-by: Randy Dunlap
Signed-off-by: Thorsten Leemhuis
[ jc: fixed conflicts, rewrote changelog ]
Signed-off-by: Jonathan Corbet
12 Nov, 2018
1 commit
-
Commit 5620a0d1aacd ("firmware: delete in-kernel firmware") removed
ihex2fw tool together with the rest of the contents of firmware/
folder. Since that tool is quite useful for doing .ihex -> .fw
converstion, restore its original source code to tools/firmwareSuggested-by: Greg Kroah-Hartman
Cc: Kyle McMartin
Cc: Andrew Morton
Cc: Masahiro Yamada
Cc: David Woodhouse
Cc: Greg Kroah-Hartman
Cc: linux-kernel
Signed-off-by: Andrey Smirnov
Signed-off-by: Greg Kroah-Hartman
03 Oct, 2018
1 commit
-
Change tool compiling process in order to be build using the same
mechanism used in other linux tools (e.g. iio, perf, etc). This will
allow in future the buildroot tool to build and integrate this tool in
a more expeditious way.Update documentation accordingly.
Signed-off-by: Gustavo Pimentel
Signed-off-by: Lorenzo Pieralisi
Reviewed-by: Kishon Vijay Abraham I
19 Nov, 2017
1 commit
-
Pull x86 platform driver updates from Andy Shevchenko:
"Here is the collected material against Platform Drivers x86 subsystem.
It's rather bit busy cycle for PDx86, mostly due to Dell SMBIOS driver
activityFor this cycle we have quite an update for the Dell SMBIOS driver
including WMI work to provide an interface for SMBIOS tokens via sysfs
and WMI support for 2017+ Dell laptop models. SMM dispatcher code is
split into a separate driver followed by a new WMI dispatcher. The
latter provides a character device interface to user space.The git history also contains a merge of immutable branch from Wolfram
Sang in order to apply a dependent fix to the Intel CherryTrail
Battery Management driver.Other Intel drivers got a lot of cleanups. The Turbo Boost Max 3.0
support is added for Intel Skylake.Peaq WMI hotkeys driver gets its own maintainer and white list of
supported models.Silead DMI is expanded to support few additional platforms.
Tablet mode via GMMS ACPI method is added to support some ThinkPad
tablets.new driver:
- Add driver to force WMI Thunderbolt controller power statusasus-wmi:
- Add lightbar led supportdell-laptop:
- Allocate buffer before rfkill usedell-smbios:
- fix string overflow
- Add filtering support
- Introduce dispatcher for SMM calls
- Add a sysfs interface for SMBIOS tokens
- only run if proper oem string is detected
- Prefix class/select with cmd_
- Add pr_fmt definition to driverdell-smbios-smm:
- test for WSMTdell-smbios-wmi:
- release mutex lock on WMI call failure
- introduce userspace interface
- Add new WMI dispatcher driverdell-smo8800:
- remove redundant assignments to byte_datadell-wmi:
- don't check length returned
- clean up wmi descriptor check
- increase severity of some failures
- Do not match on descriptor GUID modalias
- Label driver as handling notificationsdell-*wmi*:
- Relay failed initial probe to dependent driversdell-wmi-descriptor:
- check if memory was allocated
- split WMI descriptor into it's own driverfujitsu-laptop:
- Fix radio LED detection
- Don't oops when FUJ02E3 is not presnthp_accel:
- Add quirk for HP ProBook 440 G4hp-wmi:
- Fix tablet mode detection for convertiblesideapad-laptop:
- Add Lenovo Yoga 920-13IKB to no_hw_rfkill dmi listintel_cht_int33fe:
- Update fusb302 type string, add properties
- make a couple of local functions static
- Work around BIOS bug on some devicesintel-hid:
- Power button suspend on Dell Latitude 7275intel_ips:
- Convert timers to use timer_setup()
- Remove FSF address from GPL notice
- Remove unneeded fields and label
- Keep pointer to struct device
- Use PCI_VDEVICE() macro
- Switch to new PCI IRQ allocation API
- Simplify error handling via devres APIintel_pmc_ipc:
- Revert Use MFD framework to create dependent devices
- Use MFD framework to create dependent devices
- Use spin_lock to protect GCR updates
- Use devm_* calls in driver probe functionintel_punit_ipc:
- Fix resource ioremap warningintel_telemetry:
- Remove useless default in Kconfig
- Add needed inclusion
- cleanup redundant headers
- Fix typos
- Fix load failure infointel_telemetry_debugfs:
- Use standard ARRAY_SIZE() macrointel_turbo_max_3:
- Add Skylake platformintel-wmi-thunderbolt:
- Silence error casesmlx-platform:
- make a couple of structures staticpeaq_wmi:
- Fix missing terminating entry for peaq_dmi_tablepeaq-wmi:
- Remove unnecessary checks from peaq_wmi_exit
- Add DMI check before binding to the WMI interface
- Revert Blacklist Lenovo ideapad 700-15ISK
- Blacklist Lenovo ideapad 700-15ISKsilead_dmi:
- Add silead, home-button property to some tablets
- Add entry for the Digma e200 tablet
- Fix GP-electronic T701 entry
- Add entry for the Chuwi Hi8 Pro tabletsony-laptop:
- Drop variable assignment in sony_nc_setup_rfkill()
- Fix error handling in sony_nc_setup_rfkill()thinkpad_acpi:
- Implement tablet mode using GMMS methodtools/wmi:
- add a sample for dell smbios communication over WMIwmi:
- release mutex on module acquistion failure
- create userspace interface for drivers
- Don't allow drivers to get each other's GUIDs
- Add new method wmidev_evaluate_method
- Destroy on cleanup rather than unregister
- Cleanup exit routine in reverse order of init
- Sort include list"* tag 'platform-drivers-x86-v4.15-1' of git://git.infradead.org/linux-platform-drivers-x86: (74 commits)
platform/x86: silead_dmi: Add silead, home-button property to some tablets
platform/x86: dell-laptop: Allocate buffer before rfkill use
platform/x86: dell-*wmi*: Relay failed initial probe to dependent drivers
platform/x86: dell-wmi-descriptor: check if memory was allocated
platform/x86: Revert intel_pmc_ipc: Use MFD framework to create dependent devices
platform/x86: dell-smbios-wmi: release mutex lock on WMI call failure
platform/x86: wmi: release mutex on module acquistion failure
platform/x86: dell-smbios: fix string overflow
platform/x86: intel_pmc_ipc: Use MFD framework to create dependent devices
platform/x86: intel_punit_ipc: Fix resource ioremap warning
platform/x86: dell-smo8800: remove redundant assignments to byte_data
platform/x86: hp-wmi: Fix tablet mode detection for convertibles
platform/x86: intel_ips: Convert timers to use timer_setup()
platform/x86: sony-laptop: Drop variable assignment in sony_nc_setup_rfkill()
platform/x86: sony-laptop: Fix error handling in sony_nc_setup_rfkill()
tools/wmi: add a sample for dell smbios communication over WMI
platform/x86: dell-smbios-wmi: introduce userspace interface
platform/x86: wmi: create userspace interface for drivers
platform/x86: dell-smbios: Add filtering support
platform/x86: dell-smbios-smm: test for WSMT
...
04 Nov, 2017
2 commits
-
Files removed in 'net-next' had their license header updated
in 'net'. We take the remove from 'net-next'.Signed-off-by: David S. Miller
-
This application uses the character device /dev/wmi/dell-smbios
to perform SMBIOS communications from userspace.It offers demonstrations of a few simple tasks:
- Running a class/select command
- Querying a token value
- Activating a tokenSigned-off-by: Mario Limonciello
Reviewed-by: Edward O'Callaghan
Signed-off-by: Darren Hart (VMware)
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
05 Oct, 2017
1 commit
-
We currently only have BPF tools in the tools/net directory.
We are about to add more BPF tools there, not necessarily
networking related, rename the directory and related Makefile
targets to bpf.Suggested-by: Daniel Borkmann
Signed-off-by: Jakub Kicinski
Reviewed-by: Simon Horman
Acked-by: Daniel Borkmann
Acked-by: Alexei Starovoitov
Signed-off-by: David S. Miller
06 Sep, 2017
2 commits
-
Pull spi updates from Mark Brown:
"A fairly quiet release for the SPI subsystem:- Move to using IDR for allocating bus numbers
- Modernisation of the ep93xx driver, removing a lot of open coding
and using the framework more- The tools have been moved to use the standard tools build system
and an install target added (there will be a fairly trivial
conflict with tip resulting from the changes in the main tools
Makefile)- A refactoring of the Qualcomm QUP driver which enables new variants
to be supported- Explicit support for the Freescale i.MX53 and i.MX6 SPI, Renesas
R-Car H3 and Rockchip RV1108 controllers"* tag 'spi-v4.14' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (71 commits)
spi: spi-falcon: drop check of boot select
spi: imx: fix use of native chip-selects with devicetree
spi: pl022: constify amba_id
spi: imx: fix little-endian build
spi: omap: Allocate bus number from spi framework
spi: Kernel coding style fixes
spi: imx: dynamic burst length adjust for PIO mode
spi: Pick spi bus number from Linux idr or spi alias
spi: rockchip: configure CTRLR1 according to size and data frame
spi: altera: Consolidate TX/RX data register access
spi: altera: Switch to SPI core transfer queue management
spi: rockchip: add compatible string for rv1108 spi
spi: qup: fix 64-bit build warning
spi: qup: hide warning for uninitialized variable
spi: spi-ep93xx: use the default master transfer queueing mechanism
spi: spi-ep93xx: remove private data 'current_msg'
spi: spi-ep93xx: pass the spi_master pointer around
spi: spi-ep93xx: absorb the interrupt enable/disable helpers
spi: spi-ep93xx: add spi master prepare_transfer_hardware()
spi: spi-ep93xx: use 32-bit read/write for all registers
... -
Pull staging/IIO driver updates from Greg KH:
"Here is the big staging and IIO driver update for 4.14-rc1.Lots of staging driver fixes and cleanups, including some reorginizing
of the lustre header files to try to impose some sanity on what is,
and what is not, the uapi for that filesystem.There are some tty core changes in here as well, as the speakup
drivers need them, and that's ok with me, they are sane and the
speakup code is getting nicer because of it.There is also the addition of the obiligatory new wifi driver, just
because it has been a release or two since we added our last one...Other than that, lots and lots of small coding style fixes, as usual.
All of these have been in linux-next for a while with no reported
issues"* tag 'staging-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (612 commits)
staging:rtl8188eu:core Fix remove unneccessary else block
staging: typec: fusb302: make structure fusb302_psy_desc static
staging: unisys: visorbus: make two functions static
staging: fsl-dpaa2/eth: fix off-by-one FD ctrl bitmaks
staging: r8822be: Simplify deinit_priv()
staging: r8822be: Remove some dead code
staging: vboxvideo: Use CONFIG_DRM_KMS_FB_HELPER to check for fbdefio availability
staging:rtl8188eu Fix comparison to NULL
staging: rts5208: rename mmc_ddr_tunning_rx_cmd to mmc_ddr_tuning_rx_cmd
Staging: Pi433: style fix - tabs and spaces
staging: pi433: fix spelling mistake: "preample" -> "preamble"
staging:rtl8188eu:core Fix Code Indent
staging: typec: fusb302: Export current-limit through a power_supply class dev
staging: typec: fusb302: Add support for USB2 charger detection through extcon
staging: typec: fusb302: Use client->irq as irq if set
staging: typec: fusb302: Get max snk mv/ma/mw from device-properties
staging: typec: fusb302: Set max supply voltage to 5V
staging: typec: tcpm: Add get_current_limit tcpc_dev callback
staging:rtl8188eu Use __func__ instead of function name
staging: lustre: coding style fixes found by checkpatch.pl
...
24 Aug, 2017
1 commit
-
Lguest seems to be rather unused these days. It has seen only patches
ensuring it still builds the last two years and its official state is
"Odd Fixes".Remove it in order to be able to clean up the paravirt code.
Signed-off-by: Juergen Gross
Acked-by: Rusty Russell
Acked-by: Thomas Gleixner
Cc: Linus Torvalds
Cc: Peter Zijlstra
Cc: boris.ostrovsky@oracle.com
Cc: lguest@lists.ozlabs.org
Cc: rusty@rustcorp.com.au
Cc: xen-devel@lists.xenproject.org
Link: http://lkml.kernel.org/r/20170816173157.8633-3-jgross@suse.com
Signed-off-by: Ingo Molnar
09 Aug, 2017
1 commit
-
Allow user to call install target.
Signed-off-by: Andy Shevchenko
Signed-off-by: Jonathan Cameron
26 Jul, 2017
1 commit
-
Allow user to call install target.
Signed-off-by: Andy Shevchenko
Signed-off-by: Mark Brown
05 Jun, 2017
1 commit
-
Allow user to call "liblockdep_install" target. Also add liblockdep to "all"
and "install" targets (as "help" command suggests).Signed-off-by: Alexander Sverdlin
Signed-off-by: Sasha Levin
Cc: Arnaldo Carvalho de Melo
Cc: Linus Torvalds
Cc: Linus Walleij
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: a.p.zijlstra@chello.nl
Cc: ben@decadent.org.uk
Link: http://lkml.kernel.org/r/20170525130005.5947-11-alexander.levin@verizon.com
Signed-off-by: Ingo Molnar
03 May, 2017
1 commit
-
The top level tools/Makefile includes kvm_stat as a target in help, but
the actual target is missing.Signed-off-by: Justin M. Forbes
Signed-off-by: Paolo Bonzini
22 Nov, 2016
1 commit
-
The uleds driver provides userspace LED devices. This tool is used to
create one of these devices and monitor the changes in brighness for
testing purposes.Signed-off-by: David Lechner
Signed-off-by: Jacek Anaszewski
23 Jun, 2016
1 commit
-
Allow user to call install target.
Signed-off-by: Andy Shevchenko
Acked-by: Alexandre Courbot
Tested-by: Alexandre Courbot
Signed-off-by: Linus Walleij
28 May, 2016
1 commit
-
Pull second batch of KVM updates from Radim Krčmář:
"General:- move kvm_stat tool from QEMU repo into tools/kvm/kvm_stat (kvm_stat
had nothing to do with QEMU in the first place -- the tool only
interprets debugfs)- expose per-vm statistics in debugfs and support them in kvm_stat
(KVM always collected per-vm statistics, but they were summarised
into global statistics)x86:
- fix dynamic APICv (VMX was improperly configured and a guest could
access host's APIC MSRs, CVE-2016-4440)- minor fixes
ARM changes from Christoffer Dall:
- new vgic reimplementation of our horribly broken legacy vgic
implementation. The two implementations will live side-by-side
(with the new being the configured default) for one kernel release
and then we'll remove the legacy one.- fix for a non-critical issue with virtual abort injection to guests"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (70 commits)
tools: kvm_stat: Add comments
tools: kvm_stat: Introduce pid monitoring
KVM: Create debugfs dir and stat files for each VM
MAINTAINERS: Add kvm tools
tools: kvm_stat: Powerpc related fixes
tools: Add kvm_stat man page
tools: Add kvm_stat vm monitor script
kvm:vmx: more complete state update on APICv on/off
KVM: SVM: Add more SVM_EXIT_REASONS
KVM: Unify traced vector format
svm: bitwise vs logical op typo
KVM: arm/arm64: vgic-new: Synchronize changes to active state
KVM: arm/arm64: vgic-new: enable build
KVM: arm/arm64: vgic-new: implement mapped IRQ handling
KVM: arm/arm64: vgic-new: Wire up irqfd injection
KVM: arm/arm64: vgic-new: Add vgic_v2/v3_enable
KVM: arm/arm64: vgic-new: vgic_init: implement map_resources
KVM: arm/arm64: vgic-new: vgic_init: implement vgic_init
KVM: arm/arm64: vgic-new: vgic_init: implement vgic_create
KVM: arm/arm64: vgic-new: vgic_init: implement kvm_vgic_hyp_init
...
25 May, 2016
1 commit
-
This tool displays kvm vm exit statistics to ease vm monitoring. It
takes its data from the kvm debugfs files or the vm tracepoints and
outputs them as a curses ui or simple text.It was moved from qemu, as it is dependent on the kernel whereas qemu
works with a large number of kernel versions, some of which may break
the script.Signed-off-by: Janosch Frank
Signed-off-by: Paolo Bonzini
26 Apr, 2016
1 commit
-
Fix perf_clean target to follow the same logic as perf target.
Fixes the following make invokation:
$ cd && make tools/perf_clean
Reported-by: TJ
Signed-off-by: Jiri Olsa
Tested-by: Arnaldo Carvalho de Melo
Cc: David Ahern
Cc: Namhyung Kim
Cc: Peter Zijlstra
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=116411
Link: http://lkml.kernel.org/r/1461615438-27894-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo
21 Mar, 2016
1 commit
-
Pull 'objtool' stack frame validation from Ingo Molnar:
"This tree adds a new kernel build-time object file validation feature
(ONFIG_STACK_VALIDATION=y): kernel stack frame correctness validation.
It was written by and is maintained by Josh Poimboeuf.The motivation: there's a category of hard to find kernel bugs, most
of them in assembly code (but also occasionally in C code), that
degrades the quality of kernel stack dumps/backtraces. These bugs are
hard to detect at the source code level. Such bugs result in
incorrect/incomplete backtraces most of time - but can also in some
rare cases result in crashes or other undefined behavior.The build time correctness checking is done via the new 'objtool'
user-space utility that was written for this purpose and which is
hosted in the kernel repository in tools/objtool/. The tool's (very
simple) UI and source code design is shaped after Git and perf and
shares quite a bit of infrastructure with tools/perf (which tooling
infrastructure sharing effort got merged via perf and is already
upstream). Objtool follows the well-known kernel coding style.Objtool does not try to check .c or .S files, it instead analyzes the
resulting .o generated machine code from first principles: it decodes
the instruction stream and interprets it. (Right now objtool supports
the x86-64 architecture.)From tools/objtool/Documentation/stack-validation.txt:
"The kernel CONFIG_STACK_VALIDATION option enables a host tool named
objtool which runs at compile time. It has a "check" subcommand
which analyzes every .o file and ensures the validity of its stack
metadata. It enforces a set of rules on asm code and C inline
assembly code so that stack traces can be reliable.Currently it only checks frame pointer usage, but there are plans to
add CFI validation for C files and CFI generation for asm files.For each function, it recursively follows all possible code paths
and validates the correct frame pointer state at each instruction.It also follows code paths involving special sections, like
.altinstructions, __jump_table, and __ex_table, which can add
alternative execution paths to a given instruction (or set of
instructions). Similarly, it knows how to follow switch statements,
for which gcc sometimes uses jump tables."When this new kernel option is enabled (it's disabled by default), the
tool, if it finds any suspicious assembly code pattern, outputs
warnings in compiler warning format:warning: objtool: rtlwifi_rate_mapping()+0x2e7: frame pointer state mismatch
warning: objtool: cik_tiling_mode_table_init()+0x6ce: call without frame pointer save/setup
warning: objtool:__schedule()+0x3c0: duplicate frame pointer save
warning: objtool:__schedule()+0x3fd: sibling call from callable instruction with changed frame pointer... so that scripts that pick up compiler warnings will notice them.
All known warnings triggered by the tool are fixed by the tree, most
of the commits in fact prepare the kernel to be warning-free. Most of
them are bugfixes or cleanups that stand on their own, but there are
also some annotations of 'special' stack frames for justified cases
such entries to JIT-ed code (BPF) or really special boot time code.There are two other long-term motivations behind this tool as well:
- To improve the quality and reliability of kernel stack frames, so
that they can be used for optimized live patching.- To create independent infrastructure to check the correctness of
CFI stack frames at build time. CFI debuginfo is notoriously
unreliable and we cannot use it in the kernel as-is without extra
checking done both on the kernel side and on the build side.The quality of kernel stack frames matters to debuggability as well,
so IMO we can merge this without having to consider the live patching
or CFI debuginfo angle"* 'core-objtool-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (52 commits)
objtool: Only print one warning per function
objtool: Add several performance improvements
tools: Copy hashtable.h into tools directory
objtool: Fix false positive warnings for functions with multiple switch statements
objtool: Rename some variables and functions
objtool: Remove superflous INIT_LIST_HEAD
objtool: Add helper macros for traversing instructions
objtool: Fix false positive warnings related to sibling calls
objtool: Compile with debugging symbols
objtool: Detect infinite recursion
objtool: Prevent infinite recursion in noreturn detection
objtool: Detect and warn if libelf is missing and don't break the build
tools: Support relative directory path for 'O='
objtool: Support CROSS_COMPILE
x86/asm/decoder: Use explicitly signed chars
objtool: Enable stack metadata validation on 64-bit x86
objtool: Add CONFIG_STACK_VALIDATION option
objtool: Add tool to perform compile-time stack metadata validation
x86/kprobes: Mark kretprobe_trampoline() stack frame as non-standard
sched: Always inline context_switch()
...
29 Feb, 2016
1 commit
-
This adds a host tool named objtool which has a "check" subcommand which
analyzes .o files to ensure the validity of stack metadata. It enforces
a set of rules on asm code and C inline assembly code so that stack
traces can be reliable.For each function, it recursively follows all possible code paths and
validates the correct frame pointer state at each instruction.It also follows code paths involving kernel special sections, like
.altinstructions, __jump_table, and __ex_table, which can add
alternative execution paths to a given instruction (or set of
instructions). Similarly, it knows how to follow switch statements, for
which gcc sometimes uses jump tables.Here are some of the benefits of validating stack metadata:
a) More reliable stack traces for frame pointer enabled kernels
Frame pointers are used for debugging purposes. They allow runtime
code and debug tools to be able to walk the stack to determine the
chain of function call sites that led to the currently executing
code.For some architectures, frame pointers are enabled by
CONFIG_FRAME_POINTER. For some other architectures they may be
required by the ABI (sometimes referred to as "backchain pointers").For C code, gcc automatically generates instructions for setting up
frame pointers when the -fno-omit-frame-pointer option is used.But for asm code, the frame setup instructions have to be written by
hand, which most people don't do. So the end result is that
CONFIG_FRAME_POINTER is honored for C code but not for most asm code.For stack traces based on frame pointers to be reliable, all
functions which call other functions must first create a stack frame
and update the frame pointer. If a first function doesn't properly
create a stack frame before calling a second function, the *caller*
of the first function will be skipped on the stack trace.For example, consider the following example backtrace with frame
pointers enabled:[] dump_stack+0x4b/0x63
[] cmdline_proc_show+0x12/0x30
[] seq_read+0x108/0x3e0
[] proc_reg_read+0x42/0x70
[] __vfs_read+0x37/0x100
[] vfs_read+0x86/0x130
[] SyS_read+0x58/0xd0
[] entry_SYSCALL_64_fastpath+0x12/0x76It correctly shows that the caller of cmdline_proc_show() is
seq_read().If we remove the frame pointer logic from cmdline_proc_show() by
replacing the frame pointer related instructions with nops, here's
what it looks like instead:[] dump_stack+0x4b/0x63
[] cmdline_proc_show+0x12/0x30
[] proc_reg_read+0x42/0x70
[] __vfs_read+0x37/0x100
[] vfs_read+0x86/0x130
[] SyS_read+0x58/0xd0
[] entry_SYSCALL_64_fastpath+0x12/0x76Notice that cmdline_proc_show()'s caller, seq_read(), has been
skipped. Instead the stack trace seems to show that
cmdline_proc_show() was called by proc_reg_read().The benefit of "objtool check" here is that because it ensures that
*all* functions honor CONFIG_FRAME_POINTER, no functions will ever[*]
be skipped on a stack trace.[*] unless an interrupt or exception has occurred at the very
beginning of a function before the stack frame has been created,
or at the very end of the function after the stack frame has been
destroyed. This is an inherent limitation of frame pointers.b) 100% reliable stack traces for DWARF enabled kernels
This is not yet implemented. For more details about what is planned,
see tools/objtool/Documentation/stack-validation.txt.c) Higher live patching compatibility rate
This is not yet implemented. For more details about what is planned,
see tools/objtool/Documentation/stack-validation.txt.To achieve the validation, "objtool check" enforces the following rules:
1. Each callable function must be annotated as such with the ELF
function type. In asm code, this is typically done using the
ENTRY/ENDPROC macros. If objtool finds a return instruction
outside of a function, it flags an error since that usually indicates
callable code which should be annotated accordingly.This rule is needed so that objtool can properly identify each
callable function in order to analyze its stack metadata.2. Conversely, each section of code which is *not* callable should *not*
be annotated as an ELF function. The ENDPROC macro shouldn't be used
in this case.This rule is needed so that objtool can ignore non-callable code.
Such code doesn't have to follow any of the other rules.3. Each callable function which calls another function must have the
correct frame pointer logic, if required by CONFIG_FRAME_POINTER or
the architecture's back chain rules. This can by done in asm code
with the FRAME_BEGIN/FRAME_END macros.This rule ensures that frame pointer based stack traces will work as
designed. If function A doesn't create a stack frame before calling
function B, the _caller_ of function A will be skipped on the stack
trace.4. Dynamic jumps and jumps to undefined symbols are only allowed if:
a) the jump is part of a switch statement; or
b) the jump matches sibling call semantics and the frame pointer has
the same value it had on function entry.This rule is needed so that objtool can reliably analyze all of a
function's code paths. If a function jumps to code in another file,
and it's not a sibling call, objtool has no way to follow the jump
because it only analyzes a single file at a time.5. A callable function may not execute kernel entry/exit instructions.
The only code which needs such instructions is kernel entry code,
which shouldn't be be in callable functions anyway.This rule is just a sanity check to ensure that callable functions
return normally.It currently only supports x86_64. I tried to make the code generic so
that support for other architectures can hopefully be plugged in
relatively easily.On my Lenovo laptop with a i7-4810MQ 4-core/8-thread CPU, building the
kernel with objtool checking every .o file adds about three seconds of
total build time. It hasn't been optimized for performance yet, so
there are probably some opportunities for better build performance.Signed-off-by: Josh Poimboeuf
Cc: Andrew Morton
Cc: Andy Lutomirski
Cc: Arnaldo Carvalho de Melo
Cc: Bernd Petrovitsch
Cc: Borislav Petkov
Cc: Chris J Arges
Cc: Jiri Slaby
Cc: Linus Torvalds
Cc: Michal Marek
Cc: Namhyung Kim
Cc: Pedro Alves
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: live-patching@vger.kernel.org
Link: http://lkml.kernel.org/r/f3efb173de43bd067b060de73f856567c0fa1174.1456719558.git.jpoimboe@redhat.com
Signed-off-by: Ingo Molnar
09 Feb, 2016
1 commit
-
This creates GPIO tools under tools/gpio/* and adds a single
example program to list the GPIOs on a system. When proper
devices are created it provides this minimal output:Cc: Johan Hovold
Cc: Michael Welling
Cc: Markus Pargmann
Signed-off-by: Linus Walleij
15 Jan, 2016
1 commit
-
Pull perf fixes from Ingo Molnar:
"Tooling fixes, the biggest patch is one that decouples the kernel's
list.h from tooling list.h"* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (23 commits)
perf tools: Fallback to srcdir/Documentation/tips.txt
perf ui/tui: Print helpline message as is
perf tools: Set and pass DOCDIR to builtin-report.c
perf tools: Add file_only config option to strlist
perf tools: Add more usage tips
perf record: Add --buildid-all option
tools subcmd: Add missing NORETURN define for parse-options.h
tools: Fix formatting of the "make -C tools" help message
tools: Make list.h self-sufficient
perf tools: Fix mmap2 event allocation in synthesize code
perf stat: Fix recort_usage typo
perf test: Reset err after using it hold errcode in hist testcases
perf test: Fix false TEST_OK result for 'perf test hist'
tools build: Add BPF feature check to test-all
perf bpf: Fix build breakage due to libbpf
tools: Move Makefile.arch from perf/config to tools/scripts
perf tools: Fix PowerPC native building
perf tools: Fix phony build target for build-test
perf tools: Add -lutil in python lib list for broken python-config
perf tools: Add missing sources to perf's MANIFEST
...
14 Jan, 2016
1 commit
-
Pull spi updates from Mark Brown:
"A quiet release for SPI, not even many driver updates:- Add a dummy loopback driver for use in exercising framework
features during development.- Move the test utilities to tools/ and add support for transferring
data to and from a file instead of stdin and stdout to spidev_test.- Support for Mediatek MT2701 and Renesas AG5 deices"
* tag 'spi-v4.5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (69 commits)
spi: loopback: fix typo in MODULE_PARM_DESC
spi: sun4i: Prevent chip-select from being activated twice before a transfer
spi: loopback-test: spi_check_rx_ranges can get always done
spi: loopback-test: rename method spi_test_fill_tx to spi_test_fill_pattern
spi: loopback-test: write rx pattern also when running without tx_buf
spi: fsl-espi: expose maximum transfer size limit
spi: expose master transfer size limitation.
spi: zynq: use to_platform_device()
spi: cadence: use to_platform_device()
spi: mediatek: Add spi support for mt2701 IC
spi: mediatek: merge all identical compat to mtk_common_compat
spi: mtk: Add bindings for mediatek MT2701 soc platform
spi: mediatek: Prevent overflows in FIFO transfers
spi: s3c64xx: Remove unused platform_device_id entries
spi: use to_spi_device
spi: dw: Use SPI_TMOD_TR rather than magic const 0 to set tmode
spi: imx: defer spi initialization, if DMA engine is
spi: imx: return error from dma channel request
spi: imx: enable loopback only for ECSPI controller family
spi: imx: fix loopback mode setup after controller reset
...
12 Jan, 2016
2 commits
-
Align the x86_energy_perf_policy line with the others and restore the
original alphabetical sorting.Signed-off-by: Josh Poimboeuf
Cc: "H. Peter Anvin"
Cc: Andi Kleen
Cc: Andrew Morton
Cc: Andy Lutomirski
Cc: Bernd Petrovitsch
Cc: Borislav Petkov
Cc: Chris J Arges
Cc: Jiri Slaby
Cc: Linus Torvalds
Cc: Michal Marek
Cc: Namhyung Kim
Cc: Pedro Alves
Cc: Peter Zijlstra
Cc: Thomas Gleixner
Cc: live-patching@vger.kernel.org
Cc: x86@kernel.org
Link: http://lkml.kernel.org/r/572931227adbf1fc9ca96e1dae3ef2e89387feca.1450442274.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo -
…ic/s3c64xx', 'spi/topic/sh-msiof' and 'spi/topic/spidev' into spi-next
11 Jan, 2016
1 commit
-
Adding missing clean targets for following tools directories:
lib/bpf
lib/subcmd
buildThis are now cleaned via 'make -C tools clean' command.
Reported-and-Tested-by: Arnaldo Carvalho de Melo
Signed-off-by: Jiri Olsa
Cc: David Ahern
Cc: Namhyung Kim
Cc: Peter Zijlstra
Cc: Wang Nan
Link: http://lkml.kernel.org/r/1452509693-13452-2-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo
23 Nov, 2015
1 commit
-
Jon Corbet requested this code moved with the last changeset,
https://lkml.org/lkml/2015/3/1/144,
but the patch was not applied because it missed the Makefile.
Moved spidev_test, spidev_fdx and their Makefile infrastructure.Signed-off-by: Joshua Clayton
Signed-off-by: Mark Brown
19 Nov, 2015
1 commit
-
Fix copy/paste error in selftests_install rule which was copy-pasted
from the clean rule but not properly changed.Signed-off-by: Kevin Hilman
Cc: Bamvor Jian Zhang
Cc: Jiri Olsa
Cc: Jonathan Cameron
Cc: Michael Ellerman
Cc: Pali Rohar
Cc: Pavel Machek
Cc: Roberta Dobrescu
Cc: Shuah Khan
Cc: linaro-kernel@lists.linaro.org
Link: http://lkml.kernel.org/r/1447797261-1775-1-git-send-email-khilman@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo
13 Nov, 2015
1 commit
-
Signed-off-by: Kamal Mostafa
Acked-by: Pavel Machek
Cc: Jiri Olsa
Cc: Jonathan Cameron
Cc: Pali Rohar
Cc: Roberta Dobrescu
Link: http://lkml.kernel.org/r/1447280736-2161-2-git-send-email-kamal@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo
12 Nov, 2015
1 commit
-
Signed-off-by: Kamal Mostafa
Cc: Jiri Olsa
Cc: Pali Rohar
Cc: Roberta Dobrescu
Link: http://lkml.kernel.org/r/1447280736-2161-1-git-send-email-kamal@canonical.com
Signed-off-by: Arnaldo Carvalho de Melo
27 Jun, 2015
1 commit
-
Pull staging driver updates from Greg KH:
"Here's the big, really big, staging tree patches for 4.2-rc1.Loads of stuff in here, almost all just coding style fixes / churn,
and a few new drivers as well, one of which I just disabled from the
build a few minutes ago due to way too many build warnings.Other than the one "disable this driver" patch, all of these have been
in linux-next for quite a while with no reported issues"* tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1163 commits)
staging: wilc1000: disable driver due to build warnings
Staging: rts5208: fix CHANGE_LINK_STATE value
Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis
Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines
Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators
Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs
Staging: sm750fb: ddk750_swi2c.h: Shorten lines to under 80 characters
Staging: sm750fb: ddk750_swi2c.h: Replace spaces with tabs
Staging: sm750fb: modedb.h: Shorten lines to under 80 characters
Staging: sm750fb: modedb.h: Replace spaces with tabs
staging: comedi: addi_apci_3120: rename 'this_board' variables
staging: comedi: addi_apci_1516: rename 'this_board' variables
staging: comedi: ni_atmio: cleanup ni_getboardtype()
staging: comedi: vmk80xx: sanity check context used to get the boardinfo
staging: comedi: vmk80xx: rename 'boardinfo' variables
staging: comedi: dt3000: rename 'this_board' variables
staging: comedi: adv_pci_dio: rename 'this_board' variables
staging: comedi: cb_pcidas64: rename 'thisboard' variables
staging: comedi: cb_pcidas: rename 'thisboard' variables
staging: comedi: me4000: rename 'thisboard' variables
...
25 Jun, 2015
1 commit
-
Pull documentation updates from Jonathan Corbet:
"The main thing here is Ingo's big subdirectory documenting feature
support for each architecture. Beyond that, it's the usual pile of
fixes, tweaks, and small additions"* tag 'docs-for-linus' of git://git.lwn.net/linux-2.6: (79 commits)
doc:md: fix typo in md.txt.
Documentation/mic/mpssd: don't build x86 userspace when cross compiling
Documentation/prctl: don't build tsc tests when cross compiling
Documentation/vDSO: don't build tests when cross compiling
Doc:ABI/testing: Fix typo in sysfs-bus-fcoe
Doc: Docbook: Change wikipedia's URL from http to https in scsi.tmpl
Doc: Change wikipedia's URL from http to https
Documentation/kernel-parameters: add missing pciserial to the earlyprintk
Doc:pps: Fix typo in pps.txt
kbuild : Fix documentation of INSTALL_HDR_PATH
Documentation: filesystems: updated struct file_operations documentation in vfs.txt
kbuild: edit explanation of clean-files variable
Doc: ja_JP: Fix typo in HOWTO
Move freefall program from Documentation/ to tools/
Documentation: ARM: EXYNOS: Describe boot loaders interface
Doc:nfc: Fix typo in nfc-hci.txt
vfs: Minor documentation fix
Doc: networking: txtimestamp: fix printf format warning
Documentation, intel_pstate: Improve legacy mode internal governors description
Documentation: extend use case for EXPORT_SYMBOL_GPL()
...
09 Jun, 2015
1 commit
-
Signed-off-by: Pali Rohár
Acked-by: Pavel Machek
Signed-off-by: Jonathan Corbet