~krzk/ubuntu/+source/linux:focal/wip/aws-debug-list-slub

Last commit made on 2021-05-12
Get this branch:
git clone -b focal/wip/aws-debug-list-slub https://git.launchpad.net/~krzk/ubuntu/+source/linux
Only Krzysztof Kozlowski can upload to this branch. If you are Krzysztof Kozlowski please log in for upload directions.

Branch merges

Branch information

Name:
focal/wip/aws-debug-list-slub
Repository:
lp:~krzk/ubuntu/+source/linux

Recent commits

c4331ff... by Heiko Carstens <email address hidden>

PM: remove s390 specific callbacks

ARCH_SAVE_PAGE_KEYS has been introduced in order to be able to save
and restore s390 specific storage keys into a hibernation image.
With hibernation support removed from s390 there is no point in
keeping the callbacks.

Acked-by: Christian Borntraeger <email address hidden>
Acked-by: Peter Oberparleiter <email address hidden>
Signed-off-by: Heiko Carstens <email address hidden>
Signed-off-by: Vasily Gorbik <email address hidden>
(cherry picked from commit 086b2d78375cffe58f5341359bebec0650793811)
Signed-off-by: Krzysztof Kozlowski <email address hidden>

717d3ca... by Krzysztof Kozlowski

enable poison

784fab4... by Vlastimil Babka <email address hidden>

kernel/power: allow hibernation with page_poison sanity checking

Page poisoning used to be incompatible with hibernation, as the state of
poisoned pages was lost after resume, thus enabling CONFIG_HIBERNATION
forces CONFIG_PAGE_POISONING_NO_SANITY. For the same reason, the
poisoning with zeroes variant CONFIG_PAGE_POISONING_ZERO used to disable
hibernation. The latter restriction was removed by commit 1ad1410f632d
("PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO") and
similarly for init_on_free by commit 18451f9f9e58 ("PM: hibernate: fix
crashes with init_on_free=1") by making sure free pages are cleared after
resume.

We can use the same mechanism to instead poison free pages with
PAGE_POISON after resume. This covers both zero and 0xAA patterns. Thus
we can remove the Kconfig restriction that disables page poison sanity
checking when hibernation is enabled.

Link: https://<email address hidden>
Signed-off-by: Vlastimil Babka <email address hidden>
Acked-by: Rafael J. Wysocki <email address hidden> [hibernation]
Reviewed-by: David Hildenbrand <email address hidden>
Cc: Mike Rapoport <email address hidden>
Cc: Alexander Potapenko <email address hidden>
Cc: Kees Cook <email address hidden>
Cc: Laura Abbott <email address hidden>
Cc: Mateusz Nosek <email address hidden>
Cc: Michal Hocko <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(backported from commit 03b6c9a3e8805606c0bb4ad41855fac3bf85c3b9)
[krzysztof: minor context adjustment in mm/Kconfig.debug]
Signed-off-by: Krzysztof Kozlowski <email address hidden>

64dffc2... by Vlastimil Babka <email address hidden>

mm, page_poison: use static key more efficiently

Commit 11c9c7edae06 ("mm/page_poison.c: replace bool variable with static
key") changed page_poisoning_enabled() to a static key check. However,
the function is not inlined, so each check still involves a function call
with overhead not eliminated when page poisoning is disabled.

Analogically to how debug_pagealloc is handled, this patch converts
page_poisoning_enabled() back to boolean check, and introduces
page_poisoning_enabled_static() for fast paths. Both functions are
inlined.

The function kernel_poison_pages() is also called unconditionally and does
the static key check inside. Remove it from there and put it to callers.
Also split it to two functions kernel_poison_pages() and
kernel_unpoison_pages() instead of the confusing bool parameter.

Also optimize the check that enables page poisoning instead of
debug_pagealloc for architectures without proper debug_pagealloc support.
Move the check to init_mem_debugging_and_hardening() to enable a single
static key instead of having two static branches in
page_poisoning_enabled_static().

Link: https://<email address hidden>
Signed-off-by: Vlastimil Babka <email address hidden>
Reviewed-by: David Hildenbrand <email address hidden>
Cc: Mike Rapoport <email address hidden>
Cc: Rafael J. Wysocki <email address hidden>
Cc: Alexander Potapenko <email address hidden>
Cc: Kees Cook <email address hidden>
Cc: Laura Abbott <email address hidden>
Cc: Mateusz Nosek <email address hidden>
Cc: Michal Hocko <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(backported from commit 8db26a3d47354ce7271a8cab03cd65b9d3d610b9)
[krzysztof: major context change in drivers/virtio/virtio_balloon.c
 in virtballoon_validate() due to missing commits, e.g. missing
 commit d74b78fabe04 ("virtio-balloon: pull page poisoning config out of
 free page hinting")]
Signed-off-by: Krzysztof Kozlowski <email address hidden>

cff2d14... by Vlastimil Babka <email address hidden>

mm, page_alloc: do not rely on the order of page_poison and init_on_alloc/free parameters

Patch series "cleanup page poisoning", v3.

I have identified a number of issues and opportunities for cleanup with
CONFIG_PAGE_POISON and friends:

 - interaction with init_on_alloc and init_on_free parameters depends on
   the order of parameters (Patch 1)

 - the boot time enabling uses static key, but inefficienty (Patch 2)

 - sanity checking is incompatible with hibernation (Patch 3)

 - CONFIG_PAGE_POISONING_NO_SANITY can be removed now that we have
   init_on_free (Patch 4)

 - CONFIG_PAGE_POISONING_ZERO can be most likely removed now that we
   have init_on_free (Patch 5)

This patch (of 5):

Enabling page_poison=1 together with init_on_alloc=1 or init_on_free=1
produces a warning in dmesg that page_poison takes precedence. However,
as these warnings are printed in early_param handlers for
init_on_alloc/free, they are not printed if page_poison is enabled later
on the command line (handlers are called in the order of their
parameters), or when init_on_alloc/free is always enabled by the
respective config option - before the page_poison early param handler is
called, it is not considered to be enabled. This is inconsistent.

We can remove the dependency on order by making the init_on_* parameters
only set a boolean variable, and postponing the evaluation after all early
params have been processed. Introduce a new
init_mem_debugging_and_hardening() function for that, and move the related
debug_pagealloc processing there as well.

As a result init_mem_debugging_and_hardening() knows always accurately if
init_on_* and/or page_poison options were enabled. Thus we can also
optimize want_init_on_alloc() and want_init_on_free(). We don't need to
check page_poisoning_enabled() there, we can instead not enable the
init_on_* static keys at all, if page poisoning is enabled. This results
in a simpler and more effective code.

Link: https://<email address hidden>
Link: https://<email address hidden>
Signed-off-by: Vlastimil Babka <email address hidden>
Reviewed-by: David Hildenbrand <email address hidden>
Reviewed-by: Mike Rapoport <email address hidden>
Cc: Rafael J. Wysocki <email address hidden>
Cc: Alexander Potapenko <email address hidden>
Cc: Kees Cook <email address hidden>
Cc: Michal Hocko <email address hidden>
Cc: Mateusz Nosek <email address hidden>
Cc: Laura Abbott <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(backported from commit 04013513cc84c401c7de9023ff3eda7863fc4add)
[krzysztof: context adjustment in mm/page_alloc.c]
Signed-off-by: Krzysztof Kozlowski <email address hidden>

6614a72... by Mateusz Nosek <email address hidden>

mm/page_alloc.c: fix early params garbage value accesses

Previously in '__init early_init_on_alloc' and '__init early_init_on_free'
the return values from 'kstrtobool' were not handled properly. That
caused potential garbage value read from variable 'bool_result'.
Introduced patch fixes error handling.

Signed-off-by: Mateusz Nosek <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Reviewed-by: Andrew Morton <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(cherry picked from commit fdd4fa1cd90441fd1d393e49c21c00ed73ef929c)
Signed-off-by: Krzysztof Kozlowski <email address hidden>

5a062d9... by Mateusz Nosek <email address hidden>

mm/page_poison.c: replace bool variable with static key

Variable 'want_page_poisoning' is a switch deciding if page poisoning
should be enabled. This patch changes it to be static key.

Signed-off-by: Mateusz Nosek <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Cc: Naoya Horiguchi <email address hidden>
Cc: Oscar Salvador <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(cherry picked from commit 11c9c7edae06da789abfdeefe5123162a3f1c7dc)
Signed-off-by: Krzysztof Kozlowski <email address hidden>

3cfaba5... by Krzysztof Kozlowski

Revert "kernel/power: allow hibernation with page_poison sanity checking"

This reverts commit 4f3908c508c4c2f5415ea593f1aad77832a3988d.

4f3908c... by Vlastimil Babka <email address hidden>

kernel/power: allow hibernation with page_poison sanity checking

Page poisoning used to be incompatible with hibernation, as the state of
poisoned pages was lost after resume, thus enabling CONFIG_HIBERNATION
forces CONFIG_PAGE_POISONING_NO_SANITY. For the same reason, the
poisoning with zeroes variant CONFIG_PAGE_POISONING_ZERO used to disable
hibernation. The latter restriction was removed by commit 1ad1410f632d
("PM / Hibernate: allow hibernation with PAGE_POISONING_ZERO") and
similarly for init_on_free by commit 18451f9f9e58 ("PM: hibernate: fix
crashes with init_on_free=1") by making sure free pages are cleared after
resume.

We can use the same mechanism to instead poison free pages with
PAGE_POISON after resume. This covers both zero and 0xAA patterns. Thus
we can remove the Kconfig restriction that disables page poison sanity
checking when hibernation is enabled.

Link: https://<email address hidden>
Signed-off-by: Vlastimil Babka <email address hidden>
Acked-by: Rafael J. Wysocki <email address hidden> [hibernation]
Reviewed-by: David Hildenbrand <email address hidden>
Cc: Mike Rapoport <email address hidden>
Cc: Alexander Potapenko <email address hidden>
Cc: Kees Cook <email address hidden>
Cc: Laura Abbott <email address hidden>
Cc: Mateusz Nosek <email address hidden>
Cc: Michal Hocko <email address hidden>
Signed-off-by: Andrew Morton <email address hidden>
Signed-off-by: Linus Torvalds <email address hidden>
(backported from commit 03b6c9a3e8805606c0bb4ad41855fac3bf85c3b9)
[krzysztof: context adjust in include/linux/mm.h]
Signed-off-by: Krzysztof Kozlowski <email address hidden>

5f5be4e... by Krzysztof Kozlowski

Revert "Enable SLUB_RESILIENCY_TEST"

This reverts commit 9913e9909cdd70c6f4d9ebb198d739a9d9224463.