Compare commits

...

3 Commits

5 changed files with 21 additions and 7 deletions

View File

@ -1,2 +1,4 @@
TARGET_ARCH=e2k
TARGET_XML_FILES= gdb-xml/e2k-v1.xml gdb-xml/e2k-v2.xml gdb-xml/e2k-v3.xml gdb-xml/e2k-v5.xml
TARGET_ARCH=e2k64
TARGET_BASE_ARCH=e2k
TARGET_ABI_DIR=e2k
TARGET_XML_FILES= gdb-xml/e2k-v1.xml gdb-xml/e2k-v2.xml gdb-xml/e2k-v3.xml gdb-xml/e2k-v5.xml

View File

@ -62,6 +62,7 @@ static void clear_probe_cache(int num)
case TARGET_NR_remap_file_pages:
case TARGET_NR_move_pages:
case TARGET_NR_migrate_pages:
case TARGET_NR_mprotect:
start_exclusive();
CPU_FOREACH(other_cpu) {
E2KCPU *cpu = E2K_CPU(other_cpu);
@ -130,7 +131,9 @@ void cpu_loop(CPUE2KState *env)
}
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],
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[] = {
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("pagecache", E2KCPU, env.enable_pagecache, false),
DEFINE_PROP_END_OF_LIST()
};

View File

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

View File

@ -20,15 +20,20 @@
static bool e2k_probe_access_cached(CPUE2KState *env, target_ulong page, int flags)
{
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;
}
env->probe_cache_page[index] = page;
env->probe_cache_flags[index] = page_get_flags(page);
page_flags = 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)