Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: "Kim, Jong-Sung" <jsungkim@lge.com>
To: "'Thiemo Seufer'" <ths@networkno.de>
Cc: <linux-mips@linux-mips.org>
Subject: RE: Reading an entire cacheline
Date: Thu, 27 Apr 2006 14:13:00 +0900	[thread overview]
Message-ID: <00fd01c669b9$411095b0$f3479696@LGE.NET> (raw)
In-Reply-To: <20060426101603.GB29550@networkno.de>

Dear Mr. Seufer,

Thank you for your advice about directives. That's exactly what I meant. I
have confused them with push/pop style operations. Thanks.

Regards,
JS.

-----Original Message-----
From: Thiemo Seufer [mailto:ths@networkno.de] 
Sent: Wednesday, April 26, 2006 7:16 PM
To: Kim, Jong-Sung
Cc: linux-mips@linux-mips.org
Subject: Re: Reading an entire cacheline

Kim, Jong-Sung wrote:
> Hi all,
> 
> Please look at following codes:
> 
> save_flags(flags);
> cli();
> __asm__ __volatile__(
> 	"	.set	noreorder\n"
> 	"	.set	mips32\n"
> 	"2:	.set	mips3\n"
> 	"	cache	5, 0x00(%12)\n"
> 	"	.set	mips0\n"

Irrelevant sidemark:
.set mips0 resets to the original value, not to mips32. You probably want

	.set	push
	.set	noreorder
	.set 	mips32

	... <the whole code sequence>

	.set	pop

[snip]
> 	//"	bne	%0, %9, 2b\n"
> 	"	.set	mips0\n"
> 	"	.set	reorder"
> 	: "=r" (tag[1][way][0]), "=r" (datalo[1][way][0]),
> 	  "=r" (datahi[1][way][0]),
> 	  "=r" (tag[1][way][1]), "=r" (datalo[1][way][1]),
> 	  "=r" (datahi[1][way][1]),
> 	  "=r" (tag[1][way][2]), "=r" (datalo[1][way][2]),
> 	  "=r" (datahi[1][way][2]),
> 	  "=r" (tag[1][way][3]), "=r" (datalo[1][way][3]),
> 	  "=r" (datahi[1][way][3])
> 	: "r" (0x80000000 | (way << 14) | (line << 5))
> );

And this part may cause the problem you are seeing, I presume
datalo/datahi live in memory, and accesses of it change the dcache.

As Kevin mentioned, disassembling the binary might be helpful.


Thiemo

WARNING: multiple messages have this Message-ID (diff)
From: "Kim, Jong-Sung" <jsungkim@lge.com>
To: 'Thiemo Seufer' <ths@networkno.de>
Cc: linux-mips@linux-mips.org
Subject: RE: Reading an entire cacheline
Date: Thu, 27 Apr 2006 14:13:00 +0900	[thread overview]
Message-ID: <00fd01c669b9$411095b0$f3479696@LGE.NET> (raw)
Message-ID: <20060427051300.pBEiWjS70GOGHsmIqKr6bd4MfiA_HM6tdFHh2YK9Su0@z> (raw)
In-Reply-To: <20060426101603.GB29550@networkno.de>

Dear Mr. Seufer,

Thank you for your advice about directives. That's exactly what I meant. I
have confused them with push/pop style operations. Thanks.

Regards,
JS.

-----Original Message-----
From: Thiemo Seufer [mailto:ths@networkno.de] 
Sent: Wednesday, April 26, 2006 7:16 PM
To: Kim, Jong-Sung
Cc: linux-mips@linux-mips.org
Subject: Re: Reading an entire cacheline

Kim, Jong-Sung wrote:
> Hi all,
> 
> Please look at following codes:
> 
> save_flags(flags);
> cli();
> __asm__ __volatile__(
> 	"	.set	noreorder\n"
> 	"	.set	mips32\n"
> 	"2:	.set	mips3\n"
> 	"	cache	5, 0x00(%12)\n"
> 	"	.set	mips0\n"

Irrelevant sidemark:
.set mips0 resets to the original value, not to mips32. You probably want

	.set	push
	.set	noreorder
	.set 	mips32

	... <the whole code sequence>

	.set	pop

[snip]
> 	//"	bne	%0, %9, 2b\n"
> 	"	.set	mips0\n"
> 	"	.set	reorder"
> 	: "=r" (tag[1][way][0]), "=r" (datalo[1][way][0]),
> 	  "=r" (datahi[1][way][0]),
> 	  "=r" (tag[1][way][1]), "=r" (datalo[1][way][1]),
> 	  "=r" (datahi[1][way][1]),
> 	  "=r" (tag[1][way][2]), "=r" (datalo[1][way][2]),
> 	  "=r" (datahi[1][way][2]),
> 	  "=r" (tag[1][way][3]), "=r" (datalo[1][way][3]),
> 	  "=r" (datahi[1][way][3])
> 	: "r" (0x80000000 | (way << 14) | (line << 5))
> );

And this part may cause the problem you are seeing, I presume
datalo/datahi live in memory, and accesses of it change the dcache.

As Kevin mentioned, disassembling the binary might be helpful.


Thiemo

  parent reply	other threads:[~2006-04-27  5:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-24  9:52 Reading an entire cacheline 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 [this message]
2006-04-27  5:13       ` Kim, Jong-Sung
  -- strict thread matches above, loose matches on Subject: below --
2006-04-18  0:37 Kim, Jong-Sung
2006-04-18  0:37 ` Kim, Jong-Sung
2006-04-24  7:23 ` Kim, Jong-Sung
2006-04-24  7:23   ` Kim, Jong-Sung
2006-04-24  7:40   ` Kevin D. Kissell
2006-04-24  7:40     ` Kevin D. Kissell

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='00fd01c669b9$411095b0$f3479696@LGE.NET' \
    --to=jsungkim@lge.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ths@networkno.de \
    /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