Re: [Cocci] [PATCH] coccinelle: misc: add array_size_dup script to detect missed overlow checks

2020-06-18 Thread Julia Lawall
On Thu, 18 Jun 2020, Kees Cook wrote: > On Wed, Jun 17, 2020 at 08:54:03PM +0200, Julia Lawall wrote: > > > > > > On Wed, 17 Jun 2020, Kees Cook wrote: > > > > > On Mon, Jun 15, 2020 at 01:20:45PM +0300, Denis Efremov wrote: > > > > +@as@ > > > > +expression E1, E2; > > > > +@@ > > > > + > > >

Re: [PATCH 7/9] mm, slub: introduce kmem_cache_debug_flags()

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 10:37:07AM +0200, Vlastimil Babka wrote: > On 6/10/20 6:31 PM, Vlastimil Babka wrote: > > There are few places that call kmem_cache_debug(s) (which tests if any of > > debug > > flags are enabled for a cache) immediatelly followed by a test for a > > specific > > flag. The

[PATCH] vfio: Cleanup allowed driver naming

2020-06-18 Thread Alex Williamson
No functional change, avoid non-inclusive naming schemes. Signed-off-by: Alex Williamson --- drivers/vfio/vfio.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 580099afeaff..833da937b7fc 100644 --- a/drivers/vfio

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 12:10:38PM +0200, Vlastimil Babka wrote: > > On 6/17/20 7:49 PM, Kees Cook wrote: > > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > >> The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > >> always get the cache from its page in k

Re: [PATCH] kunit: kunit_tool: Fix invalid result when build fails

2020-06-18 Thread Brendan Higgins
On Mon, Jun 15, 2020 at 11:47 PM David Gow wrote: > > When separating out different phases of running tests[1] > (build/exec/parse/etc), the format of the KunitResult tuple changed > (adding an elapsed_time variable). This is not populated during a build > failure, causing kunit.py to crash. > > T

[PATCH] restore behaviour of CAP_SYS_ADMIN allowing the loading of net bpf program

2020-06-18 Thread Maciej Żenczykowski
From: Maciej Żenczykowski This is a 5.8-rc1 regression. Cc: Alexei Starovoitov Cc: Daniel Borkmann Fixes: 2c78ee898d8f ("bpf: Implement CAP_BPF") Signed-off-by: Maciej Żenczykowski --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/bpf/syscall

Re: [PATCH 2/2] nvmet: remove workarounds for gcc bug wrt unnamed fields in initializers

2020-06-18 Thread Niklas Cassel
On Thu, Jun 18, 2020 at 05:29:00PM +, Chaitanya Kulkarni wrote: > I'm not against the code cleanup and it always welcome. > Please also have a look at other comment. > > >> What is the issue with existing code that we need this patch for ? > >> > > > > Hello Chaitanya, > > > > This is just

Re: [PATCH v2 2/4] ARC: ARCv2: support loop buffer (LPB) disabling

2020-06-18 Thread Vineet Gupta
On 6/18/20 12:50 PM, Eugeniy Paltsev wrote: > Hi Vineet, > > could you also peek this patch to for-curr as we don't have any disagreement > about it? > > I'll respin the rest of the patches later. Thanks. > --- > Eugeniy Paltsev Added ! -Vineet

2dd4d163cd9c ("drm/nouveau: remove open-coded version of remove_conflicting_pci_framebuffers()")

2020-06-18 Thread Borislav Petkov
Hi, my test box won't boot 5.8-rc1 all the way but stops at ... fb0: switching to nouveaufb from EFI VGA <-- EOF I've bisected it to the commit in $Subject, see below. Unfortunately, it doesn't revert cleanly so I can't really do the final test of reverting it ontop of 5.8-rc1 to confirm that th

Re: [LTP] [x86/entry] 2bbc68f837: ltp.ptrace08.fail

2020-06-18 Thread Thomas Gleixner
Cyril Hrubis writes: > What is does is to write: > > (void*)1 to u_debugreg[0] > (void*)1 to u_debugreg[7] > do_debug addr to u_debugreg[0] > > Looking at the kernel code the write to register 7 enables the breakpoints and > what we attempt here is to change an invalid address to

[PATCH v2 1/2] nvme: remove workarounds for gcc bug wrt unnamed fields in initializers

2020-06-18 Thread Niklas Cassel
Workarounds for gcc issues with initializers and anon unions was first introduced in commit e44ac588cd61 ("drivers/block/nvme-core.c: fix build with gcc-4.4.4"). The gcc bug in question has been fixed since gcc 4.6.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 The minimum gcc version for

[PATCH v2 0/2] remove workarounds for gcc bug wrt unnamed fields in initializers

2020-06-18 Thread Niklas Cassel
Make the nvme code more uniform by initializing struct members at declaration time. This change is done both in drivers/nvme/host/ and drivers/nvme/target/. This is how the design pattern was in nvme, before workarounds for a gcc bug were introduced in commit e44ac588cd61 ("drivers/block/nvme-core

[PATCH v2 2/2] nvmet: remove workarounds for gcc bug wrt unnamed fields in initializers

2020-06-18 Thread Niklas Cassel
Workarounds for gcc issues with initializers and anon unions was first introduced in commit e44ac588cd61 ("drivers/block/nvme-core.c: fix build with gcc-4.4.4"). The gcc bug in question has been fixed since gcc 4.6.0: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 The minimum gcc version for

Re: [PATCH v2 09/16] rcu/tree: Maintain separate array for vmalloc ptrs

2020-06-18 Thread Uladzislau Rezki
On Thu, Jun 18, 2020 at 10:35:27AM -0700, Matthew Wilcox wrote: > On Thu, Jun 18, 2020 at 07:30:49PM +0200, Uladzislau Rezki wrote: > > > I'd suggest: > > > > > > rcu_lock_acquire(&rcu_callback_map); > > > trace_rcu_invoke_kfree_bulk_callback(rcu_state.name, > >

Re: [PATCH 0/3] zone-append support in aio and io-uring

2020-06-18 Thread Matias Bjørling
On 18/06/2020 21.21, Kanchan Joshi wrote: On Thu, Jun 18, 2020 at 10:04:32AM +0200, Matias Bjørling wrote: On 17/06/2020 19.23, Kanchan Joshi wrote: This patchset enables issuing zone-append using aio and io-uring direct-io interface. For aio, this introduces opcode IOCB_CMD_ZONE_APPEND. Appl

Re: [PATCH 1/2] video: ssd1307fb: Print PWM period using 64-bit format specifier

2020-06-18 Thread Guru Das Srinagesh
On Wed, Jun 17, 2020 at 09:18:34AM +0200, Geert Uytterhoeven wrote: > Hi Thierry, > > On Mon, Jun 15, 2020 at 4:17 PM Thierry Reding > wrote: > > The PWM core will soon change the duty cycle and period of PWMs to 64 > > bits to allow for a broader range of values. Use a 64-bit format > > specifi

Re: [PATCH v4 02/11] fs: Move __scm_install_fd() to __fd_install_received()

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 10:56:14AM +0200, Christian Brauner wrote: > On Mon, Jun 15, 2020 at 08:25:15PM -0700, Kees Cook wrote: > > In preparation for users of the "install a received file" logic outside > > of net/ (pidfd and seccomp), relocate and rename __scm_install_fd() from > > net/core/scm.c

[PATCH] MAINTAINERS: fix incorrect directory reference

2020-06-18 Thread Ralf Ramsauer
the below-mentioned commit moved headers to inlucde/linux/soc/mmp. MAINTAINERS was updated, but include/ was omitted. Fixes: 32adcaa010 ("ARM: mmp: move cputype.h to include/linux/soc/") Signed-off-by: Ralf Ramsauer --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --gi

Re: [PATCH 9/9] mm, slab/slub: move and improve cache_from_obj()

2020-06-18 Thread Roman Gushchin
On Thu, Jun 18, 2020 at 12:10:38PM +0200, Vlastimil Babka wrote: > > On 6/17/20 7:49 PM, Kees Cook wrote: > > On Wed, Jun 10, 2020 at 06:31:35PM +0200, Vlastimil Babka wrote: > >> The function cache_from_obj() was added by commit b9ce5ef49f00 ("sl[au]b: > >> always get the cache from its page in k

Re: [PATCH v3 2/6] dt-bindings: usb: Add Qualcomm PMIC type C controller dt-binding

2020-06-18 Thread Wesley Cheng
On 6/18/2020 11:33 AM, Rob Herring wrote: > On Wed, Jun 17, 2020 at 12:02 PM Wesley Cheng wrote: > > You are duplicating everything in usb-connector.yaml. You should have > a $ref to it. > Hi Rob, Sure, I will add a reference to that doc. > > This is wrong. The connector binding says port

Re: [PATCH v4 5/5] spi: spi-geni-qcom: Don't keep a local state variable

2020-06-18 Thread Doug Anderson
Hi, On Thu, Jun 18, 2020 at 11:05 AM Stephen Boyd wrote: > > Quoting Douglas Anderson (2020-06-18 08:06:26) > > @@ -126,20 +120,23 @@ static void handle_fifo_timeout(struct spi_master > > *spi, > > struct geni_se *se = &mas->se; > > > > spin_lock_irq(&mas->lock); > > - rein

Re: [PATCH v13] perf: Sharing PMU counters across compatible events

2020-06-18 Thread Song Liu
> On Jun 18, 2020, at 2:09 AM, Athira Rajeev > wrote: > > > >> On 02-May-2020, at 5:51 AM, Song Liu wrote: >> >> This patch tries to enable PMU sharing. When multiple perf_events are >> counting the same metric, they can share the hardware PMU counter. We >> call these events as "compatib

[PATCH] extend IMA boot_aggregate with kernel measurements

2020-06-18 Thread Maurizio Drocco
IMA is not considering TPM registers 8-9 when calculating the boot aggregate. When registers 8-9 are used to store measurements of the kernel and its command line (e.g., grub2 bootloader with tpm module enabled), IMA should include them in the boot aggregate. Signed-off-by: Maurizio Drocco --- s

Re: [PATCH v5 3/7] fs: Add fd_install_received() wrapper for __fd_install_received()

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 05:49:19AM +, Sargun Dhillon wrote: > On Wed, Jun 17, 2020 at 03:03:23PM -0700, Kees Cook wrote: > > [...] > > static inline int fd_install_received_user(struct file *file, int __user > > *ufd, > >unsigned int o_flags) > > { > >

[PATCH] ima_evm_utils: extended calc_bootaggr to PCRs 8 - 9

2020-06-18 Thread Maurizio Drocco
From: Maurizio If PCRs 8 - 9 are set (i.e. not all-zeros), cal_bootaggr should include them into the digest. Signed-off-by: Maurizio Drocco --- src/evmctl.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/evmctl.c b/src/evmctl.c index 1d065ce..554571e 1

Re: WARNING with LBR + precise_ip=2 + bpf_get_stackid()

2020-06-18 Thread Song Liu
> On Jun 18, 2020, at 11:33 AM, Peter Zijlstra wrote: > > On Thu, Jun 18, 2020 at 05:25:24PM +, Song Liu wrote: > [...] >> 0xfe4d1380 __start_orc_unwind >> 0xfe4d1388 unwind_next_frame.cold.7 >> 0xfe4d13c8 perf_callchain_kernel >> 0xfe4d1418 entry_SYSCALL

Re: [Nouveau] 2dd4d163cd9c ("drm/nouveau: remove open-coded version of remove_conflicting_pci_framebuffers()")

2020-06-18 Thread Ilia Mirkin
Hi Boris, There was a fixup to that patch that you'll also have to revert first -- 7dbbdd37f2ae7dd4175ba3f86f4335c463b18403. I guess there's some subtle difference between the old open-coded logic and the helper, they were supposed to be identical. Cheers, -ilia On Thu, Jun 18, 2020 at 4:09 P

Re: [PATCH] Fix unwind_frame for clang-built kernels

2020-06-18 Thread Nick Desaulniers
On Tue, Jun 16, 2020 at 3:36 PM 'Nathan Huckleberry' via Clang Built Linux wrote: > > Since clang does not push pc and sp in function prologues, the current > implementation of unwind_frame does not work. By using the previous > frame's lr/fp instead of saved pc/sp we get valid unwinds on clang-bu

[PATCH] dt-bindings: display: Convert connectors to DT schema

2020-06-18 Thread Rob Herring
Convert the analog TV, DVI, HDMI, and VGA connector bindings to DT schema format. Cc: Sam Ravnborg Cc: Laurent Pinchart Cc: Maxime Ripard Signed-off-by: Rob Herring --- I put myself as maintainer, but would be happy if someone else was like one of the Cc'ed people. .../display/connector/ana

Re: common KUnit Kconfig and file naming (was: Re: [PATCH] lib: kunit_test_overflow: add KUnit test of check_*_overflow functions)

2020-06-18 Thread Brendan Higgins
On Tue, Jun 16, 2020 at 9:21 PM David Gow wrote: > > On Tue, Jun 16, 2020 at 5:40 PM Alan Maguire wrote: > > > > On Tue, 16 Jun 2020, David Gow wrote: > > > > > CONFIG_PM_QOS_KUNIT_TESTOn Mon, Jun 15, 2020 at 1:48 AM Kees Cook > > > wrote: > > > > > > > > On Sat, Jun 13, 2020 at 02:51:17PM +0800

Re: [PATCH] Fix unwind_frame for clang-built kernels

2020-06-18 Thread Nick Desaulniers
On Thu, Jun 18, 2020 at 1:22 PM Nick Desaulniers wrote: > > On Tue, Jun 16, 2020 at 3:36 PM 'Nathan Huckleberry' via Clang Built > Linux wrote: > > > > Since clang does not push pc and sp in function prologues, the current > > implementation of unwind_frame does not work. By using the previous >

Re: [PATCH] kunit: fix KconfigParseError by ignoring CC_VERSION_TEXT

2020-06-18 Thread Brendan Higgins
On Wed, Jun 17, 2020 at 8:57 PM Vitor Massaru Iha wrote: > > Commit 8b59cd81dc5 ("kbuild: ensure full rebuild when the compiler > is updated") added the environment variable CC_VERSION_TEXT, > parse_from_string() doesn't expect a string and this causes the > failure below: > > [iha@bbking linux]$

[PATCH 1/7] rcu/segcblist: Prevent useless GP start if no CBs to accelerate

2020-06-18 Thread Joel Fernandes (Google)
rcu_segcblist_accelerate() returns true if a GP is to be started/requested and false if not. During tracing, I found that it is asking that GPs be requested The exact flow seems to be something like: 1. Callbacks are queued on CPU A - into the NEXT list. 2. softirq runs on CPU A, accelerate all CB

[PATCH 7/7] rcutorture: Add number of GP information to reports

2020-06-18 Thread Joel Fernandes (Google)
Add 2 things to get visiblity around number of grace periods. 1. Add number of GPs to End-state print. 2. Just like End-state, add GP state to Start-state. This helps determine how many GPs elapsed during a run of rcutorture and what the initial state was. Signed-off-by: Joel Fernandes (Google)

[PATCH 2/7] rcu/trace: Add tracing for how segcb list changes

2020-06-18 Thread Joel Fernandes (Google)
Track how the segcb list changes before/after acceleration, during queuing and during dequeuing. This has proved useful to discover an optimization to avoid unwanted GP requests when there are no callbacks accelerated. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25 +

[PATCH 5/7] rcu/trace: Use rsp's gp_seq in acceleration's rcu_grace_period tracepoint

2020-06-18 Thread Joel Fernandes (Google)
During acceleration of CB, the rsp's gp_seq is rcu_seq_snap'd. This is the value used for acceleration - it is the value of gp_seq at which it is safe the execute all callbacks in the callback list. The rdp's gp_seq is not very useful for this scenario. Make rcu_grace_period report the rsp's gp_se

[PATCH 6/7] rcutorture: Add support to get the number of wakeups of main GP kthread

2020-06-18 Thread Joel Fernandes (Google)
This is useful to check for any improvements or degradation related to number of GP kthread wakeups during testing. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/Kconfig.debug | 1 + kernel/rcu/rcu.h | 2 ++ kernel/rcu/rcutorture.c | 23 ++- kernel/rcu/tree

[PATCH 3/7] rcu/trace: Add name of the source for gp_seq

2020-06-18 Thread Joel Fernandes (Google)
The gp_seq value can come from either of rdp, rsp or rnp. Only the rsp is the global source of truth (most accurate GP info). The rnp can be off by ~1 and the rdp can be off by way more. Add some more context to traces to clarify where it comes from. Signed-off-by: Joel Fernandes (Google) --- i

[PATCH 4/7] rcu/trace: Print negative GP numbers correctly

2020-06-18 Thread Joel Fernandes (Google)
GP numbers start from -300 and gp_seq numbers start of -1200 (for a shift of 2). These negative numbers are printed as unsigned long which not only takes up more text space, but is rather confusing to the reader as they have to constantly expend energy to truncate the number. Just print the negativ

Re: [PATCH v2] kunit: fix KconfigParseError handling CC_VERSION_TEXT

2020-06-18 Thread Brendan Higgins
On Thu, Jun 18, 2020 at 5:39 AM Vitor Massaru Iha wrote: > > Commit 8b59cd81dc5 ("kbuild: ensure full rebuild when the compiler > is updated") added the environment variable CC_VERSION_TEXT, > parse_from_string() doesn't expect a string in value field and this > causes the failure below: > > [iha@

Re: [PATCH v2 09/16] rcu/tree: Maintain separate array for vmalloc ptrs

2020-06-18 Thread Uladzislau Rezki
On Thu, Jun 18, 2020 at 12:03:59PM -0700, Paul E. McKenney wrote: > On Thu, Jun 18, 2020 at 08:34:48PM +0200, Uladzislau Rezki wrote: > > > > > > > > > > I suspect that he would like to keep the tracing. > > > > > > > > > > It might be worth trying the branches, given that they would be > > > >

Re: [PATCH] kunit: fix KconfigParseError by ignoring CC_VERSION_TEXT

2020-06-18 Thread Vitor Massaru Iha
On Thu, 2020-06-18 at 13:29 -0700, Brendan Higgins wrote: > On Wed, Jun 17, 2020 at 8:57 PM Vitor Massaru Iha > wrote: > > Commit 8b59cd81dc5 ("kbuild: ensure full rebuild when the compiler > > is updated") added the environment variable CC_VERSION_TEXT, > > parse_from_string() doesn't expect a st

[PATCH] [net/sched]: Remove redundant condition in qdisc_graft

2020-06-18 Thread Gaurav Singh
parent cannot be NULL here since its in the else part of the if (parent == NULL) condition. Remove the extra check on parent pointer. Signed-off-by: Gaurav Singh --- net/sched/sch_api.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sched/sch_api.c b/net/sched/sch_api.

Re: [PATCH 1/2] mm: Expand CONFIG_SLAB_FREELIST_HARDENED to include SLAB and SLOB

2020-06-18 Thread Kees Cook
On Wed, Jun 17, 2020 at 01:01:51PM -0700, Matthew Wilcox wrote: > On Wed, Jun 17, 2020 at 12:53:48PM -0700, Kees Cook wrote: > > Include SLAB and SLOB caches when performing kmem_cache pointer > > ... SLOB? Really? Objects from different kmem caches are mixed together > on the same page with SLO

Re: [PATCH v2 09/16] rcu/tree: Maintain separate array for vmalloc ptrs

2020-06-18 Thread Matthew Wilcox
On Thu, Jun 18, 2020 at 10:35:57PM +0200, Uladzislau Rezki wrote: > On Thu, Jun 18, 2020 at 12:03:59PM -0700, Paul E. McKenney wrote: > but i do not have a strong opinion here, even though i tend to > say that it would be odd. Having just vfree_bulk(), i think > would be enough, as a result the cod

[RFC][PATCH v5 00/51] objtool: Make recordmcount a subcommand

2020-06-18 Thread Matt Helsley
recordmcount has its own ELF wrapper code and could utilize objtool's ELF code to more-portably handle architecture variations. This series makes recordmcount a subcommand of objtool. It very gradually converts recordmcount to become a subcommand of objtool and then reuses parts of objtool's ELF co

[RFC][PATCH v5 01/51] objtool: Factor out reasons to build objtool

2020-06-18 Thread Matt Helsley
Currently the reasons to build and run objtool are: Stack validation (objtool subcmds: orc + check) Orc data generation (objtool subcmds: orc) Code analysis (objtool subcmds: check) Since the reasons are varied and the stack validation step is skipped with a warning if libe

[RFC][PATCH v5 06/51] objtool: recordmcount: Convert do_func() relhdrs

2020-06-18 Thread Matt Helsley
Use objtool's ELF data structures to visit the relocation sections in the top-level ELF file walking function, do_func(). This means we can pass pointers to the relocation header structures into nested functions and avoid the indexing patterns for them. These conversions don't use libelf/objtool t

[RFC][PATCH v5 11/51] objtool: mcount: Use symbol structs to find mcount relocations

2020-06-18 Thread Matt Helsley
Rather than open coding symbol name lookups in get_sym_and_*() we rename the structure and use objtool's lookup function to get the symbol name for a relocation. We also change the name of the function to better reflect its purpose. Signed-off-by: Matt Helsley --- tools/objtool/elf.c |

[RFC][PATCH v5 05/51] objtool: recordmcount: Search for __mcount_loc before walking the sections

2020-06-18 Thread Matt Helsley
recordmcount iterates over the sections in the order they're listed in the ELF file and checks whether the section name indicates it's of interest. Objtool's elf code works differently -- it scans the elf file and builds up data structures representing the headers, sections, etc. and then supplies

[RFC][PATCH v5 17/51] objtool: mcount: Stop using ehdr in find_section_sym_index

2020-06-18 Thread Matt Helsley
We can use the objtool GElf_Ehdr structure to access ehdr here. This makes the function completely independent of the old recordmcount ELF wrapper. The next step will be to promote it to the C file. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 13 ++--- 1 file changed,

[RFC][PATCH v5 23/51] objtool: mcount: Move relocation entry size detection

2020-06-18 Thread Matt Helsley
Move where we detect the size of relocation entries we wish to use into the first loop over the sections. This will allow us to allocate the mcount location and relocation sections before the next loop that collects them. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 8 +---

[RFC][PATCH v5 24/51] objtool: mcount: Only keep ELF file size

2020-06-18 Thread Matt Helsley
Since we're no longer writing to the ELF file mapping and we're not appending to it we don't need to keep more information from the stat structure. At the same time we can give the smaller global variable a better name. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 9 ++---

[RFC][PATCH v5 18/51] objtool: mcount: Move find_section_sym_index()

2020-06-18 Thread Matt Helsley
This function is no longer dependent upon the old recordmcount ELF wrapper code -- it doesn't use the wrapper's Elf_* types nor does it call wrapped functions. Move it into the C file. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 42 tools/objto

[RFC][PATCH v5 21/51] objtool: mcount: Move nop_mcount()

2020-06-18 Thread Matt Helsley
The nop_mcount() function overwrites mcount calls that should be ignored with no-ops. This operation varies by architecture and wordsize so we retain the function pointers used to implement the fundamental operation while nop_mcount() itself is responsible for walking the relocations, determining i

[RFC][PATCH v5 15/51] objtool: mcount: Replace MIPS offset types

2020-06-18 Thread Matt Helsley
Replace MIPS is_fake_mcount code using Elf_Addr with unsigned long for the offsets. This is consistent with the way that objtool more generally treats offsets and removes the last use of the Elf_Addr wrapper. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 9 +++-- 1 file chan

[RFC][PATCH v5 20/51] objtool: mcount: Use objtool ELF to write

2020-06-18 Thread Matt Helsley
Rather than modify the pseudo-mapping of the ELF file directly, which is the recordmcount way of operating, use the objtool section list and generic ELF functions to modify the ELF file. This eliminates a bunch of code -- the ulseek() and uwrite() functions -- because it's used to patch the ELF da

[RFC][PATCH v5 08/51] objtool: mcount: Remove unused fname parameter

2020-06-18 Thread Matt Helsley
The name of the object file being processed is unused in the wrapper's leaf functions so we no longer need to pass it as a parameter. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 4 ++-- tools/objtool/recordmcount.h | 19 --- 2 files changed, 10 insertions(+),

[RFC][PATCH v5 22/51] objtool: mcount: Move has_rel_mcount() and tot_relsize()

2020-06-18 Thread Matt Helsley
The has_rel_mcount() and tot_relsize() helpers are no longer dependent on the ELF wrapper so we can move them. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 26 ++ tools/objtool/recordmcount.h | 33 - 2 files changed, 26 in

[RFC][PATCH v5 39/51] objtool: mcount: Verify x86 instruction with memcmp()

2020-06-18 Thread Matt Helsley
Instead of hard-coding what amounts to a memcmp() use memcmp to determine if the instruction we wish to replace matches what we expect. This makes the x86 code more like that of, for instance, ARM. Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 19 ++- 1 file changed, 6

[RFC][PATCH v5 47/51] objtool: mcount: Merge section mcount flags

2020-06-18 Thread Matt Helsley
One flag is only for relocation sections and the other only for text (not relocation) sections so we can share the same flag and test the section type when we need to. Signed-off-by: Matt Helsley --- tools/objtool/elf.c| 5 ++--- tools/objtool/elf.h| 2 +- tools/objtool/mcount.c | 9

[RFC][PATCH v5 32/51] objtool: mcount: Move sift_rel_mcount out of wrapper file

2020-06-18 Thread Matt Helsley
Now that this function no longer uses any of the old recordmcount wrapper code we can move it out of the wrapper too. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 47 + tools/objtool/recordmcount.h | 50 2 fil

[RFC][PATCH v5 44/51] objtool: mcount: Keep lists locations and relocations

2020-06-18 Thread Matt Helsley
To reduce the need for an initial pass through the sections we need to keep lists of mcount call locations and suitable relocations. A subsequent patch will eliminate the need for the first pass entirely. Introduce a new list for the locations and reuse objtool's relocation lists respectively. Si

[RFC][PATCH v5 36/51] objtool: mcount: Rename to mcount.c

2020-06-18 Thread Matt Helsley
Now that we've converted recordmcount to a subcommand of objtool rename the .c file in order to follow the convention of the other objtool subcmds. Signed-off-by: Matt Helsley --- tools/objtool/Build| 2 +- tools/objtool/{recordmcount.c => mcount.c} | 0 2 files changed,

[RFC][PATCH v5 25/51] objtool: mcount: Use ELF header from objtool

2020-06-18 Thread Matt Helsley
The ELF header is the very first structure in an ELF file. Rather than cast it from the file mapping we use the ELF header extracted via objtool's ELF code. This is the last usage of the open-coded mapping of the ELF file which we will remove in a later step. Signed-off-by: Matt Helsley --- too

[RFC][PATCH v5 41/51] objtool: mcount: Convert nop writes to elf_write_insn()

2020-06-18 Thread Matt Helsley
objtool's elf_write_insn() does extra checking when writing to an instruction so use that rather than a plain memcpy(). Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/objtool/mcount.c b/tools/objtool/mco

[RFC][PATCH v5 31/51] objtool: mcount: Use objtool relocation section

2020-06-18 Thread Matt Helsley
Now that we add an initially-empty relocation section and share the libelf data buffer from the beginning, we can safely use objtools elf_create_reloc_section() function to simplify the code further -- use the anticipated base section name, avoid the need to set sh_info, etc. The only remaining dif

[RFC][PATCH v5 48/51] objtool: mcount: Eliminate first pass

2020-06-18 Thread Matt Helsley
Determine the size of the mcount relocations in objtool's ELF reading code. This reduces the number of passes we make through the list of sections (which can become large due to things like -ffunction-sections). Signed-off-by: Matt Helsley --- tools/objtool/elf.c| 2 ++ tools/objtool/elf.h

[RFC][PATCH v5 34/51] objtool: mcount: Remove wrapper double-include trick

2020-06-18 Thread Matt Helsley
We no longer need to double-include the recordmcount.h wrapper All of the types and functions that rely on them have been converted to using objtool's ELF code. This moves the remaining function to recordmcount.c and changes the function name to something slightly more descriptive while dropping th

[RFC][PATCH v5 40/51] objtool: mcount: const-ify ARM instruction patterns

2020-06-18 Thread Matt Helsley
Let the compiler know we won't be modifying the instruction patterns we use to determine how to turn ARM instruction(s) into nops, and the nop instruction(s) we'll put in their place. Also, while we're at it, convert to unsigned char because the next patch will need that as well. Signed-off-by: M

[RFC][PATCH v5 43/51] objtool: check: Use class to recognize kcov calls

2020-06-18 Thread Matt Helsley
Suggested-by: Peter Zijlstra Signed-off-by: Matt Helsley --- tools/objtool/check.c | 3 +-- tools/objtool/elf.c | 7 +++ tools/objtool/elf.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 78375908acda..d08714b878c

[RFC][PATCH v5 46/51] objtool: mcount: Flag mcount relocation sections

2020-06-18 Thread Matt Helsley
Move the check for relocations sections that apply to mcountable text sections into objtool's ELF code. Signed-off-by: Matt Helsley --- tools/objtool/elf.c| 13 + tools/objtool/elf.h| 2 +- tools/objtool/mcount.c | 36 3 files changed, 30

[RFC][PATCH v5 33/51] objtool: mcount: Remove wrapper for ELF relocation type

2020-06-18 Thread Matt Helsley
Remove the last uses of the Elf_Rela wrapper by passing the size of the relocations we're dealing with as a parameter. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 4 ++-- tools/objtool/recordmcount.h | 7 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/t

[RFC][PATCH v5 42/51] objtool: mcount: Move mcount symbol name testing

2020-06-18 Thread Matt Helsley
Move the test for mcount symbols into the ELF code itself and set a class on indicator on the symbol. This simplifies mcount a little and tests the symbols names near where they're first touched so should be cache-hot and may also help us reduce the number of passes through the ELF contents needed

[RFC][PATCH v5 38/51] objtool: mcount: mcount symbol name simplification

2020-06-18 Thread Matt Helsley
Remove gpfx -- the recognized prefix for the mcount symbol -- and just recognize any of the prefixes. This allows us to further substitute the various strings directly into the code rather than using variables. Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 19 --- 1 fi

[RFC][PATCH v5 51/51] objtool: mcount: Remove stale description

2020-06-18 Thread Matt Helsley
The comments at the top no longer reflect how we process the ELF contents. More helpful comments are inline with the code so we don't need the top comments either. Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 13 - 1 file changed, 13 deletions(-) diff --git a/tools/objto

[RFC][PATCH v5 45/51] objtool: mcount: Move mcount section test to objtool ELF

2020-06-18 Thread Matt Helsley
In preparation for removing this first pass by mcount move the test for whether a section is mcountable into objtool's ELF read code, much like we did with the symbol name. A subsequent patch will eliminate the tot_relsize() function and thereby reduce the number of passes through the ELF data. Si

[RFC][PATCH v5 14/51] objtool: mcount: Move get_mcountsym

2020-06-18 Thread Matt Helsley
Now that it's been stripped of using the old recordmcount ELF wrapper get_mcountsym() is ready to be promoted out of the double-included wrapper header. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 16 tools/objtool/recordmcount.h | 19 --- 2 fi

[RFC][PATCH v5 09/51] objtool: mcount: Use libelf for section header names

2020-06-18 Thread Matt Helsley
Rather than passing in the string table contents as a parameter, pass in the section index of the string table and rely on libelf string table accessor functions to look up section names. Note that modifying the string table with libelf will come later so append_func() is unchanged. Signed-off-by

[RFC][PATCH v5 50/51] objtool: mcount: Remove useless lookup

2020-06-18 Thread Matt Helsley
Since the relocation section's sh_info points back to the text section it applies to and we already have that we can just pass it in and greatly simplify find_section_sym_index(). Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 39 +++ 1 file changed,

[RFC][PATCH v5 13/51] objtool: mcount: Return symbol from mcountsym

2020-06-18 Thread Matt Helsley
Before we can move this function out of the wrapper and into wordsize-independent code we need to return the relocation symbol information in a size-independent fashion. Previously we compared the raw info bits but that requires passing around an unsigned long. Instead we just use a pointer to the

[RFC][PATCH v5 35/51] objtool: mcount: Remove endian wrappers

2020-06-18 Thread Matt Helsley
Now that they're no longer used we can remove these endian wrappers. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 63 1 file changed, 63 deletions(-) diff --git a/tools/objtool/recordmcount.c b/tools/objtool/recordmcount.c index 7f4d18e83e2

[RFC][PATCH v5 49/51] objtool: mcount: Remove relocation size check

2020-06-18 Thread Matt Helsley
Rather than use the size of the relocations check the section header type directly to see if the mcount relocations should be rel or rela relocations. Signed-off-by: Matt Helsley --- tools/objtool/elf.c| 4 ++-- tools/objtool/elf.h| 2 +- tools/objtool/mcount.c | 15 +-- 3

[RFC][PATCH v5 37/51] objtool: mcount: Simplify mcount name matching

2020-06-18 Thread Matt Helsley
Setting altmcount only when processing ARM ELF files is not necessary -- we can make the code easier to read by always checking for the string. Signed-off-by: Matt Helsley --- tools/objtool/mcount.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/objtool/mcount.c b/t

Re: [Nouveau] 2dd4d163cd9c ("drm/nouveau: remove open-coded version of remove_conflicting_pci_framebuffers()")

2020-06-18 Thread Borislav Petkov
Hi, On Thu, Jun 18, 2020 at 04:19:02PM -0400, Ilia Mirkin wrote: > Hi Boris, > > There was a fixup to that patch that you'll also have to revert first > -- 7dbbdd37f2ae7dd4175ba3f86f4335c463b18403. I guess there's some > subtle difference between the old open-coded logic and the helper, > they we

[RFC][PATCH v5 30/51] objtool: mcount: Generic location and relocation table types

2020-06-18 Thread Matt Helsley
Rather than building the exact ELF section data we need and avoiding libelf's conversion step, use more GElf types and then libelf's elfxx_xlatetof() functions to convert the mcount locations (GElf_Addr) and associated relocations. This converts sift_rel_mcount() so that it doesn't use the recordm

Re: [PATCH v3 08/15] arm64: kvm: Split hyp/switch.c to VHE/nVHE

2020-06-18 Thread kernel test robot
Hi David, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.8-rc1 next-20200618] [cannot apply to kvmarm/next arm64/for-next/core arm-perf/for-next/perf] [If your patch is applied to the wrong git tree, kindly drop us

[RFC][PATCH v5 28/51] objtool: mcount: Move mcount_adjust out of wrapper

2020-06-18 Thread Matt Helsley
The mcount_adjust variable defines how many bytes to move back from the relocation address in order to be able to get to the start of the function call instruction(s) needed to turn it into a no-op. The values are very small and signed so we don't need to worry about changing the size of the variab

[RFC][PATCH v5 19/51] objtool: mcount: Restrict using ehdr in append_func()

2020-06-18 Thread Matt Helsley
Use the ehdr parameter to append_func() to write the ELF file's header but use the objtool ELF header data as the basis for making changes. The makes it clearer when we can switch from using the old recordmcount wrapper to write the ELF file because ehdr will only be passed on to uwrite() calls and

[RFC][PATCH v5 26/51] objtool: mcount: Remove unused file mapping

2020-06-18 Thread Matt Helsley
The ELF data is now accessed completely through objtool's ELF code. We can remove the mapping of the original ELF file and propagate elf_open_read(), elf_close(), and malloc() up in place of mmap_file(), mmap_cleanup(), and umalloc() respectively. This also eliminates the last use of the umalloc()

[RFC][PATCH v5 29/51] objtool: mcount: Pre-allocate new ELF sections

2020-06-18 Thread Matt Helsley
Rather than allocating the ELF sections after collecting the mcount locations and building the relocation entries, create the empty sections beforehand. This has the benefit of removing the memcpy() and just using the resulting libelf buffers directly. Signed-off-by: Matt Helsley --- tools/objto

[RFC][PATCH v5 16/51] objtool: mcount: Move is_fake_mcount()

2020-06-18 Thread Matt Helsley
Promote the now-bit-independent is_fake_mcount() out of the old recordmcount ELF wrapper. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 48 +++--- tools/objtool/recordmcount.h | 50 2 files changed, 45 insertions(+

[RFC][PATCH v5 27/51] objtool: mcount: Reduce usage of _size wrapper

2020-06-18 Thread Matt Helsley
Use a new loc_size parameter to append_func() rather than use the wrapper's _size macro directly. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/objtool/recordmcount.h b/tools/objtool/recordmcount

[RFC][PATCH v5 03/51] objtool: Make recordmcount into mcount subcmd

2020-06-18 Thread Matt Helsley
Rather than a standalone executable merge recordmcount as a sub command of objtool. This is a small step towards cleaning up recordmcount and eventually sharing ELF code with objtool. For the initial step all that's required is a bit of Makefile changes and invoking the former main() function fro

[RFC][PATCH v5 02/51] objtool: Prepare to merge recordmcount

2020-06-18 Thread Matt Helsley
Move recordmcount into the objtool directory. We keep this step separate so changes which turn recordmcount into a subcommand of objtool don't get obscured. Signed-off-by: Matt Helsley --- Documentation/trace/ftrace-design.rst | 4 ++-- Documentation/trace/ftrace.rst | 2 +- M

[RFC][PATCH v5 07/51] objtool: mcount: Move nhdr into find_symtab()

2020-06-18 Thread Matt Helsley
Since it's no longer needed in the rest of do_func() we can move it to where it's needed rather than pass it as a parameter. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objtool/recordmcount.h b/tools

[RFC][PATCH v5 10/51] objtool: mcount: Walk objtool Elf structs in find_secsym_ndx

2020-06-18 Thread Matt Helsley
Rather than using indices into raw ELF32/64 tables mapped for the wrapper, use the objtool functions to find the suitable symbol in the given text section. This also removes all callers to find_symtab() and get_symindex() so we can remove them as well. Also take advantage of this commit to rename

[RFC][PATCH v5 04/51] objtool: recordmcount: Start using objtool's elf wrapper

2020-06-18 Thread Matt Helsley
Use struct elf to grab the file descriptor. We will later move these calls into other functions as we expand the lifetime of the struct elf so that it can be passed to objtool elf.[ch] functions. This creates the libelf/objtool data structures and gives us two separate ways to walk the ELF file --

Re: [PATCH v6 00/19] The new cgroup slab memory controller

2020-06-18 Thread Roman Gushchin
On Thu, Jun 18, 2020 at 12:27:07PM +0300, Mike Rapoport wrote: > Hi Roman, > > On Mon, Jun 08, 2020 at 04:06:35PM -0700, Roman Gushchin wrote: > > This is v6 of the slab cgroup controller rework. > > > > The patchset moves the accounting from the page level to the object > > level. It allows to s

[RFC][PATCH v5 12/51] objtool: mcount: Walk relocation lists

2020-06-18 Thread Matt Helsley
Rather than walk the section tables using the old recordmcount mapping of the ELF file, walk the section list provided by objtool's ELF code. This removes the last use of of the Elf_r_sym wrapper so we remove that too. Signed-off-by: Matt Helsley --- tools/objtool/recordmcount.c | 10 +--- tool

<    3   4   5   6   7   8   9   10   11   12   >