qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12.
@ 2008-05-06  8:38 Edgar E. Iglesias
  2008-05-06 12:31 ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Edgar E. Iglesias @ 2008-05-06  8:38 UTC (permalink / raw)
  To: qemu-devel

Revision: 4351
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4351
Author:   edgar_igl
Date:     2008-05-06 08:38:22 +0000 (Tue, 06 May 2008)

Log Message:
-----------
Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS != 12.

Modified Paths:
--------------
    trunk/exec-all.h

Modified: trunk/exec-all.h
===================================================================
--- trunk/exec-all.h	2008-05-06 08:30:15 UTC (rev 4350)
+++ trunk/exec-all.h	2008-05-06 08:38:22 UTC (rev 4351)
@@ -191,15 +191,15 @@
 {
     target_ulong tmp;
     tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
-    return (tmp >> TB_JMP_PAGE_BITS) & TB_JMP_PAGE_MASK;
+    return (tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) & TB_JMP_PAGE_MASK;
 }
 
 static inline unsigned int tb_jmp_cache_hash_func(target_ulong pc)
 {
     target_ulong tmp;
     tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
-    return (((tmp >> TB_JMP_PAGE_BITS) & TB_JMP_PAGE_MASK) |
-	    (tmp & TB_JMP_ADDR_MASK));
+    return (((tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) & TB_JMP_PAGE_MASK)
+	    | (tmp & TB_JMP_ADDR_MASK));
 }
 
 static inline unsigned int tb_phys_hash_func(unsigned long pc)

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

* Re: [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12.
  2008-05-06  8:38 [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12 Edgar E. Iglesias
@ 2008-05-06 12:31 ` Paul Brook
  2008-05-06 14:03   ` Edgar E. Iglesias
  0 siblings, 1 reply; 4+ messages in thread
From: Paul Brook @ 2008-05-06 12:31 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias

>  {
>      target_ulong tmp;
>      tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
> -    return (tmp >> TB_JMP_PAGE_BITS) & TB_JMP_PAGE_MASK;
> +    return (tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) &
> TB_JMP_PAGE_MASK; }


I'm not sure what you're trying to achieve here, but this is definitely wrong.
TARGET_PAGE_BITS may be less than TB_JMP_PAGE_BITS.

Paul

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

* Re: [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12.
  2008-05-06 12:31 ` Paul Brook
@ 2008-05-06 14:03   ` Edgar E. Iglesias
  2008-05-06 14:18     ` Paul Brook
  0 siblings, 1 reply; 4+ messages in thread
From: Edgar E. Iglesias @ 2008-05-06 14:03 UTC (permalink / raw)
  To: Paul Brook; +Cc: Edgar E. Iglesias, qemu-devel

On Tue, May 06, 2008 at 01:31:02PM +0100, Paul Brook wrote:
> >  {
> >      target_ulong tmp;
> >      tmp = pc ^ (pc >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS));
> > -    return (tmp >> TB_JMP_PAGE_BITS) & TB_JMP_PAGE_MASK;
> > +    return (tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) &
> > TB_JMP_PAGE_MASK; }
> 
> 
> I'm not sure what you're trying to achieve here, but this is definitely wrong.
> TARGET_PAGE_BITS may be less than TB_JMP_PAGE_BITS.

Hi Paul,

Thanks for the comment. 

I didn't find any page bits under 10 in the tree. Please note that the constant beeing used is not TB_JMP_CACHE_BITS but TB_JMP_PAGE_BITS. Also that same right shift constant was already used in the initial shift of pc in that same routine.

Before committing I ran tests with target page bits 10, 11, 12, and 13 and the modified hash function behaved ok here. Are there more setups I should test ?

Best regards
-- 
Edgar E. Iglesias
Axis Communications AB

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

* Re: [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12.
  2008-05-06 14:03   ` Edgar E. Iglesias
@ 2008-05-06 14:18     ` Paul Brook
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Brook @ 2008-05-06 14:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Edgar E. Iglesias

> > > -    return (tmp >> TB_JMP_PAGE_BITS) & TB_JMP_PAGE_MASK;
> > > +    return (tmp >> (TARGET_PAGE_BITS - TB_JMP_PAGE_BITS)) &
> > > TB_JMP_PAGE_MASK; }
> >
> > I'm not sure what you're trying to achieve here, but this is definitely
> > wrong. TARGET_PAGE_BITS may be less than TB_JMP_PAGE_BITS.
>
> I didn't find any page bits under 10 in the tree.

Oops, sorry, my bad. I read TB_JMP_PAGE_BITS as TB_JMP_CACHE_BITS-1, not /2.

Paul

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

end of thread, other threads:[~2008-05-06 14:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-06  8:38 [Qemu-devel] [4351] Make the paged properties of the tb-jmp-cache hash function work for TARGET_PAGE_BITS ! = 12 Edgar E. Iglesias
2008-05-06 12:31 ` Paul Brook
2008-05-06 14:03   ` Edgar E. Iglesias
2008-05-06 14:18     ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).