Commit b7f0f463a55e4f4bded580905582f2dfa6652fca
1 parent
8e682019
debug fixes - use more generic TLB mappings
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@486 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
8 additions
and
18 deletions
target-i386/helper2.c
... | ... | @@ -73,7 +73,9 @@ void cpu_x86_close(CPUX86State *env) |
73 | 73 | static const char *cc_op_str[] = { |
74 | 74 | "DYNAMIC", |
75 | 75 | "EFLAGS", |
76 | - "MUL", | |
76 | + "MULB", | |
77 | + "MULW", | |
78 | + "MULL", | |
77 | 79 | "ADDB", |
78 | 80 | "ADDW", |
79 | 81 | "ADDL", |
... | ... | @@ -191,13 +193,15 @@ void cpu_x86_set_a20(CPUX86State *env, int a20_state) |
191 | 193 | { |
192 | 194 | a20_state = (a20_state != 0); |
193 | 195 | if (a20_state != a20_enabled) { |
196 | +#if defined(DEBUG_MMU) | |
197 | + printf("A20 update: a20=%d\n", a20_state); | |
198 | +#endif | |
194 | 199 | /* if the cpu is currently executing code, we must unlink it and |
195 | 200 | all the potentially executing TB */ |
196 | 201 | cpu_interrupt(env, 0); |
197 | 202 | |
198 | 203 | /* when a20 is changed, all the MMU mappings are invalid, so |
199 | 204 | we must flush everything */ |
200 | - page_unmap(); | |
201 | 205 | tlb_flush(env); |
202 | 206 | a20_enabled = a20_state; |
203 | 207 | if (a20_enabled) |
... | ... | @@ -211,18 +215,17 @@ void cpu_x86_update_cr0(CPUX86State *env) |
211 | 215 | { |
212 | 216 | int pg_state, pe_state; |
213 | 217 | |
214 | -#ifdef DEBUG_MMU | |
218 | +#if defined(DEBUG_MMU) | |
215 | 219 | printf("CR0 update: CR0=0x%08x\n", env->cr[0]); |
216 | 220 | #endif |
217 | 221 | pg_state = env->cr[0] & CR0_PG_MASK; |
218 | 222 | if (pg_state != last_pg_state) { |
219 | - page_unmap(); | |
220 | 223 | tlb_flush(env); |
221 | 224 | last_pg_state = pg_state; |
222 | 225 | } |
223 | 226 | pe_state = env->cr[0] & CR0_PE_MASK; |
224 | 227 | if (last_pe_state != pe_state) { |
225 | - tb_flush(); | |
228 | + tb_flush(env); | |
226 | 229 | last_pe_state = pe_state; |
227 | 230 | } |
228 | 231 | } |
... | ... | @@ -233,7 +236,6 @@ void cpu_x86_update_cr3(CPUX86State *env) |
233 | 236 | #if defined(DEBUG_MMU) |
234 | 237 | printf("CR3 update: CR3=%08x\n", env->cr[3]); |
235 | 238 | #endif |
236 | - page_unmap(); | |
237 | 239 | tlb_flush(env); |
238 | 240 | } |
239 | 241 | } |
... | ... | @@ -250,19 +252,7 @@ void cpu_x86_init_mmu(CPUX86State *env) |
250 | 252 | /* XXX: also flush 4MB pages */ |
251 | 253 | void cpu_x86_flush_tlb(CPUX86State *env, uint32_t addr) |
252 | 254 | { |
253 | - int flags; | |
254 | - unsigned long virt_addr; | |
255 | - | |
256 | 255 | tlb_flush_page(env, addr); |
257 | - | |
258 | - flags = page_get_flags(addr); | |
259 | - if (flags & PAGE_VALID) { | |
260 | - virt_addr = addr & ~0xfff; | |
261 | -#if !defined(CONFIG_SOFTMMU) | |
262 | - munmap((void *)virt_addr, 4096); | |
263 | -#endif | |
264 | - page_set_flags(virt_addr, virt_addr + 4096, 0); | |
265 | - } | |
266 | 256 | } |
267 | 257 | |
268 | 258 | /* return value: | ... | ... |