target-i386: introduce support for 1 GB pages
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 4 Apr 2014 06:12:28 +0000 (08:12 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 5 Jun 2014 14:10:34 +0000 (16:10 +0200)
Given the simplifications to the code in the previous patches, this
is now very simple to do.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target-i386/cpu.c
target-i386/helper.c

index 042a48d70301c6659a7dd456056e3935ff3e08f2..0f400d4011b60dd7438bfd5b803b50afe8236437 100644 (file)
@@ -569,9 +569,7 @@ struct X86CPUDefinition {
           CPUID_EXT_RDRAND */
 #define TCG_EXT2_FEATURES ((TCG_FEATURES & CPUID_EXT2_AMD_ALIASES) | \
           CPUID_EXT2_NX | CPUID_EXT2_MMXEXT | CPUID_EXT2_RDTSCP | \
-          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT)
-          /* missing:
-          CPUID_EXT2_PDPE1GB */
+          CPUID_EXT2_3DNOW | CPUID_EXT2_3DNOWEXT | CPUID_EXT2_PDPE1GB)
 #define TCG_EXT3_FEATURES (CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM | \
           CPUID_EXT3_CR8LEG | CPUID_EXT3_ABM | CPUID_EXT3_SSE4A)
 #define TCG_SVM_FEATURES 0
index d09e1c8ba8b8b4f120224605dec0672d4de6f34f..5a5036494b873cf765e9663a9a7d1fba97f9dc6d 100644 (file)
@@ -605,6 +605,13 @@ int x86_cpu_handle_mmu_fault(CPUState *cs, vaddr addr,
                 pdpe |= PG_ACCESSED_MASK;
                 stl_phys_notdirty(cs->as, pdpe_addr, pdpe);
             }
+            if (pdpe & PG_PSE_MASK) {
+                /* 1 GB page */
+                page_size = 1024 * 1024 * 1024;
+                pte_addr = pdpe_addr;
+                pte = pdpe;
+                goto do_check_protect;
+            }
         } else
 #endif
         {