From: "Kim, Jong-Sung" <jsungkim@lge.com>
To: <linux-mips@linux-mips.org>
Subject: RE: Reading an entire cacheline
Date: Mon, 24 Apr 2006 16:23:58 +0900 [thread overview]
Message-ID: <07fb01c66770$0d61a920$f3479696@LGE.NET> (raw)
In-Reply-To: <058801c66280$3fa1ebb0$f3479696@LGE.NET>
Hi all,
Was my question too brief? I'm using MIPS5Kf core included in a Broadcom
implemented processor and it has a 32kB d-cache and a same sized i-cache.
Cache configuration is 2-way, 32-byte cacheline for both d- and i-cache
without L2 cache. Of course, MIPS-port Linux as the kernel for it. And, a
onboard block device has problem in its operation. I don't think it's a
kernel problem. So I wanna inspect the contents of cache RAMs at the device
driver's context. I've added some lines of codes look like follow:
__asm__ __volatile__(
".set noreorder\n\t"
".set mips3\n\t"
"cache 5, 0x00(%3)\n\t" // load d-cache tag
".set mips0\n\t" // by index
".set mips32\n\t"
"mfc0 %0, $28, 0\n\t"
"mfc0 %1, $28, 1\n\t"
"mfc0 %2, $29, 1\n\t"
.set mips0\n\t"
.set reorder"
: "=r" (tag), "=r" (data_lo), "=r" (data_hi)
: "r" (0x80000000 | (way << 14) | (index << 5) | (word <<
3))
);
This is executed for every index, every way, and every word. The thing aches
my head is the tags from a single cacheline differs. (very often for
d-cache) So I modified the code to reread the cacheline from the first word
when the tag was modified before reading all four words. Then the code never
return. I couldn't find any related information from manual.
Please give me a hint for reading whole cacheline safely.
-----Original Message-----
From: linux-mips-bounce@linux-mips.org
[mailto:linux-mips-bounce@linux-mips.org] On Behalf Of Kim, Jong-Sung
Sent: Tuesday, April 18, 2006 9:37 AM
To: linux-mips@linux-mips.org
Subject: Reading an entire cacheline
Hi,
Is there any way to read an entire cacheline from the MIPS5Kf? Four
sequential cache instructions do similarly, but sometimes the tags from a
same cacheline differ. How can I read a consistent cacheline safely?
Thanks.
WARNING: multiple messages have this Message-ID (diff)
From: "Kim, Jong-Sung" <jsungkim@lge.com>
To: linux-mips@linux-mips.org
Subject: RE: Reading an entire cacheline
Date: Mon, 24 Apr 2006 16:23:58 +0900 [thread overview]
Message-ID: <07fb01c66770$0d61a920$f3479696@LGE.NET> (raw)
Message-ID: <20060424072358.6_oZ2H7AVCAF4MctPAcb4TnoJygVVf7oZ735T2f6AEA@z> (raw)
In-Reply-To: <058801c66280$3fa1ebb0$f3479696@LGE.NET>
Hi all,
Was my question too brief? I'm using MIPS5Kf core included in a Broadcom
implemented processor and it has a 32kB d-cache and a same sized i-cache.
Cache configuration is 2-way, 32-byte cacheline for both d- and i-cache
without L2 cache. Of course, MIPS-port Linux as the kernel for it. And, a
onboard block device has problem in its operation. I don't think it's a
kernel problem. So I wanna inspect the contents of cache RAMs at the device
driver's context. I've added some lines of codes look like follow:
__asm__ __volatile__(
".set noreorder\n\t"
".set mips3\n\t"
"cache 5, 0x00(%3)\n\t" // load d-cache tag
".set mips0\n\t" // by index
".set mips32\n\t"
"mfc0 %0, $28, 0\n\t"
"mfc0 %1, $28, 1\n\t"
"mfc0 %2, $29, 1\n\t"
.set mips0\n\t"
.set reorder"
: "=r" (tag), "=r" (data_lo), "=r" (data_hi)
: "r" (0x80000000 | (way << 14) | (index << 5) | (word <<
3))
);
This is executed for every index, every way, and every word. The thing aches
my head is the tags from a single cacheline differs. (very often for
d-cache) So I modified the code to reread the cacheline from the first word
when the tag was modified before reading all four words. Then the code never
return. I couldn't find any related information from manual.
Please give me a hint for reading whole cacheline safely.
-----Original Message-----
From: linux-mips-bounce@linux-mips.org
[mailto:linux-mips-bounce@linux-mips.org] On Behalf Of Kim, Jong-Sung
Sent: Tuesday, April 18, 2006 9:37 AM
To: linux-mips@linux-mips.org
Subject: Reading an entire cacheline
Hi,
Is there any way to read an entire cacheline from the MIPS5Kf? Four
sequential cache instructions do similarly, but sometimes the tags from a
same cacheline differ. How can I read a consistent cacheline safely?
Thanks.
next prev parent reply other threads:[~2006-04-24 7:12 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-18 0:37 Reading an entire cacheline Kim, Jong-Sung
2006-04-18 0:37 ` Kim, Jong-Sung
2006-04-24 7:23 ` Kim, Jong-Sung [this message]
2006-04-24 7:23 ` Kim, Jong-Sung
2006-04-24 7:40 ` Kevin D. Kissell
2006-04-24 7:40 ` Kevin D. Kissell
-- strict thread matches above, loose matches on Subject: below --
2006-04-24 9:52 Kim, Jong-Sung
2006-04-24 9:52 ` Kim, Jong-Sung
2006-04-26 8:47 ` Kim, Jong-Sung
2006-04-26 8:47 ` Kim, Jong-Sung
2006-04-26 9:48 ` Kevin D. Kissell
2006-04-26 9:48 ` Kevin D. Kissell
2006-04-26 10:16 ` Thiemo Seufer
2006-04-26 11:24 ` Kevin D. Kissell
2006-04-26 11:24 ` Kevin D. Kissell
2006-04-27 5:04 ` Kim, Jong-Sung
2006-04-27 5:04 ` Kim, Jong-Sung
2006-04-27 5:13 ` Kim, Jong-Sung
2006-04-27 5:13 ` Kim, Jong-Sung
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='07fb01c66770$0d61a920$f3479696@LGE.NET' \
--to=jsungkim@lge.com \
--cc=linux-mips@linux-mips.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.