Skip to content

Commit d0eb83a

Browse files
jsun26intelwenlingz
authored andcommitted
HV: move Kconfig IOREQ_POLLING to acrn vm config
Previously I/O emulation completion mode mode was configured in Kconfig: config IOREQ_NOTIFICATION bool "Notification mode" help When I/O request is completed, SOS will mark the completion status and notify hypervisor via hypercall. Hypervisor will finish the post work when notification is received. config IOREQ_POLLING bool "Polling mode" help When I/O request is completed, SOS will only mark completion status without notifying hypervisor. Hypervisor will poll the completion status and finish the post work. Now move this configuration to guest_flags of acrn_vm_config struct. if ((vm_config->guest_flags & IO_COMPLETION_POLLING) != 0U) { I/O with polling; } else { I/O with notification; } Tracked-On: #2291 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 6584b54 commit d0eb83a

File tree

4 files changed

+8
-29
lines changed

4 files changed

+8
-29
lines changed

hypervisor/arch/x86/Kconfig

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,28 +40,6 @@ config PARTITION_MODE
4040

4141
endchoice
4242

43-
choice
44-
prompt "I/O emulation completion mode"
45-
default IOREQ_NOTIFICATION
46-
help
47-
Select the mode of I/O emulation completion
48-
49-
config IOREQ_NOTIFICATION
50-
bool "Notification mode"
51-
help
52-
When I/O request is completed, SOS will mark the completion status and
53-
notify hypervisor via hypercall. Hypervisor will finish the post work
54-
when notification is received.
55-
56-
config IOREQ_POLLING
57-
bool "Polling mode"
58-
help
59-
When I/O request is completed, SOS will only mark completion status
60-
without notifying hypervisor. Hypervisor will poll the completion
61-
status and finish the post work.
62-
63-
endchoice
64-
6543
config BOARD
6644
string "Target board"
6745
help

hypervisor/arch/x86/guest/vm.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ int32_t create_vm(uint16_t vm_id, struct acrn_vm_config *vm_config, struct acrn_
226226
/* Populate return VM handle */
227227
*rtn_vm = vm;
228228
vm->sw.io_shared_page = NULL;
229-
#ifdef CONFIG_IOREQ_POLLING
230-
/* Now, enable IO completion polling mode for all VMs with CONFIG_IOREQ_POLLING. */
231-
vm->sw.is_completion_polling = true;
232-
#endif
229+
if ((vm_config->guest_flags & IO_COMPLETION_POLLING) != 0U) {
230+
/* enable IO completion polling mode per its guest flags in vm_config. */
231+
vm->sw.is_completion_polling = true;
232+
}
233233
status = set_vcpuid_entries(vm);
234234
if (status == 0) {
235235
vm->state = VM_CREATED;

hypervisor/partition/apl-mrb/vm_description.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ struct vm_config_arraies vm_config_partition = {
143143
{
144144
.type = PRE_LAUNCHED_VM,
145145
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2)),
146+
.guest_flags = IO_COMPLETION_POLLING,
146147
.memory.start_hpa = 0x100000000UL,
147148
.memory.size = 0x20000000UL, /* uses contiguous memory from host */
148149
.vm_vuart = true,
@@ -155,7 +156,7 @@ struct vm_config_arraies vm_config_partition = {
155156
{
156157
.type = PRE_LAUNCHED_VM,
157158
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3)),
158-
.guest_flags = LAPIC_PASSTHROUGH,
159+
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
159160
.memory.start_hpa = 0x120000000UL,
160161
.memory.size = 0x20000000UL, /* uses contiguous memory from host */
161162
.vm_vuart = true,

hypervisor/partition/dnv-cb2/vm_description.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ struct vm_config_arraies vm_config_partition = {
177177
{
178178
.type = PRE_LAUNCHED_VM,
179179
.pcpu_bitmap = (PLUG_CPU(0) | PLUG_CPU(2) | PLUG_CPU(4) | PLUG_CPU(6)),
180-
.guest_flags = LAPIC_PASSTHROUGH,
180+
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
181181
.memory.start_hpa = 0x100000000UL,
182182
.memory.size = 0x80000000UL, /* uses contiguous memory from host */
183183
.vm_vuart = true,
@@ -190,7 +190,7 @@ struct vm_config_arraies vm_config_partition = {
190190
{
191191
.type = PRE_LAUNCHED_VM,
192192
.pcpu_bitmap = (PLUG_CPU(1) | PLUG_CPU(3) | PLUG_CPU(5) | PLUG_CPU(7)),
193-
.guest_flags = LAPIC_PASSTHROUGH,
193+
.guest_flags = LAPIC_PASSTHROUGH | IO_COMPLETION_POLLING,
194194
.memory.start_hpa = 0x180000000UL,
195195
.memory.size = 0x80000000UL, /* uses contiguous memory from host */
196196
.vm_vuart = true,

0 commit comments

Comments
 (0)