Re: [PATCH v4 1/2] powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'

2020-06-12 Thread Segher Boessenkool
Hi! On Fri, Jun 12, 2020 at 02:33:09PM -0700, Nick Desaulniers wrote: > On Thu, Jun 11, 2020 at 4:53 PM Segher Boessenkool > wrote: > > The PowerPC part of > > https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html#Machine-Constraints > > (sorry, no anchor) documents %U. > > I thought

[PATCH v2 12/12] x86/traps: Fix up invalid PASID

2020-06-12 Thread Fenghua Yu
A #GP fault is generated when ENQCMD instruction is executed without a valid PASID value programmed in the current thread's PASID MSR. The #GP fault handler will initialize the MSR if a PASID has been allocated for this process. Decoding the user instruction is ugly and sets a bad architecture

[PATCH v2 11/12] x86/mmu: Allocate/free PASID

2020-06-12 Thread Fenghua Yu
A PASID is allocated for an "mm" the first time any thread attaches to an SVM capable device. Later device attachments (whether to the same device or another SVM device) will re-use the same PASID. The PASID is freed when the process exits (so no need to keep reference counts on how many SVM

[PATCH v2 09/12] fork: Clear PASID for new mm

2020-06-12 Thread Fenghua Yu
When a new mm is created, its PASID should be cleared, i.e. the PASID is initialized to its init state 0 on both ARM and X86. Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: - Add this patch to initialize PASID value for a new mm. include/linux/mm_types.h | 2 ++ kernel/fork.c

[PATCH v2 10/12] x86/process: Clear PASID state for a newly forked/cloned thread

2020-06-12 Thread Fenghua Yu
The PASID state has to be cleared on forks, since the child has a different address space. The PASID is also cleared for thread clone. While it would be correct to inherit the PASID in this case, it is unknown whether the new task will use ENQCMD. Giving it the PASID "just in case" would have the

[PATCH v2 06/12] x86/fpu/xstate: Add supervisor PASID state for ENQCMD feature

2020-06-12 Thread Fenghua Yu
From: Yu-cheng Yu ENQCMD instruction reads PASID from IA32_PASID MSR. The MSR is stored in the task's supervisor FPU PASID state and is context switched by XSAVES/XRSTORS. Signed-off-by: Yu-cheng Yu Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: -

[PATCH v2 08/12] mm: Define pasid in mm

2020-06-12 Thread Fenghua Yu
PASID is shared by all threads in a process. So the logical place to keep track of it is in the "mm". Both ARM and X86 need to use the PASID in the "mm". Suggested-by: Christoph Hellwig Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: - This new patch moves "pasid" from x86 specific

[PATCH v2 07/12] x86/msr-index: Define IA32_PASID MSR

2020-06-12 Thread Fenghua Yu
The IA32_PASID MSR (0xd93) contains the Process Address Space Identifier (PASID), a 20-bit value. Bit 31 must be set to indicate the value programmed in the MSR is valid. Hardware uses PASID to identify process address space and direct responses to the right address space. Signed-off-by: Fenghua

[PATCH v2 04/12] docs: x86: Add documentation for SVA (Shared Virtual Addressing)

2020-06-12 Thread Fenghua Yu
From: Ashok Raj ENQCMD and Data Streaming Accelerator (DSA) and all of their associated features are a complicated stack with lots of interconnected pieces. This documentation provides a big picture overview for all of the features. Signed-off-by: Ashok Raj Co-developed-by: Fenghua Yu

[PATCH v2 05/12] x86/cpufeatures: Enumerate ENQCMD and ENQCMDS instructions

2020-06-12 Thread Fenghua Yu
Work submission instruction comes in two flavors. ENQCMD can be called both in ring 3 and ring 0 and always uses the contents of PASID MSR when shipping the command to the device. ENQCMDS allows a kernel driver to submit commands on behalf of a user process. The driver supplies the PASID value in

[PATCH v2 03/12] iommu/vt-d: Change flags type to unsigned int in binding mm

2020-06-12 Thread Fenghua Yu
"flags" passed to intel_svm_bind_mm() is a bit mask and should be defined as "unsigned int" instead of "int". Change its type to "unsigned int". Suggested-by: Thomas Gleixner Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: - Add this new patch per Thomas' comment.

[PATCH v2 01/12] iommu: Change type of pasid to unsigned int

2020-06-12 Thread Fenghua Yu
PASID is defined as a few different types in iommu including "int", "u32", and "unsigned int". To be consistent and to match with ioasid's type, define PASID and its variations (e.g. max PASID) as "unsigned int". No PASID type change in uapi. Suggested-by: Thomas Gleixner Signed-off-by: Fenghua

[PATCH v2 02/12] ocxl: Change type of pasid to unsigned int

2020-06-12 Thread Fenghua Yu
PASID is defined as "int" although it's a 20-bit value and shouldn't be negative int. To be consistent with type defined in iommu, define PASID as "unsigned int". Suggested-by: Thomas Gleixner Signed-off-by: Fenghua Yu Reviewed-by: Tony Luck --- v2: - Create this new patch to define PASID as

[PATCH v2 00/12] x86: tag application address space for devices

2020-06-12 Thread Fenghua Yu
Typical hardware devices require a driver stack to translate application buffers to hardware addresses, and a kernel-user transition to notify the hardware of new work. What if both the translation and transition overhead could be eliminated? This is what Shared Virtual Address (SVA) and ENQCMD

Re: [PATCH kernel] KVM: PPC: Fix nested guest RC bits update

2020-06-12 Thread Michael Ellerman
On Thu, 11 Jun 2020 13:05:59 +1000, Alexey Kardashevskiy wrote: > Before commit 6cdf30375f82 ("powerpc/kvm/book3s: Use kvm helpers > to walk shadow or secondary table") we called __find_linux_pte() with > a page table pointer from a kvm_nested_guest struct but > now we rely on kvmhv_find_nested()

Re: [PATCH net] ibmvnic: Flush existing work items before device removal

2020-06-12 Thread David Miller
From: Thomas Falcon Date: Fri, 12 Jun 2020 13:34:41 -0500 > Ensure that all scheduled work items have completed before continuing > with device removal and after further event scheduling has been > halted. This patch fixes a bug where a scheduled driver reset event > is processed following

Re: [PATCH net] ibmvnic: Harden device login requests

2020-06-12 Thread David Miller
From: Thomas Falcon Date: Fri, 12 Jun 2020 13:31:39 -0500 > @@ -841,13 +841,14 @@ static int ibmvnic_login(struct net_device *netdev) > { > struct ibmvnic_adapter *adapter = netdev_priv(netdev); > unsigned long timeout = msecs_to_jiffies(3); > + int retries = 10; > int

Re: [PATCH] ASoC: fsl_ssi: Fix bclk calculation for mono channel

2020-06-12 Thread Nicolin Chen
On Tue, Jun 09, 2020 at 04:19:28PM +0800, Shengjiu Wang wrote: > For mono channel, ssi will switch to normal mode. In normal > mode, the Word Length Control bits control the word length > divider in clock generator, which is different with I2S master > mode, the word length is fixed to 32bit. > >

[PATCH net] ibmvnic: Flush existing work items before device removal

2020-06-12 Thread Thomas Falcon
Ensure that all scheduled work items have completed before continuing with device removal and after further event scheduling has been halted. This patch fixes a bug where a scheduled driver reset event is processed following device removal. Signed-off-by: Thomas Falcon ---

[PATCH net] ibmvnic: Harden device login requests

2020-06-12 Thread Thomas Falcon
The VNIC driver's "login" command sequence is the final step in the driver's initialization process with device firmware, confirming the available device queue resources to be utilized by the driver. Under high system load, firmware may not respond to the request in a timely manner or may abort

[PATCH v2] tty: serial: cpm_uart: Fix behaviour for non existing GPIOs

2020-06-12 Thread Christophe Leroy
devm_gpiod_get_index() doesn't return NULL but -ENOENT when the requested GPIO doesn't exist, leading to the following messages: [2.742468] gpiod_direction_input: invalid GPIO (errorpointer) [2.748147] can't set direction for gpio #2: -2 [2.753081] gpiod_direction_input: invalid GPIO

[PATCH V2] powerpc/pseries/svm: Drop unused align argument in alloc_shared_lppaca() function

2020-06-12 Thread Satheesh Rajendran
Argument "align" in alloc_shared_lppaca() was unused inside the function. Let's drop it and update code comment for page alignment. Cc: linux-ker...@vger.kernel.org Cc: Thiago Jung Bauermann Cc: Ram Pai Cc: Sukadev Bhattiprolu Cc: Laurent Dufour Cc: Michael Ellerman Reviewed-by: Thiago Jung

Re: [RFC PATCH v3 0/4] Reuse the dma channel if available in Back-End

2020-06-12 Thread Mark Brown
On Fri, 12 Jun 2020 15:37:47 +0800, Shengjiu Wang wrote: > Reuse the dma channel if available in Back-End > > Shengjiu Wang (4): > ASoC: soc-card: export snd_soc_lookup_component_nolocked > ASoC: dmaengine_pcm: export soc_component_to_pcm > ASoC: fsl_asrc_dma: Reuse the dma channel if

Re: [PATCH v3 20/41] powerpc/book3s64/kuap/kuep: Make KUAP and KUEP a subfeature of PPC_MEM_KEYS

2020-06-12 Thread kernel test robot
linux/kernel/git/powerpc/linux.git next config: powerpc-randconfig-r003-20200612 (attached as .config) compiler: powerpc64le-linux-gcc (GCC) 9.3.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chm

Re: PowerPC KVM-PR issue

2020-06-12 Thread Christian Zigotzky
On 11 June 2020 at 04:47 pm, Christian Zigotzky wrote: On 10 June 2020 at 01:23 pm, Christian Zigotzky wrote: On 10 June 2020 at 11:06 am, Christian Zigotzky wrote: On 10 June 2020 at 00:18 am, Christian Zigotzky wrote: Hello, KVM-PR doesn't work anymore on my Nemo board [1]. I figured out

Re: [PATCH kernel] powerpc/xive: Ignore kmemleak false positives

2020-06-12 Thread Michael Ellerman
Alexey Kardashevskiy writes: > xive_native_provision_pages() allocates memory and passes the pointer to > OPAL so kmemleak cannot find the pointer usage in the kernel memory and > produces a false positive report (below) (even if the kernel did scan > OPAL memory, it is unable to deal with __pa()

Re: [PATCH v5 1/4] riscv: Move kernel mapping to vmalloc zone

2020-06-12 Thread Alex Ghiti
Hi Atish, Le 6/11/20 à 5:34 PM, Atish Patra a écrit : On Sun, Jun 7, 2020 at 1:01 AM Alexandre Ghiti wrote: This is a preparatory patch for relocatable kernel. The kernel used to be linked at PAGE_OFFSET address and used to be loaded physically at the beginning of the main memory. Therefore,

Re: [PATCH v2] All arch: remove system call sys_sysctl

2020-06-12 Thread Xiaoming Ni
On 2020/6/12 2:23, Eric W. Biederman wrote: Rich Felker writes: On Thu, Jun 11, 2020 at 12:01:11PM -0500, Eric W. Biederman wrote: Rich Felker writes: On Thu, Jun 11, 2020 at 06:43:00AM -0500, Eric W. Biederman wrote: Xiaoming Ni writes: Since the commit 61a47c1ad3a4dc ("sysctl:

[PATCH] powerpc/pci: unmap legacy INTx interrupts when a PHB is removed

2020-06-12 Thread Cédric Le Goater
When a passthrough IO adapter is removed from a pseries machine using hash MMU and the XIVE interrupt mode, the POWER hypervisor, pHyp, expects the guest OS to have cleared all page table entries related to the adapter. If some are still present, the RTAS call which isolates the PCI slot returns

Re: [RFC PATCH v3 4/4] ASoC: fsl_asrc_dma: Fix data copying speed issue with EDMA

2020-06-12 Thread Nicolin Chen
On Fri, Jun 12, 2020 at 03:37:51PM +0800, Shengjiu Wang wrote: > With EDMA, there is two dma channels can be used for dev_to_dev, > one is from ASRC, one is from another peripheral (ESAI or SAI). > > If we select the dma channel of ASRC, there is an issue for ideal > ratio case, the speed of copy

Re: [RFC PATCH v3 3/4] ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End

2020-06-12 Thread Nicolin Chen
On Fri, Jun 12, 2020 at 03:37:50PM +0800, Shengjiu Wang wrote: > The dma channel has been requested by Back-End cpu dai driver already. > If fsl_asrc_dma requests dma chan with same dma:tx symlink, then > there will be below warning with SDMA. > > [ 48.174236] fsl-esai-dai 2024000.esai: Cannot

Re: [RFC PATCH v3 2/4] ASoC: dmaengine_pcm: export soc_component_to_pcm

2020-06-12 Thread Nicolin Chen
On Fri, Jun 12, 2020 at 03:37:49PM +0800, Shengjiu Wang wrote: > In DPCM case, Front-End needs to get the dma chan which has > been requested by Back-End and reuse it. > > Signed-off-by: Shengjiu Wang Reviewed-by: Nicolin Chen

Re: [RFC PATCH v3 1/4] ASoC: soc-card: export snd_soc_lookup_component_nolocked

2020-06-12 Thread Nicolin Chen
On Fri, Jun 12, 2020 at 03:37:48PM +0800, Shengjiu Wang wrote: > snd_soc_lookup_component_nolocked can be used for the DPCM case > that Front-End needs to get the unused platform component but > added by Back-End cpu dai driver. > > If the component is gotten, then we can get the dma chan created

[RFC PATCH v3 4/4] ASoC: fsl_asrc_dma: Fix data copying speed issue with EDMA

2020-06-12 Thread Shengjiu Wang
With EDMA, there is two dma channels can be used for dev_to_dev, one is from ASRC, one is from another peripheral (ESAI or SAI). If we select the dma channel of ASRC, there is an issue for ideal ratio case, the speed of copy data is faster than sample frequency, because ASRC output data is very

[RFC PATCH v3 3/4] ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End

2020-06-12 Thread Shengjiu Wang
The dma channel has been requested by Back-End cpu dai driver already. If fsl_asrc_dma requests dma chan with same dma:tx symlink, then there will be below warning with SDMA. [ 48.174236] fsl-esai-dai 2024000.esai: Cannot create DMA dma:tx symlink So if we can reuse the dma channel of

[RFC PATCH v3 2/4] ASoC: dmaengine_pcm: export soc_component_to_pcm

2020-06-12 Thread Shengjiu Wang
In DPCM case, Front-End needs to get the dma chan which has been requested by Back-End and reuse it. Signed-off-by: Shengjiu Wang --- include/sound/dmaengine_pcm.h | 11 +++ sound/soc/soc-generic-dmaengine-pcm.c | 12 2 files changed, 11 insertions(+), 12

[RFC PATCH v3 1/4] ASoC: soc-card: export snd_soc_lookup_component_nolocked

2020-06-12 Thread Shengjiu Wang
snd_soc_lookup_component_nolocked can be used for the DPCM case that Front-End needs to get the unused platform component but added by Back-End cpu dai driver. If the component is gotten, then we can get the dma chan created by Back-End component and reused it in Front-End. Signed-off-by:

[RFC PATCH v3 0/4] Reuse the dma channel if available in Back-End

2020-06-12 Thread Shengjiu Wang
Reuse the dma channel if available in Back-End Shengjiu Wang (4): ASoC: soc-card: export snd_soc_lookup_component_nolocked ASoC: dmaengine_pcm: export soc_component_to_pcm ASoC: fsl_asrc_dma: Reuse the dma channel if available in Back-End ASoC: fsl_asrc_dma: Fix data copying speed issue

Re: [PATCH 1/2] powerpc/64s: remove PROT_SAO support

2020-06-12 Thread Michael Ellerman
Nicholas Piggin writes: > ISA v3.1 does not support the SAO storage control attribute required to > implement PROT_SAO. PROT_SAO was used by specialised system software > (Lx86) that has been discontinued for about 7 years, and is not thought > to be used elsewhere, so removal should not cause