[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 11/14] hw/i386/vmport: Allow x2apic without IR
From: |
Liran Alon |
Subject: |
[PATCH 11/14] hw/i386/vmport: Allow x2apic without IR |
Date: |
Tue, 10 Mar 2020 01:54:08 +0200 |
Signal to guest that hypervisor supports x2apic without VT-d/IOMMU
Interrupt-Remapping support. This allows guest to use x2apic in
case all APIC IDs fits in 8-bit (i.e. Max APIC ID < 255).
See Linux kernel commit 4cca6ea04d31 ("x86/apic: Allow x2apic
without IR on VMware platform") and Linux try_to_enable_x2apic()
function.
Reviewed-by: Nikita Leshenko <address@hidden>
Signed-off-by: Liran Alon <address@hidden>
---
hw/i386/vmport.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c
index b33ef9c01d65..2b0a623f19c1 100644
--- a/hw/i386/vmport.c
+++ b/hw/i386/vmport.c
@@ -182,7 +182,14 @@ static uint32_t vmport_cmd_time_full(void *opaque,
uint32_t addr)
static uint32_t vmport_cmd_get_vcpu_info(void *opaque, uint32_t addr)
{
- return (1 << VCPU_INFO_RESERVED_BIT);
+ X86CPU *cpu = X86_CPU(current_cpu);
+ uint32_t ret = 0;
+
+ if (cpu->env.features[FEAT_1_ECX] & CPUID_EXT_X2APIC) {
+ ret |= 1 << VCPU_INFO_LEGACY_X2APIC_BIT;
+ }
+
+ return ret;
}
/* vmmouse helpers */
--
2.20.1
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, (continued)
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Michael S. Tsirkin, 2020/03/10
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Liran Alon, 2020/03/10
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Michael S. Tsirkin, 2020/03/10
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Liran Alon, 2020/03/10
- Re: [PATCH 05/14] hw/i386/vmport: Report VMX type in CMD_GETVERSION, Michael S. Tsirkin, 2020/03/10
[PATCH 09/14] hw/i386/vmport: Add support for CMD_GETTIMEFULL, Liran Alon, 2020/03/09
[PATCH 10/14] hw/i386/vmport: Add support for CMD_GET_VCPU_INFO, Liran Alon, 2020/03/09
[PATCH 11/14] hw/i386/vmport: Allow x2apic without IR,
Liran Alon <=
[PATCH 12/14] i386/cpu: Store LAPIC bus frequency in CPU structure, Liran Alon, 2020/03/09
[PATCH 14/14] hw/i386/vmport: Assert vmport initialized before registering commands, Liran Alon, 2020/03/09
[PATCH 13/14] hw/i386/vmport: Add support for CMD_GETHZ, Liran Alon, 2020/03/09
[PATCH 06/14] hw/i386/vmport: Define enum for all commands, Liran Alon, 2020/03/09