From: Keith Owens <kaos@sgi.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Silent data corruption caused by XPC V2.
Date: Tue, 08 Aug 2006 01:02:55 +0000 [thread overview]
Message-ID: <5147.1154998975@kao2.melbourne.sgi.com> (raw)
In-Reply-To: <20060807174933.GB24663@lnx-holt.americas.sgi.com>
Robin Holt (on Mon, 7 Aug 2006 12:49:33 -0500) wrote:
>Jack Steiner identified a problem where XPC can cause a silent
>data corruption. On module load, the placement may cause the
>xpc_remote_copy_buffer to span two physical pages. DMA transfers are
>done to the start virtual address translated to physical.
>
>This patch changes the buffer from a statically allocated buffer to a
>kmalloc'd buffer. Dean Nelson reviewed this before posting. I have
>tested it in the configuration that was showing the memory corruption
>and verified it works. I also added DBUG_ON statements to help catch
>this if a similar situation is encountered.
>
>Index: linux-2.6/arch/ia64/sn/kernel/xpc_channel.c
>=================================>--- linux-2.6.orig/arch/ia64/sn/kernel/xpc_channel.c 2006-08-07 12:37:56.187180666 -0500
>+++ linux-2.6/arch/ia64/sn/kernel/xpc_channel.c 2006-08-07 12:37:58.935517909 -0500
>@@ -274,6 +274,7 @@ xpc_pull_remote_cachelines(struct xpc_pa
> DBUG_ON((u64) src != L1_CACHE_ALIGN((u64) src));
> DBUG_ON((u64) dst != L1_CACHE_ALIGN((u64) dst));
> DBUG_ON(cnt != L1_CACHE_ALIGN(cnt));
>+ DBUG_ON((ia64_tpa(dst) + cnt) != ia64_tpa(&((char *) dst)[cnt]));
Can the byte count be greater than 2 pages? If it can, then that debug
statement is not going to catch this case:
Virtual page Physical page
A X
A+1 Y
A+2 X+2
because you only test the last page.
FWIW, I find this more readable instead of indexing then taking the
address of the result.
DBUG_ON((ia64_tpa(dst) + cnt) != ia64_tpa((char *) dst + cnt);
next prev parent reply other threads:[~2006-08-08 1:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-07 17:49 Silent data corruption caused by XPC V2 Robin Holt
2006-08-08 1:02 ` Keith Owens [this message]
2006-08-08 17:22 ` Dean Nelson
2006-08-08 17:44 ` Luck, Tony
2006-08-08 18:52 ` Yu, Fenghua
2006-08-08 19:14 ` Dean Nelson
2006-08-08 20:03 ` Dean Nelson
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=5147.1154998975@kao2.melbourne.sgi.com \
--to=kaos@sgi.com \
--cc=linux-ia64@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 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.