Re: [PATCH v6 2/4] of: make __of_attach_node() static

2017-06-21 Thread Stephen Boyd
On 06/20, frowand.l...@gmail.com wrote: > From: Frank Rowand > > __of_attach_node() is not used outside of drivers/of/dynamic.c. Make > it static and remove it from drivers/of/of_private.h. > > Signed-off-by: Frank Rowand > --- Reviewed-by: Stephen Boyd -- Qualcomm Innovation Center, Inc.

Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG

2017-06-21 Thread Herbert Xu
On Wed, Jun 21, 2017 at 08:48:55AM +0200, Maxime Ripard wrote: > On Tue, Jun 20, 2017 at 01:45:36PM +0200, Corentin Labbe wrote: > > On Tue, Jun 20, 2017 at 11:59:47AM +0200, Maxime Ripard wrote: > > > Hi, > > > > > > On Tue, Jun 20, 2017 at 10:58:19AM +0200, Corentin Labbe wrote: > > > > The Secu

Re: [PATCH] random: silence compiler warnings and fix race

2017-06-21 Thread Jeffrey Walton
On Tue, Jun 20, 2017 at 7:38 PM, Theodore Ts'o wrote: > On Tue, Jun 20, 2017 at 11:49:07AM +0200, Jason A. Donenfeld wrote: >> ... >>> I more or less agree with you that we should just turn this on for all >>> users and they'll just have to live with the spam and report odd >>> entries, and overti

Re: [PATCH 1/7] platform/x86: fujitsu-laptop: do not use kfifo for storing hotkey scancodes

2017-06-21 Thread Jonathan Woithe
On Wed, Jun 21, 2017 at 11:15:43AM -0700, Darren Hart wrote: > On Fri, Jun 16, 2017 at 06:40:52AM +0200, Micha?? K??pie?? wrote: > > -#define RINGBUFFERSIZE 40 > > > > /* Debugging */ > > #define FUJLAPTOP_DBG_ERROR 0x0001 > > @@ -146,8 +144,8 @@ struct fujitsu_laptop { > > struct

Re: [PATCH] rtc: ds3232: add temperature support

2017-06-21 Thread kbuild test robot
Hi Kirill, [auto build test ERROR on abelloni/rtc-next] [also build test ERROR on v4.12-rc6 next-20170621] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Kirill-Esipov/rtc-ds3232-add

Re: [PATCH v6 1/4] of: remove *phandle properties from expanded device tree

2017-06-21 Thread Frank Rowand
adding Ben and Paul. Hi Michael, On 06/20/17 21:57, Michael Ellerman wrote: > Hi Frank, > > frowand.l...@gmail.com writes: >> From: Frank Rowand >> >> Remove "phandle", "linux,phandle", and "ibm,phandle" properties from >> the internal device tree. The phandle will still be in the struct >> de

[PATCH 4/4] perf, tools: Add test cases for new data source encoding

2017-06-21 Thread Andi Kleen
From: Andi Kleen Add some simple tests to perf test to test data source printing. v2: Make the tests actually checked for the correct name of Forward v3: Adjust to new encoding Signed-off-by: Andi Kleen --- tools/perf/tests/Build | 1 + tools/perf/tests/builtin-test.c | 4 tool

[PATCH 2/4] perf/x86: Fix data source decoding for Skylake

2017-06-21 Thread Andi Kleen
From: Andi Kleen Skylake changed the encoding of the PEBS data source field. Some combinations are not available anymore, but some new cases e.g. for L4 cache hit are added. Fix up the conversion table for Skylake, similar as had been done for Nehalem. On Skylake server the encoding for L4 actu

Re: [RFC PATCH 2/2] mm, fs: daxfile, an interface for byte-addressable updates to pmem

2017-06-21 Thread Dave Chinner
On Tue, Jun 20, 2017 at 10:18:24PM -0700, Andy Lutomirski wrote: > On Tue, Jun 20, 2017 at 6:40 PM, Dave Chinner wrote: > >> A per-inode > >> count of the number of live DAX mappings or of the number of struct > >> file instances that have requested DAX would work here. > > > > For what purpose do

[PATCH 3/4] perf, tools: Add support for printing new mem_info encodings

2017-06-21 Thread Andi Kleen
From: Andi Kleen Add decoding for the new lvlx and snoopx field meminfo field added earlier to the kernel so that "perf mem report" and other tools can print it properly. v2: Merge with persistent memory patch. Switch to new bit encoding for each combination. v3: Switch to generic lvlnum field.

Fix Skylake PEBS data source for perf

2017-06-21 Thread Andi Kleen
Fix data source reporting for Skylake and Skylake Server. The encodings have changed to express support for L4 and persistent memory. The first patch is a (independent) cleanup. The second is for the kernel and the third for perf/tools. The kernel part and perf tools will compile independently.

[PATCH 1/4] perf/x86: Move Nehalem PEBS code to flag

2017-06-21 Thread Andi Kleen
From: Andi Kleen Minor cleanup: use an explicit x86_pmu flag to handle the missing Lock / TLB information on Nehalem, instead of always checking the model number for each PEBS sample. Signed-off-by: Andi Kleen --- arch/x86/events/intel/core.c | 1 + arch/x86/events/intel/ds.c | 5 + arch

Re: [kernel-hardening] [PATCH] random: warn when kernel uses unseeded randomness

2017-06-21 Thread Jason A. Donenfeld
Hi Ted, On Wed, Jun 21, 2017 at 10:38 PM, Theodore Ts'o wrote: > I agree completely with all of this. The following patch replaces the > current topmost patch on the random.git tree: > For developers who want to work on improving this situation, > CONFIG_WARN_UNSEEDED_RANDOM has been renamed to

Re: [PATCH v6 00/10] Implement NVMe Namespace Descriptor Identification

2017-06-21 Thread Eric W. Biederman
Linus Torvalds writes: > On Fri, Jun 16, 2017 at 6:58 PM, Christoph Hellwig wrote: >> On Fri, Jun 16, 2017 at 11:48:32AM +0200, Johannes Thumshirn wrote: >>> > >>> > Yeah, it's actually there, but for some reason find on sysfs >>> > behaves strange: >>> > >>> > root@testvm:~# find /sys -name uui

[PATCH] exec: Account for argv/envp pointers

2017-06-21 Thread Kees Cook
When limiting the argv/envp strings during exec to 1/4 of the stack limit, the storage of the pointers to the strings was not included. This means that an exec with huge numbers of tiny strings could eat 1/4 of the stack limit in strings and then additional space would be later used by the pointers

RE: [Intel-gfx] [PATCH v9 5/7] vfio: Define vfio based dma-buf operations

2017-06-21 Thread Zhang, Tina
> -Original Message- > From: intel-gvt-dev [mailto:intel-gvt-dev-boun...@lists.freedesktop.org] On > Behalf Of Gerd Hoffmann > Sent: Wednesday, June 21, 2017 7:04 PM > To: Zhang, Tina ; Alex Williamson > > Cc: Wang, Zhenyu Z ; intel- > g...@lists.freedesktop.org; linux-kernel@vger.kernel

Re: linux-next: Tree for Jun 7 (arch/x86/mm/tlb.c: events)

2017-06-21 Thread Stephen Rothwell
Hi Randy, On Wed, 7 Jun 2017 09:26:26 -0700 Randy Dunlap wrote: > > on i386: > > CC arch/x86/mm/tlb.o > In file included from ../include/linux/mm.h:1032:0, > from ../arch/x86/mm/tlb.c:3: > ../arch/x86/mm/tlb.c: In function 'flush_tlb_func_remote': > ../arch/x86/mm/tlb.c:2

Re: [next-20170609] Oops while running CPU off-on (cpuset.c/cpuset_can_attach)

2017-06-21 Thread Stephen Rothwell
Hi all, On Tue, 13 Jun 2017 09:56:41 -0400 Tejun Heo wrote: > > (forwarding to Li w/ full body) > > Li, can you please take a look at this? > > Thanks. > > On Mon, Jun 12, 2017 at 04:53:42PM +0530, Abdul Haleem wrote: > > Hi, > > > > linux-next kernel crashed while running CPU offline and onl

Re: [lkp-robot] [libata] 818831c8b2: kmsg.ata#.#:failed_to_set_xfermode(err_mask=#)

2017-06-21 Thread Stephen Rothwell
Hi all, On Thu, 15 Jun 2017 10:58:54 +0800 kernel test robot wrote: > > FYI, we noticed the following commit: > > commit: 818831c8b22f75353f59a63a484e20736c0567c9 ("libata: implement SECURITY > PROTOCOL IN/OUT") > https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git master > > in

Re: [PATCH] backlight: lm3630a: bump REG_MAX value to 0x50 instead of 0x1F

2017-06-21 Thread kbuild test robot
Hi Bhushan, [auto build test ERROR on v4.12-rc6] [also build test ERROR on next-20170621] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Bhushan-Shah/backlight-lm3630a-bump-REG_MAX-value-to

Re: [PATCH V4 2/2] powerpc/powernv : Add support for OPAL-OCC command/response interface

2017-06-21 Thread Cyril Bur
On Wed, 2017-06-21 at 13:36 +0530, Shilpasri G Bhat wrote: > In P9, OCC (On-Chip-Controller) supports shared memory based > commad-response interface. Within the shared memory there is an OPAL > command buffer and OCC response buffer that can be used to send > inband commands to OCC. This patch add

Re: [lkp-robot] [mm] 1be7107fbe: kernel_BUG_at_mm/mmap.c

2017-06-21 Thread Hugh Dickins
On Wed, 21 Jun 2017, Linus Torvalds wrote: > On Wed, Jun 21, 2017 at 1:56 PM, Oleg Nesterov wrote: > > > > I understand. My point is that this check was invalidated by > > stack-guard-page > > a long ago, and this means that we add the user-visible change now. > > Yeah. I guess we could consider

Re: [PATCH v5 3/3] net/cxgb4: Use new PCI_DEV_FLAGS_NO_RELAXED_ORDERING flag

2017-06-21 Thread Ding Tianhong
On 2017/6/22 2:28, Alexander Duyck wrote: > On Sun, Jun 18, 2017 at 11:53 PM, Ding Tianhong > wrote: >> From: Casey Leedom >> >> cxgb4 Ethernet driver now queries PCIe configuration space to determine >> if it can send TLPs to it with the Relaxed Ordering Attribute set. >> >> Signed-off-by: Ca

Re: [PATCH 0/5] rtlwifi: Neatening

2017-06-21 Thread Joe Perches
On Wed, 2017-06-21 at 13:12 -0500, Larry Finger wrote: > On 06/19/2017 03:18 PM, Joe Perches wrote: [] > In general, I approve of your patches. Unfortunately, they will conflict with > a > number of changes that I am currently making. If you would like, I can merge > your patches, fix the confli

Re: [PATCH] modpost: abort if a module name is too long

2017-06-21 Thread Wanlong Gao
On 2017/6/22 0:09, Jessica Yu wrote: > +++ Jessica Yu [06/06/17 20:41 -0700]: >> +++ Wanlong Gao [06/06/17 09:07 +0800]: >>> >>> >>> On 2017/6/5 10:09, Jessica Yu wrote: +++ Wanlong Gao [02/06/17 11:04 +0800]: > > > On 2017/6/2 7:23, Jessica Yu wrote: >> +++ Wanlong Gao [31/0

Re: [PATCH] powerpc: Only obtain cpu_hotplug_lock if called by rtasd

2017-06-21 Thread Thiago Jung Bauermann
Michael Ellerman writes: > Thiago Jung Bauermann writes: > >> Calling arch_update_cpu_topology from a CPU hotplug state machine callback >> hits a deadlock because the function tries to get a read lock on >> cpu_hotplug_lock while the state machine still holds a write lock on it. >> >> Since all

Re: [PATCH 01/32] ext4: xattr-in-inode support

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:11PM -0700, Tahsin Erdogan wrote: > From: Andreas Dilger > > Large xattr support is implemented for EXT4_FEATURE_INCOMPAT_EA_INODE. > > If the size of an xattr value is larger than will fit in a single > external block, then the xattr value will be saved into the bo

Re: [PATCH] kbuild: fix header installation under fakechroot environment

2017-06-21 Thread Masahiro Yamada
2017-06-15 17:36 GMT+09:00 Richard Genoud : > Since commit fcc8487d477a ("uapi: export all headers under uapi > directories") fakechroot make bindeb-pkg fails, mismatching files for > directories: > touch: cannot touch 'usr/include/video/uvesafb.h/.install': Not a > directory > > This due to a bug

Re: [PATCH 02/32] ext4: fix lockdep warning about recursive inode locking

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:12PM -0700, Tahsin Erdogan wrote: > Setting a large xattr value may require writing the attribute contents > to an external inode. In this case we may need to lock the xattr inode > along with the parent inode. This doesn't pose a deadlock risk because > xattr inodes a

Re: [PATCH] kbuild: replace genhdr-y with generated-y, deprecating genhdr-y

2017-06-21 Thread Masahiro Yamada
2017-06-09 17:29 GMT+09:00 Masahiro Yamada : > Prior to commit fcc8487d477a ("uapi: export all headers under uapi > directories"), genhdr-y was meant to specify generated UAPI headers. > > - generated-y: generated headers (other than asm-generic wrappers) > - header-y : headers to be exported > -

Re: [PATCH 1/2] kbuild: clang: Disable 'address-of-packed-member' warning

2017-06-21 Thread Masahiro Yamada
2017-05-17 6:32 GMT+09:00 Doug Anderson : > Hi, > > On Fri, Apr 21, 2017 at 2:39 PM, Matthias Kaehlcke wrote: >> clang generates plenty of these warnings in different parts of the code, >> to an extent that the warnings are little more than noise. Disable the >> 'address-of-packed-member' warning.

Re: [PATCH 03/32] ext4: lock inode before calling ext4_orphan_add()

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:13PM -0700, Tahsin Erdogan wrote: > ext4_orphan_add() requires caller to be holding the inode lock. > Add missing lock statements. > > WARNING: CPU: 3 PID: 1806 at fs/ext4/namei.c:2731 ext4_orphan_add+0x4e/0x240 > CPU: 3 PID: 1806 Comm: python Not tainted 4.12.0-rc1

Re: [PATCH 04/32] ext4: do not set posix acls on xattr inodes

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:14PM -0700, Tahsin Erdogan wrote: > We don't need acls on xattr inodes because they are not directly > accessible from user mode. > > Besides lockdep complains about recursive locking of xattr_sem as seen > below. > > = >

Re: [criu] 1M guard page ruined restore

2017-06-21 Thread Hugh Dickins
On Wed, 21 Jun 2017, Dmitry Safonov wrote: > On 06/21/2017 08:31 PM, Oleg Nesterov wrote: > > On 06/21, Dmitry Safonov wrote: > > > > > > The only question I have - how is it connected to guard page? > > > > Because with stack guard page do_page_fault() almost never needs to > > call expand_stack

Re: [Ocfs2-devel] [PATCH] ocfs2: get rid of ocfs2_is_o2cb_active function

2017-06-21 Thread Eric Ren
On 05/22/17 16:17, Gang He wrote: This patch is used to get rid of ocfs2_is_o2cb_active() function, Why? First, we had the similar functions to identify which cluster stack is being used via osb->osb_cluster_stack. Second, the current implementation of ocfs2_is_o2cb_active() function is not total

Re: [PATCH 05/32] ext4: attach jinode after creation of xattr inode

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:15PM -0700, Tahsin Erdogan wrote: > In data=ordered mode jinode needs to be attached to the xattr inode when > writing data to it. Attachment normally occurs during file open for regular > files. Since we are not using file interface to write to the xattr inode, > the

Re: [tip:x86/urgent] x86/mm: Fix boot crash caused by incorrect loop count calculation in sync_global_pgds()

2017-06-21 Thread Dan Williams
[ adding -stable ] The patch below is upstream as commit fc5f9d5f151c "x86/mm: Fix boot crash caused by incorrect loop count calculation in sync_global_pgds()". The referenced bug potentially affects all kaslr enabled kernels with > 512GB of memory. Please apply this patch to all current -stable k

Re: [PATCH 06/32] ext4: ea_inode owner should be the same as the inode owner

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:16PM -0700, Tahsin Erdogan wrote: > Quota charging is based on the ownership of the inode. Currently, the > xattr inode owner is set to the caller which may be different from the > parent inode owner. This is inconsistent with how quota is charged for > xattr block and

Re: [PATCH] rtc: ds3232: add temperature support

2017-06-21 Thread kbuild test robot
Hi Kirill, [auto build test WARNING on abelloni/rtc-next] [also build test WARNING on v4.12-rc6 next-20170621] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Kirill-Esipov/rtc-ds3232-add

Re: [PATCH v2 6/6] ima: Support module-style appended signatures for appraisal

2017-06-21 Thread Mimi Zohar
On Wed, 2017-06-21 at 14:45 -0300, Thiago Jung Bauermann wrote: > Hello Mimi, > > Thanks for your review, and for queuing the other patches in this series. > > Mimi Zohar writes: > > On Wed, 2017-06-07 at 22:49 -0300, Thiago Jung Bauermann wrote: > >> This patch introduces the modsig keyword to

Re: [PATCH 07/32] ext4: call journal revoke when freeing ea_inode blocks

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:17PM -0700, Tahsin Erdogan wrote: > ea_inode contents are treated as metadata, that's why it is journaled > during initial writes. Failing to call revoke during freeing could cause > user data to be overwritten with original ea_inode contents during journal > replay. >

Re: [kernel-hardening] [PATCH] exec: Account for argv/envp pointers

2017-06-21 Thread Rik van Riel
On Wed, 2017-06-21 at 17:17 -0700, Kees Cook wrote: > When limiting the argv/envp strings during exec to 1/4 of the stack > limit, > the storage of the pointers to the strings was not included. This > means > that an exec with huge numbers of tiny strings could eat 1/4 of the > stack limit in strin

[RFC v3 03/23] powerpc: introduce get_hidx_gslot helper

2017-06-21 Thread Ram Pai
Introduce get_hidx_gslot() which returns the slot number of the HPTE in the global hash table. This function will come in handy as we work towards re-arranging the PTE bits in the later patches. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/hash.h | 3 +++ arch/powerpc/mm/hash_

[RFC v3 01/23] powerpc: Free up four 64K PTE bits in 4K backed HPTE pages

2017-06-21 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6, in the 4K backed HPTE pages. These bits continue to be used for 64K backed HPTE pages in this patch, but will be freed up in the next patch. The bit numbers are big-endian as defined in the ISA3.0 The patch does the following change t

[RFC v3 15/23] powerpc: Program HPTE key protection bits

2017-06-21 Thread Ram Pai
Map the PTE protection key bits to the HPTE key protection bits, while creating HPTE entries. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/mmu-hash.h | 5 + arch/powerpc/include/asm/pkeys.h | 7 +++ arch/powerpc/mm/hash_utils_64.c | 5 + 3

[RFC v3 12/23] powerpc: Implement sys_pkey_alloc and sys_pkey_free system call

2017-06-21 Thread Ram Pai
Sys_pkey_alloc() allocates and returns available pkey Sys_pkey_free() frees up the pkey. Total 32 keys are supported on powerpc. However pkey 0,1 and 31 are reserved. So effectively we have 29 pkeys. Each key can be initialized to disable read, write and execute permissions. On powerpc a key

[RFC v3 06/23] powerpc: use helper functions in __hash_page_4K() for 64K PTE

2017-06-21 Thread Ram Pai
replace redundant code in __hash_page_4K() with helper functions get_hidx_gslot() and set_hidx_slot() Signed-off-by: Ram Pai --- arch/powerpc/mm/hash64_64k.c | 24 ++-- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/hash64_64k.c b/arch/powerpc/

[RFC v3 13/23] powerpc: store and restore the pkey state across context switches

2017-06-21 Thread Ram Pai
Store and restore the AMR, IAMR and UMOR register state of the task before scheduling out and after scheduling in, respectively. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/processor.h | 5 + arch/powerpc/kernel/process.c| 18 ++ 2 files changed, 23 insertion

[RFC v3 11/23] x86: key creation with PKEY_DISABLE_EXECUTE is disallowed

2017-06-21 Thread Ram Pai
x86 does not support disabling execute permissions on a pkey. Signed-off-by: Ram Pai --- arch/x86/kernel/fpu/xstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index c24ac1e..d582631 100644 --- a/arch/x86/kernel/fpu/xstate.

[RFC v3 04/23] powerpc: Free up four 64K PTE bits in 64K backed HPTE pages

2017-06-21 Thread Ram Pai
Rearrange 64K PTE bits to free up bits 3, 4, 5 and 6 in the 64K backed HPTE pages. This along with the earlier patch will entirely free up the four bits from 64K PTE. The bit numbers are big-endian as defined in the ISA3.0 This patch does the following change to 64K PTE that is backed by 64K

[RFC v3 17/23] powerpc: Handle exceptions caused by violation of pkey protection

2017-06-21 Thread Ram Pai
Handle Data and Instruction exceptions caused by memory protection-key. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/mmu_context.h | 12 + arch/powerpc/include/asm/pkeys.h | 9 arch/powerpc/include/asm/reg.h | 2 +- arch/powerpc/mm/fault.c| 20

[RFC v3 23/23] procfs: display the protection-key number associated with a vma

2017-06-21 Thread Ram Pai
Display the pkey number associated with the vma in smaps of a task. The key will be seen as below: VmFlags: rd wr mr mw me dw ac key=0 Signed-off-by: Ram Pai --- Documentation/filesystems/proc.txt | 3 ++- fs/proc/task_mmu.c | 22 +++--- 2 files changed, 13 inse

[RFC v3 22/23] Documentation: PowerPC specific updates to memory protection keys

2017-06-21 Thread Ram Pai
Add documentation updates that capture PowerPC specific changes. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 65 +--- 1 file changed, 45 insertions(+), 20 deletions(-) diff --git a/Documentation/vm/protection-keys.txt b/Documentation/vm/pro

Re: [PATCH 08/32] ext4: fix ref counting for ea_inode

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:18PM -0700, Tahsin Erdogan wrote: > The ref count on ea_inode is incremented by > ext4_xattr_inode_orphan_add() which is supposed to be decremented by > ext4_xattr_inode_array_free(). The decrement is conditioned on whether > the ea_inode is currently on the orphan lis

[RFC v3 19/23] selftest: Move protecton key selftest to arch neutral directory

2017-06-21 Thread Ram Pai
Signed-off-by: Ram Pai --- tools/testing/selftests/vm/Makefile |1 + tools/testing/selftests/vm/pkey-helpers.h | 219 tools/testing/selftests/vm/protection_keys.c | 1395 + tools/testing/selftests/x86/Makefile |2 +- tools/testing/self

[RFC v3 21/23] Documentation: Move protecton key documentation to arch neutral directory

2017-06-21 Thread Ram Pai
Since PowerPC and Intel both support memory protection keys, moving the documenation to arch-neutral directory. Signed-off-by: Ram Pai --- Documentation/vm/protection-keys.txt | 85 +++ Documentation/x86/protection-keys.txt | 85 --

[RFC v3 16/23] powerpc: Macro the mask used for checking DSI exception

2017-06-21 Thread Ram Pai
Replace the magic number used to check for DSI exception with a meaningful value. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/reg.h | 7 ++- arch/powerpc/kernel/exceptions-64s.S | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/reg.

Re: [PATCH 09/32] ext4: extended attribute value size limit is enforced by vfs

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:19PM -0700, Tahsin Erdogan wrote: > EXT4_XATTR_MAX_LARGE_EA_SIZE definition in ext4 is currently unused. > Besides, vfs enforces its own 64k limit which makes the 1MB limit in > ext4 redundant. Remove it. > > Signed-off-by: Tahsin Erdogan Thanks, added to the ext4 p

Re: [PATCH NET] net/hns:bugfix of ethtool -t phy self_test

2017-06-21 Thread l00371289
Hi, Andrew On 2017/6/21 21:34, Andrew Lunn wrote: >> drivers/net/ph/marvell.c >> marvell_set_loopback(struct phy_device *dev, bool enable) >> { >> /* do some device specific setting */ >> >> >> return genphy_loopback(dev, enable); >> } >> >> I don't know if this makes sense

[RFC v3 20/23] selftest: PowerPC specific test updates to memory protection keys

2017-06-21 Thread Ram Pai
Abstracted out the arch specific code into the header file, and added powerpc specific changes. a) added 4k-backed hpte, memory allocator, powerpc specific. b) added three test case where the key is associated after the page is accessed/allocated/mapped. c) cleaned up the code to make chec

[RFC v3 18/23] powerpc: Deliver SEGV signal on pkey violation

2017-06-21 Thread Ram Pai
The value of the AMR register at the time of exception is made available in gp_regs[PT_AMR] of the siginfo. This field can be used to reprogram the permission bits of any valid pkey. Similarly the value of the pkey, whose protection got violated, is made available at si_pkey field of the siginfo

[RFC v3 09/23] mm: introduce an additional vma bit for powerpc pkey

2017-06-21 Thread Ram Pai
Currently there are only 4bits in the vma flags to support 16 keys on x86. powerpc supports 32 keys, which needs 5bits. This patch introduces an addition bit in the vma flags. Signed-off-by: Ram Pai --- fs/proc/task_mmu.c | 6 +- include/linux/mm.h | 18 +- 2 files changed,

[RFC v3 14/23] powerpc: Implementation for sys_mprotect_pkey() system call

2017-06-21 Thread Ram Pai
This system call, associates the pkey with PTE of all pages covering the given address range. Signed-off-by: Ram Pai --- arch/powerpc/include/asm/book3s/64/pgtable.h | 22 ++- arch/powerpc/include/asm/mman.h | 14 - arch/powerpc/include/asm/pkeys.h | 21 ++-

[RFC v3 08/23] powerpc: use helper functions in flush_hash_page()

2017-06-21 Thread Ram Pai
replace redundant code in flush_hash_page() with helper functions get_hidx_gslot() and set_hidx_slot() Signed-off-by: Ram Pai --- arch/powerpc/mm/hash_utils_64.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/ha

[RFC v3 10/23] mm: provide the ability to disable execute on a key at creation

2017-06-21 Thread Ram Pai
Currently sys_pkey_create() provides the ability to disable read and write permission on the key, at creation. powerpc has the hardware support to disable execute on a pkey as well.This patch enhances the interface to let disable execute at key creation time. x86 does not allow this. Henc

linux-next: build failure after merge of the md tree

2017-06-21 Thread Stephen Rothwell
Hi Shaohua, After merging the md tree, today's linux-next build (powerpc ppc64_defconfig) failed like this: drivers/md/md.c: In function 'md_run': drivers/md/md.c:5449:21: error: too few arguments to function 'bioset_create' mddev->sync_set = bioset_create(BIO_POOL_SIZE, 0);

[RFC v3 00/23] powerpc: Memory Protection Keys

2017-06-21 Thread Ram Pai
Memory protection keys enable applications to protect its address space from inadvertent access or corruption from itself. The overall idea: A process allocates a key and associates it with a address range withinits address space. The process than can dynamically set read/wri

[RFC v3 02/23] powerpc: introduce set_hidx_slot helper

2017-06-21 Thread Ram Pai
Introduce set_hidx_slot() which sets the (H_PAGE_F_SECOND|H_PAGE_F_GIX) bits at the appropriate location in the PTE of 4K PTE. In the case of 64K PTE, it sets the bits in the second part of the PTE. Though the implementation for the former just needs the slot parameter, it does take some

[PATCH 24/32] ext2, ext4: make mb block cache names more explicit

2017-06-21 Thread Tahsin Erdogan
There will be a second mb_cache instance that tracks ea_inodes. Make existing names more explicit so that it is clear that they refer to xattr block cache. Signed-off-by: Tahsin Erdogan --- v2: - renamed s_mb_cache to s_mb_block_cache in both ext2 and ext4 - renamed local variables named ext[24

[PATCH 30/32] ext4: eliminate xattr entry e_hash recalculation for removes

2017-06-21 Thread Tahsin Erdogan
When an extended attribute block is modified, ext4_xattr_hash_entry() recalculates e_hash for the entry that is pointed by s->here. This is unnecessary if the modification is to remove an entry. Currently, if the removed entry is the last one and there are other entries remaining, hash calculation

[PATCH 28/32] quota: add get_inode_usage callback to transfer multi-inode charges

2017-06-21 Thread Tahsin Erdogan
Ext4 ea_inode feature allows storing xattr values in external inodes to be able to store values that are bigger than a block in size. Ext4 also has deduplication support for these type of inodes. With deduplication, the actual storage waste is eliminated but the users of such inodes are still charg

[PATCH 29/32] ext4: reserve space for xattr entries/names

2017-06-21 Thread Tahsin Erdogan
New ea_inode feature allows putting large xattr values into external inodes. struct ext4_xattr_entry and the attribute name however have to remain in the inode extra space or external attribute block. Once that space is exhausted, no further entries can be added. Some of that space could also be us

[PATCH 26/32] ext4: cleanup transaction restarts during inode deletion

2017-06-21 Thread Tahsin Erdogan
During inode deletion, journal credits that will be needed are hard to determine, that is why we have journal extend/restart calls in several places. Whenever a transaction is restarted, filesystem must be in a consistent state because there is no atomicity guarantee beyond a restart call. Add ext

[PATCH 31/32] ext4: strong binding of xattr inode references

2017-06-21 Thread Tahsin Erdogan
To verify that a xattr entry is not pointing to the wrong xattr inode, we currently check that the target inode has EXT4_EA_INODE_FL flag set and also the entry size matches the target inode size. For stronger validation, also incorporate crc32c hash of the value into the e_hash field. This is don

[RFC v3 07/23] powerpc: use helper functions in __hash_page_4K() for 4K PTE

2017-06-21 Thread Ram Pai
replace redundant code with helper functions get_hidx_gslot() and set_hidx_slot() Signed-off-by: Ram Pai --- arch/powerpc/mm/hash64_4k.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/mm/hash64_4k.c b/arch/powerpc/mm/hash64_4k.c index 6fa450c..c67

[RFC v3 05/23] powerpc: capture the PTE format changes in the dump pte report

2017-06-21 Thread Ram Pai
The H_PAGE_F_SECOND,H_PAGE_F_GIX are not in the 64K main-PTE. capture these changes in the dump pte report. Signed-off-by: Ram Pai --- arch/powerpc/mm/dump_linuxpagetables.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/dump_linuxpagetables.c b/arch/power

[PATCH v2] ocfs2: fix deadlock caused by recursive locking in xattr

2017-06-21 Thread Eric Ren
Another deadlock path caused by recursive locking is reported. This kind of issue was introduced since commit 743b5f1434f5 ("ocfs2: take inode lock in ocfs2_iop_set/get_acl()"). Two deadlock paths have been fixed by commit b891fa5024a9 ("ocfs2: fix deadlock issue when taking inode lock at vfs entry

[PATCH 25/32] ext4: add ext4_is_quota_file()

2017-06-21 Thread Tahsin Erdogan
IS_NOQUOTA() indicates whether quota is disabled for an inode. Ext4 also uses it to check whether an inode is for a quota file. The distinction currently doesn't matter because quota is disabled only for the quota files. When we start disabling quota for other inodes in the future, we will want to

[PATCH 27/32] ext4: xattr inode deduplication

2017-06-21 Thread Tahsin Erdogan
Ext4 now supports xattr values that are up to 64k in size (vfs limit). Large xattr values are stored in external inodes each one holding a single value. Once written the data blocks of these inodes are immutable. The real world use cases are expected to have a lot of value duplication such as inhe

[PATCH 32/32] ext4: add nombcache mount option

2017-06-21 Thread Tahsin Erdogan
The main purpose of mb cache is to achieve deduplication in extended attributes. In use cases where opportunity for deduplication is unlikely, it only adds overhead. Add a mount option to explicitly turn off mb cache. Suggested-by: Andreas Dilger Signed-off-by: Tahsin Erdogan --- v2: - updated

Re: [PATCH 10/32] ext4: change ext4_xattr_inode_iget() signature

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:20PM -0700, Tahsin Erdogan wrote: > In general, kernel functions indicate success/failure through their return > values. This function returns the status as an output parameter and reserves > the return value for the inode. Make it follow the general convention. > > S

Re: [PATCH v4 1/1] f2fs: dax: implement direct access

2017-06-21 Thread Chao Yu
Hi Qiuyang As I tested with pmem, this patch will corrupt f2fs image with generic/051 of fstest suit. Could you please take a look at this issue? Thanks, On 2017/6/15 16:56, sunqiuyang wrote: > From: Qiuyang Sun > > This patch implements Direct Access (DAX) in F2FS. > > Signed-off-by: Qiuyan

Re: [PATCH 11/32] ext4: clean up ext4_xattr_inode_get()

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:21PM -0700, Tahsin Erdogan wrote: > The input and output values of *size parameter are equal on successful > return from ext4_xattr_inode_get(). On error return, the callers ignore > the output value so there is no need to update it. > > Also check for NULL return fro

Re: [PATCH 12/32] ext4: add missing le32_to_cpu(e_value_inum) conversions

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:22PM -0700, Tahsin Erdogan wrote: > Two places in code missed converting xattr inode number using > le32_to_cpu(). > > Signed-off-by: Tahsin Erdogan Thanks, added to the ext4 patch queue. - Ted

Re: [PATCH 13/32] ext4: ext4_xattr_value_same() should return false for external data

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:23PM -0700, Tahsin Erdogan wrote: > ext4_xattr_value_same() is used as a quick optimization in case the new > xattr value is identical to the previous value. When xattr value is > stored in a xattr inode the check becomes expensive so it is better to > just assume that

[PATCH v4 1/4] KVM: x86: Simple kvm_x86_ops->queue_exception parameter

2017-06-21 Thread Wanpeng Li
From: Wanpeng Li This patch removes all arguments except the first in kvm_x86_ops->queue_exception since they can extract the arguments from vcpu->arch.exception themselves, do the same in nested_{vmx,svm}_check_exception. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li --- ar

[PATCH v4 3/4] KVM: async_pf: Force a nested vmexit if the injected #PF is async_pf

2017-06-21 Thread Wanpeng Li
From: Wanpeng Li Add an async_page_fault field to vcpu->arch.exception to identify an async page fault, and constructs the expected vm-exit information fields. Force a nested VM exit from nested_vmx_check_exception() if the injected #PF is async page fault. Extending the userspace interface KV

[PATCH v4 0/4] KVM: async_pf: Fix async_pf exception injection

2017-06-21 Thread Wanpeng Li
INFO: task gnome-terminal-:1734 blocked for more than 120 seconds. Not tainted 4.12.0-rc4+ #8 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. gnome-terminal- D0 1734 1015 0x Call Trace: __schedule+0x3cd/0xb30 schedule+0x40/0x90 kvm_async_pf_

[PATCH v4 2/4] KVM: async_pf: Add L1 guest async_pf #PF vmexit handler

2017-06-21 Thread Wanpeng Li
From: Wanpeng Li This patch adds the L1 guest async page fault #PF vmexit handler, such #PF is converted into vmexit from L2 to L1 on #PF which is then handled by L1 similar to ordinary async page fault. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 34

[PATCH v4 4/4] KVM: async_pf: Let host know whether the guest support delivery async_pf as #PF vmexit

2017-06-21 Thread Wanpeng Li
From: Wanpeng Li Adds another flag bit (bit 2) to MSR_KVM_ASYNC_PF_EN. If bit 2 is 1, async page faults are delivered to L1 as #PF vmexits; if bit 2 is 0, kvm_can_do_async_pf returns 0 if in guest mode. Cc: Paolo Bonzini Cc: Radim Krčmář Signed-off-by: Wanpeng Li --- Documentation/virtual/k

Re: [PATCH 14/32] ext4: fix ext4_xattr_make_inode_space() value size calculation

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:24PM -0700, Tahsin Erdogan wrote: > ext4_xattr_make_inode_space() is interested in calculating the inline > space used in an inode. When a xattr entry refers to an external inode > the value size indicates the external inode size, not the value size in > the inline are

Re: [PATCH 15/32] ext4: fix ext4_xattr_move_to_block()

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:25PM -0700, Tahsin Erdogan wrote: > When moving xattr entries from inline area to a xattr block, entries > that refer to external xattr inodes need special handling because > value data is not available in the inline area but rather should be > read from its external i

Re: [PATCH 16/32] ext4: fix ext4_xattr_cmp()

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:26PM -0700, Tahsin Erdogan wrote: > When a xattr entry refers to an external inode, the value data is not > available in the inline area so we should not attempt to read it using > value offset. > > Signed-off-by: Tahsin Erdogan Thanks, added to the ext4 patch queue

Re: [PATCH 17/32] ext4: fix credits calculation for xattr inode

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:27PM -0700, Tahsin Erdogan wrote: > When there is no space for a value in xattr block, it may be stored > in an xattr inode even if the value length is less than > EXT4_XATTR_MIN_LARGE_EA_SIZE(). So the current assumption in credits > calculation is wrong. > > Signed-

Re: [PATCH v2] drm: mediatek: change the variable type of rdma threshold

2017-06-21 Thread Bibby Hsieh
Hi, CK, Thanks for your review and comment. On Mon, 2017-05-22 at 13:46 +0800, CK Hu wrote: > Hi, Bibby: > > One comment inline. > > On Fri, 2017-05-19 at 17:57 +0800, Bibby Hsieh wrote: > > For some greater resolution, the rdma threshold > > variable will overflow. > > > > Signed-off-by: Bibb

Re: [PATCH 18/32] ext4: retry storing value in external inode with xattr block too

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:28PM -0700, Tahsin Erdogan wrote: > When value size is <= EXT4_XATTR_MIN_LARGE_EA_SIZE(), and it > doesn't fit in either inline or xattr block, a second try is made to > store it in an external inode while storing the entry itself in inline > area. There should also be

Re: [v2] drm: mediatek: change the variable type of rdma threshold

2017-06-21 Thread Bibby Hsieh
Hi, Guenter, Thanks for your test and comment. On Wed, 2017-06-21 at 14:14 -0700, Guenter Roeck wrote: > On Fri, May 19, 2017 at 05:57:23PM +0800, Bibby Hsieh wrote: > > For some greater resolution, the rdma threshold > > variable will overflow. > > > > Signed-off-by: Bibby Hsieh > > --- > >

Re: [PATCH 19/32] ext4: ext4_xattr_delete_inode() should return accurate errors

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:29PM -0700, Tahsin Erdogan wrote: > In a few places the function returns without trying to pass the actual > error code to the caller. Fix those. > > Signed-off-by: Tahsin Erdogan Thanks, added to the ext4 patch queue. - Ted

Re: [PATCH v3 01/11] x86/mm: Don't reenter flush_tlb_func_common()

2017-06-21 Thread Andy Lutomirski
On Wed, Jun 21, 2017 at 4:26 PM, Nadav Amit wrote: > Andy Lutomirski wrote: > >> index 2a5e851f2035..f06239c6919f 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@ -208,6 +208,9 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct >> mm_struct *next, >> static void flush_tl

Re: [PATCH 20/32] ext4: improve journal credit handling in set xattr paths

2017-06-21 Thread Theodore Ts'o
On Wed, Jun 21, 2017 at 02:21:30PM -0700, Tahsin Erdogan wrote: > Both ext4_set_acl() and ext4_set_context() need to be made aware of > ea_inode feature when it comes to credits calculation. > > Also add a sufficient credits check in ext4_xattr_set_handle() right > after xattr write lock is grabbe

<    4   5   6   7   8   9   10   11   >