Re: [RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-24 Thread Thiago Jung Bauermann
Hello Randy, Thanks for your quick review. Randy Dunlap writes: > On 08/24/2018 09:25 AM, Thiago Jung Bauermann wrote: >> From: Anshuman Khandual >> >> SWIOTLB buffer default size (64MB) is not enough for large sequential write >> operations which eventually leads to kernel crash like here.

Re: [RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-24 Thread Thiago Jung Bauermann
Hello Christoph, Thanks for your quick review. Christoph Hellwig writes: > On Thu, Aug 23, 2018 at 11:59:32PM -0300, Thiago Jung Bauermann wrote: >> From: Anshuman Khandual >> >> SWIOTLB checks range of incoming CPU addresses to be bounced and see if the >> device can access it through it's

Re: [PATCH v2] crypto: vmx - Fix sleep-in-atomic bugs

2018-08-24 Thread Ondrej Mosnacek
On Fri, Aug 24, 2018 at 9:39 PM Paulo Flabiano Smorigo wrote: > On 2018-08-23 17:34, Paulo Flabiano Smorigo wrote: > > On 2018-08-22 21:04, Marcelo Henrique Cerri wrote: > >> That looks good to me. Maybe Paulo can help testing it. > >> > >> -- > >> Regards, > >> Marcelo > >> > >> On Wed, Aug 22,

Re: [PATCH v2] crypto: vmx - Fix sleep-in-atomic bugs

2018-08-24 Thread Paulo Flabiano Smorigo
On 2018-08-23 17:34, Paulo Flabiano Smorigo wrote: On 2018-08-22 21:04, Marcelo Henrique Cerri wrote: That looks good to me. Maybe Paulo can help testing it. -- Regards, Marcelo On Wed, Aug 22, 2018 at 08:26:31AM +0200, Ondrej Mosnacek wrote: This patch fixes sleep-in-atomic bugs in AES-CBC

Re: [RFC PATCH 00/11] Secure Virtual Machine Enablement

2018-08-24 Thread Ram Pai
On Fri, Aug 24, 2018 at 06:33:30PM +0200, Christoph Hellwig wrote: > On Fri, Aug 24, 2018 at 01:25:24PM -0300, Thiago Jung Bauermann wrote: > > [ Some people didn't receive all the patches in this series, even though > > the linuxppc-dev list did so trying to send again. This is exactly the > >

FSL/NXP P5020: USB problems with the latest Git kernels

2018-08-24 Thread Christian Zigotzky
Hello, There are USB problems with P5020 boards with the latest Git kernels. Some users reported the following error messages: skateman@X5000LNX:~$ grep -i -E 'usb.*error' /var/log/syslog Aug 24 13:12:50 X5000LNX kernel: [ 6.552303] usb 1-1: device descriptor read/64, error -32 Aug 24 13:12:50

Re: [RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-24 Thread Randy Dunlap
On 08/24/2018 09:25 AM, Thiago Jung Bauermann wrote: > From: Anshuman Khandual > > SWIOTLB buffer default size (64MB) is not enough for large sequential write > operations which eventually leads to kernel crash like here. > > virtio-pci :00:05.0: swiotlb buffer is full (sz: 327680 bytes) >

Re: DT case sensitivity

2018-08-24 Thread Segher Boessenkool
On Fri, Aug 24, 2018 at 10:14:01AM -0500, Rob Herring wrote: > Another question: Is there ever a case where the node name in the path > aka 'driver-name' doesn't match the 'name' property? I think this > generally can't happen on FDT as the 'name' property is generated when > we unflatten it

Re: [RFC PATCH 00/11] Secure Virtual Machine Enablement

2018-08-24 Thread Christoph Hellwig
On Fri, Aug 24, 2018 at 01:25:24PM -0300, Thiago Jung Bauermann wrote: > [ Some people didn't receive all the patches in this series, even though > the linuxppc-dev list did so trying to send again. This is exactly the > same series I posted yesterday. Sorry for the clutter. ] I'm still only

[RFC PATCH 11/11] powerpc/svm: Increase SWIOTLB buffer size

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual SWIOTLB buffer default size (64MB) is not enough for large sequential write operations which eventually leads to kernel crash like here. virtio-pci :00:05.0: swiotlb buffer is full (sz: 327680 bytes) virtio-pci :00:05.0: DMA: Out of SW-IOMMU space for 327680

[RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual SWIOTLB checks range of incoming CPU addresses to be bounced and see if the device can access it through it's DMA window without requiring bouncing. In such cases it just chooses to skip bouncing. But for cases like secure guests on powerpc platform all addresses need to

[RFC PATCH 09/11] powerpc/svm: Use shared memory for LPPACA structures

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual LPPACA structures need to be shared with the host. Hence they need to be on shared memory. Instead of allocating individual chunks of memory for given structure from memblock, a contiguous chunk of memory is allocated and then converted into shared memory. Subsequent

[RFC PATCH 08/11] powerpc: Add and use LPPACA_SIZE constant

2018-08-24 Thread Thiago Jung Bauermann
Helps document what the hard-coded number means. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index

[RFC PATCH 07/11] powerpc/svm: Use shared memory for Debug Trace Log (DTL)

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual On Ultravisor platform kmem_cache for DTL buffers must use a constructor function which converts the underlying buddy allocated SLUB cache pages into shared memory so that they are accessible to the hypervisor. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung

[RFC PATCH 06/11] powerpc/svm: Use SWIOTLB DMA API for all virtio devices

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Secure guest memory (GPA range) is isolated and inaccessible from the host. But virtio ring transactions require the back end drivers to process incoming scatter gather buffers which require their access in host. Hence a portion of guest memory can be converted to shared

[RFC PATCH 05/11] powerpc/svm: Don't release SWIOTLB buffers on secure guests

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Even though SWIOTLB slab gets allocated and initialized on each powerpc platform with swiotlb_init(), it gets released away again on all server platforms because ppc_swiotlb_enable variable never gets set. Secure guests would require SWIOTLB DMA API support for virtio

[RFC PATCH 04/11] powerpc/svm: Convert SWIOTLB buffers to shared memory

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Hook the shared memory conversion functions into the ARCH_HAS_MEM_ENCRYPT framework and call swiotlb_update_mem_attributes() to convert SWIOTLB's buffers to shared memory. Signed-off-by: Anshuman Khandual Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/Kconfig

[RFC PATCH 03/11] powerpc/svm: Add memory conversion (shared/secure) helper functions

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Add the following helper functions to convert PAGE_SIZE aligned memory buffers as shared or secure (i.e., accessible to the hypervisor or not) via Ultravisor calls. 1. mem_convert_shared(unsigned long pfn, unsigned long npages) 2. mem_convert_secure(unsigned long pfn,

[RFC PATCH 02/11] powerpc/svm: Select CONFIG_DMA_DIRECT_OPS and CONFIG_SWIOTLB

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual Ultravisor based secure guest platforms will use generic SWIOTLB DMA API (i.e swiotlb_dma_ops structure) available under the CONFIG_DMA_DIRECT_OPS config. Also base CONFIG_SWIOTLB needs to be explicitly selected as well. Select both these config options on powerpc server

[RFC PATCH 01/11] powerpc/svm: Detect Secure Virtual Machine (SVM) platform

2018-08-24 Thread Thiago Jung Bauermann
From: Anshuman Khandual A guest requests to be moved to secure memory early at the kernel startup (in prom_init). Define a flag that can be easily checked by other parts of the kernel so that they can set things up accordingly. This is done by checking the MSR(S) bit, which is always set for

[RFC PATCH 00/11] Secure Virtual Machine Enablement

2018-08-24 Thread Thiago Jung Bauermann
[ Some people didn't receive all the patches in this series, even though the linuxppc-dev list did so trying to send again. This is exactly the same series I posted yesterday. Sorry for the clutter. ] This series contains preliminary work to enable Secure Virtual Machines (SVM) on powerpc.

Re: MPC83xx reset status register (RSR, offset 0x910)

2018-08-24 Thread Christophe Leroy
Hi On 08/03/2018 04:36 PM, Radu Rendec wrote: Hi Everyone, Is there any kernel code that handles the "reset status register" (RSR) on MPC83xx? I looked at arch/powerpc/platforms/83xx/misc.c, but it seems to only map the reset register area and it's static. The watchdog driver

Re: [PATCH 5/5] arm64: dts: add LX2160ARDB board support

2018-08-24 Thread Rob Herring
On Thu, Aug 23, 2018 at 10:08 AM Vabhav Sharma wrote: [...] > > > + i2c@3 { > > > + #address-cells = <1>; > > > + #size-cells = <0>; > > > + reg = <0x3>; > > > + > > > + sa56004@4c { > > > >

Re: DT case sensitivity

2018-08-24 Thread Rob Herring
On Thu, Aug 23, 2018 at 7:37 AM Segher Boessenkool wrote: > > On Thu, Aug 23, 2018 at 11:29:01AM +1000, Benjamin Herrenschmidt wrote: > > On Wed, 2018-08-22 at 20:26 -0500, Rob Herring wrote: > > > On Wed, Aug 22, 2018 at 8:14 PM Benjamin Herrenschmidt > > > wrote: > > > > > > > > On Wed,

Re: [PATCH 2/2] soc: fsl: qbman: qman: avoid allocating from non existing gen_pool

2018-08-24 Thread Roy Pledge
On 8/23/2018 5:36 PM, Alexandre Belloni wrote: > If the qman driver didn't probe, calling qman_alloc_fqid_range, > qman_alloc_pool_range or qman_alloc_cgrid_range (as done in dpaa_eth) will > pass a NULL pointer to gen_pool_alloc, leading to a NULL pointer > dereference. > > Signed-off-by:

Re: [PATCH 1/2] soc: fsl: qbman: qman_portal: defer probing when qman is not available

2018-08-24 Thread Roy Pledge
On 8/23/2018 5:36 PM, Alexandre Belloni wrote: > If the qman driver (qman_ccsr) doesn't probe or fail to probe before > qman_portal, qm_ccsr_start will be either NULL or a stale pointer to an > unmapped page. > > This leads to a crash when probing qman_portal as the init_pcfg function > calls

[GIT PULL] Please pull powerpc/linux.git powerpc-4.19-2 tag

2018-08-24 Thread Michael Ellerman
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi Linus, Please pull powerpc fixes for 4.19: The following changes since commit a2dc009afa9ae8b92305be7728676562a104cb40: powerpc/mm/book3s/radix: Add mapping statistics (2018-08-13 16:35:05 +1000) are available in the git repository at:

Re: [PATCH 2/2] i2c: remove deprecated attach_adapter callback

2018-08-24 Thread Wolfram Sang
On Tue, Aug 21, 2018 at 05:02:40PM +0200, Wolfram Sang wrote: > There aren't any users left. Remove this callback from the 2.4 times. > Phew, finally, that took years to reach... > > Signed-off-by: Wolfram Sang Applied to for-next, thanks! signature.asc Description: PGP signature

Re: [PATCH 1/2] macintosh: therm_windtunnel: drop using attach_adapter

2018-08-24 Thread Wolfram Sang
On Tue, Aug 21, 2018 at 05:02:39PM +0200, Wolfram Sang wrote: > As we now have deferred probing, we can use a custom mechanism and > finally get rid of the legacy interface from the i2c core. > > Signed-off-by: Wolfram Sang Applied to for-next, thanks! signature.asc Description: PGP

Re: [PATCH] drivers/video/fbdev: use ioremap_wc() instead of __ioremap(_PAGE_NO_CACHE)

2018-08-24 Thread Christophe LEROY
Le 24/08/2018 à 13:05, Segher Boessenkool a écrit : On Fri, Aug 24, 2018 at 10:16:22AM +, Christophe Leroy wrote: _PAGE_NO_CACHE is a target specific flag. Prefer generic functions. #ifdef CONFIG_PPC - p->screen_base = __ioremap(addr, 0x20, _PAGE_NO_CACHE); +

Re: [PATCH] drivers/video/fbdev: use ioremap_wc() instead of __ioremap(_PAGE_NO_CACHE)

2018-08-24 Thread Segher Boessenkool
On Fri, Aug 24, 2018 at 10:16:22AM +, Christophe Leroy wrote: > _PAGE_NO_CACHE is a target specific flag. Prefer generic functions. > #ifdef CONFIG_PPC > - p->screen_base = __ioremap(addr, 0x20, _PAGE_NO_CACHE); > + p->screen_base = ioremap_wc(addr, 0x20); > #else But that

Re: [PATCH v2] powerpc/xive: Avoid unitialized variable

2018-08-24 Thread Cédric Le Goater
On 08/24/2018 01:26 AM, Breno Leitao wrote: > From: Breno Leitao > > Function xive_native_get_ipi() might uses chip_id without it being > initialized. > > This gives the following error on 'smatch' tool: > > error: uninitialized symbol 'chip_id' > > The suggestion is using xc->chip_id

Re: [PATCH V3 1/6] powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

2018-08-24 Thread kbuild test robot
/linux/commits/Aneesh-Kumar-K-V/powerpc-mm-book3s-Update-pmd_present-to-look-at-_PAGE_PRESENT-bit/20180824-141837 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-obs600_defconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

Re: [PATCH V3 1/6] powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

2018-08-24 Thread kbuild test robot
/commits/Aneesh-Kumar-K-V/powerpc-mm-book3s-Update-pmd_present-to-look-at-_PAGE_PRESENT-bit/20180824-141837 base: https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next config: powerpc-allnoconfig (attached as .config) compiler: powerpc-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce

[PATCH] drivers/video/fbdev: use ioremap_wc() instead of __ioremap(_PAGE_NO_CACHE)

2018-08-24 Thread Christophe Leroy
_PAGE_NO_CACHE is a target specific flag. Prefer generic functions. Signed-off-by: Christophe Leroy --- drivers/video/fbdev/chipsfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c index

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

2018-08-24 Thread Christophe Leroy
_PAGE_WRITETHRU is a target specific flag. Prefer generic functions. 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 d0c5bc4e0703..cfbd70520eeb 100644 ---

[PATCH 2/3] drivers/video/fbdev: use ioremap_wt() instead of __ioremap(_PAGE_WRITETHRU)

2018-08-24 Thread Christophe Leroy
_PAGE_WRITETHRU is a target specific flag. Prefer generic functions. Signed-off-by: Christophe Leroy --- drivers/video/fbdev/controlfb.c | 3 +-- drivers/video/fbdev/platinumfb.c | 3 +-- drivers/video/fbdev/valkyriefb.c | 10 ++ 3 files changed, 8 insertions(+), 8 deletions(-) diff

[PATCH 1/3] powerpc/32: Add ioremap_wt()

2018-08-24 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) Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/io.h | 6 ++ arch/powerpc/mm/pgtable_32.c | 8 2 files changed, 14

Re: [PATCH v1] mm: relax deferred struct page requirements

2018-08-24 Thread Jiri Slaby
pasha.tatas...@oracle.com -> pavel.tatas...@microsoft.com due to 550 5.1.1 Unknown recipient address. On 08/24/2018, 09:32 AM, Jiri Slaby wrote: > On 06/19/2018, 09:56 PM, Pavel Tatashin wrote: >> On Tue, Jun 19, 2018 at 9:50 AM Pavel Tatashin >> wrote: >>> >>> On Sat, Jun 16, 2018 at 4:04 AM

[PATCH V3 1/6] powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

2018-08-24 Thread Aneesh Kumar K.V
With this patch we use 0x8000UL (_PAGE_PRESENT) to indicate a valid pgd/pud/pmd entry. We also switch the p**_present() to look at this bit. With pmd_present, we have a special case. We need to make sure we consider a pmd marked invalid during THP split as present. Right now we clear

Re: [PATCH V3 1/6] powerpc/mm/book3s: Update pmd_present to look at _PAGE_PRESENT bit

2018-08-24 Thread Aneesh Kumar K.V
On 08/24/2018 11:30 AM, Aneesh Kumar K.V wrote: With this patch we use 0x8000UL (_PAGE_PRESENT) to indicate a valid pgd/pud/pmd entry. We also switch the p**_present() to look at this bit. With pmd_present, we have a special case. We need to make sure we consider a pmd marked

[PATCH V3 6/6] powerpc/mm:book3s: Enable THP migration support

2018-08-24 Thread Aneesh Kumar K.V
Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/book3s/64/pgtable.h | 8 arch/powerpc/platforms/Kconfig.cputype | 1 + 2 files changed, 9 insertions(+) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index

[PATCH V3 5/6] powerpc/mm/thp: update pmd_trans_huge to check for pmd_present

2018-08-24 Thread Aneesh Kumar K.V
We need to make sure pmd_trans_huge returns false for a pmd migration entry. We mark the migration entry by clearing the _PAGE_PRESENT bit. We keep the _PAGE_PTE bit set to indicate a leaf page table entry. Hence we need to make sure we check for pmd_present() so that pmd_trans_huge won't return

[PATCH V3 4/6] arch/powerpc/mm/hash: validate the pte entries before handling the hash fault

2018-08-24 Thread Aneesh Kumar K.V
Make sure we are operating on THP and hugetlb entries in the respective hash fault handling routines. No functional change in this patch. If we walked the table wrongly before, we will retry the access. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/mm/hugepage-hash64.c| 6 ++

[PATCH V3 3/6] powerpc/mm/book3s: Check for pmd_large instead of pmd_trans_huge

2018-08-24 Thread Aneesh Kumar K.V
Update few code paths to check for pmd_large. set_pmd_at: We want to use this to store swap pte at pmd level. For swap ptes we don't want to set H_PAGE_THP_HUGE. Hence check for pmd_large in set_pmd_at. This remove the false WARN_ON when using this with swap pmd entry. pmd_page: We don't really

[PATCH V3 2/6] powerpc/mm/hugetlb/book3s: add _PAGE_PRESENT to hugepd pointer.

2018-08-24 Thread Aneesh Kumar K.V
This make hugetlb directory pointer similar to other page able entries. A hugepd entry is identified by lack of _PAGE_PTE bit set and directory size stored in HUGEPD_SHIFT_MASK. We update that to also look at _PAGE_PRESENT Signed-off-by: Aneesh Kumar K.V ---

Re: [RFC PATCH 10/11] powerpc/svm: Force the use of bounce buffers

2018-08-24 Thread Christoph Hellwig
On Thu, Aug 23, 2018 at 11:59:32PM -0300, Thiago Jung Bauermann wrote: > From: Anshuman Khandual > > SWIOTLB checks range of incoming CPU addresses to be bounced and see if the > device can access it through it's DMA window without requiring bouncing. In > such cases it just chooses to skip