Commit 435183235567e0d942829bcf0507cbd34fdcf8a7
1 parent
59faf6d6
added invlpg emulation
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@280 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
11 additions
and
0 deletions
translate-i386.c
| @@ -4036,6 +4036,7 @@ void cpu_x86_close(CPUX86State *env) | @@ -4036,6 +4036,7 @@ void cpu_x86_close(CPUX86State *env) | ||
| 4036 | 4036 | ||
| 4037 | /***********************************************************/ | 4037 | /***********************************************************/ |
| 4038 | /* x86 mmu */ | 4038 | /* x86 mmu */ |
| 4039 | +/* XXX: add PGE support */ | ||
| 4039 | 4040 | ||
| 4040 | /* called when cr3 or PG bit are modified */ | 4041 | /* called when cr3 or PG bit are modified */ |
| 4041 | static int last_pg_state = -1; | 4042 | static int last_pg_state = -1; |
| @@ -4091,8 +4092,18 @@ void cpu_x86_init_mmu(CPUX86State *env) | @@ -4091,8 +4092,18 @@ void cpu_x86_init_mmu(CPUX86State *env) | ||
| 4091 | cpu_x86_update_cr0(env); | 4092 | cpu_x86_update_cr0(env); |
| 4092 | } | 4093 | } |
| 4093 | 4094 | ||
| 4095 | +/* XXX: also flush 4MB pages */ | ||
| 4094 | void cpu_x86_flush_tlb(CPUX86State *env, uint32_t addr) | 4096 | void cpu_x86_flush_tlb(CPUX86State *env, uint32_t addr) |
| 4095 | { | 4097 | { |
| 4098 | + int flags; | ||
| 4099 | + unsigned long virt_addr; | ||
| 4100 | + | ||
| 4101 | + flags = page_get_flags(addr); | ||
| 4102 | + if (flags & PAGE_VALID) { | ||
| 4103 | + virt_addr = addr & ~0xfff; | ||
| 4104 | + munmap((void *)virt_addr, 4096); | ||
| 4105 | + page_set_flags(virt_addr, virt_addr + 4096, 0); | ||
| 4106 | + } | ||
| 4096 | } | 4107 | } |
| 4097 | 4108 | ||
| 4098 | /* return value: | 4109 | /* return value: |