[PATCH v4 0/5] Optionally randomize kernel stack offset each syscall

2020-06-22 Thread Kees Cook
v4: - rebase to v5.8-rc2 v3: https://lore.kernel.org/lkml/20200406231606.37619-1-keesc...@chromium.org/ v2: https://lore.kernel.org/lkml/20200324203231.64324-1-keesc...@chromium.org/ rfc: https://lore.kernel.org/kernel-hardening/20190329081358.30497-1-elena.reshet...@intel.com/ Hi, This is a con

[PATCH v4 4/5] x86/entry: Enable random_kstack_offset support

2020-06-22 Thread Kees Cook
Allow for a randomized stack offset on a per-syscall basis, with roughly 5 bits of entropy. Signed-off-by: Kees Cook --- arch/x86/Kconfig| 1 + arch/x86/entry/common.c | 11 +++ 2 files changed, 12 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 6a0cc524882

Re: [PATCH] soc: qcom: rpmh-rsc: Set suppress_bind_attrs flag

2020-06-22 Thread Bjorn Andersson
On Mon 22 Jun 02:03 PDT 2020, Stephen Boyd wrote: > Quoting Maulik Shah (2020-06-21 23:53:25) > > rpmh-rsc driver is fairly core to system and should not be removable > > once its probed. However it allows to unbind driver from sysfs using > > below command which results into a crash on sc7180. >

Re: [PATCH] [net] dcb_doit: remove redundant skb check

2020-06-22 Thread Jakub Kicinski
On Sun, 21 Jun 2020 12:56:28 -0400 Gaurav Singh wrote: > Remove the redundant null check for skb. > > Signed-off-by: Gaurav Singh Thanks for the patch, it looks correct, but could you describe your proof / reasoning based on which this change is correct? Please post non-bug fixes like this with

Re: [PATCH v8 0/4] introduce memory hinting API for external process

2020-06-22 Thread Minchan Kim
On Mon, Jun 22, 2020 at 12:28:56PM -0700, Minchan Kim wrote: > Now, we have MADV_PAGEOUT and MADV_COLD as madvise hinting API. With that, > application could give hints to kernel what memory range are preferred to be > reclaimed. However, in some platform(e.g., Android), the information > required

Re: [PATCH 13/16] mm: support THP migration to device private memory

2020-06-22 Thread Ralph Campbell
On 6/21/20 4:20 PM, Zi Yan wrote: On 19 Jun 2020, at 17:56, Ralph Campbell wrote: Support transparent huge page migration to ZONE_DEVICE private memory. A new flag (MIGRATE_PFN_COMPOUND) is added to the input PFN array to indicate the huge page was fully mapped by the CPU. Export prep_compoun

Re: [PATCH 0/5] Adding Huawei BMA drivers

2020-06-22 Thread Jakub Kicinski
On Tue, 23 Jun 2020 00:03:06 +0800 yunaixin03...@163.com wrote: > From: yunaixin > > This patch set contains 5 communication drivers for Huawei BMA software. > The BMA software is a system management software. It supports the status > monitoring, performance monitoring, and event monitoring of va

Re: [PATCH 10/21] KVM: x86/mmu: Make __GFP_ZERO a property of the memory cache

2020-06-22 Thread Sean Christopherson
On Wed, Jun 10, 2020 at 11:57:32AM -0700, Ben Gardon wrote: > > --- > > arch/x86/include/asm/kvm_host.h | 1 + > > arch/x86/kvm/mmu/mmu.c | 7 ++- > > 2 files changed, 7 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/include/asm/kvm_host.h > > b/arch/x86/include/asm/kvm_h

Re: [PATCH v4 3/5] stack: Optionally randomize kernel stack offset each syscall

2020-06-22 Thread Randy Dunlap
On 6/22/20 12:31 PM, Kees Cook wrote: > This provides the ability for architectures to enable kernel stack base > address offset randomization. This feature is controlled by the boot > param "randomize_kstack_offset=on/off", with its default value set by > CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT. >

Re: [PATCH v5 1/2] dt-bindings: mfd: Add ENE KB3930 Embedded Controller binding

2020-06-22 Thread Lubomir Rintel
On Mon, Jun 22, 2020 at 07:53:50AM +0100, Lee Jones wrote: > On Wed, 17 Jun 2020, Lubomir Rintel wrote: > > > Add binding document for the ENE KB3930 Embedded Controller. > > > > Signed-off-by: Lubomir Rintel > > Reviewed-by: Rob Herring > > > > --- > > Changes since v4: > > - Collected Rob's

Re: [PATCH v2 09/16] rcu/tree: Maintain separate array for vmalloc ptrs

2020-06-22 Thread Paul E. McKenney
On Mon, Jun 22, 2020 at 09:04:06PM +0200, Uladzislau Rezki wrote: > > > > > > > > Very good. When does kfree_rcu() and friends move out of kernel/rcu? > > > > > > > Do you mean to move the whole logic of kfree_rcu() from top to down to > > > mm/? > > > > I do mean exactly that. > > > > That w

RE: [PATCH][next] mm/zswap: fix a couple of memory leaks and rework kzalloc failure check

2020-06-22 Thread Song Bao Hua (Barry Song)
> -Original Message- > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > Sent: Tuesday, June 23, 2020 6:28 AM > To: Colin King > Cc: Seth Jennings ; Dan Streetman > ; Vitaly Wool ; Andrew > Morton ; Song Bao Hua (Barry Song) > ; Stephen Rothwell ; > linux...@kvack.org; kernel-jani

[PATCH 1/1] mm/vmalloc: update the header about KVA rework

2020-06-22 Thread Uladzislau Rezki (Sony)
Reflect an information about an author, date and year when the KVA rework has been done. Signed-off-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 1e94497b7388..3c3b6ec26f9c 100644 --- a/mm/vmalloc.c +++ b/mm/vma

[PATCH] soc: ti: k3-ringacc: fix: warn: variable dereferenced before check 'ring'

2020-06-22 Thread Grygorii Strashko
Fix build warning in k3_ringacc_ring_cfg(): smatch warnings: drivers/soc/ti/k3-ringacc.c:562 k3_ringacc_ring_cfg() warn: variable dereferenced before check 'ring' (see line 559) 557 int k3_ringacc_ring_cfg(struct k3_ring *ring, struct k3_ring_cfg *cfg) 558 { @559 struct k3_ringa

Re: [PATCH][v2] PM / s2idle: Clear _TIF_POLLING_NRFLAG before suspend to idle

2020-06-22 Thread Rafael J. Wysocki
On Mon, Jun 22, 2020 at 7:16 PM Chen Yu wrote: > > Hi Rafael, > On Mon, Jun 22, 2020 at 06:19:35PM +0200, Rafael J. Wysocki wrote: > [cut] > > > +{ > > > + if (!current_clr_polling_and_test()) > > > + s2idle_enter(drv, dev, index); > > > + > > > + return index; > > > > Is

Re: [PATCH] initrd: Remove erroneous comment

2020-06-22 Thread ron minnich
The other thing you ought to consider fixing: initrd is documented as follows: initrd= [BOOT] Specify the location of the initial ramdisk for bootloaders only. UEFI consumes initrd from the command line as well. As ARM servers increasingly use UEFI, there may be situations in whi

[PATCH v2] Replace HTTP links with HTTPS ones: Documentation/admin-guide

2020-06-22 Thread Alexander A. Klimov
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:

Re: [PATCH bpf v2] restore behaviour of CAP_SYS_ADMIN allowing the loading of networking bpf programs

2020-06-22 Thread John Stultz
On Sat, Jun 20, 2020 at 2:26 PM Maciej Żenczykowski wrote: > > From: Maciej Żenczykowski > > This is a fix for a regression introduced in 5.8-rc1 by: > commit 2c78ee898d8f10ae6fb2fa23a3fbaec96b1b7366 > 'bpf: Implement CAP_BPF' > > Before the above commit it was possible to load network bpf pr

Re: [PATCH v4 1/2] thermal: add support for the MCU controlled FAN on Khadas boards

2020-06-22 Thread Daniel Lezcano
On 18/06/2020 15:38, Neil Armstrong wrote: > The new Khadas VIM2 and VIM3 boards controls the cooling fan via the > on-board microcontroller. > > This implements the FAN control as thermal devices and as cell of the Khadas > MCU MFD driver. > > Signed-off-by: Neil Armstrong > Reviewed-by: Amit K

[PATCH v4 00/18] Add support for Nitro Enclaves

2020-06-22 Thread Andra Paraschiv
Nitro Enclaves (NE) is a new Amazon Elastic Compute Cloud (EC2) capability that allows customers to carve out isolated compute environments within EC2 instances [1]. For example, an application that processes sensitive data and runs in a VM, can be separated from other applications running in the

[PATCH v4 02/18] nitro_enclaves: Define the PCI device interface

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves (NE) driver communicates with a new PCI device, that is exposed to a virtual machine (VM) and handles commands meant for handling enclaves lifetime e.g. creation, termination, setting memory regions. The communication with the PCI device is handled using a MMIO space and MSI-X in

[PATCH v4 05/18] nitro_enclaves: Handle PCI device command requests

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves PCI device exposes a MMIO space that this driver uses to submit command requests and to receive command replies e.g. for enclave creation / termination or setting enclave resources. Add logic for handling PCI device command requests based on the given command type. Register an

[PATCH v4 01/18] nitro_enclaves: Add ioctl interface definition

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves driver handles the enclave lifetime management. This includes enclave creation, termination and setting up its resources such as memory and CPU. An enclave runs alongside the VM that spawned it. It is abstracted as a process running in the VM that launched it. The process intera

[PATCH v4 03/18] nitro_enclaves: Define enclave info for internal bookkeeping

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves driver keeps an internal info per each enclave. This is needed to be able to manage enclave resources state, enclave notifications and have a reference of the PCI device that handles command requests for enclave lifetime management. Signed-off-by: Alexandru-Catalin Vasile Sign

[PATCH v4 07/18] nitro_enclaves: Init misc device providing the ioctl interface

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves driver provides an ioctl interface to the user space for enclave lifetime management e.g. enclave creation / termination and setting enclave resources such as memory and CPU. This ioctl interface is mapped to a Nitro Enclaves misc device. Signed-off-by: Andra Paraschiv --- Cha

[PATCH v4 08/18] nitro_enclaves: Add logic for enclave vm creation

2020-06-22 Thread Andra Paraschiv
Add ioctl command logic for enclave VM creation. It triggers a slot allocation. The enclave resources will be associated with this slot and it will be used as an identifier for triggering enclave run. Return a file descriptor, namely enclave fd. This is further used by the associated user space en

[PATCH v4 04/18] nitro_enclaves: Init PCI device driver

2020-06-22 Thread Andra Paraschiv
The Nitro Enclaves PCI device is used by the kernel driver as a means of communication with the hypervisor on the host where the primary VM and the enclaves run. It handles requests with regard to enclave lifetime. Setup the PCI device driver and add support for MSI-X interrupts. Signed-off-by: A

[PATCH v4 06/18] nitro_enclaves: Handle out-of-band PCI device events

2020-06-22 Thread Andra Paraschiv
In addition to the replies sent by the Nitro Enclaves PCI device in response to command requests, out-of-band enclave events can happen e.g. an enclave crashes. In this case, the Nitro Enclaves driver needs to be aware of the event and notify the corresponding user space process that abstracts the

[PATCH v4 09/18] nitro_enclaves: Add logic for enclave vcpu creation

2020-06-22 Thread Andra Paraschiv
An enclave, before being started, has its resources set. One of its resources is CPU. The NE CPU pool is set for choosing CPUs for enclaves from it. Offline the CPUs from the NE CPU pool during the pool setup and online them back during the NE CPU pool teardown. The enclave CPUs need to be full c

[PATCH v4 13/18] nitro_enclaves: Add logic for enclave termination

2020-06-22 Thread Andra Paraschiv
An enclave is associated with an fd that is returned after the enclave creation logic is completed. This enclave fd is further used to setup enclave resources. Once the enclave needs to be terminated, the enclave fd is closed. Add logic for enclave termination, that is mapped to the enclave fd rel

[PATCH v4 12/18] nitro_enclaves: Add logic for enclave start

2020-06-22 Thread Andra Paraschiv
After all the enclave resources are set, the enclave is ready for beginning to run. Add ioctl command logic for starting an enclave after all its resources, memory regions and CPUs, have been set. The enclave start information includes the local channel addressing - vsock CID - and the flags asso

[PATCH v4 10/18] nitro_enclaves: Add logic for enclave image load info

2020-06-22 Thread Andra Paraschiv
Before setting the memory regions for the enclave, the enclave image needs to be placed in memory. After the memory regions are set, this memory cannot be used anymore by the VM, being carved out. Add ioctl command logic to get the offset in enclave memory where to place the enclave image. Then th

[PATCH v4 11/18] nitro_enclaves: Add logic for enclave memory region set

2020-06-22 Thread Andra Paraschiv
Another resource that is being set for an enclave is memory. User space memory regions, that need to be backed by contiguous memory regions, are associated with the enclave. One solution for allocating / reserving contiguous memory regions, that is used for integration, is hugetlbfs. The user spac

[PATCH v4 18/18] MAINTAINERS: Add entry for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * No changes. v2 -> v3 * Update file entries to be in alphabetical order. v1 -> v2 * No changes. --- MAINTAINERS | 13 + 1 file changed, 13 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 7b5ffd646c6b..66f35c4de16

[PATCH v4 16/18] nitro_enclaves: Add sample for ioctl interface usage

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Alexandru Vasile Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Update usage details to match the updates in v4. * Update NE ioctl interface usage. v2 -> v3 * Remove the include directory to use the uapi from the kernel. * Remove the GPL additional wording as SPDX-Lice

[PATCH v4 15/18] nitro_enclaves: Add Makefile for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * No changes. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Makefile to match the drivers/virt/nitro_enclaves directory. --- drivers/virt/Makefile

[PATCH v4 14/18] nitro_enclaves: Add Kconfig for the Nitro Enclaves driver

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Add PCI and SMP dependencies. v2 -> v3 * Remove the GPL additional wording as SPDX-License-Identifier is already in place. v1 -> v2 * Update path to Kconfig to match the drivers/virt/nitro_enclaves directory. * Update help in Kconfi

[PATCH v4 17/18] nitro_enclaves: Add overview documentation

2020-06-22 Thread Andra Paraschiv
Signed-off-by: Andra Paraschiv --- Changelog v3 -> v4 * Update doc type from .txt to .rst. * Update documentation based on the changes from v4. v2 -> v3 * No changes. v1 -> v2 * New in v2. --- Documentation/nitro_enclaves/ne_overview.rst | 87 1 file changed, 87 inserti

Re: [PATCH] Replace HTTP links with HTTPS ones: Documentation/process

2020-06-22 Thread Miguel Ojeda
On Mon, Jun 22, 2020 at 7:29 PM Joe Perches wrote: > > scripts/get_maintainer.pl --self-test=links has a reachability test > using wget. > > Perhaps a script like that could be used for http:// vs https:// +1 Not sure about `--no-check-certificate` if the goal is to move to "proper HTTPS". Perha

[PATCH] binder: fix null deref of proc->context

2020-06-22 Thread Todd Kjos
The binder driver makes the assumption proc->context pointer is invariant after initialization (as documented in the kerneldoc header for struct proc). However, in commit f0fe2c0f050d ("binder: prevent UAF for binderfs devices II") proc->context is set to NULL during binder_deferred_release(). Ano

[RFC v5 05/10] drm/nouveau/kms/nv50-: Fix disabling dithering

2020-06-22 Thread Lyude Paul
While we expose the ability to turn off hardware dithering for nouveau, we actually make the mistake of turning it on anyway, due to dithering_depth containing a non-zero value if our dithering depth isn't also set to 6 bpc. So, fix it by never enabling dithering when it's disabled. Signed-off-by

[RFC v5 04/10] drm/nouveau/kms/nv140-: Don't modify depth in state during atomic commit

2020-06-22 Thread Lyude Paul
Currently, we modify the depth value stored in the atomic state when performing a commit in order to workaround the fact we haven't implemented support for depths higher then 10 yet. This isn't idempotent though, as it will happen every atomic commit where we modify the OR state even if the head's

[RFC v5 02/10] drm/vblank: Add vblank works

2020-06-22 Thread Lyude Paul
Add some kind of vblank workers. The interface is similar to regular delayed works, and is mostly based off kthread_work. It allows for scheduling delayed works that execute once a particular vblank sequence has passed. It also allows for accurate flushing of scheduled vblank works - in that flushi

[RFC v5 01/10] drm/vblank: Register drmm cleanup action once per drm_vblank_crtc

2020-06-22 Thread Lyude Paul
Since we'll be allocating resources for kthread_create_worker() in the next commit (which could fail and require us to clean up the mess), let's simplify the cleanup process a bit by registering a drm_vblank_init_release() action for each drm_vblank_crtc so they're still cleaned up if we fail to in

[RFC v5 07/10] drm/nouveau/kms/nv140-: Track wndw mappings in nv50_head_atom

2020-06-22 Thread Lyude Paul
While we're not quite ready yet to add support for flexible wndw mappings, we are going to need to at least keep track of the static wndw mappings we're currently using in each head's atomic state. We'll likely use this in the future to implement real flexible window mapping, but the primary reason

[RFC v5 06/10] drm/nouveau/kms/nv50-: s/harm/armh/g

2020-06-22 Thread Lyude Paul
We refer to the armed hardware assembly as armh elsewhere in nouveau, so fix the naming here to make it consistent. This patch contains no functional changes. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/wndw.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-)

Re: [PATCH v4 3/5] stack: Optionally randomize kernel stack offset each syscall

2020-06-22 Thread Jann Horn
On Mon, Jun 22, 2020 at 9:31 PM Kees Cook wrote: > This provides the ability for architectures to enable kernel stack base > address offset randomization. This feature is controlled by the boot > param "randomize_kstack_offset=on/off", with its default value set by > CONFIG_RANDOMIZE_KSTACK_OFFSET

[RFC v5 03/10] drm/nouveau/kms/nv50-: Unroll error cleanup in nv50_head_create()

2020-06-22 Thread Lyude Paul
We'll be rolling back more things in this function, and the way it's structured is a bit confusing. So, let's clean this up a bit and just unroll in the event of failure. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouveau/dispnv50/head.c | 33 + 1 file changed, 23 inse

[PATCH v2 17/21] KVM: arm64: Use common code's approach for __GFP_ZERO with memory caches

2020-06-22 Thread Sean Christopherson
Add a "gfp_zero" member to arm64's 'struct kvm_mmu_memory_cache' to make the struct and its usage compatible with the common 'struct kvm_mmu_memory_cache' in linux/kvm_host.h. This will minimize code churn when arm64 moves to the common implementation in a future patch, at the cost of temporarily

[PATCH v2 20/21] KVM: MIPS: Account pages used for GPA page tables

2020-06-22 Thread Sean Christopherson
Use GFP_KERNEL_ACCOUNT instead of GFP_KERNEL when allocating pages for the the GPA page tables. The primary motivation for accounting the allocations is to align with the common KVM memory cache helpers in preparation for moving to the common implementation in a future patch. The actual accounting

[PATCH v2 14/21] KVM: Move x86's version of struct kvm_mmu_memory_cache to common code

2020-06-22 Thread Sean Christopherson
Move x86's 'struct kvm_mmu_memory_cache' to common code in anticipation of moving the entire x86 implementation code to common KVM and reusing it for arm64 and MIPS. Add a new architecture specific asm/kvm_types.h to control the existence and parameters of the struct. The new header is needed to

[PATCH v2 09/21] KVM: x86/mmu: Separate the memory caches for shadow pages and gfn arrays

2020-06-22 Thread Sean Christopherson
Use separate caches for allocating shadow pages versus gfn arrays. This sets the stage for specifying __GFP_ZERO when allocating shadow pages without incurring extra cost for gfn arrays. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/inc

[RFC v5 10/10] drm/nouveau/kms/nvd9-: Add CRC support

2020-06-22 Thread Lyude Paul
This introduces support for CRC readback on gf119+, using the documentation generously provided to us by Nvidia: https://github.com/NVIDIA/open-gpu-doc/blob/master/Display-CRC/display-crc.txt We expose all available CRC sources. SF, SOR, PIOR, and DAC are exposed through a single set of "outp" so

[PATCH v2 16/21] KVM: arm64: Drop @max param from mmu_topup_memory_cache()

2020-06-22 Thread Sean Christopherson
Replace the @max param in mmu_topup_memory_cache() and instead use ARRAY_SIZE() to terminate the loop to fill the cache. This removes a BUG_ON() and sets the stage for moving arm64 to the common memory cache implementation. No functional change intended. Tested-by: Marc Zyngier Signed-off-by: S

Re: [PATCH] binder: fix null deref of proc->context

2020-06-22 Thread Christian Brauner
On Mon, Jun 22, 2020 at 01:07:15PM -0700, Todd Kjos wrote: > The binder driver makes the assumption proc->context pointer is invariant > after > initialization (as documented in the kerneldoc header for struct proc). > However, in commit f0fe2c0f050d ("binder: prevent UAF for binderfs devices > I

[PATCH v2 21/21] KVM: MIPS: Use common KVM implementation of MMU memory caches

2020-06-22 Thread Sean Christopherson
Move to the common MMU memory cache implementation now that the common code and MIPS's existing code are semantically compatible. No functional change intended. Suggested-by: Christoffer Dall Signed-off-by: Sean Christopherson --- arch/mips/include/asm/Kbuild | 1 - arch/mips/include/asm

[PATCH v2 15/21] KVM: Move x86's MMU memory cache helpers to common KVM code

2020-06-22 Thread Sean Christopherson
Move x86's memory cache helpers to common KVM code so that they can be reused by arm64 and MIPS in future patches. Suggested-by: Christoffer Dall Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 53 -- include/linux/k

[PATCH v2 19/21] KVM: MIPS: Drop @max param from mmu_topup_memory_cache()

2020-06-22 Thread Sean Christopherson
Replace the @max param in mmu_topup_memory_cache() and instead use ARRAY_SIZE() to terminate the loop to fill the cache. This removes a BUG_ON() and sets the stage for moving MIPS to the common memory cache implementation. No functional change intended. Signed-off-by: Sean Christopherson --- a

[PATCH v2 18/21] KVM: arm64: Use common KVM implementation of MMU memory caches

2020-06-22 Thread Sean Christopherson
Move to the common MMU memory cache implementation now that the common code and arm64's existing code are semantically compatible. No functional change intended. Suggested-by: Christoffer Dall Tested-by: Marc Zyngier Signed-off-by: Sean Christopherson --- arch/arm64/include/asm/Kbuild |

[PATCH v2 04/21] KVM: x86/mmu: Remove superfluous gotos from mmu_topup_memory_caches()

2020-06-22 Thread Sean Christopherson
Return errors directly from mmu_topup_memory_caches() instead of branching to a label that does the same. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --g

[PATCH v2 12/21] KVM: x86/mmu: Skip filling the gfn cache for guaranteed direct MMU topups

2020-06-22 Thread Sean Christopherson
Don't bother filling the gfn array cache when the caller is a fully direct MMU, i.e. won't need a gfn array for shadow pages. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 18 ++ arch/x86/kvm/mmu/paging_tmpl.h | 4 ++-- 2 files

[PATCH v2 13/21] KVM: x86/mmu: Prepend "kvm_" to memory cache helpers that will be global

2020-06-22 Thread Sean Christopherson
Rename the memory helpers that will soon be moved to common code and be made globaly available via linux/kvm_host.h. "mmu" alone is not a sufficient namespace for globally available KVM symbols. Opportunistically add "nr_" in mmu_memory_cache_free_objects() to make it clear the function returns t

[RFC v5 08/10] drm/nouveau/kms/nv50-: Expose nv50_outp_atom in disp.h

2020-06-22 Thread Lyude Paul
In order to make sure that we flush disable updates at the right time when disabling CRCs, we'll need to be able to look at the outp state to see if we're changing it at the same time that we're disabling CRCs. So, expose the struct in disp.h. Signed-off-by: Lyude Paul --- drivers/gpu/drm/nouve

Re: [PATCH 13/16] mm: support THP migration to device private memory

2020-06-22 Thread Zi Yan
On 22 Jun 2020, at 15:36, Ralph Campbell wrote: > On 6/21/20 4:20 PM, Zi Yan wrote: >> On 19 Jun 2020, at 17:56, Ralph Campbell wrote: >> >>> Support transparent huge page migration to ZONE_DEVICE private memory. >>> A new flag (MIGRATE_PFN_COMPOUND) is added to the input PFN array to >>> indicate

[PATCH v2 01/21] KVM: x86/mmu: Track the associated kmem_cache in the MMU caches

2020-06-22 Thread Sean Christopherson
Track the kmem_cache used for non-page KVM MMU memory caches instead of passing in the associated kmem_cache when filling the cache. This will allow consolidating code and other cleanups. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/in

[PATCH v2 11/21] KVM: x86/mmu: Zero allocate shadow pages (outside of mmu_lock)

2020-06-22 Thread Sean Christopherson
Set __GFP_ZERO for the shadow page memory cache and drop the explicit clear_page() from kvm_mmu_get_page(). This moves the cost of zeroing a page to the allocation time of the physical page, i.e. when topping up the memory caches, and thus avoids having to zero out an entire page while holding mmu

[PATCH v2 10/21] KVM: x86/mmu: Make __GFP_ZERO a property of the memory cache

2020-06-22 Thread Sean Christopherson
Add a gfp_zero flag to 'struct kvm_mmu_memory_cache' and use it to control __GFP_ZERO instead of hardcoding a call to kmem_cache_zalloc(). A future patch needs such a flag for the __get_free_page() path, as gfn arrays do not need/want the allocator to zero the memory. Convert the kmem_cache paths

[RFC v5 09/10] drm/nouveau/kms/nv50-: Move hard-coded object handles into header

2020-06-22 Thread Lyude Paul
While most of the functionality on Nvidia GPUs doesn't require using an explicit handle instead of the main VRAM handle + offset, there are a couple of places that do require explicit handles, such as CRC functionality. Since this means we're about to add another nouveau-chosen handle, let's just g

[PATCH v2 07/21] KVM: x86/mmu: Topup memory caches after walking GVA->GPA

2020-06-22 Thread Sean Christopherson
Topup memory caches after walking the GVA->GPA translation during a shadow page fault, there is no need to ensure the caches are full when walking the GVA. As of commit f5a1e9f89504f ("KVM: MMU: remove call to kvm_mmu_pte_write from walk_addr"), the FNAME(walk_addr) flow no longer add rmaps via kv

[PATCH v2 08/21] KVM: x86/mmu: Clean up the gorilla math in mmu_topup_memory_caches()

2020-06-22 Thread Sean Christopherson
Clean up the minimums in mmu_topup_memory_caches() to document the driving mechanisms behind the minimums. Now that encountering an empty cache is unlikely to trigger BUG_ON(), it is less dangerous to be more precise when defining the minimums. For rmaps, the logic is 1 parent PTE per level, plus

[PATCH v2 05/21] KVM: x86/mmu: Try to avoid crashing KVM if a MMU memory cache is empty

2020-06-22 Thread Sean Christopherson
Attempt to allocate a new object instead of crashing KVM (and likely the kernel) if a memory cache is unexpectedly empty. Use GFP_ATOMIC for the allocation as the caches are used while holding mmu_lock. The immediate BUG_ON() makes the code unnecessarily explosive and led to confusing minimums be

[PATCH v2 06/21] KVM: x86/mmu: Move fast_page_fault() call above mmu_topup_memory_caches()

2020-06-22 Thread Sean Christopherson
Avoid refilling the memory caches and potentially slow reclaim/swap when handling a fast page fault, which does not need to allocate any new objects. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v2 00/21] KVM: Cleanup and unify kvm_mmu_memory_cache usage

2020-06-22 Thread Sean Christopherson
Note, patch 18 will conflict with the p4d rework in 5.8. I originally stated I would send v2 only after that got pulled into Paolo's tree, but I got my timing wrong, i.e. I was thinking that would have already happened. I'll send v3 if necessary. I wanted to get v2 out there now that I actually

[PATCH v2 03/21] KVM: x86/mmu: Use consistent "mc" name for kvm_mmu_memory_cache locals

2020-06-22 Thread Sean Christopherson
Use "mc" for local variables to shorten line lengths and provide consistent names, which will be especially helpful when some of the helpers are moved to common KVM code in future patches. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kv

[PATCH v2 02/21] KVM: x86/mmu: Consolidate "page" variant of memory cache helpers

2020-06-22 Thread Sean Christopherson
Drop the "page" variants of the topup/free memory cache helpers, using the existence of an associated kmem_cache to select the correct alloc or free routine. No functional change intended. Reviewed-by: Ben Gardon Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 37 +++---

Re: [PATCH] ima_evm_utils: extended calc_bootaggr to PCRs 8 - 9

2020-06-22 Thread Mimi Zohar
On Thu, 2020-06-18 at 16:11 -0400, Maurizio Drocco wrote: > From: Maurizio > > If PCRs 8 - 9 are set (i.e. not all-zeros), cal_bootaggr should include > them into the digest. > > Signed-off-by: Maurizio Drocco > --- > src/evmctl.c | 16 +++- > 1 file changed, 15 insertions(+), 1 de

Re: [PATCH] Replace HTTP links with HTTPS ones: Documentation/process

2020-06-22 Thread Alexander A. Klimov
Am 22.06.20 um 22:06 schrieb Miguel Ojeda: On Mon, Jun 22, 2020 at 7:29 PM Joe Perches wrote: scripts/get_maintainer.pl --self-test=links has a reachability test using wget. Perhaps a script like that could be used for http:// vs https:// +1 Not sure about `--no-check-certificate` if th

Re: [Linaro-mm-sig] [PATCH 04/18] dma-fence: prime lockdep annotations

2020-06-22 Thread Jerome Glisse
On Mon, Jun 22, 2020 at 08:46:17AM -0300, Jason Gunthorpe wrote: > On Fri, Jun 19, 2020 at 04:31:47PM -0400, Jerome Glisse wrote: > > Not doable as page refcount can change for things unrelated to GUP, with > > John changes we can identify GUP and we could potentialy copy GUPed page > > instead of

Re: [PATCH v2] ima: move APPRAISE_BOOTPARAM dependency on ARCH_POLICY to runtime

2020-06-22 Thread Bruno Meneguele
On Mon, Jun 22, 2020 at 03:28:13PM -0400, Mimi Zohar wrote: > On Mon, 2020-06-22 at 14:27 -0300, Bruno Meneguele wrote: > > IMA_APPRAISE_BOOTPARAM has been marked as dependent on !IMA_ARCH_POLICY in > > compile time, enforcing the appraisal whenever the kernel had the arch > > policy option enabled

[PATCH] btrfs: tests: remove if duplicate in __check_free_space_extents()

2020-06-22 Thread Denis Efremov
num_extents is already checked in the next if condition and can be safely removed. Signed-off-by: Denis Efremov --- fs/btrfs/tests/free-space-tree-tests.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/btrfs/tests/free-space-tree-tests.c b/fs/btrfs/tests/free-space-tree-tests.c index 9

[PATCH] trivial: fix kerneldoc comments

2020-06-22 Thread Julia Lawall
Fix the parameter names in the comment to correspond to those in the function header. Drop comments about return values when there is no return value. Signed-off-by: Julia Lawall --- arch/arm/mach-omap2/omap-secure.c| 2 +- arch/arm/mach-prima2/rtciobrg.c | 2

Re: [PATCH] binder: fix null deref of proc->context

2020-06-22 Thread Todd Kjos
On Mon, Jun 22, 2020 at 1:09 PM Christian Brauner wrote: > > On Mon, Jun 22, 2020 at 01:07:15PM -0700, Todd Kjos wrote: > > The binder driver makes the assumption proc->context pointer is invariant > > after > > initialization (as documented in the kerneldoc header for struct proc). > > However,

[PATCH 5/6] KVM: x86/mmu: Add sptep_to_sp() helper to wrap shadow page lookup

2020-06-22 Thread Sean Christopherson
Introduce sptep_to_sp() to reduce the boilerplate code needed to get the shadow page associated with a spte pointer, and to improve readability as it's not immediately obvious that "page_header" is a KVM-specific accessor for retrieving a shadow page. Signed-off-by: Sean Christopherson --- arch/

[PATCH 0/6] KVM: x86/mmu: Files and sp helper cleanups

2020-06-22 Thread Sean Christopherson
Move more files to the mmu/ directory, and an mmu_internal.h to share stuff amongst the mmu/ files, and clean up the helpers for retrieving a shadow page from a sptep and/or hpa. Sean Christopherson (6): KVM: x86/mmu: Move mmu_audit.c and mmutrace.h into the mmu/ sub-directory KVM: x86/mmu

[PATCH 2/6] KVM: x86/mmu: Move kvm_mmu_available_pages() into mmu.c

2020-06-22 Thread Sean Christopherson
Move kvm_mmu_available_pages() from mmu.h to mmu.c, it has a single caller and has no business being exposed via mmu.h. Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu.h | 9 - arch/x86/kvm/mmu/mmu.c | 9 + 2 files changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 1/6] KVM: x86/mmu: Move mmu_audit.c and mmutrace.h into the mmu/ sub-directory

2020-06-22 Thread Sean Christopherson
Move mmu_audit.c and mmutrace.h under mmu/ where they belong. Signed-off-by: Sean Christopherson --- arch/x86/kvm/{ => mmu}/mmu_audit.c | 0 arch/x86/kvm/{ => mmu}/mmutrace.h | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename arch/x86/kvm/{ => mmu}/mmu_audit.c (100%) rename arch/x8

[PATCH 3/6] KVM: x86/mmu: Add MMU-internal header

2020-06-22 Thread Sean Christopherson
Add mmu/mmu_internal.h to hold declarations and definitions that need to be shared between various mmu/ files, but should not be used by anything outside of the MMU. Begin populating mmu_internal.h with declarations of the helpers used by page_track.c. Signed-off-by: Sean Christopherson --- arc

[PATCH 4/6] KVM: x86/mmu: Make kvm_mmu_page definition and accessor internal-only

2020-06-22 Thread Sean Christopherson
Make 'struct kvm_mmu_page' MMU-only, nothing outside of the MMU should be poking into the gory details of shadow pages. Signed-off-by: Sean Christopherson --- arch/x86/include/asm/kvm_host.h | 46 ++- arch/x86/kvm/mmu/mmu_internal.h | 48 ++

[PATCH 6/6] KVM: x86/mmu: Rename page_header() to to_shadow_page()

2020-06-22 Thread Sean Christopherson
Rename KVM's accessor for retrieving a 'struct kvm_mmu_page' from the associated host physical address to better convey what the function is doing. Signed-off-by: Sean Christopherson --- arch/x86/kvm/mmu/mmu.c | 20 ++-- arch/x86/kvm/mmu/mmu_audit.c| 6 +++--- arch/

RE: [Intel-wired-lan] [PATCH][next] ice: Use struct_size() helper

2020-06-22 Thread Allan, Bruce W
> -Original Message- > From: Intel-wired-lan On Behalf Of > Gustavo A. R. Silva > Sent: Friday, June 19, 2020 10:56 AM > To: Kirsher, Jeffrey T ; David S. Miller > ; Jakub Kicinski > Cc: net...@vger.kernel.org; intel-wired-...@lists.osuosl.org; linux- > ker...@vger.kernel.org > Subject: [

[PATCH] dma-remap: Align the size in dma_common_*_remap()

2020-06-22 Thread Eric Auger
Running a guest with a virtio-iommu protecting virtio devices is broken since commit 515e5b6d90d4 ("dma-mapping: use vmap insted of reimplementing it"). Before the conversion, the size was page aligned in __get_vm_area_node(). Doing so fixes the regression. Fixes: 515e5b6d90d4 ("dma-mapping: use v

Re: [PATCH] initrd: Remove erroneous comment

2020-06-22 Thread hpa
On June 19, 2020 5:03:33 PM PDT, ron minnich wrote: >It seems fine to me, but I did not initially object to the use of that >name anyway. hpa, what do you think? > >On Fri, Jun 19, 2020 at 7:31 AM Tom Rini wrote: >> >> Most architectures have been passing the location of an initrd via >the >> ini

Re: [PATCH v3 2/6] remoteproc: k3: Add TI-SCI processor control helper functions

2020-06-22 Thread Suman Anna
Hi Mathieu, On 6/22/20 12:35 PM, Mathieu Poirier wrote: Hi Suman, Apologies for the late reply, this one slipped through the cracks... No problem :) On Fri, Jun 12, 2020 at 05:49:10PM -0500, Suman Anna wrote: Texas Instruments' K3 generation SoCs have specific modules/register spaces use

[PATCH] crypto: ccp - Fix use of merged scatterlists

2020-06-22 Thread John Allen
Running the crypto manager self tests with CONFIG_CRYPTO_MANAGER_EXTRA_TESTS may result in several types of errors when using the ccp-crypto driver: alg: skcipher: cbc-des3-ccp encryption failed on test vector 0; expected_error=0, actual_error=-5 ... alg: skcipher: ctr-aes-ccp decryption overran

Re: [PATCH v3] venus: fix multiple encoder crash

2020-06-22 Thread Doug Anderson
Hi, On Mon, Jun 22, 2020 at 5:16 AM Stanimir Varbanov wrote: > > From: Mansur Alisha Shaik > > Currently we are considering the instances which are available > in core->inst list for load calculation in min_loaded_core() > function, but this is incorrect because by the time we call > decide_core

Re: [PATCH] trivial: fix kerneldoc comments

2020-06-22 Thread Joe Perches
On Mon, 2020-06-22 at 21:37 +0200, Julia Lawall wrote: > Fix the parameter names in the comment to correspond to those in the > function header. > > Drop comments about return values when there is no return value. Done by hand or script? [] > diff --git a/arch/mips/cavium-octeon/executive/cvmx-s

[PATCH] drm/radeon: fix fb_div check in ni_init_smc_spll_table()

2020-06-22 Thread Denis Efremov
clk_s is checked twice in a row in ni_init_smc_spll_table(). fb_div should be checked instead. Fixes: 69e0b57a91ad ("drm/radeon/kms: add dpm support for cayman (v5)") Cc: sta...@vger.kernel.org Signed-off-by: Denis Efremov --- drivers/gpu/drm/radeon/ni_dpm.c | 2 +- 1 file changed, 1 insertion(+

Re: [PATCH 5.7] x86/crypto: aesni: Fix build with LLVM_IAS=1

2020-06-22 Thread Nick Desaulniers
On Mon, Jun 22, 2020 at 8:50 AM Sedat Dilek wrote: > > When building with LLVM_IAS=1 means using Clang's Integrated Assembly (IAS) > from LLVM/Clang >= v10.0.1-rc1+ instead of GNU/as from GNU/binutils > I see the following breakage in Debian/testing AMD64: > > :15:74: error: too many positional ar

Re: [PATCH v6 17/19] mm: memcg/slab: use a single set of kmem_caches for all allocations

2020-06-22 Thread Roman Gushchin
On Mon, Jun 22, 2020 at 12:21:28PM -0700, Shakeel Butt wrote: > On Mon, Jun 8, 2020 at 4:07 PM Roman Gushchin wrote: > > > > Instead of having two sets of kmem_caches: one for system-wide and > > non-accounted allocations and the second one shared by all accounted > > allocations, we can use just

Re: [PATCH] initrd: Remove erroneous comment

2020-06-22 Thread Tom Rini
On Mon, Jun 22, 2020 at 01:02:16PM -0700, ron minnich wrote: > The other thing you ought to consider fixing: > initrd is documented as follows: > > initrd= [BOOT] Specify the location of the initial ramdisk > > for bootloaders only. > > UEFI consumes initrd from the command line

<    3   4   5   6   7   8   9   10   11   12   >