[PATCH v4 3/6] iommu: add iommu_default_dma_mode_get() helper

2019-04-07 Thread Zhen Lei
Add IOMMU_DMA_MODE_IS_LAZY() and IOMMU_DMA_MODE_IS_PASSTHROUGH() to make the code looks cleaner. There is no functional change, just prepare for the following patches. Signed-off-by: Zhen Lei --- drivers/iommu/iommu.c | 12 include/linux/iommu.h | 11 +++ 2 files changed,

[PATCH v4 0/6] normalize IOMMU dma mode boot options

2019-04-07 Thread Zhen Lei
As Robin Murphy's suggestion: "It's also not necessarily obvious to the user how this interacts with IOMMU_DEFAULT_PASSTHROUGH, so if we really do go down this route, maybe it would be better to refactor the whole lot into a single selection of something like IOMMU_DEFAULT_MODE anyway." In this

Re: [PATCH v10 00/18] Introduce the Counter subsystem

2019-04-07 Thread Jonathan Cameron
On Tue, 2 Apr 2019 15:30:35 +0900 William Breathitt Gray wrote: > Changes in v10: > - Fix minor typographical errors in documentation > - Merge the FlexTimer Module Quadrature decoder counter driver patches > > This revision is functionally identical to the last; changes in this > version

[PATCH v4 4/6] s390/pci: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
s390_iommu=strict can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 7 --- arch/s390/pci/pci_dma.c | 20 +--- drivers/iommu/Kconfig | 1 + 3 files

[PATCH v4 2/6] iommu: keep dma mode build options consistent with cmdline options

2019-04-07 Thread Zhen Lei
First, add build option IOMMU_DMA_MODE_LAZY, so that we have the opportunity to set lazy mode as default at build time. Then put the three config options in an choice, make people can only choose one of the three at a time, the same to the boot options iommu.dma_mode. Signed-off-by: Zhen Lei ---

[PATCH v4 6/6] x86/iommu: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
iommu=pt can be replaced with iommu.dma_mode=passthrough. iommu=nopt can be replaced with iommu.dma_mode=lazy. intel_iommu=strict can be replaced with iommu.dma_mode=strict. amd_iommu=fullflush can be replaced with iommu.dma_mode=strict. Note: intel_iommu_strict is not deleted because it can also

[PATCH v4 1/6] iommu: use iommu.dma_mode to replace iommu.passthrough and iommu.strict

2019-04-07 Thread Zhen Lei
Currently the IOMMU dma contains 3 modes: passthrough, lazy, strict. The passthrough mode bypass the IOMMU, the lazy mode defer the invalidation of hardware TLBs, and the strict mode invalidate IOMMU hardware TLBs synchronously. The three modes are mutually exclusive. So people maybe confused

[PATCH v4 5/6] powernv/iommu: use common boot option iommu.dma_mode

2019-04-07 Thread Zhen Lei
iommu=nobypass can be replaced with iommu.dma_mode=strict. Signed-off-by: Zhen Lei --- Documentation/admin-guide/kernel-parameters.txt | 2 -- arch/powerpc/platforms/powernv/pci-ioda.c | 23 +-- drivers/iommu/Kconfig | 1 + 3 files changed,

Re: [PATCH kernel] powerpc/mm_iommu: Allow pinning large regions

2019-04-07 Thread David Gibson
On Tue, Apr 02, 2019 at 03:31:01PM +1100, Alexey Kardashevskiy wrote: > When called with vmas_arg==NULL, get_user_pages_longterm() allocates > an array of nr_pages*8 which can easily get greater that the max order, > for example, registering memory for a 256GB guest does this and fails > in

Re: [PATCH v2] powerpc/xmon: add read-only mode

2019-04-07 Thread Oliver
On Mon, Apr 8, 2019 at 1:06 PM Christopher M. Riedl wrote: > > Operations which write to memory and special purpose registers should be > restricted on systems with integrity guarantees (such as Secure Boot) > and, optionally, to avoid self-destructive behaviors. > > Add a config option, XMON_RW,

[PATCH v2] powerpc/xmon: add read-only mode

2019-04-07 Thread Christopher M. Riedl
Operations which write to memory and special purpose registers should be restricted on systems with integrity guarantees (such as Secure Boot) and, optionally, to avoid self-destructive behaviors. Add a config option, XMON_RW, to control default xmon behavior along with kernel cmdline options

Re: [PATCH v4 0/6] normalize IOMMU dma mode boot options

2019-04-07 Thread Hanjun Guo
Hi Zhen, On 2019/4/7 20:41, Zhen Lei wrote: > As Robin Murphy's suggestion: > "It's also not necessarily obvious to the user how this interacts with > IOMMU_DEFAULT_PASSTHROUGH, so if we really do go down this route, maybe it > would be better to refactor the whole lot into a single selection of

Re: [PATCH v4 0/6] normalize IOMMU dma mode boot options

2019-04-07 Thread Leizhen (ThunderTown)
On 2019/4/8 9:14, Hanjun Guo wrote: > Hi Zhen, > > On 2019/4/7 20:41, Zhen Lei wrote: >> As Robin Murphy's suggestion: >> "It's also not necessarily obvious to the user how this interacts with >> IOMMU_DEFAULT_PASSTHROUGH, so if we really do go down this route, maybe it >> would be better to

Re: [PATCH] powerpc/pseries/pmem: fix a set but not used value

2019-04-07 Thread Mukesh Ojha
On 4/7/2019 7:24 AM, Qian Cai wrote: The commit 4c5d87db4978 ("powerpc/pseries: PAPR persistent memory support") set a local variable "count" in dlpar_hp_pmem() but never use it. arch/powerpc/platforms/pseries/pmem.c: In function 'dlpar_hp_pmem': arch/powerpc/platforms/pseries/pmem.c:109:6:

Re: [PATCH] powerpc/configs: Enable CONFIG_USB_XHCI_HCD by default

2019-04-07 Thread Thomas Huth
On 12/02/2019 00.31, David Gibson wrote: > On Mon, 11 Feb 2019 12:37:12 +0100 > Thomas Huth wrote: > >> Recent versions of QEMU provide a XHCI device by default these >> days instead of an old-fashioned OHCI device: >> >> https://git.qemu.org/?p=qemu.git;a=commitdiff;h=57040d451315320b7d27 >>

Re: [PATCH] powerpc/pseries/iommu: fix set but not used values

2019-04-07 Thread Mukesh Ojha
On 4/7/2019 8:18 AM, Qian Cai wrote: The commit b7d6bf4fdd47 ("powerpc/pseries/pci: Remove obsolete SW invalidate") left 2 variables unused. arch/powerpc/platforms/pseries/iommu.c: In function 'tce_build_pSeries': arch/powerpc/platforms/pseries/iommu.c:108:17: warning: variable 'tces' set but