Commit a363e34cc51220a31691d54e576fb0e29ec02646
1 parent
ea041c0e
fixed VM86 support in Virtual Linux - fixed compilation issues with gcc 2.96 - c…
…puid returns now pentium pro in order to avoid F00F bug workaround in Linux kernel git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@277 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
21 additions
and
4 deletions
helper-i386.c
| ... | ... | @@ -216,7 +216,10 @@ static void do_interrupt_protected(int intno, int is_int, int error_code, |
| 216 | 216 | break; |
| 217 | 217 | } |
| 218 | 218 | dpl = (e2 >> DESC_DPL_SHIFT) & 3; |
| 219 | - cpl = env->segs[R_CS].selector & 3; | |
| 219 | + if (env->eflags & VM_MASK) | |
| 220 | + cpl = 3; | |
| 221 | + else | |
| 222 | + cpl = env->segs[R_CS].selector & 3; | |
| 220 | 223 | /* check privledge if software int */ |
| 221 | 224 | if (is_int && dpl < cpl) |
| 222 | 225 | raise_exception_err(EXCP0D_GPF, intno * 8 + 2); |
| ... | ... | @@ -572,13 +575,25 @@ void helper_cpuid(void) |
| 572 | 575 | ECX = 0x6c65746e; |
| 573 | 576 | EDX = 0x49656e69; |
| 574 | 577 | } else if (EAX == 1) { |
| 578 | + int family, model, stepping; | |
| 575 | 579 | /* EAX = 1 info */ |
| 576 | - EAX = 0x52b; | |
| 580 | +#if 0 | |
| 581 | + /* pentium 75-200 */ | |
| 582 | + family = 5; | |
| 583 | + model = 2; | |
| 584 | + stepping = 11; | |
| 585 | +#else | |
| 586 | + /* pentium pro */ | |
| 587 | + family = 6; | |
| 588 | + model = 1; | |
| 589 | + stepping = 3; | |
| 590 | +#endif | |
| 591 | + EAX = (family << 8) | (model << 4) | stepping; | |
| 577 | 592 | EBX = 0; |
| 578 | 593 | ECX = 0; |
| 579 | 594 | EDX = CPUID_FP87 | CPUID_DE | CPUID_PSE | |
| 580 | 595 | CPUID_TSC | CPUID_MSR | CPUID_MCE | |
| 581 | - CPUID_CX8; | |
| 596 | + CPUID_CX8 | CPUID_PGE | CPUID_CMOV; | |
| 582 | 597 | } |
| 583 | 598 | } |
| 584 | 599 | |
| ... | ... | @@ -751,7 +766,9 @@ void jmp_seg(int selector, unsigned int new_eip) |
| 751 | 766 | load_seg_cache(&sc1, e1, e2); |
| 752 | 767 | if (new_eip > sc1.limit) |
| 753 | 768 | raise_exception_err(EXCP0D_GPF, selector & 0xfffc); |
| 754 | - env->segs[R_CS] = sc1; | |
| 769 | + env->segs[R_CS].base = sc1.base; | |
| 770 | + env->segs[R_CS].limit = sc1.limit; | |
| 771 | + env->segs[R_CS].flags = sc1.flags; | |
| 755 | 772 | env->segs[R_CS].selector = (selector & 0xfffc) | cpl; |
| 756 | 773 | EIP = new_eip; |
| 757 | 774 | } else { | ... | ... |