Bug 832986

Summary: Incomplete "big real mode" emulation in kvm on older Intel hosts
Product: Red Hat Enterprise Linux 7 Reporter: Avi Kivity <avi>
Component: kernelAssignee: Paolo Bonzini <pbonzini>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.0CC: areis, avi, juzhang, knoel, pbonzini, tburke, xfu
Target Milestone: rcFlags: xfu: needinfo-
Target Release: 7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kernel 3.7-rc1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-13 11:22:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Avi Kivity 2012-06-18 10:59:24 UTC
Description of problem:

Pre-Westmere Intel processors (AMDs are not affected) cannot emulation so-called big real mode correctly.  It has been observed that some versions of Windows (OEM?) use big real mode, and thus will crash under these processors.

How reproducible:

Always

Steps to Reproduce:
1.  Install affected version of Windows on a pre-Westmere processor

Actual results:

KVM: entry failed, hardware error 0x80000021

If you're runnning a guest on an Intel machine without unrestricted mode
support, the failure can be most likely due to the guest entering an invalid
state for Intel VT. For example, the guest maybe running in big real mode
which is not supported on less recent Intel processors.

EAX=00000010 EBX=00000080 ECX=00000000 EDX=00000080
ESI=0025da4a EDI=0007da4a EBP=00001f20 ESP=00000200
EIP=0000009b EFL=00000002 [-------] CPL=3 II=0 A20=1 SMM=0 HLT=0
ES =0020 00000200 0000ffff 00009300
CS =b000 002b0000 0000ffff 0000f300
SS =0020 00000200 0000ffff 0000f300
DS =0020 00000200 0000ffff 00009300
FS =0020 00000200 0000ffff 00009300
GS =0020 00000200 0000ffff 00009300
LDT=0000 00000000 0000ffff 00008200
TR =0000 00000000 0000ffff 00008b00
GDT=     002b0000 00000027
IDT=     00000000 000003ff
CR0=00000010 CR2=00000000 CR3=00000000 CR4=00000000
DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000
DR3=0000000000000000
DR6=00000000ffff0ff0 DR7=0000000000000400
EFER=0000000000000000
Code=02 00 00 ea 91 00 00 00 18 00 0f 20 c0 66 83 e0 fe 0f 22 c0 <66> 31
c0 8e d8 8e c0 8e d0 66 bc 00 04 00 00 8e e0 8e e8 ea 00 00 00 20 00 00
00 20 4a da

Expected results:

No crash

Additional info:

Comment 3 Karen Noel 2012-10-20 15:43:30 UTC
Big real mode was mostly fixed in 3.6 kernel, but then more fixes were pulled into 3.7-rc1:

commit ecefbd94b834fa32559d854646d777c56749ef1c
Merge: ce57e98 3d11df7
Author: Linus Torvalds <torvalds>
Date:   Thu Oct 4 09:30:33 2012 -0700

    Merge tag 'kvm-3.7-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
    
    Pull KVM updates from Avi Kivity:
     "Highlights of the changes for this release include support for vfio
      level triggered interrupts, improved big real mode support on older
      Intels, a streamlines guest page table walker, guest APIC speedups,
      PIO optimizations, better overcommit handling, and read-only memory."

Comment 7 FuXiangChun 2014-03-10 10:14:05 UTC
verify this bug with 3.10.0-95.el7.x86_64 and qemu-kvm-rhev-1.5.3-49.el7.x86_64.

I tested three windows guests(win7 win8 and win2008) and  two scenarios to verify it. 

S1. Installed three windows guest with "-cpu Nehalem"

S2. Installed three windows guest with "-cpu SandyBridge"

Result:
Installation is successful. guest and host work well.


Host cpuinfo(It should be Pre-Westmere Intel processors)

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Xeon(R) CPU           E5205  @ 1.86GHz
stepping	: 6
microcode	: 0x60f
cpu MHz		: 1861.976
cache size	: 6144 KB
physical id	: 3
siblings	: 2
core id		: 1
cpu cores	: 2
apicid		: 7
initial apicid	: 7
fpu		: yes
fpu_exception	: yes
cpuid level	: 10
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca sse4_1 lahf_lm dtherm tpr_shadow vnmi flexpriority
bogomips	: 3723.85
clflush size	: 64
cache_alignment	: 64
address sizes	: 38 bits physical, 48 bits virtual
power management:



Avi,
Could you have a look at this test result above?  Base on this result.  Is this bug fixed?

Comment 8 FuXiangChun 2014-03-10 10:26:39 UTC
Hi Paolo,
would you please have a look at this test result in comment 7? Is this bug fixed?

Comment 9 Paolo Bonzini 2014-03-10 12:48:52 UTC
Yes, it is.

Comment 10 juzhang 2014-03-11 01:37:03 UTC
According to comment7 and comment9, set this issue as verified.

Comment 11 Ludek Smid 2014-06-13 11:22:56 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.