From: Will Deacon <hidden> Date: 2017-09-12 20:26:16
On Mon, Aug 28, 2017 at 09:53:00AM +0530, ankijain at codeaurora.org wrote:
Hi Will Deacon/ Al viro
-->Please find the attached kmsg.txt
<3>[17620.275249] BUG: sleeping function called from invalid context at /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/arch/arm64/mm/fault.c:313
<3>[17620.276504] in_atomic(): 0, irqs_disabled(): 0, pid: 10290, name:
stress-ng-dirde
<6>[17620.298995] ------------[ cut here ]------------
<2>[17620.299009] kernel BUG at /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
<6>[17620.306372] ------------[ cut here ]------------
<2>[17620.327239] kernel BUG at /local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
--> we are using arm64 machine with kernel 4.4.
--> can you please guide us, how to capture ESR value while taking the
fault?
-->
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
From: ankijain at codeaurora.org <hidden> Date: 2017-09-13 17:05:40
Hi Will
quoted
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
we didn't try yet with above changes.
we will start the test soon and update you.
Regards,
Ankit Jain
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center,
Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project
On 2017-09-13 01:56, Will Deacon wrote:
On Mon, Aug 28, 2017 at 09:53:00AM +0530, ankijain at codeaurora.org
wrote:
quoted
Hi Will Deacon/ Al viro
-->Please find the attached kmsg.txt
<3>[17620.275249] BUG: sleeping function called from invalid context
at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/arch/arm64/mm/fault.c:313
<3>[17620.276504] in_atomic(): 0, irqs_disabled(): 0, pid: 10290,
name:
stress-ng-dirde
<6>[17620.298995] ------------[ cut here ]------------
<2>[17620.299009] kernel BUG at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
<6>[17620.306372] ------------[ cut here ]------------
<2>[17620.327239] kernel BUG at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
--> we are using arm64 machine with kernel 4.4.
--> can you please guide us, how to capture ESR value while taking the
fault?
-->
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
From: ankijain at codeaurora.org <hidden> Date: 2017-09-26 17:36:28
Hi will
Unfortunately issue path is not getting hit with our released
binary(without your chnage) also with your suggested changes.
so we cant confirm that your suggested changes are working or not.
We will come back to you once will face issue again.
Regards,
Ankit Jain
On 2017-09-13 22:35, ankijain at codeaurora.org wrote:
Hi Will
quoted
quoted
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
we didn't try yet with above changes.
we will start the test soon and update you.
Regards,
Ankit Jain
Qualcomm India Private Limited, on behalf of Qualcomm Innovation
Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project
On 2017-09-13 01:56, Will Deacon wrote:
quoted
On Mon, Aug 28, 2017 at 09:53:00AM +0530, ankijain at codeaurora.org
wrote:
quoted
Hi Will Deacon/ Al viro
-->Please find the attached kmsg.txt
<3>[17620.275249] BUG: sleeping function called from invalid context
at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/arch/arm64/mm/fault.c:313
<3>[17620.276504] in_atomic(): 0, irqs_disabled(): 0, pid: 10290,
name:
stress-ng-dirde
<6>[17620.298995] ------------[ cut here ]------------
<2>[17620.299009] kernel BUG at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
<6>[17620.306372] ------------[ cut here ]------------
<2>[17620.327239] kernel BUG at
/local/mnt/workspace/lnxbuild/project/trees_in_use/free_tree_platform_manifest_refs_tags_AU_LINUX_ANDROID_LA.UM.5.7.07.01.01.287.725_sdm660_64_commander_26168534/checkout/kernel/msm-4.4/kernel/sched/core.c:8528!
--> we are using arm64 machine with kernel 4.4.
--> can you please guide us, how to capture ESR value while taking
the
fault?
-->
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
[looking through the old mail]
On Tue, Sep 12, 2017 at 09:26:16PM +0100, Will Deacon wrote:
quoted
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
Did you test with this change?
FWIW, while that went in as commit 760bfb47c36a ("arm64: fault: Route pte
translation faults via do_translation_fault"), I wonder if the same issue
exists on arm. It looks like the pagefault handler there is fairly
similar to arm64 one and the same shortcut is present there.
The more I'm looking at that, the more it looks like we *really* need
a comment in all instances of load_unaligned_zeropad() warning about
that pitfall. Something like
/*
* Load an unaligned word from kernel space.
*
* In the (very unlikely) case of the word being a page-crosser
* and the next page not being mapped, take the exception and
* return zeroes in the non-existing part.
*
* NOTE: this relies upon the pagefault handler *NOT* blocking
* in such situation (fault in kernel mode on kernel address with
* exception fixup present). Verify that for your architecture
* before using an equivalent of this approach. Note that
* you can't count upon faulthandler_disabled() saving you;
* this function can be called e.g. under a spinlock on non-preempt
* kernels without pagefault_disable() done by caller.
*/
perhaps. That property holds on x86, ppc and (now) arm64, but as
arm64 case shows, it might not be true for other architectures.
As the matter of fact, e.g. sparc64 (which will not use that
thing for obvious reasons anyway) it is *not* true, etc.
From: Will Deacon <hidden> Date: 2017-11-07 01:19:03
On Sat, Nov 04, 2017 at 12:17:57AM +0000, Al Viro wrote:
[looking through the old mail]
On Tue, Sep 12, 2017 at 09:26:16PM +0100, Will Deacon wrote:
quoted
quoted
- { do_page_fault, SIGSEGV, SEGV_MAPERR, "level 3 translation
fault" },
+ { do_translation_fault, SIGSEGV, SEGV_MAPERR, "level 3
translation fault" },
we will try with above changes and get back to you.
Did you test with this change?
FWIW, while that went in as commit 760bfb47c36a ("arm64: fault: Route pte
translation faults via do_translation_fault"), I wonder if the same issue
exists on arm. It looks like the pagefault handler there is fairly
similar to arm64 one and the same shortcut is present there.
So we never actually nailed this one down on arm64 (the problem mysteriously
disappeared iirc, and I failed to reproduce it on my systems) but I fixed it
anyway because it looked at least theoretically possible. In that case, yes,
I think ARM needs the same sort of fixes for both 2 and 3 level tables where
the handler branch directly to do_page_fault.
The more I'm looking at that, the more it looks like we *really* need
a comment in all instances of load_unaligned_zeropad() warning about
that pitfall. Something like
/*
* Load an unaligned word from kernel space.
*
* In the (very unlikely) case of the word being a page-crosser
* and the next page not being mapped, take the exception and
* return zeroes in the non-existing part.
*
* NOTE: this relies upon the pagefault handler *NOT* blocking
* in such situation (fault in kernel mode on kernel address with
* exception fixup present). Verify that for your architecture
* before using an equivalent of this approach. Note that
* you can't count upon faulthandler_disabled() saving you;
* this function can be called e.g. under a spinlock on non-preempt
* kernels without pagefault_disable() done by caller.
*/
perhaps. That property holds on x86, ppc and (now) arm64, but as
arm64 case shows, it might not be true for other architectures.
As the matter of fact, e.g. sparc64 (which will not use that
thing for obvious reasons anyway) it is *not* true, etc.
I wonder if there's any mileage in a test module for this? That code rarely
(if ever) gets run in practice.
Will