Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] qemu does not have dcache aliases
@ 2006-08-19 15:33 Atsushi Nemoto
  2006-08-21 12:45 ` Maciej W. Rozycki
  0 siblings, 1 reply; 14+ messages in thread
From: Atsushi Nemoto @ 2006-08-19 15:33 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>

diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
index f4e370e..529445d 100644
--- a/include/asm-mips/mach-qemu/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
@@ -20,7 +20,7 @@ #define cpu_has_ejtag		0
 
 #define cpu_has_llsc		1
 #define cpu_has_vtag_icache	0
-#define cpu_has_dc_aliases	(PAGE_SIZE < 0x4000)
+#define cpu_has_dc_aliases	0
 #define cpu_has_ic_fills_f_dc	0
 
 #define cpu_has_dsp		0

^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-19 15:33 [PATCH] qemu does not have dcache aliases Atsushi Nemoto
@ 2006-08-21 12:45 ` Maciej W. Rozycki
  2006-08-21 12:47   ` Ralf Baechle
  2006-08-21 13:59   ` Atsushi Nemoto
  0 siblings, 2 replies; 14+ messages in thread
From: Maciej W. Rozycki @ 2006-08-21 12:45 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips, ralf

On Sun, 20 Aug 2006, Atsushi Nemoto wrote:

> @@ -20,7 +20,7 @@ #define cpu_has_ejtag		0
>  
>  #define cpu_has_llsc		1
>  #define cpu_has_vtag_icache	0
> -#define cpu_has_dc_aliases	(PAGE_SIZE < 0x4000)
> +#define cpu_has_dc_aliases	0
>  #define cpu_has_ic_fills_f_dc	0
>  
>  #define cpu_has_dsp		0

 Hmm, it looks like a bug in QEMU -- we should definitely implement them!

  Maciej

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 12:45 ` Maciej W. Rozycki
@ 2006-08-21 12:47   ` Ralf Baechle
  2006-08-21 13:59   ` Atsushi Nemoto
  1 sibling, 0 replies; 14+ messages in thread
From: Ralf Baechle @ 2006-08-21 12:47 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Atsushi Nemoto, linux-mips

On Mon, Aug 21, 2006 at 01:45:03PM +0100, Maciej W. Rozycki wrote:

> > @@ -20,7 +20,7 @@ #define cpu_has_ejtag		0
> >  
> >  #define cpu_has_llsc		1
> >  #define cpu_has_vtag_icache	0
> > -#define cpu_has_dc_aliases	(PAGE_SIZE < 0x4000)
> > +#define cpu_has_dc_aliases	0
> >  #define cpu_has_ic_fills_f_dc	0
> >  
> >  #define cpu_has_dsp		0
> 
>  Hmm, it looks like a bug in QEMU -- we should definitely implement them!

In this case I'd rather suggest to fix reality to match emulation ;-)

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 12:45 ` Maciej W. Rozycki
  2006-08-21 12:47   ` Ralf Baechle
@ 2006-08-21 13:59   ` Atsushi Nemoto
  2006-08-21 14:46     ` Ralf Baechle
  2006-08-21 15:16     ` Maciej W. Rozycki
  1 sibling, 2 replies; 14+ messages in thread
From: Atsushi Nemoto @ 2006-08-21 13:59 UTC (permalink / raw)
  To: macro; +Cc: linux-mips, ralf

On Mon, 21 Aug 2006 13:45:03 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
>  Hmm, it looks like a bug in QEMU -- we should definitely implement them!

Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
anyway. :-)

Or we can just remove cpu_has_dc_aliases from the file and use generic
definition.

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 13:59   ` Atsushi Nemoto
@ 2006-08-21 14:46     ` Ralf Baechle
  2006-08-21 14:51       ` Geert Uytterhoeven
  2006-08-21 15:22       ` Atsushi Nemoto
  2006-08-21 15:16     ` Maciej W. Rozycki
  1 sibling, 2 replies; 14+ messages in thread
From: Ralf Baechle @ 2006-08-21 14:46 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: macro, linux-mips

On Mon, Aug 21, 2006 at 10:59:10PM +0900, Atsushi Nemoto wrote:

> On Mon, 21 Aug 2006 13:45:03 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> >  Hmm, it looks like a bug in QEMU -- we should definitely implement them!
> 
> Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> anyway. :-)
> 
> Or we can just remove cpu_has_dc_aliases from the file and use generic
> definition.

The CPU emulated by Qemu might change eventually so I think this is
preferable.

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 14:46     ` Ralf Baechle
@ 2006-08-21 14:51       ` Geert Uytterhoeven
  2006-08-21 15:02         ` Ralf Baechle
  2006-08-21 15:22       ` Atsushi Nemoto
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2006-08-21 14:51 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Atsushi Nemoto, macro, Linux/MIPS Development

On Mon, 21 Aug 2006, Ralf Baechle wrote:
> On Mon, Aug 21, 2006 at 10:59:10PM +0900, Atsushi Nemoto wrote:
> > On Mon, 21 Aug 2006 13:45:03 +0100 (BST), "Maciej W. Rozycki" <macro@linux-mips.org> wrote:
> > >  Hmm, it looks like a bug in QEMU -- we should definitely implement them!
> > 
> > Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> > anyway. :-)
> > 
> > Or we can just remove cpu_has_dc_aliases from the file and use generic
> > definition.
> 
> The CPU emulated by Qemu might change eventually so I think this is
> preferable.

Or become fully configurable, to make it match every single MIPS core ever
build?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 14:51       ` Geert Uytterhoeven
@ 2006-08-21 15:02         ` Ralf Baechle
  0 siblings, 0 replies; 14+ messages in thread
From: Ralf Baechle @ 2006-08-21 15:02 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Atsushi Nemoto, macro, Linux/MIPS Development

On Mon, Aug 21, 2006 at 04:51:40PM +0200, Geert Uytterhoeven wrote:

> Or become fully configurable, to make it match every single MIPS core ever
> build?

I imagine a special debug CPU type that throws exception when particular
problems such as cache aliases, stale I-cache lines, back-to-back cp0
operations and other dangerous or suspisious instructions are detected
or more complex and detailed profiling that a processor can offer.

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 13:59   ` Atsushi Nemoto
  2006-08-21 14:46     ` Ralf Baechle
@ 2006-08-21 15:16     ` Maciej W. Rozycki
  2006-08-21 15:26       ` Ralf Baechle
  1 sibling, 1 reply; 14+ messages in thread
From: Maciej W. Rozycki @ 2006-08-21 15:16 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips, ralf

On Mon, 21 Aug 2006, Atsushi Nemoto wrote:

> >  Hmm, it looks like a bug in QEMU -- we should definitely implement them!
> 
> Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> anyway. :-)

 I don't think emulating a bigger cache so that we can add aliases should 
be *that* difficult.  Adding aliases themselves might be a bit trickier, 
but the gain would certainly justify the hassle, wouldn't it?

  Maciej

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 14:46     ` Ralf Baechle
  2006-08-21 14:51       ` Geert Uytterhoeven
@ 2006-08-21 15:22       ` Atsushi Nemoto
  1 sibling, 0 replies; 14+ messages in thread
From: Atsushi Nemoto @ 2006-08-21 15:22 UTC (permalink / raw)
  To: ralf; +Cc: macro, linux-mips

On Mon, 21 Aug 2006 15:46:06 +0100, Ralf Baechle <ralf@linux-mips.org> wrote:
> The CPU emulated by Qemu might change eventually so I think this is
> preferable.

Then we can just remove mach-qemu/cpu-features-overrides.h to get
maximum availability.  Would I create a patch?

---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 15:16     ` Maciej W. Rozycki
@ 2006-08-21 15:26       ` Ralf Baechle
  2006-08-21 15:36         ` Thiemo Seufer
  0 siblings, 1 reply; 14+ messages in thread
From: Ralf Baechle @ 2006-08-21 15:26 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Atsushi Nemoto, linux-mips

On Mon, Aug 21, 2006 at 04:16:21PM +0100, Maciej W. Rozycki wrote:

> > Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> > anyway. :-)
> 
>  I don't think emulating a bigger cache so that we can add aliases should 
> be *that* difficult.  Adding aliases themselves might be a bit trickier, 
> but the gain would certainly justify the hassle, wouldn't it?

The cache lookup for every access would have serious impact on performance.
The question is, is it worth the price?  Would such patches be acceptable
by the upstream qemu maintainers?

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 15:26       ` Ralf Baechle
@ 2006-08-21 15:36         ` Thiemo Seufer
  2006-08-21 15:43           ` Geert Uytterhoeven
  0 siblings, 1 reply; 14+ messages in thread
From: Thiemo Seufer @ 2006-08-21 15:36 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: Maciej W. Rozycki, Atsushi Nemoto, linux-mips

Ralf Baechle wrote:
> On Mon, Aug 21, 2006 at 04:16:21PM +0100, Maciej W. Rozycki wrote:
> 
> > > Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> > > anyway. :-)
> > 
> >  I don't think emulating a bigger cache so that we can add aliases should 
> > be *that* difficult.  Adding aliases themselves might be a bit trickier, 
> > but the gain would certainly justify the hassle, wouldn't it?
> 
> The cache lookup for every access would have serious impact on performance.
> The question is, is it worth the price?  Would such patches be acceptable
> by the upstream qemu maintainers?

Likely not, given that performance is the prime criterion there.


Thiemo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 15:36         ` Thiemo Seufer
@ 2006-08-21 15:43           ` Geert Uytterhoeven
  2006-08-21 18:12             ` Thiemo Seufer
  0 siblings, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2006-08-21 15:43 UTC (permalink / raw)
  To: Thiemo Seufer
  Cc: Ralf Baechle, Maciej W. Rozycki, Atsushi Nemoto,
	Linux/MIPS Development

On Mon, 21 Aug 2006, Thiemo Seufer wrote:
> Ralf Baechle wrote:
> > On Mon, Aug 21, 2006 at 04:16:21PM +0100, Maciej W. Rozycki wrote:
> > 
> > > > Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> > > > anyway. :-)
> > > 
> > >  I don't think emulating a bigger cache so that we can add aliases should 
> > > be *that* difficult.  Adding aliases themselves might be a bit trickier, 
> > > but the gain would certainly justify the hassle, wouldn't it?
> > 
> > The cache lookup for every access would have serious impact on performance.
> > The question is, is it worth the price?  Would such patches be acceptable
> > by the upstream qemu maintainers?
> 
> Likely not, given that performance is the prime criterion there.

It depends. If you just want to run MIPS Linux, yes.
If you want to debug the kernel on a MIPS core with cache aliasing[*], no.

[*] Replace with whatever slow-to-emulate and hard-to-debug feature.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 15:43           ` Geert Uytterhoeven
@ 2006-08-21 18:12             ` Thiemo Seufer
  2006-08-21 20:39               ` Ralf Baechle
  0 siblings, 1 reply; 14+ messages in thread
From: Thiemo Seufer @ 2006-08-21 18:12 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Ralf Baechle, Maciej W. Rozycki, Atsushi Nemoto,
	Linux/MIPS Development

Geert Uytterhoeven wrote:
> On Mon, 21 Aug 2006, Thiemo Seufer wrote:
> > Ralf Baechle wrote:
> > > On Mon, Aug 21, 2006 at 04:16:21PM +0100, Maciej W. Rozycki wrote:
> > > 
> > > > > Well, the QEMU cpu has 2-way 2kB dcache... does not have aliasing
> > > > > anyway. :-)
> > > > 
> > > >  I don't think emulating a bigger cache so that we can add aliases should 
> > > > be *that* difficult.  Adding aliases themselves might be a bit trickier, 
> > > > but the gain would certainly justify the hassle, wouldn't it?
> > > 
> > > The cache lookup for every access would have serious impact on performance.
> > > The question is, is it worth the price?  Would such patches be acceptable
> > > by the upstream qemu maintainers?
> > 
> > Likely not, given that performance is the prime criterion there.
> 
> It depends. If you just want to run MIPS Linux, yes.
> If you want to debug the kernel on a MIPS core with cache aliasing[*], no.

I wrote about qemu upstream's priorities.


Thiemo

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH] qemu does not have dcache aliases
  2006-08-21 18:12             ` Thiemo Seufer
@ 2006-08-21 20:39               ` Ralf Baechle
  0 siblings, 0 replies; 14+ messages in thread
From: Ralf Baechle @ 2006-08-21 20:39 UTC (permalink / raw)
  To: Thiemo Seufer
  Cc: Geert Uytterhoeven, Maciej W. Rozycki, Atsushi Nemoto,
	Linux/MIPS Development

On Mon, Aug 21, 2006 at 07:12:16PM +0100, Thiemo Seufer wrote:

> > It depends. If you just want to run MIPS Linux, yes.
> > If you want to debug the kernel on a MIPS core with cache aliasing[*], no.
> 
> I wrote about qemu upstream's priorities.

Considering that maybe we just change Qemu's c0_config to pretend it
emulates a cacheless CPU - which matches what it actually does.  We can
still change that once upstream priorities and Qemu's actual capabilities
have changed.

  Ralf

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-08-22 12:40 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-19 15:33 [PATCH] qemu does not have dcache aliases Atsushi Nemoto
2006-08-21 12:45 ` Maciej W. Rozycki
2006-08-21 12:47   ` Ralf Baechle
2006-08-21 13:59   ` Atsushi Nemoto
2006-08-21 14:46     ` Ralf Baechle
2006-08-21 14:51       ` Geert Uytterhoeven
2006-08-21 15:02         ` Ralf Baechle
2006-08-21 15:22       ` Atsushi Nemoto
2006-08-21 15:16     ` Maciej W. Rozycki
2006-08-21 15:26       ` Ralf Baechle
2006-08-21 15:36         ` Thiemo Seufer
2006-08-21 15:43           ` Geert Uytterhoeven
2006-08-21 18:12             ` Thiemo Seufer
2006-08-21 20:39               ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox