From: Michael Ellerman <patch-notifications@ellerman.id.au>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
imunsie@au1.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [RESEND] cxl: Fix coredump generation when cxl_get_fd() is used
Date: Tue, 22 Nov 2016 11:34:18 +1100 (AEDT) [thread overview]
Message-ID: <3tN60p45Shz9s5g@ozlabs.org> (raw)
In-Reply-To: <20161114085854.19667-1-fbarrat@linux.vnet.ibm.com>
On Mon, 2016-11-14 at 08:58:54 UTC, Frederic Barrat wrote:
> If a process dumps core while owning a cxl file descriptor obtained
> from an AFU driver (e.g. cxlflash) through the cxl_get_fd() API, the
> following error occurs:
>
> [ 868.027591] Unable to handle kernel paging request for data at address ...
> [ 868.027778] Faulting instruction address: 0xc00000000035edb0
> cpu 0x8c: Vector: 300 (Data Access) at [c000003c688275e0]
> pc: c00000000035edb0: elf_core_dump+0xd60/0x1300
> lr: c00000000035ed80: elf_core_dump+0xd30/0x1300
> sp: c000003c68827860
> msr: 9000000100009033
> dar: c
> dsisr: 40000000
> current = 0xc000003c68780000
> paca = 0xc000000001b73200 softe: 0 irq_happened: 0x01
> pid = 46725, comm = hxesurelock
> enter ? for help
> [c000003c68827a60] c00000000036948c do_coredump+0xcec/0x11e0
> [c000003c68827c20] c0000000000ce9e0 get_signal+0x540/0x7b0
> [c000003c68827d10] c000000000017354 do_signal+0x54/0x2b0
> [c000003c68827e00] c00000000001777c do_notify_resume+0xbc/0xd0
> [c000003c68827e30] c000000000009838 ret_from_except_lite+0x64/0x68
> --- Exception: 300 (Data Access) at 00003fff98ad2918
>
> The root cause is that the address_space structure for the file
> doesn't define a 'host' member.
>
> When cxl allocates a file descriptor, it's using the anonymous inode
> to back the file, but allocates a private address_space for each
> context. The private address_space allows to track memory allocation
> for each context. cxl doesn't define the 'host' member of the address
> space, i.e. the inode. We don't want to define it as the anonymous
> inode, since there's no longer a 1-to-1 relation between address_space
> and inode.
>
> To fix it, instead of using the anonymous inode, we introduce a simple
> pseudo filesystem so that cxl can allocate its own inodes. So we now
> have one inode for each file and address_space. The pseudo filesystem
> is only mounted on the first allocation of a file descriptor by
> cxl_get_fd().
>
> Tested with cxlflash.
>
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/bdecf76e319a29735d828575f4a926
cheers
prev parent reply other threads:[~2016-11-22 0:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-14 8:58 [RESEND PATCH] cxl: Fix coredump generation when cxl_get_fd() is used Frederic Barrat
2016-11-14 16:27 ` Matthew R. Ochs
2016-11-18 12:04 ` Michael Ellerman
2016-11-22 0:34 ` Michael Ellerman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3tN60p45Shz9s5g@ozlabs.org \
--to=patch-notifications@ellerman.id.au \
--cc=fbarrat@linux.vnet.ibm.com \
--cc=imunsie@au1.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.