From b98dbc90950cd4e43ab9b4f8300dbeae6cf8c8cb Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 15 May 2014 16:07:04 +0200 Subject: target-i386: fix segment flags for SMM and VM86 mode With the next patch, these need to be correct or VM86 tasks have the wrong CPL. The flags are basically what the Intel VMX documentation say is mandatory for entry into a VM86 guest. For consistency, SMM ought to have the same flags except with CPL=0. Tested-by: Kevin O'Connor Signed-off-by: Paolo Bonzini --- bsd-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bsd-user') diff --git a/bsd-user/main.c b/bsd-user/main.c index 4ba61da896..0e8c26c137 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -1004,7 +1004,7 @@ int main(int argc, char **argv) #if defined(TARGET_I386) env->cr[0] = CR0_PG_MASK | CR0_WP_MASK | CR0_PE_MASK; - env->hflags |= HF_PE_MASK; + env->hflags |= HF_PE_MASK | HF_CPL_MASK; if (env->features[FEAT_1_EDX] & CPUID_SSE) { env->cr[4] |= CR4_OSFXSR_MASK; env->hflags |= HF_OSFXSR_MASK; -- cgit v1.2.1