Skip to contentSkip to conversation

Issue #2294 | Machine microvm doesn't run under Xen accel for x86_64

PATCH In review Will Gyda 3 participants 6 messages May 28, 2024 – May 29, 2024

lore
Share & tools
lore

Will Gyda

author
#0 lore raw

PATCH 1/1 Issue #2294 | Machine microvm doesn't run under Xen accel for x86_64

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64.
Solution: microvm is now not build if only Xen is available.

---
 configs/devices/i386-softmmu/default.mak | 2 +-
 hw/i386/Kconfig                          | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +1 -1
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@
 CONFIG_ISAPC=y
 CONFIG_I440FX=y
 CONFIG_Q35=y
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n
hw/i386/Kconfig +2 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 
 config MICROVM
     bool
+    default y
+    depends on KVM || WHPX || NVMM || HVF
     select SERIAL_ISA # for serial_hds_isa_init()
     select ISA_BUS
     select APIC
Signature · 1 line
2.25.1
#1 lore raw
Quoted 2 lines · Will Gyda

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64.
Solution: microvm is now not build if only Xen is available.

This does not fix the issue that microvm does not start with a Xen accelerator. I think it would be better to try and make it work instead.

Paolo

Quoted 30 lines
---
  configs/devices/i386-softmmu/default.mak | 2 +-
  hw/i386/Kconfig                          | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +1 -1
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@
  CONFIG_ISAPC=y
  CONFIG_I440FX=y
  CONFIG_Q35=y
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n
hw/i386/Kconfig +2 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 
  config MICROVM
      bool
+    default y
+    depends on KVM || WHPX || NVMM || HVF
      select SERIAL_ISA # for serial_hds_isa_init()
      select ISA_BUS
      select APIC
#2 lore raw

@philmd commented on gitlab: Discussed with @epilys on IRC, only Xen machines (xenpv/xenfv) configure Xen so can run under it.

But if we want to make it work under Xen. Any ideas how to move in that direction?

Quoted 41 lines · Paolo Bonzini
Quoted 2 lines · Will Gyda

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64.
Solution: microvm is now not build if only Xen is available.

This does not fix the issue that microvm does not start with a Xen accelerator. I think it would be better to try and make it work instead.

Paolo

Quoted 30 lines
---
  configs/devices/i386-softmmu/default.mak | 2 +-
  hw/i386/Kconfig                          | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +1 -1
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@
  CONFIG_ISAPC=y
  CONFIG_I440FX=y
  CONFIG_Q35=y
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n
hw/i386/Kconfig +2 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 
  config MICROVM
      bool
+    default y
+    depends on KVM || WHPX || NVMM || HVF
      select SERIAL_ISA # for serial_hds_isa_init()
      select ISA_BUS
      select APIC
#3 lore raw
Quoted 6 lines · Vilhelm Gyda

@philmd commented on gitlab: Discussed with @epilys on IRC, only Xen machines (xenpv/xenfv) configure Xen so can run under it.

But if we want to make it work under Xen. Any ideas how to move in that direction?

We'd have to specify what "works under Xen" means; xen as a type 1 hypervisor? I am trying to think if it makes sense, Xen machines in qemu already provide PV devices analogously to what microvm promises to support. What would be the use case for a "hypervisor agnostic" microvm machine?

Quoted 44 lines · Paolo Bonzini
Quoted 41 lines · Will Gyda
Quoted 2 lines

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64.
Solution: microvm is now not build if only Xen is available.

This does not fix the issue that microvm does not start with a Xen accelerator. I think it would be better to try and make it work instead.

Paolo

Quoted 30 lines
---
  configs/devices/i386-softmmu/default.mak | 2 +-
  hw/i386/Kconfig                          | 2 ++
  2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +1 -1
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@
  CONFIG_ISAPC=y
  CONFIG_I440FX=y
  CONFIG_Q35=y
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n
hw/i386/Kconfig +2 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 
  config MICROVM
      bool
+    default y
+    depends on KVM || WHPX || NVMM || HVF
      select SERIAL_ISA # for serial_hds_isa_init()
      select ISA_BUS
      select APIC
Signature · 2 lines
Manos Pitsidianakis
Emulation and Virtualization Engineer at Linaro Ltd
#4 lore raw
In reply to Will Gyda
Quoted 4 lines · Will Gyda

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64. Solution: microvm is now not build if only Xen is available.

I suggest rewording the commit title to something like

"i386: remove microvm from default build"

And adding a commit message that explains that the microvm does not work on Xen, hence if only Xen is available it should not be built.

Also, you can add a

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2294

line before your Signed-off-by. See https://www.qemu.org/docs/master/devel/submitting-a-patch.html

But, seeing the issue itself, it's about the microvm being stuck under Xen. So the commit that resolves this would either make it non-stuck or make it impossible to start the vm to begin with.

Quoted 13 lines

---
configs/devices/i386-softmmu/default.mak | 2 +-
hw/i386/Kconfig | 2 ++

2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +0 -0
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@

CONFIG_ISAPC=y
CONFIG_I440FX=y
CONFIG_Q35=y

configs/devices/i386-softmmu/default.mak line 32

Quoted 2 lines
configs/devices/i386-softmmu/default.mak +1 -1
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n

Better remove this altogether since it's not a default anymore.

hw/i386/Kconfig config Q35 · line 112

Quoted 10 lines
hw/i386/Kconfig +0 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 

config MICROVM
bool

hw/i386/Kconfig +2 -0
+    default y
+    depends on KVM || WHPX || NVMM || HVF

What about TCG? Will it be available if we only build with tcg?

Quoted 7 lines

select SERIAL_ISA # for serial_hds_isa_init()
select ISA_BUS
select APIC

Signature · 1 line
2.25.1
#5 lore raw
Quoted 1 line · Manos Pitsidianakis

What about TCG? Will it be available if we only build with tcg?

I will try doing this, and report back, and will make the suggested changes, and re-submit.

Quoted 66 lines · Manos Pitsidianakis
Quoted 5 lines · Will Gyda

Issue #2294: Machine microvm doesn't run under Xen accel for qemu-system-x86_64.
Solution: microvm is now not build if only Xen is available.

I suggest rewording the commit title to something like

"i386: remove microvm from default build"

And adding a commit message that explains that the microvm does not work on Xen, hence if only Xen is available it should not be built.

Also, you can add a

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2294

line before your Signed-off-by. See
https://www.qemu.org/docs/master/devel/submitting-a-patch.html

But, seeing the issue itself, it's about the microvm being stuck under Xen. So the commit that resolves this would either make it non-stuck or make it impossible to start the vm to begin with.

Quoted 13 lines

---
configs/devices/i386-softmmu/default.mak | 2 +-
hw/i386/Kconfig | 2 ++

2 files changed, 3 insertions(+), 1 deletion(-)
configs/devices/i386-softmmu/default.mak +0 -0
index 598c6646df..6a73aee7dd 100644
@@ -29,4 +29,4 @@

CONFIG_ISAPC=y
CONFIG_I440FX=y
CONFIG_Q35=y

configs/devices/i386-softmmu/default.mak line 32

Quoted 2 lines
configs/devices/i386-softmmu/default.mak +1 -1
-CONFIG_MICROVM=y
+#CONFIG_MICROVM=n

Better remove this altogether since it's not a default anymore.

hw/i386/Kconfig config Q35 · line 112

Quoted 10 lines
hw/i386/Kconfig +0 -0
index a6ee052f9a..f8ec8ebd7a 100644
@@ -108,6 +108,8 @@ config Q35
 

config MICROVM
bool

hw/i386/Kconfig +2 -0
+    default y
+    depends on KVM || WHPX || NVMM || HVF

What about TCG? Will it be available if we only build with tcg?

Quoted 7 lines

select SERIAL_ISA # for serial_hds_isa_init()
select ISA_BUS
select APIC
--
2.25.1