[PATCH] powerpc/rtas: retry when cpu offline races with suspend/migration

2019-06-20 Thread Nathan Lynch
The protocol for suspending or migrating an LPAR requires all present processor threads to enter H_JOIN. So if we have threads offline, we have to temporarily bring them up. This can race with administrator actions such as SMT state changes. As of dfd718a2ed1f ("powerpc/rtas: Fix a potential race b

[PATCH] powerpc/powernv: Rename pe_level_printk to pe_printk and embed KERN_LEVEL in format

2019-06-20 Thread Joe Perches
Remove the separate KERN_ from each pe_level_printk and instead add the KERN_ to the format. pfix in pe_level_printk could also be used uninitialized so add a new else and set pfx to the hex value of pe->flags. Rename pe_level_printk to pe_printk and update the pe_ macros. Signed-off-by: Joe Per

[PATCH kernel] powerpc/of/pci: Rewrite pci_parse_of_flags

2019-06-20 Thread Alexey Kardashevskiy
The existing code uses bunch of hardcoded values from the PCI Bus Binding to IEEE Std 1275 spec; and it does so in quite non-obvious way. This defines fields from the cell#0 of the "reg" property of a PCI device and uses them for parsing. This should cause no behavioral change. Signed-off-by: Al

[PATCH 13/13] powerpc: add machine check safe copy_to_user

2019-06-20 Thread Santosh Sivaraj
Use memcpy_mcsafe() implementation to define copy_to_user_mcsafe() Signed-off-by: Santosh Sivaraj --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/uaccess.h | 12 2 files changed, 13 insertions(+) diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig inde

[PATCH 12/13] powerpc/memcpy_mcsafe: return remaining bytes

2019-06-20 Thread Santosh Sivaraj
memcpy_mcsafe currently return -EFAULT on a machine check exception, change it to return the remaining bytes that needs to be copied, so that machine check safe copy_to_user can maintain the same behavior as copy_to_user. Signed-off-by: Santosh Sivaraj --- arch/powerpc/lib/memcpy_mcsafe_64.S | 1

[PATCH 11/13] powerpc/64s: Save r13 in machine_check_common_early

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Testing my memcpy_mcsafe() work in progress with an injected UE, I get an error like this immediately after the function returns: BUG: Unable to handle kernel data access at 0x7fff84dec8f8 Faulting instruction address: 0xc008009c00b0 Oops: Kernel access of bad area, sig: 11

[PATCH 10/13] powerpc/mce: Enable MCE notifiers in external modules

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Signed-off-by: Reza Arbab --- arch/powerpc/kernel/exceptions-64s.S | 6 ++ arch/powerpc/kernel/mce.c| 2 ++ 2 files changed, 8 insertions(+) diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index c83e38a403fd..311f1392a2

[PATCH 09/13] powerpc/mce: Handle memcpy_mcsafe()

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Add an mce notifier intended to service memcpy_mcsafe(). The notifier uses this heuristic; if a UE occurs when accessing device memory, and the faulting instruction had a fixup entry, the callback will return NOTIFY_STOP. This causes the notification mechanism to consider the M

[PATCH 08/13] powerpc/memcpy: Add memcpy_mcsafe for pmem

2019-06-20 Thread Santosh Sivaraj
From: Balbir Singh The pmem infrastructure uses memcpy_mcsafe in the pmem layer so as to convert machine check exceptions into a return value on failure in case a machine check exception is encountered during the memcpy. This patch largely borrows from the copyuser_power7 logic and does not add

[PATCH 07/13] powerpc/mce: Add fixup address to UE events

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab If the instruction causing a UE has an exception table entry with fixup address, save it in the machine_check_event struct. If a machine check notifier callback returns NOTIFY_STOP to indicate it has handled the error, set nip to continue execution from the fixup address. Signe

[PATCH 06/13] powerpc/mce: Do not process notifier-handled UE events

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Signed-off-by: Reza Arbab --- arch/powerpc/include/asm/mce.h | 3 ++- arch/powerpc/kernel/mce.c | 9 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/mce.h b/arch/powerpc/include/asm/mce.h index 948bef579086..240dd1fdfe35 10

[PATCH 05/13] powerpc/mce: Allow notifier callback to handle MCE

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab If a notifier returns NOTIFY_STOP, consider the MCE handled, just as we do when machine_check_early() returns 1. Signed-off-by: Reza Arbab --- arch/powerpc/include/asm/asm-prototypes.h | 2 +- arch/powerpc/kernel/exceptions-64s.S | 3 +++ arch/powerpc/kernel/mce.c

[PATCH 04/13] powerpc/mce: Move machine_check_ue_event() call

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Move the call site of machine_check_ue_event() slightly later in the MCE codepath. No functional change intended--this is prep for a later patch to conditionally skip the call. Signed-off-by: Reza Arbab --- arch/powerpc/kernel/mce.c | 5 - 1 file changed, 4 insertions(+),

[PATCH 03/13] powerpc/mce: Add MCE notification chain

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab Signed-off-by: Reza Arbab --- arch/powerpc/include/asm/asm-prototypes.h | 1 + arch/powerpc/include/asm/mce.h| 4 arch/powerpc/kernel/exceptions-64s.S | 4 arch/powerpc/kernel/mce.c | 22 ++ 4 files changed, 31 i

[PATCH 02/13] powerpc/mce: Bug fixes for MCE handling in kernel space

2019-06-20 Thread Santosh Sivaraj
From: Balbir Singh The code currently assumes PAGE_SHIFT as the shift value of the pfn, this works correctly (mostly) for user space pages, but the correct thing to do is 1. Extract the shift value returned via the pte-walk API's 2. Use the shift value to access the instruction address. Note, t

[PATCH 00/13] powerpc: implement machine check safe memcpy

2019-06-20 Thread Santosh Sivaraj
During a memcpy from a pmem device, if a machine check exception is generated we end up in a panic. In case of fsdax read, this should only result in a -EIO. Avoid MCE by implementing memcpy_mcsafe. Before this patch series: ``` bash-4.4# mount -o dax /dev/pmem0 /mnt/pmem/ [ 7621.714094] Disablin

[PATCH 01/13] powerpc/mce: Make machine_check_ue_event() static

2019-06-20 Thread Santosh Sivaraj
From: Reza Arbab The function doesn't get used outside this file, so make it static. Signed-off-by: Reza Arbab --- arch/powerpc/kernel/mce.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c index b18df633eae9..e78c4f1

Re: [PATCH 2/4] powerpc/powernv: remove the unused tunneling exports

2019-06-20 Thread Oliver O'Halloran
On Thu, May 23, 2019 at 5:51 PM Christoph Hellwig wrote: > > These have been unused ever since they've been added to the kernel. > > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/include/asm/pnv-pci.h| 4 -- > arch/powerpc/platforms/powernv/pci-ioda.c | 4 +- > arch/powerpc/pla

Re: [PATCH 4/4] powerpc/powernv: remove the unused vas_win_paste_addr and vas_win_id functions

2019-06-20 Thread Oliver O'Halloran
On Thu, May 23, 2019 at 5:56 PM Christoph Hellwig wrote: > > These two function have never been used since they were added to the > kernel. > > Signed-off-by: Christoph Hellwig > --- > arch/powerpc/include/asm/vas.h | 10 -- > arch/powerpc/platforms/powernv/vas-window.c | 19

Re: [PATCH v2] ocxl: Allow contexts to be attached with a NULL mm

2019-06-20 Thread Andrew Donnellan
On 20/6/19 2:12 pm, Alastair D'Silva wrote: From: Alastair D'Silva If an OpenCAPI context is to be used directly by a kernel driver, there may not be a suitable mm to use. The patch makes the mm parameter to ocxl_context_attach optional. Signed-off-by: Alastair D'Silva Acked-by: Andrew Don

[PATCH v3 6/6] drivers/base/memory.c: Get rid of find_memory_block_hinted()

2019-06-20 Thread David Hildenbrand
No longer needed, let's remove it. Also, drop the "hint" parameter completely from "find_memory_block_by_id", as nobody needs it anymore. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Stephen Rothwell Cc: Pavel Tatashin Cc: "mike.tra...@hpe.com" Signed-off-by: David Hi

[PATCH v3 5/6] mm/memory_hotplug: Move and simplify walk_memory_blocks()

2019-06-20 Thread David Hildenbrand
Let's move walk_memory_blocks() to the place where memory block logic resides and simplify it. While at it, add a type for the callback function. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: David Hildenbrand Cc: Andrew Morton Cc: Stephen Rothwell Cc: Pavel Tatashin Cc: Andrew Banman

[PATCH v3 4/6] mm/memory_hotplug: Rename walk_memory_range() and pass start+size instead of pfns

2019-06-20 Thread David Hildenbrand
walk_memory_range() was once used to iterate over sections. Now, it iterates over memory blocks. Rename the function, fixup the documentation. Also, pass start+size instead of PFNs, which is what most callers already have at hand. (we'll rework link_mem_sections() most probably soon) Follow-up pat

[PATCH v3 0/6] mm: Further memory block device cleanups

2019-06-20 Thread David Hildenbrand
@Andrew: Only patch 1, 4 and 6 changed compared to v1. Some further cleanups around memory block devices. Especially, clean up and simplify walk_memory_range(). Including some other minor cleanups. Compiled + tested on x86 with DIMMs under QEMU. Compile-tested on ppc64. v2 -> v3: - "mm/memory_ho

[PATCH v3 3/6] mm: Make register_mem_sect_under_node() static

2019-06-20 Thread David Hildenbrand
It is only used internally. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Keith Busch Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- drivers/base/node.c | 3 ++- include/linux/node.h | 7 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a

[PATCH v3 2/6] drivers/base/memory: Use "unsigned long" for block ids

2019-06-20 Thread David Hildenbrand
Block ids are just shifted section numbers, so let's also use "unsigned long" for them, too. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dr

[PATCH v3 1/6] mm: Section numbers use the type "unsigned long"

2019-06-20 Thread David Hildenbrand
We are using a mixture of "int" and "unsigned long". Let's make this consistent by using "unsigned long" everywhere. We'll do the same with memory block ids next. While at it, turn the "unsigned long i" in removable_show() into an int - sections_per_block is an int. Cc: Greg Kroah-Hartman Cc: "R

Re: [PATCH v2 6/6] drivers/base/memory.c: Get rid of find_memory_block_hinted()

2019-06-20 Thread David Hildenbrand
On 20.06.19 12:35, David Hildenbrand wrote: > No longer needed, let's remove it. Also, drop the "hint" parameter > completely from "find_memory_block_by_id", as nobody needs it anymore. > > Cc: Greg Kroah-Hartman > Cc: "Rafael J. Wysocki" > Cc: Andrew Morton > Cc: Stephen Rothwell > Cc: Pavel

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-20 Thread Linus Torvalds
On Thu, Jun 20, 2019 at 5:19 AM Nicholas Piggin wrote: > > The processor aliasing problem happens because the struct will > be initialised with stores using one base register (e.g., stack > register), and then same memory is loaded using a different > register (e.g., parameter register). Hmm. Hon

Re: [PATCH v2 4/6] mm/memory_hotplug: Rename walk_memory_range() and pass start+size instead of pfns

2019-06-20 Thread David Hildenbrand
On 20.06.19 18:05, Nathan Chancellor wrote: > On Thu, Jun 20, 2019 at 12:35:18PM +0200, David Hildenbrand wrote: >> walk_memory_range() was once used to iterate over sections. Now, it >> iterates over memory blocks. Rename the function, fixup the >> documentation. Also, pass start+size instead of P

Re: [PATCH v2 4/6] mm/memory_hotplug: Rename walk_memory_range() and pass start+size instead of pfns

2019-06-20 Thread Nathan Chancellor
On Thu, Jun 20, 2019 at 12:35:18PM +0200, David Hildenbrand wrote: > walk_memory_range() was once used to iterate over sections. Now, it > iterates over memory blocks. Rename the function, fixup the > documentation. Also, pass start+size instead of PFNs, which is what most > callers already have at

Re: [PATCH] powerpc: enable a 30-bit ZONE_DMA for 32-bit pmac

2019-06-20 Thread Michael Ellerman
Benjamin Herrenschmidt writes: > On Wed, 2019-06-19 at 22:32 +1000, Michael Ellerman wrote: >> Christoph Hellwig writes: >> > Any chance this could get picked up to fix the regression? >> >> Was hoping Ben would Ack it. He's still powermac maintainer :) >> >> I guess he OK'ed it in the other th

Re: [PATCH 16/16] mm: pass get_user_pages_fast iterator arguments in a structure

2019-06-20 Thread Nicholas Piggin
Linus Torvalds's on June 12, 2019 11:09 am: > On Tue, Jun 11, 2019 at 2:55 PM Nicholas Piggin wrote: >> >> What does this do for performance? I've found this pattern can be >> bad for store aliasing detection. > > I wouldn't expect it to be noticeable, and the lack of argument > reloading etc sho

Re: switch the remaining architectures to use generic GUP v3

2019-06-20 Thread Christoph Hellwig
I just noticed I didn't have Andrew explicitly on the receipents list, so adding him. Is everyone happy enough to give this a spin in -mm and linux-next?

Re: [PATCH v2 43/52] powerpc/64s/exception: machine check early only runs in HV mode

2019-06-20 Thread Mahesh Jagannath Salgaonkar
On 6/20/19 3:46 PM, Nicholas Piggin wrote: > Mahesh J Salgaonkar's on June 20, 2019 7:53 pm: >> On 2019-06-20 15:14:50 Thu, Nicholas Piggin wrote: >>> machine_check_common_early and machine_check_handle_early only run in >>> HVMODE. Remove dead code. >> >> That's not true. For pseries guest with FW

[PATCH v2 6/6] drivers/base/memory.c: Get rid of find_memory_block_hinted()

2019-06-20 Thread David Hildenbrand
No longer needed, let's remove it. Also, drop the "hint" parameter completely from "find_memory_block_by_id", as nobody needs it anymore. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Stephen Rothwell Cc: Pavel Tatashin Cc: "mike.tra...@hpe.com" Signed-off-by: David Hi

[PATCH v2 4/6] mm/memory_hotplug: Rename walk_memory_range() and pass start+size instead of pfns

2019-06-20 Thread David Hildenbrand
walk_memory_range() was once used to iterate over sections. Now, it iterates over memory blocks. Rename the function, fixup the documentation. Also, pass start+size instead of PFNs, which is what most callers already have at hand. (we'll rework link_mem_sections() most probably soon) Follow-up pat

[PATCH v2 5/6] mm/memory_hotplug: Move and simplify walk_memory_blocks()

2019-06-20 Thread David Hildenbrand
Let's move walk_memory_blocks() to the place where memory block logic resides and simplify it. While at it, add a type for the callback function. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: David Hildenbrand Cc: Andrew Morton Cc: Stephen Rothwell Cc: Pavel Tatashin Cc: Andrew Banman

[PATCH v2 3/6] mm: Make register_mem_sect_under_node() static

2019-06-20 Thread David Hildenbrand
It is only used internally. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton Cc: Keith Busch Cc: Oscar Salvador Signed-off-by: David Hildenbrand --- drivers/base/node.c | 3 ++- include/linux/node.h | 7 --- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a

[PATCH v2 1/6] mm: Section numbers use the type "unsigned long"

2019-06-20 Thread David Hildenbrand
We are using a mixture of "int" and "unsigned long". Let's make this consistent by using "unsigned long" everywhere. We'll do the same with memory block ids next. While at it, turn the "unsigned long i" in removable_show() into an int - sections_per_block is an int. Cc: Greg Kroah-Hartman Cc: "R

[PATCH v2 0/6] mm: Further memory block device cleanups

2019-06-20 Thread David Hildenbrand
@Andrew: Only patch 1 and 6 changed. The patches are based on the same state as the previous patches (replace the old ones if possible). Some further cleanups around memory block devices. Especially, clean up and simplify walk_memory_range(). Including some other minor cleanups. Compiled + tested

[PATCH v2 2/6] drivers/base/memory: Use "unsigned long" for block ids

2019-06-20 Thread David Hildenbrand
Block ids are just shifted section numbers, so let's also use "unsigned long" for them, too. Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Signed-off-by: David Hildenbrand --- drivers/base/memory.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dr

Re: [PATCH v2 43/52] powerpc/64s/exception: machine check early only runs in HV mode

2019-06-20 Thread Nicholas Piggin
Mahesh J Salgaonkar's on June 20, 2019 7:53 pm: > On 2019-06-20 15:14:50 Thu, Nicholas Piggin wrote: >> machine_check_common_early and machine_check_handle_early only run in >> HVMODE. Remove dead code. > > That's not true. For pseries guest with FWNMI enabled hypervisor, > machine_check_common_ea

Re: [PATCH v2 43/52] powerpc/64s/exception: machine check early only runs in HV mode

2019-06-20 Thread Mahesh J Salgaonkar
On 2019-06-20 15:14:50 Thu, Nicholas Piggin wrote: > machine_check_common_early and machine_check_handle_early only run in > HVMODE. Remove dead code. That's not true. For pseries guest with FWNMI enabled hypervisor, machine_check_common_early gets called in non-HV mode as well. machine_check_

Re: [PATCH v2 42/52] powerpc/64s/exception: machine check fwnmi does not trigger when in HV mode

2019-06-20 Thread Nicholas Piggin
Mahesh Jagannath Salgaonkar's on June 20, 2019 7:26 pm: > On 6/20/19 10:44 AM, Nicholas Piggin wrote: >> Remove dead code. >> >> Signed-off-by: Nicholas Piggin >> --- >> arch/powerpc/kernel/exceptions-64s.S | 3 --- >> 1 file changed, 3 deletions(-) >> >> diff --git a/arch/powerpc/kernel/except

Re: [PATCH v2 42/52] powerpc/64s/exception: machine check fwnmi does not trigger when in HV mode

2019-06-20 Thread Mahesh Jagannath Salgaonkar
On 6/20/19 10:44 AM, Nicholas Piggin wrote: > Remove dead code. > > Signed-off-by: Nicholas Piggin > --- > arch/powerpc/kernel/exceptions-64s.S | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/powerpc/kernel/exceptions-64s.S > b/arch/powerpc/kernel/exceptions-64s.S > index 286bd

Re: [PATCH v2] ocxl: Allow contexts to be attached with a NULL mm

2019-06-20 Thread Frederic Barrat
Le 20/06/2019 à 06:12, Alastair D'Silva a écrit : From: Alastair D'Silva If an OpenCAPI context is to be used directly by a kernel driver, there may not be a suitable mm to use. The patch makes the mm parameter to ocxl_context_attach optional. Signed-off-by: Alastair D'Silva --- Thanks

[PATCH v4 6/6] mm/nvdimm: Fix endian conversion issues 

2019-06-20 Thread Aneesh Kumar K.V
nd_label->dpa issue was observed when trying to enable the namespace created with little-endian kernel on a big-endian kernel. That made me run `sparse` on the rest of the code and other changes are the result of that. Fixes: d9b83c756953 ("libnvdimm, btt: rework error clearing") Fixes: 9dedc73a46

[PATCH v4 5/6] mm/nvdimm: Use correct alignment when looking at first pfn from a region

2019-06-20 Thread Aneesh Kumar K.V
vmem_altmap_offset() adjust the section aligned base_pfn offset. So we need to make sure we account for the same when computing base_pfn. ie, for altmap_valid case, our pfn_first should be: pfn_first = altmap->base_pfn + vmem_altmap_offset(altmap); Signed-off-by: Aneesh Kumar K.V --- kernel/me

[PATCH v4 2/6] mm/nvdimm: Add page size and struct page size to pfn superblock

2019-06-20 Thread Aneesh Kumar K.V
This is needed so that we don't wrongly initialize a namespace which doesn't have enough space reserved for holding struct pages with the current kernel. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/pfn.h | 5 - drivers/nvdimm/pfn_devs.c | 27 ++- 2 files

[PATCH v4 3/6] mm/nvdimm: Use correct #defines instead of open coding

2019-06-20 Thread Aneesh Kumar K.V
Use PAGE_SIZE instead of SZ_4K and sizeof(struct page) instead of 64. If we have a kernel built with different struct page size the previous patch should handle marking the namespace disabled. Signed-off-by: Aneesh Kumar K.V --- drivers/nvdimm/label.c | 2 +- drivers/nvdimm/namespace_de

[PATCH v4 4/6] mm/nvdimm: Pick the right alignment default when creating dax devices

2019-06-20 Thread Aneesh Kumar K.V
Allow arch to provide the supported alignments and use hugepage alignment only if we support hugepage. Right now we depend on compile time configs whereas this patch switch this to runtime discovery. Architectures like ppc64 can have THP enabled in code, but then can have hugepage size disabled by

[PATCH v4 1/6] nvdimm: Consider probe return -EOPNOTSUPP as success

2019-06-20 Thread Aneesh Kumar K.V
This patch add -EOPNOTSUPP as return from probe callback to indicate we were not able to initialize a namespace due to pfn superblock feature/version mismatch. We want to consider this a probe success so that we can create new namesapce seed and there by avoid marking the failed namespace as the se

[PATCH v4 0/6] Fixes related namespace alignment/page size/big endian

2019-06-20 Thread Aneesh Kumar K.V
This series handle configs where hugepage support is not enabled by default. Also, we update some of the information messages to make sure we use PAGE_SIZE instead of SZ_4K. We now store page size and struct page size in pfn_sb and do extra check before enabling namespace. There also an endiannes

Re: [PATCH 3/3] KVM: PPC: Book3S HV: Clear pending decr exceptions on nested guest entry

2019-06-20 Thread Cédric Le Goater
On 20/06/2019 09:57, Laurent Vivier wrote: > On 20/06/2019 03:46, Suraj Jitindar Singh wrote: >> If we enter an L1 guest with a pending decrementer exception then this >> is cleared on guest exit if the guest has writtien a positive value into >> the decrementer (indicating that it handled the decr

Re: [PATCH v12 00/31] Speculative page faults

2019-06-20 Thread Haiyan Song
Hi Laurent, I downloaded your script and run it on Intel 2s skylake platform with spf-v12 patch serials. Here attached the output results of this script. The following comparison result is statistics from the script outputs. a). Enable THP SPF_0

Re: [PATCH v2] crypto: nx: no need to check return value of debugfs_create functions

2019-06-20 Thread Herbert Xu
Greg Kroah-Hartman wrote: > When calling debugfs functions, there is no need to ever check the > return value. The function can work or not, but the code logic should > never do something different based on this. > > Also, there is no need to store the individual debugfs file names, > especially

Re: [PATCH] crypto: talitos - fix max key size for sha384 and sha512

2019-06-20 Thread Herbert Xu
On Wed, Jun 12, 2019 at 05:49:50AM +, Christophe Leroy wrote: > Below commit came with a typo in the CONFIG_ symbol, leading > to a permanently reduced max key size regarless of the driver > capabilities. > > Reported-by: Horia Geantă > Fixes: b8fbdc2bc4e7 ("crypto: talitos - reduce max key s

Re: [PATCH] crypto: vmx - Document CTR mode counter width quirks

2019-06-20 Thread Herbert Xu
On Tue, Jun 11, 2019 at 11:54:31AM +1000, Daniel Axtens wrote: > The CTR code comes from OpenSSL, where it does a 32-bit counter. > The kernel has a 128-bit counter. This difference has lead to > issues. > > Document it. > > Signed-off-by: Daniel Axtens > --- > drivers/crypto/vmx/aesp8-ppc.pl |

Re: [PATCH 3/3] KVM: PPC: Book3S HV: Clear pending decr exceptions on nested guest entry

2019-06-20 Thread Laurent Vivier
On 20/06/2019 03:46, Suraj Jitindar Singh wrote: > If we enter an L1 guest with a pending decrementer exception then this > is cleared on guest exit if the guest has writtien a positive value into > the decrementer (indicating that it handled the decrementer exception) > since there is no other way

Re: [PATCH 2/3] KVM: PPC: Book3S HV: Signed extend decrementer value if not using large decr

2019-06-20 Thread Laurent Vivier
On 20/06/2019 03:46, Suraj Jitindar Singh wrote: > On POWER9 the decrementer can operate in large decrementer mode where > the decrementer is 56 bits and signed extended to 64 bits. When not > operating in this mode the decrementer behaves as a 32 bit decrementer > which is NOT signed extended (as

Re: [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code

2019-06-20 Thread Alexey Kardashevskiy
On 20/06/2019 16:21, Christoph Hellwig wrote: > On Thu, Jun 20, 2019 at 04:20:08PM +1000, Alexey Kardashevskiy wrote: >> >> >> On 20/06/2019 16:03, Christoph Hellwig wrote: >>> Hi Linus, >>> >>> this goes back to the discussion at last years kernel summit, where >>> we had the discussion on remo

Re: [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code

2019-06-20 Thread Christoph Hellwig
On Thu, Jun 20, 2019 at 04:20:08PM +1000, Alexey Kardashevskiy wrote: > > > On 20/06/2019 16:03, Christoph Hellwig wrote: > > Hi Linus, > > > > this goes back to the discussion at last years kernel summit, where > > we had the discussion on removing code never used by any in-kernel > > user an n

Re: [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code

2019-06-20 Thread Alexey Kardashevskiy
On 20/06/2019 16:03, Christoph Hellwig wrote: > Hi Linus, > > this goes back to the discussion at last years kernel summit, where > we had the discussion on removing code never used by any in-kernel > user an no prospects of one. The IBM folks are unfortunately still > dragging their feet on t

Re: [PATCH 3/4] powerpc/powernv: remove dead NPU DMA code

2019-06-20 Thread Christoph Hellwig
Hi Linus, this goes back to the discussion at last years kernel summit, where we had the discussion on removing code never used by any in-kernel user an no prospects of one. The IBM folks are unfortunately still dragging their feet on the powerpc side. Can we revise this discussion? The use cas

Re: [PATCH v4 1/4] lib/scatterlist: Fix mapping iterator when sg->offset is greater than PAGE_SIZE

2019-06-20 Thread Herbert Xu
On Mon, Jun 17, 2019 at 09:15:02PM +, Christophe Leroy wrote: > All mapping iterator logic is based on the assumption that sg->offset > is always lower than PAGE_SIZE. > > But there are situations where sg->offset is such that the SG item > is on the second page. In that case sg_copy_to_buffer

[PATCH] KVM: PPC: Book3S HV: Fix CR0 setting in TM emulation

2019-06-20 Thread Michael Neuling
When emulating tsr, treclaim and trechkpt, we incorrectly set CR0. The code currently sets: CR0 <- 00 || MSR[TS] but according to the ISA it should be: CR0 <- 0 || MSR[TS] || 0 This fixes the bit shift to put the bits in the correct location. Tested-by: Suraj Jitindar Singh Signed-off-b

Re: [PATCH v2 30/52] powerpc/64s/exception: optimise system_reset for idle, clean up non-idle case

2019-06-20 Thread Nicholas Piggin
Nicholas Piggin's on June 20, 2019 3:14 pm: > The idle wake up code in the system reset interrupt is not very > optimal. There are two requirements: perform idle wake up quickly; > and save everything including CFAR for non-idle interrupts, with > no performance requirement. > > The problem with p

Re: [PATCH v2] ocxl: Allow contexts to be attached with a NULL mm

2019-06-20 Thread Nicholas Piggin
Alastair D'Silva's on June 20, 2019 2:12 pm: > From: Alastair D'Silva > > If an OpenCAPI context is to be used directly by a kernel driver, there > may not be a suitable mm to use. > > The patch makes the mm parameter to ocxl_context_attach optional. > > Signed-off-by: Alastair D'Silva Yeah I

[PATCH v2 52/52] powerpc/64s/exception: add missing branch to self after RFI

2019-06-20 Thread Nicholas Piggin
For consistency. These may not be required on modern processors, and they don't quite fit with the RFI_TO macros, but they should be all removed in that case. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/power

[PATCH v2 51/52] powerpc/64s/exception: machine check improve branch labels

2019-06-20 Thread Nicholas Piggin
Short forward and backward branches can be given number labels, but larger significant divergences in code path a more readable if they're given descriptive names. Signed-off-by: Nicholas Piggin --- arch/powerpc/kernel/exceptions-64s.S | 10 +- 1 file changed, 5 insertions(+), 5 deletion

[PATCH v2 50/52] powerpc/64s/exception: untangle early machine check handler

2019-06-20 Thread Nicholas Piggin
machine_check_early_common now branches to machine_check_handle_early which is its only caller, and they're separated by a bunch of other code which makes no sense. This patch moves that other code out of the way, and removes the branch instruction. Signed-off-by: Nicholas Piggin --- arch/power