Re: [PATCH v20 00/28] Intel SGX1 support

2019-05-16 Thread Jarkko Sakkinen
On Thu, May 16, 2019 at 09:51:03AM +0300, Jarkko Sakkinen wrote: > On Thu, May 16, 2019 at 08:07:05AM +0300, Jarkko Sakkinen wrote: > > On Wed, May 15, 2019 at 07:27:02AM -0700, Andy Lutomirski wrote: > > > > > > > On May 15, 2019, at 4:00 AM, Jarkko Sakkinen > > > > wrote: > > > > > > > >> On

Re: [PATCH 4.4 247/266] cpu/speculation: Add mitigations= cmdline option

2019-05-16 Thread Geert Uytterhoeven
Hi Greg, Ben, On Wed, May 15, 2019 at 1:12 PM Greg Kroah-Hartman wrote: > From: Josh Poimboeuf > > commit 98af8452945c55652de68536afdde3b520fec429 upstream. > > Keeping track of the number of mitigations for all the CPU speculation > bugs has become overwhelming for many users. It's getting mor

[PATCH] cpu/speculation: Warn on unsupported mitigations= parameter

2019-05-16 Thread Geert Uytterhoeven
Currently, if the user specifies an unsupported mitigation strategy on the kernel command line, it will be ignored silently. The code will fall back to the default strategy, possibly leaving the system more vulnerable than expected. This may happen due to e.g. a simple typo, or, for a stable kern

Re: [v5 0/3] "Hotremove" persistent memory

2019-05-16 Thread David Hildenbrand
On 16.05.19 02:42, Dan Williams wrote: > On Wed, May 15, 2019 at 11:12 AM Pavel Tatashin > wrote: >> >>> Hi Pavel, >>> >>> I am working on adding this sort of a workflow into a new daxctl command >>> (daxctl-reconfigure-device)- this will allow changing the 'mode' of a >>> dax device to kmem, onli

[tip:x86/urgent] x86/speculation/mds: Revert CPU buffer clear on double fault exit

2019-05-16 Thread tip-bot for Andy Lutomirski
Commit-ID: 88640e1dcd089879530a49a8d212d1814678dfe7 Gitweb: https://git.kernel.org/tip/88640e1dcd089879530a49a8d212d1814678dfe7 Author: Andy Lutomirski AuthorDate: Tue, 14 May 2019 13:24:39 -0700 Committer: Ingo Molnar CommitDate: Thu, 16 May 2019 09:05:11 +0200 x86/speculation/mds: Re

[tip:x86/urgent] x86/speculation/mds: Improve CPU buffer clear documentation

2019-05-16 Thread tip-bot for Andy Lutomirski
Commit-ID: 9d8d0294e78a164d407133dea05caf4b84247d6a Gitweb: https://git.kernel.org/tip/9d8d0294e78a164d407133dea05caf4b84247d6a Author: Andy Lutomirski AuthorDate: Tue, 14 May 2019 13:24:40 -0700 Committer: Ingo Molnar CommitDate: Thu, 16 May 2019 09:05:12 +0200 x86/speculation/mds: Im

[PATCH] arm64: dts: meson: sei510: add bluetooth supplies

2019-05-16 Thread Jerome Brunet
Add bluetooth vbat and vddio power supplies Signed-off-by: Jerome Brunet --- arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-sei510.dts index 61fb30

Re: SGX vs LSM (Re: [PATCH v20 00/28] Intel SGX1 support)

2019-05-16 Thread James Morris
On Wed, 15 May 2019, Andy Lutomirski wrote: > On Wed, May 15, 2019 at 3:46 PM James Morris wrote: > > > > You could try user.sigstruct, which does not require any privs. > > > > I don't think I understand your proposal. What file would this > attribute be on? What would consume it? It would b

[PATCH] MIPS: ralink: add mt7621-clk.h for device tree binding

2019-05-16 Thread Chuanhong Guo
This patch adds dt binding header for mediatek,mt7621-pll which was added in: commit e6046b5e69a0 ("MIPS: ralink: fix cpu clock of mt7621 and add dt clk devices") Signed-off-by: Weijie Gao Signed-off-by: Chuanhong Guo --- checkpatch.pl shows a warning that the line referencing old commit is ov

[PATCH v2 1/6] clk: rockchip: Add supprot to limit input rate for fractional divider

2019-05-16 Thread Elaine Zhang
From: Finley Xiao >From Rockchips fractional divider usage, some clocks can be generated by fractional divider, but the input clock frequency of fractional divider should be less than a specified value. Signed-off-by: Finley Xiao Signed-off-by: Elaine Zhang --- drivers/clk/rockchip/clk-px30.c

[PATCH v2 0/6] clk: rockchip: Support for some new features

2019-05-16 Thread Elaine Zhang
1. Support for some new features 2. fix up some error Chang in V2: [PATCH v2 5/6] : fix up the Register error, and add delay. Elaine Zhang (4): clk: rockchip: fix up the frac clk get rate error clk: rockchip: add a clock-type for muxes based in the pmugrf clk: rockchip: add pll up and down

Re: [PATCH v4 1/3] mm/vmap: keep track of free blocks for vmap allocation

2019-05-16 Thread Uladzislau Rezki
+Tobin C. Harding On Wed, May 15, 2019 at 5:24 PM Uladzislau Rezki wrote: > > Hello, Andrew. > > > An earlier version of this patch was accused of crashing the kernel: > > > > https://lists.01.org/pipermail/lkp/2019-April/010004.html > > > > does the v4 series address this? > I tried before to n

Re: [PATCH] i2c: i2c-stm32f7: fix the get_irq error cases

2019-05-16 Thread Pierre Yves MORDRET
Hi Reviewed-by: Pierre-Yves MORDRET Thanks Regards On 5/15/19 5:09 PM, Fabrice Gasnier wrote: > During probe, return the "get_irq" error value instead of -EINVAL which > allows the driver to be deferred probed if needed. > Fix also the case where of_irq_get() returns a negative value. > Note :

[PATCH v2 6/6] clk: rockchip: support pll setting by auto

2019-05-16 Thread Elaine Zhang
If setting freq is not support in rockchip_pll_rate_table, It can calculate and set pll params by auto. Signed-off-by: Elaine Zhang --- drivers/clk/rockchip/clk-pll.c | 215 ++--- 1 file changed, 200 insertions(+), 15 deletions(-) diff --git a/drivers/clk/roc

[PATCH v2 5/6] clk: rockchip: add pll up and down when change pll freq

2019-05-16 Thread Elaine Zhang
set pll sequence: ->set pll to slow mode or other plls ->set pll down ->set pll params ->set pll up ->wait pll lock status ->set pll to normal mode To slove the system error: wait_pll_lock: timeout waiting for pll to lock pll_set_params: pll update u

[PATCH v2 4/6] clk: rockchip: add a clock-type for muxes based in the pmugrf

2019-05-16 Thread Elaine Zhang
Rockchip socs often have some tiny number of muxes not controlled from the core clock controller but through bits set in the pmugrf. Use MUXPMUGRF() to cover this special clock-type. Signed-off-by: Elaine Zhang --- drivers/clk/rockchip/clk.c | 9 + drivers/clk/rockchip/clk.h | 17 ++

[PATCH v2 3/6] clk: rockchip: add a COMPOSITE_DIV_OFFSET clock-type

2019-05-16 Thread Elaine Zhang
From: Finley Xiao The div offset of some clocks are different from their mux offset and the COMPOSITE clock-type require that div and mux offset are the same, so add a new COMPOSITE_DIV_OFFSET clock-type to handle that. Signed-off-by: Finley Xiao Signed-off-by: Elaine Zhang --- drivers/clk/ro

[PATCH v2 2/6] clk: rockchip: fix up the frac clk get rate error

2019-05-16 Thread Elaine Zhang
support fractional divider with only one level parent clock Signed-off-by: Elaine Zhang --- drivers/clk/rockchip/clk.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/clk/rockchip/clk.c b/drivers/clk/rockchip/clk.c index e04bf300ea0a..0256a99f06f3

Re: [PATCH 4.14 067/115] crypto: testmgr - add AES-CFB tests

2019-05-16 Thread Jinpu Wang
snip > > > > Can you drop the patch? > > Yes, now dropped. Sasha, I think I did this same thing in the past :) Thanks, I remember I probably reported same thing in the past too :) Jack

Re: [PATCH] riscv: fix locking violation in page fault handler

2019-05-16 Thread Andreas Schwab
On Mai 07 2019, Palmer Dabbelt wrote: > LMK if you, or anyone else, has a preference. I'm assuming this will go in > through my tree, so I've picked up my version for now :) You did? Andreas. -- Andreas Schwab, SUSE Labs, sch...@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4

Re: [PATCH] selftests: pidfd: Create .gitignore to include pidfd_test

2019-05-16 Thread Kelsey Skunberg
On Tue, May 14, 2019 at 05:26:25PM -0600, Shuah Khan wrote: > Hi Kelsey, > > On 5/11/19 10:57 PM, Kelsey Skunberg wrote: > > Create /selftests/pidfd/.gitignore which holds the following file name > > created after compiling: > > This patch generates the following checkpatch warning. > > WARNING:

Re: [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs

2019-05-16 Thread Michal Hocko
On Wed 15-05-19 17:15:57, Greg KH wrote: > On Wed, May 15, 2019 at 04:51:51PM +0200, Michal Hocko wrote: > > [Cc Suren and Minchan - the email thread starts here > > 20190514131654.25463-1-oleksa...@redhat.com] > > > > On Wed 15-05-19 08:53:11, Michal Hocko wrote: > > [...] > > > I will try to co

Re: [PATCH] cpu/speculation: Warn on unsupported mitigations= parameter

2019-05-16 Thread Jiri Kosina
On Thu, 16 May 2019, Geert Uytterhoeven wrote: > Currently, if the user specifies an unsupported mitigation strategy on > the kernel command line, it will be ignored silently. The code will > fall back to the default strategy, possibly leaving the system more > vulnerable than expected. Honestly

Re: [PATCH] vsock/virtio: Initialize core virtio vsock before registering the driver

2019-05-16 Thread Stefano Garzarella
On Wed, May 15, 2019 at 04:24:00PM +0100, Stefan Hajnoczi wrote: > On Tue, May 07, 2019 at 02:25:43PM +0200, Stefano Garzarella wrote: > > Hi Jorge, > > > > On Mon, May 06, 2019 at 01:19:55PM -0700, Jorge Moreira Broche wrote: > > > > On Wed, May 01, 2019 at 03:08:31PM -0400, Stefan Hajnoczi wrote

Re: [PATCH RFC v2 0/4] mm/ksm: add option to automerge VMAs

2019-05-16 Thread Greg KH
On Thu, May 16, 2019 at 09:47:13AM +0200, Michal Hocko wrote: > On Wed 15-05-19 17:15:57, Greg KH wrote: > > On Wed, May 15, 2019 at 04:51:51PM +0200, Michal Hocko wrote: > > > [Cc Suren and Minchan - the email thread starts here > > > 20190514131654.25463-1-oleksa...@redhat.com] > > > > > > On W

Re: Question about MDS mitigation

2019-05-16 Thread Liran Alon
Indeed those CPU resources are shared between sibling hyperthreads on same CPU core. There is currently no mechanism merged upstream to completely mitigate SMT-enabled scenarios. Note that this is also true for L1TF. There are several proposal to address this but they are still in early research

[PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread YueHaibing
If spi_register_master fails in spi_bitbang_start because device_add failure, We should return the error code other than 0, otherwise calling spi_bitbang_stop may trigger NULL pointer dereference like this: BUG: KASAN: null-ptr-deref in __list_del_entry_valid+0x45/0xd0 Read of size 8 at addr 0

Re: [PATCH v3 1/1] bsr: do not use assignment in if condition

2019-05-16 Thread Mukesh Ojha
On 5/15/2019 9:47 PM, parna.naveenku...@gmail.com wrote: From: Naveen Kumar Parna checkpatch.pl does not like assignment in if condition Signed-off-by: Naveen Kumar Parna Reviewed-by: Mukesh Ojha Cheers, -Mukesh --- Changes in v3: The first patch has an extra space in if statement, so

[PATCH v2 01/17] locking/lockdep: Add lock type enum to explicitly specify read or write locks

2019-05-16 Thread Yuyang Du
Add an enum to formalize lock types, as those type values now matter. In order to make: LOCK_TYPE_READ & LOCK_TYPE_RECURSIVE != 0 The recursive-read type is set to 3 as opposed to the current 2. Signed-off-by: Yuyang Du --- include/linux/lockdep.h | 45 +

[PATCH v2 02/17] locking/lockdep: Add read-write type for dependency

2019-05-16 Thread Yuyang Du
Direct dependency needs to keep track of its locks' read-write types. A union field is added to lock_list struct so the type is stored there as this: lock_type[1] (u16), lock_type[0] (u16) or: dep_type (int) where value: 0: exclusive / write 1: read 2

[PATCH v2 00/17] Support for read-write lock deadlock detection

2019-05-16 Thread Yuyang Du
Hi Peter and Ingo, Historically, the read-write lock (recursive-read locks included) is not well supported in lockdep. This patchset attempts to solve this problem sound and complete. The bulk of the algorithm is in patch #10, which is actually not complex at all. Hopefully, it simply works. Now

[PATCH v2 10/17] locking/lockdep: Support read-write lock's deadlock detection

2019-05-16 Thread Yuyang Du
A read-write lock is different from an exclusive lock in that read locks can be concurrent, while a write lock is essentially the same as an exclusive lock. Read-write locks have not been well supported for deadlock detection so far. This patch series designs and implements an algorithm to add thi

[PATCH v2 12/17] locking/lockdep: Remove useless lock type assignment

2019-05-16 Thread Yuyang Du
Next lock to acquire has the lock type set already. There is no need to reassign it when it is recursive read. No functional change. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c

[PATCH v2 11/17] locking/lockdep: Adjust lockdep selftest cases

2019-05-16 Thread Yuyang Du
With read-write lock support, some read-write lock cases need to be updated, specifically, some read-lock involved deadlocks are actually not deadlocks. Hope I am not wildly wrong. Signed-off-by: Yuyang Du --- lib/locking-selftest.c | 44 +--- 1 file chang

[PATCH v2 07/17] locking/lockdep: Introduce mark_lock_unaccessed()

2019-05-16 Thread Yuyang Du
Since in graph search, multiple matches may be needed, a matched lock needs to rejoin the search for another match, thereby introduce mark_lock_unaccessed(). Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 9 + 1 file changed, 9 insertions(+) diff --git a/kernel/locking/lockdep.

[PATCH v2 15/17] locking/lockdep: Adjust selftest case for recursive read lock

2019-05-16 Thread Yuyang Du
Now that we support recursive read locks, a previously failed case: | spin |wlock |rlock |mutex | wsem | rsem | ---

Re: [PATCH] staging: rtl8723bs: core: rtw_recv: fix warning Comparison to NULL

2019-05-16 Thread Dan Carpenter
On Wed, May 15, 2019 at 11:15:36PM +0530, Hariprasad Kelam wrote: > @@ -1042,7 +1042,7 @@ sint sta2ap_data_frame( > } > > *psta = rtw_get_stainfo(pstapriv, pattrib->src); > - if (*psta == NULL) { > + if (!*psta == NULL) { ^^^

[PATCH v2 08/17] locking/lockdep: Introduce chain_hlocks_type for held lock's read-write type

2019-05-16 Thread Yuyang Du
Lock chain needs to include information about the read-write lock type. To that end, introduce: chain_hlocks_type[MAX_LOCKDEP_CHAIN_HLOCKS] in addition to: chain_hlocks[MAX_LOCKDEP_CHAIN_HLOCKS] Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 9 + 1 file change

[PATCH v2 09/17] locking/lockdep: Hash held lock's read-write type into chain key

2019-05-16 Thread Yuyang Du
When computing a chain's hash key, we need to consider a held lock's type, so the additional data to use Jenkins hash algorithm is a composite of the new held lock's lock class index (lower 16 bits) and its read-write type (higher 16 bits) as opposed to just class index before: held lock t

[PATCH v2 05/17] locking/lockdep: Rename deadlock check functions

2019-05-16 Thread Yuyang Du
Deadlock checks are performed at two places: - Within current's held lock stack, check for lock recursion deadlock. - Within dependency graph, check for lock inversion deadlock. Rename the two relevant functions for later use. Plus, with read locks, dependency circle in graph is not a sufficien

[PATCH v2 14/17] locking/lockdep: Support recursive read locks

2019-05-16 Thread Yuyang Du
Now we are good to finally support recursive read locks. This is done simply by adding the dependency that has recursive locks to the graph, which previously is skipped. The reason is plainly simple: (a). Recursive read lock differs from read lock only inside a task. (b). check_deadlock_curr

[PATCH v2 03/17] locking/lockdep: Add helper functions to operate on the searched path

2019-05-16 Thread Yuyang Du
- find_lock_in_path() tries to find whether a lock class is in the path. - find_next_dep_in_path() returns the next dependency after a given dependency in the path. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 31 +++ 1 file changed, 31 insertions(+)

[PATCH v2 13/17] locking/lockdep: Add nest lock type

2019-05-16 Thread Yuyang Du
Add a macro LOCK_TYPE_NEST for nest lock type and mark the nested lock in check_deadlock_current(). Unlike the other LOCK_TYPE_* enums, this lock type is used only in lockdep. No functional change. Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 7 +-- kernel/locking/lockd

[PATCH v2 06/17] locking/lockdep: Adjust BFS algorithm to support multiple matches

2019-05-16 Thread Yuyang Du
With read locks, circle is not sufficient condition for a deadlock. As a result, we need to continue the search after a match but the match is not wanted. __bfs() is adjusted to that end. The basic idea is to enqueue a node's children before matching the node. No functional change. Signed-off-by:

[PATCH v2 04/17] locking/lockdep: Update direct dependency's read-write type if it exists

2019-05-16 Thread Yuyang Du
When adding a dependency, if the dependency exists - be it direct or indirect - the dependency's read-write type may be updated. We can keep all different-typed dependencies, but for simplicity we just "upgrade" lock types if possible, making them more exlusive (in the order: recursive read -> rea

[PATCH v2 16/17] locking/lockdep: Add more lockdep selftest cases

2019-05-16 Thread Yuyang Du
Lets make sure our 8 cases can be correctly handled. In contrast, before this patchset, these 8 cases have 24 failures: | spin |wlock |rlock |mutex | wsem | rsem | ---

[PATCH v2 17/17] locking/lockdep: Remove irq-safe to irq-unsafe read check

2019-05-16 Thread Yuyang Du
We have a lockdep warning: WARNING: possible irq lock inversion dependency detected 5.1.0-rc7+ #141 Not tainted kworker/8:2/328 just changed the state of lock: 07f1

Re: [PATCH v2] media/doc: Allow sizeimage to be set by v4l clients

2019-05-16 Thread Stanimir Varbanov
Hi Hans, On 5/14/19 11:54 AM, Hans Verkuil wrote: > Hi Stanimir, > > On 4/12/19 5:59 PM, Stanimir Varbanov wrote: >> This changes v4l2_pix_format and v4l2_plane_pix_format sizeimage >> field description to allow v4l clients to set bigger image size >> in case of variable length compressed data. >

[PATCH 2/4] iio: adc: mediatek: mt6765 upstream driver

2019-05-16 Thread Chun-Hung Wu
1. Add calibrated sample data support 2. Use of_match_table to decide each platform's feature set Signed-off-by: Chun-Hung Wu --- drivers/iio/adc/mt6577_auxadc.c | 54 +++-- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/drivers/iio/adc/mt6

[PATCH 1/4] dt-bindings: iio: adc: mediatek: Add document for mt6765

2019-05-16 Thread Chun-Hung Wu
Add compatible node for mt6765 auxadc Signed-off-by: Chun-Hung Wu --- Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt b/Documentation/devicetree/bindings/iio/adc/mt6577_au

[PATCH 4/4] iio: auxadc: mediatek: change to subsys_initcall

2019-05-16 Thread Chun-Hung Wu
Move auxadc platform_driver_register() from module_init to subsys_initcall because auxadc user drivers are all moudle drivers, need to gurantee auxadc driver ready before module_init. Signed-off-by: Chun-Hung Wu --- drivers/iio/adc/mt6577_auxadc.c | 14 +- 1 file changed, 13 insert

[PATCH 0/4] iio: adc: mediatek: add mt6765 driver support

2019-05-16 Thread Chun-Hung Wu
This patch adds support of auxadc to MT6765 SoC. Chun-Hung Wu (4): dt-bindings: iio: adc: mediatek: Add document for mt6765 iio: adc: mediatek: mt6765 upstream driver iio: adc: mediatek: SET_LATE_SYSTEM_SLEEP_PM_OPS support iio: auxadc: mediatek: change to subsys_initcall .../devicetree/

[PATCH 3/4] iio: adc: mediatek: SET_LATE_SYSTEM_SLEEP_PM_OPS support

2019-05-16 Thread Chun-Hung Wu
Move suspend/resume to late_suspend and early_resume to gurantee users can use auxadc driver at suspend/resume stage. Signed-off-by: Chun-Hung Wu --- drivers/iio/adc/mt6577_auxadc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/mt6577_auxadc.c b/dri

Re: [PATCH v3 2/4] clk: at91: sckc: add support to specify registers bit offsets

2019-05-16 Thread Claudiu.Beznea
On 11.05.2019 00:32, Alexandre Belloni wrote: > On 10/05/2019 11:23:31+, claudiu.bez...@microchip.com wrote: >> From: Claudiu Beznea >> >> Different IPs uses different bit offsets in registers for the same >> functionality, thus adapt the driver to support this. >> >> Signed-off-by: Claudiu

Re: [PATCH] cpu/speculation: Warn on unsupported mitigations= parameter

2019-05-16 Thread Ingo Molnar
* Jiri Kosina wrote: > On Thu, 16 May 2019, Geert Uytterhoeven wrote: > > > Currently, if the user specifies an unsupported mitigation strategy on > > the kernel command line, it will be ignored silently. The code will > > fall back to the default strategy, possibly leaving the system more >

RE: Questions regarding Documentation/media/uapi/v4l/field-order.rst

2019-05-16 Thread Rodin, Michael (Ferchau; ADITG/ESM1)
> On 4/16/19 3:54 PM, Rodin, Michael (Ferchau; ADITG/ESM1) wrote: > > Hi, > > > > I would like to ask several questions regarding the documentation of the > enum "v4l2_field" [1]. > > These questions came up during my investigations of issues with > > interaction between the gstreamer plugin v4l2sr

Re: [PATCH] kernel/hung_task.c: Monitor killed tasks.

2019-05-16 Thread Tetsuo Handa
On 2019/05/15 19:55, Petr Mladek wrote: >> +if (!stamp) { >> +stamp = jiffies; >> +if (!stamp) >> +stamp++; >> +t->killed_time = stamp; >> +return; >> +} > > I might be too dumb but the above code looks pretty tricky to me

Re: [PATCH 0/1] Forced-wakeup for stop lite states on Powernv

2019-05-16 Thread Gautham R Shenoy
Hi Nicholas, On Thu, May 16, 2019 at 04:13:17PM +1000, Nicholas Piggin wrote: > > > The motivation behind this patch was a HPC customer issue where they > > were observing some CPUs in the core getting stuck at stop0_lite > > state, thereby lowering the performance on the other CPUs of the core

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Geert Uytterhoeven
On Thu, May 16, 2019 at 9:57 AM YueHaibing wrote: > If spi_register_master fails in spi_bitbang_start > because device_add failure, We should return the > error code other than 0, otherwise calling > spi_bitbang_stop may trigger NULL pointer dereference > like this: > > BUG: KASAN: null-ptr-deref

[PATCH v1 0/6] KVM: VMX: Intel PT configuration switch using XSAVES/XRSTORS on VM-Entry/Exit

2019-05-16 Thread Luwei Kang
This patch set is mainly used for reduce the overhead of switch Intel PT configuation contex on VM-Entry/Exit by XSAVES/XRSTORS instructions. I measured the cycles number of context witch on Manual and XSAVES/XRSTORES by rdtsc, and the data as below: Manual save(rdmsr): ~334 cycles Manual re

[PATCH v1 1/6] x86/fpu: Introduce new fpu state for Intel processor trace

2019-05-16 Thread Luwei Kang
Introduce new fpu state structure pt_state to save Intel processor trace configuration. The upcoming using XSAVES/XRSTORS to switch the Intel PT configuration on VM-Entry/Exit will use this structure. Signed-off-by: Luwei Kang --- arch/x86/include/asm/fpu/types.h | 13 + 1 file chang

[PATCH v1 3/6] KVM: VMX: Dymamic allocate Intel PT configuration state

2019-05-16 Thread Luwei Kang
This patch change the Intel PT configuration state to structure pointer so that we only need to allocate the state buffer when Intel PT working in HOST_GUEST mode. Signed-off-by: Luwei Kang --- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/vmx.c| 202 +++---

[PATCH v1 4/6] KVM: VMX: Allocate XSAVE area for Intel PT configuration

2019-05-16 Thread Luwei Kang
Allocate XSAVE area for host and guest Intel PT configuration when Intel PT working in HOST_GUEST mode. Intel PT configuration state can be saved using XSAVES and restored by XRSTORS instruction. Signed-off-by: Luwei Kang --- arch/x86/kvm/vmx/vmx.c | 25 - arch/x86/kvm/vm

[PATCH v1 6/6] KVM: VMX: Get PT state from xsave area to variables

2019-05-16 Thread Luwei Kang
This patch get the Intel PT state from xsave area to variables when PT is change from enabled to disabled. Because PT state is saved/restored to/from xsave area by XSAVES/XRSTORES instructions when Intel PT is enabled. The KVM guest may read this MSRs when PT is disabled but the real value is saved

[PATCH v1 2/6] KVM: VMX: Reuse the pt_state structure for PT context

2019-05-16 Thread Luwei Kang
Remove the previous pt_ctx structure and use pt_state to save the PT configuration because they are saved the same things. Add *_ctx postfix to different with the upcoming host and guest fpu pointer for PT state. Signed-off-by: Luwei Kang --- arch/x86/kvm/vmx/nested.c | 2 +- arch/x86/kvm/vmx/v

[PATCH v1 5/6] KVM: VMX: Intel PT configration context switch using XSAVES/XRSTORS

2019-05-16 Thread Luwei Kang
This patch add the support of using XSAVES/XRSTORS to do the Intel processor trace context switch. Because of native driver didn't set the XSS[bit8] to enabled the PT state in xsave area, so this patch only set this bit before XSAVE/XRSTORS intstuction executtion and restore the original value aft

Re: Removal of dump_stack()s from /fs/ubifs/io.c

2019-05-16 Thread Richard Weinberger
- Ursprüngliche Mail - >> They are not required, but they are just useful. While you are right that the >> locations within UBIFS are unique, >> they are not for the whole kernel context. >> Filesystem functions can get called via many different paths from VFS... > > Isn't that true for an

[GIT PULL] configfs update for 5.2

2019-05-16 Thread Christoph Hellwig
The following changes since commit e93c9c99a629c61837d5a7fc2120cd2b6c70dbdd: Linux 5.1 (2019-05-05 17:42:58 -0700) are available in the Git repository at: git://git.infradead.org/users/hch/configfs.git tags/configfs-for-5.2 for you to fetch changes up to 35399f87e271f7cf3048eab00a421a6519ac

Re: [PATCH v3 2/2] media: docs-rst: Document memory-to-memory video encoder interface

2019-05-16 Thread Michael Tretter
On Tue, 14 May 2019 17:12:04 +0900, Tomasz Figa wrote: > Hi Michael, > > On Tue, Apr 30, 2019 at 07:34:12PM +0200, Michael Tretter wrote: > > On Thu, 24 Jan 2019 19:04:19 +0900, Tomasz Figa wrote: > > [snip] > > > > +State machine > > > += > > > + > > > +.. kernel-render:: DOT > >

Re: [PATCH] spi: bitbang: Fix NULL pointer dereference in spi_unregister_master

2019-05-16 Thread Axel Lin
YueHaibing 於 2019年5月16日 週四 下午3:57寫道: > > If spi_register_master fails in spi_bitbang_start > because device_add failure, We should return the > error code other than 0, otherwise calling > spi_bitbang_stop may trigger NULL pointer dereference > like this: Reviewed-by: Axel Lin

Re: [PATCH V3 3/4] arm64/mm: Inhibit huge-vmap with ptdump

2019-05-16 Thread Ard Biesheuvel
On Tue, 14 May 2019 at 11:00, Anshuman Khandual wrote: > > From: Mark Rutland > > The arm64 ptdump code can race with concurrent modification of the > kernel page tables. At the time this was added, this was sound as: > > * Modifications to leaf entries could result in stale information being >

[Patch] hdac_sysfs: Fix a memory leaking bug in sound/hda/hdac_sysfs.c file of Linux 5.1

2019-05-16 Thread Gen Zhang
tree->root and tree->nodes are allocated by memory allocation functions. And tree is also an allocated memory. When allocation of tree->root and tree->nodes fails, not freeing tree will leak memory. Thus we should free tree in this situation. Signed-off-by: Gen Zhang --- diff --git a/sound/hd

Re: [PATCH] vfio-mdev/samples: make some symbols static

2019-05-16 Thread Andy Shevchenko
On Thu, May 16, 2019 at 09:55:26AM +0800, Kefeng Wang wrote: > Make some structs and functions static to fix build warning, parts of > warning shown below, > > amples/vfio-mdev/mtty.c:730:5: warning: symbol 'mtty_create' was not > declared. Should it be static? > samples/vfio-mdev/mtty.c:780:5: w

Re: [PATCH] gcc-plugins: arm_ssp_per_task_plugin: Fix for older GCC < 6

2019-05-16 Thread Ard Biesheuvel
On Sat, 11 May 2019 at 00:42, Doug Anderson wrote: > > Hi, > > > Use gen_rtx_set instead of gen_rtx_SET. The former is a wrapper macro > > that handles the difference between GCC versions implementing > > the latter. > > > > This fixes the following error on my system with g++ 5.4.0 as the host >

Re: [PATCH v3 2/2] media: docs-rst: Document memory-to-memory video encoder interface

2019-05-16 Thread Tomasz Figa
On Thu, May 16, 2019 at 5:37 PM Michael Tretter wrote: > > On Tue, 14 May 2019 17:12:04 +0900, Tomasz Figa wrote: > > Hi Michael, > > > > On Tue, Apr 30, 2019 at 07:34:12PM +0200, Michael Tretter wrote: > > > On Thu, 24 Jan 2019 19:04:19 +0900, Tomasz Figa wrote: > > > > [snip] > > > > > > +State

[PATCH v2 2/7] iommu/vt-d: Duplicate iommu_resv_region objects per device list

2019-05-16 Thread Eric Auger
intel_iommu_get_resv_regions() aims to return the list of reserved regions accessible by a given @device. However several devices can access the same reserved memory region and when building the list it is not safe to use a single iommu_resv_region object, whose container is the RMRR. This iommu_re

Re: [Patch] hdac_sysfs: Fix a memory leaking bug in sound/hda/hdac_sysfs.c file of Linux 5.1

2019-05-16 Thread Takashi Iwai
On Thu, 16 May 2019 10:40:03 +0200, Gen Zhang wrote: > > tree->root and tree->nodes are allocated by memory allocation > functions. And tree is also an allocated memory. When allocation of > tree->root and tree->nodes fails, not freeing tree will leak memory. > Thus we should free tree in this

[PATCH RESEND] ARM: dts: qcom: msm8974-hammerhead: add device tree bindings for vibrator

2019-05-16 Thread Brian Masney
This patch adds device device tree bindings for the vibrator found on the LG Nexus 5 (hammerhead) phone. Signed-off-by: Brian Masney --- This is a resend of the following patch that has missed the last two merge windows: https://lore.kernel.org/lkml/20190206013329.18195-4-masn...@onstation.org/

Re: [PATCH v2] arm64: dts: allwinner: a64: orangepi-win: Add wifi and bluetooth nodes

2019-05-16 Thread Maxime Ripard
On Tue, May 14, 2019 at 10:54:45PM +0200, Jernej Skrabec wrote: > The AP6212 is based on the Broadcom BCM43430 or BCM43438. The WiFi side > identifies as BCM43430, while the Bluetooth side identifies as BCM43438. > > WiFi is connected to mmc1 and the Bluetooth side is connected to UART1 > in a 4 wi

[PATCH v3 01/13] epoll: move private helpers from a header to the source

2019-05-16 Thread Roman Penyaev
Those helpers will access private eventpoll structure in future patches, so keep those helpers close to callers. Nothing important here. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kernel.org diff --git

[PATCH v3 13/13] epoll: implement epoll_create2() syscall

2019-05-16 Thread Roman Penyaev
epoll_create2() is needed to accept EPOLL_USERPOLL flags and size, i.e. this patch wires up polling from userspace. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kernel.org diff --git a/arch/x86/entry/sysc

[PATCH v3 05/13] epoll: offload polling to a work in case of epfd polled from userspace

2019-05-16 Thread Roman Penyaev
Not every device reports pollflags on wake_up(), expecting that it will be polled later. vfs_poll() can't be called from ep_poll_callback(), because ep_poll_callback() is called under the spinlock. Obviously userspace can't call vfs_poll(), thus epoll has to offload vfs_poll() to a work and then

[PATCH v3 03/13] epoll: allocate user header and user events ring for polling from userspace

2019-05-16 Thread Roman Penyaev
This one allocates user header and user events ring according to max items number, passed as a parameter. User events (index) ring is in a pow2. Pages, which will be shared between kernel and userspace, are accounted through user->locked_vm counter. Signed-off-by: Roman Penyaev Cc: Andrew Morton

[PATCH v3 08/13] epoll: support polling from userspace for ep_insert()

2019-05-16 Thread Roman Penyaev
When epfd is polled by userspace and new item is inserted new bit should be get from a bitmap and then user item is set accordingly. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kernel.org diff --git a/fs

[PATCH v3 10/13] epoll: support polling from userspace for ep_modify()

2019-05-16 Thread Roman Penyaev
When epfd is polled from userspace and item is being modified: 1. Update user item with new pointer or poll flags. 2. Add event to user ring if needed. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kernel.

[PATCH v3 11/13] epoll: support polling from userspace for ep_poll()

2019-05-16 Thread Roman Penyaev
Rule of thumb for epfd polled from userspace is simple: epfd has events if ->head != ->tail, no traversing of each item is performed. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kernel.org diff --git a/f

[PATCH v3 06/13] epoll: introduce helpers for adding/removing events to uring

2019-05-16 Thread Roman Penyaev
Both add and remove events are lockless and can be called in parallel. ep_add_event_to_uring(): o user item is marked atomically as ready o if on previous stem user item was observed as not ready, then new entry is created for the index uring. ep_remove_user_item():

[PATCH v3 12/13] epoll: support mapping for epfd when polled from userspace

2019-05-16 Thread Roman Penyaev
User has to mmap user_header and user_index vmalloce'd pointers in order to consume events from userspace. Also we do not let any copies of vma on fork(). Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc: linux-kernel@vger.kern

[PATCH v3 09/13] epoll: support polling from userspace for ep_remove()

2019-05-16 Thread Roman Penyaev
On ep_remove() simply mark a user item with EPOLLREMOVE if the item was ready (i.e. has some bits set). That will prevent further user index entry creation on item ->bit reuse. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc:

[PATCH v3 04/13] epoll: some sanity flags checks for epoll syscalls for polling from userspace

2019-05-16 Thread Roman Penyaev
There are various of limitations if epfd is polled by user: 1. Expect always EPOLLET flag (Edge Triggered behavior) 2. No support for EPOLLWAKEUP events are consumed from userspace, thus no way to call __pm_relax() 3. No support for EPOLLEXCLUSIVE If device does not pass pollfla

[PATCH v3 00/13] epoll: support pollable epoll from userspace

2019-05-16 Thread Roman Penyaev
Hi all, This is v3 which introduces pollable epoll from userspace. v3: - Measurements made, represented below. - Fix alignment for epoll_uitem structure on all 64-bit archs except x86-64. epoll_uitem should be always 16 bit, proper BUILD_BUG_ON is added. (Linus) - Check pollflags expli

[PATCH v3 02/13] epoll: introduce user structures for polling from userspace

2019-05-16 Thread Roman Penyaev
This one introduces structures of user items array: struct epoll_uheader - describes inserted epoll items. struct epoll_uitem - single epoll item visible to userspace. Signed-off-by: Roman Penyaev Cc: Andrew Morton Cc: Al Viro Cc: Linus Torvalds Cc: linux-fsde...@vger.kernel.org Cc:

[PATCH v3 07/13] epoll: call ep_add_event_to_uring() from ep_poll_callback()

2019-05-16 Thread Roman Penyaev
Each ep_poll_callback() is called when fd calls wakeup() on epfd. So account new event in user ring. The tricky part here is EPOLLONESHOT. Since we are lockless we have to be deal with ep_poll_callbacks() called in paralle, thus use cmpxchg to clear public event bits and filter out concurrent cal

Re: [Patch] hdac_sysfs: Fix a memory leaking bug in sound/hda/hdac_sysfs.c file of Linux 5.1

2019-05-16 Thread Gen Zhang
On Thu, May 16, 2019 at 10:49:43AM +0200, Takashi Iwai wrote: > On Thu, 16 May 2019 10:40:03 +0200, > Gen Zhang wrote: > > > > tree->root and tree->nodes are allocated by memory allocation > > functions. And tree is also an allocated memory. When allocation of > > tree->root and tree->nodes fail

RE: [RFC PATCH] kbuild: check uniqueness of basename of modules

2019-05-16 Thread David Laight
From: Masahiro Yamada > Sent: 15 May 2019 18:55 ... > > xargs basename -a -- | sort | ... > > Sorry for my ignorance, but could you > teach me the effect of "--" ? > > I sometimes use "--" as a separator > when there is ambiguity in arguments > for example, "git log -- " > > In this case, w

[PATCH v6 01/12] dt-binding: gce: remove thread-num property

2019-05-16 Thread Bibby Hsieh
"thread-num" is an unused property so we remove it from example. Signed-off-by: Bibby Hsieh Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/mailbox/mtk-gce.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mailbox/mtk-gce.txt b/Documentatio

[PATCH v6 06/12] mailbox: mediatek: cmdq: support mt8183 gce function

2019-05-16 Thread Bibby Hsieh
add mt8183 compatible name for supporting gce function Signed-off-by: Bibby Hsieh Reviewed-by: CK Hu --- drivers/mailbox/mtk-cmdq-mailbox.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 87617dc7504d..6db1e2dd2d

[PATCH v6 08/12] soc: mediatek: cmdq: define the instruction struct

2019-05-16 Thread Bibby Hsieh
Define a instruction structure for gce driver to append command. This structure can make the client's code more readability. Signed-off-by: Bibby Hsieh --- drivers/soc/mediatek/mtk-cmdq-helper.c | 113 +++ include/linux/mailbox/mtk-cmdq-mailbox.h | 2 + include/linux/soc/

[PATCH v6 04/12] dt-binding: gce: add binding for gce event property

2019-05-16 Thread Bibby Hsieh
Client hardware would send event to GCE hardware, mediatek,gce-event-names and mediatek,gce-events can be used to present the event. Signed-off-by: Bibby Hsieh --- Documentation/devicetree/bindings/mailbox/mtk-gce.txt | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Docu

[PATCH v6 10/12] soc: mediatek: cmdq: add cmdq_dev_get_subsys function

2019-05-16 Thread Bibby Hsieh
GCE cannot know the register base address, this function can help cmdq client to get the relationship of subsys and register base address. Signed-off-by: Bibby Hsieh --- drivers/soc/mediatek/mtk-cmdq-helper.c | 25 + include/linux/soc/mediatek/mtk-cmdq.h | 18 +++

  1   2   3   4   5   6   7   8   9   >