From: David Miller <davem@davemloft.net>
To: mroos@linux.ee
Cc: iamjoonsoo.kim@lge.com, linux-kernel@vger.kernel.org,
cl@linux.com, penberg@kernel.org, rientjes@google.com,
akpm@linux-foundation.org, linux-mm@kvack.org,
sparclinux@vger.kernel.org
Subject: Re: unaligned accesses in SLAB etc.
Date: Thu, 16 Oct 2014 16:50:17 -0400 (EDT) [thread overview]
Message-ID: <20141016.165017.1151349565275102498.davem@davemloft.net> (raw)
In-Reply-To: <20141016.162001.599580415052560455.davem@redhat.com>
From: David Miller <davem@redhat.com>
Date: Thu, 16 Oct 2014 16:20:01 -0400 (EDT)
> So I'm going to audit all the code paths to make sure we don't put garbage
> into the fault_code value.
There are two code paths where we can put garbage into the fault_code
value. And for the dtlb_prot.S case, the value we put in there is
TLB_TAG_ACCESS which is 0x30, which include bit 0x20 which is that
FAULT_CODE_BAD_RA indication which is erroneously triggering.
The other path is via hugepage TLB misses, for the situation where
we haven't allocated the huge TSB for the thread yet. That might
explain some other longer-term problems we've had.
I'm about to test the following fix:
diff --git a/arch/sparc/kernel/dtlb_prot.S b/arch/sparc/kernel/dtlb_prot.S
index b2c2c5b..d668ca14 100644
--- a/arch/sparc/kernel/dtlb_prot.S
+++ b/arch/sparc/kernel/dtlb_prot.S
@@ -24,11 +24,11 @@
mov TLB_TAG_ACCESS, %g4 ! For reload of vaddr
/* PROT ** ICACHE line 2: More real fault processing */
+ ldxa [%g4] ASI_DMMU, %g5 ! Put tagaccess in %g5
bgu,pn %xcc, winfix_trampoline ! Yes, perform winfixup
- ldxa [%g4] ASI_DMMU, %g5 ! Put tagaccess in %g5
- ba,pt %xcc, sparc64_realfault_common ! Nope, normal fault
mov FAULT_CODE_DTLB | FAULT_CODE_WRITE, %g4
- nop
+ ba,pt %xcc, sparc64_realfault_common ! Nope, normal fault
+ nop
nop
nop
nop
diff --git a/arch/sparc/kernel/tsb.S b/arch/sparc/kernel/tsb.S
index 14158d4..be98685 100644
--- a/arch/sparc/kernel/tsb.S
+++ b/arch/sparc/kernel/tsb.S
@@ -162,10 +162,10 @@ tsb_miss_page_table_walk_sun4v_fastpath:
nop
.previous
- rdpr %tl, %g3
- cmp %g3, 1
+ rdpr %tl, %g7
+ cmp %g7, 1
bne,pn %xcc, winfix_trampoline
- nop
+ mov %g3, %g4
ba,pt %xcc, etrap
rd %pc, %g7
call hugetlb_setup
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-10-16 20:50 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-12 2:15 David Miller
2014-10-12 17:20 ` David Miller
2014-10-13 20:22 ` mroos
2014-10-13 23:52 ` Joonsoo Kim
2014-10-14 0:04 ` David Miller
2014-10-14 0:14 ` Joonsoo Kim
2014-10-14 21:19 ` mroos
2014-10-14 21:32 ` David Miller
2014-10-15 8:04 ` Meelis Roos
2014-10-15 18:36 ` David Miller
2014-10-15 20:11 ` Meelis Roos
2014-10-16 3:11 ` David Miller
2014-10-16 7:22 ` Meelis Roos
2014-10-16 20:11 ` Meelis Roos
2014-10-16 20:18 ` David Miller
2014-10-16 7:02 ` Meelis Roos
2014-10-16 20:07 ` David Miller
2014-10-16 20:16 ` Meelis Roos
2014-10-16 20:20 ` David Miller
2014-10-16 20:50 ` David Miller [this message]
2014-10-17 11:12 ` Meelis Roos
2014-10-18 17:59 ` David Miller
2014-10-18 18:23 ` David Miller
2014-10-19 12:31 ` Meelis Roos
2014-10-19 17:12 ` Meelis Roos
2014-10-19 17:18 ` David Miller
2014-10-19 15:32 ` Sam Ravnborg
2014-10-19 17:27 ` David Miller
2014-10-19 19:55 ` Sam Ravnborg
2014-10-16 20:20 ` Meelis Roos
2014-10-16 20:40 ` Meelis Roos
2014-10-12 17:22 ` Joonsoo Kim
2014-10-12 17:30 ` David Miller
2014-10-12 17:43 ` Joonsoo Kim
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=20141016.165017.1151349565275102498.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mroos@linux.ee \
--cc=penberg@kernel.org \
--cc=rientjes@google.com \
--cc=sparclinux@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox