[PATCH] infiniband: nes: add unlikely() to assert()

2018-08-31 Thread Igor Stoppa
Typically the assert is expected to not fail. Signed-off-by: Igor Stoppa Acked-by: Doug Ledford Cc: Faisal Latif Cc: Chien Tung Cc: Roland Dreier Cc: Faisal Latif Cc: Jason Gunthorpe Cc: linux-r...@vger.kernel.org CC: linux-kernel@vger.kernel.org --- drivers/infiniband/hw/nes/nes.h | 2

[PATCH] infiniband: nes: add unlikely() to assert()

2018-08-31 Thread Igor Stoppa
Typically the assert is expected to not fail. Signed-off-by: Igor Stoppa Acked-by: Doug Ledford Cc: Faisal Latif Cc: Chien Tung Cc: Roland Dreier Cc: Faisal Latif Cc: Jason Gunthorpe Cc: linux-r...@vger.kernel.org CC: linux-kernel@vger.kernel.org --- drivers/infiniband/hw/nes/nes.h | 2

[PATCH 09/23] cpufreq: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: "Rafael J. Wysocki" Cc: Srivatsa S. Bhat --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/c

[PATCH 09/23] cpufreq: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: "Rafael J. Wysocki" Cc: Srivatsa S. Bhat --- drivers/cpufreq/cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/c

[PATCH 22/23] powerpc: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Arseny Solokha Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/mm/tlb_nohash.c | 2 +- arch/powerpc/sysdev/xive/common.c | 2 +- 2

[PATCH 23/23] scsi: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
BUG_ON() already contains an unlikely(), there is no need for another one. Signed-off-by: Igor Stoppa Cc: "Martin K. Petersen" Cc: "James E.J. Bottomley" --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_

[PATCH 16/23] lvm: device mapper: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Joe Thornber Cc: Alasdair Kergon --- drivers/md/dm-cache-policy-smq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-cache-policy-smq.c b

[PATCH 22/23] powerpc: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Arseny Solokha Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman --- arch/powerpc/mm/tlb_nohash.c | 2 +- arch/powerpc/sysdev/xive/common.c | 2 +- 2

[PATCH 23/23] scsi: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
BUG_ON() already contains an unlikely(), there is no need for another one. Signed-off-by: Igor Stoppa Cc: "Martin K. Petersen" Cc: "James E.J. Bottomley" --- drivers/scsi/scsi_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/scsi_

[PATCH 16/23] lvm: device mapper: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Joe Thornber Cc: Alasdair Kergon --- drivers/md/dm-cache-policy-smq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm-cache-policy-smq.c b

[PATCH 13/23] freescale: ethernet: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
Both WARN_ON() and WARN_ONCE() already contain an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net

[PATCH 18/23] infiniband: scsi: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers

[PATCH 13/23] freescale: ethernet: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
Both WARN_ON() and WARN_ONCE() already contain an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Madalin Bucur --- drivers/net/ethernet/freescale/dpaa/dpaa_eth.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/net

[PATCH 18/23] infiniband: scsi: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Bart Van Assche --- drivers/infiniband/ulp/srpt/ib_srpt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers

[PATCH 21/23] filesystems: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Alexander Viro --- fs/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/open.c b/fs/open.c index 0285ce7dbd51..19a9e4b378d3 100644 --- a/fs/open.c

[PATCH 21/23] filesystems: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Alexander Viro --- fs/open.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/open.c b/fs/open.c index 0285ce7dbd51..19a9e4b378d3 100644 --- a/fs/open.c

[PATCH 10/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON_ONCE() already contains an unlikely(), and the logical or of two of them is still unlikely(), so it's not necessary to wrap them into another. Signed-off-by: Igor Stoppa Cc: Christian Lamparter Cc: Kalle Valo --- drivers/net/wireless/ath/carl9170/tx.c | 4 ++-- 1 file changed, 2

[PATCH 10/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON_ONCE() already contains an unlikely(), and the logical or of two of them is still unlikely(), so it's not necessary to wrap them into another. Signed-off-by: Igor Stoppa Cc: Christian Lamparter Cc: Kalle Valo --- drivers/net/wireless/ath/carl9170/tx.c | 4 ++-- 1 file changed, 2

[PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: zijun_hu Cc: Tejun Heo Cc: Christoph Lameter Cc: Dennis Zhou --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c

[PATCH 01/23] infiniband: nes: add unlikely() to assert()

2018-08-30 Thread Igor Stoppa
Typically the assert is expected to not fail. Signed-off-by: Igor Stoppa Cc: Chien Tung Cc: Roland Dreier Cc: Faisal Latif Cc: Doug Ledford Cc: Jason Gunthorpe --- drivers/infiniband/hw/nes/nes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/nes

[PATCH 04/23] mips: bug: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
Add a hint to the compiler that probably it won't be necessary to BUG() Signed-off-by: Igor Stoppa Cc: David Daney Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan --- arch/mips/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/bug.h

[PATCH 02/23] ethernet: hnae: add unlikely() to assert()

2018-08-30 Thread Igor Stoppa
The assert() condition is likely to be true. Signed-off-by: Igor Stoppa Cc: huangdaode Cc: Yisen Zhuang Cc: Salil Mehta --- drivers/net/ethernet/hisilicon/hns/hnae.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net

[PATCH 11/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON_ONCE() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Kalle Valo Cc: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless

[PATCH 08/23] drm: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Rob Clark Cc: David Airlie Cc: Archit Taneja Cc: Stephane Viau --- drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp_format.c| 2 +- 2

[PATCH 19/23] pinctrl: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Andrew Jeffery Cc: Linus Walleij --- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/aspeed

[PATCH 03/23] asm-generic: bug: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
Add a hint to the compiler. If BUG_ON() is used instead of BUG(), it means that probably the preferred outcome is to not BUG(). Signed-off-by: Igor Stoppa Cc: Arnd Bergmann --- include/asm-generic/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic

[PATCH 05/23] selftest: vm: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
BUG_ON() is unlikely() to BUG() Signed-off-by: Igor Stoppa Cc: Dmitry Safonov Cc: Shuah Khan --- tools/testing/selftests/vm/map_populate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/map_populate.c b/tools/testing/selftests/vm/map_populate.c

[PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: zijun_hu Cc: Tejun Heo Cc: Christoph Lameter Cc: Dennis Zhou --- mm/percpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/percpu.c b/mm/percpu.c

[PATCH 01/23] infiniband: nes: add unlikely() to assert()

2018-08-30 Thread Igor Stoppa
Typically the assert is expected to not fail. Signed-off-by: Igor Stoppa Cc: Chien Tung Cc: Roland Dreier Cc: Faisal Latif Cc: Doug Ledford Cc: Jason Gunthorpe --- drivers/infiniband/hw/nes/nes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/nes

[PATCH 04/23] mips: bug: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
Add a hint to the compiler that probably it won't be necessary to BUG() Signed-off-by: Igor Stoppa Cc: David Daney Cc: Ralf Baechle Cc: Paul Burton Cc: James Hogan --- arch/mips/include/asm/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/include/asm/bug.h

[PATCH 02/23] ethernet: hnae: add unlikely() to assert()

2018-08-30 Thread Igor Stoppa
The assert() condition is likely to be true. Signed-off-by: Igor Stoppa Cc: huangdaode Cc: Yisen Zhuang Cc: Salil Mehta --- drivers/net/ethernet/hisilicon/hns/hnae.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hns/hnae.h b/drivers/net

[PATCH 11/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON_ONCE() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Kalle Valo Cc: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless

[PATCH 08/23] drm: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Rob Clark Cc: David Airlie Cc: Archit Taneja Cc: Stephane Viau --- drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c | 4 ++-- drivers/gpu/drm/msm/disp/mdp_format.c| 2 +- 2

[PATCH 19/23] pinctrl: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Andrew Jeffery Cc: Linus Walleij --- drivers/pinctrl/aspeed/pinctrl-aspeed.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/aspeed

[PATCH 03/23] asm-generic: bug: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
Add a hint to the compiler. If BUG_ON() is used instead of BUG(), it means that probably the preferred outcome is to not BUG(). Signed-off-by: Igor Stoppa Cc: Arnd Bergmann --- include/asm-generic/bug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/asm-generic

[PATCH 05/23] selftest: vm: add unlikely() to BUG_ON()

2018-08-30 Thread Igor Stoppa
BUG_ON() is unlikely() to BUG() Signed-off-by: Igor Stoppa Cc: Dmitry Safonov Cc: Shuah Khan --- tools/testing/selftests/vm/map_populate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/map_populate.c b/tools/testing/selftests/vm/map_populate.c

[PATCH 17/23] usb: octeon-hcd: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Aaro Koskinen Cc: Greg Kroah-Hartman --- drivers/staging/octeon-usb/octeon-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/octeon

[PATCH 17/23] usb: octeon-hcd: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Aaro Koskinen Cc: Greg Kroah-Hartman --- drivers/staging/octeon-usb/octeon-hcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/octeon

[PATCH 14/23] wimax: i2400m: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Inaky Perez-Gonzalez --- drivers/net/wimax/i2400m/tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax

[PATCH 15/23] lvm: device mapper: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Mike Snitzer Cc: Alasdair Kergon --- drivers/md/dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 20f7e4ef5342

[PATCH 07/23] seccomp: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Kees Cook --- kernel/seccomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index fd023ac24e10..5a2a9af4663e

[PATCH 06/23] virtio: add unlikely() to WARN_ON_ONCE()

2018-08-30 Thread Igor Stoppa
The condition to test is unlikely() to be true. Add the hint. Signed-off-by: Igor Stoppa Cc: "Michael S. Tsirkin" --- tools/virtio/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index fb

[PATCH 12/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Larry Finger Cc: Kalle Valo --- drivers/net/wireless/broadcom/b43/dma.c | 2 +- drivers/net/wireless/broadcom/b43legacy/dma.c | 2 +- 2 files changed, 2 insertions

[PATCH 14/23] wimax: i2400m: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Inaky Perez-Gonzalez --- drivers/net/wimax/i2400m/tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax

[PATCH 15/23] lvm: device mapper: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Mike Snitzer Cc: Alasdair Kergon --- drivers/md/dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 20f7e4ef5342

[PATCH 07/23] seccomp: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Kees Cook --- kernel/seccomp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/seccomp.c b/kernel/seccomp.c index fd023ac24e10..5a2a9af4663e

[PATCH 06/23] virtio: add unlikely() to WARN_ON_ONCE()

2018-08-30 Thread Igor Stoppa
The condition to test is unlikely() to be true. Add the hint. Signed-off-by: Igor Stoppa Cc: "Michael S. Tsirkin" --- tools/virtio/linux/kernel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index fb

[PATCH 12/23] wireless: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to wrap it into another. Signed-off-by: Igor Stoppa Cc: Larry Finger Cc: Kalle Valo --- drivers/net/wireless/broadcom/b43/dma.c | 2 +- drivers/net/wireless/broadcom/b43legacy/dma.c | 2 +- 2 files changed, 2 insertions

Re: [RFC: Coding Style] Best way to split a long function declaration with modifiers

2018-05-12 Thread Igor Stoppa
On 12/05/18 18:41, Joe Perches wrote: I personally like more the former, not to mention that it uses also one line less, but it seems less common in the sources. The coding style references do not seem to say anything explicit about which style to prefer. thank you, I could provide a patch to

Re: [RFC: Coding Style] Best way to split a long function declaration with modifiers

2018-05-12 Thread Igor Stoppa
On 12/05/18 18:41, Joe Perches wrote: I personally like more the former, not to mention that it uses also one line less, but it seems less common in the sources. The coding style references do not seem to say anything explicit about which style to prefer. thank you, I could provide a patch to

[RFC: Coding Style] Best way to split a long function declaration with modifiers

2018-05-12 Thread Igor Stoppa
Hi, I have been wondering if it's ok to break a long (function declaration) line in the following way: static __always_inline struct foo_bar *__get_foo_bar(type1 parm1, type2 parm2, type3 parm3) instead of: static __always_inline struct foo_bar *__get_foo_bar(type1 parm1,

[RFC: Coding Style] Best way to split a long function declaration with modifiers

2018-05-12 Thread Igor Stoppa
Hi, I have been wondering if it's ok to break a long (function declaration) line in the following way: static __always_inline struct foo_bar *__get_foo_bar(type1 parm1, type2 parm2, type3 parm3) instead of: static __always_inline struct foo_bar *__get_foo_bar(type1 parm1,

Re: Correct way to access the physmap? - Was: Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-05-03 Thread Igor Stoppa
On 04/05/18 01:55, Dave Hansen wrote: On 05/03/2018 02:52 PM, Igor Stoppa wrote: At the end of the summit, we agreed that I would go through the physmap. Do you mean the kernel linear map? Apparently I did mean it. It was confusing, because I couldn't find a single place stating

Re: Correct way to access the physmap? - Was: Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-05-03 Thread Igor Stoppa
On 04/05/18 01:55, Dave Hansen wrote: On 05/03/2018 02:52 PM, Igor Stoppa wrote: At the end of the summit, we agreed that I would go through the physmap. Do you mean the kernel linear map? Apparently I did mean it. It was confusing, because I couldn't find a single place stating

Correct way to access the physmap? - Was: Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-05-03 Thread Igor Stoppa
On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks to support a separate class of data

Correct way to access the physmap? - Was: Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-05-03 Thread Igor Stoppa
On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks to support a separate class of data

Re: [PATCH 0/3 v2] linux-next: mm: Track genalloc allocations

2018-05-02 Thread Igor Stoppa
On 03/05/18 01:50, Andrew Morton wrote: On Wed, 2 May 2018 05:05:19 +0400 Igor Stoppa <igor.sto...@gmail.com> wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens the memory management for the generic allocator ge

Re: [PATCH 0/3 v2] linux-next: mm: Track genalloc allocations

2018-05-02 Thread Igor Stoppa
On 03/05/18 01:50, Andrew Morton wrote: On Wed, 2 May 2018 05:05:19 +0400 Igor Stoppa wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens the memory management for the generic allocator genalloc. Genalloc does not currently

[PATCH 2/3] Add label and license to genalloc.rst

2018-05-01 Thread Igor Stoppa
Add SPDX license to genalloc.rst, then a label, to allow cross-referencing. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- Documentation/core-api/genalloc.rst | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/core-api/genalloc.rst b/Documentation/co

[PATCH 2/3] Add label and license to genalloc.rst

2018-05-01 Thread Igor Stoppa
Add SPDX license to genalloc.rst, then a label, to allow cross-referencing. Signed-off-by: Igor Stoppa --- Documentation/core-api/genalloc.rst | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/core-api/genalloc.rst b/Documentation/core-api/genalloc.rst index 6b38a39fab24

[PATCH 1/3] genalloc: track beginning of allocations

2018-05-01 Thread Igor Stoppa
Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- include/linux/genalloc.h | 112 +++ lib/genalloc.c | 742 ++- 2 files changed, 599 insertions(+), 255 deletions(-) diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h

[PATCH 1/3] genalloc: track beginning of allocations

2018-05-01 Thread Igor Stoppa
Signed-off-by: Igor Stoppa --- include/linux/genalloc.h | 112 +++ lib/genalloc.c | 742 ++- 2 files changed, 599 insertions(+), 255 deletions(-) diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 872f930f1b06..ff72295

[PATCH 3/3] genalloc: selftest

2018-05-01 Thread Igor Stoppa
troubleshooting a crash, it is recommended to compile the tests into the monolithic kernel. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- lib/Kconfig.debug | 23 +++ lib/Makefile| 1 + lib/test_genalloc.c | 419 3 files c

[PATCH 3/3] genalloc: selftest

2018-05-01 Thread Igor Stoppa
troubleshooting a crash, it is recommended to compile the tests into the monolithic kernel. Signed-off-by: Igor Stoppa --- lib/Kconfig.debug | 23 +++ lib/Makefile| 1 + lib/test_genalloc.c | 419 3 files changed, 443 insertions(+) create

[PATCH 0/3 v2] linux-next: mm: Track genalloc allocations

2018-05-01 Thread Igor Stoppa
enwall.com/lists/kernel-hardening/2018/04/29/1] * make the tester code a kernel module * turn selftest BUG() error exit paths into WARN() * add analysis of impact on current users of genalloc Igor Stoppa (3): genalloc: track beginning of allocations Add label and license to genalloc.rst

[PATCH 0/3 v2] linux-next: mm: Track genalloc allocations

2018-05-01 Thread Igor Stoppa
enwall.com/lists/kernel-hardening/2018/04/29/1] * make the tester code a kernel module * turn selftest BUG() error exit paths into WARN() * add analysis of impact on current users of genalloc Igor Stoppa (3): genalloc: track beginning of allocations Add label and license to genalloc.rst

Re: [PATCH 0/2] mm: tweaks for improving use of vmap_area

2018-05-01 Thread Igor Stoppa
On 01/05/18 03:15, Andrew Morton wrote: On Fri, 27 Apr 2018 03:42:41 +0400 Igor Stoppa <igor.sto...@gmail.com> wrote: These two patches were written in preparation for the creation of protectable memory, however their use is not limited to pmalloc and can improve the use of vir

Re: [PATCH 0/2] mm: tweaks for improving use of vmap_area

2018-05-01 Thread Igor Stoppa
On 01/05/18 03:15, Andrew Morton wrote: On Fri, 27 Apr 2018 03:42:41 +0400 Igor Stoppa wrote: These two patches were written in preparation for the creation of protectable memory, however their use is not limited to pmalloc and can improve the use of virtually contiguous memory. The first

Re: [PATCH 3/3] genalloc: selftest

2018-04-29 Thread Igor Stoppa
On 29/04/18 07:36, Randy Dunlap wrote: On 04/28/2018 07:45 PM, Igor Stoppa wrote: [...] + test_genalloc(); Is there a stub for test_genalloc() when its config option is not enabled? I don't see it. I failed to add to the patch include/linux/test_genalloc.h :-/ That's where the stub

Re: [PATCH 3/3] genalloc: selftest

2018-04-29 Thread Igor Stoppa
On 29/04/18 07:36, Randy Dunlap wrote: On 04/28/2018 07:45 PM, Igor Stoppa wrote: [...] + test_genalloc(); Is there a stub for test_genalloc() when its config option is not enabled? I don't see it. I failed to add to the patch include/linux/test_genalloc.h :-/ That's where the stub

Re: [PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-29 Thread Igor Stoppa
oops, sorry, I forgot the references :-( On 29/04/18 20:39, Igor Stoppa wrote: On 29/04/18 07:09, Matthew Wilcox wrote: On Sun, Apr 29, 2018 at 06:45:39AM +0400, Igor Stoppa wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens

Re: [PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-29 Thread Igor Stoppa
oops, sorry, I forgot the references :-( On 29/04/18 20:39, Igor Stoppa wrote: On 29/04/18 07:09, Matthew Wilcox wrote: On Sun, Apr 29, 2018 at 06:45:39AM +0400, Igor Stoppa wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens

Re: [PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-29 Thread Igor Stoppa
On 29/04/18 07:09, Matthew Wilcox wrote: On Sun, Apr 29, 2018 at 06:45:39AM +0400, Igor Stoppa wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens the memory management for the generic allocator genalloc. Genalloc does

Re: [PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-29 Thread Igor Stoppa
On 29/04/18 07:09, Matthew Wilcox wrote: On Sun, Apr 29, 2018 at 06:45:39AM +0400, Igor Stoppa wrote: This patchset was created as part of an older version of pmalloc, however it has value per-se, as it hardens the memory management for the generic allocator genalloc. Genalloc does

[PATCH 3/3] genalloc: selftest

2018-04-28 Thread Igor Stoppa
it as module. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- init/main.c | 2 + lib/Kconfig | 15 ++ lib/Makefile| 1 + lib/test_genalloc.c | 410 4 files changed, 428 insertions(+) create mode 1006

[PATCH 3/3] genalloc: selftest

2018-04-28 Thread Igor Stoppa
it as module. Signed-off-by: Igor Stoppa --- init/main.c | 2 + lib/Kconfig | 15 ++ lib/Makefile| 1 + lib/test_genalloc.c | 410 4 files changed, 428 insertions(+) create mode 100644 lib/test_genalloc.c diff --git

[PATCH 2/3] Add label and license to genalloc.rst

2018-04-28 Thread Igor Stoppa
Add SPDX license to genalloc.rst, then a label, to allow cross-referencing. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- Documentation/core-api/genalloc.rst | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/core-api/genalloc.rst b/Documentation/co

[PATCH 1/3] genalloc: track beginning of allocations

2018-04-28 Thread Igor Stoppa
that the patch works correctly. Eventually, the extra parameter (and the corresponding verification) could be dropped, in favor of a simplified API. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- include/linux/genalloc.h | 112 +++ lib/genalloc.c

[PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-28 Thread Igor Stoppa
the callers of the free function with the internal tracking. Later on, the "size" parameter can be dropped, and each caller can be adjusted accordingly. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> Igor Stoppa (3): genalloc: track beginning of allocations Add l

[PATCH 2/3] Add label and license to genalloc.rst

2018-04-28 Thread Igor Stoppa
Add SPDX license to genalloc.rst, then a label, to allow cross-referencing. Signed-off-by: Igor Stoppa --- Documentation/core-api/genalloc.rst | 4 1 file changed, 4 insertions(+) diff --git a/Documentation/core-api/genalloc.rst b/Documentation/core-api/genalloc.rst index 6b38a39fab24

[PATCH 1/3] genalloc: track beginning of allocations

2018-04-28 Thread Igor Stoppa
that the patch works correctly. Eventually, the extra parameter (and the corresponding verification) could be dropped, in favor of a simplified API. Signed-off-by: Igor Stoppa --- include/linux/genalloc.h | 112 +++ lib/genalloc.c | 742 ++- 2

[PATCH 0/3] linux-next: mm: hardening: Track genalloc allocations

2018-04-28 Thread Igor Stoppa
the callers of the free function with the internal tracking. Later on, the "size" parameter can be dropped, and each caller can be adjusted accordingly. Signed-off-by: Igor Stoppa Igor Stoppa (3): genalloc: track beginning of allocations Add label and license to genalloc.rst

[PATCH 1/2] struct page: add field for vm_struct

2018-04-26 Thread Igor Stoppa
arent area. This will avoid more expensive searches, later on. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> Reviewed-by: Jay Freyensee <why2jjj.li...@gmail.com> Reviewed-by: Matthew Wilcox <mawil...@microsoft.com> --- include/linux/mm_types.h | 1 + mm/vmalloc.c

[PATCH 1/2] struct page: add field for vm_struct

2018-04-26 Thread Igor Stoppa
arent area. This will avoid more expensive searches, later on. Signed-off-by: Igor Stoppa Reviewed-by: Jay Freyensee Reviewed-by: Matthew Wilcox --- include/linux/mm_types.h | 1 + mm/vmalloc.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/linux/mm_types.h b/inc

[PATCH 2/2] vmalloc: rename llist field in vmap_area

2018-04-26 Thread Igor Stoppa
tilization outside of the purging phase. Since the purging happens after the vmap_area is dismissed, its use is mutually exclusive with any use performed while the area is allocated. Signed-off-by: Igor Stoppa <igor.sto...@huawei.com> --- include/linux/vmalloc.h | 2 +- mm/vmalloc.c

[PATCH 2/2] vmalloc: rename llist field in vmap_area

2018-04-26 Thread Igor Stoppa
tilization outside of the purging phase. Since the purging happens after the vmap_area is dismissed, its use is mutually exclusive with any use performed while the area is allocated. Signed-off-by: Igor Stoppa --- include/linux/vmalloc.h | 2 +- mm/vmalloc.c| 6 +++--- 2 files changed, 4

[PATCH 0/2] mm: tweaks for improving use of vmap_area

2018-04-26 Thread Igor Stoppa
/Igor-security/linux/tree/preparations-for-mm Igor Stoppa (2): struct page: add field for vm_struct vmalloc: rename llist field in vmap_area include/linux/mm_types.h | 1 + include/linux/vmalloc.h | 2 +- mm/vmalloc.c | 8 +--- 3 files changed, 7 insertions(+), 4 deletions

[PATCH 0/2] mm: tweaks for improving use of vmap_area

2018-04-26 Thread Igor Stoppa
/Igor-security/linux/tree/preparations-for-mm Igor Stoppa (2): struct page: add field for vm_struct vmalloc: rename llist field in vmap_area include/linux/mm_types.h | 1 + include/linux/vmalloc.h | 2 +- mm/vmalloc.c | 8 +--- 3 files changed, 7 insertions(+), 4 deletions

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-25 Thread Igor Stoppa
On 24/04/18 18:44, Matthew Wilcox wrote: On Tue, Apr 24, 2018 at 02:32:36PM +0200, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d and destroy the old pool. With the

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-25 Thread Igor Stoppa
On 24/04/18 18:44, Matthew Wilcox wrote: On Tue, Apr 24, 2018 at 02:32:36PM +0200, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d and destroy the old pool. With the

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:33, Igor Stoppa wrote: On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:33, Igor Stoppa wrote: On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 19:03, lazytyped wrote: On 4/24/18 4:44 PM, Matthew Wilcox wrote: On Tue, Apr 24, 2018 at 02:32:36PM +0200, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 19:03, lazytyped wrote: On 4/24/18 4:44 PM, Matthew Wilcox wrote: On Tue, Apr 24, 2018 at 02:32:36PM +0200, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d

Re: [PATCH 9/9] Protect SELinux initialized state with pmalloc

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:49, Stephen Smalley wrote: On 04/23/2018 08:54 AM, Igor Stoppa wrote: [...] The patch is probably in need of rework, to make it fit better with the new SELinux internal data structures, however it shows how to deny an easy target to the attacker. I know this is just

Re: [PATCH 9/9] Protect SELinux initialized state with pmalloc

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:49, Stephen Smalley wrote: On 04/23/2018 08:54 AM, Igor Stoppa wrote: [...] The patch is probably in need of rework, to make it fit better with the new SELinux internal data structures, however it shows how to deny an easy target to the attacker. I know this is just

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:32, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d and destroy the old pool. With the above, you have just shifted the target of the arbitrary write

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 16:32, lazytyped wrote: On 4/24/18 1:50 PM, Matthew Wilcox wrote: struct modifiable_data { struct immutable_data *d; ... }; Then allocate a new pool, change d and destroy the old pool. With the above, you have just shifted the target of the arbitrary write

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks to support a separate class of data

Re: [PATCH 7/9] Pmalloc Rare Write: modify selected pools

2018-04-24 Thread Igor Stoppa
On 24/04/18 15:50, Matthew Wilcox wrote: On Mon, Apr 23, 2018 at 04:54:56PM +0400, Igor Stoppa wrote: While the vanilla version of pmalloc provides support for permanently transitioning between writable and read-only of a memory pool, this patch seeks to support a separate class of data

<    1   2   3   4   5   6   7   8   9   >