hv: Device MSIs in partition mode ACRN

VMs in partition mode uses a kernel patch to switch to physical mode xAPIC.
The kernel patch together with this patch makes sure device MSIs use
physical mode as DM and physical APIC IDs in Destination field.

Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com>
This commit is contained in:
Sainath Grandhi
2018-08-23 12:24:49 -07:00
committed by lijinxia
parent ef1a730230
commit c102c44c16
3 changed files with 14 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ struct mptable_info mptable_vm1 = {
},
{
.type = MPCT_ENTRY_PROCESSOR,
.apic_id = 1U,
.apic_id = 4U,
.apic_version = LAPIC_VERSION,
.cpu_flags = PROCENTRY_FLAG_EN,
.cpu_signature = MPEP_SIG,
@@ -232,7 +232,7 @@ struct mptable_info mptable_vm2 = {
.proc_entry_array = {
{
.type = MPCT_ENTRY_PROCESSOR,
.apic_id = 0U,
.apic_id = 6U,
.apic_version = LAPIC_VERSION,
.cpu_flags = PROCENTRY_FLAG_EN | PROCENTRY_FLAG_BP,
.cpu_signature = MPEP_SIG,
@@ -240,7 +240,7 @@ struct mptable_info mptable_vm2 = {
},
{
.type = MPCT_ENTRY_PROCESSOR,
.apic_id = 1U,
.apic_id = 2U,
.apic_version = LAPIC_VERSION,
.cpu_flags = PROCENTRY_FLAG_EN,
.cpu_signature = MPEP_SIG,

View File

@@ -170,12 +170,21 @@ vlapic_build_id(struct acrn_vlapic *vlapic)
uint8_t vlapic_id;
uint32_t lapic_regs_id;
#ifdef CONFIG_PARTITION_MODE
/*
* Partition mode UOS is forced to use physical mode in xAPIC
* Hence ACRN needs to maintain physical APIC ids for partition
* mode.
*/
vlapic_id = per_cpu(lapic_id, vcpu->pcpu_id);
#else
if (is_vm0(vcpu->vm)) {
/* Get APIC ID sequence format from cpu_storage */
vlapic_id = per_cpu(lapic_id, vcpu->vcpu_id);
} else {
vlapic_id = (uint8_t)vcpu->vcpu_id;
}
#endif
lapic_regs_id = (uint32_t)vlapic_id << APIC_ID_SHIFT;