Re: [for-next][PATCH 09/18] powerpc/function_graph: Simplify with function_graph_entry()

2018-11-22 Thread Sasha Levin
Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 03274a3ffb44 tracing/fgraph: Adjust fgraph depth before calling trace return callback. The bot has tested the following trees: v4.19.3, v4.14.82, v4.9.138, v4.4.164, v3.18.126.

[PATCH kernel v4 15/19] powerpc/powernv/npu: Add compound IOMMU groups

2018-11-22 Thread Alexey Kardashevskiy
At the moment the powernv platform registers an IOMMU group for each PE. There is an exception though: an NVLink bridge which is attached to the corresponding GPU's IOMMU group making it a master. Now we have POWER9 systems with GPUs connected to each other directly bypassing PCI. At the moment

[PATCH kernel v4 14/19] powerpc/powernv/npu: Convert NPU IOMMU helpers to iommu_table_group_ops

2018-11-22 Thread Alexey Kardashevskiy
At the moment NPU IOMMU is manipulated directly from the IODA2 PCI PE code; PCI PE acts as a master to NPU PE. Soon we will have compound IOMMU groups with several PEs from several different PHB (such as interconnected GPUs and NPUs) so there will be no single master but a one big IOMMU group.

[PATCH kernel v4 12/19] powerpc/powernv: Add purge cache OPAL call

2018-11-22 Thread Alexey Kardashevskiy
Flushing caches using the dcbf instruction takes quite some time if we need to flush gigabytes (16GB takes more than 15s); OPAL just added a big hammer to flush all caches. This adds opal_purge_cache() which will be used later to flush caches for coherent GPU memory which might suddenly become

[PATCH kernel v4 19/19] vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver

2018-11-22 Thread Alexey Kardashevskiy
POWER9 Witherspoon machines come with 4 or 6 V100 GPUs which are not pluggable PCIe devices but still have PCIe links which are used for config space and MMIO. In addition to that the GPUs have 6 NVLinks which are connected to other GPUs and the POWER9 CPU. POWER9 chips have a special unit on a

[PATCH kernel v4 11/19] powerpc/powernv: Reference iommu_table while it is linked to a group

2018-11-22 Thread Alexey Kardashevskiy
The iommu_table pointer stored in iommu_table_group may get stale by accident, this adds referencing and removes a redundant comment about this. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- arch/powerpc/platforms/powernv/pci-ioda-tce.c | 3 ++-

[PATCH kernel v4 18/19] vfio_pci: Allow regions to add own capabilities

2018-11-22 Thread Alexey Kardashevskiy
VFIO regions already support region capabilities with a limited set of fields. However the subdriver might have to report to the userspace additional bits. This adds an add_capability() hook to vfio_pci_regops. Signed-off-by: Alexey Kardashevskiy --- Changes: v3: * removed confusing rationale

[PATCH kernel v4 17/19] vfio_pci: Allow mapping extra regions

2018-11-22 Thread Alexey Kardashevskiy
So far we only allowed mapping of MMIO BARs to the userspace. However there there are GPUs with on-board coherent RAM accessible via side channels which we also want to map to the userspace. The first client for this is NVIDIA V100 GPU with NVLink2 direct links to a POWER9 NPU-enabled CPU; such

[PATCH kernel v4 16/19] powerpc/powernv/npu: Add release_ownership hook

2018-11-22 Thread Alexey Kardashevskiy
In order to make ATS work and translate addresses for arbitrary LPID and PID, we need to program an NPU with LPID and allow PID wildcard matching with a specific MSR mask. This implements a helper to assign a GPU to LPAR and program the NPU with a wildcard for PID and a helper to do clean-up. The

[PATCH kernel v4 07/19] powerpc/pseries/npu: Enable platform support

2018-11-22 Thread Alexey Kardashevskiy
We already changed NPU API for GPUs to not to call OPAL and the remaining bit is initializing NPU structures. This searches for POWER9 NVLinks attached to any device on a PHB and initializes an NPU structure if any found. Signed-off-by: Alexey Kardashevskiy --- Changes: v4: * dropped

[PATCH kernel v4 06/19] powerpc/pseries/iommu: Use memory@ nodes in max RAM address calculation

2018-11-22 Thread Alexey Kardashevskiy
We might have memory@ nodes with "linux,usable-memory" set to zero (for example, to replicate powernv's behaviour for GPU coherent memory) which means that the memory needs an extra initialization but since it can be used afterwards, the pseries platform will try mapping it for DMA so the DMA

[PATCH kernel v4 13/19] powerpc/powernv/npu: Move single TVE handling to NPU PE

2018-11-22 Thread Alexey Kardashevskiy
Normal PCI PEs have 2 TVEs, one per a DMA window; however NPU PE has only one which points to one of two tables of the corresponding PCI PE. So whenever a new DMA window is programmed to PEs, the NPU PE needs to release old table in order to use the new one. Commit d41ce7b1bcc3e

[PATCH kernel v4 04/19] powerpc/powernv: Move npu struct from pnv_phb to pci_controller

2018-11-22 Thread Alexey Kardashevskiy
The powernv PCI code stores NPU data in the pnv_phb struct. The latter is referenced by pci_controller::private_data. We are going to have NPU2 support in the pseries platform as well but it does not store any private_data in in the pci_controller struct; and even if it did, it would be a

[PATCH kernel v4 10/19] powerpc/iommu_api: Move IOMMU groups setup to a single place

2018-11-22 Thread Alexey Kardashevskiy
Registering new IOMMU groups and adding devices to them are separated in code and the latter is dug in the DMA setup code which it does not really belong to. This moved IOMMU groups setup to a separate helper which registers a group and adds devices as before. This does not make a difference as

[PATCH kernel v4 01/19] powerpc/ioda/npu: Call skiboot's hot reset hook when disabling NPU2

2018-11-22 Thread Alexey Kardashevskiy
The skiboot firmware has a hot reset handler which fences the NVIDIA V100 GPU RAM on Witherspoons and makes accesses no-op instead of throwing HMIs: https://github.com/open-power/skiboot/commit/fca2b2b839a67 Now we are going to pass V100 via VFIO which most certainly involves KVM guests which are

[PATCH kernel v4 09/19] powerpc/powernv/pseries: Rework device adding to IOMMU groups

2018-11-22 Thread Alexey Kardashevskiy
The powernv platform registers IOMMU groups and adds devices to them from the pci_controller_ops::setup_bridge() hook except one case when virtual functions (SRIOV VFs) are added from a bus notifier. The pseries platform registers IOMMU groups from the pci_controller_ops::dma_bus_setup() hook and

[PATCH kernel v4 00/19] powerpc/powernv/npu, vfio: NVIDIA V100 + P9 passthrough

2018-11-22 Thread Alexey Kardashevskiy
This is for passing through NVIDIA V100 GPUs on POWER9 systems. 19/19 has the details of hardware setup. This implements support for NVIDIA V100 GPU with coherent memory and NPU/ATS support available in the POWER9 CPU. The aim is to support unmodified vendor driver in the guest. This is pushed

[PATCH kernel v4 08/19] powerpc/pseries: Remove IOMMU API support for non-LPAR systems

2018-11-22 Thread Alexey Kardashevskiy
The pci_dma_bus_setup_pSeries and pci_dma_dev_setup_pSeries hooks are registered for the pseries platform which does not have FW_FEATURE_LPAR; these would be pre-powernv platforms which we never supported PCI pass through for anyway so remove it. Signed-off-by: Alexey Kardashevskiy Reviewed-by:

[PATCH kernel v4 05/19] powerpc/powernv/npu: Move OPAL calls away from context manipulation

2018-11-22 Thread Alexey Kardashevskiy
When introduced, the NPU context init/destroy helpers called OPAL which enabled/disabled PID (a userspace memory context ID) filtering in an NPU per a GPU; this was a requirement for P9 DD1.0. However newer chip revision added a PID wildcard support so there is no more need to call OPAL every time

[PATCH kernel v4 03/19] powerpc/vfio/iommu/kvm: Do not pin device memory

2018-11-22 Thread Alexey Kardashevskiy
This new memory does not have page structs as it is not plugged to the host so gup() will fail anyway. This adds 2 helpers: - mm_iommu_newdev() to preregister the "memory device" memory so the rest of API can still be used; - mm_iommu_is_devmem() to know if the physical address is one of thise

[PATCH kernel v4 02/19] powerpc/mm/iommu/vfio_spapr_tce: Change mm_iommu_get to reference a region

2018-11-22 Thread Alexey Kardashevskiy
Normally mm_iommu_get() is supposed to add a reference and mm_iommu_put() to remove it. However historically mm_iommu_find() does the referencing and mm_iommu_get() is doing allocation and referencing. We are going to add another helper to preregister device memory so instead of having

Re: [PATCH 5/9] PCI: consolidate the PCI_DOMAINS and PCI_DOMAINS_GENERIC config options

2018-11-22 Thread Masahiro Yamada
On Fri, Nov 16, 2018 at 4:07 AM Christoph Hellwig wrote: > diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig > index a8128a1946a2..95812fc4958c 100644 > --- a/drivers/pci/Kconfig > +++ b/drivers/pci/Kconfig > @@ -21,6 +21,15 @@ menuconfig PCI > support for PCI-X and the

Re: [PATCH 2/9] alpha: force PCI on for non-jensen configs

2018-11-22 Thread Masahiro Yamada
On Fri, Nov 16, 2018 at 4:06 AM Christoph Hellwig wrote: > > Without PCI support the kernel won't even compile, so force it on. > > Signed-off-by: Christoph Hellwig > --- I do not understand this patch because alpha already enables PCI forcibly. 'No prompt' + 'default y' means always on.

Re: [PATCH 1/9] arm: remove EISA kconfig option

2018-11-22 Thread Masahiro Yamada
On Fri, Nov 16, 2018 at 4:06 AM Christoph Hellwig wrote: > > No arm config enables EISA, and arm does not include drivers/eisa/Kconfig > which provides support for things like PCI to EISA bridges, so it is most > likely dead. As I said before, this is absolutely dead. Only the difference

Re: [PATCH 3/9] MIPS: remove the HT_PCI config option

2018-11-22 Thread Masahiro Yamada
On Tue, Nov 20, 2018 at 6:07 AM Paul Burton wrote: > > On Mon, Nov 19, 2018 at 01:01:41PM -0800, Paul Burton wrote: > > On Thu, Nov 15, 2018 at 08:05:31PM +0100, Christoph Hellwig wrote: > > > This option is always selected from LOONGSON_MACH3X. Switch to just > > > seleting PCI from that option

Re: move bus (PCI, PCMCIA, EISA, rapdio) config to drivers/ v4

2018-11-22 Thread Masahiro Yamada
On Fri, Nov 23, 2018 at 11:32 AM Masahiro Yamada wrote: > > Hi Christoph, > > > On Fri, Nov 16, 2018 at 4:08 AM Christoph Hellwig wrote: > > > > Hi all, > > > > currently every architecture that wants to provide on of the common > > periphal busses needs to add some boilerplate code and include

Re: [PATCH 9/9] eisa: consolidate EISA Kconfig entry in drivers/eisa

2018-11-22 Thread Masahiro Yamada
On Fri, Nov 16, 2018 at 4:06 AM Christoph Hellwig wrote: > > Let architectures opt into EISA support by selecting HAS_EISA and I locally fixed the commit log (HAS_EISA -> HAVE_EISA) so that it matches to the code. Thanks. > handle everything else in drivers/eisa. > > Signed-off-by: Christoph

Re: move bus (PCI, PCMCIA, EISA, rapdio) config to drivers/ v4

2018-11-22 Thread Masahiro Yamada
Hi Christoph, On Fri, Nov 16, 2018 at 4:08 AM Christoph Hellwig wrote: > > Hi all, > > currently every architecture that wants to provide on of the common > periphal busses needs to add some boilerplate code and include the > right Kconfig files. This series instead just selects the presence

Re: [PATCH] mm: convert totalram_pages, totalhigh_pages and managed_pages to atomic.

2018-11-22 Thread Kuehling, Felix
On 2018-10-22 1:23 p.m., Arun KS wrote: > Remove managed_page_count_lock spinlock and instead use atomic > variables. > > Suggested-by: Michal Hocko > Suggested-by: Vlastimil Babka > Signed-off-by: Arun KS Acked-by: Felix Kuehling Regards,   Felix > > --- > As discussed here, >

[PATCH] soc/fsl/qe: fix err handling of ucc_of_parse_tdm

2018-11-22 Thread Yi Wang
From: Wen Yang Currently there are 2 problems with the ucc_of_parse_tdm function: 1,a possible null pointer dereference in ucc_of_parse_tdm, detected by the semantic patch deref_null.cocci, with the following warning: drivers/soc/fsl/qe/qe_tdm.c:177:21-24: ERROR: pdev is NULL but dereferenced.

[PATCH AUTOSEL 3.18 6/7] powerpc/numa: Suppress "VPHN is not supported" messages

2018-11-22 Thread Sasha Levin
From: Satheesh Rajendran [ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ] When VPHN function is not supported and during cpu hotplug event, kernel prints message 'VPHN function not supported. Disabling polling...'. Currently it prints on every hotplug event, it floods dmesg when a

[PATCH AUTOSEL 4.4 7/8] powerpc/numa: Suppress "VPHN is not supported" messages

2018-11-22 Thread Sasha Levin
From: Satheesh Rajendran [ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ] When VPHN function is not supported and during cpu hotplug event, kernel prints message 'VPHN function not supported. Disabling polling...'. Currently it prints on every hotplug event, it floods dmesg when a

[PATCH AUTOSEL 4.4 1/8] KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

2018-11-22 Thread Sasha Levin
From: Scott Wood [ Upstream commit 28c5bcf74fa07c25d5bd118d1271920f51ce2a98 ] TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by , so like that #include, they should be outside #ifdef protection. They also need to be #undefed before defining, in case multiple trace headers are included by

[PATCH AUTOSEL 4.9 13/15] powerpc/numa: Suppress "VPHN is not supported" messages

2018-11-22 Thread Sasha Levin
From: Satheesh Rajendran [ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ] When VPHN function is not supported and during cpu hotplug event, kernel prints message 'VPHN function not supported. Disabling polling...'. Currently it prints on every hotplug event, it floods dmesg when a

[PATCH AUTOSEL 4.9 07/15] powerpc/io: Fix the IO workarounds code to work with Radix

2018-11-22 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 43c6494fa1499912c8177e71450c0279041152a6 ] Back in 2006 Ben added some workarounds for a misbehaviour in the Spider IO bridge used on early Cell machines, see commit 014da7ff47b5 ("[POWERPC] Cell "Spider" MMIO workarounds"). Later these were made to be

[PATCH AUTOSEL 4.9 03/15] KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

2018-11-22 Thread Sasha Levin
From: Scott Wood [ Upstream commit 28c5bcf74fa07c25d5bd118d1271920f51ce2a98 ] TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by , so like that #include, they should be outside #ifdef protection. They also need to be #undefed before defining, in case multiple trace headers are included by

[PATCH AUTOSEL 4.14 17/21] powerpc/numa: Suppress "VPHN is not supported" messages

2018-11-22 Thread Sasha Levin
From: Satheesh Rajendran [ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ] When VPHN function is not supported and during cpu hotplug event, kernel prints message 'VPHN function not supported. Disabling polling...'. Currently it prints on every hotplug event, it floods dmesg when a

[PATCH AUTOSEL 4.14 08/21] powerpc/io: Fix the IO workarounds code to work with Radix

2018-11-22 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 43c6494fa1499912c8177e71450c0279041152a6 ] Back in 2006 Ben added some workarounds for a misbehaviour in the Spider IO bridge used on early Cell machines, see commit 014da7ff47b5 ("[POWERPC] Cell "Spider" MMIO workarounds"). Later these were made to be

[PATCH AUTOSEL 4.14 03/21] KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

2018-11-22 Thread Sasha Levin
From: Scott Wood [ Upstream commit 28c5bcf74fa07c25d5bd118d1271920f51ce2a98 ] TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by , so like that #include, they should be outside #ifdef protection. They also need to be #undefed before defining, in case multiple trace headers are included by

[PATCH AUTOSEL 4.19 31/36] powerpc/numa: Suppress "VPHN is not supported" messages

2018-11-22 Thread Sasha Levin
From: Satheesh Rajendran [ Upstream commit 437ccdc8ce629470babdda1a7086e2f477048cbd ] When VPHN function is not supported and during cpu hotplug event, kernel prints message 'VPHN function not supported. Disabling polling...'. Currently it prints on every hotplug event, it floods dmesg when a

Re: [PATCH net 0/2] ibmvnic: Fix queue and buffer accounting errors

2018-11-22 Thread David Miller
From: Thomas Falcon Date: Wed, 21 Nov 2018 11:17:57 -0600 > This series includes two small fixes. The first resolves a typo bug > in the code to clean up unused RX buffers during device queue removal. > The second ensures that device queue memory is updated to reflect new > supported queue ring

[PATCH AUTOSEL 4.19 16/36] powerpc/io: Fix the IO workarounds code to work with Radix

2018-11-22 Thread Sasha Levin
From: Michael Ellerman [ Upstream commit 43c6494fa1499912c8177e71450c0279041152a6 ] Back in 2006 Ben added some workarounds for a misbehaviour in the Spider IO bridge used on early Cell machines, see commit 014da7ff47b5 ("[POWERPC] Cell "Spider" MMIO workarounds"). Later these were made to be

[PATCH AUTOSEL 4.19 10/36] KVM: PPC: Move and undef TRACE_INCLUDE_PATH/FILE

2018-11-22 Thread Sasha Levin
From: Scott Wood [ Upstream commit 28c5bcf74fa07c25d5bd118d1271920f51ce2a98 ] TRACE_INCLUDE_PATH and TRACE_INCLUDE_FILE are used by , so like that #include, they should be outside #ifdef protection. They also need to be #undefed before defining, in case multiple trace headers are included by

[PATCH 4/4] powerpc/64s: Implement KUAP for Radix MMU

2018-11-22 Thread Russell Currey
Kernel Userspace Access Prevention utilises a feature of the Radix MMU which disallows read and write access to userspace addresses. By utilising this, the kernel is prevented from accessing user data from outside of trusted paths that perform proper safety checks, such as copy_{to/from}_user()

[PATCH 3/4] powerpc/mm/radix: Use KUEP API for Radix MMU

2018-11-22 Thread Russell Currey
Execution protection already exists on radix, this just refactors the radix init to provide the KUEP setup function instead. Thus, the only functional change is that it can now be disabled. Signed-off-by: Russell Currey --- arch/powerpc/mm/pgtable-radix.c| 9 ++---

[PATCH 2/4] powerpc/64: Setup KUP before feature fixups

2018-11-22 Thread Russell Currey
The subsequent implementation of KUAP for radix makes use of a MMU feature in order to patch out assembly when KUAP is disabled or unsupported. This won't work unless there's an entry point for KUP support before the feature magic happens, so relocate setup_kup() earlier in setup. Signed-off-by:

[PATCH 1/4] powerpc: Track KUAP state in the PACA

2018-11-22 Thread Russell Currey
Necessary for subsequent patches that enable KUAP support for radix. Could plausibly be useful for other platforms too, if similar to the radix case, reading the register that manages these accesses is costly. Has the unfortunate downside of another layer of abstraction for platforms that

[PATCH 0/4] Kernel Userspace Protection for Radix MMU

2018-11-22 Thread Russell Currey
Back again, this time based on top of Christophe Leroy's series: http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=74541 With the magic perk of being the snowpatch maintainer I will try and get the snowpatch results for this series to be applied on top of that series so all the tests

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Andrew Murray
On Thu, Nov 22, 2018 at 01:26:37PM +0100, Peter Zijlstra wrote: > On Thu, Nov 22, 2018 at 12:21:43PM +, Andrew Murray wrote: > > On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > > > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > > index

Re: [PATCH] powerpc/tm: Set MSR[TS] just prior to recheckpoint

2018-11-22 Thread Breno Leitao
Hi Mikey, On 11/21/18 8:42 PM, Michael Neuling wrote: >> Do you mean in this part of code? >> >> SYSCALL_DEFINE0(rt_sigreturn) >> { >> >> if (__copy_from_user(, >uc_sigmask, sizeof(set))) >> goto badframe; >> >> ... >> if

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Peter Zijlstra
On Thu, Nov 22, 2018 at 12:21:43PM +, Andrew Murray wrote: > On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > > diff --git a/kernel/events/core.c b/kernel/events/core.c > > index 84530ab358c3..d76b724177b9 100644 > > --- a/kernel/events/core.c > > +++ b/kernel/events/core.c >

Re: [PATCH 00/10] perf/core: Generalise event exclusion checking

2018-11-22 Thread Andrew Murray
On Mon, Nov 19, 2018 at 02:08:00PM +0100, Peter Zijlstra wrote: > On Fri, Nov 16, 2018 at 10:24:03AM +, Andrew Murray wrote: > > Many PMU drivers do not have the capability to exclude counting events > > that occur in specific contexts such as idle, kernel, guest, etc. These > > drivers