e2k: disable probe page cache by default

This commit is contained in:
Denis Drakhnia 2024-07-12 12:14:42 +03:00
parent 79d628e979
commit 78fced2bba
4 changed files with 16 additions and 5 deletions

View File

@ -130,7 +130,9 @@ void cpu_loop(CPUE2KState *env)
} }
if (ret == 0) { if (ret == 0) {
clear_probe_cache(num); if (env->enable_pagecache) {
clear_probe_cache(num);
}
ret = do_syscall(env, num, args[1], args[2], args[3], ret = do_syscall(env, num, args[1], args[2], args[3],
args[4], args[5], args[6], args[7], args[8]); args[4], args[5], args[6], args[7], args[8]);
} }

View File

@ -252,6 +252,7 @@ static struct TCGCPUOps e2k_tcg_ops = {
static Property e2k_cpu_properties[] = { static Property e2k_cpu_properties[] = {
DEFINE_PROP_BOOL("force_save_alc_dst", E2KCPU, env.force_save_alc_dst, false), DEFINE_PROP_BOOL("force_save_alc_dst", E2KCPU, env.force_save_alc_dst, false),
DEFINE_PROP_BOOL("tags", E2KCPU, env.enable_tags, false), DEFINE_PROP_BOOL("tags", E2KCPU, env.enable_tags, false),
DEFINE_PROP_BOOL("pagecache", E2KCPU, env.enable_pagecache, false),
DEFINE_PROP_END_OF_LIST() DEFINE_PROP_END_OF_LIST()
}; };

View File

@ -936,6 +936,9 @@ typedef struct CPUArchState {
/* Enable tags handling. /* Enable tags handling.
* Default: false */ * Default: false */
bool enable_tags; bool enable_tags;
/* Enable page cache for speculative memory accesses.
* Default: false */
bool enable_pagecache;
struct e2k_def_t def; struct e2k_def_t def;

View File

@ -20,15 +20,20 @@
static bool e2k_probe_access_cached(CPUE2KState *env, target_ulong page, int flags) static bool e2k_probe_access_cached(CPUE2KState *env, target_ulong page, int flags)
{ {
int index = (page >> TARGET_PAGE_BITS) & (TARGET_PROBE_CACHE_SIZE - 1); int index = (page >> TARGET_PAGE_BITS) & (TARGET_PROBE_CACHE_SIZE - 1);
uint8_t page_flags;
if (env->probe_cache_page[index] == page) { if (env->enable_pagecache && env->probe_cache_page[index] == page) {
return (env->probe_cache_flags[index] & flags) == flags; return (env->probe_cache_flags[index] & flags) == flags;
} }
env->probe_cache_page[index] = page; page_flags = page_get_flags(page);
env->probe_cache_flags[index] = page_get_flags(page);
return (env->probe_cache_flags[index] & flags) == flags; if (env->enable_pagecache) {
env->probe_cache_page[index] = page;
env->probe_cache_flags[index] = page_flags;
}
return (page_flags & flags) == flags;
} }
static bool e2k_probe_access(CPUE2KState *env, target_ulong addr, int size, int flags) static bool e2k_probe_access(CPUE2KState *env, target_ulong addr, int size, int flags)