<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Virtual 8086 mode guest in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859904#M7511</link>
    <description>You should ensure requirements for virtual-8086 guest state are satisfied. These requirements are described in software developer manual, 3b, chapter "CHECKING AND LOADING GUEST STATE".&lt;BR /&gt;&lt;BR /&gt;VM entry failure can be determined by exit reason with bit 31 set.&lt;BR /&gt;&lt;BR /&gt;The best way to determine what happens inside the guest is writing such code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void vmexit_handler()&lt;BR /&gt;{&lt;BR /&gt; if (0x80000000 &amp;amp; vmread(EXIT_REASON)) /* check for VM entry failure */&lt;BR /&gt; {&lt;BR /&gt; printk("VM entry failuren");&lt;BR /&gt; validate_vmcs();&lt;BR /&gt; }&lt;BR /&gt; ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* Check VMCS for requirements for host and guest state from SDM 3B */&lt;BR /&gt;void validate_vmcs()&lt;BR /&gt;{&lt;BR /&gt; ...&lt;BR /&gt; if (vmread(GUEST_RFLAGS) &amp;amp; RFLAGS_VM)&lt;BR /&gt; {&lt;BR /&gt; /* Conditions for virtual 8086 from SDM 3B &lt;BR /&gt; * Access-rights fields. CS, SS, DS, ES, FS, GS. &lt;BR /&gt; * If the guest will be virtual-8086, the field must be 000000F3H. */&lt;BR /&gt; ASSERT(vmread(GUEST_CS_ACCESS_RIGHTS) == 0xf3);&lt;BR /&gt; ASSERT(vmread(GUEST_DS_ACCESS_RIGHTS) == 0xf3);&lt;BR /&gt; ...&lt;BR /&gt; /* Base-address fields. CS, SS, DS, ES, FS, GS. &lt;BR /&gt; * If the guest will be virtual-8086, the address must be &lt;BR /&gt; * the selector field shifted left 4 bits (multiplied by 16). */		 &lt;BR /&gt; ASSERT(vmread(GUEST_CS_BASE) == vmread(GUEST_CS_SEL) &amp;lt;&amp;lt; 4);&lt;BR /&gt; ASSERT(vmread(GUEST_DS_BASE) == vmread(GUEST_DS_SEL) &amp;lt;&amp;lt; 4);&lt;BR /&gt; ...&lt;BR /&gt; /* And so on. All conditions must be met. */&lt;BR /&gt; }&lt;BR /&gt; ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this will help.&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 29 Sep 2009 19:54:33 GMT</pubDate>
    <dc:creator>hellfire</dc:creator>
    <dc:date>2009-09-29T19:54:33Z</dc:date>
    <item>
      <title>Virtual 8086 mode guest</title>
      <link>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859902#M7509</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have a system running Core i7 920 with VT enabled in the BIOS. I am trying to write&lt;BR /&gt;a simple hypervisor which sets up a context for a guest in Virtual 8086 mode. However,&lt;BR /&gt;when I set the VM bit (for Virtual 8086 mode) in the VMCS RFLAGS register and launch&lt;BR /&gt;the guest ( value of RFLAGS I am using is 0x0000000000020002) , the system seems to &lt;BR /&gt;be frozen (probably a VMX abort?). I dont have access&lt;BR /&gt;to a hardware debugger and hence cannot be sure whether it is a VMX abort or what&lt;BR /&gt;the abort code is.&lt;BR /&gt;&lt;BR /&gt;However, I have success in launching a 32-bit protected mode guest with paging and &lt;BR /&gt;am even able to communicate with the hypervisor using VMCALLs from the 32-bit guest. &lt;BR /&gt;So, I am inclined to think that it is not failing due to a VMX abort when launching the&lt;BR /&gt;V86 guest. &lt;BR /&gt;&lt;BR /&gt;I have even tried to launch a 32-bit guest and within that have setup a&lt;BR /&gt;V86 stack frame and tried to do a IRET to that with EFLAGS VM set. That also has&lt;BR /&gt;the same effect in the system being frozen when IRET executes. I am not sure &lt;BR /&gt;what I am missing in setting up a V86 guest. Any help will be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Sep 2009 17:56:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859902#M7509</guid>
      <dc:creator>drav007</dc:creator>
      <dc:date>2009-09-28T17:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: Virtual 8086 mode guest</title>
      <link>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859903#M7510</link>
      <description>&lt;DIV style="margin:0px;"&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Just to add to my previous question. The V86 mode code I am trying to execute&lt;BR /&gt;basically writes the character 'A' to the video frame buffer at 0xB800:0000 and&lt;BR /&gt;ends with a HLT instruction. I am trying to run this test code with interrupts&lt;BR /&gt;disabled and hoping to get a General Protection Fault (GPF) when the HLT instruction&lt;BR /&gt;executes in V86 mode. However, the letter 'A' doesnt get printed and nor do I&lt;BR /&gt;receive a GPF (I have the IDT handlers setup and have verified that they work correctly &lt;BR /&gt;when the guest is in 32-bit mode). &lt;BR /&gt;&lt;BR /&gt;I also tried a simple VMCALL instruction as a test code within the V86 guest. However,&lt;BR /&gt;that doesnt produce a VMEXIT. So I am pretty sure that the V86 mode is not established&lt;BR /&gt;by the processor as it doesnt seem to execute any instruction. Further, there are no&lt;BR /&gt;VMEXITs and the CPU simply appears frozen. That is one of the reasons I thought it&lt;BR /&gt;might be a VMX abort. But what is more confusing is thatI have verified the hypervisor&lt;BR /&gt;with a 32-bit guest and it doesnt generate a VMX abort at any time and as per the&lt;BR /&gt;intel docs thereis no V86 guest mode specific VMX abort. So I am not sure what is&lt;BR /&gt;happening here!&lt;/DIV&gt;
&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Sep 2009 18:05:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859903#M7510</guid>
      <dc:creator>drav007</dc:creator>
      <dc:date>2009-09-28T18:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Virtual 8086 mode guest</title>
      <link>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859904#M7511</link>
      <description>You should ensure requirements for virtual-8086 guest state are satisfied. These requirements are described in software developer manual, 3b, chapter "CHECKING AND LOADING GUEST STATE".&lt;BR /&gt;&lt;BR /&gt;VM entry failure can be determined by exit reason with bit 31 set.&lt;BR /&gt;&lt;BR /&gt;The best way to determine what happens inside the guest is writing such code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;void vmexit_handler()&lt;BR /&gt;{&lt;BR /&gt; if (0x80000000 &amp;amp; vmread(EXIT_REASON)) /* check for VM entry failure */&lt;BR /&gt; {&lt;BR /&gt; printk("VM entry failuren");&lt;BR /&gt; validate_vmcs();&lt;BR /&gt; }&lt;BR /&gt; ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;/* Check VMCS for requirements for host and guest state from SDM 3B */&lt;BR /&gt;void validate_vmcs()&lt;BR /&gt;{&lt;BR /&gt; ...&lt;BR /&gt; if (vmread(GUEST_RFLAGS) &amp;amp; RFLAGS_VM)&lt;BR /&gt; {&lt;BR /&gt; /* Conditions for virtual 8086 from SDM 3B &lt;BR /&gt; * Access-rights fields. CS, SS, DS, ES, FS, GS. &lt;BR /&gt; * If the guest will be virtual-8086, the field must be 000000F3H. */&lt;BR /&gt; ASSERT(vmread(GUEST_CS_ACCESS_RIGHTS) == 0xf3);&lt;BR /&gt; ASSERT(vmread(GUEST_DS_ACCESS_RIGHTS) == 0xf3);&lt;BR /&gt; ...&lt;BR /&gt; /* Base-address fields. CS, SS, DS, ES, FS, GS. &lt;BR /&gt; * If the guest will be virtual-8086, the address must be &lt;BR /&gt; * the selector field shifted left 4 bits (multiplied by 16). */		 &lt;BR /&gt; ASSERT(vmread(GUEST_CS_BASE) == vmread(GUEST_CS_SEL) &amp;lt;&amp;lt; 4);&lt;BR /&gt; ASSERT(vmread(GUEST_DS_BASE) == vmread(GUEST_DS_SEL) &amp;lt;&amp;lt; 4);&lt;BR /&gt; ...&lt;BR /&gt; /* And so on. All conditions must be met. */&lt;BR /&gt; }&lt;BR /&gt; ...&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hope this will help.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 29 Sep 2009 19:54:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Virtual-8086-mode-guest/m-p/859904#M7511</guid>
      <dc:creator>hellfire</dc:creator>
      <dc:date>2009-09-29T19:54:33Z</dc:date>
    </item>
  </channel>
</rss>

