Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Virtual 8086 mode
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==64-bit and VMX support== Virtual 8086 mode is not available in [[x86-64]] [[long mode]], although it is still present on x86-64 capable processors running in [[x86-64#Legacy mode|legacy mode]]. [[Intel VT-x]] brings back the ability to run virtual 8086 mode from x86-64 long mode, but it has to be done by transitioning the (physical) processor to VMX root mode and launching a logical (virtual) processor itself running in virtual 8086 mode.<ref>{{cite book|url=http://www.intel.com/Assets/en_US/PDF/manual/253669.pdf|title=Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3B: System Programming Guide, Part 2|page=29{{hyphen}}1|date=September 2009|publisher=[[Intel]]|quote=a VM entry is allowed only to guests with paging enabled that are in protected mode or in virtual-8086 mode. Guest execution in other processor operating modes need to be specially handled by the VMM|archive-url=https://web.archive.org/web/20100105142519/http://www.intel.com/Assets/en_US/PDF/manual/253669.pdf|archive-date=January 5, 2010}}; see also [http://www.cs.usfca.edu/~cruse/cs686s07/ CS 686: Special Topic: Intel EM64T and VT Extensions (Spring 2007)], [https://www.cs.usfca.edu/~cruse/cs686s07/lesson24.ppt lesson 24] how to do this from Linux (not that the code is pretty dated, so might not work as-is with current kernels) more up-to-date code can be found [http://opensecuritytraining.info/AdvancedX86-VTX.html here]. Also beware that this sample code is more complicated than strictly booting the logical processor in virtual 8086 mode; its ultimate goal is make some real-mode BIOS calls.</ref> [[Westmere (microarchitecture)|Westmere]] and later Intel processors usually<ref>{{cite web|url=http://ark.intel.com/Products/VirtualizationTechnology |title=Intel Virtualization Technology List |publisher=Ark.intel.com |access-date=2014-02-20 |quote=A list of Intel processors that support VT-x but not EPT|archive-url=https://web.archive.org/web/20140210004823/http://ark.intel.com/Products/VirtualizationTechnology|archive-date=2014-02-10|url-status=dead}}</ref> can start the virtual processor directly in real mode using the "unrestricted guest" feature (which itself requires [[Extended Page Table]]s); this method removes the need to resort to the nested virtual 8086 mode simply to run the legacy BIOS for booting.<ref>[http://2013.asiabsdcon.org/papers/abc2013-P5A-paper.pdf "Intel added unrestricted guest mode on Westmere micro-architecture and later Intel CPUs, it uses EPT to translate guest physical address access to host physical address. With this mode, VMEnter without enable paging is allowed."]</ref><ref>[http://download.intel.com/products/processor/manual/326019.pdf "If the “unrestricted guest” VM-execution control is 1, the “enable EPT” VM-execution control must also be 1"]</ref> [[AMD-V]] can do virtual 8086 mode in guests, too, but it can also just run the guest in "paged real mode" using the following steps: you create a SVM (Secure Virtual Machine) mode guest with CR0.PE=0, but CR0.PG=1 (that is, with protected mode disabled but paging enabled), which is ordinarily impossible, but is allowed for SVM guests if the host intercepts page faults.<ref>{{Cite book|last=|url=https://www.amd.com/system/files/TechDocs/24593.pdf#G21.1088365|title=AMD64 Architecture Programmer's Manual, Volume 2: System Programming|date=November 2021|publisher=[[Advanced Micro Devices]]|edition=|series=Rev. 3.38|pages=515–516|chapter=15.19 Paged Real Mode|quote=To facilitate virtualization of real mode, the VMRUN instruction may legally load a guest CR0 value with PE = 0 but PG = 1. Likewise, the RSM instruction is permitted to return to paged real mode. This processor mode behaves in every way like real mode, with the exception that paging is applied. The intent is that the VMM run the guest in paged-real mode at CPL0, and with page faults intercepted. The VMM is responsible for setting up a shadow page table that maps guest physical memory to the appropriate system physical addresses.<!-- paragraph break --> The behavior of running a guest in paged real mode without intercepting page faults to the VMM is undefined.}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)