Re: [PATCH V3 8/9] powerpc/powernv: Support PCI config restore for VFs

2015-05-11 Thread Gavin Shan
On Tue, May 12, 2015 at 09:31:34AM +0800, Wei Yang wrote: >On Mon, May 11, 2015 at 02:22:38PM +1000, Gavin Shan wrote: >>On Mon, May 04, 2015 at 03:07:37PM +0800, Wei Yang wrote: >>>Since FW is not aware of VFs, the restore action for VF should be done in >> ^^ >> skiboot firmware >>>ke

Re: [PATCH V3 5/9] powerpc/eeh: create EEH_PE_VF for VF PE

2015-05-11 Thread Gavin Shan
On Mon, May 11, 2015 at 02:25:49PM +0800, Wei Yang wrote: >On Mon, May 11, 2015 at 12:37:07PM +1000, Gavin Shan wrote: >>On Mon, May 04, 2015 at 03:07:34PM +0800, Wei Yang wrote: >> >>Please reorder PATCH[6] with this one because the EEH device is expected >>to be created before EEH PE. > >That's a

Re: [PATCH V3 2/9] powerpc/pci_dn: cache vf_index in pci_dn

2015-05-11 Thread Gavin Shan
On Mon, May 11, 2015 at 01:54:12PM +0800, Wei Yang wrote: >On Mon, May 11, 2015 at 12:21:04PM +1000, Gavin Shan wrote: >>On Mon, May 04, 2015 at 03:07:31PM +0800, Wei Yang wrote: >>>This patch caches the index of a VF in its PF in pci_dn. >>> >> >>At least you can mention the purpose of vf_index to

[PATCH V4 1/3] mm/thp: Split out pmd collpase flush into a separate functions

2015-05-11 Thread Aneesh Kumar K.V
Architectures like ppc64 [1] need to do special things while clearing pmd before a collapse. For them this operation is largely different from a normal hugepage pte clear. Hence add a separate function to clear pmd before collapse. After this patch pmdp_* functions operate only on hugepage pte, and

[PATCH V4 2/3] powerpc/mm: Use generic version of pmdp_clear_flush

2015-05-11 Thread Aneesh Kumar K.V
Also move the pmd_trans_huge check to generic code. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/pgtable-ppc64.h | 4 arch/powerpc/mm/pgtable_64.c | 11 --- mm/pgtable-generic.c | 1 + 3 files changed, 1 insertion(+), 15 deletions(-)

[PATCH V4 3/3] mm: Clarify that the function operateds on hugepage pte

2015-05-11 Thread Aneesh Kumar K.V
We have confusing functions to clear pmd, pmd_clear_* and pmd_clear. Add _huge_ to pmdp_clear functions so that we are clear that they operate on hugepage pte. We don't bother about other functions like pmdp_set_wrprotect, pmdp_clear_flush_young, because they operate on PTE bits and hence indicate

Re: [PATCH V3 00/13] POWER DSCR fixes, improvements, docs and tests

2015-05-11 Thread Anshuman Khandual
On 04/10/2015 01:59 PM, Anshuman Khandual wrote: > This patch series has patches for POWER DSCR fixes, improvements, > in code documentaion, kernel support user documentation and selftest based > test cases. It has got five test cases which are derived from Anton's DSCR > test bucket which ca

Re: [PATCH RESEND v6 1/2] arm64: dts: Add the arasan sdhci nodes in apm-storm.dtsi

2015-05-11 Thread Suman Tripathi
Hi , On Mon, May 11, 2015 at 2:08 PM, Suman Tripathi wrote: > This patch adds the arasan sdhci nodes to reuse the of-arasan > driver for APM X-Gene SoC. > > Signed-off-by: Suman Tripathi > --- > arch/arm64/boot/dts/apm/apm-mustang.dts | 4 +++ > arch/arm64/boot/dts/apm/apm-storm.dtsi | 43 >

[PATCH v3] powerpc/defconfig: new way of writing defconfig

2015-05-11 Thread Lijun Pan
It is always a headache dealing with different defconfigs though they only differ in a few places. Hence we are proposing a new way of writing the defconfig: 1. Define a basic defconfig say mpc85xx_basic_defconfig 2. Spin off as much features as possible from the current mpc85xx_defconfig a

[PATCH] powerpc/defconfig: new way of writing defconfig

2015-05-11 Thread Lijun Pan
It is always a headache dealing with different defconfigs though they only differ in a few places. Hence we are proposing a new way of writing the defconfig: 1. Define a basic defconfig say mpc85xx_basic_defconfig 2. Spin off as much features as possible from the current mpc85xx_defconfig a

[PATCH v2] powerpc/mce: fix off by one errors in mce event handling

2015-05-11 Thread Daniel Axtens
Before 69111bac42f5 ("powerpc: Replace __get_cpu_var uses"), in save_mce_event, index got the value of mce_nest_count, and mce_nest_count was incremented *after* index was set. However, that patch changed the behaviour so that mce_nest count was incremented *before* setting index. This causes an

Re: [PATCH kernel v10 01/34] powerpc/eeh/ioda2: Use device::iommu_group to check IOMMU group

2015-05-11 Thread Gavin Shan
On Tue, May 12, 2015 at 01:38:50AM +1000, Alexey Kardashevskiy wrote: >This relies on the fact that a PCI device always has an IOMMU table >which may not be the case when we get dynamic DMA windows so >let's use more reliable check for IOMMU group here. > >As we do not rely on the table presence he

Re: [PATCH V3 8/9] powerpc/powernv: Support PCI config restore for VFs

2015-05-11 Thread Wei Yang
On Mon, May 11, 2015 at 02:22:38PM +1000, Gavin Shan wrote: >On Mon, May 04, 2015 at 03:07:37PM +0800, Wei Yang wrote: >>Since FW is not aware of VFs, the restore action for VF should be done in > ^^ > skiboot firmware >>kernel. >> >>This patch introduces pnv_eeh_vf_restore_config() for

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-11 Thread Gavin Shan
On Tue, May 12, 2015 at 10:53:29AM +1000, Alexey Kardashevskiy wrote: >On 05/12/2015 10:03 AM, Gavin Shan wrote: >>On Mon, May 11, 2015 at 05:02:08PM +1000, Alexey Kardashevskiy wrote: >>>On 05/11/2015 04:25 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 10:43:23PM +1000, Alexey Kardashevskiy wr

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-11 Thread Alexey Kardashevskiy
On 05/12/2015 10:03 AM, Gavin Shan wrote: On Mon, May 11, 2015 at 05:02:08PM +1000, Alexey Kardashevskiy wrote: On 05/11/2015 04:25 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 10:43:23PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: The original code doesn't s

Re: [PATCH v4 10/21] powerpc/powernv: Fundamental reset for PCI bus reset

2015-05-11 Thread Gavin Shan
On Mon, May 11, 2015 at 05:17:42PM +1000, Alexey Kardashevskiy wrote: >On 05/11/2015 04:47 PM, Gavin Shan wrote: >>On Sun, May 10, 2015 at 12:12:18AM +1000, Alexey Kardashevskiy wrote: >>>On 05/01/2015 04:02 PM, Gavin Shan wrote: Function pnv_pci_reset_secondary_bus() is used to reset specified

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-11 Thread Gavin Shan
On Mon, May 11, 2015 at 05:02:08PM +1000, Alexey Kardashevskiy wrote: >On 05/11/2015 04:25 PM, Gavin Shan wrote: >>On Sat, May 09, 2015 at 10:43:23PM +1000, Alexey Kardashevskiy wrote: >>>On 05/01/2015 04:02 PM, Gavin Shan wrote: The original code doesn't support releasing PEs dynamically, mean

Re: [PATCH] i2c: powermac: don't workaround for keywest

2015-05-11 Thread Benjamin Herrenschmidt
On Mon, 2015-05-11 at 09:34 +0200, w...@the-dreams.de wrote: > On Mon, May 11, 2015 at 08:14:47AM +1000, Benjamin Herrenschmidt wrote: > > On Sun, 2015-05-10 at 20:34 +0200, Wolfram Sang wrote: > > > Okay, so this patch is bogus. I understand now that onyx uses another > > > codec than TAS, so this

Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures

2015-05-11 Thread Rafael J. Wysocki
On Monday, May 11, 2015 07:40:41 PM Daniel Lezcano wrote: > On 05/10/2015 01:15 AM, Rafael J. Wysocki wrote: > > On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: > >> On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: > >>> On Saturday, May 09, 2015 11:19:16 AM Preeti U Mu

Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures

2015-05-11 Thread Rafael J. Wysocki
On Monday, May 11, 2015 04:13:37 PM Sudeep Holla wrote: > > On 10/05/15 00:15, Rafael J. Wysocki wrote: > > On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: > >> On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: > >>> On Saturday, May 09, 2015 11:19:16 AM Preeti U Murthy

Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures

2015-05-11 Thread Rafael J. Wysocki
On Monday, May 11, 2015 10:51:02 AM Preeti U Murthy wrote: > On 05/10/2015 04:45 AM, Rafael J. Wysocki wrote: > > On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: > >> On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: > >>> On Saturday, May 09, 2015 11:19:16 AM Preeti U M

Re: [PATCH V3] mm/thp: Split out pmd collpase flush into a separate functions

2015-05-11 Thread Andrew Morton
On Mon, 11 May 2015 12:09:30 +0530 "Aneesh Kumar K.V" wrote: > Architectures like ppc64 [1] need to do special things while clearing > pmd before a collapse. For them this operation is largely different > from a normal hugepage pte clear. Hence add a separate function > to clear pmd before colla

Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-05-11 Thread Stewart Smith
trigg writes: >> --- a/arch/powerpc/include/asm/opal-api.h >> +++ b/arch/powerpc/include/asm/opal-api.h >> @@ -730,6 +730,36 @@ struct opal_i2c_request { >> __be64 buffer_ra; /* Buffer real address */ >> }; >> >> +/* >> + * EPOW status sharing (OPAL and the host) >> + * >> +

Re: [PATCH v3 3/3] kvm/powerpc: Export HCALL reason codes

2015-05-11 Thread Scott Wood
On Fri, 2015-05-08 at 06:23 +0530, Hemant Kumar wrote: > For perf to analyze the KVM events like hcalls, we need the > hypervisor calls and their codes to be exported through uapi. > > This patch moves most of the pSeries hcall codes from > arch/powerpc/include/asm/hvcall.h to > arch/powerpc/inclu

Re: [PATCH v3 1/2] perf/kvm: Port perf kvm to powerpc

2015-05-11 Thread Scott Wood
On Fri, 2015-05-08 at 06:37 +0530, Hemant Kumar wrote: > From: Srikar Dronamraju > > perf kvm can be used to analyze guest exit reasons. This support already > exists in x86. Hence, porting it to powerpc. > > - To trace KVM events : > perf kvm stat record > If many guests are running, we ca

Re: [PATCH 0/3] Allow user to request memory to be locked on page fault

2015-05-11 Thread Eric B Munson
On Mon, 11 May 2015, Andrew Morton wrote: > On Mon, 11 May 2015 10:36:18 -0400 Eric B Munson wrote: > > > On Fri, 08 May 2015, Andrew Morton wrote: > > ... > > > > > > > > Why can't the application mmap only those parts of the file which it > > > wants and mlock those? > > > > There are a numb

Re: [PATCH] QorIQ/TMU: add thermal management support based on TMU

2015-05-11 Thread Eduardo Valentin
Jia Hongtao, Thanks for sharing your driver. Sorry for the late answer. Please find couple of comments as follows. On Fri, Apr 03, 2015 at 03:11:27PM +0800, Jia Hongtao wrote: > It supports one critical trip point and one passive trip point. > The cpufreq is used as the cooling device to throttle

Re: [PATCH 0/3] Allow user to request memory to be locked on page fault

2015-05-11 Thread Andrew Morton
On Mon, 11 May 2015 10:36:18 -0400 Eric B Munson wrote: > On Fri, 08 May 2015, Andrew Morton wrote: > ... > > > > > Why can't the application mmap only those parts of the file which it > > wants and mlock those? > > There are a number of problems with this approach. The first is it > presumes

Re: [PATCH 0/3] Allow user to request memory to be locked on page fault

2015-05-11 Thread Eric B Munson
On Fri, 08 May 2015, Andrew Morton wrote: > On Fri, 8 May 2015 15:33:43 -0400 Eric B Munson wrote: > > > mlock() allows a user to control page out of program memory, but this > > comes at the cost of faulting in the entire mapping when it is > > allocated. For large mappings where the entire a

Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures

2015-05-11 Thread Daniel Lezcano
On 05/10/2015 01:15 AM, Rafael J. Wysocki wrote: On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: On Saturday, May 09, 2015 11:19:16 AM Preeti U Murthy wrote: Hi Rafael, On 05/08/2015 07:48 PM, Rafael J. Wysocki wrot

[PATCH kernel v10 30/34] powerpc/iommu/ioda2: Add get_table_size() to calculate the size of future table

2015-05-11 Thread Alexey Kardashevskiy
This adds a way for the IOMMU user to know how much a new table will use so it can be accounted in the locked_vm limit before allocation happens. This stores the allocated table size in pnv_pci_ioda2_get_table_size() so the locked_vm counter can be updated correctly when a table is being disposed.

[PATCH kernel v10 28/34] vfio: powerpc/spapr: powerpc/powernv/ioda: Define and implement DMA windows API

2015-05-11 Thread Alexey Kardashevskiy
This extends iommu_table_group_ops by a set of callbacks to support dynamic DMA windows management. create_table() creates a TCE table with specific parameters. it receives iommu_table_group to know nodeid in order to allocate TCE table memory closer to the PHB. The exact format of allocated multi

[PATCH kernel v10 23/34] powerpc/iommu/powernv: Release replaced TCE

2015-05-11 Thread Alexey Kardashevskiy
At the moment writing new TCE value to the IOMMU table fails with EBUSY if there is a valid entry already. However PAPR specification allows the guest to write new TCE value without clearing it first. Another problem this patch is addressing is the use of pool locks for external IOMMU users such a

[PATCH kernel v10 34/34] vfio: powerpc/spapr: Support Dynamic DMA windows

2015-05-11 Thread Alexey Kardashevskiy
This adds create/remove window ioctls to create and remove DMA windows. sPAPR defines a Dynamic DMA windows capability which allows para-virtualized guests to create additional DMA windows on a PCI bus. The existing linux kernels use this new window to map the entire guest memory and switch to the

[PATCH kernel v10 16/34] powerpc/spapr: vfio: Replace iommu_table with iommu_table_group

2015-05-11 Thread Alexey Kardashevskiy
Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table is supported. This defines iommu_table_group struct which stores pointers to iommu_group and iommu_table(s). This rep

[PATCH kernel v10 33/34] vfio: powerpc/spapr: Register memory and define IOMMU v2

2015-05-11 Thread Alexey Kardashevskiy
The existing implementation accounts the whole DMA window in the locked_vm counter. This is going to be worse with multiple containers and huge DMA windows. Also, real-time accounting would requite additional tracking of accounted pages due to the page size difference - IOMMU uses 4K pages and syst

[PATCH kernel v10 20/34] powerpc/powernv/ioda2: Move TCE kill register address to PE

2015-05-11 Thread Alexey Kardashevskiy
At the moment the DMA setup code looks for the "ibm,opal-tce-kill" property which contains the TCE kill register address. Writes to this register invalidates TCE cache on IODA/IODA2 hub. This moves the register address from iommu_table to pnv_ioda_pe as: 1) When we get 2 tables per PE, this regist

[PATCH kernel v10 27/34] powerpc/powernv: Implement multilevel TCE tables

2015-05-11 Thread Alexey Kardashevskiy
TCE tables might get too big in case of 4K IOMMU pages and DDW enabled on huge guests (hundreds of GB of RAM) so the kernel might be unable to allocate contiguous chunk of physical memory to store the TCE table. To address this, POWER8 CPU (actually, IODA2) supports multi-level TCE tables, up to 5

[PATCH kernel v10 24/34] powerpc/powernv/ioda2: Rework iommu_table creation

2015-05-11 Thread Alexey Kardashevskiy
This moves iommu_table creation to the beginning to make following changes easier to review. This starts using table parameters from the iommu_table struct. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: * updated commit l

[PATCH kernel v10 19/34] powerpc/iommu: Fix IOMMU ownership control functions

2015-05-11 Thread Alexey Kardashevskiy
This adds missing locks in iommu_take_ownership()/ iommu_release_ownership(). This marks all pages busy in iommu_table::it_map in order to catch errors if there is an attempt to use this table while ownership over it is taken. This only clears TCE content if there is no page marked busy in it_map

[PATCH kernel v10 14/34] powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table

2015-05-11 Thread Alexey Kardashevskiy
This adds a iommu_table_ops struct and puts pointer to it into the iommu_table struct. This moves tce_build/tce_free/tce_get/tce_flush callbacks from ppc_md to the new struct where they really belong to. This adds the requirement for @it_ops to be initialized before calling iommu_init_table() to m

[PATCH kernel v10 11/34] vfio: powerpc/spapr: Moving pinning/unpinning to helpers

2015-05-11 Thread Alexey Kardashevskiy
This is a pretty mechanical patch to make next patches simpler. New tce_iommu_unuse_page() helper does put_page() now but it might skip that after the memory registering patch applied. As we are here, this removes unnecessary checks for a value returned by pfn_to_page() as it cannot possibly retu

[PATCH kernel v10 32/34] powerpc/mmu: Add userspace-to-physical addresses translation cache

2015-05-11 Thread Alexey Kardashevskiy
We are adding support for DMA memory pre-registration to be used in conjunction with VFIO. The idea is that the userspace which is going to run a guest may want to pre-register a user space memory region so it all gets pinned once and never goes away. Having this done, a hypervisor will not have to

[PATCH kernel v10 09/34] vfio: powerpc/spapr: Move locked_vm accounting to helpers

2015-05-11 Thread Alexey Kardashevskiy
There moves locked pages accounting to helpers. Later they will be reused for Dynamic DMA windows (DDW). This reworks debug messages to show the current value and the limit. This stores the locked pages number in the container so when unlocking the iommu table pointer won't be needed. This does n

[PATCH kernel v10 10/34] vfio: powerpc/spapr: Disable DMA mappings on disabled container

2015-05-11 Thread Alexey Kardashevskiy
At the moment DMA map/unmap requests are handled irrespective to the container's state. This allows the user space to pin memory which it might not be allowed to pin. This adds checks to MAP/UNMAP that the container is enabled, otherwise -EPERM is returned. Signed-off-by: Alexey Kardashevskiy [a

[PATCH kernel v10 07/34] vfio: powerpc/spapr: Check that IOMMU page is fully contained by system page

2015-05-11 Thread Alexey Kardashevskiy
This checks that the TCE table page size is not bigger that the size of a page we just pinned and going to put its physical address to the table. Otherwise the hardware gets unwanted access to physical memory between the end of the actual page and the end of the aligned up TCE page. Since compoun

[PATCH kernel v10 29/34] powerpc/powernv/ioda2: Use new helpers to do proper cleanup on PE release

2015-05-11 Thread Alexey Kardashevskiy
The existing code programmed TVT#0 with some address and then immediately released that memory. This makes use of pnv_pci_ioda2_unset_window() and pnv_pci_ioda2_set_bypass() which do correct resource release and TVT update. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv/

[PATCH kernel v10 12/34] vfio: powerpc/spapr: Rework groups attaching

2015-05-11 Thread Alexey Kardashevskiy
This is to make extended ownership and multiple groups support patches simpler for review. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson Reviewed-by: David Gibson --- drivers/vfio/vfio_iommu_spapr_tce.

[PATCH kernel v10 08/34] vfio: powerpc/spapr: Use it_page_size

2015-05-11 Thread Alexey Kardashevskiy
This makes use of the it_page_size from the iommu_table struct as page size can differ. This replaces missing IOMMU_PAGE_SHIFT macro in commented debug code as recently introduced IOMMU_PAGE_XXX macros do not include IOMMU_PAGE_SHIFT. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson

[PATCH kernel v10 21/34] powerpc/powernv/ioda2: Add TCE invalidation for all attached groups

2015-05-11 Thread Alexey Kardashevskiy
The iommu_table struct keeps a list of IOMMU groups it is used for. At the moment there is just a single group attached but further patches will add TCE table sharing. When sharing is enabled, TCE cache in each PE needs to be invalidated so does the patch. This does not change pnv_pci_ioda1_tce_in

[PATCH kernel v10 13/34] powerpc/powernv: Do not set "read" flag if direction==DMA_NONE

2015-05-11 Thread Alexey Kardashevskiy
Normally a bitmap from the iommu_table is used to track what TCE entry is in use. Since we are going to use iommu_table without its locks and do xchg() instead, it becomes essential not to put bits which are not implied in the direction flag as the old TCE value (more precisely - the permission bit

[PATCH kernel v10 06/34] vfio: powerpc/spapr: Move page pinning from arch code to VFIO IOMMU driver

2015-05-11 Thread Alexey Kardashevskiy
This moves page pinning (get_user_pages_fast()/put_page()) code out of the platform IOMMU code and puts it to VFIO IOMMU driver where it belongs to as the platform code does not deal with page pinning. This makes iommu_take_ownership()/iommu_release_ownership() deal with the IOMMU table bitmap onl

[PATCH kernel v10 26/34] powerpc/powernv/ioda2: Introduce pnv_pci_ioda2_set_window

2015-05-11 Thread Alexey Kardashevskiy
This is a part of moving DMA window programming to an iommu_ops callback. pnv_pci_ioda2_set_window() takes an iommu_table_group as a first parameter (not pnv_ioda_pe) as it is going to be used as a callback for VFIO DDW code. This adds pnv_pci_ioda2_tvt_invalidate() to invalidate TVT as it is a go

[PATCH kernel v10 31/34] vfio: powerpc/spapr: powerpc/powernv/ioda2: Use DMA windows API in ownership control

2015-05-11 Thread Alexey Kardashevskiy
Before the IOMMU user (VFIO) would take control over the IOMMU table belonging to a specific IOMMU group. This approach did not allow sharing tables between IOMMU groups attached to the same container. This introduces a new IOMMU ownership flavour when the user can not just control the existing IO

[PATCH kernel v10 22/34] powerpc/powernv: Implement accessor to TCE entry

2015-05-11 Thread Alexey Kardashevskiy
This replaces direct accesses to TCE table with a helper which returns an TCE entry address. This does not make difference now but will when multi-level TCE tables get introduces. No change in behavior is expected. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: *

[PATCH kernel v10 17/34] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-05-11 Thread Alexey Kardashevskiy
Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table is supported. For IODA, instead of embedding iommu_table, the new iommu_table_group keeps pointers to those. The iomm

[PATCH kernel v10 18/34] vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control

2015-05-11 Thread Alexey Kardashevskiy
This adds tce_iommu_take_ownership() and tce_iommu_release_ownership which call in a loop iommu_take_ownership()/iommu_release_ownership() for every table on the group. As there is just one now, no change in behaviour is expected. At the moment the iommu_table struct has a set_bypass() which enabl

[PATCH kernel v10 25/34] powerpc/powernv/ioda2: Introduce helpers to allocate TCE pages

2015-05-11 Thread Alexey Kardashevskiy
This is a part of moving TCE table allocation into an iommu_ops callback to support multiple IOMMU groups per one VFIO container. This moves the code which allocates the actual TCE tables to helpers: pnv_pci_ioda2_table_alloc_pages() and pnv_pci_ioda2_table_free_pages(). These do not allocate/free

[PATCH kernel v10 05/34] powerpc/iommu: Always release iommu_table in iommu_free_table()

2015-05-11 Thread Alexey Kardashevskiy
At the moment iommu_free_table() only releases memory if the table was initialized for the platform code use, i.e. it had it_map initialized (which purpose is to track DMA memory space use). With dynamic DMA windows, we will need to be able to release iommu_table even if it was used for VFIO in wh

[PATCH kernel v10 15/34] powerpc/powernv/ioda/ioda2: Rework TCE invalidation in tce_build()/tce_free()

2015-05-11 Thread Alexey Kardashevskiy
The pnv_pci_ioda_tce_invalidate() helper invalidates TCE cache. It is supposed to be called on IODA1/2 and not called on p5ioc2. It receives start and end host addresses of TCE table. IODA2 actually needs PCI addresses to invalidate the cache. Those can be calculated from host addresses but since

[PATCH kernel v10 02/34] powerpc/iommu/powernv: Get rid of set_iommu_table_base_and_group

2015-05-11 Thread Alexey Kardashevskiy
The set_iommu_table_base_and_group() name suggests that the function sets table base and add a device to an IOMMU group. However actual table base setting happens in pnv_pci_ioda_dma_dev_setup(). The actual purpose for table base setting is to put some reference into a device so later iommu_add_de

[PATCH kernel v10 03/34] powerpc/powernv/ioda: Clean up IOMMU group registration

2015-05-11 Thread Alexey Kardashevskiy
The existing code has 3 calls to iommu_register_group() and all 3 branches actually cover all possible cases. This replaces 3 calls with one and moves the registration earlier; the latter will make more sense when we add TCE table sharing. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/pl

[PATCH kernel v10 01/34] powerpc/eeh/ioda2: Use device::iommu_group to check IOMMU group

2015-05-11 Thread Alexey Kardashevskiy
This relies on the fact that a PCI device always has an IOMMU table which may not be the case when we get dynamic DMA windows so let's use more reliable check for IOMMU group here. As we do not rely on the table presence here, remove the workaround from pnv_pci_ioda2_set_bypass(); also remove the

[PATCH kernel v10 04/34] powerpc/iommu: Put IOMMU group explicitly

2015-05-11 Thread Alexey Kardashevskiy
So far an iommu_table lifetime was the same as PE. Dynamic DMA windows will change this and iommu_free_table() will not always require the group to be released. This moves iommu_group_put() out of iommu_free_table(). This adds a iommu_pseries_free_table() helper which does iommu_group_put() and i

[PATCH kernel v10 00/34] powerpc/iommu/vfio: Enable Dynamic DMA windows

2015-05-11 Thread Alexey Kardashevskiy
This enables sPAPR defined feature called Dynamic DMA windows (DDW). Each Partitionable Endpoint (IOMMU group) has an address range on a PCI bus where devices are allowed to do DMA. These ranges are called DMA windows. By default, there is a single DMA window, 1 or 2GB big, mapped at zero on a PC

Re: [PATCH 0/3] cpuidle: updates related to tick_broadcast_enter() failures

2015-05-11 Thread Sudeep Holla
On 10/05/15 00:15, Rafael J. Wysocki wrote: On Saturday, May 09, 2015 10:33:05 PM Rafael J. Wysocki wrote: On Saturday, May 09, 2015 10:11:41 PM Rafael J. Wysocki wrote: On Saturday, May 09, 2015 11:19:16 AM Preeti U Murthy wrote: Hi Rafael, On 05/08/2015 07:48 PM, Rafael J. Wysocki wrote:

Re: [PATCH 0/3] Allow user to request memory to be locked on page fault

2015-05-11 Thread Eric B Munson
On Fri, 08 May 2015, Andrew Morton wrote: > On Fri, 8 May 2015 16:06:10 -0400 Eric B Munson wrote: > > > On Fri, 08 May 2015, Andrew Morton wrote: > > > > > On Fri, 8 May 2015 15:33:43 -0400 Eric B Munson > > > wrote: > > > > > > > mlock() allows a user to control page out of program memory

[PATCH 1/3] ASoC: fsl_sai: add sai master mode support

2015-05-11 Thread Zidan Wang
When sai works on master mode, set its bit clock and frame clock. SAI has 4 MCLK source, bus clock, MCLK1, MCLK2 and MCLK3. fsl_sai_set_bclk will select proper MCLK source, then calculate and set the bit clock divider. After fsl_sai_set_bclk, enable the selected mclk in hw_params(), and add hw_fr

Re: powerpc: Enabling sys_kcmp for CRIU

2015-05-11 Thread Laurent Dufour
On 11/05/2015 12:31, Michael Ellerman wrote: > On Tue, 2015-05-05 at 15:30:21 UTC, Laurent Dufour wrote: >> The commit 8170a83f15ee ("powerpc: Wireup the kcmp syscall to sys_ni") has >> disabled the kcmp syscall for powerpc. This has been done due to the use >> of unsigned long parameters which ma

[PATCH v3 20/22] cputime:Introduce the cputime_to_timespec64/timespec64_to_cputime function

2015-05-11 Thread Baolin Wang
This patch introduces some functions for converting cputime to timespec64 and back, that repalce the timespec type with timespec64 type, as well as for arch/s390 and arch/powerpc architecture. And these new methods will replace the old cputime_to_timespec/timespec_to_cputime function to ready f

[PATCH v3 00/22] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-05-11 Thread Baolin Wang
This patch series changes the 32-bit time type (timespec/itimerspec) to the 64-bit one (timespec64/itimerspec64), since 32-bit time types will break in the year 2038. This patch series introduces new methods with timespec64/itimerspec64 type, and removes the old ones with timespec/itimerspec type

[PATCH v3 00/22] Convert the posix_clock_operations and k_clock structure to ready for 2038

2015-05-11 Thread Baolin Wang
This patch series changes the 32-bit time type (timespec/itimerspec) to the 64-bit one (timespec64/itimerspec64), since 32-bit time types will break in the year 2038. This patch series introduces new methods with timespec64/itimerspec64 type, and removes the old ones with timespec/itimerspec type

[PATCH 0/3] Add sai master mode, tdm slot operation and add some sample rate support

2015-05-11 Thread Zidan Wang
Add SAI master mode support. Add tdm slots operation for SAI master mode. Add 12kHz, 24kHz, 176.4kHz and 192kHz sample rate support. Zidan Wang (3): SoC: fsl_sai: add sai master mode support ASoC: fsl_sai: Add tdm slots operation for SAI master mode ASoC: fsl_sai: add 12kHz, 24kHz, 176.4kHz

[PATCH 2/3] ASoC: fsl_sai: Add tdm slots operation for SAI master mode

2015-05-11 Thread Zidan Wang
Add tdm slot operation for SAI master mode. When using SAI as master mode, we should use set_tdm_slot() helper function to set tdm slots in machine driver, or it will using default value of slots and slot width. SAI will generate BCLK depends on sample rate, slots and slot width. And there may be

Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-05-11 Thread Vipin K Parashar
On 05/11/2015 02:31 PM, Vipin K Parashar wrote: On 05/11/2015 12:19 PM, Michael Ellerman wrote: On Thu, 2015-05-07 at 15:00 +0530, Vipin K Parashar wrote: This patch adds support for FSP EPOW (Early Power Off Warning) and DPO (Delayed Power Off) events support for PowerNV platform. EPOW even

[PATCH 3/3] ASoC: fsl_sai: add 12kHz, 24kHz, 176.4kHz and 192kHz sample rate support

2015-05-11 Thread Zidan Wang
Normally we don't support 12kHz, 24kHz in audio driver, alsa didn't have formal definition of 12kHz, 24kHz, but alsa supply a way to support these sample rates. And add 176.4kHz and 192kHz support. Signed-off-by: Zidan Wang --- sound/soc/fsl/fsl_sai.c | 24 +--- 1 file change

Re: powerpc: Enabling sys_kcmp for CRIU

2015-05-11 Thread Michael Ellerman
On Tue, 2015-05-05 at 15:30:21 UTC, Laurent Dufour wrote: > The commit 8170a83f15ee ("powerpc: Wireup the kcmp syscall to sys_ni") has > disabled the kcmp syscall for powerpc. This has been done due to the use > of unsigned long parameters which may require a dedicated wrapper to handle > 32bit pr

Re: [1/1] powerpc/hv-24x7: Check support before registering PMU

2015-05-11 Thread Michael Ellerman
On Thu, 2015-30-04 at 03:04:51 UTC, Sukadev Bhattiprolu wrote: > We currently try to register the 24x7 PMU unconditionally. Not all > Power systems support 24x7 counters (eg: Power7). On these systems > we get a backtrace during boot when trying to register the 24x7 PMU. > > Check if the hyperviso

Re: powerpc/mce: fix off by one errors in mce event handling

2015-05-11 Thread Michael Ellerman
Stable folks please ignore this patch. Comments below. On Mon, 2015-11-05 at 00:48:32 UTC, Daniel Axtens wrote: > Before 69111bac42f5 ("powerpc: Replace __get_cpu_var uses"), in > save_mce_event, index got the value of mce_nest_count, and > mce_nest_count was incremented *after* index was set. >

Re: [v3, 5/8] powernv/opal: Convert opal message events to opal irq domain

2015-05-11 Thread Michael Ellerman
On Thu, 2015-07-05 at 03:16:15 UTC, Alistair Popple wrote: > diff --git a/arch/powerpc/platforms/powernv/opal.c > b/arch/powerpc/platforms/powernv/opal.c > index 4399ff2..0196220 100644 > --- a/arch/powerpc/platforms/powernv/opal.c > +++ b/arch/powerpc/platforms/powernv/opal.c > @@ -362,33 +362,34

Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-05-11 Thread Vipin K Parashar
On 05/11/2015 12:19 PM, Michael Ellerman wrote: On Thu, 2015-05-07 at 15:00 +0530, Vipin K Parashar wrote: This patch adds support for FSP EPOW (Early Power Off Warning) and DPO (Delayed Power Off) events support for PowerNV platform. EPOW events are generated by SPCN/FSP due to various critic

Re: [PATCH V3] mm/thp: Split out pmd collpase flush into a separate functions

2015-05-11 Thread Aneesh Kumar K.V
"Kirill A. Shutemov" writes: > On Mon, May 11, 2015 at 12:09:30PM +0530, Aneesh Kumar K.V wrote: >> Architectures like ppc64 [1] need to do special things while clearing >> pmd before a collapse. For them this operation is largely different >> from a normal hugepage pte clear. Hence add a separat

Re: [PATCH V3] powerpc/thp: Serialize pmd clear against a linux page table walk.

2015-05-11 Thread Aneesh Kumar K.V
"Kirill A. Shutemov" writes: > On Mon, May 11, 2015 at 11:56:01AM +0530, Aneesh Kumar K.V wrote: >> Serialize against find_linux_pte_or_hugepte which does lock-less >> lookup in page tables with local interrupts disabled. For huge pages >> it casts pmd_t to pte_t. Since format of pte_t is differe

[PATCH RESEND v6 2/2] mmc: sdhci: Add support to disable SDR104/SDR50/DDR50 based on capability register 0.

2015-05-11 Thread Suman Tripathi
The sdhci framework disables SDR104/SDR50/DDR50 based on only quirk. This patch adds the support to disable SDR104/SDR50/DDR50 based on reading the capability register 0. Signed-off-by: Suman Tripathi --- drivers/mmc/host/sdhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --gi

[PATCH RESEND v6 1/2] arm64: dts: Add the arasan sdhci nodes in apm-storm.dtsi

2015-05-11 Thread Suman Tripathi
This patch adds the arasan sdhci nodes to reuse the of-arasan driver for APM X-Gene SoC. Signed-off-by: Suman Tripathi --- arch/arm64/boot/dts/apm/apm-mustang.dts | 4 +++ arch/arm64/boot/dts/apm/apm-storm.dtsi | 43 + 2 files changed, 47 insertions(+) diff --g

[PATCH RESEND v6 0/2] Add SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller.

2015-05-11 Thread Suman Tripathi
This patch adds the SDHCI support for APM X-Gene SoC using ARASAN SDHCI controller. v1 change: * Use the CONFIG_ARM64_DMA_HAS_IOMMU for dma-mapping. v2 change: * Drop the IOMMU support and switching to PIO mode for arasan. controller integrated inside APM X-Gene SoC. v3 change: * Change t

[PATCH] nvram: print no error message when nvram is not set as pstore backend

2015-05-11 Thread Hari Bathini
Pstore only supports one backend at a time. The preferred pstore backend is set by passing the pstore.backend= argument to the kernel at boot time. Currently, while trying to register with pstore, nvram throws an error message even when "pstore.backend != nvram", which is unnecessary. This patch re

Re: [PATCH V3] powerpc/thp: Serialize pmd clear against a linux page table walk.

2015-05-11 Thread Kirill A. Shutemov
On Mon, May 11, 2015 at 11:56:01AM +0530, Aneesh Kumar K.V wrote: > Serialize against find_linux_pte_or_hugepte which does lock-less > lookup in page tables with local interrupts disabled. For huge pages > it casts pmd_t to pte_t. Since format of pte_t is different from > pmd_t we want to prevent t

Re: [PATCH v4 00/21] PowerPC/PowerNV: PCI Slot Management

2015-05-11 Thread Gavin Shan
On Sat, May 09, 2015 at 09:59:25AM +1000, Alexey Kardashevskiy wrote: >On 05/01/2015 04:02 PM, Gavin Shan wrote: >>The series of patches intend to support PCI slot for PowerPC PowerNV platform, >>which is running on top of skiboot firmware. The patchset requires >>corresponding >>changes from skib

Re: [PATCH v4 21/21] pci/hotplug: PowerPC PowerNV PCI hotplug driver

2015-05-11 Thread Gavin Shan
On Sun, May 10, 2015 at 01:54:31AM +1000, Alexey Kardashevskiy wrote: >On 05/01/2015 04:03 PM, Gavin Shan wrote: >>The patch intends to add standalone driver to support PCI hotplug >>for PowerPC PowerNV platform, which runs on top of skiboot firmware. >>The firmware identified hotpluggable slots an

Re: [PATCH] i2c: powermac: don't workaround for keywest

2015-05-11 Thread wsa
On Mon, May 11, 2015 at 08:14:47AM +1000, Benjamin Herrenschmidt wrote: > On Sun, 2015-05-10 at 20:34 +0200, Wolfram Sang wrote: > > Okay, so this patch is bogus. I understand now that onyx uses another > > codec than TAS, so this change will regress on other machines. > > However, > > it shows tha

Re: [PATCH v4 16/21] powerpc/pci: Create eeh_dev while creating pci_dn

2015-05-11 Thread Gavin Shan
On Sun, May 10, 2015 at 01:08:28AM +1000, Alexey Kardashevskiy wrote: >On 05/01/2015 04:03 PM, Gavin Shan wrote: >>The eeh_dev is always created based on pci_dn, but with initcall >>supported by core_initcall_sync(). The patch creates eeh_dev >>when pci_dn is created, indicating they have same life

Re: [PATCH v4 15/21] powerpc/pci: Delay creating pci_dn

2015-05-11 Thread Gavin Shan
On Sun, May 10, 2015 at 12:55:51AM +1000, Alexey Kardashevskiy wrote: >On 05/01/2015 04:03 PM, Gavin Shan wrote: >>The pci_dn instances are allocated from memblock or bootmem when >>creating PCI controller (hoses) in setup_arch(). The PCI hotplug, >>which will be supported by proceeding patches, wi

Re: [PATCHv3 00/10] add 842 hw compression for PowerNV platform

2015-05-11 Thread Herbert Xu
On Thu, May 07, 2015 at 01:49:11PM -0400, Dan Streetman wrote: > > v3 changes the sw and hw crypto drivers to use the same alg name "842", > and different driver names, "842-generic" and "842-nx" All applied. Thanks a lot! -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP

Re: [PATCH v4 13/21] powerpc/powernv: Introduce pnv_pci_poll()

2015-05-11 Thread Gavin Shan
On Sun, May 10, 2015 at 12:30:07AM +1000, Alexey Kardashevskiy wrote: >On 05/01/2015 04:03 PM, Gavin Shan wrote: >>We might not get some PCI slot information (e.g. power status) >>immediately by OPAL API. Instead, opal_pci_poll() need to be called >>for the required information. >> >>The patch intr

Re: [PATCH v4 10/21] powerpc/powernv: Fundamental reset for PCI bus reset

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:47 PM, Gavin Shan wrote: On Sun, May 10, 2015 at 12:12:18AM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: Function pnv_pci_reset_secondary_bus() is used to reset specified PCI bus, which is leaded by root complex or PCI bridge. That means the func

Re: [PATCH v4 09/21] powerpc/powernv: Use PCI slot reset infrastructure

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:45 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 11:41:05PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: For PowerNV platform, running on top of skiboot, all PE level reset should be routed to firmware if the bridge of the PE primary bus has devi

Re: [PATCH] powerpc/mce: fix off by one errors in mce event handling

2015-05-11 Thread Mahesh J Salgaonkar
On 2015-05-11 10:48:32 Mon, Daniel Axtens wrote: > Before 69111bac42f5 ("powerpc: Replace __get_cpu_var uses"), in > save_mce_event, index got the value of mce_nest_count, and > mce_nest_count was incremented *after* index was set. > > However, that patch changed the behaviour so that mce_nest cou

Re: [PATCH v2 1/2] powerpc/powernv: Add poweroff (EPOW, DPO) events support for PowerNV platform

2015-05-11 Thread Vipin K Parashar
Hi Joel, Thanks for review. My comments below. On 05/08/2015 06:56 AM, Joel Stanley wrote: Hello Vipin, On Thu, May 7, 2015 at 7:00 PM, Vipin K Parashar wrote: This patch adds support for FSP EPOW (Early Power Off Warning) and DPO (Delayed Power Off) events support for PowerNV plat

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:25 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 10:43:23PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: The original code doesn't support releasing PEs dynamically, meaning that PE and the associated resources (IO, M32, M64 and DMA) can't be rel

  1   2   >