SYSENTER fix for x86_64 CPUs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1565 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									aa0bc6b68c
								
							
						
					
					
						commit
						ca0d1734b4
					
				
							
								
								
									
										8
									
								
								kqemu.c
								
								
								
								
							
							
						
						
									
										8
									
								
								kqemu.c
								
								
								
								
							| 
						 | 
					@ -119,13 +119,19 @@ static void kqemu_update_cpuid(CPUState *env)
 | 
				
			||||||
    critical_features_mask = 
 | 
					    critical_features_mask = 
 | 
				
			||||||
        CPUID_CMOV | CPUID_CX8 | 
 | 
					        CPUID_CMOV | CPUID_CX8 | 
 | 
				
			||||||
        CPUID_FXSR | CPUID_MMX | CPUID_SSE | 
 | 
					        CPUID_FXSR | CPUID_MMX | CPUID_SSE | 
 | 
				
			||||||
        CPUID_SSE2;
 | 
					        CPUID_SSE2 | CPUID_SEP;
 | 
				
			||||||
    if (!is_cpuid_supported()) {
 | 
					    if (!is_cpuid_supported()) {
 | 
				
			||||||
        features = 0;
 | 
					        features = 0;
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        cpuid(1, eax, ebx, ecx, edx);
 | 
					        cpuid(1, eax, ebx, ecx, edx);
 | 
				
			||||||
        features = edx;
 | 
					        features = edx;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					#ifdef __x86_64__
 | 
				
			||||||
 | 
					    /* NOTE: on x86_64 CPUs, SYSENTER is not supported in
 | 
				
			||||||
 | 
					       compatibility mode, so in order to have the best performances
 | 
				
			||||||
 | 
					       it is better not to use it */
 | 
				
			||||||
 | 
					    features &= ~CPUID_SEP;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
    env->cpuid_features = (env->cpuid_features & ~critical_features_mask) |
 | 
					    env->cpuid_features = (env->cpuid_features & ~critical_features_mask) |
 | 
				
			||||||
        (features & critical_features_mask);
 | 
					        (features & critical_features_mask);
 | 
				
			||||||
    /* XXX: we could update more of the target CPUID state so that the
 | 
					    /* XXX: we could update more of the target CPUID state so that the
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue