Re: [PATCH v6 03/28] powerpc/xmon: Move breakpoints to text section

2020-04-27 Thread Christophe Leroy
Le 28/04/2020 à 07:30, Jordan Niethe a écrit : On Tue, Apr 28, 2020 at 3:20 PM Christophe Leroy wrote: Le 28/04/2020 à 03:57, Jordan Niethe a écrit : The instructions for xmon's breakpoint are stored bpt_table[] which is in the data section. This is problematic as the data section may

Re: [PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

2020-04-27 Thread Christophe Leroy
Hi, Le 28/04/2020 à 03:48, H.J. Lu a écrit : arch/powerpc/kernel/vmlinux.lds.S has DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) *(.glink .iplt .plt .rela* .comment) *(.gnu.version*) *(.gnu.attributes)

[PATCH] tty: hvc: Fix data abort due to race in hvc_open

2020-04-27 Thread Raghavendra Rao Ananta
Potentially, hvc_open() can be called in parallel when two tasks calls open() on /dev/hvcX. In such a scenario, if the hp->ops->notifier_add() callback in the function fails, where it sets the tty->driver_data to NULL, the parallel hvc_open() can see this NULL and cause a memory abort. Hence,

Re: [PATCH v4] pci: Make return value of pcie_capability_read*() consistent

2020-04-27 Thread Yicong Yang
On 2020/4/28 2:13, Bjorn Helgaas wrote: > > I'm starting to think we're approaching this backwards. I searched > for PCIBIOS_FUNC_NOT_SUPPORTED, PCIBIOS_BAD_VENDOR_ID, and the other > error values. Almost every use is a *return* in a config accessor. > There are very, very few *tests* for these

Re: [PATCH v6 03/28] powerpc/xmon: Move breakpoints to text section

2020-04-27 Thread Jordan Niethe
On Tue, Apr 28, 2020 at 3:20 PM Christophe Leroy wrote: > > > > Le 28/04/2020 à 03:57, Jordan Niethe a écrit : > > The instructions for xmon's breakpoint are stored bpt_table[] which is in > > the data section. This is problematic as the data section may be marked > > as no execute. Move

Re: [PATCH v6 03/28] powerpc/xmon: Move breakpoints to text section

2020-04-27 Thread Christophe Leroy
Le 28/04/2020 à 03:57, Jordan Niethe a écrit : The instructions for xmon's breakpoint are stored bpt_table[] which is in the data section. This is problematic as the data section may be marked as no execute. Move bpt_table[] to the text section. Signed-off-by: Jordan Niethe --- v6: - New to

Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-04-27 Thread Sandipan Das
Hi Mike, On 28/04/20 12:39 am, Mike Kravetz wrote: > On 4/27/20 10:25 AM, Mike Kravetz wrote: >> On 4/26/20 10:04 PM, Sandipan Das wrote: >>> On 18/04/20 12:20 am, Mike Kravetz wrote: Now that architectures provide arch_hugetlb_valid_size(), parsing of "hugepagesz=" can be done in

[PATCH v4 1/2] powerpc/eeh: fix pseries_eeh_configure_bridge()

2020-04-27 Thread Sam Bobroff
If a device is hot unplgged during EEH recovery, it's possible for the RTAS call to ibm,configure-pe in pseries_eeh_configure() to return parameter error (-3), however negative return values are not checked for and this leads to an infinite loop. Fix this by correctly bailing out on negative

[PATCH v4 2/2] powerpc/eeh: Release EEH device state synchronously

2020-04-27 Thread Sam Bobroff
EEH device state is currently removed (by eeh_remove_device()) during the device release handler, which is invoked as the device's reference count drops to zero. This may take some time, or forever, as other threads may hold references. However, the PCI device state is released synchronously by

[PATCH v4 0/2] powerpc/eeh: Release EEH device state synchronously

2020-04-27 Thread Sam Bobroff
Hi everyone, Here are some fixes and cleanups that have come from other work but that I think stand on their own. Only one patch ("Release EEH device state synchronously", suggested by Oliver O'Halloran) is a significant change: it moves the cleanup of some EEH device data out of the (possibly

Re: [PATCH v3 1/3] powerpc/rtas: Export rtas_error_rc

2020-04-27 Thread Michael Ellerman
Sam Bobroff writes: > Export rtas_error_rc() so that it can be used by other users of > rtas_call() (which is already exported). > > Signed-off-by: Sam Bobroff > --- > v3 * New in this version. > > arch/powerpc/include/asm/rtas.h | 1 + > arch/powerpc/kernel/rtas.c | 3 ++- > 2 files

[Bug 104871] bcl+8 in arch/powerpc/kernel/vdso64/datapage.S causes branch prediction issues

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=104871 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|RESOLVED|CLOSED --

[Bug 104871] bcl+8 in arch/powerpc/kernel/vdso64/datapage.S causes branch prediction issues

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=104871 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|NEW |RESOLVED

[Bug 199471] [Bisected][Regression] windfarm_pm* no longer gets automatically loaded when CONFIG_I2C_POWERMAC=y is set

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199471 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|VERIFIED|CLOSED --

[Bug 199471] [Bisected][Regression] windfarm_pm* no longer gets automatically loaded when CONFIG_I2C_POWERMAC=y is set

2020-04-27 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=199471 Michael Ellerman (mich...@ellerman.id.au) changed: What|Removed |Added Status|RESOLVED|VERIFIED ---

Re: [PATCH 1/5] powerpc/spufs: simplify spufs core dumping

2020-04-27 Thread Jeremy Kerr
Hi Al & Christoph, > Again, this really needs fixing. Preferably - as a separate commit > preceding this series, so that it could be > backported. simple_read_from_buffer() is a blocking operation. I'll put together a patch that fixes this. Christoph: I'll do it in a way that matches your

Re: [PATCH v3 1/3] powerpc/rtas: Export rtas_error_rc

2020-04-27 Thread Sam Bobroff
On Fri, Apr 24, 2020 at 11:07:43AM -0500, Nathan Lynch wrote: > Sam Bobroff writes: > > Export rtas_error_rc() so that it can be used by other users of > > rtas_call() (which is already exported). > > This will do the right thing for your ibm,configure-pe use case in patch > 2, but the -900x =>

[PATCH v6 28/28] powerpc sstep: Add support for prefixed fixed-point arithmetic

2020-04-27 Thread Jordan Niethe
This adds emulation support for the following prefixed Fixed-Point Arithmetic instructions: * Prefixed Add Immediate (paddi) Reviewed-by: Balamuruhan S Signed-off-by: Jordan Niethe --- v3: Since we moved the prefixed loads/stores into the load/store switch statement it no longer makes sense

[PATCH v6 27/28] powerpc sstep: Add support for prefixed load/stores

2020-04-27 Thread Jordan Niethe
This adds emulation support for the following prefixed integer load/stores: * Prefixed Load Byte and Zero (plbz) * Prefixed Load Halfword and Zero (plhz) * Prefixed Load Halfword Algebraic (plha) * Prefixed Load Word and Zero (plwz) * Prefixed Load Word Algebraic (plwa) * Prefixed Load

[PATCH v6 26/28] powerpc: Support prefixed instructions in alignment handler

2020-04-27 Thread Jordan Niethe
If a prefixed instruction results in an alignment exception, the SRR1_PREFIXED bit is set. The handler attempts to emulate the responsible instruction and then increment the NIP past it. Use SRR1_PREFIXED to determine by how much the NIP should be incremented. Prefixed instructions are not

[PATCH v6 25/28] powerpc: Test prefixed instructions in feature fixups

2020-04-27 Thread Jordan Niethe
Expand the feature-fixups self-tests to includes tests for prefixed instructions. Signed-off-by: Jordan Niethe --- v6: New to series --- arch/powerpc/lib/feature-fixups-test.S | 68 +++ arch/powerpc/lib/feature-fixups.c | 74 ++ 2 files changed,

[PATCH v6 24/28] powerpc: Test prefixed code patching

2020-04-27 Thread Jordan Niethe
Expand the code-patching self-tests to includes tests for patching prefixed instructions. Signed-off-by: Jordan Niethe --- v6: New to series --- arch/powerpc/lib/Makefile | 2 +- arch/powerpc/lib/code-patching.c | 21 + arch/powerpc/lib/test_code-patching.S

[PATCH v6 23/28] powerpc: Add prefixed instructions to instruction data type

2020-04-27 Thread Jordan Niethe
For powerpc64, redefine the ppc_inst type so both word and prefixed instructions can be represented. On powerpc32 the type will remain the same. Update places which had assumed instructions to be 4 bytes long. Signed-off-by: Jordan Niethe --- v4: New to series v5: - Distinguish normal

[PATCH v6 22/28] powerpc: Define new SRR1 bits for a future ISA version

2020-04-27 Thread Jordan Niethe
Add the BOUNDARY SRR1 bit definition for when the cause of an alignment exception is a prefixed instruction that crosses a 64-byte boundary. Add the PREFIXED SRR1 bit definition for exceptions caused by prefixed instructions. Bit 35 of SRR1 is called SRR1_ISI_N_OR_G. This name comes from it being

[PATCH v6 21/28] powerpc: Enable Prefixed Instructions

2020-04-27 Thread Jordan Niethe
From: Alistair Popple Prefix instructions have their own FSCR bit which needs to enabled via a CPU feature. The kernel will save the FSCR for problem state but it needs to be enabled initially. If prefixed instructions are made unavailable by the [H]FSCR, attempting to use them will cause a

[PATCH v6 20/28] powerpc: Make test_translate_branch() independent of instruction length

2020-04-27 Thread Jordan Niethe
test_translate_branch() uses two pointers to instructions within a buffer, p and q, to test patch_branch(). The pointer arithmetic done on them assumes a size of 4. This will not work if the instruction length changes. Instead do the arithmetic relative to the void * to the buffer. Signed-off-by:

[PATCH v6 19/28] powerpc/xmon: Move insertion of breakpoint for xol'ing

2020-04-27 Thread Jordan Niethe
When a new breakpoint is created, the second instruction of that breakpoint is patched with a trap instruction. This assumes the length of the instruction is always the same. In preparation for prefixed instructions, remove this assumption. Insert the trap instruction at the same time the first

[PATCH v6 18/28] powerpc/xmon: Use a function for reading instructions

2020-04-27 Thread Jordan Niethe
Currently in xmon, mread() is used for reading instructions. In preparation for prefixed instructions, create and use a new function, mread_instr(), especially for reading instructions. Signed-off-by: Jordan Niethe --- v5: New to series, seperated from "Add prefixed instructions to

[PATCH v6 17/28] powerpc: Introduce a function for reporting instruction length

2020-04-27 Thread Jordan Niethe
Currently all instructions have the same length, but in preparation for prefixed instructions introduce a function for returning instruction length. Signed-off-by: Jordan Niethe --- v6: - feature-fixups.c: do_final_fixups(): use here - ppc_inst_len(): change return type from bool to int

[PATCH v6 16/28] powerpc: Define and use __get_user_instr{, inatomic}()

2020-04-27 Thread Jordan Niethe
Define specific __get_user_instr() and __get_user_instr_inatomic() macros for reading instructions from user space. Signed-off-by: Jordan Niethe --- arch/powerpc/include/asm/uaccess.h | 5 + arch/powerpc/kernel/align.c | 2 +- arch/powerpc/kernel/hw_breakpoint.c | 2 +-

[PATCH v6 15/28] powerpc/kprobes: Use patch_instruction()

2020-04-27 Thread Jordan Niethe
Instead of using memcpy() and flush_icache_range() use patch_instruction() which not only accomplishes both of these steps but will also make it easier to add support for prefixed instructions. Signed-off-by: Jordan Niethe --- v6: New to series. --- arch/powerpc/kernel/kprobes.c | 5 + 1

[PATCH v6 14/28] powerpc: Add a probe_kernel_read_inst() function

2020-04-27 Thread Jordan Niethe
Introduce a probe_kernel_read_inst() function to use in cases where probe_kernel_read() is used for getting an instruction. This will be more useful for prefixed instructions. Signed-off-by: Jordan Niethe --- v6: - This was previously just in ftrace.c --- arch/powerpc/include/asm/inst.h| 2

[PATCH v6 13/28] powerpc: Add a probe_user_read_inst() function

2020-04-27 Thread Jordan Niethe
Introduce a probe_user_read_inst() function to use in cases where probe_user_read() is used for getting an instruction. This will be more useful for prefixed instructions. Signed-off-by: Jordan Niethe --- v6: - New to series --- arch/powerpc/include/asm/inst.h | 3 +++

[PATCH v6 12/28] powerpc: Use a function for reading instructions

2020-04-27 Thread Jordan Niethe
Prefixed instructions will mean there are instructions of different length. As a result dereferencing a pointer to an instruction will not necessarily give the desired result. Introduce a function for reading instructions from memory into the instruction data type. Signed-off-by: Jordan Niethe

[PATCH v6 11/28] powerpc: Use a datatype for instructions

2020-04-27 Thread Jordan Niethe
Currently unsigned ints are used to represent instructions on powerpc. This has worked well as instructions have always been 4 byte words. However, a future ISA version will introduce some changes to instructions that mean this scheme will no longer work as well. This change is Prefixed

[PATCH v6 10/28] powerpc: Introduce functions for instruction equality

2020-04-27 Thread Jordan Niethe
In preparation for an instruction data type that can not be directly used with the '==' operator use functions for checking equality. Reviewed-by: Balamuruhan S Signed-off-by: Jordan Niethe --- v5: Remove ppc_inst_null() --- arch/powerpc/include/asm/inst.h| 5 +

[PATCH v6 09/28] powerpc: Use a function for byte swapping instructions

2020-04-27 Thread Jordan Niethe
Use a function for byte swapping instructions in preparation of a more complicated instruction type. Reviewed-by: Balamuruhan S Signed-off-by: Jordan Niethe --- arch/powerpc/include/asm/inst.h | 5 + arch/powerpc/kernel/align.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)

[PATCH v6 08/28] powerpc: Use a function for getting the instruction op code

2020-04-27 Thread Jordan Niethe
In preparation for using a data type for instructions that can not be directly used with the '>>' operator use a function for getting the op code of an instruction. Signed-off-by: Jordan Niethe --- v4: New to series v6: - Rename ppc_inst_primary() to ppc_inst_primary_opcode() - Use in

[PATCH v6 07/28] powerpc: Use an accessor for instructions

2020-04-27 Thread Jordan Niethe
In preparation for introducing a more complicated instruction type to accomodate prefixed instructions use an accessor for getting an instruction as a u32. Signed-off-by: Jordan Niethe --- v4: New to series v5: Remove references to 'word' instructions v6: - test_emulate_step.c:

[PATCH v6 06/28] powerpc: Use a macro for creating instructions from u32s

2020-04-27 Thread Jordan Niethe
In preparation for instructions having a more complex data type start using a macro, ppc_inst(), for making an instruction out of a u32. A macro is used so that instructions can be used as initializer elements. Currently this does nothing, but it will allow for creating a data type that can

[PATCH v6 05/28] powerpc: Change calling convention for create_branch() et. al.

2020-04-27 Thread Jordan Niethe
create_branch(), create_cond_branch() and translate_branch() return the instruction that they create, or return 0 to signal an error. Separate these concerns in preparation for an instruction type that is not just an unsigned int. Fill the created instruction to a pointer passed as the first

[PATCH v6 04/28] powerpc/xmon: Use bitwise calculations in_breakpoint_table()

2020-04-27 Thread Jordan Niethe
A modulo operation is used for calculating the current offset from a breakpoint within the breakpoint table. As instruction lengths are always a power of 2, this can be replaced with a bitwise 'and'. The current check for word alignment can be replaced with checking that the lower 2 bits are not

[PATCH v6 03/28] powerpc/xmon: Move breakpoints to text section

2020-04-27 Thread Jordan Niethe
The instructions for xmon's breakpoint are stored bpt_table[] which is in the data section. This is problematic as the data section may be marked as no execute. Move bpt_table[] to the text section. Signed-off-by: Jordan Niethe --- v6: - New to series. Was part of the previous patch. - Make

[PATCH v6 02/28] powerpc/xmon: Move breakpoint instructions to own array

2020-04-27 Thread Jordan Niethe
To execute an instruction out of line after a breakpoint, the NIP is set to the address of struct bpt::instr. Here a copy of the instruction that was replaced with a breakpoint is kept, along with a trap so normal flow can be resumed after XOLing. The struct bpt's are located within the data

[PATCH v6 01/28] powerpc/xmon: Remove store_inst() for patch_instruction()

2020-04-27 Thread Jordan Niethe
For modifying instructions in xmon, patch_instruction() can serve the same role that store_inst() is performing with the advantage of not being specific to xmon. In some places patch_instruction() is already being using followed by store_inst(). In these cases just remove the store_inst().

[PATCH v6 00/28] Initial Prefixed Instruction support

2020-04-27 Thread Jordan Niethe
A future revision of the ISA will introduce prefixed instructions. A prefixed instruction is composed of a 4-byte prefix followed by a 4-byte suffix. All prefixes have the major opcode 1. A prefix will never be a valid word instruction. A suffix may be an existing word instruction or a new

[PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

2020-04-27 Thread H.J. Lu
arch/powerpc/kernel/vmlinux.lds.S has DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) *(.glink .iplt .plt .rela* .comment) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) } Since .rela* sections are

[PATCH 2/2] Discard .note.gnu.property sections in generic NOTES

2020-04-27 Thread H.J. Lu
With the command-line option, -mx86-used-note=yes, the x86 assembler in binutils 2.32 and above generates a program property note in a note section, .note.gnu.property, to encode used x86 ISAs and features. But kernel linker script only contains a single NOTE segment: PHDRS { text PT_LOAD

Re: [PATCH] ibmvfc: don't send implicit logouts prior to NPIV login

2020-04-27 Thread Martin K. Petersen
Tyrel, > Commit ed830385a2b1 ("scsi: ibmvfc: Avoid loss of all paths during SVC > node reboot") introduced a regression where when the client resets or > re-enables its CRQ with the hypervisor there is a chance that if the > server side doesn't issue its INIT handshake quick enough the client >

Re: [PATCH] ibmvscsi: fix WARN_ON during event pool release

2020-04-27 Thread Martin K. Petersen
On Mon, 27 Apr 2020 15:49:53 -0700, Tyrel Datwyler wrote: > While removing an ibmvscsi client adapter a WARN_ON like the following > is seen in the kernel log: Applied to 5.7/scsi-fixes, thanks! [1/1] scsi: ibmvscsi: fix WARN_ON during event pool release

Re: [PATCH] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

2020-04-27 Thread Michael Ellerman
"H.J. Lu" writes: > arch/powerpc/kernel/vmlinux.lds.S has > > DISCARDS > /DISCARD/ : { > *(*.EMB.apuinfo) > *(.glink .iplt .plt .rela* .comment) > *(.gnu.version*) > *(.gnu.attributes) > *(.eh_frame)

Re: [RFC 1/3] powernv/cpuidle : Support for pre-entry and post exit of stop state in firmware

2020-04-27 Thread Nicholas Piggin
Thanks for picking this up and pushing it along. I do plan to come back and take another look at it all, but what we do need to do first is get a coherent approach to this proposed new calling convention and OS ops. It's fine to work on this in the meantime, but to start merging things my idea

Re: [PATCH v2,RESEND] misc: new driver sram_uapi for user level SRAM access

2020-04-27 Thread Scott Wood
On Mon, 2020-04-27 at 09:13 -0500, Rob Herring wrote: > On Sun, Apr 19, 2020 at 10:06 PM Wang Wenhu wrote: > > > > A generic User-Kernel interface that allows a misc device created > > by it to support file-operations of ioctl and mmap to access SRAM > > memory from user level. Different kinds

[PATCH] ibmvscsi: fix WARN_ON during event pool release

2020-04-27 Thread Tyrel Datwyler
While removing an ibmvscsi client adapter a WARN_ON like the following is seen in the kernel log: drmgr: drmgr: -r -c slot -s U9080.M9S.783AEC8-V11-C11 -w 5 -d 1 WARNING: CPU: 9 PID: 24062 at ../kernel/dma/mapping.c:311 dma_free_attrs+0x78/0x110 Supported: No, Unreleased kernel CPU: 9 PID: 24062

Re: [PATCH 2/7] signal: factor copy_siginfo_to_external32 from copy_siginfo_to_user32

2020-04-27 Thread Andrew Morton
On Sun, 26 Apr 2020 09:40:39 +0200 Christoph Hellwig wrote: > On Sat, Apr 25, 2020 at 09:47:24PM -0700, Andrew Morton wrote: > > I looked at fixing it but surely this sort of thing: > > > > > > int copy_siginfo_to_user32(struct compat_siginfo __user *to, > >const struct

Re: [PATCH v2 1/2] PCI/AER: Allow Native AER Host Bridges to use AER

2020-04-27 Thread Bjorn Helgaas
On Mon, Apr 27, 2020 at 04:11:07PM +, Derrick, Jonathan wrote: > On Fri, 2020-04-24 at 18:30 -0500, Bjorn Helgaas wrote: > > I'm glad you raised this because I think the way we handle > > FIRMWARE_FIRST is really screwed up. > > > > On Mon, Apr 20, 2020 at 03:37:09PM -0600, Jon Derrick wrote:

[PATCH] ibmvfc: don't send implicit logouts prior to NPIV login

2020-04-27 Thread Tyrel Datwyler
From: Brian King Commit ed830385a2b1 ("scsi: ibmvfc: Avoid loss of all paths during SVC node reboot") introduced a regression where when the client resets or re-enables its CRQ with the hypervisor there is a chance that if the server side doesn't issue its INIT handshake quick enough the client

[PATCH v3 23/29] docs: filesystems: convert spufs/spufs.txt to ReST

2020-04-27 Thread Mauro Carvalho Chehab
This file is at groff output format. Manually convert it to ReST format, trying to preserve a similar output after parsed. Signed-off-by: Mauro Carvalho Chehab --- Documentation/filesystems/spufs/index.rst | 1 + .../spufs/{spufs.txt => spufs.rst}| 59 +--

[PATCH v3 00/29] Convert files to ReST - part 2

2020-04-27 Thread Mauro Carvalho Chehab
This is the second part of a series I wrote sometime ago where I manually convert lots of files to be properly parsed by Sphinx as ReST files. As it touches on lot of stuff, this series is based on today's linux-next, at tag next-20190617. The first version of this series had 57 patches. The

[PATCH] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

2020-04-27 Thread H.J. Lu
arch/powerpc/kernel/vmlinux.lds.S has DISCARDS /DISCARD/ : { *(*.EMB.apuinfo) *(.glink .iplt .plt .rela* .comment) *(.gnu.version*) *(.gnu.attributes) *(.eh_frame) } Since .rela* sections are

Re: [PATCH 1/5] powerpc/spufs: simplify spufs core dumping

2020-04-27 Thread Al Viro
On Mon, Apr 27, 2020 at 10:06:21PM +0200, Christoph Hellwig wrote: > @@ -1988,7 +1984,12 @@ static ssize_t spufs_mbox_info_read(struct file *file, > char __user *buf, > if (ret) > return ret; > spin_lock(>csa.register_lock); > - ret = __spufs_mbox_info_read(ctx,

Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-04-27 Thread Mike Kravetz
On 4/27/20 1:18 PM, Andrew Morton wrote: > On Mon, 27 Apr 2020 12:09:47 -0700 Mike Kravetz > wrote: > >> Previously, a check for hugepages_supported was added before processing >> hugetlb command line parameters. On some architectures such as powerpc, >> hugepages_supported() is not set to

Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-04-27 Thread Andrew Morton
On Mon, 27 Apr 2020 12:09:47 -0700 Mike Kravetz wrote: > Previously, a check for hugepages_supported was added before processing > hugetlb command line parameters. On some architectures such as powerpc, > hugepages_supported() is not set to true until after command line > processing.

[PATCH 5/5] binfmt_elf_fdpic: remove the set_fs(KERNEL_DS) in elf_fdpic_core_dump

2020-04-27 Thread Christoph Hellwig
There is no logic in elf_fdpic_core_dump itself or in the various arch helpers called from it which use uaccess routines on kernel pointers except for the file writes thate are nicely encapsulated by using __kernel_write in dump_emit. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf_fdpic.c |

[PATCH 4/5] binfmt_elf: remove the set_fs(KERNEL_DS) in elf_core_dump

2020-04-27 Thread Christoph Hellwig
There is no logic in elf_core_dump itself or in the various arch helpers called from it which use uaccess routines on kernel pointers except for the file writes thate are nicely encapsulated by using __kernel_write in dump_emit. Signed-off-by: Christoph Hellwig --- fs/binfmt_elf.c | 40

[PATCH 3/5] binfmt_elf: remove the set_fs in fill_siginfo_note

2020-04-27 Thread Christoph Hellwig
From: "Eric W. Biederman" The code in binfmt_elf.c is differnt from the rest of the code that processes siginfo, as it sends siginfo from a kernel buffer to a file rather than from kernel memory to userspace buffers. To remove it's use of set_fs the code needs some different siginfo helpers.

[PATCH 2/5] signal: factor copy_siginfo_to_external32 from copy_siginfo_to_user32

2020-04-27 Thread Christoph Hellwig
From: "Eric W. Biederman" To remove the use of set_fs in the coredump code there needs to be a way to convert a kernel siginfo to a userspace compat siginfo. Call that function copy_siginfo_to_compat and factor it out of copy_siginfo_to_user32. The existence of x32 complicates this code. On

[PATCH 1/5] powerpc/spufs: simplify spufs core dumping

2020-04-27 Thread Christoph Hellwig
Replace the coredump ->read method with a ->dump method that must call dump_emit itself. That way we avoid a buffer allocation an messing with set_fs() to call into code that is intended to deal with user buffers. For the ->get case we can now use a small on-stack buffer and avoid memory

remove set_fs calls from the coredump code v4

2020-04-27 Thread Christoph Hellwig
Hi all, this series gets rid of playing with the address limit in the exec and coredump code. Most of this was fairly trivial, the biggest changes are those to the spufs coredump code. Changes since v3: - fix x86 compilation with x32 in the new version of the signal code - split the exec

Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-04-27 Thread Mike Kravetz
On 4/27/20 10:25 AM, Mike Kravetz wrote: > On 4/26/20 10:04 PM, Sandipan Das wrote: >> On 18/04/20 12:20 am, Mike Kravetz wrote: >>> Now that architectures provide arch_hugetlb_valid_size(), parsing >>> of "hugepagesz=" can be done in architecture independent code. >> >> This isn't working as

[PATCH] powerpc: Add interrupt mode information in /proc/cpuinfo

2020-04-27 Thread Cédric Le Goater
PowerNV and pSeries machines can run using the XIVE or XICS interrupt mode. Report this information in /proc/cpuinfo : timebase: 51200 platform: PowerNV model : 9006-22C machine : PowerNV 9006-22C firmware: OPAL MMU : Radix IRQ

Re: [PATCH v4] pci: Make return value of pcie_capability_read*() consistent

2020-04-27 Thread Bjorn Helgaas
[+cc Thomas, Michael, linux-mips, linux-ppc, LKML Background: - PCI config accessors (pci_read_config_word(), etc) return 0 or a positive error (PCIBIOS_BAD_REGISTER_NUMBER, etc). - PCI Express capability accessors (pcie_capability_read_word(), etc) return 0, a negative error

[PATCH net] ibmvnic: Fall back to 16 H_SEND_SUB_CRQ_INDIRECT entries with old FW

2020-04-27 Thread Juliet Kim
The maximum entries for H_SEND_SUB_CRQ_INDIRECT has increased on some platforms from 16 to 128. If Live Partition Mobility is used to migrate a running OS image from a newer source platform to an older target platform, then H_SEND_SUB_CRQ_INDIRECT will fail with H_PARAMETER if 128 entries are

Re: [PATCH v3 2/4] hugetlbfs: move hugepagesz= parsing to arch independent code

2020-04-27 Thread Mike Kravetz
On 4/26/20 10:04 PM, Sandipan Das wrote: > Hi Mike, > > On 18/04/20 12:20 am, Mike Kravetz wrote: >> Now that architectures provide arch_hugetlb_valid_size(), parsing >> of "hugepagesz=" can be done in architecture independent code. >> Create a single routine to handle hugepagesz= parsing and

Re: [PATCH 1/3] powerpc: Properly return error code from do_patch_instruction()

2020-04-27 Thread Naveen N. Rao
Christopher M. Riedl wrote: On Fri Apr 24, 2020 at 9:15 AM, Steven Rostedt wrote: On Thu, 23 Apr 2020 18:21:14 +0200 Christophe Leroy wrote: > Le 23/04/2020 à 17:09, Naveen N. Rao a écrit : > > With STRICT_KERNEL_RWX, we are currently ignoring return value from > > __patch_instruction() in

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-27 Thread Naveen N. Rao
Steven Rostedt wrote: On Sat, 25 Apr 2020 10:11:56 + Christophe Leroy wrote: Sure it's be more explicit, but then more lines also. 3 lines for only one really usefull. With goto, I would look like: diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c index

Re: [PATCH 3/3] powerpc/kprobes: Check return value of patch_instruction()

2020-04-27 Thread Naveen N. Rao
Christophe Leroy wrote: On 04/24/2020 06:26 PM, Naveen N. Rao wrote: Steven Rostedt wrote: On Thu, 23 Apr 2020 17:41:52 +0200 Christophe Leroy wrote: > diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c > index 024f7aad1952..046485bb0a52 100644 > ---

RE: [PATCH] x86: Fix early boot crash on gcc-10, next try

2020-04-27 Thread David Laight
From: Borislav Petkov > Sent: 25 April 2020 18:53 ... > IOW, something like this (ontop) which takes care of the xen case too. > If it needs to be used by all arches, then I'll split the patch: . > - asm (""); > + prevent_tail_call_optimization(); > } One obvious implementation would be

Re: [PATCH v2 1/2] PCI/AER: Allow Native AER Host Bridges to use AER

2020-04-27 Thread Derrick, Jonathan
Hi Bjorn, On Fri, 2020-04-24 at 18:30 -0500, Bjorn Helgaas wrote: > Hi Jon, > > I'm glad you raised this because I think the way we handle > FIRMWARE_FIRST is really screwed up. > > On Mon, Apr 20, 2020 at 03:37:09PM -0600, Jon Derrick wrote: > > Some platforms have a mix of ports whose

Re: [PATCH v2 2/2] PCI/DPC: Allow Native DPC Host Bridges to use DPC

2020-04-27 Thread Kuppuswamy, Sathyanarayanan
On 4/27/20 8:15 AM, Derrick, Jonathan wrote: Hi Sathyanarayanan, On Sat, 2020-04-25 at 13:46 -0700, Kuppuswamy, Sathyanarayanan wrote: On 4/23/20 8:11 AM, Derrick, Jonathan wrote: Hi Sathyanarayanan, On Wed, 2020-04-22 at 15:50 -0700, Kuppuswamy, Sathyanarayanan wrote: On 4/20/20 2:37

Re: [PATCH v2 2/2] PCI/DPC: Allow Native DPC Host Bridges to use DPC

2020-04-27 Thread Derrick, Jonathan
Hi Sathyanarayanan, On Sat, 2020-04-25 at 13:46 -0700, Kuppuswamy, Sathyanarayanan wrote: > > On 4/23/20 8:11 AM, Derrick, Jonathan wrote: > > Hi Sathyanarayanan, > > > > On Wed, 2020-04-22 at 15:50 -0700, Kuppuswamy, Sathyanarayanan wrote: > > > On 4/20/20 2:37 PM, Jon Derrick wrote: > > > >

Re: [PATCH v2 6/7] debugfs: switch to simplefs inode creation API

2020-04-27 Thread Paolo Bonzini
On 21/04/20 15:57, Emanuele Giuseppe Esposito wrote: > - inode = debugfs_get_inode(dentry->d_sb); You're not removing debugfs_get_inode so I think you're going to get a warning (same in tracefs)? You can wait a few more days for reviews and/or Acked-bys (especially for patches 6 and 7) and

Re: [PATCH v2, RESEND] misc: new driver sram_uapi for user level SRAM access

2020-04-27 Thread Rob Herring
On Sun, Apr 19, 2020 at 10:06 PM Wang Wenhu wrote: > > A generic User-Kernel interface that allows a misc device created > by it to support file-operations of ioctl and mmap to access SRAM > memory from user level. Different kinds of SRAM alloction and free > APIs could be registered by specific

Re: [RFC 3/3] powernv/cpuidle : Introduce capability for firmware-enabled-stop

2020-04-27 Thread Gautham R Shenoy
On Sun, Apr 26, 2020 at 09:10:27PM -0500, Abhishek Goel wrote: > This patch introduces the capability for firmware to handle the stop > states instead. A bit is set based on the discovery of the feature > and correspondingly also the responsibility to handle the stop states. > > If Kernel does

Re: [RFC 2/3] powernv/cpuidle : Interface for an idle-stop dependency structure

2020-04-27 Thread Gautham R Shenoy
On Sun, Apr 26, 2020 at 09:10:26PM -0500, Abhishek Goel wrote: > This patch introduces the idea of having a dependency structure for > idle-stop. The structure encapsulates the following: > 1. Bitmask for version of idle-stop > 2. Bitmask for propterties like ENABLE/DISABLE > 3. Function pointer

Re: [PATCH v5 0/6] implement KASLR for powerpc/fsl_booke/64

2020-04-27 Thread Daniel Axtens
Hi Jason, > Thanks for the test. Can you send me the full log which may contain the > system info such as the following: It's attached. Regards, Daniel fail-log Description: Binary data > > - > phys_mem_size = 0x2 >

Re: New powerpc vdso calling convention

2020-04-27 Thread Adhemerval Zanella
On 26/04/2020 00:41, Nicholas Piggin wrote: > Excerpts from Rich Felker's message of April 26, 2020 9:11 am: >> On Sun, Apr 26, 2020 at 08:58:19AM +1000, Nicholas Piggin wrote: >>> Excerpts from Christophe Leroy's message of April 25, 2020 10:20 pm: Le 25/04/2020 à 12:56,

Re: [PATCH v2] ASoC: fsl_easrc: Check for null pointer before dereferencing "ctx" in fsl_easrc_hw_free()

2020-04-27 Thread Mark Brown
On Sat, 25 Apr 2020 15:19:29 +0800, Shengjiu Wang wrote: > The patch 955ac624058f: "ASoC: fsl_easrc: Add EASRC ASoC CPU DAI > drivers" from Apr 16, 2020, leads to the following Smatch complaint: > > sound/soc/fsl/fsl_easrc.c:1529 fsl_easrc_hw_free() > warn: variable dereferenced before check

Re: [PATCH v2] ASoC: fsl_esai: Disable exception interrupt before scheduling tasklet

2020-04-27 Thread Mark Brown
On Mon, 27 Apr 2020 14:23:21 +0800, Shengjiu Wang wrote: > Disable exception interrupt before scheduling tasklet, otherwise if > the tasklet isn't handled immediately, there will be endless xrun > interrupt. > > Fixes: 7ccafa2b3879 ("ASoC: fsl_esai: recover the channel swap after xrun") >

Re: [RFC 1/3] powernv/cpuidle : Support for pre-entry and post exit of stop state in firmware

2020-04-27 Thread Gautham R Shenoy
Hi Abhishek, On Sun, Apr 26, 2020 at 09:10:25PM -0500, Abhishek Goel wrote: > This patch provides kernel framework fro opal support of save restore > of sprs in idle stop loop. Opal support for stop states is needed to > selectively enable stop states or to introduce a quirk quickly in case > a

[RFC PATCH 19/25] powerpc/book3s64/kuap: Restrict access to userspace based on userspace AMR

2020-04-27 Thread Aneesh Kumar K.V
If an application has configured address protection such that read/write is denied using pkey even the kernel should receive a FAULT on accessing the same. This patch use user AMR value stored in pt_regs.kuap to achieve the same. Signed-off-by: Aneesh Kumar K.V ---

[RFC PATCH 24/25] powerpc/book3s64/hash/kuep: Enable KUEP on hash

2020-04-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 40b6240ecc89..a1952ee6668e 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[RFC PATCH 22/25] powerpc/book3s64/kuep: Use Key 3 to implement KUEP with hash translation.

2020-04-27 Thread Aneesh Kumar K.V
Radix use IAMR Key 0 and hash translation use IAMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h index

[RFC PATCH 25/25] powerpc/book3s64/keys: Print information during boot.

2020-04-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index a1952ee6668e..660e0691db07 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[RFC PATCH 21/25] powerpc/book3s64/kuap: Use Key 3 to implement KUAP with hash translation.

2020-04-27 Thread Aneesh Kumar K.V
Radix use AMR Key 0 and hash translation use AMR key 3. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/kup.h b/arch/powerpc/include/asm/book3s/64/kup.h

[RFC PATCH 20/25] powerpc/book3s64/kuap: Improve error reporting with KUAP

2020-04-27 Thread Aneesh Kumar K.V
With hash translation use DSISR_KEYFAULT to identify a wrong access. With Radix we look at the AMR value and type of fault. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 7 -- arch/powerpc/mm/fault.c | 27 +++- 2 files

[RFC PATCH 23/25] powerpc/book3s64/hash/kuap: Enable kuap on hash

2020-04-27 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/book3s64/pkeys.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 2484d8502499..40b6240ecc89 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++

[RFC PATCH 18/25] powerpc/book3s64/pkeys: Don't update SPRN_AMR when in kernel mode.

2020-04-27 Thread Aneesh Kumar K.V
Now that kernel correctly store/restore userspace AMR/IAMR values, avoid manipulating AMR and IAMR from the kernel on behalf of userspace. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/kup.h | 27 + arch/powerpc/include/asm/pkeys.h | 2 -

[RFC PATCH 17/25] powerpc/ptrace-view: Use pt_regs values instead of thread_struct based one.

2020-04-27 Thread Aneesh Kumar K.V
We will remove thread.amr/iamr/uamor in a later patch Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/kernel/ptrace/ptrace-view.c | 23 +-- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c

[RFC PATCH 16/25] powerpc/book3s64/pkeys: Reset userspace AMR correctly on exec

2020-04-27 Thread Aneesh Kumar K.V
On fork, we inherit from the parent and on exec, we should switch to default_amr values. Also, avoid changing the AMR register value within the kernel. The kernel now runs with different AMR values. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pkeys.h | 1 +

  1   2   >