[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 12/13] hw/acpi: disable modern CPU hotplug interface for mirr
From: |
Ashish Kalra |
Subject: |
[RFC PATCH 12/13] hw/acpi: disable modern CPU hotplug interface for mirror vcpu's |
Date: |
Mon, 16 Aug 2021 13:31:15 +0000 |
From: Ashish Kalra <ashish.kalra@amd.com>
OVMF expects both fw_cfg and the modern CPU hotplug interface to
return the same boot CPU count. We reduce the fw_cfg boot cpu count
with number of mirror vcpus's. This fails the OVMF sanity check
as fw_cfg boot cpu count and modern CPU hotplug interface boot
count don't match, hence disable the modern CPU hotplug interface.
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
---
hw/acpi/cpu.c | 11 ++++++++++-
include/hw/acpi/cpu.h | 1 +
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/hw/acpi/cpu.c b/hw/acpi/cpu.c
index 8ac2fd018e..6cfaf2b450 100644
--- a/hw/acpi/cpu.c
+++ b/hw/acpi/cpu.c
@@ -86,7 +86,12 @@ static uint64_t cpu_hotplug_rd(void *opaque, hwaddr addr,
unsigned size)
case ACPI_CPU_CMD_DATA2_OFFSET_R:
switch (cpu_st->command) {
case CPHP_GET_NEXT_CPU_WITH_EVENT_CMD:
- val = 0;
+ /* Disabling modern CPUHP interface for mirror vCPU support */
+ if (!cpu_st->mirror_vcpu_enabled) {
+ val = 0;
+ } else {
+ val = -1ULL;
+ }
break;
case CPHP_GET_CPU_ID_CMD:
val = cdev->arch_id >> 32;
@@ -226,6 +231,10 @@ void cpu_hotplug_hw_init(MemoryRegion *as, Object *owner,
state->dev_count = id_list->len;
state->devs = g_new0(typeof(*state->devs), state->dev_count);
for (i = 0; i < id_list->len; i++) {
+ /* Disabling modern CPUHP interface for mirror vCPU support */
+ if (id_list->cpus[i].mirror_vcpu) {
+ state->mirror_vcpu_enabled = TRUE;
+ }
state->devs[i].cpu = CPU(id_list->cpus[i].cpu);
state->devs[i].arch_id = id_list->cpus[i].arch_id;
}
diff --git a/include/hw/acpi/cpu.h b/include/hw/acpi/cpu.h
index 999caaf510..e7949e86b8 100644
--- a/include/hw/acpi/cpu.h
+++ b/include/hw/acpi/cpu.h
@@ -33,6 +33,7 @@ typedef struct CPUHotplugState {
uint8_t command;
uint32_t dev_count;
AcpiCpuStatus *devs;
+ bool mirror_vcpu_enabled;
} CPUHotplugState;
void acpi_cpu_plug_cb(HotplugHandler *hotplug_dev,
--
2.17.1
- [RFC PATCH 02/13] hw/boards: Add mirror_vcpu flag to CPUArchId, (continued)
- [RFC PATCH 02/13] hw/boards: Add mirror_vcpu flag to CPUArchId, Ashish Kalra, 2021/08/16
- [RFC PATCH 03/13] hw/i386: Mark mirror vcpus in possible_cpus, Ashish Kalra, 2021/08/16
- [RFC PATCH 04/13] hw/acpi: Don't include mirror vcpus in ACPI tables, Ashish Kalra, 2021/08/16
- [RFC PATCH 05/13] cpu: Add boolean mirror_vcpu field to CPUState, Ashish Kalra, 2021/08/16
- [RFC PATCH 06/13] hw/i386: Set CPUState.mirror_vcpu=true for mirror vcpus, Ashish Kalra, 2021/08/16
- [RFC PATCH 07/13] kvm: Add Mirror VM ioctl and enable cap interfaces., Ashish Kalra, 2021/08/16
- [RFC PATCH 08/13] kvm: Add Mirror VM support., Ashish Kalra, 2021/08/16
- [RFC PATCH 09/13] kvm: create Mirror VM and share primary VM's encryption context., Ashish Kalra, 2021/08/16
- [RFC PATCH 10/13] softmmu/cpu: Skip mirror vcpu's for pause, resume and synchronization., Ashish Kalra, 2021/08/16
- [RFC PATCH 11/13] kvm/apic: Disable in-kernel APIC support for mirror vcpu's., Ashish Kalra, 2021/08/16
- [RFC PATCH 12/13] hw/acpi: disable modern CPU hotplug interface for mirror vcpu's,
Ashish Kalra <=
- [RFC PATCH 13/13] hw/i386/pc: reduce fw_cfg boot cpu count taking into account mirror vcpu's., Ashish Kalra, 2021/08/16
- Re: [RFC PATCH 00/13] Add support for Mirror VM., Claudio Fontana, 2021/08/16
- Re: [RFC PATCH 00/13] Add support for Mirror VM., Paolo Bonzini, 2021/08/16
- Re: [RFC PATCH 00/13] Add support for Mirror VM., Ashish Kalra, 2021/08/16