Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Nicholas Piggin
On Tue, 14 Mar 2017 15:50:01 +1100 Benjamin Herrenschmidt wrote: > On Tue, 2017-03-14 at 14:35 +1000, Nicholas Piggin wrote: > > > We might need a sync still between clearing the byte and calling the > > > handler no ? Or at least a smp_wmb() to ensure that the clear is > > > visible before any a

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 7:07 PM, Till Smejkal wrote: > On Mon, 13 Mar 2017, Andy Lutomirski wrote: >> This sounds rather complicated. Getting TLB flushing right seems >> tricky. Why not just map the same thing into multiple mms? > > This is exactly what happens at the end. The memory region that

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Benjamin Herrenschmidt
On Tue, 2017-03-14 at 14:35 +1000, Nicholas Piggin wrote: > > We might need a sync still between clearing the byte and calling the > > handler no ? Or at least a smp_wmb() to ensure that the clear is > > visible before any action of the handler. > > Yes I have exactly that (smp_wmb). > > At first

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Nicholas Piggin
On Tue, 14 Mar 2017 14:57:20 +1100 Benjamin Herrenschmidt wrote: > On Tue, 2017-03-14 at 12:53 +1000, Nicholas Piggin wrote: > > >   - Load all > > >   - For each byte if set > > > - clear byte > > > - then call handler > > > > Yes. I think that will be okay because we shouldn't get

[PATCH 3/3] cxl: Provide user-space access to afu descriptor on bare metal

2017-03-13 Thread Vaibhav Jain
This patch implements cxl backend to provide user-space access to binary afu descriptor contents via sysfs. We add a new member to struct cxl_afu_native named phy_desc that caches the physical base address of afu descriptor, which is then used in implementation of new native cxl backend ops namel:

[PATCH 2/3] cxl: Introduce afu_desc sysfs attribute

2017-03-13 Thread Vaibhav Jain
This patch introduces a new afu sysfs attribute named afu_desc. This binary attribute provides access to raw contents of the afu descriptor to user-space. Direct access to afu descriptor is useful for libcxl that can use it to determine if the CXL card has been fenced or provide application access

[PATCH 1/3] cxl: Re-factor cxl_pci_afu_read_err_buffer()

2017-03-13 Thread Vaibhav Jain
This patch moves,renames and re-factors the function afu_pci_afu_err_buffer(). The function is now moved to native.c from pci.c and renamed as native_afu_read_err_buffer(). Also the ability of copying data from h/w enforcing 4/8 byte aligned access is useful and better shared across other function

[PATCH 0/3] cxl: Provide user-space r/o access to the AFU descriptor

2017-03-13 Thread Vaibhav Jain
Hi, This patch-set provides a fix for libcxl github issue#20 "libcxl doesn't handle a mmio read of 0xfff... (all 1's) correctly" at https://github.com/ibm-capi/libcxl/issues/20. The issue arises as libcxl uses mmio read values from problem-state-area(PSA) to determine if the card had fenced

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Benjamin Herrenschmidt
On Tue, 2017-03-14 at 12:53 +1000, Nicholas Piggin wrote: > >   - Load all > >   - For each byte if set > > - clear byte > > - then call handler > > Yes. I think that will be okay because we shouldn't get any load-hit- > store > issues. I'll do some benchmarking anyway. We might need a

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
On Mon, 13 Mar 2017, Andy Lutomirski wrote: > On Mon, Mar 13, 2017 at 3:14 PM, Till Smejkal > wrote: > > This patchset extends the kernel memory management subsystem with a new > > type of address spaces (called VAS) which can be created and destroyed > > independently of processes by a user in th

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
On Tue, 14 Mar 2017, Richard Henderson wrote: > On 03/14/2017 10:39 AM, Till Smejkal wrote: > > > Is this an indication that full virtual address spaces are useless? It > > > would seem like if you only use virtual address segments then you avoid > > > all > > > of the problems with executing cod

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Richard Henderson
On 03/14/2017 10:39 AM, Till Smejkal wrote: Is this an indication that full virtual address spaces are useless? It would seem like if you only use virtual address segments then you avoid all of the problems with executing code, active stacks, and brk. What do you mean with *virtual address seg

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Andy Lutomirski
On Mon, Mar 13, 2017 at 3:14 PM, Till Smejkal wrote: > This patchset extends the kernel memory management subsystem with a new > type of address spaces (called VAS) which can be created and destroyed > independently of processes by a user in the system. During its lifetime > such a VAS can be atta

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
On Tue, 14 Mar 2017, Richard Henderson wrote: > On 03/14/2017 08:14 AM, Till Smejkal wrote: > > At the current state of the development, first class virtual address spaces > > have one limitation, that we haven't been able to solve so far. The feature > > allows, that different threads of the same

Re: [RFC PATCH 10/13] mm: Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
Hi Greg, First of all thanks for your reply. On Tue, 14 Mar 2017, Greg Kroah-Hartman wrote: > On Mon, Mar 13, 2017 at 03:14:12PM -0700, Till Smejkal wrote: > > There's no way with that many cc: lists and people that this is really > making it through very many people's filters and actually on a

Re: [RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Richard Henderson
On 03/14/2017 08:14 AM, Till Smejkal wrote: At the current state of the development, first class virtual address spaces have one limitation, that we haven't been able to solve so far. The feature allows, that different threads of the same process can execute in different AS at the same time. This

Re: [PATCH] kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()

2017-03-13 Thread Greg Kroah-Hartman
On Tue, Mar 14, 2017 at 08:17:00AM +0530, Vaibhav Jain wrote: > Recently started seeing a kernel oops when a module tries removing a > memory mapped sysfs bin_attribute. On closer investigation the root > cause seems to be kernfs_release_file() trying to call > kernfs_op.release() callback that's N

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Nicholas Piggin
On Tue, 14 Mar 2017 13:34:38 +1100 Benjamin Herrenschmidt wrote: > On Tue, 2017-03-14 at 11:49 +1000, Nicholas Piggin wrote: > > On Tue, 14 Mar 2017 10:31:08 +1100 > > > Benjamin Herrenschmidt wrote: > > > > > On Mon, 2017-03-13 at 03:13 +1000, Nicholas Piggin wrote: > > > > Hi, > > > >

[PATCH] kernfs: Check KERNFS_HAS_RELEASE before calling kernfs_release_file()

2017-03-13 Thread Vaibhav Jain
Recently started seeing a kernel oops when a module tries removing a memory mapped sysfs bin_attribute. On closer investigation the root cause seems to be kernfs_release_file() trying to call kernfs_op.release() callback that's NULL for such sysfs bin_attributes. The oops occurs when kernfs_release

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Benjamin Herrenschmidt
On Tue, 2017-03-14 at 11:49 +1000, Nicholas Piggin wrote: > On Tue, 14 Mar 2017 10:31:08 +1100 > > Benjamin Herrenschmidt wrote: > > > On Mon, 2017-03-13 at 03:13 +1000, Nicholas Piggin wrote: > > > Hi, > > > > > > Just after the previous two fixes, I would like to propose changing > > > the way

Re: [RFC PATCH 10/13] mm: Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
Hi Vineet, On Mon, 13 Mar 2017, Vineet Gupta wrote: > I've not looked at the patches closely (or read the references paper fully > yet), > but at first glance it seems on ARC architecture, we can can potentially > use/leverage this mechanism to implement the shared TLB entries. Before anyone > sh

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Nicholas Piggin
On Tue, 14 Mar 2017 10:31:08 +1100 Benjamin Herrenschmidt wrote: > On Mon, 2017-03-13 at 03:13 +1000, Nicholas Piggin wrote: > > Hi, > > > > Just after the previous two fixes, I would like to propose changing > > the way we do doorbell vs interrupt controller IPIs, and add support > > for global

Re: [RFC PATCH 10/13] mm: Introduce first class virtual address spaces

2017-03-13 Thread Vineet Gupta
+CC Ingo, tglx Hi Till, On 03/13/2017 03:14 PM, Till Smejkal wrote: > Introduce a different type of address spaces which are first class citizens > in the OS. That means that the kernel now handles two types of AS, those > which are closely coupled with a process and those which aren't. While the

[GIT PULL] Please pull powerpc/linux.git powerpc-4.11-4 tag

2017-03-13 Thread Michael Ellerman
Hi Linus, Please pull some more powerpc fixes for 4.11. The bulk of the diffstat is the Power9 Machine Check handler. It's bigger than I'd usually send after rc2, but apparently folks are hitting them in the field, and it's from Nick. This also includes the fix for macio devices that was sent di

Re: [PATCH kernel v8 00/10] powerpc/kvm/vfio: Enable in-kernel acceleration

2017-03-13 Thread David Gibson
On Tue, Mar 14, 2017 at 11:54:03AM +1100, Alexey Kardashevskiy wrote: > On 10/03/17 15:48, David Gibson wrote: > > On Fri, Mar 10, 2017 at 02:53:27PM +1100, Alexey Kardashevskiy wrote: > >> This is my current queue of patches to add acceleration of TCE > >> updates in KVM. > >> > >> This is based o

Re: [PATCH kernel v8 00/10] powerpc/kvm/vfio: Enable in-kernel acceleration

2017-03-13 Thread Alexey Kardashevskiy
On 10/03/17 15:48, David Gibson wrote: > On Fri, Mar 10, 2017 at 02:53:27PM +1100, Alexey Kardashevskiy wrote: >> This is my current queue of patches to add acceleration of TCE >> updates in KVM. >> >> This is based on Linus'es tree sha1 c1aa905a304e. > > I think we're finally there - I've now sen

Re: [RFC][PATCH 0/2] reworking cause_ipi and adding global doorbell support

2017-03-13 Thread Benjamin Herrenschmidt
On Mon, 2017-03-13 at 03:13 +1000, Nicholas Piggin wrote: > Hi, > > Just after the previous two fixes, I would like to propose changing > the way we do doorbell vs interrupt controller IPIs, and add support > for global doorbells supported by POWER9 in HV mode. > > After this, the platform code k

Re: [RFC PATCH 11/13] mm/vas: Introduce VAS segments - shareable address space regions

2017-03-13 Thread Till Smejkal
Hi Matthew, On Mon, 13 Mar 2017, Matthew Wilcox wrote: > On Mon, Mar 13, 2017 at 03:14:13PM -0700, Till Smejkal wrote: > > +/** > > + * Create a new VAS segment. > > + * > > + * @param[in] name:The name of the new VAS segment. > > + * @param[in] start: The address whe

Re: [RFC PATCH 11/13] mm/vas: Introduce VAS segments - shareable address space regions

2017-03-13 Thread Matthew Wilcox
On Mon, Mar 13, 2017 at 03:14:13PM -0700, Till Smejkal wrote: > +/** > + * Create a new VAS segment. > + * > + * @param[in] name: The name of the new VAS segment. > + * @param[in] start: The address where the VAS segment begins. > + * @param[in] end: The address where the

[RFC PATCH 13/13] fs/proc: Add procfs support for first class virtual address spaces

2017-03-13 Thread Till Smejkal
Add new files and directories to the procfs file system that contain various information about the first class virtual address spaces attach to the processes in the system. To the procfs directories of each process in the system (/proc/$PID) an additional directory with the name 'vas' is added tha

[RFC PATCH 12/13] mm/vas: Add lazy-attach support for first class virtual address spaces

2017-03-13 Thread Till Smejkal
Until now, whenever a task attaches a first class virtual address space, all the memory regions currently present in the task are replicated into the first class virtual address space so that the task can continue executing as if nothing has changed. However, this technique causes the attach and de

[RFC PATCH 11/13] mm/vas: Introduce VAS segments - shareable address space regions

2017-03-13 Thread Till Smejkal
VAS segments are an extension to first class virtual address spaces that can be used to share specific memory regions between multiple first class virtual address spaces. VAS segments have a specific size and position in a virtual address space and can thereby be used to share in-memory pointer bas

[RFC PATCH 10/13] mm: Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
Introduce a different type of address spaces which are first class citizens in the OS. That means that the kernel now handles two types of AS, those which are closely coupled with a process and those which aren't. While the former ones are created and destroyed together with the process by the kern

[RFC PATCH 09/13] mm/memory: Add function to one-to-one duplicate page ranges

2017-03-13 Thread Till Smejkal
Add new function to one-to-one duplicate a page table range of one memory map to another memory map. The new function 'dup_page_range' copies the page table entries for the specified region from the page table of the source memory map to the page table of the destination memory map and thereby allo

[RFC PATCH 08/13] kernel/fork: Define explicitly which mm_struct to duplicate during fork

2017-03-13 Thread Till Smejkal
The dup_mm-function used during 'do_fork' to duplicate the current task's mm_struct for the newly forked task always implicitly uses current->mm for this purpose. However, during copy_mm it was already decided which mm_struct to copy/duplicate. So pass this mm_struct to dup_mm instead of again deci

[RFC PATCH 07/13] kernel/fork: Split and export 'mm_alloc' and 'mm_init'

2017-03-13 Thread Till Smejkal
The only way until now to create a new memory map was via the exported function 'mm_alloc'. Unfortunately, this function not only allocates a new memory map, but also completely initializes it. However, with the introduction of first class virtual address spaces, some initialization steps done in '

[RFC PATCH 06/13] mm/mmap: Export 'vma_link' and 'find_vma_links' to mm subsystem

2017-03-13 Thread Till Smejkal
Make the functions 'vma_link' and 'find_vma_links' accessible to other source files in the mm/ source directory of the kernel so that other files in that directory can also perform low level changes to mm_struct data structures. Signed-off-by: Till Smejkal --- mm/internal.h | 11 +++ mm/

[RFC PATCH 05/13] mm: Add mm_struct argument to 'mm_populate' and '__mm_populate'

2017-03-13 Thread Till Smejkal
Add to the 'mm_populate' and '__mm_populate' functions as additional argument which mm_struct they should use during their execution. Before, these functions simply used the memory map of the current task. However, with the introduction of first class virtual address spaces, both functions also nee

[RFC PATCH 04/13] mm: Add mm_struct argument to 'get_unmapped_area' and 'vm_unmapped_area'

2017-03-13 Thread Till Smejkal
Add the mm_struct that for which an unmapped area should be found as explicit argument to the 'get_unmapped_area' function. Previously, the function simply search for an unmapped area in the memory map of the current task. However, with the introduction of first class virtual address spaces, it is

[RFC PATCH 03/13] mm: Rename 'unmap_region' and add mm_struct argument

2017-03-13 Thread Till Smejkal
Rename the 'unmap_region' function to 'munmap_region' so that it uses the same naming pattern as the do_mmap <-> mmap_region couple. In addition also make the new 'munmap_region' function publicly available to all other kernel sources. In addition, also add to the function the mm_struct it should

[RFC PATCH 02/13] mm: Add mm_struct argument to 'do_mmap' and 'do_mmap_pgoff'

2017-03-13 Thread Till Smejkal
Add to the 'do_mmap' and 'do_mmap_pgoff' functions the mm_struct they should operate on as additional argument. Before, both functions simply used the memory map of the current task. However, with the introduction of first class virtual address spaces, these functions also need to be usable for oth

[RFC PATCH 01/13] mm: Add mm_struct argument to 'mmap_region'

2017-03-13 Thread Till Smejkal
Add to the 'mmap_region' function the mm_struct that it should operate on as additional argument. Before, the function simply used the memory map of the current task. However, with the introduction of first class virtual address spaces, mmap_region needs also be able to operate on other memory maps

[RFC PATCH 00/13] Introduce first class virtual address spaces

2017-03-13 Thread Till Smejkal
First class virtual address spaces (also called VAS) are a new functionality of the Linux kernel allowing address spaces to exist independently of processes. The general idea behind this feature is described in a paper at ASPLOS16 with the title 'SpaceJMP: Programming with Multiple Virtual Address

Re: [RFC PATCH 10/13] mm: Introduce first class virtual address spaces

2017-03-13 Thread Greg Kroah-Hartman
On Mon, Mar 13, 2017 at 03:14:12PM -0700, Till Smejkal wrote: There's no way with that many cc: lists and people that this is really making it through very many people's filters and actually on a mailing list. Please trim them down. Minor sysfs questions/issues: > +struct vas { > + struct k

Re: [RFC] powerpc: handle simultanneous interrupts at once

2017-03-13 Thread Benjamin Herrenschmidt
On Fri, 2017-03-10 at 12:11 +0100, Christophe Leroy wrote: > It often happens to have simultanneous interrupts, for instance > when having double Ethernet attachment. With the current > implementation, we suffer the cost of kernel entry/exit for each > interrupt. > > This patch introduces a loop i

Re: 5-level pagetable patches break ppc64le

2017-03-13 Thread Anton Blanchard
Hi Kirill, > > My ppc64le boot tests stopped working as of commit c2febafc6773 > > ("mm: convert generic code to 5-level paging") > > > > We hang part way during boot, just before bringing up the network. I > > haven't had a chance to narrow it down yet. > > Please check if patch by this link

Re: syscall statx not implemented on powerpc

2017-03-13 Thread Chris Packham
On 13/03/17 21:52, Chandan Rajendra wrote: > On Monday, March 13, 2017 03:33:07 AM Chris Packham wrote: >> Hi, >> >> I've just attempted to build a powerpc kernel from 4.11-rc2 using a >> custom defconfig (available on request) and I'm hitting the following >> error in the early stages of compilati

Re: [PATCH v2 2/6] powerpc/perf: Export memory hierarchy info to user space

2017-03-13 Thread Sukadev Bhattiprolu
Madhavan Srinivasan [ma...@linux.vnet.ibm.com] wrote: > The LDST field and DATA_SRC in SIER identifies the memory hierarchy level > (eg: L1, L2 etc), from which a data-cache miss for a marked instruction > was satisfied. Use the 'perf_mem_data_src' object to export this > hierarchy level to user sp

[PATCH] ASoC: fsl: constify snd_soc_ops structures

2017-03-13 Thread Bhumika Goyal
Declare snd_soc_ops structures as const as they are only stored in the ops field of a snd_soc_dai_link structure. This field is of type const, so snd_soc_ops structures having this property can be made const too. The following .o files did not compile: sound/soc/fsl/{p1022_rdk.c/p1022_ds.c/mpc8610

Re: 4.11.0-rc1 boot resulted in WARNING: CPU: 14 PID: 1722 at fs/sysfs/dir.c:31 .sysfs_warn_dup+0x78/0xb0

2017-03-13 Thread Abdul Haleem
On Sat, 2017-03-11 at 15:46 -0700, Jens Axboe wrote: > On 03/09/2017 05:59 AM, Brian Foster wrote: > > cc linux-block > > > > On Thu, Mar 09, 2017 at 04:20:06PM +0530, Abdul Haleem wrote: > >> On Wed, 2017-03-08 at 08:17 -0500, Brian Foster wrote: > >>> On Tue, Mar 07, 2017 at 10:01:04PM +0530, Ab

Re: [BUG] [PowerPC] Kernel Oops when booting Linux mainline

2017-03-13 Thread Abdul Haleem
On Mon, 2017-03-13 at 14:48 +0530, Abdul Haleem wrote: > Hi, > > Mainline boot is broken on PowerPC bare metal with below traces: > Machine Type : Power 8 Bare metal > > [ OK ] Mounted Debug File System. > [ OK ] Started Nameserver information manager. > [ OK ] Started LVM2 metadata daemon.

Re: [PATCH v2 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

2017-03-13 Thread Peter Zijlstra
On Mon, Mar 13, 2017 at 04:45:51PM +0530, Madhavan Srinivasan wrote: > > - should you not have fixed this in the tool only? This patch > >effectively breaks ABI on big-endian architectures. > > IIUC, we are the first BE user for this feature > (Kindly correct me if I am wrong), so technically

Re: 5-level pagetable patches break ppc64le

2017-03-13 Thread Kirill A. Shutemov
On Mon, Mar 13, 2017 at 09:05:50PM +1100, Anton Blanchard wrote: > Hi, > > My ppc64le boot tests stopped working as of commit c2febafc6773 ("mm: > convert generic code to 5-level paging") > > We hang part way during boot, just before bringing up the network. I > haven't had a chance to narrow it

Re: [PATCH v2 1/6] powerpc/perf: Define big-endian version of perf_mem_data_src

2017-03-13 Thread Madhavan Srinivasan
On Tuesday 07 March 2017 03:53 PM, Peter Zijlstra wrote: On Tue, Mar 07, 2017 at 03:28:17PM +0530, Madhavan Srinivasan wrote: On Monday 06 March 2017 04:52 PM, Peter Zijlstra wrote: On Mon, Mar 06, 2017 at 04:13:08PM +0530, Madhavan Srinivasan wrote: From: Sukadev Bhattiprolu perf_mem_dat

Re: [FIX PATCH v1] powerpc/pseries: Fix reference count leak during CPU unplug

2017-03-13 Thread Bharata B Rao
On Thu, Mar 09, 2017 at 01:34:00PM -0800, Tyrel Datwyler wrote: > On 03/08/2017 08:37 PM, Bharata B Rao wrote: > > The following warning is seen when a CPU is hot unplugged on a PowerKVM > > guest: > > Is this the case with cpus present at boot? What about cpus hotplugged > after boot? I have obs

5-level pagetable patches break ppc64le

2017-03-13 Thread Anton Blanchard
Hi, My ppc64le boot tests stopped working as of commit c2febafc6773 ("mm: convert generic code to 5-level paging") We hang part way during boot, just before bringing up the network. I haven't had a chance to narrow it down yet. Anton

[BUG] [PowerPC] Kernel Oops when booting Linux mainline

2017-03-13 Thread Abdul Haleem
Hi, Mainline boot is broken on PowerPC bare metal with below traces: Machine Type : Power 8 Bare metal [ OK ] Mounted Debug File System. [ OK ] Started Nameserver information manager. [ OK ] Started LVM2 metadata daemon. Unable to handle kernel paging request for data at address 0x30079

Re: syscall statx not implemented on powerpc

2017-03-13 Thread Chandan Rajendra
On Monday, March 13, 2017 03:33:07 AM Chris Packham wrote: > Hi, > > I've just attempted to build a powerpc kernel from 4.11-rc2 using a > custom defconfig (available on request) and I'm hitting the following > error in the early stages of compilation. > > :1325:2: error: #warning syscall statx