Re: [PATCH v1 3/3] ARM: dts: Add node for Broadcom OTP controller driver

2016-11-16 Thread Florian Fainelli
On 10/24/2016 12:12 PM, Jonathan Richardson wrote: > From: Jonathan Richardson > > Reviewed-by: Ray Jui > Tested-by: Jonathan Richardson > Signed-off-by: Scott Branden > Signed-off-by: Oza Pawandeep > Signed-off-by: Jonathan Richardson Applied, thanks -- Florian

Re: [PATCH 1/1] ARM: dts: enable GPIO-b for Broadcom NSP

2016-11-16 Thread Florian Fainelli
On 11/14/2016 05:30 AM, Yendapally Reddy Dhananjaya Reddy wrote: > This enables the GPIO-b support for Broadcom NSP SoC > > Signed-off-by: Yendapally Reddy Dhananjaya Reddy > Applied, thanks -- Florian

Re: [PATCH] mtd: nand: nandsim: fix error check

2016-11-16 Thread Sudip Mukherjee
On Wednesday 16 November 2016 04:56 PM, Marek Vasut wrote: On 11/16/2016 08:52 AM, Sudip Mukherjee wrote: On Tuesday 15 November 2016 11:42 PM, Marek Vasut wrote: On 11/16/2016 12:09 AM, Sudip Mukherjee wrote: debugfs_create_dir() and debugfs_create_file() returns NULL on error or a pointer on

Re: [PATCH] Support for perf on AMD family17h processors

2016-11-16 Thread Natarajan, Janakarajan
On 11/16/2016 11:30 AM, Peter Zijlstra wrote: On Wed, Nov 16, 2016 at 11:01:53AM -0600, Janakarajan Natarajan wrote: This patch enables perf core PMU support for AMD family17h processors. In family17h, there is no PMC-event constraint. All events, irrespective of the type, can be measured using

Re: Regression: Failed boots bisected to 4cd13c21b207 "softirq: Let ksoftirqd do its job"

2016-11-16 Thread Brian Starkey
On Wed, Nov 16, 2016 at 10:49:06AM -0800, Eric Dumazet wrote: On Wed, Nov 16, 2016 at 10:01 AM, Brian Starkey wrote: The smc91x driver does seem to have some trickiness around softirqs. I'm not familiar with net drivers, but I'll see if I can figure anything out there. Oh this code looks ug

Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits

2016-11-16 Thread Chris Metcalf
On 11/16/2016 1:04 PM, John Stultz wrote: On Wed, Nov 16, 2016 at 8:57 AM, Chris Metcalf wrote: include/linux/clocksource.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 08398182f56e..b2a022acf232 100644 --

Re: [PATCH v6 0/3] x86/kvm: Support AVX512_4VNNIW and AVX512_4FMAPS for KVM guest

2016-11-16 Thread Radim Krčmář
2016-11-16 11:16+0100, Thomas Gleixner: > On Fri, 11 Nov 2016, He Chen wrote: > >> This patch series is going to add two new AVX512 features to KVM guest. >> Since these two features are defined as scattered features in kernel, >> some extra modification in kernel is included. > > I merged the fi

Re: [PATCH v2] Add a "nosymlinks" mount option.

2016-11-16 Thread Mattias Nissler
I understand that silence suggests there's little interest, but here's some new information I discovered today that may justify to reconsider the patch: The BSDs already have exactly what I propose, the mount option is called "nosymfollow" there: https://github.com/freebsd/freebsd/blob/a41f4cc9a57

[PATCH v2] time: Avoid signed overflow in timekeeping_delta_to_ns()

2016-11-16 Thread Chris Metcalf
This bug was originally fixed in commit 35a4933a8959 ("time: Avoid signed overflow in timekeeping_get_ns()"). When the code was refactored in commit 6bd58f09e1d8 ("time: Add cycles to nanoseconds translation") the signed overflow fix was lost. Re-introduce it in a less subtle way by changing the

[PATCH v2 0/2] kcov: add AFL-style tracing

2016-11-16 Thread Quentin Casasnovas
Hi Dmitry, Sorry it took so long to implement the small suggestions you had, we've been very busy with other projects (or at least that's our excuse!). The changes to afl.git in order to use kcov were sent to Michal so hopefully people can start fuzzing their kernel with AFL without cherry-pickin

[PATCH 2/2] kcov: add AFL-style tracing

2016-11-16 Thread Quentin Casasnovas
AFL uses a fixed-size buffer (typically 64 KiB) where each byte is a counter representing how many times an A -> B branch was taken. Of course, since the buffer is fixed size, it's a little imprecise in that e.g. two different branches could map to the same counter, but in practice it works well.

Re: [Patch v6.1] x86/kvm: Add AVX512_4VNNIW and AVX512_4FMAPS support

2016-11-16 Thread Radim Krčmář
2016-11-14 16:45+0800, He Chen: > From 2daa60b3c6ab5aa6414ebb33119a34403dad2048 Mon Sep 17 00:00:00 2001 > From: Luwei Kang > Date: Mon, 7 Nov 2016 14:03:20 +0800 > Subject: [Patch v6.1] x86/kvm: Add AVX512_4VNNIW and AVX512_4FMAPS support > > Add two new AVX512 subfeatures support for KVM guest.

[PATCH 1/2] kcov: size of arena is now given in bytes.

2016-11-16 Thread Quentin Casasnovas
We'll introduce a different mode of tracing a-la AFL fixed table and Dmitry suggests that the code would be simpler with the size expressed in bytes as opposed unsigned longs. We only change the kcov::size field, which will be shared between different modes, but leave the task_struct::kcov_size fi

[GIT PULL] drm-vc4-next-2016-11-16

2016-11-16 Thread Eric Anholt
Linux 4.9-rc1 (2016-10-15 12:17:50 -0700) are available in the git repository at: https://github.com/anholt/linux tags/drm-vc4-next-2016-11-16 for you to fetch changes up to c778cc5df944291dcdb1ca7a6bb781fbc22550c5: drm/vc4: Add fragment shader threading support (2016-11-16 13:25:26 -0800

Re: [PATCH] rtl8xxxu: Fix for agressive power saving by rtl8723bu wireless IC

2016-11-16 Thread Jes Sorensen
John Heenan writes: > Barry Day has submitted real world reports for the 8192eu and 8192cu. > This needs to be acknowledged. I have submitted real world reports for > the 8723bu. Lets get this a little more clear - first of all, I have asked you to investigate which part resolves the problem. Rat

Re: [PATCH] clocksource_cyc2ns: avoid overflowing 64 bits

2016-11-16 Thread Chris Metcalf
On 11/16/2016 2:45 PM, John Stultz wrote: On Wed, Nov 16, 2016 at 11:30 AM, Chris Metcalf wrote: diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 08398182f56e..529884b8 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -171,6 +171,10 @

Re: [GIT PULL] Re: [PATCH] drm: tda998x: mali-dp: hdlcd: refactor connector registration

2016-11-16 Thread Russell King - ARM Linux
Okay, I've queued this into my own for-next branch, along with the now reviewed and tested set of tda998x patches that I sent out for comment and testing. I'm still hopeful that Dave's going to pull the initial patch at some point... please? On Tue, Nov 15, 2016 at 09:46:31AM +, Russell King

Re: [PATCH v4.1 2/2] console: Add persistent scrollback buffers for all VGA consoles

2016-11-16 Thread kbuild test robot
Hi Manuel, [auto build test ERROR on linus/master] [also build test ERROR on v4.9-rc5 next-20161116] [cannot apply to v4.1] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Manuel-Sch-lling

GHES platform devices

2016-11-16 Thread Bjorn Helgaas
Hi Huang, 7ad6e9435596 ("ACPI, APEI, Manage GHES as platform devices") added platform devices so the GHES driver could be built as a module and automatically loaded when needed. Later, 86cd47334b00 ("ACPI, APEI, GHES, Prevent GHES to be built as module") removed the ability to build GHES as a mod

[PATCH] drm/nouveau: Don't enabling polling twice on runtime resume

2016-11-16 Thread Lyude
As it turns out, on cards that actually have CRTCs on them we're already calling drm_kms_helper_poll_enable(drm_dev) from nouveau_display_resume() before we call it in nouveau_pmops_runtime_resume(). This leads us to accidentally trying to enable polling twice, which results in a potential deadlock

[PATCH] vgaarb: Use dev_printk() when possible

2016-11-16 Thread Bjorn Helgaas
For consistency with other device-related messages, use dev_printk() when possible instead of pr_*() and pci_name(). This changes messages like this: vgaarb: setting as boot device: PCI::01:00.0 vgaarb: device added: PCI::01:00.0,decodes=io+mem,owns=io+mem,locks=none vgaarb: bridge

[PATCH 00/16] Kernel lockdown

2016-11-16 Thread David Howells
These patches provide a facility by which a variety of avenues by which userspace can feasibly modify the running kernel image can be locked down. These include: (*) No unsigned modules and no modules for which can't validate the signature. (*) No use of ioperm(), iopl() and no writing to

[PATCH 05/16] efi: Add EFI_SECURE_BOOT bit

2016-11-16 Thread David Howells
From: Josh Boyer UEFI machines can be booted in Secure Boot mode. Add a EFI_SECURE_BOOT bit for use with efi_enabled. Signed-off-by: Josh Boyer Signed-off-by: David Howells --- arch/x86/kernel/setup.c |1 + include/linux/efi.h |1 + 2 files changed, 2 insertions(+) diff --git a

[PATCH 01/16] Add the ability to lock down access to the running kernel image

2016-11-16 Thread David Howells
Provide a single call to allow kernel code to determine whether the system should be locked down, thereby disallowing various accesses that might allow the running kernel image to be changed including the loading of modules that aren't validly signed with a key we recognise, fiddling with MSR regis

[PATCH 02/16] efi: Get the secure boot status

2016-11-16 Thread David Howells
Get the firmware's secure-boot status in the kernel boot wrapper and stash it somewhere that the main kernel image can find. Signed-off-by: Matthew Garrett Signed-off-by: David Howells --- Documentation/x86/zero-page.txt |2 ++ arch/x86/boot/compressed/eboot.c | 35 +++

[PATCH 12/16] ACPI: Limit access to custom_method when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett custom_method effectively allows arbitrary access to system memory, making it possible for an attacker to circumvent restrictions on module loading. Disable it if the kernel is locked down. Signed-off-by: Matthew Garrett Signed-off-by: David Howells --- drivers/acpi/cus

[PATCH 07/16] kexec: Disable at runtime if the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett kexec permits the loading and execution of arbitrary code in ring 0, which is something that lock-down is meant to prevent. It makes sense to disable kexec in this situation. This does not affect kexec_file_load() which can check for a signature on the image to be booted.

[PATCH 13/16] asus-wmi: Restrict debugfs interface when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett We have no way of validating what all of the Asus WMI methods do on a given machine - and there's a risk that some will allow hardware state to be manipulated in such a way that arbitrary code can be executed in the kernel, circumventing module loading restrictions. Prevent

[PATCH 16/16] x86: Restrict MSR access when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett Writing to MSRs should not be allowed if the kernel is locked down, since it could lead to execution of arbitrary code in kernel mode. Based on a patch by Kees Cook. Cc: Kees Cook Signed-off-by: Matthew Garrett Signed-off-by: David Howells --- arch/x86/kernel/msr.c |

[PATCH 09/16] hibernate: Disable when the kernel is locked down

2016-11-16 Thread David Howells
From: Josh Boyer There is currently no way to verify the resume image when returning from hibernate. This might compromise the signed modules trust model, so until we can work with signed hibernate images we disable it when the kernel is locked down. Signed-off-by: Josh Boyer Signed-off-by: Da

[PATCH 10/16] PCI: Lock down BAR access when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett Any hardware that can potentially generate DMA has to be locked down in order to avoid it being possible for an attacker to modify kernel code, allowing them to circumvent disabled module loading or module signing. Default to paranoid - in future we can potentially relax thi

[PATCH 15/16] acpi: Ignore acpi_rsdp kernel param when the kernel has been locked down

2016-11-16 Thread David Howells
From: Josh Boyer This option allows userspace to pass the RSDP address to the kernel, which makes it possible for a user to circumvent any restrictions imposed on loading modules. Ignore the option when the kernel is locked down. Signed-off-by: Josh Boyer Signed-off-by: David Howells --- dr

[PATCH 14/16] Restrict /dev/mem and /dev/kmem when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett Allowing users to write to address space makes it possible for the kernel to be subverted, avoiding module loading restrictions. Prevent this when the kernel has been locked down. Signed-off-by: Matthew Garrett Signed-off-by: David Howells --- drivers/char/mem.c |6

[PATCH 08/16] Copy secure_boot flag in boot params across kexec reboot

2016-11-16 Thread David Howells
From: Dave Young Kexec reboot in case secure boot being enabled does not keep the secure boot mode in new kernel, so later one can load unsigned kernel via legacy kexec_load. In this state, the system is missing the protections provided by secure boot. Adding a patch to fix this by retain the s

[PATCH 04/16] efi: Lock down the kernel if booted in secure boot mode

2016-11-16 Thread David Howells
UEFI Secure Boot provides a mechanism for ensuring that the firmware will only load signed bootloaders and kernels. Certain use cases may also require that all kernel modules also be signed. Add a configuration option that to lock down the kernel - which includes requiring validly signed modules

[PATCH 11/16] x86: Lock down IO port access when the kernel is locked down

2016-11-16 Thread David Howells
From: Matthew Garrett IO port access would permit users to gain access to PCI configuration registers, which in turn (on a lot of hardware) give access to MMIO register space. This would potentially permit root to trigger arbitrary DMA, so lock it down by default. Signed-off-by: Matthew Garrett

[PATCH 06/16] Add a sysrq option to exit secure boot mode

2016-11-16 Thread David Howells
From: Kyle McMartin Make sysrq+x exit secure boot mode on x86_64, thereby allowing the running kernel image to be modified. This lifts the lockdown. Signed-off-by: David Howells --- arch/x86/Kconfig| 10 ++ arch/x86/kernel/setup.c | 31

[PATCH 03/16] efi: Disable secure boot if shim is in insecure mode

2016-11-16 Thread David Howells
From: Josh Boyer A user can manually tell the shim boot loader to disable validation of images it loads. When a user does this, it creates a UEFI variable called MokSBState that does not have the runtime attribute set. Given that the user explicitly disabled validation, we can honor that and no

Re: [PATCH V2 0/2] ARM: bcm2835: Fix names for the Raspberry Pi GPIO lines

2016-11-16 Thread Eric Anholt
Stefan Wahren writes: > This patch series should fix and extend the patch V4 "ARM: bcm2835: Add names > for the Raspberry Pi GPIO lines" from Linus Walleij and Eric Anholt. > > Changes in V2: > - fix URL to firmware DT blob > - drop dtsi file since Model A+ and Zero aren't identical Pulled.

Re: [PATCH 1/2] staging: vc04_services: remove duplicate mutex_lock_interruptible

2016-11-16 Thread Eric Anholt
Arnd Bergmann writes: > The driver tries to redefine mutex_lock_interruptible as an open-coded > mutex_lock_killable, but that definition clashes with the normal > mutex_lock_interruptible definition when CONFIG_DEBUG_LOCK_ALLOC > is set: These two are: Acked-by: Eric Anholt signature.asc De

Re: [PATCH 3/3] ovl: redirect on rename-dir

2016-11-16 Thread Miklos Szeredi
On Mon, Nov 14, 2016 at 5:25 PM, Amir Goldstein wrote: > On Sun, Nov 13, 2016 at 12:00 PM, Amir Goldstein wrote: >> Looks goods, except for the case of change from relative to absolute >> redirect of the victim dentry. IIUC, ovl_set_redirect() will return >> immediately >> because ovl_dentry_is

Re: [PATCH] netronome: don't access real_num_rx_queues directly

2016-11-16 Thread David Miller
From: Arnd Bergmann Date: Wed, 16 Nov 2016 15:10:49 +0100 > The netdev->real_num_rx_queues setting is only available if CONFIG_SYSFS > is enabled, so we now get a build failure when that is turned off: > > netronome/nfp/nfp_net_common.c: In function 'nfp_net_ring_swap_enable': > netronome/nfp/nf

Re: Boot failures in -next due to 'ARM: dts: imx: Remove skeleton.dtsi'

2016-11-16 Thread Guenter Roeck
> > Boot log for imx25-pdk: > > > > qemu-system-arm: findnode_nofail Couldn't find node /chosen: > > FDT_ERR_NOTFOUND > > So this implies we no longer have a /chosen node. We should add one to > the relevant dts{i,} files, with stdout-path and so on. > > > Boot

Re: [fuse-devel] fuse: max_background and congestion_threshold settings

2016-11-16 Thread Maxim Patlasov
On 11/16/2016 12:19 PM, Nikolaus Rath wrote: On Nov 16 2016, Maxim Patlasov wrote: On 11/16/2016 11:19 AM, Nikolaus Rath wrote: Hi Maxim, On Nov 15 2016, Maxim Patlasov wrote: On 11/15/2016 08:18 AM, Nikolaus Rath wrote: Could someone explain to me the meaning of the max_background and c

Re: [PATCH 1/2] pci: pcie-designware: Change Maintenance

2016-11-16 Thread Bjorn Helgaas
On Tue, Nov 15, 2016 at 04:10:46PM +, Joao Pinto wrote: > I accepted the invitation from Pratyush to replace him in the > pcie-designware maintenance. This patch makes the maintainer replacement > and symplifies a bit the pcie-designware* maintenance structure. > > Signed-off-by: Joao Pinto >

Re: [PATCH 01/16] Add the ability to lock down access to the running kernel image

2016-11-16 Thread Borislav Petkov
On Wed, Nov 16, 2016 at 09:47:24PM +, David Howells wrote: > Provide a single call to allow kernel code to determine whether the system > should be locked down, thereby disallowing various accesses that might > allow the running kernel image to be changed including the loading of > modules that

Re: [PATCH] nvmem: qfprom: Fix to support single byte read/write

2016-11-16 Thread Stephen Boyd
On 11/16, Vivek Gautam wrote: > Hi Stephen, > > On Wed, Nov 16, 2016 at 12:29 AM, Stephen Boyd wrote: > > On 11/15, Vivek Gautam wrote: > >> @@ -53,7 +53,7 @@ static int qfprom_remove(struct platform_device *pdev) > >> static struct nvmem_config econfig = { > >> .name = "qfprom", > >>

[PATCH 25/29] rxrpc: Abstract away knowledge of IDR internals

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Add idr_get_cursor() / idr_set_cursor() APIs, and remove the rounding up to IDR_SIZE. Signed-off-by: Matthew Wilcox --- include/linux/idr.h | 26 ++ net/rxrpc/af_rxrpc.c| 11 ++- net/rxrpc/conn_client.c | 4 ++-- 3 files changed, 34

[PATCH 07/29] radix tree test suite: Use rcu_barrier

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Calling rcu_barrier() allows all of the rcu-freed memory to be actually returned to the pool, and allows nr_allocated to return to 0. As well as allowing diffs between runs to be more useful, it also lets us pinpoint leaks more effectively. Signed-off-by: Matthew Wilcox --

[PATCH 01/29] tools: Add WARN_ON_ONCE

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox The radix tree uses its own buggy WARN_ON_ONCE. Replace it with the definition from asm-generic/bug.h Signed-off-by: Matthew Wilcox --- tools/include/asm/bug.h| 11 +++ tools/testing/radix-tree/Makefile | 2 +- tools/testing/radix-tree/linux/

[PATCH 18/29] btrfs: Fix race in btrfs_free_dummy_fs_info()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox We drop the lock which protects the radix tree, so we must call radix_tree_iter_next() in order to avoid a modification to the tree invalidating the iterator state. Signed-off-by: Matthew Wilcox --- fs/btrfs/tests/btrfs-tests.c | 1 + 1 file changed, 1 insertion(+) diff -

[PATCH 03/29] radix tree test suite: Track preempt_count

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Rather than simply NOP out preempt_enable() and preempt_disable(), keep track of preempt_count and display it regularly in case either the test suite or the code under test is forgetting to balance the enables & disables. Only found a test-case that was forgetting to re-enab

[PATCH 13/29] radix-tree: Fix typo

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox --- lib/radix-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 6d73575..e917c56 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1147,7 +1147,7 @@ void **radix_tree_next_chunk(struct radix_tree_root

[PATCH 06/29] radix tree test suite: benchmark for iterator

2016-11-16 Thread Matthew Wilcox
From: Konstantin Khlebnikov This adds simple benchmark for iterator similar to one I've used for commit 78c1d78 ("radix-tree: introduce bit-optimized iterator") Building with make BENCHMARK=1 set radix tree order to 6, this allows to get performance comparable to in kernel performance. Signed-o

[PATCH 19/29] radix tree test suite: iteration test misuses RCU

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Each thread needs to register itself with RCU, otherwise the reading thread's read lock has no effect and the freeing thread will free the memory in the tree without waiting for the read lock to be dropped. Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/iterati

[PATCH 23/29] idr: Add ida_is_empty

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Two of the USB Gadgets were poking around in the internals of struct ida in order to determine if it is empty. Add the appropriate abstraction. Signed-off-by: Matthew Wilcox --- drivers/usb/gadget/function/f_hid.c | 6 +++--- drivers/usb/gadget/function/f_printer.c |

[PATCH 27/29] radix tree test suite: Add some more functionality

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox IDR needs more functionality from the kernel: kmalloc()/kfree(), and xchg(). Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/linux.c| 15 +++ tools/testing/radix-tree/linux/kernel.h | 3 +++ tools/testing/radix-tree/linux/slab.h | 3 +++

[PATCH 05/29] radix tree test suite: Make runs more reproducible

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Instead of reseeding the random number generator every time around the loop in big_gang_check(), seed it at the beginning of execution. Use rand_r() and an independent base seed for each thread in iteration_test() so they don't stomp all over each others state. Since this p

[PATCH 22/29] radix-tree: Delete radix_tree_range_tag_if_tagged()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This is an exceptionally complicated function with just one caller (tag_pages_for_writeback). We devote a large portion of the runtime of the test suite to testing this one function which has one caller. By introducing the new function radix_tree_iter_tag_set(), we can elimi

[PATCH 00/29] Improve radix tree for 4.10

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Hi Andrew, Please include these patches in the -mm tree for 4.10. Mostly these are improvements; the only bug fixes in here relate to multiorder entries (which as far as I'm aware remain unused). The IDR rewrite has the highest potential for causing mayhem as the test suit

[PATCH 12/29] radix-tree: Add radix_tree_split_preload()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Calculate how many nodes we need to allocate to split an old_order entry into multiple entries, each of size new_order. The test suite checks that we allocated exactly the right number of nodes; neither too many (checked by rtp->nr == 0), nor too few (checked by comparing nr

[PATCH 20/29] radix tree: Improve multiorder iterators

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This fixes several interlinked problems with the iterators in the presence of multiorder entries. 1. radix_tree_iter_next() would only advance by one slot, which would result in the iterators returning the same entry more than once if there were sibling entries. 2. radix_tr

Re: [PATCH 00/16] Kernel lockdown

2016-11-16 Thread Justin Forbes
On Wed, Nov 16, 2016 at 3:47 PM, David Howells wrote: > > These patches provide a facility by which a variety of avenues by which > userspace can feasibly modify the running kernel image can be locked down. > These include: > Bit surprised to see this. Not that I am opposed to the patches themse

[PATCH 14/29] radix-tree: Move rcu_head into a union with private_list

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox I want to be able to reference node->parent after freeing node. Currently node->parent is in a union with rcu_head, so it is overwritten when the node is put on the RCU list. We know that private_list is not referenced after the node is freed, so it is safe for these two mem

[PATCH 24/29] tpm: Use idr_find(), not idr_find_slowpath()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox idr_find_slowpath() is not intended to be part of the public API, it's an implementation detail. There's no reason to skip straight to the slowpath here. Signed-off-by: Matthew Wilcox --- drivers/char/tpm/tpm-chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

Re: Boot failures in -next due to 'ARM: dts: imx: Remove skeleton.dtsi'

2016-11-16 Thread Fabio Estevam
Hi Guenter, On Wed, Nov 16, 2016 at 8:10 PM, Guenter Roeck wrote: > > Anyway, I guess the problem is that the "official" dtb files no longer provide > the skeleton /chosen and /memory nodes (and maybe others), and qemu seems to > expect that they are provided. Is that correct ? imx6qdl-sabrelite

[PATCH 10/29] radix-tree: Add radix_tree_join

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This new function allows for the replacement of many smaller entries in the radix tree with one larger multiorder entry. From the point of view of an RCU walker, they may see a mixture of the smaller entries and the large entry during the same walk, but they will never see N

Re: [PATCH 00/16] Kernel lockdown

2016-11-16 Thread One Thousand Gnomes
Whether it's a good idea aside You need to filter or lock down kernel module options because a lot of modules let you set the I/O port or similar (eg mmio) which means you can hack the entire machine with say the 8250 driver just by using it with an mmio of the right location to patch the secure s

[PATCH 29/29] Reimplement IDR and IDA using the radix tree

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox The IDR is very similar to the radix tree. It has some functionality that the radix tree did not have (alloc next free, cyclic allocation, a callback-based for_each, destroy tree), which is readily implementable on top of the radix tree. A few small changes were needed in o

[PATCH 06/29] radix tree test suite: benchmark for iterator

2016-11-16 Thread Matthew Wilcox
From: Konstantin Khlebnikov This adds simple benchmark for iterator similar to one I've used for commit 78c1d78 ("radix-tree: introduce bit-optimized iterator") Building with make BENCHMARK=1 set radix tree order to 6, this allows to get performance comparable to in kernel performance. Signed-o

[PATCH 21/29] radix-tree: Delete radix_tree_locate_item()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This rather complicated function can be better implemented as an iterator. It has only one caller, so move the functionality to the only place that needs it. Update the test suite to follow the same pattern. Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h

[PATCH 07/29] radix tree test suite: Use rcu_barrier

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Calling rcu_barrier() allows all of the rcu-freed memory to be actually returned to the pool, and allows nr_allocated to return to 0. As well as allowing diffs between runs to be more useful, it also lets us pinpoint leaks more effectively. Signed-off-by: Matthew Wilcox --

[PATCH 18/29] btrfs: Fix race in btrfs_free_dummy_fs_info()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox We drop the lock which protects the radix tree, so we must call radix_tree_iter_next() in order to avoid a modification to the tree invalidating the iterator state. Signed-off-by: Matthew Wilcox --- fs/btrfs/tests/btrfs-tests.c | 1 + 1 file changed, 1 insertion(+) diff -

[PATCH 25/29] rxrpc: Abstract away knowledge of IDR internals

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Add idr_get_cursor() / idr_set_cursor() APIs, and remove the rounding up to IDR_SIZE. Signed-off-by: Matthew Wilcox --- include/linux/idr.h | 26 ++ net/rxrpc/af_rxrpc.c| 11 ++- net/rxrpc/conn_client.c | 4 ++-- 3 files changed, 34

[PATCH 08/29] tools: Add more bitmap functions

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox I need the following functions for the radix tree: bitmap_fill find_next_zero_bit bitmap_empty bitmap_full Copy the implementations from include/linux/bitmap.h and lib/find_bit.c --- tools/include/linux/bitmap.h | 26 ++ tools/lib/find_bit.c

[PATCH 02/29] radix tree test suite: Allow GFP_ATOMIC allocations to fail

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox In order to test the preload code, it is necessary to fail GFP_ATOMIC allocations, which requires defining GFP_KERNEL and GFP_ATOMIC properly. Remove the obsolete __GFP_WAIT and copy the definitions of the __GFP flags which are used from the kernel include files. We also nee

[PATCH 04/29] radix tree test suite: Free preallocated nodes

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox It can be a source of mild concern when the test suite shows that we're leaking nodes. While poring over the source code looking for leaks can lead to some fascinating bugs being discovered, sometimes the leak is simply that these nodes were preallocated and are sitting on t

[PATCH 08/29] tools: Add more bitmap functions

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox I need the following functions for the radix tree: bitmap_fill find_next_zero_bit bitmap_empty bitmap_full Copy the implementations from include/linux/bitmap.h and lib/find_bit.c --- tools/include/linux/bitmap.h | 26 ++ tools/lib/find_bit.c

[PATCH 22/29] radix-tree: Delete radix_tree_range_tag_if_tagged()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This is an exceptionally complicated function with just one caller (tag_pages_for_writeback). We devote a large portion of the runtime of the test suite to testing this one function which has one caller. By introducing the new function radix_tree_iter_tag_set(), we can elimi

[PATCH 02/29] radix tree test suite: Allow GFP_ATOMIC allocations to fail

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox In order to test the preload code, it is necessary to fail GFP_ATOMIC allocations, which requires defining GFP_KERNEL and GFP_ATOMIC properly. Remove the obsolete __GFP_WAIT and copy the definitions of the __GFP flags which are used from the kernel include files. We also nee

[PATCH 23/29] idr: Add ida_is_empty

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Two of the USB Gadgets were poking around in the internals of struct ida in order to determine if it is empty. Add the appropriate abstraction. Signed-off-by: Matthew Wilcox --- drivers/usb/gadget/function/f_hid.c | 6 +++--- drivers/usb/gadget/function/f_printer.c |

[PATCH 26/29] idr: Reduce the number of bits per level from 8 to 6

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox In preparation for merging the IDR and radix tree, reduce the fanout at each level from 256 to 64. If this causes a performance problem then a bisect will point to this commit, and we'll have a better idea about what we might do to fix it. Signed-off-by: Matthew Wilcox ---

[PATCH 17/29] radix-tree: Improve dump output

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Print the indices of the entries as unsigned (instead of signed) integers and print the parent node of each entry to help navigate around larger trees where the layout is not quite so obvious. Print the indices covered by a node. Rearrange the order of fields printed so the

[PATCH 11/29] radix-tree: Add radix_tree_split

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This new function splits a larger multiorder entry into smaller entries (potentially multi-order entries). These entries are initialised to RADIX_TREE_RETRY to ensure that RCU walkers who see this state aren't confused. The caller should then call radix_tree_for_each_slot()

[PATCH 21/29] radix-tree: Delete radix_tree_locate_item()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This rather complicated function can be better implemented as an iterator. It has only one caller, so move the functionality to the only place that needs it. Update the test suite to follow the same pattern. Signed-off-by: Matthew Wilcox --- include/linux/radix-tree.h

[PATCH 13/29] radix-tree: Fix typo

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox --- lib/radix-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/radix-tree.c b/lib/radix-tree.c index 6d73575..e917c56 100644 --- a/lib/radix-tree.c +++ b/lib/radix-tree.c @@ -1147,7 +1147,7 @@ void **radix_tree_next_chunk(struct radix_tree_root

[PATCH 24/29] tpm: Use idr_find(), not idr_find_slowpath()

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox idr_find_slowpath() is not intended to be part of the public API, it's an implementation detail. There's no reason to skip straight to the slowpath here. Signed-off-by: Matthew Wilcox --- drivers/char/tpm/tpm-chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

[PATCH 17/29] radix-tree: Improve dump output

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Print the indices of the entries as unsigned (instead of signed) integers and print the parent node of each entry to help navigate around larger trees where the layout is not quite so obvious. Print the indices covered by a node. Rearrange the order of fields printed so the

[PATCH 14/29] radix-tree: Move rcu_head into a union with private_list

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox I want to be able to reference node->parent after freeing node. Currently node->parent is in a union with rcu_head, so it is overwritten when the node is put on the RCU list. We know that private_list is not referenced after the node is freed, so it is safe for these two mem

[PATCH 20/29] radix tree: Improve multiorder iterators

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This fixes several interlinked problems with the iterators in the presence of multiorder entries. 1. radix_tree_iter_next() would only advance by one slot, which would result in the iterators returning the same entry more than once if there were sibling entries. 2. radix_tr

[PATCH 10/29] radix-tree: Add radix_tree_join

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This new function allows for the replacement of many smaller entries in the radix tree with one larger multiorder entry. From the point of view of an RCU walker, they may see a mixture of the smaller entries and the large entry during the same walk, but they will never see N

[PATCH 16/29] radix-tree: Make radix_tree_find_next_bit more useful

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Since this function is specialised to the radix tree, pass in the node and tag to calculate the address of the bitmap in radix_tree_find_next_bit() instead of the caller. Likewise, there is no need to pass in the size of the bitmap. Signed-off-by: Matthew Wilcox --- lib/r

[PATCH 26/29] idr: Reduce the number of bits per level from 8 to 6

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox In preparation for merging the IDR and radix tree, reduce the fanout at each level from 256 to 64. If this causes a performance problem then a bisect will point to this commit, and we'll have a better idea about what we might do to fix it. Signed-off-by: Matthew Wilcox ---

[PATCH 09/29] radix tree test suite: Use common find-bit code

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Remove the old find_next_bit code in favour of linking in the find_bit code from tools/lib. Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/Makefile | 7 ++- tools/testing/radix-tree/find_next_bit.c | 57 -- tools/

[PATCH 28/29] radix-tree: Create all_tag_set

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox all_tag_set() sets every tag on a node. This is useful for the IDR code when we're creating new nodes which contain only free slots. Signed-off-by: Matthew Wilcox --- lib/radix-tree.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/radix-tre

[PATCH 09/29] radix tree test suite: Use common find-bit code

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Remove the old find_next_bit code in favour of linking in the find_bit code from tools/lib. Signed-off-by: Matthew Wilcox --- tools/testing/radix-tree/Makefile | 7 ++- tools/testing/radix-tree/find_next_bit.c | 57 -- tools/

[PATCH 16/29] radix-tree: Make radix_tree_find_next_bit more useful

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox Since this function is specialised to the radix tree, pass in the node and tag to calculate the address of the bitmap in radix_tree_find_next_bit() instead of the caller. Likewise, there is no need to pass in the size of the bitmap. Signed-off-by: Matthew Wilcox --- lib/r

Re: [PATCH 01/16] Add the ability to lock down access to the running kernel image

2016-11-16 Thread David Howells
Borislav Petkov wrote: > > +EXPORT_SYMBOL(kernel_locked_down); > > Surely > > EXPORT_SYMBOL(kernel_is_locked_down); Sorry, yes. Obviously it won't cause a compilation error... David

Re: Boot failures in -next due to 'ARM: dts: imx: Remove skeleton.dtsi'

2016-11-16 Thread Guenter Roeck
On Wed, Nov 16, 2016 at 08:27:09PM -0200, Fabio Estevam wrote: > Hi Guenter, > > On Wed, Nov 16, 2016 at 8:10 PM, Guenter Roeck wrote: > > > > Anyway, I guess the problem is that the "official" dtb files no longer > > provide > > the skeleton /chosen and /memory nodes (and maybe others), and qem

[PATCH 11/29] radix-tree: Add radix_tree_split

2016-11-16 Thread Matthew Wilcox
From: Matthew Wilcox This new function splits a larger multiorder entry into smaller entries (potentially multi-order entries). These entries are initialised to RADIX_TREE_RETRY to ensure that RCU walkers who see this state aren't confused. The caller should then call radix_tree_for_each_slot()

<    2   3   4   5   6   7   8   9   10   >