From 2362e58509484fd7f6d54b42f224a73a53eb6374 Mon Sep 17 00:00:00 2001 From: Victor Sun Date: Tue, 23 Apr 2019 11:16:30 +0800 Subject: [PATCH] HV: correct usage of GUEST_FLAG_IO_COMPLETION_POLLING The guest flags of GUEST_FLAG_IO_COMPLETION_POLLING work for NORMAL_VM only; Tracked-On: #2291 Signed-off-by: Victor Sun Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/vm.c | 2 +- hypervisor/scenarios/logical_partition/vm_configurations.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hypervisor/arch/x86/guest/vm.c b/hypervisor/arch/x86/guest/vm.c index 762f44b6e..121327f26 100644 --- a/hypervisor/arch/x86/guest/vm.c +++ b/hypervisor/arch/x86/guest/vm.c @@ -430,7 +430,7 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_ /* Populate return VM handle */ *rtn_vm = vm; vm->sw.io_shared_page = NULL; - if ((vm_config->guest_flags & GUEST_FLAG_IO_COMPLETION_POLLING) != 0U) { + if ((vm_config->type == NORMAL_VM) && (vm_config->guest_flags & GUEST_FLAG_IO_COMPLETION_POLLING) != 0U) { /* enable IO completion polling mode per its guest flags in vm_config. */ vm->sw.is_completion_polling = true; } diff --git a/hypervisor/scenarios/logical_partition/vm_configurations.c b/hypervisor/scenarios/logical_partition/vm_configurations.c index 17ee5b002..6f4650aa1 100644 --- a/hypervisor/scenarios/logical_partition/vm_configurations.c +++ b/hypervisor/scenarios/logical_partition/vm_configurations.c @@ -22,7 +22,6 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { /* 26c5e0d8-8f8a-47d8-8109-f201ebd61a5e */ .pcpu_bitmap = VM0_CONFIG_PCPU_BITMAP, .cpu_num = VM0_CONFIG_NUM_CPUS, - .guest_flags = GUEST_FLAG_IO_COMPLETION_POLLING, .clos = 0U, .memory = { .start_hpa = VM0_CONFIG_MEM_START_HPA, @@ -50,7 +49,7 @@ struct acrn_vm_config vm_configs[CONFIG_MAX_VM_NUM] = { /* dd87ce08-66f9-473d-bc58-7605837f935e */ .pcpu_bitmap = VM1_CONFIG_PCPU_BITMAP, .cpu_num = VM1_CONFIG_NUM_CPUS, - .guest_flags = (GUEST_FLAG_RT | GUEST_FLAG_LAPIC_PASSTHROUGH | GUEST_FLAG_IO_COMPLETION_POLLING), + .guest_flags = (GUEST_FLAG_RT | GUEST_FLAG_LAPIC_PASSTHROUGH), .clos = 0U, .memory = { .start_hpa = VM1_CONFIG_MEM_START_HPA,