diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2015-08-17 17:34:10 +1000 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2015-09-11 08:15:28 -0700 |
commit | 97ed5ccdee95f0b98bedc601ff979e368583472c (patch) | |
tree | 5ee711528010f3700f13983b8222c2ca7ae85c83 /target-i386 | |
parent | ba9cef7b6e487a5a8969db81d09b8eec8a2b50c6 (diff) | |
download | qemu-97ed5ccdee95f0b98bedc601ff979e368583472c.tar.gz qemu-97ed5ccdee95f0b98bedc601ff979e368583472c.tar.bz2 qemu-97ed5ccdee95f0b98bedc601ff979e368583472c.zip |
tlb: Add "ifetch" argument to cpu_mmu_index()
This is set to true when the index is for an instruction fetch
translation.
The core get_page_addr_code() sets it, as do the SOFTMMU_CODE_ACCESS
acessors.
All targets ignore it for now, and all other callers pass "false".
This will allow targets who wish to split the mmu index between
instruction and data accesses to do so. A subsequent patch will
do just that for PowerPC.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Message-Id: <1439796853-4410-2-git-send-email-benh@kernel.crashing.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/cpu.h | 2 | ||||
-rw-r--r-- | target-i386/translate.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 74b674d524..151f1b9d7f 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -1199,7 +1199,7 @@ uint64_t cpu_get_tsc(CPUX86State *env); #define MMU_KSMAP_IDX 0 #define MMU_USER_IDX 1 #define MMU_KNOSMAP_IDX 2 -static inline int cpu_mmu_index(CPUX86State *env) +static inline int cpu_mmu_index(CPUX86State *env, bool ifetch) { return (env->hflags & HF_CPL_MASK) == 3 ? MMU_USER_IDX : (!(env->hflags & HF_SMAP_MASK) || (env->eflags & AC_MASK)) diff --git a/target-i386/translate.c b/target-i386/translate.c index b1a5ad9a20..d72fa4687c 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -7942,7 +7942,7 @@ static inline void gen_intermediate_code_internal(X86CPU *cpu, /* select memory access functions */ dc->mem_index = 0; if (flags & HF_SOFTMMU_MASK) { - dc->mem_index = cpu_mmu_index(env); + dc->mem_index = cpu_mmu_index(env, false); } dc->cpuid_features = env->features[FEAT_1_EDX]; dc->cpuid_ext_features = env->features[FEAT_1_ECX]; |