[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86: fix cpuid reporting on PVH Dom0



commit 41220bb7d5946d3a693863d364a089e69b968ec7
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Aug 4 13:46:54 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 4 13:46:54 2014 +0200

    x86: fix cpuid reporting on PVH Dom0

    dab11417d also caused some problems regarding HVM guest creation on
    PVH Dom0, mainly the CR4 mask returned by hvm_cr4_guest_reserved_bits
    changed from 0xfffffffffffff800 to 0xfffffffffffff893, which means HVM
    guests created from a PVH Dom0 are unable to set VME, PVI, PSE or PGE
    CR4 flags.

    This is because cpuid on PVH guests mask PSE, PGE, PSE36 and VME
    flags, so the white listing done in xc_cpuid_hvm_policy doesn't enable
    those features, and the guest ends up with a very restrictive cpuid
    policy.

    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/traps.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index 677074b..71be2ae 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -803,12 +803,16 @@ void pv_cpuid(struct cpu_user_regs *regs)
     if ( (regs->eax & 0x7fffffff) == 0x00000001 )
     {
         /* Modify Feature Information. */
-        __clear_bit(X86_FEATURE_VME, &d);
         if ( !cpu_has_apic )
             __clear_bit(X86_FEATURE_APIC, &d);
-        __clear_bit(X86_FEATURE_PSE, &d);
-        __clear_bit(X86_FEATURE_PGE, &d);
-        __clear_bit(X86_FEATURE_PSE36, &d);
+
+        if ( !is_pvh_vcpu(curr) )
+        {
+            __clear_bit(X86_FEATURE_PSE, &d);
+            __clear_bit(X86_FEATURE_PGE, &d);
+            __clear_bit(X86_FEATURE_PSE36, &d);
+            __clear_bit(X86_FEATURE_VME, &d);
+        }
     }

     switch ( (uint32_t)regs->eax )
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.