dm: adapt mptable generation for VM with lapic pt

- don't generate io apic entry for vm with lapic pt.

Tracked-On: #2351
Signed-off-by: Yan, Like <like.yan@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yan, Like 2018-12-23 16:08:46 +08:00 committed by wenlingz
parent e2cecfb560
commit 8925da64d9
3 changed files with 14 additions and 9 deletions

View File

@ -88,6 +88,7 @@ char *elf_file_name;
uint8_t trusty_enabled; uint8_t trusty_enabled;
char *mac_seed; char *mac_seed;
bool stdio_in_use; bool stdio_in_use;
bool lapic_pt;
static int virtio_msix = 1; static int virtio_msix = 1;
static bool debugexit_enabled; static bool debugexit_enabled;

View File

@ -335,16 +335,19 @@ mptable_build(struct vmctx *ctx, int ncpu)
curraddr += sizeof(*mpeb) * MPE_NUM_BUSES; curraddr += sizeof(*mpeb) * MPE_NUM_BUSES;
mpch->entry_count += MPE_NUM_BUSES; mpch->entry_count += MPE_NUM_BUSES;
mpei = (io_apic_entry_ptr)curraddr; /* Don't generate io_apic entry for VM with lapic pt */
mpt_build_ioapic_entries(mpei, 0); if (!lapic_pt) {
curraddr += sizeof(*mpei); mpei = (io_apic_entry_ptr)curraddr;
mpch->entry_count++; mpt_build_ioapic_entries(mpei, 0);
curraddr += sizeof(*mpei);
mpch->entry_count++;
mpie = (int_entry_ptr) curraddr; mpie = (int_entry_ptr) curraddr;
ioints = mpt_count_ioint_entries(); ioints = mpt_count_ioint_entries();
mpt_build_ioint_entries(mpie, 0); mpt_build_ioint_entries(mpie, 0);
curraddr += sizeof(*mpie) * ioints; curraddr += sizeof(*mpie) * ioints;
mpch->entry_count += ioints; mpch->entry_count += ioints;
}
mpie = (int_entry_ptr)curraddr; mpie = (int_entry_ptr)curraddr;
mpt_build_localint_entries(mpie); mpt_build_localint_entries(mpie);

View File

@ -45,6 +45,7 @@ extern char *elf_file_name;
extern char *vmname; extern char *vmname;
extern bool stdio_in_use; extern bool stdio_in_use;
extern char *mac_seed; extern char *mac_seed;
extern bool lapic_pt;
int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req, int vmexit_task_switch(struct vmctx *ctx, struct vhm_request *vhm_req,
int *vcpu); int *vcpu);