Re: [PATCH kernel v6 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-12 Thread Nicholas Piggin
On Wed, 11 Jul 2018 21:00:44 +1000 Alexey Kardashevskiy wrote: > A VM which has: > - a DMA capable device passed through to it (eg. network card); > - running a malicious kernel that ignores H_PUT_TCE failure; > - capability of using IOMMU pages bigger that physical pages > can create an

[PATCH] powerpc/Makefile: Assemble with -me500 when building for E500

2018-07-12 Thread James Clarke
Some of the assembly files use instructions specific to BookE or E500, which are rejected with the now-default -mcpu=powerpc, so we must pass -me500 to the assembler just as we pass -me200 for E200. Fixes: 4bf4f42a2feb ("powerpc/kbuild: Set default generic machine type for 32-bit compile")

[PATCH 13/18] ibmvscsi: change strncpy+truncation to strlcpy

2018-07-12 Thread Dominique Martinet
Generated by scripts/coccinelle/misc/strncpy_truncation.cocci Signed-off-by: Dominique Martinet --- Please see https://marc.info/?l=linux-kernel=153144450722324=2 (the first patch of the serie) for the motivation behind this patch drivers/scsi/ibmvscsi/ibmvscsi.c | 6 ++ 1 file changed, 2

Re: [PATCH kernel v3 0/6] powerpc/powernv/iommu: Optimize memory use

2018-07-12 Thread Alexey Kardashevskiy
On Wed, 4 Jul 2018 16:13:43 +1000 Alexey Kardashevskiy wrote: > This patchset aims to reduce actual memory use for guests with > sparse memory. The pseries guest uses dynamic DMA windows to map > the entire guest RAM but it only actually maps onlined memory > which may be not be contiguous. I

[PATCH kernel] KVM: PPC: Expose userspace mm context id via debugfs

2018-07-12 Thread Alexey Kardashevskiy
This adds a debugfs entry with mm context id of a process which is using KVM. This id is an index in the process table so the userspace can dump that tree provided it is granted access to /dev/mem. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/kvm_host.h | 1 +

Re: [PATCH kernel v6 2/2] KVM: PPC: Check if IOMMU page is contained in the pinned physical page

2018-07-12 Thread Nicholas Piggin
On Wed, 11 Jul 2018 21:00:44 +1000 Alexey Kardashevskiy wrote: > A VM which has: > - a DMA capable device passed through to it (eg. network card); > - running a malicious kernel that ignores H_PUT_TCE failure; > - capability of using IOMMU pages bigger that physical pages > can create an

[RFC] macintosh: Use common code to access RTC

2018-07-12 Thread Finn Thain
Once the 68k Mac port adopts the via-pmu driver, it must access the PMU RTC using the appropriate command format. The same code can then be used for both m68k and powerpc. Replace the RTC code that's duplicated in arch/powerpc and arch/m68k with common RTC accessors for Cuda and PMU devices.

Re: [PATCH] [RESEND] powerpc: xmon: use ktime_get_coarse_boottime64

2018-07-12 Thread Michael Ellerman
Arnd Bergmann writes: > get_monotonic_boottime() is deprecated, and may not be safe to call in > every context, as it has to read a hardware clocksource. > > This changes xmon to print the time using ktime_get_coarse_boottime64() > instead, which avoids the old timespec type and the HW access. >

Re: [PATCH kernel] powerpc/powernv/ioda2: Add 256M IOMMU page size to the default POWER8 case

2018-07-12 Thread Russell Currey
On Mon, 2018-07-02 at 17:42 +1000, Alexey Kardashevskiy wrote: > The sketchy bypass uses 256M pages so add this page size as well. > > This should cause no behavioral change but will be used later. > > Fixes: 477afd6ea6 "powerpc/ioda: Use ibm,supported-tce-sizes for > IOMMU page size mask" >

Re: Several suspected memory leaks

2018-07-12 Thread Michael Ellerman
Michael Ellerman writes: > Hi Paul, > > Paul Menzel writes: >> Dear Liunx folks, >> >> On a the IBM S822LC (8335-GTA) with Ubuntu 18.04 I built Linux master >> – 4.18-rc4+, commit 092150a2 (Merge branch 'for-linus' >> of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid) – with >>

Re: [PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-12 Thread Christoph Hellwig
On Thu, Jul 12, 2018 at 11:48:47AM +0900, Joonsoo Kim wrote: > One of existing user is general DMA layer and it takes gfp flags that is > provided by user. I don't check all the DMA allocation sites but how do > you convince that none of them try to use anything other > than GFP_KERNEL

[RFC PATCH] mm: optimise pte dirty/accessed bits handling in fork

2018-07-12 Thread Nicholas Piggin
fork clears dirty/accessed bits from new ptes in the child, even though the mapping allows such accesses. This logic has existed for ~ever, and certainly well before physical page reclaim and cleaning was not strongly tied to pte access state as it is today. Now that is the case, this access bit

Re: [PATCH] powerpc: Replaced msleep(x) with msleep(OPAL_BUSY_DELAY_MS)

2018-07-12 Thread Nicholas Piggin
On Thu, 12 Jul 2018 15:46:06 +1000 Michael Ellerman wrote: > Daniel Klamt writes: > > > Replaced msleep(x) with with msleep(OPAL_BUSY_DELAY_MS) > > to diocument these sleep is to wait for opal. > > > > Signed-off-by: Daniel Klamt > > Signed-off-by: Bjoern Noetel > > Thanks. > > Your

Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded)

2018-07-12 Thread Stephen Rothwell
Hi all, On Thu, 12 Jul 2018 09:47:29 +1000 Stephen Rothwell wrote: > > On Wed, 11 Jul 2018 14:13:44 -0700 Andrew Morton > wrote: > > > > OK, I shall drop > > mm-sparse-remove-config_sparsemem_alloc_mem_map_together.patch for now. > > I have dropped it from linux-next today (in case you

Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded)

2018-07-12 Thread Oscar Salvador
> > I just roughly check, but if I checked the right place, > > vmemmap_populated() checks for the section to contain the flags we are > > setting in sparse_init_one_section(). > > Yes. > > > But with this patch, we populate first everything, and then we call > > sparse_init_one_section() in

Re: [PATCH v5 5/7] powerpc/pseries: flush SLB contents on SLB MCE errors.

2018-07-12 Thread Michal Suchánek
On Tue, 3 Jul 2018 08:08:14 +1000 "Nicholas Piggin" wrote: > On Mon, 02 Jul 2018 11:17:06 +0530 > Mahesh J Salgaonkar wrote: > > > From: Mahesh Salgaonkar > > > > On pseries, as of today system crashes if we get a machine check > > exceptions due to SLB errors. These are soft errors and can

Re: Boot failures with "mm/sparse: Remove CONFIG_SPARSEMEM_ALLOC_MEM_MAP_TOGETHER" on powerpc (was Re: mmotm 2018-07-10-16-50 uploaded)

2018-07-12 Thread Pavel Tatashin
On Thu, Jul 12, 2018 at 5:50 AM Oscar Salvador wrote: > > > > I just roughly check, but if I checked the right place, > > > vmemmap_populated() checks for the section to contain the flags we are > > > setting in sparse_init_one_section(). > > > > Yes. > > > > > But with this patch, we populate

[PATCH] powerpc/prom_init: remove linux,stdout-package property

2018-07-12 Thread Murilo Opsfelder Araujo
This property was added in 2004 by https://github.com/mpe/linux-fullhistory/commit/689fe5072fe9a0dec914bfa4fa60aed1e54563e6 and the only use of it, which was already inside `#if 0`, was removed a month later by

Re: [next-20180711][Oops] linux-next kernel boot is broken on powerpc

2018-07-12 Thread Pavel Tatashin
> Related commit could be one of below ? I see lots of patches related to mm > and could not bisect > > 5479976fda7d3ab23ba0a4eb4d60b296eb88b866 mm: page_alloc: restore > memblock_next_valid_pfn() on arm/arm64 > 41619b27b5696e7e5ef76d9c692dd7342c1ad7eb >