Re: [PATCH 1/7] x86/entry: Fix #UD vs WARN more

2020-06-18 Thread Peter Zijlstra
On Thu, Jun 18, 2020 at 12:29:50PM -0700, Andy Lutomirski wrote: > > > On Jun 18, 2020, at 12:02 PM, Peter Zijlstra wrote: > > > > On Thu, Jun 18, 2020 at 11:36:53AM -0700, Andy Lutomirski wrote: > > > >> I wasn't imagining going far down the rabbit hole at all -- I think > >> that, at most,

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

2020-06-18 Thread Uladzislau Rezki
> > > > trace_rcu_invoke_kfree_bulk_callback( > > rcu_state.name, bkvhead[i]->nr_records, > > bkvhead[i]->records); > > if (i == 0) > > kfree_bulk(bkvhead[i]->nr_records, > > bkvhead[i]->records); > > else > >

INFO: trying to register non-static key in is_dynamic_key

2020-06-18 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:b791d1bd Merge tag 'locking-kcsan-2020-06-11' of git://git.. git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing console output: https://syzkaller.appspot.com/x/log.txt?x=13f305a910 kernel

[PATCH net-next v8 3/5] dt-bindings: net: Add RGMII internal delay for DP83869

2020-06-18 Thread Dan Murphy
Add the internal delay values into the header and update the binding with the internal delay properties. Signed-off-by: Dan Murphy --- .../devicetree/bindings/net/ti,dp83869.yaml | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git

[PATCH net-next v8 4/5] net: dp83869: Add RGMII internal delay configuration

2020-06-18 Thread Dan Murphy
Add RGMII internal delay configuration for Rx and Tx. Signed-off-by: Dan Murphy --- drivers/net/phy/dp83869.c | 53 --- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/drivers/net/phy/dp83869.c b/drivers/net/phy/dp83869.c index

[PATCH net-next v8 5/5] net: phy: DP83822: Add setting the fixed internal delay

2020-06-18 Thread Dan Murphy
The DP83822 can be configured to use the RGMII interface. There are independent fixed 3.5ns clock shift (aka internal delay) for the TX and RX paths. This allow either one to be set if the MII interface is RGMII and the value is set in the firmware node. Signed-off-by: Dan Murphy ---

[PATCH net-next v8 1/5] dt-bindings: net: Add tx and rx internal delays

2020-06-18 Thread Dan Murphy
tx-internal-delays and rx-internal-delays are a common setting for RGMII capable devices. These properties are used when the phy-mode or phy-controller is set to rgmii-id, rgmii-rxid or rgmii-txid. These modes indicate to the controller that the PHY will add the internal delay for the

[PATCH net-next v8 2/5] net: phy: Add a helper to return the index for of the internal delay

2020-06-18 Thread Dan Murphy
Add a helper function that will return the index in the array for the passed in internal delay value. The helper requires the array, size and delay value. The helper will then return the index for the exact match or return the index for the index to the closest smaller value. Signed-off-by: Dan

[PATCH v3 1/2] integrity: Add errno field in audit message

2020-06-18 Thread Lakshmi Ramasubramanian
Error code is not included in the audit messages logged by the integrity subsystem. Define a new function integrity_audit_message() that takes error code in the "errno" parameter. Add "errno" field in the audit messages logged by the integrity subsystem and set the value passed in the "errno"

[PATCH net-next v8 0/5] RGMII Internal delay common property

2020-06-18 Thread Dan Murphy
Hello The RGMII internal delay is a common setting found in most RGMII capable PHY devices. It was found that many vendor specific device tree properties exist to do the same function. This creates a common property to be used for PHY's that have internal delays for the Rx and Tx paths. If the

[PATCH v3 2/2] IMA: Add audit log for failure conditions

2020-06-18 Thread Lakshmi Ramasubramanian
process_buffer_measurement() and ima_alloc_key_entry() functions need to log an audit message for auditing integrity measurement failures. Add audit message in these two functions. Remove "pr_devel" log message in process_buffer_measurement(). Sample audit messages: [6.303048] audit:

Re: [PATCH] Ability to read the MKTME status from userspace

2020-06-18 Thread Dave Hansen
On 6/18/20 2:02 PM, Daniel Gutson wrote: > The intent of this patch is to provide visibility of the > MKTME status to userspace. This is an important factor for > firmware security related applilcations. I think we need more specifics before considering adding a new ABI like this. Could you

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 Thu, Jun 18, 2020 at 09:56:18PM +0200, Julia Lawall wrote: > > @@ > > identifier i,fld; > > expression e; > > @@ > > > > \(\(i\|e.fld\|e->fld\) \& E\) > > > > The e will match all of the variants you are concerned about. > > Ah, I see! Okay, that's

[PATCH] linux++, this: rename "struct notifier_block *this"

2020-06-18 Thread Alexey Dobriyan
Rename struct notifier_block *this to struct notifier_block *nb "nb" is arguably a better name for notifier block. Someone used "this" back in the days and everyone else copied. In nearly 100% of cases it is unused with notable exception of net/x25/af_ax25.c Both gcc and g++

[PATCH] nbd: allocate sufficient space for NBD_CMD_STATUS

2020-06-18 Thread Thadeu Lima de Souza Cascardo
The nest attribute NBD_ATTR_DEVICE_LIST was not accounted for when allocating the message, resulting in -EMSGSIZE. As __alloc_skb aligns size requests to SMP_CACHE_BYTES and SLUB will end up allocating more than requested, this can hardly be reproduced on most setups. However, I managed to test

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c:1710:40: sparse: sparse: incorrect type in initializer (different base types)

2020-06-18 Thread kernel test robot
-20200618 (attached as .config) compiler: riscv64-linux-gcc (GCC) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.2-rc1-10-gc17b1b06-dirty git checkout 9c29da3f4e7ef9810bdfaf3d8aa5e6d2e33136f8 # save the attached .config to linux build tree make W=1

[PATCH] nbd: allocate sufficient space for NBD_CMD_STATUS

2020-06-18 Thread Thadeu Lima de Souza Cascardo
The nest attribute NBD_ATTR_DEVICE_LIST was not accounted for when allocating the message, resulting in -EMSGSIZE. As __alloc_skb aligns size requests to SMP_CACHE_BYTES and SLUB will end up allocating more than requested, this can hardly be reproduced on most setups. However, I managed to test

[PATCH] Ability to read the MKTME status from userspace

2020-06-18 Thread Daniel Gutson
From: Daniel Gutson The intent of this patch is to provide visibility of the MKTME status to userspace. This is an important factor for firmware security related applilcations. Signed-off-by: Daniel Gutson --- MAINTAINERS | 5 +++ arch/x86/include/asm/cpu.h | 8

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

2020-06-18 Thread Alexei Starovoitov
On Thu, Jun 18, 2020 at 1:00 PM Maciej Żenczykowski wrote: > > From: Maciej Żenczykowski > > This is a 5.8-rc1 regression. Please add full explanation here. Also use [PATCH bpf] in the subject for future submission. > Cc: Alexei Starovoitov > Cc: Daniel Borkmann > Fixes: 2c78ee898d8f ("bpf:

Re: [PATCH] x86/asm/64: Align start of __clear_user() loop to 16-bytes

2020-06-18 Thread Alexey Dobriyan
On Thu, Jun 18, 2020 at 04:39:35PM +, David Laight wrote: > From: Alexey Dobriyan > > Sent: 18 June 2020 14:17 > ... > > > > diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c > > > > index fff28c6f73a2..b0dfac3d3df7 100644 > > > > --- a/arch/x86/lib/usercopy_64.c > > > >

Re: [PATCH] sched, mm: Optimize current_gfp_context()

2020-06-18 Thread Waiman Long
On 6/18/20 12:07 PM, Peter Zijlstra wrote: On Thu, Jun 18, 2020 at 11:58:47AM -0400, Waiman Long wrote: The current_gfp_context() converts a number of PF_MEMALLOC_* per-process flags into the corresponding GFP_* flags for memory allocation. In that function, current->flags is accessed 3 times.

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

2020-06-18 Thread Sam Ravnborg
Hi Rob. On Thu, Jun 18, 2020 at 02:24:47PM -0600, Rob Herring wrote: > 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

INFO: trying to register non-static key in ath9k_htc_rxep

2020-06-18 Thread syzbot
Hello, syzbot found the following crash on: HEAD commit:b791d1bd Merge tag 'locking-kcsan-2020-06-11' of git://git.. git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing console output: https://syzkaller.appspot.com/x/log.txt?x=1522cc2510 kernel

Re: rename probe_kernel_* and probe_user_*

2020-06-18 Thread Helge Deller
On 18.06.20 21:48, Linus Torvalds wrote: > [ Explicitly added architecture lists and developers to the cc to make > this more visible ] > > On Wed, Jun 17, 2020 at 12:38 AM Christoph Hellwig wrote: >> >> Andrew and I decided to drop the patches implementing your suggested >> rename of the

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

2020-06-18 Thread Kees Cook
On Thu, Jun 18, 2020 at 09:56:18PM +0200, Julia Lawall wrote: > @@ > identifier i,fld; > expression e; > @@ > > \(\(i\|e.fld\|e->fld\) \& E\) > > The e will match all of the variants you are concerned about. Ah, I see! Okay, that's good. And the "& E" part is to effectively collect it into E

[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 +---

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

[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

[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 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 ---

[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

[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

[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

[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 +-

[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

[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

[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

[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

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

[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

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 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

[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 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 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.

[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

[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.

[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

[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

[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

[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,

[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

[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

[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 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

[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:

[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

[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 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 ---

[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

[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

[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.

[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 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,

[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 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

[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

[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

[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

[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 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 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

[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

[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

[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

[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

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

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

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

[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

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 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: > >

[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

[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 ++-

[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) ---

[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

[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 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 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

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]$

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: 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

[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.

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

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

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

<    1   2   3   4   5   6   7   8   9   10   >