Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Kenneth Lee
On Thu, Nov 15, 2018 at 04:54:55PM +0200, Leon Romanovsky wrote: > Date: Thu, 15 Nov 2018 16:54:55 +0200 > From: Leon Romanovsky > To: Kenneth Lee > CC: Kenneth Lee , Tim Sell , > linux-doc@vger.kernel.org, Alexander Shishkin > , Zaibo Xu , > zhangfei@foxmail.com, linux...@huawei.com, haoj

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Kenneth Lee
On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > Date: Mon, 19 Nov 2018 17:14:05 +0800 > From: Kenneth Lee > To: Leon Romanovsky > CC: Tim Sell , linux-doc@vger.kernel.org, > Alexander Shishkin , Zaibo Xu > , zhangfei@foxmail.com, linux...@huawei.com, > haojian.zhu...@linaro.

Re: [PATCH 00/12] unify the interface of the proportional-share policy in blkio/io

2018-11-19 Thread Angelo Ruocco
2018-11-15 17:30 GMT+01:00, Jens Axboe : > On 11/15/18 4:54 AM, Angelo Ruocco wrote: >> Hi Jens, >> >> I have rebased the patchset against the for-4.21/block branch, but I >> can't test them properly because the compiling process has an error on >> a different file. In particular: >> >> include/net

Re: [PATCH v1 1/2]: Documentation/admin-guide: update admin-guide index.rst

2018-11-19 Thread Greg KH
On Mon, Nov 19, 2018 at 08:41:31AM +0300, Alexey Budankov wrote: > > Extend index.rst index file at admin-guide root directory with > the reference to perf-security.rst file being introduced. > > Signed-off-by: Alexey Budankov > --- > Documentation/admin-guide/index.rst | 1 + > 1 file changed

[PATCH v1 6/8] vmw_balloon: mark inflated pages PG_offline

2018-11-19 Thread David Hildenbrand
Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Cc: Xavier Deguillard Cc: Nadav Amit Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Julien Freche Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsir

[PATCH v1 2/8] mm: convert PG_balloon to PG_offline

2018-11-19 Thread David Hildenbrand
PG_balloon was introduced to implement page migration/compaction for pages inflated in virtio-balloon. Nowadays, it is only a marker that a page is part of virtio-balloon and therefore logically offline. We also want to make use of this flag in other balloon drivers - for inflated pages or when on

[PATCH v1 3/8] kexec: export PG_offline to VMCOREINFO

2018-11-19 Thread David Hildenbrand
Right now, pages inflated as part of a balloon driver will be dumped by dump tools like makedumpfile. While XEN is able to check in the crash kernel whether a certain pfn is actuall backed by memory in the hypervisor (see xen_oldmem_pfn_is_ram) and optimize this case, dumps of other balloon inflate

[PATCH v1 1/8] mm: balloon: update comment about isolation/migration/compaction

2018-11-19 Thread David Hildenbrand
Commit b1123ea6d3b3 ("mm: balloon: use general non-lru movable page feature") reworked balloon handling to make use of the general non-lru movable page feature. The big comment block in balloon_compaction.h contains quite some outdated information. Let's fix this. Cc: Andrew Morton Cc: Matthew Wi

[PATCH v1 8/8] PM / Hibernate: exclude all PageOffline() pages

2018-11-19 Thread David Hildenbrand
The content of pages that are marked PG_offline is not of interest (e.g. inflated by a balloon driver), let's skip these pages. Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Len Brown Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Acked-by: Pavel Machek Signe

[PATCH v1 5/8] hv_balloon: mark inflated pages PG_offline

2018-11-19 Thread David Hildenbrand
Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Stephen Hemminger Cc: Kairui Song Cc: Vitaly Kuznetsov Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S.

[PATCH v1 7/8] PM / Hibernate: use pfn_to_online_page()

2018-11-19 Thread David Hildenbrand
Let's use pfn_to_online_page() instead of pfn_to_page() when checking for saveable pages to not save/restore offline memory sections. Cc: "Rafael J. Wysocki" Cc: Pavel Machek Cc: Len Brown Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Suggested-by: Michal Ho

[PATCH v1 4/8] xen/balloon: mark inflated pages PG_offline

2018-11-19 Thread David Hildenbrand
Mark inflated and never onlined pages PG_offline, to tell the world that the content is stale and should not be dumped. Cc: Boris Ostrovsky Cc: Juergen Gross Cc: Stefano Stabellini Cc: Andrew Morton Cc: Matthew Wilcox Cc: Michal Hocko Cc: "Michael S. Tsirkin" Signed-off-by: David Hildenbran

[PATCH v1] makedumpfile: exclude pages that are logically offline

2018-11-19 Thread David Hildenbrand
Linux marks pages that are logically offline via a page flag (map count). Such pages e.g. include pages infated as part of a balloon driver or pages that were not actually onlined when onlining the whole section. While the hypervisor usually allows to read such inflated memory, we basically read a

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Peter Zijlstra
On Mon, Nov 19, 2018 at 08:42:52AM +0300, Alexey Budankov wrote: > > Implement initial version of perf-security.rst documentation file > initially covering security concerns related to PCL/Perf performance > monitoring in multiuser environments. Ditch the PCL thing. That's not a term used anywh

[PATCH V2 06/10] cgroup: make all functions of all cftypes be invoked

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco When two or more entities (of any kind) share a file, their respective cftypes are linked together. The allowed operations on those files are: open, release, write and show, mapped to the functions defined in the cftypes. This commit makes the cgroup core invoke, whenever one

[PATCH V2 07/10] block, bfq: use standard file names for the proportional-share policy

2018-11-19 Thread Paolo Valente
Some of the files exposed in a cgroup by bfq, for the proportional share policy, have the same meaning as the files owned by cfq (before legacy blk was removed). The old implementation of the cgroup interface didn't allow different entities to create cgroup files with the same name (in the same su

[PATCH V2 01/10] cgroup: add hook seq_show_cft with also the owning cftype as parameter

2018-11-19 Thread Paolo Valente
The current implementation of the seq_show hook in the cftype struct has only, as parameters, the seq_file to write to and the arguments passed by the command line. Thus, the only way to retrieve the cftype that owns an instance of such hook function is by using the accessor in the seq_file itself.

[PATCH V2 08/10] block, throttle: allow sharing cgroup statistic files

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco Some of the cgroup files defined in the throttle policy have the same meaning as those defined in the proportional share policy. This commit uses the new file sharing interface in cgroup to share these files. Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- b

[PATCH V2 05/10] block, bfq: align min and default weights with the old cfq default

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco bfq exposes a cgroup attribute, weight, with the same meaning as that exposed by cfq. This commit changes bfq default and min weights to match the ones set by cfq (before legacy blk was removed). Signed-off-by: Angelo Ruocco Signed-off-by: Paolo Valente --- block/bfq-iosc

[PATCH V2 09/10] doc, bfq-iosched: fix a few clerical errors

2018-11-19 Thread Paolo Valente
This commit fixes a few clerical errors in Documentation/block/bfq-iosched.txt. Signed-off-by: Paolo Valente --- Documentation/block/bfq-iosched.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/block/bfq-iosched.txt b/Documentation/block/bfq-iosched.tx

[PATCH V2 10/10] doc, bfq-iosched: make it consistent with the new cgroup interface

2018-11-19 Thread Paolo Valente
BFQ now shares interface files with CFQ, for the proportional-share policy. Make documentation consistent with that. Signed-off-by: Paolo Valente --- Documentation/block/bfq-iosched.txt | 28 +++- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Documentati

[PATCH V2 03/10] cgroup: link cftypes of the same subsystem with the same name

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco Two entities, of any kind, are not able to create a cgroup file with the same name in the same folder: if an entity tries to create a file that has the same name as a file created by another entity, the cgroup core stops it, warns the user about the error, and then proceeds to

[PATCH V2 04/10] cgroup: add owner name to cftypes

2018-11-19 Thread Paolo Valente
From: Angelo Ruocco The piece of information "who created a certain cftype" is not stored anywhere, thus a cftype is not able to know who is its owner. This commit addresses this problem by adding a new field in the cftype structure that enables the name of its owner to be explicitly set. Signe

[PATCH V2 02/10] block, cgroup: pass cftype to functions that need to use it

2018-11-19 Thread Paolo Valente
Some seq_show functions need to access the cftype they belong to, for retrieving the data to show. These functions get their cftype by using the seq_cft accessor for the seq_file. This solution is no longer viable in case a seq_file is shared among more than one cftype, because the accessor always

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Jordan Glover
On Monday, November 19, 2018 6:42 AM, Alexey Budankov wrote: > Implement initial version of perf-security.rst documentation file > initially covering security concerns related to PCL/Perf performance > monitoring in multiuser environments. > > Suggested-by: Thomas Gleixner t...@linutronix.de > S

[PATCH V2 00/10] unify the interface of the proportional-share policy in blkio/io

2018-11-19 Thread Paolo Valente
Hi, here is the V2 of this patch series. Let me rephrase the description of the series, in view of the fact that CFQ will be gone with legacy block. The current implementation of cgroups doesn't allow two or more entities, e.g., I/O schedulers, to share the same files. Thus, to enable people to s

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Peter Zijlstra
On Mon, Nov 19, 2018 at 10:35:59AM +, Jordan Glover wrote: > On Monday, November 19, 2018 6:42 AM, Alexey Budankov > wrote: > > +>=3: > > > > - Restrict *access* to PCL performance monitoring for unprivileged > > processes. > > > > > > - This is the default on Debian and Android

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Leon Romanovsky
On Mon, Nov 19, 2018 at 05:19:10PM +0800, Kenneth Lee wrote: > On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > > Date: Mon, 19 Nov 2018 17:14:05 +0800 > > From: Kenneth Lee > > To: Leon Romanovsky > > CC: Tim Sell , linux-doc@vger.kernel.org, > > Alexander Shishkin , Zaibo Xu > >

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Jordan Glover
On Monday, November 19, 2018 11:46 AM, Peter Zijlstra wrote: > On Mon, Nov 19, 2018 at 10:35:59AM +, Jordan Glover wrote: > > > On Monday, November 19, 2018 6:42 AM, Alexey Budankov > > alexey.budan...@linux.intel.com wrote: > > > > > +>=3: > > > > > > - Restrict *access* to PCL per

Re: [PATCH v2] Document /proc/pid PID reuse behavior

2018-11-19 Thread Pavel Machek
On Mon 2018-11-05 13:22:05, Daniel Colascione wrote: > State explicitly that holding a /proc/pid file descriptor open does > not reserve the PID. Also note that in the event of PID reuse, these > open file descriptors refer to the old, now-dead process, and not the > new one that happens to be name

[PATCH] Documentation: Use "while" instead of "whilst"

2018-11-19 Thread Will Deacon
Whilst making an unrelated change to some Documentation, Linus sayeth: | Afaik, even in Britain, "whilst" is unusual and considered more | formal, and "while" is the common word. | | [...] | | Can we just admit that we work with computers, and we don't need to | use þe eald Englisc s

Re: [PATCH v2] Document /proc/pid PID reuse behavior

2018-11-19 Thread Aleksa Sarai
On 2018-11-07, Daniel Colascione wrote: > On Wed, Nov 7, 2018 at 4:00 PM, Michal Hocko wrote: > > On Wed 07-11-18 15:48:20, Daniel Colascione wrote: > >> On Tue, Nov 6, 2018 at 1:05 PM, Michal Hocko wrote: > >> > otherwise anybody could simply DoS the system > >> > by consuming all available pid

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

2018-11-19 Thread Stefan Agner
On 15.11.2018 23:16, Fernando Ramos wrote: > This patch unifies the naming of DRM functions for reference counting as > requested on Documentation/gpu/todo.rst > > Signed-off-by: Fernando Ramos > --- > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++-- > drivers/gpu/drm/atmel-hlcdc/atmel_hlc

Re: [PATCH v1 2/8] mm: convert PG_balloon to PG_offline

2018-11-19 Thread Konstantin Khlebnikov
On Mon, Nov 19, 2018 at 1:16 PM David Hildenbrand wrote: > > PG_balloon was introduced to implement page migration/compaction for pages > inflated in virtio-balloon. Nowadays, it is only a marker that a page is > part of virtio-balloon and therefore logically offline. > > We also want to make use

Re: [PATCH v1 7/8] PM / Hibernate: use pfn_to_online_page()

2018-11-19 Thread Michal Hocko
On Mon 19-11-18 11:16:15, David Hildenbrand wrote: > Let's use pfn_to_online_page() instead of pfn_to_page() when checking > for saveable pages to not save/restore offline memory sections. > > Cc: "Rafael J. Wysocki" > Cc: Pavel Machek > Cc: Len Brown > Cc: Andrew Morton > Cc: Matthew Wilcox

Re: [PATCH 3/9] drm: replace "drm_dev_unref" function with "drm_dev_put"

2018-11-19 Thread Shawn Guo
On Thu, Nov 15, 2018 at 11:16:23PM +0100, Fernando Ramos wrote: > This patch unifies the naming of DRM functions for reference counting as > requested on Documentation/gpu/todo.rst > > Signed-off-by: Fernando Ramos > --- > drivers/gpu/drm/arc/arcpgu_drv.c | 4 ++-- > drivers/gpu/drm/

Re: [PATCH v1 4/8] xen/balloon: mark inflated pages PG_offline

2018-11-19 Thread Juergen Gross
On 19/11/2018 11:16, David Hildenbrand wrote: > Mark inflated and never onlined pages PG_offline, to tell the world that > the content is stale and should not be dumped. > > Cc: Boris Ostrovsky > Cc: Juergen Gross > Cc: Stefano Stabellini > Cc: Andrew Morton > Cc: Matthew Wilcox > Cc: Michal

Re: [PATCH v10 0/9] Add the I3C subsystem

2018-11-19 Thread vitor
Hi Boris, On 16/11/18 13:16, Boris Brezillon wrote: On Fri, 16 Nov 2018 12:31:42 + vitor wrote: Hi Boris, On 15/11/18 19:00, Boris Brezillon wrote: On Thu, 15 Nov 2018 18:03:47 + vitor wrote: Hi Boris, On 15/11/18 15:28, Boris Brezillon wrote: On Thu, 15 Nov 2018 16:01:37 +

Re: [PATCH v10 0/9] Add the I3C subsystem

2018-11-19 Thread Boris Brezillon
On Mon, 19 Nov 2018 12:35:42 + vitor wrote: > Hi Boris, > > On 16/11/18 13:16, Boris Brezillon wrote: > > On Fri, 16 Nov 2018 12:31:42 + > > vitor wrote: > > > >> Hi Boris, > >> > >> > >> On 15/11/18 19:00, Boris Brezillon wrote: > >>> On Thu, 15 Nov 2018 18:03:47 + > >>> vitor

Re: [PATCH v10 0/9] Add the I3C subsystem

2018-11-19 Thread vitor
On 19/11/18 12:43, Boris Brezillon wrote: I know [1], but there might be other subsystems doing the same thing. [1]https://urldefense.proofpoint.com/v2/url?u=https-3A__elixir.bootlin.com_linux_v4.20-2Drc3_source_drivers_spi_spidev.c&d=DwIFaQ&c=DPL6_X_6JkXFx7AXWqB0tg&r=qVuU64u9x77Y0Kd0PhDK_lpxFgg

Re: [PATCH v1 4/8] xen/balloon: mark inflated pages PG_offline

2018-11-19 Thread David Hildenbrand
On 19.11.18 13:22, Juergen Gross wrote: > On 19/11/2018 11:16, David Hildenbrand wrote: >> Mark inflated and never onlined pages PG_offline, to tell the world that >> the content is stale and should not be dumped. >> >> Cc: Boris Ostrovsky >> Cc: Juergen Gross >> Cc: Stefano Stabellini >> Cc: An

Re: [PATCH v1 7/8] PM / Hibernate: use pfn_to_online_page()

2018-11-19 Thread Pavel Machek
On Mon 2018-11-19 11:16:15, David Hildenbrand wrote: > Let's use pfn_to_online_page() instead of pfn_to_page() when checking > for saveable pages to not save/restore offline memory sections. > > Cc: "Rafael J. Wysocki" Acked-by: Pavel Machek -- (english) http://www.livejournal.com/~pavelmache

Re: [LKP] dad4f140ed [ 7.709376] WARNING:suspicious_RCU_usage

2018-11-19 Thread Matthew Wilcox
On Sun, Nov 18, 2018 at 05:19:04PM -0800, Matthew Wilcox wrote: > On Mon, Nov 19, 2018 at 09:08:20AM +0800, kernel test robot wrote: > > Greetings, > > > > 0day kernel testing robot got the below dmesg and the first bad commit is > > Umm. I don't see a 'suspicious RCU usage' message in here. I

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Alexey Budankov
Hi, On 19.11.2018 13:33, Peter Zijlstra wrote: > On Mon, Nov 19, 2018 at 08:42:52AM +0300, Alexey Budankov wrote: >> >> Implement initial version of perf-security.rst documentation file >> initially covering security concerns related to PCL/Perf performance >> monitoring in multiuser environments

Re: [PATCH v1 1/2]: Documentation/admin-guide: update admin-guide index.rst

2018-11-19 Thread Alexey Budankov
Hello Greg, On 19.11.2018 13:03, Greg KH wrote: > On Mon, Nov 19, 2018 at 08:41:31AM +0300, Alexey Budankov wrote: >> >> Extend index.rst index file at admin-guide root directory with >> the reference to perf-security.rst file being introduced. >> >> Signed-off-by: Alexey Budankov >> --- >> Doc

Re: [PATCH v1 2/2]: Documentation/admin-guide: introduce perf-security.rst file

2018-11-19 Thread Alexey Budankov
Hi, On 19.11.2018 13:49, Jordan Glover wrote: > On Monday, November 19, 2018 11:46 AM, Peter Zijlstra > wrote: > >> On Mon, Nov 19, 2018 at 10:35:59AM +, Jordan Glover wrote: >> >>> On Monday, November 19, 2018 6:42 AM, Alexey Budankov >>> alexey.budan...@linux.intel.com wrote: >>> +>

[PATCH v11 07/24] kasan: rename kasan_zero_page to kasan_early_shadow_page

2018-11-19 Thread Andrey Konovalov
With tag based KASAN mode the early shadow value is 0xff and not 0x00, so this patch renames kasan_zero_(page|pte|pmd|pud|p4d) to kasan_early_shadow_(page|pte|pmd|pud|p4d) to avoid confusion. Suggested-by: Mark Rutland Signed-off-by: Andrey Konovalov --- arch/arm64/mm/kasan_init.c | 43

[PATCH v11 08/24] kasan: initialize shadow to 0xff for tag-based mode

2018-11-19 Thread Andrey Konovalov
A tag-based KASAN shadow memory cell contains a memory tag, that corresponds to the tag in the top byte of the pointer, that points to that memory. The native top byte value of kernel pointers is 0xff, so with tag-based KASAN we need to initialize shadow memory to 0xff. Reviewed-by: Andrey Ryabini

[PATCH v11 06/24] kasan, arm64: adjust shadow size for tag-based mode

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN uses 1 shadow byte for 16 bytes of kernel memory, so it requires 1/16th of the kernel virtual address space for the shadow memory. This commit sets KASAN_SHADOW_SCALE_SHIFT to 4 when the tag-based KASAN mode is enabled. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Sig

[PATCH v11 10/24] kasan: add tag related helper functions

2018-11-19 Thread Andrey Konovalov
This commit adds a few helper functions, that are meant to be used to work with tags embedded in the top byte of kernel pointers: to set, to get or to reset the top byte. Signed-off-by: Andrey Konovalov --- arch/arm64/include/asm/kasan.h | 8 +-- arch/arm64/include/asm/memory.h | 12 ++

[PATCH v11 18/24] mm: move obj_to_index to include/linux/slab_def.h

2018-11-19 Thread Andrey Konovalov
While with SLUB we can actually preassign tags for caches with contructors and store them in pointers in the freelist, SLAB doesn't allow that since the freelist is stored as an array of indexes, so there are no pointers to store the tags. Instead we compute the tag twice, once when a slab is crea

[PATCH v11 14/24] kasan, arm64: enable top byte ignore for the kernel

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN uses the Top Byte Ignore feature of arm64 CPUs to store a pointer tag in the top byte of each pointer. This commit enables the TCR_TBI1 bit, which enables Top Byte Ignore for the kernel, when tag-based KASAN is used. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-

[PATCH v11 19/24] kasan: add hooks implementation for tag-based mode

2018-11-19 Thread Andrey Konovalov
This commit adds tag-based KASAN specific hooks implementation and adjusts common generic and tag-based KASAN ones. 1. When a new slab cache is created, tag-based KASAN rounds up the size of the objects in this cache to KASAN_SHADOW_SCALE_SIZE (== 16). 2. On each kmalloc tag-based KASAN genera

[PATCH v11 21/24] kasan, mm, arm64: tag non slab memory allocated via pagealloc

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN doesn't check memory accesses through pointers tagged with 0xff. When page_address is used to get pointer to memory that corresponds to some page, the tag of the resulting pointer gets set to 0xff, even though the allocated memory might have been tagged differently. For slab pages

[PATCH v11 23/24] kasan: update documentation

2018-11-19 Thread Andrey Konovalov
This patch updates KASAN documentation to reflect the addition of the new tag-based mode. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov --- Documentation/dev-tools/kasan.rst | 232 ++ 1 file changed, 138 insertions(+), 94 de

[PATCH v11 24/24] kasan: add SPDX-License-Identifier mark to source files

2018-11-19 Thread Andrey Konovalov
This patch adds a "SPDX-License-Identifier: GPL-2.0" mark to all source files under mm/kasan. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov --- mm/kasan/common.c | 1 + mm/kasan/generic.c| 1 + mm/kasan/generic_report.c | 1 + mm/kasan/

[PATCH v11 15/24] kasan, mm: perform untagged pointers comparison in krealloc

2018-11-19 Thread Andrey Konovalov
The krealloc function checks where the same buffer was reused or a new one allocated by comparing kernel pointers. Tag-based KASAN changes memory tag on the krealloc'ed chunk of memory and therefore also changes the pointer tag of the returned pointer. Therefore we need to perform comparison on unt

[PATCH v11 16/24] kasan: split out generic_report.c from report.c

2018-11-19 Thread Andrey Konovalov
This patch moves generic KASAN specific error reporting routines to generic_report.c without any functional changes, leaving common error reporting code in report.c to be later reused by tag-based KASAN. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov ---

[PATCH v11 22/24] kasan: add __must_check annotations to kasan hooks

2018-11-19 Thread Andrey Konovalov
This patch adds __must_check annotations to kasan hooks that return a pointer to make sure that a tagged pointer always gets propagated. Suggested-by: Andrey Ryabinin Signed-off-by: Andrey Konovalov --- include/linux/kasan.h | 16 ++-- mm/kasan/common.c | 14 -- 2 fi

[PATCH v11 17/24] kasan: add bug reporting routines for tag-based mode

2018-11-19 Thread Andrey Konovalov
This commit adds rountines, that print tag-based KASAN error reports. Those are quite similar to generic KASAN, the difference is: 1. The way tag-based KASAN finds the first bad shadow cell (with a mismatching tag). Tag-based KASAN compares memory tags from the shadow memory to the pointer t

[PATCH v11 20/24] kasan, arm64: add brk handler for inline instrumentation

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN inline instrumentation mode (which embeds checks of shadow memory into the generated code, instead of inserting a callback) generates a brk instruction when a tag mismatch is detected. This commit adds a tag-based KASAN specific brk handler, that decodes the immediate value passed

[PATCH v11 12/24] kasan: preassign tags to objects with ctors or SLAB_TYPESAFE_BY_RCU

2018-11-19 Thread Andrey Konovalov
An object constructor can initialize pointers within this objects based on the address of the object. Since the object address might be tagged, we need to assign a tag before calling constructor. The implemented approach is to assign tags to objects with constructors when a slab is allocated and c

Re: [PATCH v11 00/24] kasan: add software tag-based mode for arm64

2018-11-19 Thread Andrey Konovalov
On Mon, Nov 19, 2018 at 6:26 PM, Andrey Konovalov wrote: > This patchset adds a new software tag-based mode to KASAN [1]. > (Initially this mode was called KHWASAN, but it got renamed, > see the naming rationale at the end of this section). > > The plan is to implement HWASan [2] for the kernel w

[PATCH v11 13/24] kasan, arm64: fix up fault handling logic

2018-11-19 Thread Andrey Konovalov
Right now arm64 fault handling code removes pointer tags from addresses covered by TTBR0 in faults taken from both EL0 and EL1, but doesn't do that for pointers covered by TTBR1. This patch adds two helper functions is_ttbr0_addr() and is_ttbr1_addr(), where the latter one accounts for the fact th

[PATCH v11 09/24] arm64: move untagged_addr macro from uaccess.h to memory.h

2018-11-19 Thread Andrey Konovalov
Move the untagged_addr() macro from arch/arm64/include/asm/uaccess.h to arch/arm64/include/asm/memory.h to be later reused by KASAN. Also make the untagged_addr() macro accept all kinds of address types (void *, unsigned long, etc.). This allows not to specify type casts in each place where the ma

[PATCH v11 11/24] kasan, arm64: untag address in _virt_addr_is_linear

2018-11-19 Thread Andrey Konovalov
virt_addr_is_linear (which is used by virt_addr_valid) assumes that the top byte of the address is 0xff, which isn't always the case with tag-based KASAN. This patch resets the tag in this macro. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov --- arch/

[PATCH v11 05/24] kasan: add CONFIG_KASAN_GENERIC and CONFIG_KASAN_SW_TAGS

2018-11-19 Thread Andrey Konovalov
This commit splits the current CONFIG_KASAN config option into two: 1. CONFIG_KASAN_GENERIC, that enables the generic KASAN mode (the one that exists now); 2. CONFIG_KASAN_SW_TAGS, that enables the software tag-based KASAN mode. The name CONFIG_KASAN_SW_TAGS is chosen as in the future we will h

[PATCH v11 04/24] kasan: rename source files to reflect the new naming scheme

2018-11-19 Thread Andrey Konovalov
We now have two KASAN modes: generic KASAN and tag-based KASAN. Rename kasan.c to generic.c to reflect that. Also rename kasan_init.c to init.c as it contains initialization code for both KASAN modes. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov --- m

[PATCH v11 03/24] kasan: move common generic and tag-based code to common.c

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN reuses a significant part of the generic KASAN code, so move the common parts to common.c without any functional changes. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: Andrey Konovalov --- mm/kasan/Makefile | 5 +- mm/kasan/common.c | 603

[PATCH v11 00/24] kasan: add software tag-based mode for arm64

2018-11-19 Thread Andrey Konovalov
This patchset adds a new software tag-based mode to KASAN [1]. (Initially this mode was called KHWASAN, but it got renamed, see the naming rationale at the end of this section). The plan is to implement HWASan [2] for the kernel with the incentive, that it's going to have comparable to KASAN perf

[PATCH v11 01/24] kasan, mm: change hooks signatures

2018-11-19 Thread Andrey Konovalov
Tag-based KASAN changes the value of the top byte of pointers returned from the kernel allocation functions (such as kmalloc). This patch updates KASAN hooks signatures and their usage in SLAB and SLUB code to reflect that. Reviewed-by: Andrey Ryabinin Reviewed-by: Dmitry Vyukov Signed-off-by: A

[PATCH v11 02/24] kasan, slub: handle pointer tags in early_kmem_cache_node_alloc

2018-11-19 Thread Andrey Konovalov
The previous patch updated KASAN hooks signatures and their usage in SLAB and SLUB code, except for the early_kmem_cache_node_alloc function. This patch handles that function separately, as it requires to reorder some of the initialization code to correctly propagate a tagged pointer in case a tag

Re: [PATCH v11 00/24] kasan: add software tag-based mode for arm64

2018-11-19 Thread Mark Rutland
On Mon, Nov 19, 2018 at 06:28:57PM +0100, Andrey Konovalov wrote: > On Mon, Nov 19, 2018 at 6:26 PM, Andrey Konovalov > wrote: > > Changes in v11: > > - Rebased onto 9ff01193 (4.20-rc3). > > - Moved KASAN_SHADOW_SCALE_SHIFT definition to arch/arm64/Makefile. > > - Added and used CC_HAS_KASAN_GENE

Re: PLEASE REVERT URGENTLY: Re: [PATCH v5 2/3] x86/boot: add acpi rsdp address to setup_header

2018-11-19 Thread Konrad Rzeszutek Wilk
On Sun, Nov 11, 2018 at 10:49:39AM -0800, H. Peter Anvin wrote: > On 11/10/18 1:03 AM, Juergen Gross wrote: > > > > How would that help? The garabge data written could have the correct > > terminal sentinel value by chance. > > > > That's why I re-used an existing field in setup_header (the versi

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 12:48:01PM +0200, Leon Romanovsky wrote: > On Mon, Nov 19, 2018 at 05:19:10PM +0800, Kenneth Lee wrote: > > On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > > > On Thu, Nov 15, 2018 at 04:54:55PM +0200, Leon Romanovsky wrote: > > > > On Thu, Nov 15, 2018 at 04:

Re: [PATCH v3 7/7] cgroup: document cgroup v2 freezer interface

2018-11-19 Thread Roman Gushchin
On Sat, Nov 17, 2018 at 12:02:28AM -0800, Mike Rapoport wrote: > Hi, > > On Fri, Nov 16, 2018 at 04:38:30PM -0800, Roman Gushchin wrote: > > Describe cgroup v2 freezer interface in the cgroup v2 admin guide. > > > > Signed-off-by: Roman Gushchin > > Cc: Tejun Heo > > Cc: linux-doc@vger.kernel.o

Re: [PATCH] hwmon (ina3221) Add single-shot mode support

2018-11-19 Thread Guenter Roeck
On Fri, Nov 16, 2018 at 05:51:34PM -0800, Nicolin Chen wrote: > Hello Guenter, > > On Wed, Nov 14, 2018 at 09:23:30AM -0800, Guenter Roeck wrote: > > > An alternative way (without the sysfs node), after looking at > > > other hwmon code, could be to have a timed polling thread and > > > read data

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > Just to comment on this, any infiniband driver which use umem and do > not have ODP (here ODP for me means listening to mmu notifier so all > infiniband driver except mlx5) will be affected by same issue AFAICT. > > AFAICT there is

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > > > Just to comment on this, any infiniband driver which use umem and do > > not have ODP (here ODP for me means listening to mmu notifier so all > > infiniband drive

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 05:14:05PM +0800, Kenneth Lee wrote: > If the hardware cannot share page table with the CPU, we then need to have > some way to change the device page table. This is what happen in ODP. It > invalidates the page table in device upon mmu_notifier call back. But this > cann

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > > > > > Just to comment on this, any infiniband driver which use umem and do > > > not have ODP (he

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Leon Romanovsky
On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > > > > > Just to comment on this, any infiniband driver which use umem and do > > > not have ODP (her

Re: [PATCH v8 01/13] arch/resctrl: Start renaming the rdt files to more generic names

2018-11-19 Thread Thomas Gleixner
On Sun, 18 Nov 2018, Borislav Petkov wrote: > > Now, it looks to me like the whole resctrl thing begs for its own dir: > > arch/x86/kernel/cpu/resctrl/core.c > arch/x86/kernel/cpu/resctrl/ctrlmondata.c > arch/x86/kernel/cpu/resctrl/internal.h > arch/x86/kernel/cpu/resctrl/monitor.c > arch/x8

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 11:53:33AM -0700, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > > On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > > > On Mon, Nov 19, 2018 at 11:48:54AM -0500, Jerome Glisse wrote: > > > > > > > Just to comment

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Christopher Lameter
On Mon, 19 Nov 2018, Jerome Glisse wrote: > > IIRC this is solved in IB by automatically calling > > madvise(MADV_DONTFORK) before creating the MR. > > > > MADV_DONTFORK > > .. This is useful to prevent copy-on-write semantics from changing the > > physical location of a page if the parent wri

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 07:19:04PM +, Christopher Lameter wrote: > On Mon, 19 Nov 2018, Jerome Glisse wrote: > > > > IIRC this is solved in IB by automatically calling > > > madvise(MADV_DONTFORK) before creating the MR. > > > > > > MADV_DONTFORK > > > .. This is useful to prevent copy-on-wr

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 02:17:21PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 11:53:33AM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > > > On Mon, Nov 19, 2018 at 11:27:52AM -0700, Jason Gunthorpe wrote: > > > > On Mon, Nov 19, 2018 at

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 12:27:02PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 02:17:21PM -0500, Jerome Glisse wrote: > > On Mon, Nov 19, 2018 at 11:53:33AM -0700, Jason Gunthorpe wrote: > > > On Mon, Nov 19, 2018 at 01:42:16PM -0500, Jerome Glisse wrote: > > > > On Mon, Nov 19, 2018 at

RE: [PATCH v8 01/13] arch/resctrl: Start renaming the rdt files to more generic names

2018-11-19 Thread Moger, Babu
Boris/Thomas, > -Original Message- > From: Thomas Gleixner > Sent: Monday, November 19, 2018 1:14 PM > To: Borislav Petkov > Cc: Moger, Babu ; mi...@redhat.com; > cor...@lwn.net; fenghua...@intel.com; reinette.cha...@intel.com; > pet...@infradead.org; gre...@linuxfoundation.org; > da...@

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 02:46:32PM -0500, Jerome Glisse wrote: > > ?? How can O_DIRECT be fine but RDMA not? They use exactly the same > > get_user_pages flow, right? Can we do what O_DIRECT does in RDMA and > > be fine too? > > > > AFAIK the only difference is the length of the race window. You'

Re: [PATCH v8 01/13] arch/resctrl: Start renaming the rdt files to more generic names

2018-11-19 Thread Borislav Petkov
On Mon, Nov 19, 2018 at 08:11:36PM +, Moger, Babu wrote: > Changed core.c and internel.h to res.c and res.h respectively. Both of > these files are about resource definitions and initialization. I guess but the core.c thing we do a lot in the kernel: $ git ls-files | grep -E "/core\.c" | wc -

Re: [PATCH v8 01/13] arch/resctrl: Start renaming the rdt files to more generic names

2018-11-19 Thread Moger, Babu
On 11/19/18 2:22 PM, Borislav Petkov wrote: > On Mon, Nov 19, 2018 at 08:11:36PM +, Moger, Babu wrote: >> Changed core.c and internel.h to res.c and res.h respectively. Both of >> these files are about resource definitions and initialization. > > I guess but the core.c thing we do a lot in t

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 01:11:56PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 02:46:32PM -0500, Jerome Glisse wrote: > > > > ?? How can O_DIRECT be fine but RDMA not? They use exactly the same > > > get_user_pages flow, right? Can we do what O_DIRECT does in RDMA and > > > be fine too

[PATCH] Documentation: hwmon: Add descriptions for ina2xx sysfs entries

2018-11-19 Thread Nicolin Chen
There are a few sysfs entries being exposed to user space by the ina2xx hwmon driver while not getting explicitly documented. So this patch just adds a description section for them. Signed-off-by: Nicolin Chen --- Documentation/hwmon/ina2xx | 15 +++ 1 file changed, 15 insertions(+)

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 03:26:15PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 01:11:56PM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 02:46:32PM -0500, Jerome Glisse wrote: > > > > > > ?? How can O_DIRECT be fine but RDMA not? They use exactly the same > > > > get_user_page

Re: [PATCH v9 00/24] ILP32 for ARM64

2018-11-19 Thread Yury Norov
Hi all, On Wed, May 16, 2018 at 11:18:45AM +0300, Yury Norov wrote: > This series enables AARCH64 with ILP32 mode. > > As supporting work, it introduces ARCH_32BIT_OFF_T configuration > option that is enabled for existing 32-bit architectures but disabled > for new arches (so 64-bit off_t userspa

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jerome Glisse
On Mon, Nov 19, 2018 at 02:26:38PM -0700, Jason Gunthorpe wrote: > On Mon, Nov 19, 2018 at 03:26:15PM -0500, Jerome Glisse wrote: > > On Mon, Nov 19, 2018 at 01:11:56PM -0700, Jason Gunthorpe wrote: > > > On Mon, Nov 19, 2018 at 02:46:32PM -0500, Jerome Glisse wrote: > > > > > > > > ?? How can O_D

Re: [RFCv3 PATCH 1/6] uacce: Add documents for WarpDrive/uacce

2018-11-19 Thread Jason Gunthorpe
On Mon, Nov 19, 2018 at 04:33:20PM -0500, Jerome Glisse wrote: > On Mon, Nov 19, 2018 at 02:26:38PM -0700, Jason Gunthorpe wrote: > > On Mon, Nov 19, 2018 at 03:26:15PM -0500, Jerome Glisse wrote: > > > On Mon, Nov 19, 2018 at 01:11:56PM -0700, Jason Gunthorpe wrote: > > > > On Mon, Nov 19, 2018 at

[RFC PATCH v6 24/26] mm/mmap: Add Shadow stack pages to memory accounting

2018-11-19 Thread Yu-cheng Yu
Add shadow stack pages to memory accounting. Signed-off-by: Yu-cheng Yu --- mm/mmap.c | 5 + 1 file changed, 5 insertions(+) diff --git a/mm/mmap.c b/mm/mmap.c index 30836512ca79..9560d69fa08c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1701,6 +1701,9 @@ static inline int accountable_mapping

[RFC PATCH v6 26/26] x86/cet/shstk: Add Shadow Stack instructions to opcode map

2018-11-19 Thread Yu-cheng Yu
Add the following shadow stack management instructions. INCSSP: Increment shadow stack pointer by the steps specified. RDSSP: Read SSP register into a GPR. SAVEPREVSSP: Use "prev ssp" token at top of current shadow stack to create a "restore token" on previous shadow stack. RSTO

  1   2   >