]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
i386/pc: Add e820 entry for SGX EPC section(s)
authorSean Christopherson <sean.j.christopherson@intel.com>
Mon, 19 Jul 2021 11:21:21 +0000 (19:21 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Sep 2021 13:30:24 +0000 (15:30 +0200)
Note that SGX EPC is currently guaranteed to reside in a single
contiguous chunk of memory regardless of the number of EPC sections.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Yang Zhong <yang.zhong@intel.com>
Message-Id: <20210719112136.57018-19-yang.zhong@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/pc.c

index e41c002539123f397291b46e275eb679a3a09d95..df457eceba8d43d40f3a65d7f0a7f0071a2abbab 100644 (file)
@@ -889,6 +889,10 @@ void pc_memory_init(PCMachineState *pcms,
         e820_add_entry(0x100000000ULL, x86ms->above_4g_mem_size, E820_RAM);
     }
 
+    if (pcms->sgx_epc.size != 0) {
+        e820_add_entry(pcms->sgx_epc.base, pcms->sgx_epc.size, E820_RESERVED);
+    }
+
     if (!pcmc->has_reserved_memory &&
         (machine->ram_slots ||
          (machine->maxram_size > machine->ram_size))) {