Skip to contentSkip to conversation

qemu-kvm-x86: fix e820 reservation

PATCH Marcelo Tosatti 1 participant 1 message Oct 25, 2010 KVM

lore
Share & tools
lore
#0 lore raw

e820 reserved range should start at 0xfeffc000, which includes the EPT identity page, not 0xfeffd000.

qemu-kvm-x86.c +8 -7
index ec7d419..20b7d6d 100644
@@ -32,13 +32,6 @@ extern unsigned int kvm_shadow_memory;
 int kvm_set_tss_addr(kvm_context_t kvm, unsigned long addr)
 {
     int r;
-    /*
-     * Tell fw_cfg to notify the BIOS to reserve the range.
-     */
-    if (e820_add_entry(addr, 0x4000, E820_RESERVED) < 0) {
-        perror("e820_add_entry() table is full");
-        exit(1);
-    }
 
     r = kvm_vm_ioctl(kvm_state, KVM_SET_TSS_ADDR, addr);
     if (r < 0) {
@@ -146,6 +139,14 @@ int kvm_arch_create(kvm_context_t kvm, unsigned long phys_mem_bytes,
         return r;
     }
 
+    /*
+     * Tell fw_cfg to notify the BIOS to reserve the range.
+     */
+    if (e820_add_entry(0xfeffc000, 0x4000, E820_RESERVED) < 0) {
+        perror("e820_add_entry() table is full");
+        exit(1);
+    }
+
     r = kvm_create_pit(kvm);
     if (r < 0) {
         return r;