[PATCH kernel 5/5] vfio/spapr_tce: Advertise and allow a huge DMA windows at 4GB

2020-02-17 Thread Alexey Kardashevskiy
So far the only option for a big 64big DMA window was a window located at 0x800... (1<<59) which creates problems for devices supporting smaller DMA masks. This exploits a POWER9 PHB option to allow the second DMA window to map at 0 and advertises it with a 4GB offset to avoid overlap

[PATCH kernel 4/5] powerpc/powernv/phb4: Add 4GB IOMMU bypass mode

2020-02-17 Thread Alexey Kardashevskiy
IODA2 systems (POWER8/9) allow DMA windows at 2 fixed locations - 0 and 0x800...==1<<59, stored in TVT as TVE0/1. PHB4 on POWER9 has an additional PHB mode to allow mapping both windows at 0 and selecting one based on IOBA address - accesses below 4GB go via TVE0 and above 4GB - via

[PATCH kernel 2/5] powerpc/powernv/ioda: Rework for huge DMA window at 4GB

2020-02-17 Thread Alexey Kardashevskiy
This moves code to make the next patches look simpler. In particular: 1. Separate locals declaration as we will be allocating a smaller DMA window if a TVE1_4GB option (allows a huge DMA windows at 4GB) is enabled; 2. Pass the bypass offset directly to pnv_pci_ioda2_create_table() as it is the

[PATCH kernel 1/5] powerpc/powernv/ioda: Move TCE bypass base to PE

2020-02-17 Thread Alexey Kardashevskiy
We are about to allow another location for the second DMA window and we will need to advertise it outside of the powernv platform code. This moves bypass base address to iommu_table_group so drivers such as VFIO SPAPR TCE can see it. Signed-off-by: Alexey Kardashevskiy ---

[PATCH kernel 0/5] powerpc/powenv/ioda: Allow huge DMA window at 4GB

2020-02-17 Thread Alexey Kardashevskiy
Here is an attempt to support bigger DMA space for devices supporting DMA masks less than 59 bits (GPUs come into mind first). POWER9 PHBs have an option to map 2 windows at 0 and select a windows based on DMA address being below or above 4GB. This adds the "iommu=iommu_bypass" kernel parameter

[PATCH kernel 3/5] powerpc/powernv/ioda: Allow smaller TCE table levels

2020-02-17 Thread Alexey Kardashevskiy
Now the minimum allocation size for a TCE table level is PAGE_SIZE (64k) as this is the minimum for alloc_pages(). The limit was set in POWER8 where we did not have sparse RAM so we did not need sparse TCE tables. On POWER9 we have gaps in the phys address space for which using multi level TCE

Re: [PATCH kernel v3] powerpc/book3s64: Fix error handling in mm_iommu_do_alloc()

2020-02-17 Thread Alexey Kardashevskiy
On 24/12/2019 10:32, Alexey Kardashevskiy wrote: > > > On 23/12/2019 22:18, Michael Ellerman wrote: >> Alexey Kardashevskiy writes: >> >>> The last jump to free_exit in mm_iommu_do_alloc() happens after page >>> pointers in struct mm_iommu_table_group_mem_t were already converted to >>>

[PATCH v2 3/3] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI and platform drivers

2020-02-17 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. It is different with old ASRC module. The primary features for the EASRC are as follows: - 4 Contexts - groups of channels with an independent time base - Fully independent and concurrent context control -

[PATCH v2 2/3] ASoC: dt-bindings: fsl_easrc: Add document for EASRC

2020-02-17 Thread Shengjiu Wang
EASRC (Enhanced Asynchronous Sample Rate Converter) is a new IP module found on i.MX8MN. Signed-off-by: Shengjiu Wang --- .../devicetree/bindings/sound/fsl,easrc.txt | 57 +++ 1 file changed, 57 insertions(+) create mode 100644

[PATCH v2 0/3] Add new module driver for new ASRC

2020-02-17 Thread Shengjiu Wang
Add new module driver for new ASRC in i.MX8MN. Shengjiu Wang (3): ASoC: fsl_asrc: Move common definition to fsl_asrc_common ASoC: dt-bindings: fsl_easrc: Add document for EASRC ASoC: fsl_easrc: Add EASRC ASoC CPU DAI and platform drivers changes in v2 - change i.MX815 to i.MX8MN - Add

[PATCH v2 1/3] ASoC: fsl_asrc: Move common definition to fsl_asrc_common

2020-02-17 Thread Shengjiu Wang
There is a new ASRC included in i.MX serial platform, there are some common definition can be shared with each other. So move the common definition to a separate header file. Signed-off-by: Shengjiu Wang --- sound/soc/fsl/fsl_asrc.h| 11 +-- sound/soc/fsl/fsl_asrc_common.h | 21

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Christophe Leroy
Le 18/02/2020 à 01:44, Masami Hiramatsu a écrit : On Mon, 17 Feb 2020 16:38:50 +0100 Christophe Leroy wrote: Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit : On Mon, 17 Feb 2020 10:03:22 +0100 Christophe Leroy wrote: Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : On Sat, 15

[PATCH] KVM: PPC: Book3S HV: Use RADIX_PTE_INDEX_SIZE in Radix MMU code

2020-02-17 Thread Michael Ellerman
In kvmppc_unmap_free_pte() in book3s_64_mmu_radix.c, we use the non-constant value PTE_INDEX_SIZE to clear a PTE page. We can instead use the constant RADIX_PTE_INDEX_SIZE, because we know this code will only be running when the Radix MMU is active. Note that we already use RADIX_PTE_INDEX_SIZE

Re: [PATCH 2/5] mm/vma: Make vma_is_accessible() available for general use

2020-02-17 Thread Guo Ren
csky: Acked-by: Guo Ren On Mon, Feb 17, 2020 at 1:04 PM Anshuman Khandual wrote: > > Lets move vma_is_accessible() helper to include/linux/mm.h which makes it > available for general use. While here, this replaces all remaining open > encodings for VMA access check with vma_is_accessible(). >

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Masami Hiramatsu
On Mon, 17 Feb 2020 16:38:50 +0100 Christophe Leroy wrote: > > > Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit : > > On Mon, 17 Feb 2020 10:03:22 +0100 > > Christophe Leroy wrote: > > > >> > >> > >> Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : > >>> On Sat, 15 Feb 2020 11:28:49 +0100

Re: [PATCH] powerpc/chrp: Fix enter_rtas() with CONFIG_VMAP_STACK

2020-02-17 Thread Michael Neuling
On Mon, 2020-02-17 at 07:40 +0100, Christophe Leroy wrote: > > Le 16/02/2020 à 23:40, Michael Neuling a écrit : > > On Fri, 2020-02-14 at 08:33 +, Christophe Leroy wrote: > > > With CONFIG_VMAP_STACK, data MMU has to be enabled > > > to read data on the stack. > > > > Can you describe what

Re: [PATCH v6 02/11] mm/gup: Use functions to track lockless pgtbl walks on gup_pgd_range

2020-02-17 Thread Leonardo Bras
Hello John, comments inline; On Fri, 2020-02-07 at 14:54 -0800, John Hubbard wrote: > On 2/5/20 7:25 PM, Leonardo Bras wrote: > > On Thu, 2020-02-06 at 00:08 -0300, Leonardo Bras wrote: > > > gup_pgd_range(addr, end, gup_flags, pages, ); > > > - local_irq_enable(); >

[PATCH v2 21/24] docs: powerpc: convert vcpudispatch_stats.txt to ReST

2020-02-17 Thread Mauro Carvalho Chehab
- Add a SPDX header; - Use standard markup for document title; - Adjust identation on lists and add blank lines where needed; - Add it to the powerpc index.rst file. Signed-off-by: Mauro Carvalho Chehab --- Documentation/powerpc/index.rst | 1 + ...ispatch_stats.txt =>

Re: [PATCH v6 03/11] powerpc/mm: Adds arch-specificic functions to track lockless pgtable walks

2020-02-17 Thread Leonardo Bras
On Fri, 2020-02-07 at 01:38 -0300, Leonardo Bras wrote: > > Why not make them static inline just like the generic ones ? > > > > Sure, can be done. It would save some function calls. > For that I will define the per-cpu variable in .c and declare it in .h > All new function can be moved to .h,

vdso function descriptors (VDS64_HAS_DESCRIPTORS)?

2020-02-17 Thread Joe Lawrence
I was wondering if there was history behind VDS64_HAS_DESCRIPTORS and in what cases would one want to turn them on? (Note, I'm assuming they are an implementation of Function Descriptors. [1]) arch/powerpc/include/asm/vdso.h unsets the macro: /* Define if 64 bits VDSO has procedure

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Christophe Leroy
On 02/17/2020 03:38 PM, Christophe Leroy wrote: Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit : On Mon, 17 Feb 2020 10:03:22 +0100 Christophe Leroy wrote: Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : On Sat, 15 Feb 2020 11:28:49 +0100 Christophe Leroy wrote: Hi, Le

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Christophe Leroy
Le 17/02/2020 à 11:27, Masami Hiramatsu a écrit : On Mon, 17 Feb 2020 10:03:22 +0100 Christophe Leroy wrote: Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : On Sat, 15 Feb 2020 11:28:49 +0100 Christophe Leroy wrote: Hi, Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit : Hi, On

Re: QEMU/KVM snapshot restore bug

2020-02-17 Thread Cédric Le Goater
On 2/17/20 3:48 AM, dftxbs3e wrote: > On 2/16/20 7:16 PM, Cédric Le Goater wrote: >> >> I think this is fixed by commit f55750e4e4fb ("spapr/xive: Mask the EAS when >> allocating an IRQ") which is not in QEMU 4.1.1. The same problem should also >> occur with LE guests. >> >> Could you possibly

Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

2020-02-17 Thread Leonardo Bras
Hello Christophe, thank you for the feedback. On Mon, 2020-02-17 at 07:31 +0100, Christophe Leroy wrote: > > if (old.oprofile_cpu_type != NULL) { > > t->oprofile_cpu_type = old.oprofile_cpu_type; > > - t->oprofile_type = old.oprofile_type; > >

Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

2020-02-17 Thread Leonardo Bras
On Mon, 2020-02-17 at 09:33 +1100, Michael Neuling wrote: > On Sat, 2020-02-15 at 02:36 -0300, Leonardo Bras wrote: > > Before checking for cpu_type == NULL, this same copy happens, so doing > > it here will just write the same value to the t->oprofile_type > > again. > > > > Remove the repeated

Re: [PATCH] powerpc: Fix /proc/cpuinfo revision for POWER9P processors

2020-02-17 Thread Leonardo Bras
On Sat, 2020-02-15 at 03:23 -0300, Leonardo Bras wrote: > Mahesh Salgaonkar writes: > > Hello Mahesh, > > > POWER9P PVR bits are same as that of POWER9. Hence mask off only the > > relevant bits for the major revision similar to POWER9. > > > > Without this patch the cpuinfo output shows 17.0

Re: [PATCH] selftests/vm: Fix map_hugetlb length used for testing read and write

2020-02-17 Thread Leonardo Bras
On Sat, 2020-02-15 at 03:49 -0300, Leonardo Bras wrote: > Hello Christophe, thank you for the patch. > > On Thu, 2020-02-06 at 08:42 +, Christophe Leroy wrote: > > Commit fa7b9a805c79 ("tools/selftest/vm: allow choosing mem size and > > page size in map_hugetlb") added the possibility to

Re: [PATCH] powerpc/8xx: Fix clearing of bits 20-23 in ITLB miss

2020-02-17 Thread Leonardo Bras
On Sat, 2020-02-15 at 11:17 +0100, Christophe Leroy wrote: > > Le 15/02/2020 à 07:28, Leonardo Bras a écrit : > > On Sun, 2020-02-09 at 18:14 +, Christophe Leroy wrote: > > > In ITLB miss handled the line supposed to clear bits 20-23 on the > > > L2 ITLB entry is buggy and does indeed

[Bug 206525] BUG: KASAN: stack-out-of-bounds in test_bit+0x30/0x44 (kernel 5.6-rc1)

2020-02-17 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206525 Erhard F. (erhar...@mailbox.org) changed: What|Removed |Added Component|PPC-32 |Other

[Bug 206525] BUG: KASAN: stack-out-of-bounds in test_bit+0x30/0x44 (kernel 5.6-rc1)

2020-02-17 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=206525 --- Comment #5 from Christophe Leroy (christophe.le...@c-s.fr) --- That's not a PPC32 bug but a Network bug affecting all 32 bits architectures. -- You are receiving this mail because: You are watching the assignee of the bug.

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Masami Hiramatsu
On Mon, 17 Feb 2020 10:03:22 +0100 Christophe Leroy wrote: > > > Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : > > On Sat, 15 Feb 2020 11:28:49 +0100 > > Christophe Leroy wrote: > > > >> Hi, > >> > >> Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit : > >>> Hi, > >>> > >>> On Fri, 14 Feb

[PATCH] powerpc/mm: Don't kmap_atomic() in pte_offset_map() on PPC32

2020-02-17 Thread Christophe Leroy
On PPC32, pte_offset_map() does a kmap_atomic() in order to support page tables allocated in high memory, just like ARM and x86/32. But since at least 2008 and commit 8054a3428fbe ("powerpc: Remove dead CONFIG_HIGHPTE"), page tables are never allocated in high memory. When the page is in low

Re: [PATCH 2/5] mm/vma: Make vma_is_accessible() available for general use

2020-02-17 Thread Anshuman Khandual
On 02/17/2020 10:33 AM, Anshuman Khandual wrote: > Lets move vma_is_accessible() helper to include/linux/mm.h which makes it > available for general use. While here, this replaces all remaining open > encodings for VMA access check with vma_is_accessible(). > > Cc: Guo Ren > Cc: Geert

Re: [PATCH 3/5] mm/vma: Replace all remaining open encodings with is_vm_hugetlb_page()

2020-02-17 Thread Anshuman Khandual
On 02/17/2020 10:33 AM, Anshuman Khandual wrote: > This replaces all remaining open encodings with is_vm_hugetlb_page(). > > Cc: Paul Mackerras > Cc: Benjamin Herrenschmidt > Cc: Michael Ellerman > Cc: Alexander Viro > Cc: Will Deacon > Cc: "Aneesh Kumar K.V" > Cc: Andrew Morton > Cc: Nick

Re: [PATCH] powerpc/kprobes: Fix trap address when trap happened in real mode

2020-02-17 Thread Christophe Leroy
Le 16/02/2020 à 13:34, Masami Hiramatsu a écrit : On Sat, 15 Feb 2020 11:28:49 +0100 Christophe Leroy wrote: Hi, Le 14/02/2020 à 14:54, Masami Hiramatsu a écrit : Hi, On Fri, 14 Feb 2020 12:47:49 + (UTC) Christophe Leroy wrote: When a program check exception happens while MMU

Re: [PATCH AUTOSEL 5.5 096/542] powerpc/powernv/ioda: Fix ref count for devices with their own PE

2020-02-17 Thread Frederic Barrat
Le 14/02/2020 à 16:41, Sasha Levin a écrit : From: Frederic Barrat [ Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 ] Hi, Upstream commit 05dd7da76986937fb288b4213b1fa10dbe0d1b33 doesn't really need to go to stable (any of 4.19, 5.4 and 5.5). While it's probably safe, the

[PATCH v7 12/12] doc/admin-guide: update kernel.rst with CAP_PERFMON information

2020-02-17 Thread Alexey Budankov
Update kernel.rst documentation file with the information related to usage of CAP_PERFMON capability to secure performance monitoring and observability operations in system. Signed-off-by: Alexey Budankov --- Documentation/admin-guide/sysctl/kernel.rst | 16 +++- 1 file changed,

[PATCH v7 11/12] doc/admin-guide: update perf-security.rst with CAP_PERFMON information

2020-02-17 Thread Alexey Budankov
Update perf-security.rst documentation file with the information related to usage of CAP_PERFMON capability to secure performance monitoring and observability operations in system. Signed-off-by: Alexey Budankov --- Documentation/admin-guide/perf-security.rst | 65 + 1

[PATCH v7 10/12] drivers/oprofile: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

[PATCH v7 09/12] drivers/perf: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

[PATCH v7 08/12] parisc/perf: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

[PATCH v7 07/12] powerpc/perf: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of least

[PATCH v7 06/12] trace/bpf_trace: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to bpf_trace monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of

[PATCH v7 05/12] drm/i915/perf: open access for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to i915_perf monitoring for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. CAP_PERFMON implements the principal of

[PATCH v7 04/12] perf tool: extend Perf tool with CAP_PERFMON capability support

2020-02-17 Thread Alexey Budankov
Extend error messages to mention CAP_PERFMON capability as an option to substitute CAP_SYS_ADMIN capability for secure system performance monitoring and observability. Make perf_event_paranoid_check() and __cmd_ftrace() to be aware of CAP_PERFMON capability. CAP_PERFMON implements the principal

[PATCH v7 03/12] perf/core: open access to probes for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring via kprobes and uprobes and eBPF tracing for CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more secure. perf

[PATCH v7 02/12] perf/core: open access to the core for CAP_PERFMON privileged process

2020-02-17 Thread Alexey Budankov
Open access to monitoring of kernel code, cpus, tracepoints and namespaces data for a CAP_PERFMON privileged process. Providing the access under CAP_PERFMON capability singly, without the rest of CAP_SYS_ADMIN credentials, excludes chances to misuse the credentials and makes operation more

[PATCH v7 01/12] capabilities: introduce CAP_PERFMON to kernel and user space

2020-02-17 Thread Alexey Budankov
Introduce CAP_PERFMON capability designed to secure system performance monitoring and observability operations so that CAP_PERFMON would assist CAP_SYS_ADMIN capability in its governing role for performance monitoring and observability subsystems. CAP_PERFMON hardens system security and

[PATCH v7 00/12] Introduce CAP_PERFMON to secure system performance monitoring and observability

2020-02-17 Thread Alexey Budankov
Currently access to perf_events, i915_perf and other performance monitoring and observability subsystems of the kernel is open only for a privileged process [1] with CAP_SYS_ADMIN capability enabled in the process effective set [2]. This patch set introduces CAP_PERFMON capability designed to