Re: [PATCH v1 3/4] scsi: ufs: add trace events and dump prints for debug

2015-02-03 Thread Steven Rostedt
On Tue, 3 Feb 2015 17:37:19 +0200 Gilad Broner wrote: > Add trace events to driver to allow monitoring and profilig > of activities such as PM suspend/resume, hibernate enter/exit, > clock gating and clock scaling up/down. > In addition, add UFS host controller register dumps to provide > detail

Re: [alsa-devel] [RFC PATCH] ASoC: wm8731: let codec to manage clock by itself

2015-02-03 Thread Lars-Peter Clausen
On 02/03/2015 01:44 PM, Mark Brown wrote: On Tue, Feb 03, 2015 at 08:54:57AM +0100, Manuel Lauss wrote: +wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); +if (IS_ERR(wm8731->mclk)) { +wm8731->mclk = NULL; +dev_warn(&spi->dev, "assuming static MCLK\n"); +} This is br

[PATCH] Input - mt: Fix input_mt_get_slot_by_key

2015-02-03 Thread Benjamin Tissoires
The case occured recently with a touchscreen using twice a slot during a single EV_SYN event: E: 0.288415 # SYN_REPORT (0) -- E: 0.296207 0003 002f # EV_ABS / ABS_MT_SLOT 0 E: 0.296207 0003 0039 -001 # EV_ABS / ABS_MT_TRACKING_ID -

Re: [PATCH] regmap: Fix i2c word access when using SMBus access functions

2015-02-03 Thread Guenter Roeck
On Tue, Feb 03, 2015 at 04:09:28PM +, Mark Brown wrote: > On Tue, Feb 03, 2015 at 06:21:45AM -0800, Guenter Roeck wrote: > > On 02/03/2015 03:42 AM, Mark Brown wrote: > > > >Perhaps it just needs to be more explicit about how it's handling native > > >endian? I didn't spot it. > > > Thinking

Re: [Linaro-mm-sig] [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-02-03 Thread Russell King - ARM Linux
On Tue, Feb 03, 2015 at 05:12:40PM +0100, Arnd Bergmann wrote: > On Tuesday 03 February 2015 15:54:04 Russell King - ARM Linux wrote: > > On Tue, Feb 03, 2015 at 04:31:13PM +0100, Arnd Bergmann wrote: > > > The dma_map_* interfaces assign the virtual addresses internally, > > > using typically eith

Re: [PATCH V2 2/2] spmi: pmic_arb: add support for hw version 2

2015-02-03 Thread Gilad Avidov
Hi Stan, Thank you for the review. On 2/3/2015 2:59 AM, Stanimir Varbanov wrote: Hi Gilad, Thanks for the patch. On 01/31/2015 02:46 AM, Gilad Avidov wrote: Qualcomm PMIC Arbiter version-2 changes from version-1 are: - Some different register offsets. - New channel register space, one per P

[PATCH 4/4] hyperv: netvsc: improve protection against rescind offer

2015-02-03 Thread Vitaly Kuznetsov
The check added in commit c3582a2c4d0b ("hyperv: Add support for vNIC hot removal") is incomplete as there is no synchronization between vmbus_onoffer_rescind() and netvsc_send(). In case we get the offer after we checked out_channel->rescind and before netvsc_send() finishes its job we can get a c

[PATCH 0/4] Drivers: hv: Further protection for the rescind path

2015-02-03 Thread Vitaly Kuznetsov
This series is a continuation of the "Drivers: hv: vmbus: serialize Offer and Rescind offer". I'm trying to address a number of theoretically possible issues with rescind offer handling. All these complications come from the fact that a rescind offer results in vmbus channel being freed and we must

[PATCH 2/4] Drivers: hv: vmbus: do not lose rescind offer on failure in vmbus_process_offer()

2015-02-03 Thread Vitaly Kuznetsov
In case we hit a failure condition in vmbus_process_offer() and a rescind offer was pending for the channel we just do free_channel() so CHANNELMSG_RELID_RELEASED will never be send to the host. We have to follow vmbus_process_rescind_offer() path anyway. To support the change we need to protect

Re: [Linaro-mm-sig] [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-02-03 Thread Russell King - ARM Linux
On Tue, Feb 03, 2015 at 11:22:01AM -0500, Rob Clark wrote: > On Tue, Feb 3, 2015 at 11:12 AM, Arnd Bergmann wrote: > > I agree for the case you are describing here. From what I understood > > from Rob was that he is looking at something more like: > > > > Fig 3 > > CPU--L1cache--L2cache--Memory--I

[PATCH 1/4] Drivers: hv: vmbus: implement get/put usage workflow for vmbus channels

2015-02-03 Thread Vitaly Kuznetsov
free_channel() function frees the channel unconditionally so we need to make sure nobody has any link to it. This is not trivial and there are several examples of races we have: 1) In vmbus_onoffer_rescind() we check for channel existence with relid2channel() and then use it. This can go wrong

[PATCH 3/4] Drivers: hv: vmbus: protect vmbus_get_outgoing_channel() against channel removal

2015-02-03 Thread Vitaly Kuznetsov
list_for_each_safe() we have in vmbus_get_outgoing_channel() works, however, we are not protected against the channel being removed (e.g. after receiving rescind offer). Users of this function (storvsc_do_io() is the only one at this moment) can get a link to an already freed channel. Make vmbus_g

[PATCH 1/1 linux-next] fs/ufs/super.c: fix potential race condition

2015-02-03 Thread Fabian Frederick
Let locking subsystem decide on mutex management. As reported by Andrew Morton this patch fixes a bug: " lock_ufs() is assuming that on non-preempt uniprocessor, the calling code will run atomically up to the matching unlock_ufs(). But that isn't true. The very first site I looked at (ufs_frag_ma

Re: [GIT PULL] floppy update

2015-02-03 Thread Jens Axboe
On 02/03/2015 05:11 AM, Jiri Kosina wrote: Hi Jens, please pull from https://urldefense.proofpoint.com/v1/url?u=https://git.kernel.org/pub/scm/linux/kernel/git/jikos/linux-block.git&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=3JMVyziIyZtZ5cv9eWNLwQ%3D%3D%0A&m=HkNxvFOUWWsXyUBdCnKUEvrNBoT9%2FNP9iACxy

Re: [PATCH] iommu/amd: Fix amd_iommu_free_device()

2015-02-03 Thread Jesse Barnes
On Tue, 3 Feb 2015 13:25:51 +0100 Peter Zijlstra wrote: > On Tue, Feb 03, 2015 at 12:27:33PM +0100, Peter Zijlstra wrote: > > drivers/iommu/amd_iommu_v2.c-static void > > put_device_state_wait(struct device_state *dev_state) > > drivers/iommu/amd_iommu_v2.c-{ drivers/iommu/amd_iommu_v2.c- > > DEF

Re: [3.18.3 BISECTED REGRESSION] scx200_acb / cs5535-smb / geodewdt / cs5535-clockevt torpedoed

2015-02-03 Thread Myron Stowe
On Tue, Feb 3, 2015 at 9:50 AM, Bjorn Helgaas wrote: > On Mon, Feb 2, 2015 at 11:36 AM, Nix wrote: >> On 2 Feb 2015, Myron Stowe verbalised: >> >>> Nix: >>> >>> Thanks for the work you've already done with the bisection. Let's see >>> if we can get to the bottom of this. Would you capture two c

Re: [RFC PATCH 0/5] compaction: changing initial position of scanners

2015-02-03 Thread Joonsoo Kim
2015-02-04 0:51 GMT+09:00 Vlastimil Babka : > On 02/03/2015 04:00 PM, Joonsoo Kim wrote: >> 2015-02-03 18:05 GMT+09:00 Vlastimil Babka : >>> On 02/03/2015 07:49 AM, Joonsoo Kim wrote: On Mon, Jan 19, 2015 at 11:05:15AM +0100, Vlastimil Babka wrote: Hello, I don't have any e

[PATCH] media: i2c: ADV7604: Rename adv7604 prefixes.

2015-02-03 Thread Pablo Anton
It is confusing which parts of the driver are adv7604 specific, adv7611 specific or common for both. This patch renames any adv7604 prefixes (both for functions and defines) to adv76xx whenever they are common. Signed-off-by: Pablo Anton Signed-off-by: Jean-Michel Hautbois --- drivers/media/i

Re: [RFC] sched, x86: Prevent resched interrupts if task in kernel mode and !CONFIG_PREEMPT

2015-02-03 Thread Kirill Tkhai
В Пн, 26/01/2015 в 14:58 +0300, Kirill Tkhai пишет: > В Пт, 23/01/2015 в 18:36 -0800, Andy Lutomirski пишет: > > On Fri, Jan 23, 2015 at 9:09 AM, Kirill Tkhai wrote: > > > В Пт, 23/01/2015 в 08:24 -0800, Andy Lutomirski пишет: > > >> On Fri, Jan 23, 2015 at 8:07 AM, Peter Zijlstra > > >> wrote:

Re: [PATCH V2 2/2] spmi: pmic_arb: add support for hw version 2

2015-02-03 Thread Stanimir Varbanov
On 02/03/2015 06:59 PM, Gilad Avidov wrote: > Hi Stan, > > Thank you for the review. > > On 2/3/2015 2:59 AM, Stanimir Varbanov wrote: >> Hi Gilad, >> >> Thanks for the patch. >> >> On 01/31/2015 02:46 AM, Gilad Avidov wrote: >>> Qualcomm PMIC Arbiter version-2 changes from version-1 are: >>> >>>

Re: [PATCH] EDAC: Deletion of unnecessary checks before the function call "pci_dev_put"

2015-02-03 Thread Borislav Petkov
On Mon, Feb 02, 2015 at 07:25:48PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Mon, 2 Feb 2015 18:26:34 +0100 > > The pci_dev_put() function tests whether its argument is NULL and then > returns immediately. Thus the test around the call is not needed. > > This issue was detec

Re: [PATCH 4/5] locking/rwsem: Avoid deceiving lock spinners

2015-02-03 Thread Tim Chen
> > > > > > + if (READ_ONCE(sem->owner)) > > > + return true; /* new owner, continue spinning */ > > > + > > > > Do you have some comparison data of whether it is more advantageous > > to continue spinning when owner changes? After the above change, > > rwsem will behave more like a s

Re: [PATCH v3 00/11] powerpc8xx: Further optimisation of TLB handling

2015-02-03 Thread Scott Wood
On Tue, 2015-02-03 at 12:38 +0100, Christophe Leroy wrote: > This patchset provides a further optimisation of TLB handling in the 8xx. > Main changes are based on: > - Using processor handling of PGD/PTE Validity bits instead of testing > ourselves > the entries validity > - Aligning PGD address t

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Christoph Lameter
On Tue, 3 Feb 2015, Serge E. Hallyn wrote: > We've currently got two proposals. (Three includig yours; but I explained my > problem with yours earlier this morning - do appreciate the proposal and > the patch though, really, thanks) It's worth digging into the details of > each, but if they en

Re: [alsa-devel] [RFC PATCH] ASoC: wm8731: let codec to manage clock by itself

2015-02-03 Thread Russell King - ARM Linux
On Tue, Feb 03, 2015 at 05:53:48PM +0100, Lars-Peter Clausen wrote: > On 02/03/2015 01:44 PM, Mark Brown wrote: > >On Tue, Feb 03, 2015 at 08:54:57AM +0100, Manuel Lauss wrote: > > > >>+wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); > >>+if (IS_ERR(wm8731->mclk)) { > >>+wm8731->mcl

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Christoph Lameter
On Tue, 3 Feb 2015, Serge E. Hallyn wrote: > So again I think the pA seems like an elegant way to work around this. > I'm interested in other ideas, but I worry about the proc solution Christoph > proposed because it would be system- or namespace-wide, rather than > per-process. Ok can we have a

Re: [PATCH v8 09/21] ARM64 / ACPI: Disable ACPI if FADT revision is less than 5.1

2015-02-03 Thread Catalin Marinas
On Mon, Feb 02, 2015 at 12:45:37PM +, Hanjun Guo wrote: > diff --git a/arch/arm64/kernel/acpi.c b/arch/arm64/kernel/acpi.c > index afe10b4..b9f64ec 100644 > --- a/arch/arm64/kernel/acpi.c > +++ b/arch/arm64/kernel/acpi.c > @@ -13,6 +13,8 @@ > * published by the Free Software Foundation. >

Re: [alsa-devel] [RFC PATCH] ASoC: wm8731: let codec to manage clock by itself

2015-02-03 Thread Lars-Peter Clausen
On 02/03/2015 06:17 PM, Russell King - ARM Linux wrote: On Tue, Feb 03, 2015 at 05:53:48PM +0100, Lars-Peter Clausen wrote: On 02/03/2015 01:44 PM, Mark Brown wrote: On Tue, Feb 03, 2015 at 08:54:57AM +0100, Manuel Lauss wrote: +wm8731->mclk = devm_clk_get(&spi->dev, "mclk"); +if (IS_

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Serge E. Hallyn
Quoting Christoph Lameter (c...@linux.com): > On Tue, 3 Feb 2015, Serge E. Hallyn wrote: > > > We've currently got two proposals. (Three includig yours; but I explained > > my > > problem with yours earlier this morning - do appreciate the proposal and > > the patch though, really, thanks) It

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Serge E. Hallyn
Quoting Casey Schaufler (ca...@schaufler-ca.com): > On 2/3/2015 7:51 AM, Serge E. Hallyn wrote: > > Quoting Casey Schaufler (ca...@schaufler-ca.com): > >> On 2/2/2015 12:37 PM, Andy Lutomirski wrote: > >>> On Mon, Feb 2, 2015 at 10:08 AM, Serge Hallyn > >>> wrote: > Quoting Casey Schaufler (

Re: [PATCH] staging: lustre: lustre: lmv: fix sparse warnings about static declarations

2015-02-03 Thread Sudip Mukherjee
On Tue, Feb 03, 2015 at 08:54:45PM +0530, Mohammad Jamal wrote: > This patch adds a static keyword to lprocfs_lmv_init_vars and > lprocfs_lmv_module_vars to suppress the sparse warnings about > static declaration have you build tested your patch? After your patch: drivers/staging/lustre/lustre/lmv

[PATCH] ARM: EXYNOS: Fix failed second suspend on Exynos4

2015-02-03 Thread Krzysztof Kozlowski
On Exynos4412 boards (Trats2, Odroid U3) after enabling L2 cache in 56b60b8bce4a ("ARM: 8265/1: dts: exynos4: Add nodes for L2 cache controller") the second suspend to RAM failed. First suspend worked fine but the next one hang just after powering down of secondary CPUs (system consumed energy as i

[PATCH] ARM: EXYNOS: Handle of_find_device_by_node and kstrdup failures

2015-02-03 Thread Krzysztof Kozlowski
Prevent possible NULL pointer dereference of pointer returned by of_find_device_by_node(). Handle this by skipping such power domain. Additionally fail the init on kstrdup() failure. Such case is actually not fatal because the name for power domain allocated by kstrdup() is used only in printk. St

[PATCH] rc: img-ir: Add and enable sys clock for IR

2015-02-03 Thread Sifan Naeem
Gets a handle to the system clock, already described in the binding document, and calls the appropriate common clock framework functions to mark it prepared/enabled, the common clock framework initially enables the clock and doesn't disable it at least until the device/driver is removed. The system

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Serge E. Hallyn
Quoting Christoph Lameter (c...@linux.com): > On Tue, 3 Feb 2015, Serge E. Hallyn wrote: > > > So again I think the pA seems like an elegant way to work around this. > > I'm interested in other ideas, but I worry about the proc solution Christoph > > proposed because it would be system- or namespa

Re: [PATCH v8 02/21] acpi: fix acpi_os_ioremap for arm64

2015-02-03 Thread Mark Salter
On Mon, 2015-02-02 at 23:14 +0100, Rafael J. Wysocki wrote: > On Monday, February 02, 2015 08:45:30 PM Hanjun Guo wrote: > > From: Mark Salter > > > > The acpi_os_ioremap() function may be used to map normal RAM or IO > > regions. The current implementation simply uses ioremap_cache(). This > > w

Re: [PATCH v1 4/7] thermal: introduce the Power Allocator governor

2015-02-03 Thread Lina Iyer
On Tue, Feb 03 2015 at 08:30 -0700, Eduardo Valentin wrote: On Tue, Feb 03, 2015 at 01:03:37PM +, Javi Merino wrote: On Mon, Feb 02, 2015 at 11:51:20PM +, Lina Iyer wrote: > On Wed, Jan 28 2015 at 14:42 -0700, Javi Merino wrote: > >The power allocator governor is a thermal governor that

Re: [PATCH] staging: sm7xxfb: make smtc_scr_info static

2015-02-03 Thread Sudip Mukherjee
On Tue, Feb 03, 2015 at 02:44:28PM +0600, Max Perepelitsyn wrote: > This symbol is never used anywhere else besides sm7xxfb.c > > Signed-off-by: Max Perepelitsyn Tested-by: Sudip Mukherjee > --- > drivers/staging/sm7xxfb/sm7xxfb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > d

Re: [PATCH] iommu/amd: Fix amd_iommu_free_device()

2015-02-03 Thread Joerg Roedel
Hi Peter, On Tue, Feb 03, 2015 at 01:25:51PM +0100, Peter Zijlstra wrote: > Subject: iommu/amd: Fix amd_iommu_free_device() > > put_device_state_wait() doesn't loop on the condition and a spurious > wakeup will have it free the device state even though there might still > be references out to it.

Re: [PATCH v13 5/6] clkdev: Export clk_register_clkdev

2015-02-03 Thread Andy Shevchenko
On Fri, Jan 23, 2015 at 1:03 PM, Tomeu Vizoso wrote: > So it can be used from modules such as clk-test.ko. > > Signed-off-by: Tomeu Vizoso > Reviewed-by: Stephen Boyd Sorry for late answer, but this is useless. We have to provide the way how to get the allocated clk_lookup. Otherwise you have

Re: [Linaro-mm-sig] [RFCv3 2/2] dma-buf: add helpers for sharing attacher constraints with dma-parms

2015-02-03 Thread Rob Clark
On Tue, Feb 3, 2015 at 11:58 AM, Russell King - ARM Linux wrote: > > Okay, but switching contexts is not something which the DMA API has > any knowledge of (so it can't know which context to associate with > which mapping.) While it knows which device, it has no knowledge > (nor is there any way

Re: [nfs] WARNING: CPU: 1 PID: 1392 at kernel/sched/core.c:7300 __might_sleep+0xbd/0xd0()

2015-02-03 Thread Josh Boyer
On Mon, Feb 2, 2015 at 8:43 AM, Trond Myklebust wrote: > On Mon, Feb 2, 2015 at 2:33 AM, Christoph Hellwig wrote: >> >> On Sat, Jan 31, 2015 at 07:19:17PM -0800, Fengguang Wu wrote: >> > Hi Christoph, >> > >> > FYI, this patch discloses an 100% reproducible boot warning. >> > >> > git://git.infra

Re: [PATCH v3 3/4] pinctrl: cygnus: add initial IOMUX driver support

2015-02-03 Thread Dmitry Torokhov
Hi Ray, On Mon, Feb 02, 2015 at 06:01:33PM -0800, Ray Jui wrote: > This adds the initial driver support for the Broadcom Cygnus IOMUX > controller. The Cygnus IOMUX controller supports group based mux > configuration but allows certain pins to be muxed to GPIO individually > > Signed-off-by: Ray

Re: [PATCH] edac: remove dev_attr_sdram_scrub_rate on failure

2015-02-03 Thread Borislav Petkov
On Tue, Feb 03, 2015 at 09:54:41AM +0800, Junjie Mao wrote: Commit message here please. > Signed-off-by: Junjie Mao > --- > drivers/edac/edac_mc_sysfs.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c > index 8e48d32efe37..

[PATCH v11 00/19] Kernel address sanitizer - runtime memory debugger.

2015-02-03 Thread Andrey Ryabinin
KASan is a runtime memory debugger designed to find use-after-free and out-of-bounds bugs. Currently KASAN supported only for x86_64 architecture and requires kernel to be build with SLUB allocator. KASAN uses compile-time instrumentation for checking every memory access, therefore you will need

[PATCH v11 01/19] compiler: introduce __alias(symbol) shortcut

2015-02-03 Thread Andrey Ryabinin
To be consistent with other compiler attributes introduce __alias(symbol) macro expanding into __attribute__((alias(#symbol))) Signed-off-by: Andrey Ryabinin --- include/linux/compiler-gcc.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler

[PATCH v11 07/19] mm: slub: share object_err function

2015-02-03 Thread Andrey Ryabinin
Remove static and add function declarations to linux/slub_def.h so it could be used by kernel address sanitizer. Signed-off-by: Andrey Ryabinin --- include/linux/slub_def.h | 3 +++ mm/slub.c| 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/slub_

[PATCH v11 08/19] mm: slub: introduce metadata_access_enable()/metadata_access_disable()

2015-02-03 Thread Andrey Ryabinin
It's ok for slub to access memory that marked by kasan as inaccessible (object's metadata). Kasan shouldn't print report in that case because these accesses are valid. Disabling instrumentation of slub.c code is not enough to achieve this because slub passes pointer to object's metadata into extern

Re: [Linaro-acpi] [PATCH v8 00/21] Introduce ACPI for ARM64 based on ACPI 5.1

2015-02-03 Thread Al Stone
On 02/03/2015 09:47 AM, Mark Rutland wrote: > On Mon, Feb 02, 2015 at 12:45:28PM +, Hanjun Guo wrote: >> Hi, >> >> This is the v8 of ACPI core patches for ARM64 based on ACPI 5.1, there are >> some updates since v7: >> >> - Add two more documantation to explain why we need ACPI in ARM64 server

Re: [PATCH v13 5/6] clkdev: Export clk_register_clkdev

2015-02-03 Thread Andy Shevchenko
On Tue, Feb 3, 2015 at 7:35 PM, Andy Shevchenko wrote: > On Fri, Jan 23, 2015 at 1:03 PM, Tomeu Vizoso > wrote: >> So it can be used from modules such as clk-test.ko. >> >> Signed-off-by: Tomeu Vizoso >> Reviewed-by: Stephen Boyd > > Sorry for late answer, but this is useless. > > We have to pr

[PATCH v11 05/19] mm: page_alloc: add kasan hooks on alloc and free paths

2015-02-03 Thread Andrey Ryabinin
Add kernel address sanitizer hooks to mark allocated page's addresses as accessible in corresponding shadow region. Mark freed pages as inaccessible. Signed-off-by: Andrey Ryabinin --- include/linux/kasan.h | 6 ++ mm/compaction.c | 2 ++ mm/kasan/kasan.c | 14 ++ mm

[PATCH] spi: img-spfi: same edge bit set to double spfi speeds

2015-02-03 Thread Sifan Naeem
Setting the same edge bit is required for operating at full bitrate programmed into the SPFI control register. Without this bit set the max operating bitrate supported would be half the maximum bitrate supported by the img-spfi block. It's safe to set this bit for all transactions. Signed-off-by:

[PATCH v11 16/19] mm: vmalloc: pass additional vm_flags to __vmalloc_node_range()

2015-02-03 Thread Andrey Ryabinin
For instrumenting global variables KASan will shadow memory backing memory for modules. So on module loading we will need to allocate memory for shadow and map it at address in shadow that corresponds to the address allocated in module_alloc(). __vmalloc_node_range() could be used for this purpose

[PATCH v11 17/19] kernel: add support for .init_array.* constructors

2015-02-03 Thread Andrey Ryabinin
KASan uses constructors for initializing redzones for global variables. Globals instrumentation in GCC 4.9.2 produces constructors with priority (.init_array.00099) Currently kernel ignores such constructors. Only constructors with default priority supported (.init_array) This patch adds support

[PATCH v11 18/19] module: fix types of device tables aliases

2015-02-03 Thread Andrey Ryabinin
MODULE_DEVICE_TABLE() macro used to create aliases to device tables. Normally alias should have the same type as aliased symbol. Device tables are arrays, so they have 'struct type##_device_id[x]' types. Alias created by MODULE_DEVICE_TABLE() will have non-array type - 'struct type##_devic

[PATCH v11 19/19] kasan: enable instrumentation of global variables

2015-02-03 Thread Andrey Ryabinin
This feature let us to detect accesses out of bounds of global variables. This will work as for globals in kernel image, so for globals in modules. Currently this won't work for symbols in user-specified sections (e.g. __init, __read_mostly, ...) The idea of this is simple. Compiler increases each

[PATCH v11 15/19] mm: vmalloc: add flag preventing guard hole allocation

2015-02-03 Thread Andrey Ryabinin
For instrumenting global variables KASan will shadow memory backing memory for modules. So on module loading we will need to allocate memory for shadow and map it at address in shadow that corresponds to the address allocated in module_alloc(). __vmalloc_node_range() could be used for this purpose

[PATCH] [media] stk-webcam: Delete an unnecessary check before the function call "vfree"

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 3 Feb 2015 18:36:35 +0100 The vfree() function performs also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/media/usb/stkwebcam/stk-web

Re: [PATCH v2] hwmon: tmp102: add hibernation callbacks

2015-02-03 Thread Guenter Roeck
On Tue, Feb 03, 2015 at 05:01:58PM +0200, grygorii.stras...@linaro.org wrote: > From: Grygorii Strashko > > Setting a dev_pm_ops suspend/resume pair but not a set of > hibernation functions means those pm functions will not be > called upon hibernation. > Fix this by using SIMPLE_DEV_PM_OPS, whic

[PATCH v11 12/19] lib: add kasan test module

2015-02-03 Thread Andrey Ryabinin
This is a test module doing various nasty things like out of bounds accesses, use after free. It is useful for testing kernel debugging features like kernel address sanitizer. It mostly concentrates on testing of slab allocator, but we might want to add more different stuff here in future (like st

[PATCH v11 14/19] kasan: enable stack instrumentation

2015-02-03 Thread Andrey Ryabinin
Stack instrumentation allows to detect out of bounds memory accesses for variables allocated on stack. Compiler adds redzones around every variable on stack and poisons redzones in function's prologue. Such approach significantly increases stack usage, so all in-kernel stacks size were doubled. S

[PATCH v11 13/19] x86_64: kasan: add interceptors for memset/memmove/memcpy functions

2015-02-03 Thread Andrey Ryabinin
Recently instrumentation of builtin functions calls was removed from GCC 5.0. To check the memory accessed by such functions, userspace asan always uses interceptors for them. So now we should do this as well. This patch declares memset/memmove/memcpy as weak symbols. In mm/kasan/kasan.c we have o

[PATCH v11 10/19] fs: dcache: manually unpoison dname after allocation to shut up kasan's reports

2015-02-03 Thread Andrey Ryabinin
We need to manually unpoison rounded up allocation size for dname to avoid kasan's reports in dentry_string_cmp(). When CONFIG_DCACHE_WORD_ACCESS=y dentry_string_cmp may access few bytes beyound requested in kmalloc() size. dentry_string_cmp() relates on that fact that dentry allocated using kmall

[PATCH v11 06/19] mm: slub: introduce virt_to_obj function.

2015-02-03 Thread Andrey Ryabinin
virt_to_obj takes kmem_cache address, address of slab page, address x pointing somewhere inside slab object, and returns address of the beginning of object. Signed-off-by: Andrey Ryabinin Acked-by: Christoph Lameter --- include/linux/slub_def.h | 16 1 file changed, 16 insertio

[PATCH v11 09/19] mm: slub: add kernel address sanitizer support for slub allocator

2015-02-03 Thread Andrey Ryabinin
With this patch kasan will be able to catch bugs in memory allocated by slub. Initially all objects in newly allocated slab page, marked as redzone. Later, when allocation of slub object happens, requested by caller number of bytes marked as accessible, and the rest of the object (including slub's

[PATCH v11 04/19] x86_64: add KASan support

2015-02-03 Thread Andrey Ryabinin
This patch adds arch specific code for kernel address sanitizer. 16TB of virtual addressed used for shadow memory. It's located in range [ec00 - fc00] between vmemmap and %esp fixup stacks. At early stage we map whole shadow region with zero page. Latter, after pages mappe

Re: [capabilities] Allow normal inheritance for a configurable set of capabilities

2015-02-03 Thread Casey Schaufler
On 2/3/2015 9:28 AM, Serge E. Hallyn wrote: > Quoting Casey Schaufler (ca...@schaufler-ca.com): >> On 2/3/2015 7:51 AM, Serge E. Hallyn wrote: >>> Quoting Casey Schaufler (ca...@schaufler-ca.com): On 2/2/2015 12:37 PM, Andy Lutomirski wrote: > On Mon, Feb 2, 2015 at 10:08 AM, Serge Hallyn

[PATCH v11 11/19] kmemleak: disable kasan instrumentation for kmemleak

2015-02-03 Thread Andrey Ryabinin
kmalloc internally round up allocation size, and kmemleak uses rounded up size as object's size. This makes kasan to complain while kmemleak scans memory or calculates of object's checksum. The simplest solution here is to disable kasan. Signed-off-by: Andrey Ryabinin Acked-by: Catalin Marinas -

Re: [alsa-devel] [RFC PATCH] ASoC: wm8731: let codec to manage clock by itself

2015-02-03 Thread Lars-Peter Clausen
On 02/03/2015 06:26 PM, Lars-Peter Clausen wrote: On 02/03/2015 06:17 PM, Russell King - ARM Linux wrote: On Tue, Feb 03, 2015 at 05:53:48PM +0100, Lars-Peter Clausen wrote: On 02/03/2015 01:44 PM, Mark Brown wrote: On Tue, Feb 03, 2015 at 08:54:57AM +0100, Manuel Lauss wrote: +wm8731->m

[PATCH v11 03/19] kasan: disable memory hotplug

2015-02-03 Thread Andrey Ryabinin
Currently memory hotplug won't work with KASan. As we don't have shadow for hotplugged memory, kernel will crash on the first access to it. To make this work we will need to allocate shadow for new memory. At some future point proper memory hotplug support will be implemented. Until then, print a

[PATCH v11 02/19] Add kernel address sanitizer infrastructure.

2015-02-03 Thread Andrey Ryabinin
Kernel Address sanitizer (KASan) is a dynamic memory error detector. It provides fast and comprehensive solution for finding use-after-free and out-of-bounds bugs. KASAN uses compile-time instrumentation for checking every memory access, therefore GCC >= v4.9.2 required. This patch only adds inf

Re: [PATCH 1/5] WIP: Add syscall unlinkat_s (currently x86* only)

2015-02-03 Thread Theodore Ts'o
On Tue, Feb 03, 2015 at 01:48:56PM +0100, Alexander Holler wrote: > > E.g. my parents are stull successfully using contact lists on paper. These > are still more readable, easier to handle and smaller than any available > electronic replacement. And they have absolutely no problem to destroy an >

Re: [PATCH] iommu: arm-smmu: avoid build warning

2015-02-03 Thread j...@8bytes.org
On Mon, Feb 02, 2015 at 10:20:49AM +, Will Deacon wrote: > On Fri, Jan 30, 2015 at 09:55:55PM +, Arnd Bergmann wrote: > > - reg = (iova & ~0xfff) >> 32; > > + reg = ((u64)iova & ~0xfff) >> 32; > > writel_relaxed(reg, cb_base + ARM_SMMU_CB_ATS1PR_HI); > >

Re: How to fix CDROM/DVD eject mess?

2015-02-03 Thread Theodore Ts'o
On Tue, Feb 03, 2015 at 01:34:32PM +, One Thousand Gnomes wrote: > > By working with people who spent a lot of time with the questions what > > the default behavior of user interfaces should be. Buttons, especially > > physical ones, need to give immediate feedback to the user. If they > > don'

Re: [PATCH 4/5] locking/rwsem: Avoid deceiving lock spinners

2015-02-03 Thread Jason Low
On Tue, 2015-02-03 at 09:16 -0800, Tim Chen wrote: > > > > > > > > + if (READ_ONCE(sem->owner)) > > > > + return true; /* new owner, continue spinning */ > > > > + > > > > > > Do you have some comparison data of whether it is more advantageous > > > to continue spinning when

Re: [PATCH 1/5] WIP: Add syscall unlinkat_s (currently x86* only)

2015-02-03 Thread Alexander Holler
Am 03.02.2015 um 18:48 schrieb Theodore Ts'o: On Tue, Feb 03, 2015 at 01:48:56PM +0100, Alexander Holler wrote: E.g. my parents are stull successfully using contact lists on paper. These are still more readable, easier to handle and smaller than any available electronic replacement. And they ha

Re: [PATCH v3 00/13] locks: saner method for managing file locks

2015-02-03 Thread Mike Marshall
Yes, 131 goes all the way through now... thanks for fixing my code in your thread ... int pvfs2_lock(struct file *filp, int cmd, struct file_lock *fl) { int rc = 0; if (cmd == F_GETLK) posix_test_lock(filp, fl); else rc = posix_lock_file(fil

[PATCH v2 2/2] regmap: Fix i2c word access when using SMBus access functions

2015-02-03 Thread Guenter Roeck
SMBus access functions assume that 16-bit values are formatted as little endian numbers. The direct i2c access functions in regmap, however, assume that 16-bit values are formatted as big endian numbers. As a result, the current code returns different values if an i2c chip's 16-bit registers are ac

[PATCH v2 1/2] regmap: Export regmap_get_val_endian

2015-02-03 Thread Guenter Roeck
We'll need to call it from regmap-i2c.c, which can be built as module. Cc: Jean Delvare Signed-off-by: Guenter Roeck --- v2: New patch drivers/base/regmap/internal.h | 4 drivers/base/regmap/regmap.c | 7 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/bas

Re: [Xen-devel] [PATCH v5 1/2] xen: add xen_is_preemptible_hypercall()

2015-02-03 Thread Luis R. Rodriguez
On Tue, Feb 03, 2015 at 11:05:15AM +, David Vrabel wrote: > On 27/01/15 01:51, Luis R. Rodriguez wrote: > > > > +#ifndef CONFIG_PREEMPT > > +extern struct { char _entry[32]; } preemptible_hypercall_page[]; > > + > > +static inline bool xen_is_preemptible_hypercall(struct pt_regs *regs) > > +{

Re: [nfs] WARNING: CPU: 1 PID: 1392 at kernel/sched/core.c:7300 __might_sleep+0xbd/0xd0()

2015-02-03 Thread Trond Myklebust
On Tue, Feb 3, 2015 at 12:40 PM, Josh Boyer wrote: > On Mon, Feb 2, 2015 at 8:43 AM, Trond Myklebust > wrote: >> On Mon, Feb 2, 2015 at 2:33 AM, Christoph Hellwig wrote: >>> >>> On Sat, Jan 31, 2015 at 07:19:17PM -0800, Fengguang Wu wrote: >>> > Hi Christoph, >>> > >>> > FYI, this patch disclose

[PATCH] [media] au0828: Delete unnecessary checks before the function call "video_unregister_device"

2015-02-03 Thread SF Markus Elfring
From: Markus Elfring Date: Tue, 3 Feb 2015 19:00:25 +0100 The video_unregister_device() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring

Re: [nfs] WARNING: CPU: 1 PID: 1392 at kernel/sched/core.c:7300 __might_sleep+0xbd/0xd0()

2015-02-03 Thread Josh Boyer
On Tue, Feb 3, 2015 at 1:02 PM, Trond Myklebust wrote: > On Tue, Feb 3, 2015 at 12:40 PM, Josh Boyer wrote: >> On Mon, Feb 2, 2015 at 8:43 AM, Trond Myklebust >> wrote: >>> On Mon, Feb 2, 2015 at 2:33 AM, Christoph Hellwig wrote: On Sat, Jan 31, 2015 at 07:19:17PM -0800, Fengguang Wu

[PATCH 1/6 linux-next] FS/AFFS: replace min() with casting/constant suffix by min_t

2015-02-03 Thread Fabian Frederick
This patch prepares for AFFSNAMEMAX definition Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/amigaffs.c | 2 +- fs/affs/dir.c | 2 +- fs/affs/namei.c| 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 51

[PATCH 3/6 linux-next] fs/affs/amigaffs.c: remove else after return

2015-02-03 Thread Fabian Frederick
else is unnecessary after return -ENAMETOOLONG Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/amigaffs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 581a2fb..029e23a 100644 --- a/fs/affs/amigaffs.c +++ b/fs/a

[PATCH 2/6 linux-next] FS/AFFS: define AFFSNAMEMAX to replace constant use

2015-02-03 Thread Fabian Frederick
30 was used all over the place to compare name length against AFFS maximum name length. Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/affs.h | 2 ++ fs/affs/amigaffs.c | 6 +++--- fs/affs/dir.c | 3 ++- fs/affs/namei.c| 16 fs/affs/super.c|

[PATCH 4/6 linux-next] fs/affs/bitmap.c: remove unnecessary return

2015-02-03 Thread Fabian Frederick
return is not needed at the end of function. Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/bitmap.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/affs/bitmap.c b/fs/affs/bitmap.c index c8de511..6751489 100644 --- a/fs/affs/bitmap.c +++ b/fs/affs/bitmap.c @@ -99,7 +99,6 @

[PATCH 5/6 linux-next] fs/affs/inode.c: remove double extern affs_symlink_inode_operations

2015-02-03 Thread Fabian Frederick
affs_symlink_inode_operations was already declared extern in affs.h Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/affs/inode.c b/fs/affs/inode.c index 25cb4b4..6f34510 100644 --- a/fs/affs/inode.c +++ b/fs/affs/inod

[PATCH 6/6 linux-next] fs/affs/super.c: fix switch indentation

2015-02-03 Thread Fabian Frederick
Fix checkpatch error: "ERROR: switch and case should be at the same indent" Cc: Andrew Morton Signed-off-by: Fabian Frederick --- fs/affs/super.c | 66 - 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/fs/affs/super.c b/fs/

[PATCH v1 05/12] x86, alternatives: Use optimized NOPs for padding

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Alternatives allow now for empty old instruction. In this case we go and pad the space with NOPs at assembly time. However, there are the optimal, longer NOPs which should be used. Do that at patching time. Signed-off-by: Borislav Petkov --- arch/x86/kernel/alternative.c

[PATCH v1 12/12] x86, alternative: Cleanup prefetch primitives

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov This is based on a patch originally by hpa. With the current improvements to the alternatives, we can simply use %P1 as a mem8 operand constraint and rely on the toolchain to generate the proper instruction sizes. For example, on 32-bit, where we use an empty old instructio

[PATCH v1 01/12] x86, copy_user: Remove FIX_ALIGNMENT define

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov It is superfluous now so remove it. No object file change before and after. Signed-off-by: Borislav Petkov --- arch/x86/lib/copy_user_64.S | 5 - 1 file changed, 5 deletions(-) diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S index dee945d55594.

[PATCH v1 11/12] x86, alternative: Use alternative_2 in rdtsc_barrier

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov ... now that we have it. Cc: Richard Weinberger Signed-off-by: Borislav Petkov --- arch/x86/include/asm/barrier.h | 6 ++ arch/x86/um/asm/barrier.h | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/arch/x86/include/asm/barrier.h b/arch/x86

[PATCH v1 00/12] x86, alternatives: Instruction padding and more robust JMPs

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov [ Changelog is in version-increasing number so that one can follow the evolution of the patch set in a more natural way (i.e., latest version comes at the end. ] v0: this is something which hpa and I talked about recently: the ability for the alternatives code to

[PATCH v1 04/12] x86, alternatives: Make JMPs more robust

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Up until now we had to pay attention to relative JMPs in alternatives about how their relative offset gets computed so that the jump target is still correct. Or, as it is the case for near CALLs (opcode e8), we still have to go and readjust the offset at patching time. What

[PATCH v1 10/12] x86, alternatives: Convert clear_page_64.S

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Move clear_page() up so that we can get 2-byte forward JMPs when patching: [2.388007] apply_alternatives: feat: 3*32+16, old: (8130adb0, len: 5), repl: (81d0b859, len: 5) [2.390992] 8130adb0: alt_insn: 90 90 90 90 90 [2.393169] recompute

[PATCH v1 03/12] x86, alternatives: Add instruction padding

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Up until now we have always paid attention to make sure the length of the new instruction replacing the old one is at least less or equal to the length of the old instruction. If the new instruction is longer, at the time it replaces the old instruction it will overwrite the

[PATCH v1 06/12] x86, copy_page_64.S: Use generic ALTERNATIVE macro

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov ... instead of the semi-version with the spelled out sections. What is more, make the REP_GOOD version be the default copy_page() version as the majority of the relevant x86 CPUs do set X86_FEATURE_REP_GOOD. Thus, copy_page gets compiled to: 8130af80 : 8130

[PATCH v1 07/12] x86, copy_user_64.S: Convert to ALTERNATIVE_2

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Use the asm macro and drop the locally grown version. Signed-off-by: Borislav Petkov --- arch/x86/lib/copy_user_64.S | 40 ++-- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/c

[PATCH v1 09/12] x86, alternative: Convert X86_INVD_BUG to generic macro

2015-02-03 Thread Borislav Petkov
From: Borislav Petkov Booting a 486 kernel on an AMD guest says: [0.416564] apply_alternatives: feat: 0*32+25, old: (c160a475, len: 5), repl: (c19557d4, len: 5) [0.420009] c160a475: alt_insn: 68 10 35 00 c1 [0.425106] c19557d4: rpl_insn: 68 80 39 00 c1 which looks ok: old insn VA:

<    1   2   3   4   5   6   7   8   9   10   >