[PATCH] ACPI / battery: Fix reporting "Not charging" when capacity is 100%

2018-11-02 Thread João Paulo Rechi Vita
Commit 19fffc8450d4378580a8f019b195c4617083176f fixed reporting "Discharging" on some machines when AC was connected but the battery was not charging. But now on these machines the battery status is reported as "Not charging" even when the battery is fully charged. This commit takes the battery ca

[PATCH] clk: qcom: smd: Add support for QCS404 rpm clocks

2018-11-02 Thread Bjorn Andersson
From: Taniya Das Add rpm smd clocks, PMIC and bus clocks which are required on QCS404 for clients to vote on. Signed-off-by: Taniya Das Signed-off-by: Anu Ramanathan [bjorn: Dropped cxo, voter clocks and static initialization] Signed-off-by: Bjorn Andersson --- .../devicetree/bindings/clock/

Re: /proc/iomem: only expose physical resource addresses to privileged users

2018-11-02 Thread Greg KH
On Fri, Nov 02, 2018 at 12:08:59PM -0700, Mark Salyzyn wrote: > From: Linus Torvalds > > commit 51d7b120418e99d6b3bf8df9eb3cc31e8171dee4 upstream ported to > 3.18.y Now queued up, thanks. greg k-h

Re: [git pull] mount API series

2018-11-02 Thread Gao Xiang
Hi Al, On 2018/11/2 12:07, Al Viro wrote: > On Thu, Nov 01, 2018 at 11:59:23PM +, David Howells wrote: > >> (*) mount-api-core. These are the internal-only patches that add the >> fs_context, the legacy wrapper and the security hooks and make certain >> filesystems make use of it.

Re: [PATCH RFC] hist lookups

2018-11-02 Thread David Miller
From: David Miller Date: Wed, 31 Oct 2018 09:08:16 -0700 (PDT) > From: Jiri Olsa > Date: Wed, 31 Oct 2018 16:39:07 +0100 > >> it'd be great to make hist processing faster, but is your main target here >> to get the load out of the reader thread, so we dont lose events during the >> hist process

Re: [git pull] mount API series

2018-11-02 Thread Gao Xiang
Hi Al, On 2018/11/3 3:42, Al Viro wrote: > On Fri, Nov 02, 2018 at 04:07:01AM +, Al Viro wrote: >> On Thu, Nov 01, 2018 at 11:59:23PM +, David Howells wrote: >> >>> (*) mount-api-core. These are the internal-only patches that add the >>> fs_context, the legacy wrapper and the securi

[PATCH] perf: Remove strchr() in map__process_kallsyms_symbol().

2018-11-02 Thread David Miller
This is looking for '[vdso]', '[vsyscall]' or similar to force the "kernel" boolean arg to __symbols__insert() to false. But such things never show up in kallsyms. This check was added by commit 608c34de0b3d ("perf symbols: Mark if a symbol is idle in the library") Signed-off-by: David S. Mill

[PATCH v4] of: overlay: user space synchronization

2018-11-02 Thread frowand . list
From: Frank Rowand When an overlay is applied or removed, the live devicetree visible in /proc/device-tree/, aka /sys/firmware/devicetree/base/, reflects the changes. There is no method for user space to determine whether the live devicetree was modified by overlay actions. Provide a sysfs file

[PATCH] sched/rt: Remove unnecessary check for next_task in push_rt_task()

2018-11-02 Thread Muchun Song
In push_rt_task(), we call pick_next_pushable_task() to pick next_task before the check. If next_task and rq->curr are equal, which will trigger BUG_ON() in pick_next_pushable_task(). See the following code in pick_next_pushable_task(). static struct task_struct *pick_next_pushable_task(struct r

Re: linux-next: Signed-off-by missing for commit in the arm-soc tree

2018-11-02 Thread Olof Johansson
Looks like I accidentally rebased the fixes branch locally after merging that patch in. Will fixup, thanks for reporting. -Olof On Fri, Nov 2, 2018 at 8:58 PM Stephen Rothwell wrote: > > Hi all, > > Commit > > cda58c80fe27 ("ARM: OMAP1: ams-delta: Fix impossible .irq < 0") > > is missing a Si

Re: [PATCH] arm64: dts: msm8916: remove bogus argument to the cpu clock

2018-11-02 Thread Bjorn Andersson
On Fri 02 Nov 17:57 PDT 2018, Niklas Cassel wrote: > The apcs node has #clock-cells = <0>, which means that those who > references it should specify 0 arguments. > > The apcs reference in the cpu node incorrectly specifies an argument, > remove this bogus argument. > > Fixes: 65afdf458360 ("arm6

[PATCH] arch/sparc: Use kzalloc_node

2018-11-02 Thread Sabyasachi Gupta
Replaced kmalloc_node + memset with kzalloc_node Signed-off-by: Sabyasachi Gupta --- arch/sparc/kernel/iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 40d008b..05eb016 100644 --- a/arch/sparc/kernel/iommu.c

Re: [RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-11-02 Thread Joel Fernandes
On Thu, Nov 01, 2018 at 09:13:07AM -0700, Paul E. McKenney wrote: > On Wed, Oct 31, 2018 at 10:00:19PM -0700, Joel Fernandes wrote: > > On Wed, Oct 31, 2018 at 11:17:48AM -0700, Paul E. McKenney wrote: > > > On Tue, Oct 30, 2018 at 06:11:19PM -0700, Joel Fernandes wrote: > > > > Hi Paul, > > > > >

Re: [PATCH] mm: Create the new vm_fault_t type

2018-11-02 Thread Souptick Joarder
On Sat, Nov 3, 2018 at 10:31 AM Souptick Joarder wrote: > > Page fault handlers are supposed to return VM_FAULT codes, > but some drivers/file systems mistakenly return error > numbers. Now that all drivers/file systems have been converted > to use the vm_fault_t return type, change the type defin

[PATCH] mm: Create the new vm_fault_t type

2018-11-02 Thread Souptick Joarder
Page fault handlers are supposed to return VM_FAULT codes, but some drivers/file systems mistakenly return error numbers. Now that all drivers/file systems have been converted to use the vm_fault_t return type, change the type definition to no longer be compatible with 'int'. By making it an unsign

Re: [PATCH v3] of: overlay: user space synchronization

2018-11-02 Thread Frank Rowand
Hi Rob, First, the point of this patch was to provide a way for userspace (program, command line interface, whatever -- that is orthogonal) to ensure that its view of the devicetree via /proc/device-tree/ is consistent since an overlay apply or remove can alter the devicetree. For in-kernel use,

[PATCH 4/6] tpm: move tpm_validate_commmand() to tpm2-space.c

2018-11-02 Thread Jarkko Sakkinen
Move tpm_validate_command() to tpm2-space.c and make it part of the tpm2_prepare_space() flow. Make cc resolution as part of the TPM space functionality in order to detach it from rest of the tpm_transmit() flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 72 +++---

[PATCH 3/6] tpm: access command header through struct in tpm_try_transmit()

2018-11-02 Thread Jarkko Sakkinen
Instead of accessing fields of the command header through offsets to the raw buffer, it is a better idea to use the header struct pointer that is already used elsewhere in the function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH 5/6] tpm: encapsulate tpm_dev_transmit()

2018-11-02 Thread Jarkko Sakkinen
Encapsulate tpm_transmit() call pattern to tpm_dev_transmit() because it is identically used from two places. Use unlocked version of tpm_transmit() so that we are able to move the calls to tpm2_prepare_space() and tpm2_commit_space() later on to this new function. Signed-off-by: Jarkko Sakkinen

[PATCH 6/6] tpm: move TPM space code out of tpm_transmit()

2018-11-02 Thread Jarkko Sakkinen
Prepare and commit TPM space before and after calling tpm_transmit() instead of doing that inside tpm_transmit(). After this change we can remove TPM_TRANSMIT_NESTED flag. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-dev-common.c | 31 --- drivers/char/tpm/

[PATCH 1/6] tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter

2018-11-02 Thread Jarkko Sakkinen
Since we pass an initialized struct tpm_buf instance in every call site now, it is cleaner to pass that directly to the tpm_transmit_cmd() as the TPM command/response buffer. Fine-tune a little bit tpm_transmit() and tpm_transmit_cmd() comments while doing this. Signed-off-by: Jarkko Sakkinen --

[PATCH 0/6] Detach TPM space code from tpm_transmit() flow

2018-11-02 Thread Jarkko Sakkinen
Make the changes that are needed to detach TPM space code from tpm_transmit() flow so that we do no longer need nested tpm_transmit() calls. Jarkko Sakkinen (6): tpm: use tpm_buf in tpm_transmit_cmd() as the IO parameter tpm: clean up tpm_try_transmit() error handling flow tpm: access comman

[PATCH 2/6] tpm: clean up tpm_try_transmit() error handling flow

2018-11-02 Thread Jarkko Sakkinen
Move locking, locality handling and power management to tpm_transmit() in order to simplify the flow and fix the error message formatting in tpm_try_transmit() to output correct function name by using the '__func__' macro. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 103

linux-next: Signed-off-by missing for commit in the arm-soc tree

2018-11-02 Thread Stephen Rothwell
Hi all, Commit cda58c80fe27 ("ARM: OMAP1: ams-delta: Fix impossible .irq < 0") is missing a Signed-off-by from its committer. -- Cheers, Stephen Rothwell pgpe0FrniLfHl.pgp Description: OpenPGP digital signature

Re: [LKP] [net/ipv6] 4ed591c8ab: kernel_selftests.net.fib-onlink-tests.sh.fail

2018-11-02 Thread David Ahern
On 11/1/18 8:11 PM, kernel test robot wrote: > FYI, we noticed the following commit (built with gcc-7): > > commit: 4ed591c8ab44e711e56b8e021ffaf4f407c045f5 ("net/ipv6: Allow onlink > routes to have a device mismatch if it is the default route") > https://git.kernel.org/cgit/linux/kernel/git/torv

Update

2018-11-02 Thread Bruce Blake
Hello Dear how are you doing today? my name is Bruce Blake, the manager foreign affairs in City Finance Bank, we have a customer here in bank that has not accessed his account for the past 18 years, after some research made about him we found out he was a victim of the crashed mining company in

Re: [PATCH v8] clk: qcom: Add lpass clock controller driver for SDM845

2018-11-02 Thread Taniya Das
Hello Stephen, On 11/2/2018 10:08 PM, Stephen Boyd wrote: Quoting Taniya Das (2018-10-28 00:35:40) Add support for the lpass clock controller found on SDM845 based devices. This would allow lpass peripheral loader drivers to control the clocks to bring the subsystem out of reset. LPASS clocks p

Re: [PATCH 2/2] cpufreq: qcom-hw: Add support for QCOM cpufreq HW driver

2018-11-02 Thread Taniya Das
Hello Stephen, On 10/18/2018 5:02 AM, Stephen Boyd wrote: Quoting Taniya Das (2018-10-11 04:36:01) --- a/drivers/cpufreq/Kconfig.arm +++ b/drivers/cpufreq/Kconfig.arm @@ -121,6 +121,17 @@ config ARM_QCOM_CPUFREQ_KRYO If in doubt, say N. +config ARM_QCOM_CPUFREQ_HW + bool "QCO

[PATCH] trace: fix memory leak in create_filter()

2018-11-02 Thread Takeshi Misawa
In create_filter(), pe variable is leaked. Since commit 80765597bc58 ("tracing: Rewrite filter logic to be simpler and faster"), create_filter_finish() is missing. kmemleak: unreferenced object 0x90148ba9c790 (size 8): comm "bash", pid 1378, jiffies 4294731025 (age 15.258s) hex dump (fir

Re: [PATCH 4.14 106/143] sch_netem: restore skb->dev after dequeuing from the rbtree

2018-11-02 Thread Sasha Levin
On Fri, Nov 02, 2018 at 04:28:04PM -0700, Josh Hunt wrote: On Fri, Nov 2, 2018 at 12:00 PM Greg Kroah-Hartman wrote: 4.14-stable review patch. If anyone has any objections, please let me know. -- Upstream commit bffa72cf7f9d ("net: sk_buff rbnode reorg") got backported as co

Re: [PATCH 4.14 069/143] ARM: tegra: Fix ULPI regression on Tegra20

2018-11-02 Thread Sasha Levin
On Fri, Nov 02, 2018 at 07:56:57PM +, Sudip Mukherjee wrote: Hi Greg, On Fri, Nov 2, 2018 at 6:53 PM Greg Kroah-Hartman wrote: 4.14-stable review patch. If anyone has any objections, please let me know. It seems this has already been reverted upstream: 9bf4e370048d ("ARM: dts: tegra20:

Re: [PATCH 4.14 060/143] net/mlx5: Fix mlx5_get_vector_affinity function

2018-11-02 Thread Sasha Levin
On Fri, Nov 02, 2018 at 07:59:39PM +, Sudip Mukherjee wrote: Hi Greg, On Fri, Nov 2, 2018 at 6:52 PM Greg Kroah-Hartman wrote: 4.14-stable review patch. If anyone has any objections, please let me know. There is another upstream patch which fixes this one. e3ca34880652 ("net/mlx5: Fix

Re: [PATCH 3/3] lockdep: Use line-buffered printk() for lockdep messages.

2018-11-02 Thread Tetsuo Handa
On 2018/11/02 22:36, Peter Zijlstra wrote: > On Fri, Nov 02, 2018 at 10:31:57PM +0900, Tetsuo Handa wrote: >> syzbot is sometimes getting mixed output like below due to concurrent >> printk(). Mitigate such output by using line-buffered printk() API. >> >> RCU used illegally from idle CPU! >> r

[PATCH v2] KEYS: always initialize keyring_index_key::desc_len

2018-11-02 Thread Eric Biggers
From: Eric Biggers syzbot hit the 'BUG_ON(index_key->desc_len == 0);' in __key_link_begin() called from construct_alloc_key() during sys_request_key(), because the length of the key description was never calculated. The problem is that we rely on ->desc_len being initialized by search_process_ke

Re: [PATCH] KEYS: always initialize keyring_index_key::desc_len

2018-11-02 Thread Eric Biggers
On Fri, Nov 02, 2018 at 04:15:10PM -0700, Eric Biggers wrote: > From: Eric Biggers > > syzbot hit the 'BUG_ON(index_key->desc_len == 0);' in __key_link_begin() > called from construct_alloc_key() during sys_request_key(), because the > length of the key description was never calculated. > > The

Re: [PATCH v6 1/3] printk: Add line-buffered printk() API.

2018-11-02 Thread Tetsuo Handa
On 2018/11/02 23:40, Matthew Wilcox wrote: > On Fri, Nov 02, 2018 at 10:31:55PM +0900, Tetsuo Handa wrote: >> get_printk_buffer() tries to assign a "struct printk_buffer" from >> statically preallocated array. get_printk_buffer() returns NULL if >> all "struct printk_buffer" are in use, but t

[PATCH] tpm: move tpm_validate_commmand() to tpm2-space.c

2018-11-02 Thread Jarkko Sakkinen
Move tpm_validate_command() to tpm2-space.c and make it part of the tpm2_prepare_space() flow. Make cc resolution as part of the TPM space functionality in order to detach it from rest of the tpm_transmit() flow. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 72 +++---

Re: [PATCH v15 16/23] x86/sgx: Enumerate and track EPC sections

2018-11-02 Thread Jethro Beekman
On 2018-11-02 16:11, Jarkko Sakkinen wrote: diff --git a/arch/x86/kernel/cpu/intel_sgx.c b/arch/x86/kernel/cpu/intel_sgx.c new file mode 100644 index ..b86aa4111592 --- /dev/null +++ b/arch/x86/kernel/cpu/intel_sgx.c ... +static __init int sgx_page_cache_init(void) +{ + u32 ea

[PATCH] arm64: dts: msm8916: remove bogus argument to the cpu clock

2018-11-02 Thread Niklas Cassel
The apcs node has #clock-cells = <0>, which means that those who references it should specify 0 arguments. The apcs reference in the cpu node incorrectly specifies an argument, remove this bogus argument. Fixes: 65afdf458360 ("arm64: dts: qcom: msm8916: Add CPU frequency scaling support") Signed

[PATCH] tpm: access command header through struct in tpm_try_transmit()

2018-11-02 Thread Jarkko Sakkinen
Instead of accessing fields of the command header through offsets to the raw buffer, it is a better idea to use the header struct pointer that is already used elsewhere in the function. Signed-off-by: Jarkko Sakkinen --- drivers/char/tpm/tpm-interface.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH v3 2/4] arm64: hyperv: Add support for Hyper-V as a hypervisor

2018-11-02 Thread Michael Kelley
Add ARM64-specific code to enable Hyper-V. This code includes: * Detecting Hyper-V and initializing the guest/Hyper-V interface * Setting up Hyper-V's synthetic clocks * Making hypercalls using the HVC instruction * Setting up VMbus and stimer0 interrupts * Setting up kexec and crash handlers This

[PATCH v3 1/4] arm64: hyperv: Add core Hyper-V include files

2018-11-02 Thread Michael Kelley
hyperv-tlfs.h defines Hyper-V interfaces from the Hyper-V Top Level Functional Spec (TLFS). The TLFS is distinctly oriented to x86/x64, and Hyper-V has not separated out the architecture-dependent parts into x86/x64 vs. ARM64. So hyperv-tlfs.h includes information for ARM64 that is not yet formally

[PATCH v3 3/4] Drivers: hv: vmbus: Add hooks for per-CPU IRQ

2018-11-02 Thread Michael Kelley
Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks are in the architecture independent setup and shutdown paths for Hyper-V, and are needed by Linux guests on Hyper-V on ARM64. The x86/x64 implementation is null because VMbus interrupts on x86/x64 don't use an IRQ. Signed-off-by: Mi

[PATCH v3 4/4] Drivers: hv: Enable CONFIG_HYPERV on ARM64

2018-11-02 Thread Michael Kelley
Update drivers/hv/Kconfig so CONFIG_HYPERV can be selected on ARM64, causing the Hyper-V specific code to be built. Signed-off-by: Michael Kelley --- drivers/hv/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig index 97954f5..c3

[PATCH v3 0/4] Subject: Enable Linux guests on Hyper-V on ARM64

2018-11-02 Thread Michael Kelley
This series enables Linux guests running on Hyper-V on ARM64 hardware. New ARM64-specific code in arch/arm64/hyperv initializes Hyper-V, including its synthetic clocks and hypercall mechanism. Existing architecture independent drivers for Hyper-V's VMbus and synthetic devices just work when built f

[git pull] followup fix to work.afs

2018-11-02 Thread Al Viro
Regression fix for net/9p handling of iov_iter; broken by braino when switching to iov_iter_is_kvec() et.al., spotted and fixed by Marc. The following changes since commit 0e9b4a82710220c04100892fb7277b78fd33a747: missing bits of "iov_iter: Separate type from direction and use accessor

Re: [PATCH] copy_{to,from}_user(): fix compile-time sanity checks with gcc -Og

2018-11-02 Thread Changbin Du
On Fri, Nov 02, 2018 at 04:56:58PM +0100, Arnd Bergmann wrote: > When CONFIG_CC_OPTIMIZE_FOR_DEBUGGING is set, we get countless warnings > like > > In function 'check_copy_size', > inlined from 'copy_from_user' at include/linux/uaccess.h:146:6, > inlined from '__copy_siginfo_from_user' at

Re: linux-next: Tree for Oct 31 (vboxguest)

2018-11-02 Thread Changbin Du
On Fri, Nov 02, 2018 at 04:54:25PM +0100, Arnd Bergmann wrote: > On 11/2/18, Masahiro Yamada wrote: > > On Thu, Nov 1, 2018 at 11:32 PM Changbin Du wrote: > >> On Thu, Nov 01, 2018 at 12:32:48PM +0900, Masahiro Yamada wrote: > > > > How about clang? > > > > For clang, -Og might be equivalent to -

Re: linux-next: Tree for Oct 31 (vboxguest)

2018-11-02 Thread Changbin Du
Hi Yamada, >On Fri, Nov 02, 2018 at 05:25:00PM +0900, Masahiro Yamada wrote: >[...] > > > > > > > > diff --git a/drivers/virt/vboxguest/vboxguest_core.c > > > > b/drivers/virt/vboxguest/vboxguest_core.c > > > > index 3093655c7b92..1475ed5ffcde 100644 > > > > --- a/drivers/virt/vboxguest/vboxguest_c

Re: [PATCH v15 02/23] x86/cpufeatures: Add Intel-defined SGX feature bit

2018-11-02 Thread Jarkko Sakkinen
On Sat, Nov 03, 2018 at 12:33:01AM +0100, Borislav Petkov wrote: > On Sat, Nov 03, 2018 at 01:11:01AM +0200, Jarkko Sakkinen wrote: > > From: Kai Huang > > > > X86_FEATURE_SGX reflects whether or not the CPU supports Intel's > > Software Guard eXtensions (SGX). > > > > Signed-off-by: Kai Huang

Re: [PATCH] EDAC: skx_edac: add ACPI dependency

2018-11-02 Thread Borislav Petkov
On Fri, Nov 02, 2018 at 10:39:59AM -0700, Luck, Tony wrote: > On Fri, Nov 02, 2018 at 05:10:13PM +0100, Borislav Petkov wrote: > > On Fri, Nov 02, 2018 at 04:32:06PM +0100, Arnd Bergmann wrote: > > > We cannot currently select ACPI_ADXL without also enabling the top-level > > > ACPI option: > > >

Re: [PATCH 00/10] steal tasks to improve CPU utilization

2018-11-02 Thread Subhra Mazumdar
On 10/22/18 7:59 AM, Steve Sistare wrote: When a CPU has no more CFS tasks to run, and idle_balance() fails to find a task, then attempt to steal a task from an overloaded CPU in the same LLC. Maintain and use a bitmap of overloaded CPUs to efficiently identify candidates. To minimize search t

Re: RFC: userspace exception fixups

2018-11-02 Thread Jann Horn
On Sat, Nov 3, 2018 at 12:32 AM Andy Lutomirski wrote: > On Fri, Nov 2, 2018 at 4:28 PM Jann Horn wrote: > > On Fri, Nov 2, 2018 at 11:04 PM Sean Christopherson > > wrote: > > > On Fri, Nov 02, 2018 at 08:02:23PM +0100, Jann Horn wrote: > > > > On Fri, Nov 2, 2018 at 7:27 PM Sean Christopherson

Re: [GIT PULL] vfs: fix many problems in vfs clone/dedupe implementation

2018-11-02 Thread Dave Chinner
On Fri, Nov 02, 2018 at 09:35:23AM -0700, Linus Torvalds wrote: > On Thu, Nov 1, 2018 at 10:15 PM Dave Chinner wrote: > > > > Can you please pull update containing a rework of the VFS clone and > > dedupe file range infrastructure from the tag listed below? > > I don't love the timing of this at

Re: [PATCH v15 02/23] x86/cpufeatures: Add Intel-defined SGX feature bit

2018-11-02 Thread Borislav Petkov
On Sat, Nov 03, 2018 at 01:11:01AM +0200, Jarkko Sakkinen wrote: > From: Kai Huang > > X86_FEATURE_SGX reflects whether or not the CPU supports Intel's > Software Guard eXtensions (SGX). > > Signed-off-by: Kai Huang This and all the other patches of which you're not the author, need to have yo

Re: RFC: userspace exception fixups

2018-11-02 Thread Andy Lutomirski
On Fri, Nov 2, 2018 at 4:28 PM Jann Horn wrote: > > On Fri, Nov 2, 2018 at 11:04 PM Sean Christopherson > wrote: > > On Fri, Nov 02, 2018 at 08:02:23PM +0100, Jann Horn wrote: > > > On Fri, Nov 2, 2018 at 7:27 PM Sean Christopherson > > > wrote: > > > > On Fri, Nov 02, 2018 at 10:48:38AM -0700,

[PATCH v3 0/7] x86/alternatives: text_poke() fixes

2018-11-02 Thread Nadav Amit
This patch-set addresses some issues that were raised in a recent correspondence and might affect the security and the correctness of code patching. (Note that patching performance is not addressed by this patch-set). The main issue that the patches deal with is the fact that the fixmap PTEs that

[PATCH v3 5/7] x86/alternatives: initializing temporary mm for patching

2018-11-02 Thread Nadav Amit
To prevent improper use of the PTEs that are used for text patching, we want to use a temporary mm struct. We initailize it by copying the init mm. The address that will be used for patching is taken from the lower area that is usually used for the task memory. Doing so prevents the need to freque

[PATCH v3 2/7] x86/jump_label: Use text_poke_early() during early_init

2018-11-02 Thread Nadav Amit
There is no apparent reason not to use text_poke_early() while we are during early-init and we do not patch code that might be on the stack (i.e., we'll return to the middle of the patched code). This appears to be the case of jump-labels, so do so. This is required for the next patches that woul

[PATCH v3 1/7] Fix "x86/alternatives: Lockdep-enforce text_mutex in text_poke*()"

2018-11-02 Thread Nadav Amit
text_mutex is expected to be held before text_poke() is called, but we cannot add a lockdep assertion since kgdb does not take it, and instead *supposedly* ensures the lock is not taken and will not be acquired by any other core while text_poke() is running. The reason for the "supposedly" comment

[PATCH v3 3/7] x86/mm: temporary mm struct

2018-11-02 Thread Nadav Amit
From: Andy Lutomirski Sometimes we want to set a temporary page-table entries (PTEs) in one of the cores, without allowing other cores to use - even speculatively - these mappings. There are two benefits for doing so: (1) Security: if sensitive PTEs are set, temporary mm prevents their use in ot

[PATCH v3 7/7] x86/alternatives: remove text_poke() return value

2018-11-02 Thread Nadav Amit
The return value of text_poke() is meaningless - it is one of the function inputs. One day someone may allow the callers to deal with text_poke() failures, if those actually happen. In the meanwhile, remove the return value. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Reviewed-by: Mas

[PATCH v3 6/7] x86/alternatives: use temporary mm for text poking

2018-11-02 Thread Nadav Amit
text_poke() can potentially compromise the security as it sets temporary PTEs in the fixmap. These PTEs might be used to rewrite the kernel code from other cores accidentally or maliciously, if an attacker gains the ability to write onto kernel memory. Moreover, since remote TLBs are not flushed a

[PATCH v3 4/7] fork: provide a function for copying init_mm

2018-11-02 Thread Nadav Amit
Provide a function for copying init_mm. This function will be later used for setting a temporary mm. Cc: Andy Lutomirski Cc: Kees Cook Cc: Peter Zijlstra Cc: Dave Hansen Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu Signed-off-by: Nadav Amit --- include/linux/sched/task.h | 1

Re: [PATCH 4.14 106/143] sch_netem: restore skb->dev after dequeuing from the rbtree

2018-11-02 Thread Josh Hunt
On Fri, Nov 2, 2018 at 12:00 PM Greg Kroah-Hartman wrote: > > 4.14-stable review patch. If anyone has any objections, please let me know. > > -- > > Upstream commit bffa72cf7f9d ("net: sk_buff rbnode reorg") got > backported as commit 6b921536f170 ("net: sk_buff rbnode reorg") int

Re: RFC: userspace exception fixups

2018-11-02 Thread Jann Horn
On Fri, Nov 2, 2018 at 11:04 PM Sean Christopherson wrote: > On Fri, Nov 02, 2018 at 08:02:23PM +0100, Jann Horn wrote: > > On Fri, Nov 2, 2018 at 7:27 PM Sean Christopherson > > wrote: > > > On Fri, Nov 02, 2018 at 10:48:38AM -0700, Andy Lutomirski wrote: > > > > This whole mechanism seems very

Re: [PATCH 4/6] mm: introduce page->dma_pinned_flags, _count

2018-11-02 Thread John Hubbard
On 10/24/18 4:00 AM, Balbir Singh wrote: > On Fri, Oct 12, 2018 at 05:15:51PM -0700, John Hubbard wrote: >> On 10/12/18 3:56 AM, Balbir Singh wrote: >>> On Thu, Oct 11, 2018 at 11:00:12PM -0700, john.hubb...@gmail.com wrote: From: John Hubbard >> [...] + * Because page->dma_pinned_flags

Re: [PATCH 4.14 000/143] 4.14.79-stable review

2018-11-02 Thread kernelci.org bot
stable-rc/linux-4.14.y boot: 125 boots: 0 failed, 110 passed with 13 offline, 2 untried/unknown (v4.14.78-144-ge862e4c85291) Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.14.y/kernel/v4.14.78-144-ge862e4c85291/ Full Build Summary: https://kernelci.org/build/stabl

Re: [PATCH v2 3/3] ALSA: hda: add support for Huawei WMI MicMute LED

2018-11-02 Thread ayman . bagabas
On Fri, 2018-11-02 at 20:12 +0200, Andy Shevchenko wrote: > On Fri, Nov 2, 2018 at 6:12 AM Ayman Bagabas > wrote: > > > > Some of Huawei laptops come with a LED in the mic mute key. This > > patch > > enables and disable this LED accordingly. > > --- a/drivers/platform/x86/huawei_wmi.c > > +++ b/

[PATCH v15 21/23] x86/sgx: Add a simple swapper for the EPC memory manager

2018-11-02 Thread Jarkko Sakkinen
Wire up the EPC manager's reclaim flow to the SGX driver's swapping functionality. In the long term there will be multiple users of the EPC manager, e.g. SGX driver and KVM, thus the interface between the EPC manager and the driver is fairly genericized and decoupled. But to avoid adding unusued

[PATCH v15 22/23] platform/x86: ptrace() support for the SGX driver

2018-11-02 Thread Jarkko Sakkinen
Add VMA callbacks for ptrace() that can be used with debug enclaves. With debug enclaves data can be read and write the memory word at a time by using ENCLS(EDBGRD) and ENCLS(EDBGWR) leaf instructions. Signed-off-by: Jarkko Sakkinen --- drivers/platform/x86/intel_sgx/sgx_vma.c | 109

[PATCH v15 20/23] platform/x86: sgx: Add swapping functionality to the Intel SGX driver

2018-11-02 Thread Jarkko Sakkinen
Because the kernel is untrusted, swapping pages in/out of the Enclave Page Cache (EPC) has specialized requirements: * The kernel cannot directly access EPC memory, i.e. cannot copy data to/from the EPC. * To evict a page from the EPC, the kernel must "prove" to hardware that are no valid TLB

[PATCH v15 19/23] platform/x86: Intel SGX driver

2018-11-02 Thread Jarkko Sakkinen
Intel Software Guard eXtensions (SGX) is a set of CPU instructions that can be used by applications to set aside private regions of code and data. The code outside the enclave is disallowed to access the memory inside the enclave by the CPU access control. SGX driver provides a ioctl API for loadi

Re: [PATCH 4.14 053/143] x86/power: Fix some ordering bugs in __restore_processor_context()

2018-11-02 Thread Sasha Levin
On Fri, Nov 02, 2018 at 08:19:36PM +, Sudip Mukherjee wrote: Hi Greg, On Fri, Nov 2, 2018 at 6:51 PM Greg Kroah-Hartman wrote: 4.14-stable review patch. If anyone has any objections, please let me know. This has been fixed by another upstream commit: 7ee18d677989 ("x86/power: Make rest

[PATCH v15 18/23] x86/sgx: Add sgx_einit() for initializing enclaves

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Add a helper function to perform ENCLS(EINIT) with the correct LE hash MSR values. ENCLS[EINIT] initializes an enclave, verifying the enclave's measurement and preparing it for execution, i.e. the enclave cannot be run until it has been initialized. The measurement asp

[PATCH v15 15/23] x86/sgx: Add wrappers for ENCLS leaf functions

2018-11-02 Thread Jarkko Sakkinen
ENCLS is an umbrella instruction for a variety of cpl0 SGX functions. The ENCLS function that is executed is specified in EAX, with each function potentially having more leaf-specific operands beyond EAX. ENCLS introduces its own (positive value) error codes that (some) leafs use to return failure

[PATCH v15 17/23] x86/sgx: Add functions to allocate and free EPC pages

2018-11-02 Thread Jarkko Sakkinen
At this time there is no support for reclaiming pages prior to the owner explicitly freeing the page. As for freeing pages, because freeing a page is expected to succeed in the vast majority of cases and because most call sites will not be equipped to handle failure, provide a variant for freeing

[PATCH v15 16/23] x86/sgx: Enumerate and track EPC sections

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Enumerate Enclave Page Cache (EPC) sections via CPUID and add the data structures necessary to track EPC pages so that they can be allocated, freed and managed. As a system may have multiple EPC sections, invoke CPUID on SGX sub-leafs until an invalid leaf is encountere

[PATCH v15 14/23] x86/cpu/intel: Clear SGX_LC capability if not enabled in FEATURE_CONTROL

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Like SGX itself, SGX Launch Control must be explicitly enabled via a flag in IA32_FEATURE_CONTROL. Clear the SGX_LC capability if Launch Control is not fully enabled (or obviously if SGX itself is disabled). Note that clearing X86_FEATURE_SGX_LC creates a bit of a conu

[PATCH v15 13/23] x86/msr: Add SGX Launch Control MSR definitions

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Add a new IA32_FEATURE_CONTROL bit, SGX_LE_WR. When set, SGX_LE_WR allows software to write the SGXLEPUBKEYHASH MSRs (see below). The The existence of the bit is enumerated by CPUID as X86_FEATURE_SGX_LC. Like all other flags in IA32_FEATURE_CONTROL, the MSR must be lo

[PATCH v15 12/23] x86/cpufeatures: Add Intel-defined SGX_LC feature bit

2018-11-02 Thread Jarkko Sakkinen
From: Kai Huang X86_FEATURE_SGX_LC reflects whether or not the CPU supports SGX Launch Control, i.e. enumerates the existence of IA32_FEATURE_CONTROL's SGX_LE_WR bit and the IA32_SGXLEPUBKEYHASH MSRs. Signed-off-by: Kai Huang Signed-off-by: Sean Christopherson --- arch/x86/include/asm/cpufeat

[PATCH v15 11/23] x86/sgx: Add definitions for SGX's CPUID leaf and variable sub-leafs

2018-11-02 Thread Jarkko Sakkinen
SGX defines its own CPUID leaf, 0x12, along with a variable number of sub-leafs. Sub-leafs 0 and 1 are always available if SGX is supported and enumerate various SGX features, e.g. instruction sets and enclave capabilities. Sub-leafs 2+ are variable, both in their existence and in what they enume

[PATCH v15 09/23] x86/sgx: Add ENCLS architectural error codes

2018-11-02 Thread Jarkko Sakkinen
The SGX architecture defines an extensive set of error codes that are used by ENCL{S,U,V} instructions to provide software with (somewhat) precise error information. Though they are architectural, define the known error codes in a separate file from sgx_arch.h so that they can be exposed to usersp

[PATCH v15 10/23] x86/sgx: Add SGX1 and SGX2 architectural data structures

2018-11-02 Thread Jarkko Sakkinen
Define the data structures used by various ENCLS functions needed for Linux to support all SGX1 and SGX2 ENCLS leaf functions. This is not an exhaustive representation of all SGX data structures as several are only consumed by ENCLU (userspace), e.g. REPORT and KEYREQUEST, while others are only co

[PATCH] KEYS: always initialize keyring_index_key::desc_len

2018-11-02 Thread Eric Biggers
From: Eric Biggers syzbot hit the 'BUG_ON(index_key->desc_len == 0);' in __key_link_begin() called from construct_alloc_key() during sys_request_key(), because the length of the key description was never calculated. The problem is that we rely on ->desc_len being initialized by search_process_ke

[PATCH v15 08/23] x86/sgx: Define SGX1 and SGX2 ENCLS leafs

2018-11-02 Thread Jarkko Sakkinen
ENCLS, a.k.a. Enclave System instruction, is an umbrella instruction for a variety of privileged SGX functions. The ENCLS function to be executed is specified in EAX, a la GETSEC of SMX/TXT fame. Leafs may use additional registers for function-specific operands. ENCLS also introduces its own set

[PATCH v15 07/23] x86/mm: x86/sgx: Signal SIGSEGV for userspace #PFs w/ PF_SGX

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson The PF_SGX bit is set if and only if the #PF is detected by the SGX Enclave Page Cache Map (EPCM). The EPCM is a hardware-managed table that enforces accesses to an enclave's EPC pages in addition to the software-managed kernel page tables, i.e. the effective permission

[PATCH v15 06/23] x86/mm: x86/sgx: Add new 'PF_SGX' page fault error code bit

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson The SGX bit is set in the #PF error code if and only if the fault is detected by the Enclave Page Cache Map (EPCM), a hardware-managed table that enforces the paging permissions defined by the enclave, e.g. to prevent the kernel from changing the permissions of an enclav

[PATCH v15 04/23] x86/msr: Add IA32_FEATURE_CONTROL.SGX_ENABLE definition

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Add a new IA32_FEATURE_CONTROL bit, SGX_ENABLE, which must be set in order to execute SGX instructions, i.e. ENCL{S,U,V}. The existence of the bit is enumerated by CPUID as X86_FEATURE_SGX. Like all other flags in IA32_FEATURE_CONTROL, the MSR must be locked for SGX_EN

[PATCH v15 05/23] x86/cpu/intel: Detect SGX support and update caps appropriately

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson Similar to other large Intel features such as VMX and TXT, SGX must be explicitly enabled in IA32_FEATURE_CONTROL MSR to be truly usable. Clear all SGX related capabilities if SGX is not fully enabled in IA32_FEATURE_CONTROL or if the SGX1 instruction set isn't supported

[PATCH v15 03/23] x86/cpufeatures: Add SGX sub-features (as Linux-defined bits)

2018-11-02 Thread Jarkko Sakkinen
From: Sean Christopherson CPUID_12_EAX is an Intel-defined feature bits leaf dedicated for SGX that enumerates the SGX instruction sets that are supported by the CPU, e.g. SGX1, SGX2, etc... Because Linux currently only cares about two bits (SGX1 and SGX2) and there are currently only four docum

[PATCH v15 01/23] x86/sgx: Update MAINTAINERS

2018-11-02 Thread Jarkko Sakkinen
Add the maintainer information for the SGX subsystem. Signed-off-by: Jarkko Sakkinen --- MAINTAINERS | 7 +++ 1 file changed, 7 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 02a39617ec82..a5597a89c7a9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7595,6 +7595,13 @@ L: li

[PATCH v15 02/23] x86/cpufeatures: Add Intel-defined SGX feature bit

2018-11-02 Thread Jarkko Sakkinen
From: Kai Huang X86_FEATURE_SGX reflects whether or not the CPU supports Intel's Software Guard eXtensions (SGX). Signed-off-by: Kai Huang --- arch/x86/include/asm/cpufeatures.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/cpufeatures.h b/arch/x86/include/asm/cpufe

Re: [PATCH v2 1/3] x86: add support for Huawei WMI hotkeys.

2018-11-02 Thread ayman . bagabas
On Fri, 2018-11-02 at 20:20 +0200, Andy Shevchenko wrote: > On Fri, Nov 2, 2018 at 6:11 AM Ayman Bagabas > wrote: > > > > This driver adds support for missing hotkeys on some Huawei > > laptops. > > Currently, only Huawei Matebook X Pro is supported. The driver > > recognizes the following keys:

[PATCH] perf: replace automatic const char[] variables by statics

2018-11-02 Thread Rasmus Villemoes
An automatic const char[] variable gets initialized at runtime, just like any other automatic variable. For long strings, that uses a lot of stack and wastes time building the string; e.g. for the "No %s allocation events..." case one has 444516: 48 b8 4e 6f 20 25 73 20 61 6c movabs $0x6

Re: [GIT PULL] timer for tip/urgent

2018-11-02 Thread Daniel Lezcano
On 02/11/2018 22:01, Thomas Gleixner wrote: > Daniel, > > On Fri, 2 Nov 2018, Daniel Lezcano wrote: > >> this is a late pull request for the c-sky clocksource and clockevent. >> These are new drivers, they passed the review process several times for >> the c-sky architecture. >> >> - Add the per

Re: [PATCH 10/11] x86/fpu: prepare copy_fpstate_to_sigframe for TIF_LOAD_FPU

2018-11-02 Thread Sebastian Andrzej Siewior
On 2018-10-12 12:40:19 [-0700], Dave Hansen wrote: > On 10/04/2018 07:05 AM, Sebastian Andrzej Siewior wrote: > > From: Rik van Riel > > > > If TIF_LOAD_FPU is set, then the registers are saved (not loaded). In that > > case > > we skip the saving part. > > This sentence hurts my brain. > >

Re: [PATCH 4.18 000/150] 4.18.17-stable review

2018-11-02 Thread kernelci.org bot
stable-rc/linux-4.18.y boot: 130 boots: 0 failed, 116 passed with 13 offline, 1 conflict (v4.18.16-151-g8a21f68d3977) Full Boot Summary: https://kernelci.org/boot/all/job/stable-rc/branch/linux-4.18.y/kernel/v4.18.16-151-g8a21f68d3977/ Full Build Summary: https://kernelci.org/build/stable-rc/br

Re: INFO: task hung in grab_super

2018-11-02 Thread Dominique Martinet
Dmitry Vyukov wrote on Fri, Nov 02, 2018: > >> I guess that's the problem, right? SIGKILL-ed task must not ignore > >> SIGKILL and hang in infinite loop. This would explain a bunch of hangs > >> in 9p. > > > > Did you check /proc/18253/task/*/stack after manually sending SIGKILL? > > Yes: > > roo

Re: [PATCH] kconfig: merge_config: avoid false positive matches from comment lines

2018-11-02 Thread Petr Vorel
Hi Masahiro, > The current SED_CONFIG_EXP could match to comment lines in config > fragment files, especially when CONFIG_PREFIX_ is empty. For example, > Buildroot uses empty prefixing; starting symbols with BR2_ is just > convention. > Make the sed expression more robust against false positives

  1   2   3   4   5   6   7   8   >