Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Andy Lutomirski
On Fri, Apr 16, 2021 at 3:14 PM Borislav Petkov wrote: > > On Fri, Apr 16, 2021 at 03:06:17PM -0700, Andy Lutomirski wrote: > > On Fri, Apr 16, 2021 at 3:03 PM Borislav Petkov wrote: > > > > > > On Fri, Apr 16, 2021 at 02:49:23PM -0700, Sami Tolvanen wrote: > > > > __nocfi only disables CFI check

Re: [PATCH v3 2/5] media: i2c: max9286: Use "maxim,gpio-poc" property

2021-04-16 Thread Laurent Pinchart
Hi Jacopo, On Fri, Apr 16, 2021 at 09:43:07AM +0200, Jacopo Mondi wrote: > On Thu, Apr 15, 2021 at 10:14:05PM +0300, Laurent Pinchart wrote: > > > > > + /* GPIO values default to high */ > > > > > + priv->gpio_state = BIT(0) | BIT(1); > > > > > > > > Why is that ? > > > > >

[PATCH v7 6/6] w1: ds2438: support for writing to offset register

2021-04-16 Thread Luiz Sampaio
Added a sysfs entry to support writing to the offset register on page1. This register is used to calibrate the chip canceling offset errors in the current ADC. This means that, over time, reading the IAD register will not return the correct current measurement, it will have an offset. Writing to th

[PATCH v7 5/6] w1: ds2438: adding support for reading page1

2021-04-16 Thread Luiz Sampaio
Added a sysfs entry to support reading the page1 registers. This registers contain Elapsed Time Meter (ETM) data, which shows for how long the chip is on, as well as an Offset Register data, which can be used to calibrate the current measurement of the chip. Signed-off-by: Luiz Sampaio --- .../A

[PATCH v7 4/6] w1: ds2438: fixing bug that would always get page0

2021-04-16 Thread Luiz Sampaio
The purpose of the w1_ds2438_get_page function is to get the register values at the page passed as the pageno parameter. However, the page0 was hardcoded, such that the function always returned the page0 contents. Fixed so that the function can retrieve any page. Signed-off-by: Luiz Sampaio ---

[PATCH v7 3/6] w1: ds2438: changed sysfs macro for rw file

2021-04-16 Thread Luiz Sampaio
The iad sysfs file has permissions for read and write. Changed to the recommended macro BIN_ATTR_RW. Signed-off-by: Luiz Sampaio --- drivers/w1/slaves/w1_ds2438.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c ind

[PATCH v7 2/6] w1: ds2438: fixed if brackets coding style issue

2021-04-16 Thread Luiz Sampaio
Since there is only one statement inside the if clause, no brackets are required. Signed-off-by: Luiz Sampaio --- drivers/w1/slaves/w1_ds2438.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slaves/w1_ds2438.c index

[PATCH v7 1/6] w1: ds2438: fixed a coding style issue

2021-04-16 Thread Luiz Sampaio
There is an if statement and, if the function goes into it, it returns. So, the next else is not required. Signed-off-by: Luiz Sampaio --- drivers/w1/slaves/w1_ds2438.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/w1/slaves/w1_ds2438.c b/drivers/w1/slave

[PATCH v7 0/6] w1: ds2438: adding support for calibration of current measurements

2021-04-16 Thread Luiz Sampaio
The following patches aim to make a user able to calibrate the current measurement of the DS2438. This chip uses a offset register in page1, which is added to the current register to give the user the current measurement. If this value is wrong, the user will get an offset current value, even if th

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Kees Cook
On Sat, Apr 17, 2021 at 12:02:51AM +0200, Borislav Petkov wrote: > On Fri, Apr 16, 2021 at 02:49:23PM -0700, Sami Tolvanen wrote: > > __nocfi only disables CFI checking in a function, the compiler still > > changes function addresses to point to the CFI jump table, which is > > why we need function

Re: [PATCH 1/1] rtc: pcf85063: fallback to parent of_node

2021-04-16 Thread Alexandre Belloni
On Wed, 10 Mar 2021 16:10:26 -0500, Francois Gervais wrote: > The rtc device node is always or at the very least can possibly be NULL. > > Since v5.12-rc1-dontuse/3c9ea42802a1fbf7ef29660ff8c6e526c58114f6 this > will lead to a NULL pointer dereference. > > To fix this we fallback to using the pare

Re: [PATCH V6 00/10] PKS: Add Protection Key Supervisor support

2021-04-16 Thread Ira Weiny
On Thu, Apr 01, 2021 at 03:58:23PM -0700, 'Ira Weiny' wrote: > From: Ira Weiny > > Introduce a new page protection mechanism for supervisor pages, Protection Key > Supervisor (PKS). Is there any feedback on this series? Perhaps I should ping for specific feedback or an ack? Maybe an ack from x

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-16 Thread Andy Lutomirski
On Fri, Apr 16, 2021 at 3:11 PM Len Brown wrote: > > > I get it. That does not explain why LDMXCSR and VLDMXCSR cause > > pipelines stalls. > > Sorry, I thought this thread was about AMX. > I don't know the answer to your LDMXCSR and VLDMXCSR question. My point is that every single major math ex

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Borislav Petkov
On Fri, Apr 16, 2021 at 03:06:17PM -0700, Andy Lutomirski wrote: > On Fri, Apr 16, 2021 at 3:03 PM Borislav Petkov wrote: > > > > On Fri, Apr 16, 2021 at 02:49:23PM -0700, Sami Tolvanen wrote: > > > __nocfi only disables CFI checking in a function, the compiler still > > > changes function address

[PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-16 Thread Song Liu
Currently, to use BPF to aggregate perf event counters, the user uses --bpf-counters option. Enable "use bpf by default" events with a config option, stat.bpf-counter-events. Events with name in the option will use BPF. This also enables mixed BPF event and regular event in the same sesssion. For

[PATCH v3 4/4] perf-stat: introduce ':b' modifier

2021-04-16 Thread Song Liu
Introduce 'b' modifier to event parser, which means use BPF program to manage this event. This is the same as --bpf-counters option, but only applies to this event. For example, perf stat -e cycles:b,cs # use bpf for cycles, but not cs perf stat -e cycles,cs --bpf-counters # use

[PATCH v3 2/4] perf bpf: check perf_attr_map is compatible with the perf binary

2021-04-16 Thread Song Liu
perf_attr_map could be shared among different version of perf binary. Add bperf_attr_map_compatible() to check whether the existing attr_map is compatible with current perf binary. Signed-off-by: Song Liu --- tools/perf/util/bpf_counter.c | 19 +++ 1 file changed, 19 insertions(+

[PATCH v3 1/4] perf util: move bpf_perf definitions to a libperf header

2021-04-16 Thread Song Liu
By following the same protocol, other tools can share hardware PMCs with perf. Move perf_event_attr_map_entry and BPF_PERF_DEFAULT_ATTR_MAP_PATH to bpf_perf.h for other tools to use. Signed-off-by: Song Liu --- tools/lib/perf/include/perf/bpf_perf.h | 31 ++ tools/perf/ut

[PATCH v3 0/4] perf util: bpf perf improvements

2021-04-16 Thread Song Liu
This patches set improves bpf_perf (perf-stat --bpf-counter) by 1) exposing key definitions to a libperf header; 2) adding compatibility check for perf_attr_map; 3) introducing config stat.bpf-counter-events. 4) introducing 'b' modify to event parser. Changes v2 => v3: 1. Add 'b' modifier.

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 14:49, Sami Tolvanen wrote: > On Fri, Apr 16, 2021 at 2:18 PM Borislav Petkov wrote: >> In file included from ./include/linux/ftrace.h:22:0, >> from ./include/linux/init_task.h:9, >> from init/init_task.c:2: >> ./include/linux/ftrace.h: In f

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-16 Thread Len Brown
> I get it. That does not explain why LDMXCSR and VLDMXCSR cause > pipelines stalls. Sorry, I thought this thread was about AMX. I don't know the answer to your LDMXCSR and VLDMXCSR question.

[PATCH v2] kunit: add unit test for filtering suites by names

2021-04-16 Thread Daniel Latypov
This adds unit tests for kunit_filter_subsuite() and kunit_filter_suites(). Note: what the executor means by "subsuite" is the array of suites corresponding to each test file. This patch lightly refactors executor.c to avoid the use of global variables to make it testable. It also includes a clev

Re: [PATCH v1 1/1] libnvdimm: Don't use GUID APIs against raw buffer

2021-04-16 Thread Dan Williams
On Fri, Apr 16, 2021 at 1:42 PM Andy Shevchenko wrote: > > On Fri, Apr 16, 2021 at 01:08:06PM -0700, Dan Williams wrote: > > [ add Erik ] > > > > On Fri, Apr 16, 2021 at 10:36 AM Andy Shevchenko > > wrote: > > > > > > On Thu, Apr 15, 2021 at 05:37:54PM +0300, Andy Shevchenko wrote: > > > > Strict

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Andy Lutomirski
On Fri, Apr 16, 2021 at 3:03 PM Borislav Petkov wrote: > > On Fri, Apr 16, 2021 at 02:49:23PM -0700, Sami Tolvanen wrote: > > __nocfi only disables CFI checking in a function, the compiler still > > changes function addresses to point to the CFI jump table, which is > > why we need function_nocfi(

Re: [PATCH 1/1] rtc: pcf85063: add integrity check

2021-04-16 Thread Alexandre Belloni
Hi, On 11/03/2021 12:49:40-0500, Francois Gervais wrote: > Sometimes when the RTC battery is inserted, the voltage will bounce a > bit and we've seen that this can randomly flip configuration bits in > the RTC. > > For example, we've seen COF bits flips and then the output clock > frequency would

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-16 Thread Len Brown
On Thu, Apr 15, 2021 at 1:47 AM Borislav Petkov wrote: > What I'd like to see is 0-overhead for current use cases and only > overhead for those who want to use it. If that can't be done > automagically, then users should request it explicitly. So basically you > blow up the xsave buffer only for

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Willy Tarreau
On Fri, Apr 16, 2021 at 11:39:00PM +0200, Miguel Ojeda wrote: > On Fri, Apr 16, 2021 at 10:58 PM Willy Tarreau wrote: > > > > No, two: > > - ok in %rax (seems like it's "!ok" technically speaking since it > > returns 1 on !ok and 0 on ok) > > - foo_or_err in %rdx > > Yes, but that is the

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-16 Thread Andy Lutomirski
On Fri, Apr 16, 2021 at 2:54 PM Len Brown wrote: > > On Thu, Apr 15, 2021 at 12:24 PM Andy Lutomirski wrote: > > On Wed, Apr 14, 2021 at 2:48 PM Len Brown wrote: > > > > > ... the transition penalty into and out of AMX code > > The concept of 'transition' exists between AVX and SSE instructions

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Borislav Petkov
On Fri, Apr 16, 2021 at 02:49:23PM -0700, Sami Tolvanen wrote: > __nocfi only disables CFI checking in a function, the compiler still > changes function addresses to point to the CFI jump table, which is > why we need function_nocfi(). So call it __func_addr() or get_function_addr() or so, so that

Re: [PATCH v2] X86: Makefile: Replace -pg with CC_FLAGS_FTRACE

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:39, zhaoxiao wrote: > In preparation for x86 supporting ftrace built on other compiler > options, let's have the x86 Makefiles remove the $(CC_FLAGS_FTRACE) > flags, whatever these may be, rather than assuming '-pg'. s/let's have the/make the/ > There should be no functi

Re: Candidate Linux ABI for Intel AMX and hypothetical new related features

2021-04-16 Thread Len Brown
On Thu, Apr 15, 2021 at 12:24 PM Andy Lutomirski wrote: > On Wed, Apr 14, 2021 at 2:48 PM Len Brown wrote: > > > ... the transition penalty into and out of AMX code The concept of 'transition' exists between AVX and SSE instructions because it is possible to mix both instruction sets and touch

Re: [PATCH net-next 4/6] r8152: support new chips

2021-04-16 Thread Jakub Kicinski
On Fri, 16 Apr 2021 16:04:35 +0800 Hayes Wang wrote: > Support RTL8153C, RTL8153D, RTL8156A, and RTL8156B. The RTL8156A > and RTL8156B are the 2.5G ethernet. > > Signed-off-by: Hayes Wang > + switch (tp->version) { > + case RTL_VER_10: > + data = ocp_reg_read(tp, 0xad40); > +

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Sami Tolvanen
On Fri, Apr 16, 2021 at 2:18 PM Borislav Petkov wrote: > > On Fri, Apr 16, 2021 at 01:38:34PM -0700, Sami Tolvanen wrote: > > With CONFIG_CFI_CLANG, the compiler replaces function addresses in > > instrumented C code with jump table addresses. This change implements > > the function_nocfi() macro,

Re: [PATCH v3 0/6] percpu: partial chunk depopulation

2021-04-16 Thread Dennis Zhou
Hello, On Sat, Apr 17, 2021 at 01:14:03AM +0530, Pratik Sampat wrote: > > > On 17/04/21 12:39 am, Roman Gushchin wrote: > > On Sat, Apr 17, 2021 at 12:11:37AM +0530, Pratik Sampat wrote: > > > > > > On 17/04/21 12:04 am, Roman Gushchin wrote: > > > > On Fri, Apr 16, 2021 at 11:57:03PM +0530, Pr

Re: [patch] x86/crash: fix crash_setup_memmap_entries() out-of-bounds access

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 17:13, Mike Galbraith wrote: > On Fri, 2021-04-16 at 16:44 +0200, Borislav Petkov wrote: >> On Fri, Apr 16, 2021 at 03:16:07PM +0200, Mike Galbraith wrote: >> > On Fri, 2021-04-16 at 14:16 +0200, Borislav Petkov wrote: >> > > >> > > Please be more verbose and structure your c

Re: [PATCH v13 00/12] Add AMD SEV guest live migration support

2021-04-16 Thread Steve Rutherford
On Thu, Apr 15, 2021 at 8:52 AM Ashish Kalra wrote: > > From: Ashish Kalra > > The series add support for AMD SEV guest live migration commands. To protect > the > confidentiality of an SEV protected guest memory while in transit we need to > use the SEV commands defined in SEV API spec [1]. > >

[ANNOUNCE] 4.19.188-rt77

2021-04-16 Thread Clark Williams
Hello RT-list! I'm pleased to announce the 4.19.188-rt77 stable release. Note that this is a merge of the v4.19.188 stable release and the backport of two RT commits: 87bd0bf324f4mm: slub: Don't resize the location tracking cache on PREEMPT_RT 3c7e3c2cc78dlocking/rwsem-rt: Add __down_rea

[PATCH] perf arm64: Fix off-by-one directory paths.

2021-04-16 Thread Ian Rogers
Relative path include works in the regular build due to -I paths but may break in other situations. Signed-off-by: Ian Rogers --- tools/perf/arch/arm64/util/kvm-stat.c | 4 ++-- tools/perf/arch/arm64/util/pmu.c | 4 ++-- tools/perf/arch/arm64/util/unwind-libunwind.c | 4 ++--

Re: [PATCH v2] arm64: vdso: remove commas between macro name and arguments

2021-04-16 Thread Ard Biesheuvel
On Fri, 16 Apr 2021 at 22:35, Jian Cai wrote: > > LLVM's integrated assembler does not support using commas separating > the name and arguments in .macro. However, only spaces are used in the > manual page. This replaces commas between macro names and the subsequent > arguments with space in calls

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Miguel Ojeda
On Fri, Apr 16, 2021 at 10:58 PM Willy Tarreau wrote: > > No, two: > - ok in %rax (seems like it's "!ok" technically speaking since it > returns 1 on !ok and 0 on ok) > - foo_or_err in %rdx Yes, but that is the implementation -- conceptually you only have one or the other, and Rust won't

Re: [PATCH 04/15] static_call: Use global functions for the self-test

2021-04-16 Thread Thomas Gleixner
On Fri, Apr 16 2021 at 13:38, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler renames static functions. This > breaks static_call users using static functions, because the current > implementation assumes functions have stable names by hardcoding them > in inline assembly. Make the self

Re: [PATCH bpf-next v4 0/3] add batched ops for percpu array

2021-04-16 Thread Martin KaFai Lau
On Thu, Apr 15, 2021 at 02:46:16PM -0300, Pedro Tammela wrote: > This patchset introduces batched operations for the per-cpu variant of > the array map. > > It also removes the percpu macros from 'bpf_util.h'. This change was > suggested by Andrii in a earlier iteration of this patchset. > > The

Re: [RFC PATCH] capabilities: require CAP_SETFCAP to map uid 0 (v3)

2021-04-16 Thread Serge E. Hallyn
On Fri, Apr 16, 2021 at 05:05:01PM +0200, Christian Brauner wrote: > On Thu, Apr 15, 2021 at 11:58:51PM -0500, Serge Hallyn wrote: > > (Eric - this patch (v3) is a cleaned up version of the previous approach. > > v4 is at > > https://git.kernel.org/pub/scm/linux/kernel/git/sergeh/linux.git/log/?h=

Re: [PATCH v2] sched: Warn on long periods of pending need_resched

2021-04-16 Thread Josh Don
On Fri, Apr 16, 2021 at 8:05 AM Peter Zijlstra wrote: > > On Tue, Mar 30, 2021 at 03:44:12PM -0700, Josh Don wrote: > > Peter, > > > > Since you've already pulled the need_resched warning patch into your > > tree, I'm including just the diff based on that patch (in response to > > Mel's comments)

Re: [PATCH v2] mm/compaction:let proactive compaction order configurable

2021-04-16 Thread David Rientjes
On Sat, 17 Apr 2021, chukaiping wrote: > Currently the proactive compaction order is fixed to > COMPACTION_HPAGE_ORDER(9), it's OK in most machines with lots of > normal 4KB memory, but it's too high for the machines with small > normal memory, for example the machines with most memory configured

[PATCH v2 resubmit] sched: Warn on long periods of pending need_resched

2021-04-16 Thread Josh Don
From: Paul Turner CPU scheduler marks need_resched flag to signal a schedule() on a particular CPU. But, schedule() may not happen immediately in cases where the current task is executing in the kernel mode (no preemption state) for extended periods of time. This patch adds a warn_on if need_res

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-16 Thread Leonardo Bras
Hello Rob, thanks for this feedback! On Thu, 2021-04-15 at 13:59 -0500, Rob Herring wrote: > +PPC and PCI lists > > On Thu, Apr 15, 2021 at 1:01 PM Leonardo Bras wrote: > > > > Many other resource flag parsers already add this flag when the input > > has bits 24 & 25 set, so update this one to

Re: [PATCH net-next 09/10] net: sparx5: add ethtool configuration and statistics support

2021-04-16 Thread Jakub Kicinski
On Fri, 16 Apr 2021 15:16:56 +0200 Steen Hegelund wrote: > + "rx_in_bytes", > + "rx_symbol_err", > + "rx_pause", > + "rx_unsup_opcode", > + "rx_ok_bytes", > + "rx_bad_bytes", > + "rx_unicast", > + "rx_multicast", > + "rx_broadcast", > + "rx_crc_err", > +

Re: [PATCH 0/5] Bring the BusLogic host bus adapter driver up to Y2021

2021-04-16 Thread Maciej W. Rozycki
On Fri, 16 Apr 2021, Khalid Aziz wrote: > > Sadly I didn't get to these resources while they were still there, and > > neither did archive.org, and now they not appear available from anywhere > > online. I'm sure Leonard had this all, but, alas, he is long gone too. > > These documents were a

Re: [PATCH 0/5] evm: Prepare for moving to the LSM infrastructure

2021-04-16 Thread Casey Schaufler
On 4/16/2021 9:37 AM, Roberto Sassu wrote: >> From: Casey Schaufler [mailto:ca...@schaufler-ca.com] >> Sent: Thursday, April 15, 2021 10:44 PM >> On 4/15/2021 3:04 AM, Roberto Sassu wrote: >>> This patch set depends on: >>> >>> https://lore.kernel.org/linux-integrity/20210409114313.4073-1- >> rober

Re: [PATCH] dax: Fix missed wakeup in put_unlocked_entry()

2021-04-16 Thread Vivek Goyal
On Fri, Apr 16, 2021 at 12:56:05PM -0700, Dan Williams wrote: > On Fri, Apr 16, 2021 at 10:35 AM Vivek Goyal wrote: > > > > I am seeing missed wakeups which ultimately lead to a deadlock when I am > > using virtiofs with DAX enabled and running "make -j". I had to mount > > virtiofs as rootfs and

Re: [PATCH net-next 03/10] net: sparx5: add hostmode with phylink support

2021-04-16 Thread Jakub Kicinski
On Fri, 16 Apr 2021 15:16:50 +0200 Steen Hegelund wrote: > +static int sparx5_set_mac_address(struct net_device *dev, void *p) > +{ > + const struct sockaddr *addr = p; > + > + /* Record the address */ > + ether_addr_copy(dev->dev_addr, addr->sa_data); I think you need to validate that

Re: [PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Borislav Petkov
On Fri, Apr 16, 2021 at 01:38:34PM -0700, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler replaces function addresses in > instrumented C code with jump table addresses. This change implements > the function_nocfi() macro, which returns the actual function address > instead. > > Signed-

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Miguel Ojeda
On Fri, Apr 16, 2021 at 10:22 PM Willy Tarreau wrote: > > So it simply does the equivalent of: > > struct result { > int status; > int error; > }; Not exactly, it is more like a tagged union, as Connor mentioned. However, and this is the critical bit: it is a compile-time error to

[PATCH v3 1/2] iommu/sva: Tighten SVA bind API with explicit flags

2021-04-16 Thread Jacob Pan
The void* drvdata parameter isn't really used in iommu_sva_bind_device() API, the current IDXD code "borrows" the drvdata for a VT-d private flag for supervisor SVA usage. Supervisor/Privileged mode request is a generic feature. It should be promoted from the VT-d vendor driver to the generic code

[PATCH v3 0/2] Simplify and restrict IOMMU SVA APIs

2021-04-16 Thread Jacob Pan
A couple of small changes to simplify and restrict SVA APIs. The motivation is to make PASID allocation palatable for cgroup consumptions. Misc cgroup is merged for v5.13, it can be extended for IOASID as another scalar resource. I have not tested on ARM platforms due to availability. Would apprec

[PATCH v3 2/2] iommu/sva: Remove mm parameter from SVA bind API

2021-04-16 Thread Jacob Pan
The mm parameter in iommu_sva_bind_device() is intended for privileged process perform bind() on behalf of other processes. This use case has yet to be materialized, let alone potential security implications of adding kernel hooks without explicit user consent. In addition, with the agreement that

[PATCH] brd: expose number of allocated pages in debugfs

2021-04-16 Thread Saravanan D
From: Calvin Owens While the maximum size of each ramdisk is defined either as a module parameter, or compile time default, it's impossible to know how many pages have currently been allocated by each ram%d device, since they're allocated when used and never freed. This patch creates a new direc

Re: [PATCH] blk-mq: Fix spurious debugfs directory creation during initialization

2021-04-16 Thread Jens Axboe
On 4/7/21 11:59 AM, Saravanan D wrote: > blk_mq_debugfs_register_sched_hctx() called from > device_add_disk()->elevator_init_mq()->blk_mq_init_sched() > initialization sequence does not have relevant parent directory > setup and thus spuriously attempts "sched" directory creation > from root mount

Re: [PATCH v3 5/6] percpu: factor out pcpu_check_chunk_hint()

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:35PM -0700, Roman Gushchin wrote: > Factor out the pcpu_check_chunk_hint() helper, which will be useful > in the future. The new function checks if the allocation can likely > fit the given chunk. > > Signed-off-by: Roman Gushchin > --- > mm/percpu.c | 30 ++

Re: [PATCH][next] sctp: Fix out-of-bounds warning in sctp_process_asconf_param()

2021-04-16 Thread Marcelo Ricardo Leitner
On Fri, Apr 16, 2021 at 02:12:36PM -0500, Gustavo A. R. Silva wrote: > Fix the following out-of-bounds warning: > > net/sctp/sm_make_chunk.c:3150:4: warning: 'memcpy' offset [17, 28] from the > object at 'addr' is out of the bounds of referenced subobject 'v4' with type > 'struct sockaddr_in' at

[tip:master] BUILD SUCCESS 345774c3f039a2d1d4844bfc3deb6ba9a05c6c65

2021-04-16 Thread kernel test robot
onfig-a003-20210416 i386 randconfig-a006-20210416 i386 randconfig-a001-20210416 i386 randconfig-a005-20210416 i386 randconfig-a004-20210416 i386 randconfig-a002-20210416 x86_64 randconfig-a014-20210

Re: [PATCH v20 4/9] mm: hugetlb: free the vmemmap pages associated with each HugeTLB page

2021-04-16 Thread Mike Kravetz
On 4/15/21 1:40 AM, Muchun Song wrote: > Every HugeTLB has more than one struct page structure. We __know__ that > we only use the first 4 (__NR_USED_SUBPAGE) struct page structures > to store metadata associated with each HugeTLB. > > There are a lot of struct page structures associated with each

Re: [PATCH v3 4/6] percpu: generalize pcpu_balance_populated()

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:34PM -0700, Roman Gushchin wrote: > To prepare for the depopulation of percpu chunks, split out the > populating part of the pcpu_balance_populated() into the new > pcpu_grow_populated() (with an intention to add > pcpu_shrink_populated() in the next commit). >

Re: [PATCH v3 3/6] percpu: make pcpu_nr_empty_pop_pages per chunk type

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:33PM -0700, Roman Gushchin wrote: > nr_empty_pop_pages is used to guarantee that there are some free > populated pages to satisfy atomic allocations. Accounted and > non-accounted allocations are using separate sets of chunks, > so both need to have a surplus o

Re: [PATCH v3 2/6] percpu: split __pcpu_balance_workfn()

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:32PM -0700, Roman Gushchin wrote: > __pcpu_balance_workfn() became fairly big and hard to follow, but in > fact it consists of two fully independent parts, responsible for > the destruction of excessive free chunks and population of necessarily > amount of free

Re: [PATCH v3 1/6] percpu: fix a comment about the chunks ordering

2021-04-16 Thread Dennis Zhou
Hello, On Wed, Apr 07, 2021 at 08:57:31PM -0700, Roman Gushchin wrote: > Since the commit 3e54097beb22 ("percpu: manage chunks based on > contig_bits instead of free_bytes") chunks are sorted based on the > size of the biggest continuous free area instead of the total number > of free bytes. Updat

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Willy Tarreau
On Fri, Apr 16, 2021 at 03:34:50PM -0500, Connor Kuehl wrote: > On 4/16/21 3:22 PM, Willy Tarreau wrote: > > So it simply does the equivalent of: > > > > #define EINVAL -1234 > > > > struct result { > > int status; > > int error; > > }; > > Result and Option types are more like a

Re: [PATCH 1/1] of/pci: Add IORESOURCE_MEM_64 to resource flags for 64-bit memory addresses

2021-04-16 Thread Leonardo Bras
Hello Rob, thanks for this feedback! On Thu, 2021-04-15 at 13:59 -0500, Rob Herring wrote: > +PPC and PCI lists > > On Thu, Apr 15, 2021 at 1:01 PM Leonardo Bras wrote: > > > > Many other resource flag parsers already add this flag when the input > > has bits 24 & 25 set, so update this one to

Re: [PATCH] x86/uaccess: small optimization in unsafe_copy_to_user()

2021-04-16 Thread Eric Dumazet
On Fri, Apr 16, 2021 at 10:11 PM Eric Dumazet wrote: > > On Fri, Apr 16, 2021 at 9:44 PM Al Viro wrote: > > > > On Fri, Apr 16, 2021 at 12:24:13PM -0700, Eric Dumazet wrote: > > > From: Eric Dumazet > > > > > > We have to loop only to copy u64 values. > > > After this first loop, we copy at most

Re: [PATCH 00/13] [RFC] Rust support

2021-04-16 Thread Josh Triplett
On Fri, Apr 16, 2021 at 12:27:39PM +0800, Boqun Feng wrote: > Josh, I think it's good if we can connect to the people working on Rust > memoryg model, I think the right person is Ralf Jung and the right place > is https://github.com/rust-lang/unsafe-code-guidelines, but you > cerntainly know better

Re: [PATCH v8 clocksource 2/5] clocksource: Retry clock read if long delays detected

2021-04-16 Thread Thomas Gleixner
On Tue, Apr 13 2021 at 21:35, Paul E. McKenney wrote: > #define WATCHDOG_INTERVAL (HZ >> 1) > #define WATCHDOG_THRESHOLD (NSEC_PER_SEC >> 4) Didn't we discuss that the threshold is too big ?

Re: [PATCH v1 1/1] libnvdimm: Don't use GUID APIs against raw buffer

2021-04-16 Thread Andy Shevchenko
On Fri, Apr 16, 2021 at 01:08:06PM -0700, Dan Williams wrote: > [ add Erik ] > > On Fri, Apr 16, 2021 at 10:36 AM Andy Shevchenko > wrote: > > > > On Thu, Apr 15, 2021 at 05:37:54PM +0300, Andy Shevchenko wrote: > > > Strictly speaking the comparison between guid_t and raw buffer > > > is not cor

Re: [PATCH 1/5] scsi: BusLogic: Fix missing `pr_cont' use

2021-04-16 Thread Khalid Aziz
On 4/15/21 8:08 PM, Joe Perches wrote: > And while it's a lot more code, I'd prefer a solution that looks more > like the other commonly used kernel logging extension mechanisms > where adapter is placed before the format, ... in the argument list. Hi Joe, I don't mind making these changes. It is

[PATCH 15/15] x86, build: Allow CONFIG_CFI_CLANG to be selected

2021-04-16 Thread Sami Tolvanen
Select ARCH_SUPPORTS_CFI_CLANG to allow CFI to be enabled. Signed-off-by: Sami Tolvanen --- arch/x86/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bf69d07e46b8..81d2dc568e56 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -106,6 +10

[PATCH 14/15] x86, kprobes: Fix optprobe_template_func type mismatch

2021-04-16 Thread Sami Tolvanen
The optprobe_template_func symbol is defined in inline assembly, but it's not marked global, which conflicts with the C declaration needed for STACK_FRAME_NON_STANDARD and confuses the compiler when CONFIG_CFI_CLANG is enabled. Marking the symbol global would make the compiler happy, but as the co

[PATCH 12/15] x86, module: Ignore __typeid__ relocations

2021-04-16 Thread Sami Tolvanen
Ignore the __typeid__ relocations generated with CONFIG_CFI_CLANG when loading modules. Signed-off-by: Sami Tolvanen --- arch/x86/kernel/module.c | 4 1 file changed, 4 insertions(+) diff --git a/arch/x86/kernel/module.c b/arch/x86/kernel/module.c index 5e9a34b5bd74..c4aeba237eef 100644 --

[PATCH 13/15] x86, cpu: Use LTO for cpu.c with CFI

2021-04-16 Thread Sami Tolvanen
Allow LTO to be used for cpu.c when CONFIG_CFI_CLANG is enabled to avoid indirect call failures. CFI requires Clang >= 12, which doesn't have the stack protector inlining bug. Signed-off-by: Sami Tolvanen --- arch/x86/power/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/

[PATCH 11/15] x86, relocs: Ignore __typeid__ relocations

2021-04-16 Thread Sami Tolvanen
From: Kees Cook The __typeid__* symbols aren't actually relocations, so they can be ignored during relocation generation. Signed-off-by: Kees Cook Signed-off-by: Sami Tolvanen --- arch/x86/tools/relocs.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/tools/relocs.c b/arch

[PATCH 10/15] x86/purgatory: Disable CFI

2021-04-16 Thread Sami Tolvanen
Disable CONFIG_CFI_CLANG for the stand-alone purgatory.ro. Signed-off-by: Sami Tolvanen --- arch/x86/purgatory/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 95ea17a9d20c..ed46ad780130 100644 --- a/arch

[PATCH 08/15] x86/extable: Do not mark exception callback as CFI

2021-04-16 Thread Sami Tolvanen
From: Kees Cook The exception table entries are constructed out of a relative offset and point to the actual function, not the CFI table entry. For now, just mark the caller as not checking CFI. The failure is most visible at boot with CONFIG_DEBUG_RODATA_TEST=y. Signed-off-by: Kees Cook Signed

[PATCH 09/15] x86/alternatives: Use C int3 selftest but disable KASAN

2021-04-16 Thread Sami Tolvanen
From: Kees Cook Instead of using inline asm for the int3 selftest (which confuses the Clang's ThinLTO pass), this restores the C function but disables KASAN (and tracing for good measure) to keep the things simple and avoid unexpected side-effects. This attempts to keep the fix from commit ecc606

[PATCH 04/15] static_call: Use global functions for the self-test

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler renames static functions. This breaks static_call users using static functions, because the current implementation assumes functions have stable names by hardcoding them in inline assembly. Make the self-test functions global to prevent the compiler from renaming

[PATCH 03/15] objtool: Add ASM_STACK_FRAME_NON_STANDARD

2021-04-16 Thread Sami Tolvanen
To use the STACK_FRAME_NON_STANDARD macro for a static symbol defined in inline assembly, we need a C declaration that implies global visibility. This type mismatch confuses the compiler with CONFIG_CFI_CLANG. This change adds an inline assembly version of the macro to avoid the issue. Signed-off-

[PATCH 07/15] x86/ftrace: Use function_nocfi in MCOUNT_ADDR

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces the __fentry__ address in MCOUNT_ADDR with the address of a CFI jump table. Use function_nocfi() to get the actual function address. Signed-off-by: Sami Tolvanen --- arch/x86/include/asm/ftrace.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 06/15] x86: Avoid CFI jump tables in IDT and entry points

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function addresses in C code with jump table addresses. To avoid referring to jump tables in entry code with PTI, disable CFI for IDT and paravirt code, and use function_nocfi() to prevent jump table addresses from being added to the IDT or system call e

[PATCH 05/15] x86: Implement function_nocfi

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function addresses in instrumented C code with jump table addresses. This change implements the function_nocfi() macro, which returns the actual function address instead. Signed-off-by: Sami Tolvanen --- arch/x86/include/asm/page.h | 14 ++

[PATCH 02/15] objtool: Add CONFIG_CFI_CLANG support

2021-04-16 Thread Sami Tolvanen
With CONFIG_CFI_CLANG, the compiler replaces function references with references to the CFI jump table, which confuses objtool. This change, based on Josh's initial patch [1], goes through the list of relocations and replaces jump table symbols with the actual function symbols. [1] https://lore.k

[PATCH 01/15] objtool: Find a destination for jumps beyond the section end

2021-04-16 Thread Sami Tolvanen
With -ffunction-sections, Clang can generate a jump beyond the end of a section when the section ends in an unreachable instruction. If the offset matches the section length, use the last instruction as the jump destination. Signed-off-by: Sami Tolvanen --- tools/objtool/check.c | 4 1 file

[PATCH 00/15] x86: Add support for Clang CFI

2021-04-16 Thread Sami Tolvanen
e used and fix other smaller issues, such as type conflicts that confuse the compiler. Note that the patches are based on next-20210416. You can also pull the series from https://github.com/samitolvanen/linux.git x86-cfi-v1 Kees Cook (3): x86/extable: Do not mark exception callback as

[PATCH v2] arm64: vdso: remove commas between macro name and arguments

2021-04-16 Thread Jian Cai
LLVM's integrated assembler does not support using commas separating the name and arguments in .macro. However, only spaces are used in the manual page. This replaces commas between macro names and the subsequent arguments with space in calls to clock_gettime_return to make it compatible with IAS.

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Connor Kuehl
On 4/16/21 3:22 PM, Willy Tarreau wrote: > So it simply does the equivalent of: > > #define EINVAL -1234 > > struct result { > int status; > int error; > }; Result and Option types are more like a union with a tag that describes which variant it is. struct foo_result { /* if

Re: [PATCH 0/2] m68k: Add Virtual M68k Machine

2021-04-16 Thread Alexandre Belloni
On 16/04/2021 22:26:26+0200, Alexandre Belloni wrote: > On Tue, 23 Mar 2021 23:14:28 +0100, Laurent Vivier wrote: > > The most powerful m68k machine emulated by QEMU is a Quadra 800, > > but this machine is very limited: only 1 GiB of memory and only some > > specific interfaces, with no DMA. > >

Re: linux-next: Tree for Apr 16 (IMA appraise causing build error)

2021-04-16 Thread Randy Dunlap
Hi, On 4/16/21 1:25 PM, Nayna wrote: > > On 4/16/21 2:53 PM, Randy Dunlap wrote: >> On 4/16/21 4:36 AM, Stephen Rothwell wrote: >>> Hi all, >>> >>> Changes since 20210415: >>> >> I noticed this build error message (on an i386 build): >> >> ../certs/Makefile:52: *** Could not determine digest type

[PATCH 1/2] drm/msm/dp: service only one irq_hpd if there are multiple irq_hpd pending

2021-04-16 Thread Kuogee Hsieh
Some dongle may generate more than one irq_hpd events in a short period of time. This patch will treat those irq_hpd events as single one and service only one irq_hpd event. Signed-off-by: Kuogee Hsieh --- drivers/gpu/drm/msm/dp/dp_display.c | 9 + 1 file changed, 9 insertions(+) diff -

Re: [PATCH 0/2] m68k: Add Virtual M68k Machine

2021-04-16 Thread Alexandre Belloni
On Tue, 23 Mar 2021 23:14:28 +0100, Laurent Vivier wrote: > The most powerful m68k machine emulated by QEMU is a Quadra 800, > but this machine is very limited: only 1 GiB of memory and only some > specific interfaces, with no DMA. > > The Virtual M68k Machine is based on Goldfish interfaces defin

Re: linux-next: Tree for Apr 16 (IMA appraise causing build error)

2021-04-16 Thread Nayna
On 4/16/21 2:53 PM, Randy Dunlap wrote: On 4/16/21 4:36 AM, Stephen Rothwell wrote: Hi all, Changes since 20210415: I noticed this build error message (on an i386 build): ../certs/Makefile:52: *** Could not determine digest type to use from kernel config. Stop. and when I was checking o

Re: [PATCH 04/13] Kbuild: Rust support

2021-04-16 Thread Willy Tarreau
On Fri, Apr 16, 2021 at 08:57:07PM +0200, Miguel Ojeda wrote: > On Fri, Apr 16, 2021 at 8:10 PM Al Viro wrote: > > > > How well would ? operator fit that pattern? _If_ it's just a syntax sugar > > along the lines of "if argument matches Err(_), return Err(_)", the types > > shouldn't be an issue,

Re: [PATCH] powerpc/pseries: extract host bridge from pci_bus prior to bus removal

2021-04-16 Thread Tyrel Datwyler
On 4/16/21 12:15 AM, Daniel Axtens wrote: > Hi Tyrel, > >> The pci_bus->bridge reference may no longer be valid after >> pci_bus_remove() resulting in passing a bad value to device_unregister() >> for the associated bridge device. >> >> Store the host_bridge reference in a separate variable prior

Re: [PATCH][next] sctp: Fix out-of-bounds warning in sctp_process_asconf_param()

2021-04-16 Thread Gustavo A. R. Silva
On 4/16/21 14:53, Kees Cook wrote: > On Fri, Apr 16, 2021 at 02:12:36PM -0500, Gustavo A. R. Silva wrote: >> Fix the following out-of-bounds warning: >> >> net/sctp/sm_make_chunk.c:3150:4: warning: 'memcpy' offset [17, 28] from the >> object at 'addr' is out of the bounds of referenced subobjec

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