Re: [PATCH v3] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 13/09/2018 à 05:03, Michael Neuling a écrit : This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck()

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Michael Neuling
On Thu, 2018-09-13 at 07:38 +0200, Christophe LEROY wrote: > > Le 13/09/2018 à 03:21, Tyrel Datwyler a écrit : > > On 09/12/2018 05:36 PM, Michael Neuling wrote: > > > > > > > > > > > > + (unsigned long)patch_addr); > > > > > > > > Please align second line as per Codying

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 13/09/2018 à 02:36, Michael Neuling a écrit : --- a/arch/powerpc/lib/code-patching.c +++ b/arch/powerpc/lib/code-patching.c @@ -23,11 +23,33 @@ #include #include + This blank line is not needed Ack +static inline bool in_init_section(unsigned int *patch_addr) +{ +

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 13/09/2018 à 03:21, Tyrel Datwyler a écrit : On 09/12/2018 05:36 PM, Michael Neuling wrote: + (unsigned long)patch_addr); Please align second line as per Codying style. Sorry I can't see what's wrong. You're (or Cody :-P) going to have to spell it this out

[PATCH] KVM: PPC: Book3S HV: Fix guest r11 corruption with POWER9 TM workarounds

2018-09-12 Thread Michael Neuling
When we come into the softpatch handler (0x1500), we use r11 to store the HSRR0 for later use by the denorm handler. We also use the softpatch handler for the TM workarounds for POWER9. Unfortunately, in kvmppc_interrupt_hv we later store r11 out to the vcpu assuming it's still what we got from

RE: [PATCH 0/7 v7] Support for fsl-mc bus and its devices in SMMU

2018-09-12 Thread Nipun Gupta
> -Original Message- > From: Will Deacon [mailto:will.dea...@arm.com] > Sent: Wednesday, September 12, 2018 10:29 PM > To: Nipun Gupta > Cc: j...@8bytes.org; robin.mur...@arm.com; robh...@kernel.org; > r...@kernel.org; mark.rutl...@arm.com; catalin.mari...@arm.com; >

[PATCH v3] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Michael Neuling
This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck() -> barrier_nospec(); We have a code patching

Re: [PATCH] MAINTAINERS: Add PPC contacts for PCI core error handling

2018-09-12 Thread Russell Currey
On Wed, 2018-09-12 at 11:58 -0500, Bjorn Helgaas wrote: > On Wed, Sep 12, 2018 at 11:55:26AM -0500, Bjorn Helgaas wrote: > > From: Bjorn Helgaas > > > > The original PCI error recovery functionality was for the powerpc-specific > > IBM EEH feature. PCIe subsequently added some similar features,

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Tyrel Datwyler
On 09/12/2018 05:36 PM, Michael Neuling wrote: > >>> --- a/arch/powerpc/lib/code-patching.c >>> +++ b/arch/powerpc/lib/code-patching.c >>> @@ -23,11 +23,33 @@ >>> #include >>> #include >>> >>> + >> >> This blank line is not needed > > Ack > >> >>> +static inline bool

Re: [PATCH v2 03/17] compat_ioctl: use correct compat_ptr() translation in drivers

2018-09-12 Thread Andrew Donnellan
On 13/09/18 01:01, Arnd Bergmann wrote: A handful of drivers all have a trivial wrapper around their ioctl handler, but don't call the compat_ptr() conversion function at the moment. In practice this does not matter, since none of them are used on the s390 architecture and for all other

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Michael Neuling
> > --- a/arch/powerpc/lib/code-patching.c > > +++ b/arch/powerpc/lib/code-patching.c > > @@ -23,11 +23,33 @@ > > #include > > #include > > > > + > > This blank line is not needed Ack > > > +static inline bool in_init_section(unsigned int *patch_addr) > > +{ > > + if (patch_addr <

[PATCH v2] selftests/powerpc: Do not fail with reschedule

2018-09-12 Thread Breno Leitao
There are cases where the test is not expecting to have the transaction aborted, but, the test process might have been rescheduled, either in the OS level or by KVM (if it is running on a KVM guest machine). The process reschedule will cause a treclaim/recheckpoint which will cause the transaction

[RFC PATCH 11/11] selftests/powerpc: Adapt the test

2018-09-12 Thread Breno Leitao
The Documentation/powerpc/transactional_memory.txt says: "Syscalls made from within a suspended transaction are performed as normal and the transaction is not explicitly doomed by the kernel. However, what the kernel does to perform the syscall may result in the transaction being doomed

[RFC PATCH 10/11] powerpc/tm: Set failure summary

2018-09-12 Thread Breno Leitao
Since the transaction will be doomed with treckpt., the TEXASR[FS] should be set, to reflect that the transaction is a failure. This patch ensures it before recheckpointing, and remove changes from other places that were calling recheckpoint. Signed-off-by: Breno Leitao ---

[RFC PATCH 09/11] powerpc/tm: Do not restore default DSCR

2018-09-12 Thread Breno Leitao
In the previous TM code, trecheckpoint was being executed in the middle of an exception, thus, DSCR was being restored to default kernel DSCR value after trecheckpoint was done. With this current patchset, trecheckpoint is executed just before getting to userspace, at ret_from_except_lite, for

[RFC PATCH 08/11] powerpc/tm: Do not reclaim on ptrace

2018-09-12 Thread Breno Leitao
Make sure that we are not suspended on ptrace and that the registers were already reclaimed. Since the data was already reclaimed, there is nothing to be done here except to restore the SPRs. Signed-off-by: Breno Leitao --- arch/powerpc/kernel/ptrace.c | 10 -- 1 file changed, 4

[RFC PATCH 07/11] powerpc/tm: Do not recheckpoint at sigreturn

2018-09-12 Thread Breno Leitao
Do not recheckpoint at signal code return. Just make sure TIF_RESTORE_TM is set, which will restore on the exit to userspace by restore_tm_state. All the FP and VEC lazy restore was already done by tm_reclaim_current(), where it checked if FP/VEC was set, and filled out the ckfp and ckvr

[RFC PATCH 06/11] powerpc/tm: Refactor the __switch_to_tm code

2018-09-12 Thread Breno Leitao
__switch_to_tm is the function that switches between two tasks which might have TM enabled. This function is clearly split in two parts, the task that is leaving the CPU, known as 'prev' and the task that is being scheduled, known as new. It starts checking if the previous task had TM enable, if

[RFC PATCH 05/11] powerpc/tm: Function that updates the failure code

2018-09-12 Thread Breno Leitao
Now the transaction reclaims happens very earlier in the trap handler, and it is impossible to know precisely, at that early time, what should be set as the failure cause for some specific cases, as, if the task will be rescheduled, thus, the transaction abort case should be updated from

[RFC PATCH 04/11] powerpc/tm: Always set TIF_RESTORE_TM on reclaim

2018-09-12 Thread Breno Leitao
If the task data was reclaimed (through TM_KERNEL_ENTRY), then it needs to be recheckpointed later, once exiting to userspace. The recheckpoint is done by restore_tm_state() function, which is called on our way to userspace if the task has the TIF_RESTORE_TM flag set. This patch makes sure the

[RFC PATCH 03/11] powerpc/tm: Recheckpoint when exiting from kernel

2018-09-12 Thread Breno Leitao
This is the only place we are going to recheckpoint now. Now the task needs to have TIF_RESTORE_TM flag set, which will get into restore_tm_state() and execute the recheckpoint if MSR shows that the transaction was active. Every time a task is required to recheckpoint, or just have the TM SPRs

[RFC PATCH 02/11] powerpc/tm: Reclaim on unavailable exception

2018-09-12 Thread Breno Leitao
If there is a FP/VEC/Altivec touch inside a transaction and the facility is disabled, then a facility unavailable exception is raised and ends up calling {fp,vec,vsx}_unavailable_tm, which was reclaiming and recheckpointing. This is not required anymore, since the checkpointed state was reclaimed

[RFC PATCH 01/11] powerpc/tm: Reclaim transaction on kernel entry

2018-09-12 Thread Breno Leitao
This patch creates a macro that will be invoked on all entrance to the kernel, so, in kernel space the transaction will be completely reclaimed and not suspended anymore. This patchset checks if we are coming from PR, if not, skip. This is useful when there is a irq_replay() being called after

[RFC PATCH 00/11] New TM Model

2018-09-12 Thread Breno Leitao
This patchset for the hardware transactional memory (TM) subsystem aims to avoid spending a lot of time on TM suspended mode in kernel space. It basically changes where the reclaim/recheckpoint will be executed. Once a CPU enters in transactional state it uses a footprint area to track down the

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Greg Kroah-Hartman
On Wed, Sep 12, 2018 at 05:08:52PM +0200, Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390

Re: [PATCH v2 03/17] compat_ioctl: use correct compat_ptr() translation in drivers

2018-09-12 Thread Greg Kroah-Hartman
On Wed, Sep 12, 2018 at 05:01:04PM +0200, Arnd Bergmann wrote: > A handful of drivers all have a trivial wrapper around their ioctl > handler, but don't call the compat_ptr() conversion function at the > moment. In practice this does not matter, since none of them are used > on the s390

[PATCH] powerpc/pseries: Track LMB nid instead of using device tree

2018-09-12 Thread Nathan Fontenot
When removing memory we need to remove the memory from the node it was added to instead of looking up the node it should be in in the device tree. During testing we have seen scenarios where the affinity for a LMB changes due to a partition migration or PRRN event. In these cases the node the LMB

Re: [PATCH] MAINTAINERS: Add PPC contacts for PCI core error handling

2018-09-12 Thread Bjorn Helgaas
On Wed, Sep 12, 2018 at 11:55:26AM -0500, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > The original PCI error recovery functionality was for the powerpc-specific > IBM EEH feature. PCIe subsequently added some similar features, including > AER and DPC, that can be used on any architecture. >

Re: [PATCH 0/7 v7] Support for fsl-mc bus and its devices in SMMU

2018-09-12 Thread Will Deacon
Hi Nipun, On Mon, Sep 10, 2018 at 07:19:14PM +0530, Nipun Gupta wrote: > This patchset defines IOMMU DT binding for fsl-mc bus and adds > support in SMMU for fsl-mc bus. > > These patches > - Define property 'iommu-map' for fsl-mc bus (patch 1) > - Integrates the fsl-mc bus with the SMMU

[PATCH] MAINTAINERS: Add PPC contacts for PCI core error handling

2018-09-12 Thread Bjorn Helgaas
From: Bjorn Helgaas The original PCI error recovery functionality was for the powerpc-specific IBM EEH feature. PCIe subsequently added some similar features, including AER and DPC, that can be used on any architecture. We want the generic PCI core error handling support to work with all of

Re: [PATCH 0/2] sriov enablement on s390

2018-09-12 Thread Benjamin Herrenschmidt
On Wed, 2018-09-12 at 08:02 -0500, Bjorn Helgaas wrote: > [+cc Arnd, powerpc folks] [+Oliver] > On Wed, Sep 12, 2018 at 02:34:09PM +0200, Sebastian Ott wrote: > > Hello Bjorn, > > > > On s390 we currently handle SRIOV within firmware. Which means > > that the PF is under firmware control and

Re: [RFC PATCH v1 00/17] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-12 Thread Christophe LEROY
Le 06/09/2018 à 11:58, Aneesh Kumar K.V a écrit : Christophe Leroy writes: Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not

Re: [RFC PATCH v1 00/17] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-12 Thread Christophe LEROY
Le 10/09/2018 à 08:08, Aneesh Kumar K.V a écrit : Christophe Leroy writes: On 09/06/2018 09:58 AM, Aneesh Kumar K.V wrote: Christophe Leroy writes: Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Mauro Carvalho Chehab
Em Wed, 12 Sep 2018 17:08:52 +0200 Arnd Bergmann escreveu: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390

[PATCH v2 24/24] powerpc/book3s64: Avoid multiple endian conversion in pte helpers

2018-09-12 Thread Christophe Leroy
In the same spirit as already done in pte query helpers, this patch changes pte setting helpers to perform endian conversions on the constants rather than on the pte value. In the meantime, it changes pte_access_permitted() to use pte helpers for the same reason. Signed-off-by: Christophe Leroy

[PATCH v2 23/24] powerpc/8xx: change name of a few page flags to avoid confusion

2018-09-12 Thread Christophe Leroy
_PAGE_PRIVILEGED corresponds to the SH bit which doesn't protect against user access but only disables ASID verification on kernel accesses. User access is controlled with _PMD_USER flag. Name it _PAGE_SH instead of _PAGE_PRIVILEGED _PAGE_HUGE corresponds to the SPS bit which doesn't really

[PATCH v2 22/24] powerpc/mm: Get rid of pte-common.h

2018-09-12 Thread Christophe Leroy
Do not include pte-common.h in nohash/32/pgtable.h As that was the last includer, get rid of pte-common.h Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/32/pgtable.h | 23 +-- arch/powerpc/include/asm/pte-common.h|

[PATCH v2 21/24] powerpc/mm: Define platform default caches related flags

2018-09-12 Thread Christophe Leroy
Cache related flags like _PAGE_COHERENT and _PAGE_WRITETHRU are defined on most platforms. The platforms not defining them don't define any alternative. So we can give them a NUL value directly for those platforms directly. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy ---

[PATCH v2 20/24] powerpc/mm: Allow platforms to redefine some helpers

2018-09-12 Thread Christophe Leroy
The 40xx defines _PAGE_HWWRITE while others don't. The 8xx defines _PAGE_RO instead of _PAGE_RW. The 8xx defines _PAGE_PRIVILEGED instead of _PAGE_USER. The 8xx defines _PAGE_HUGE and _PAGE_NA while others don't. Lets those platforms redefine pte_write(), pte_wrprotect() and pte_mkwrite() and get

[PATCH v2 19/24] powerpc/nohash/64: do not include pte-common.h

2018-09-12 Thread Christophe Leroy
nohash/64 only uses book3e PTE flags, so it doesn't need pte-common.h This also allows to drop PAGE_SAO and H_PAGE_4K_PFN from pte_common.h as they are only used by PPC64 Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/64/pgtable.h | 16

[PATCH v2 18/24] powerpc/mm: Distribute platform specific PAGE and PMD flags and definitions

2018-09-12 Thread Christophe Leroy
The base kernel PAGE_ definition sets are more or less platform specific. Lets distribute them close to platform _PAGE_XXX flags definition, and customise them to their exact platform flags. Also defines _PAGE_PSIZE and _PTE_NONE_MASK for each platform allthough they are defined as 0. Do the

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Daniel Vetter
On Wed, Sep 12, 2018 at 5:08 PM, Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390 architecture,

[PATCH v2 17/24] powerpc/mm: Move pte_user() into nohash/pgtable.h

2018-09-12 Thread Christophe Leroy
Now the pte-common.h is only for nohash platforms, lets move pte_user() helper out of pte-common.h to put it together with other helpers. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/nohash/pgtable.h | 10 ++

[PATCH v2 16/24] powerpc/book3s/32: do not include pte-common.h

2018-09-12 Thread Christophe Leroy
As done for book3s/64, add necessary flags/defines in book3s/32/pgtable.h and do not include pte-common.h It allows in the meantime to remove all related hash definitions from pte-common.h and to also remove _PAGE_EXEC default as _PAGE_EXEC is defined on all platforms except book3s/32.

[PATCH v2 15/24] powerpc/mm: move __P and __S tables in the common pgtable.h

2018-09-12 Thread Christophe Leroy
__P and __S flags are the same for all platform and should remain as is in the future, so avoid duplication. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/64/pgtable.h | 20 arch/powerpc/include/asm/pgtable.h |

[PATCH v2 14/24] powerpc/mm: drop unused page flags

2018-09-12 Thread Christophe Leroy
The following page flags in pte-common.h can be dropped: _PAGE_ENDIAN is only used in mm/fsl_booke_mmu.c and is defined in asm/nohash/32/pte-fsl-booke.h _PAGE_4K_PFN is nowhere defined nor used _PAGE_READ, _PAGE_WRITE and _PAGE_PTE are only defined and used in book3s/64 The following page

[PATCH v2 13/24] powerpc/mm: Split dump_pagelinuxtables flag_array table

2018-09-12 Thread Christophe Leroy
To reduce the complexity of flag_array, and allow the removal of default 0 value of non existing flags, lets have one flag_array table for each platform family with only the really existing flags. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/mm/Makefile

[PATCH v2 11/24] powerpc/mm: don't use _PAGE_EXEC for calling hash_preload()

2018-09-12 Thread Christophe Leroy
The 'access' parameter of hash_preload() is either 0 or _PAGE_EXEC. Among the two versions of hash_preload(), only the PPC64 one is doing something with this 'access' parameter. In order to remove the use of _PAGE_EXEC outside platform code, 'access' parameter is replaced by 'is_exec' which will

[PATCH v2 12/24] powerpc/mm: use pte helpers in generic code

2018-09-12 Thread Christophe Leroy
Get rid of platform specific _PAGE_ in powerpc common code and use helpers instead. mm/dump_linuxpagetables.c will be handled separately Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 9 +++--

[PATCH v2 10/24] powerpc/mm: add pte helpers to query and change pte flags

2018-09-12 Thread Christophe Leroy
In order to avoid using generic _PAGE_XXX flags in powerpc core functions, define helpers for all needed flags: - pte_mkuser() and pte_mkprivileged() to set/unset and/or unset/set _PAGE_USER and/or _PAGE_PRIVILEGED - pte_hashpte() to check if _PAGE_HASHPTE is set. - pte_ci() check if cache is

[PATCH v2 09/24] powerpc/mm: move some nohash pte helpers in nohash/[32:64]/pgtable.h

2018-09-12 Thread Christophe Leroy
In order to allow their use in nohash/32/pgtable.h, we have to move the following helpers in nohash/[32:64]/pgtable.h: - pte_mkwrite() - pte_mkdirty() - pte_mkyoung() - pte_wrprotect() Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy ---

[PATCH v2 08/24] powerpc/mm: don't use _PAGE_EXEC in book3s/32

2018-09-12 Thread Christophe Leroy
book3s/32 doesn't define _PAGE_EXEC, so no need to use it. All other platforms define _PAGE_EXEC so no need to check it is not NUL when not book3s/32. Reviewed-by: Aneesh Kumar K.V Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +-

[PATCH v2 07/24] powerpc: handover page flags with a pgprot_t parameter

2018-09-12 Thread Christophe Leroy
In order to avoid multiple conversions, handover directly a pgprot_t to map_kernel_page() as already done for radix. Do the same for __ioremap_caller() and __ioremap_at(). Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/book3s/32/pgtable.h | 2 +-

[PATCH v2 06/24] powerpc/mm: properly set PAGE_KERNEL flags in ioremap()

2018-09-12 Thread Christophe Leroy
Set PAGE_KERNEL directly in the caller and do not rely on a hack adding PAGE_KERNEL flags when _PAGE_PRESENT is not set. As already done for PPC64, use pgprot_cache() helpers instead of _PAGE_XXX flags in PPC32 ioremap() derived functions. Signed-off-by: Christophe Leroy ---

[PATCH v2 05/24] powerpc: don't use ioremap_prot() nor __ioremap() unless really needed.

2018-09-12 Thread Christophe Leroy
In many places, ioremap_prot() and __ioremap() can be replaced with higher level functions like ioremap(), ioremap_coherent(), ioremap_cache(), ioremap_wc() ... Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/btext.c | 2 +- arch/powerpc/kernel/crash_dump.c | 2 +-

[PATCH v2 04/24] soc/fsl/qbman: use ioremap_cache() instead of ioremap_prot(0)

2018-09-12 Thread Christophe Leroy
ioremap_prot() with flag set to 0 relies on a hack in __ioremap_caller() which adds PAGE_KERNEL flags when the handed flags don't look like a valid set of flags (ie don't include _PAGE_PRESENT) The intention being to map cached memory, use ioremap_cache() instead. Signed-off-by: Christophe Leroy

[PATCH v2 03/24] drivers/block/z2ram: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-09-12 Thread Christophe Leroy
_PAGE_WRITETHRU is a target specific flag. Prefer generic functions. Acked-by: Geert Uytterhoeven Signed-off-by: Christophe Leroy --- drivers/block/z2ram.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/block/z2ram.c b/drivers/block/z2ram.c index

[PATCH v2 00/24] ban the use of _PAGE_XXX flags outside platform specific code

2018-09-12 Thread Christophe Leroy
Today flags like for instance _PAGE_RW or _PAGE_USER are used through common parts of code. Using those directly in common parts of code have proven to lead to mistakes or misbehaviour, because their use is not always as trivial as one could think. For instance, (flags & _PAGE_USER) == 0 isn't

[PATCH v2 02/24] drivers/video/fbdev: use ioremap_wc/wt() instead of __ioremap()

2018-09-12 Thread Christophe Leroy
_PAGE_NO_CACHE is a platform specific flag. In addition, this flag is misleading because one would think it requests a noncached page whereas a noncached page is _PAGE_NO_CACHE | _PAGE_GUARDED _PAGE_NO_CACHE alone means write combined noncached page, so lets use ioremap_wc() instead.

[PATCH v2 01/24] powerpc/32: Add ioremap_wt() and ioremap_coherent()

2018-09-12 Thread Christophe Leroy
Other arches have ioremap_wt() to map IO areas write-through. Implement it on PPC as well in order to avoid drivers using __ioremap(_PAGE_WRITETHRU) Also implement ioremap_coherent() to avoid drivers using __ioremap(_PAGE_COHERENT) Signed-off-by: Christophe Leroy ---

Re: [PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Jason Gunthorpe
On Wed, Sep 12, 2018 at 05:08:52PM +0200, Arnd Bergmann wrote: > The .ioctl and .compat_ioctl file operations have the same prototype so > they can both point to the same function, which works great almost all > the time when all the commands are compatible. > > One exception is the s390

[PATCH v2 05/17] compat_ioctl: move more drivers to generic_compat_ioctl_ptrarg

2018-09-12 Thread Arnd Bergmann
The .ioctl and .compat_ioctl file operations have the same prototype so they can both point to the same function, which works great almost all the time when all the commands are compatible. One exception is the s390 architecture, where a compat pointer is only 31 bit wide, and converting it into

[PATCH v2 03/17] compat_ioctl: use correct compat_ptr() translation in drivers

2018-09-12 Thread Arnd Bergmann
A handful of drivers all have a trivial wrapper around their ioctl handler, but don't call the compat_ptr() conversion function at the moment. In practice this does not matter, since none of them are used on the s390 architecture and for all other architectures, compat_ptr() does not do anything,

Re: [PATCH 00/25] Change tty_port(standard)_install's return type

2018-09-12 Thread Alan Cox
On Tue, 4 Sep 2018 11:44:26 +0900 Jaejoong Kim wrote: > Many drivers with tty use the tty_stand_install(). But, there is no > need to handle the error, since it always returns 0. And what happens if another change means it can fail again. It's just a property of the current implementation

Re: [PATCH 0/2] sriov enablement on s390

2018-09-12 Thread Bjorn Helgaas
[+cc Arnd, powerpc folks] On Wed, Sep 12, 2018 at 02:34:09PM +0200, Sebastian Ott wrote: > Hello Bjorn, > > On s390 we currently handle SRIOV within firmware. Which means > that the PF is under firmware control and not visible to operating > systems. SRIOV enablement happens within firmware and

Re: [PATCH v2 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-12 Thread Benjamin Herrenschmidt
On Mon, 2018-09-10 at 19:00 +0300, Sergey Miroshnichenko wrote: > > Yes, missing a real EEH event is possible, unfortunately, and it is > indeed worth mentioning. > > To reduce this probability the next patchset I'll post in a few days > among other things puts all the affected device drivers to

Re: [PATCH 5/5] PCI/powerpc/eeh: Add pcibios hooks for preparing to rescan

2018-09-12 Thread Benjamin Herrenschmidt
On Wed, 2018-09-05 at 18:40 +0300, Sergey Miroshnichenko wrote: > Reading an empty slot returns all ones, which triggers a false > EEH error event on PowerNV. > > New callbacks pcibios_rescan_prepare/done are introduced to > pause/resume the EEH during rescan. This freaks me out a bit. EEH will

Re: [PATCH 4/5] powerpc/powernv/pci: Enable reassigning the bus numbers

2018-09-12 Thread Benjamin Herrenschmidt
On Wed, 2018-09-05 at 18:40 +0300, Sergey Miroshnichenko wrote: > PowerNV doesn't depend on PCIe topology info from DT anymore, and now > it is able to enumerate the fabric and assign the bus numbers. No it's not, at least unless we drop P7 support. P7 has constraints on the bus ranges being

Re: [PATCH 2/5] powerpc/pci: Create pci_dn on demand

2018-09-12 Thread Benjamin Herrenschmidt
On Wed, 2018-09-05 at 18:40 +0300, Sergey Miroshnichenko wrote: > The pci_dn structures can be created not only from DT, but also > directly from newly discovered PCIe devices, so allocate them > dynamically. I'd rather we moved towards killing pci_dn completely to be honest :) > Signed-off-by:

Re: [PATCH v3 0/6] powerpc/powernv/pci: Discover surprise-hotplugged PCIe devices during rescan

2018-09-12 Thread Oliver
On Tue, Sep 11, 2018 at 9:56 PM, Sergey Miroshnichenko wrote: > This patchset allows hotplugged PCIe devices to be enumerated during a bus > rescan being issued via sysfs on PowerNV platforms, when the "Presence > Detect Changed" interrupt is not available. Seems to be on par with the sysfs slot

Re: [PATCH net] powerpc: use big endian to hash len and proto in csum_ipv6_magic

2018-09-12 Thread Xin Long
On Wed, Sep 12, 2018 at 2:01 PM David Miller wrote: > > From: Xin Long > Date: Sat, 8 Sep 2018 18:15:12 +0800 > > > The function csum_ipv6_magic doesn't convert len and proto to big > > endian before doing ipv6 csum hash, which is not consistent with > > RFC and other arches. > > > > Jianlin

Re: [PATCH net] powerpc: use big endian to hash len and proto in csum_ipv6_magic

2018-09-12 Thread Christophe LEROY
Le 12/09/2018 à 08:01, David Miller a écrit : From: Xin Long Date: Sat, 8 Sep 2018 18:15:12 +0800 The function csum_ipv6_magic doesn't convert len and proto to big endian before doing ipv6 csum hash, which is not consistent with RFC and other arches. Jianlin found it when ICMPv6 packets

Re: [PATCH v2] powerpc: Avoid code patching freed init sections

2018-09-12 Thread Christophe LEROY
Le 12/09/2018 à 07:20, Michael Neuling a écrit : This stops us from doing code patching in init sections after they've been freed. In this chain: kvm_guest_init() -> kvm_use_magic_page() -> fault_in_pages_readable() -> __get_user() -> __get_user_nocheck()

Re: [PATCH net] powerpc: use big endian to hash len and proto in csum_ipv6_magic

2018-09-12 Thread David Miller
From: Xin Long Date: Sat, 8 Sep 2018 18:15:12 +0800 > The function csum_ipv6_magic doesn't convert len and proto to big > endian before doing ipv6 csum hash, which is not consistent with > RFC and other arches. > > Jianlin found it when ICMPv6 packets from other hosts were dropped > in the