Skip to contentSkip to conversation

x86/run: Use separate "-accel" option to configure the accelerator

PATCH In review Xiaoyao Li 2 participants 8 messages May 28 – Sep 29 KVM

lore
Share & tools
lore

Xiaoyao Li

author
#0 lore raw

PATCH 1/1 x86/run: Use separate "-accel" option to configure the accelerator

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

# ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c
# qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify-vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
 x86/run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +1 -1
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi
 pit="-global kvm-pit.lost_tick_policy=discard"
 
 command="${qemu} --no-reboot -nodefaults $pit $pc_testdev -display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"
 if [ "${CONFIG_EFI}" != y ]; then
 	command+=" -kernel"
 fi
Signature · 1 line
2.43.0
#1 lore raw
Quoted 19 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

# ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c
# qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify-vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
 x86/run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755

x86/run fi · line 46

Quoted 5 lines
x86/run +1 -1
@@ -43,7 +43,7 @@ fi
 pit="-global kvm-pit.lost_tick_policy=discard"
 
 command="${qemu} --no-reboot -nodefaults $pit $pc_testdev -display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

qemu: -accel kvm,kernel_irqchip=split: Property 'kvm-accel.kernel_irqchip' not found

Quoted 6 lines
x86/run +0 -0
 if [ "${CONFIG_EFI}" != y ]; then
 	command+=" -kernel"
 fi
Signature · 1 line
2.43.0
author
#2 lore raw
Quoted 22 lines · Sean Christopherson
Quoted 21 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c
   #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify-vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi
  pit="-global kvm-pit.lost_tick_policy=discard"
 
Quoted 7 lines

x86/run fi · line 46

Quoted 3 lines
x86/run +1 -1
  command="${qemu} --no-reboot -nodefaults $pit $pc_testdev -display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

qemu: -accel kvm,kernel_irqchip=split: Property 'kvm-accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

This needs to be fixed on QEMU side. I'll look at it.

#3 lore raw
Quoted 28 lines · Xiaoyao Li
Quoted 27 lines · Sean Christopherson
Quoted 19 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c
   #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify-vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755

x86/run fi · line 45

Quoted 4 lines
x86/run +1 -1
@@ -43,7 +43,7 @@ fi
  pit="-global kvm-pit.lost_tick_policy=discard"
  command="${qemu} --no-reboot -nodefaults $pit $pc_testdev -display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

Quoted 3 lines
Quoted 1 line

qemu: -accel kvm,kernel_irqchip=split: Property 'kvm-accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

Oh, nice. Yep, that works for me.

author
#4 lore raw
In reply to Xiaoyao Li
Quoted 28 lines · Xiaoyao Li
Quoted 27 lines · Sean Christopherson
Quoted 21 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c
   #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify- vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi

  pit="-global kvm-pit.lost_tick_policy=discard"
  command="${qemu} --no-reboot -nodefaults $pit $pc_testdev -display none -serial stdio $pci_testdev"

x86/run fi · line 46

Quoted 2 lines
x86/run +1 -1
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

Quoted 5 lines
Quoted 1 line

   qemu: -accel kvm,kernel_irqchip=split: Property 'kvm- accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

This needs to be fixed on QEMU side. I'll look at it.

Well, I feel hard to justify a QEMU "fix" for it.

"kernel_irqchip" was a property of "machine" in old QEMU, and QEMU switched it to "kernel-irqchip" automatically.

Then QEMU moved it to be a property of "accel", while keeping the compatibility when users configure it via "machine" that QEMU internally setting it to accel's property in this case.

However, "kernel_irqchip" is only valid on "machine", but not on "accel".

For this KVM unit test issue, do we need to add workaround to keep your (work-by-accident) usage working? or just kill it?

#5 lore raw
Quoted 43 lines · Xiaoyao Li
Quoted 30 lines · Xiaoyao Li
Quoted 29 lines · Sean Christopherson
Quoted 22 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify- vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi

  pit="-global kvm-pit.lost_tick_policy=discard" command="${qemu} --no-reboot -nodefaults $pit $pc_testdev

x86/run fi · line 46

Quoted 3 lines
x86/run +1 -2
-display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

Quoted 6 lines
Quoted 2 lines

   qemu: -accel kvm,kernel_irqchip=split: Property 'kvm- accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

This needs to be fixed on QEMU side. I'll look at it.

Well, I feel hard to justify a QEMU "fix" for it.

"kernel_irqchip" was a property of "machine" in old QEMU, and QEMU switched it to "kernel-irqchip" automatically.

Quoted 8 lines

Then QEMU moved it to be a property of "accel", while keeping the compatibility when users configure it via "machine" that QEMU internally setting it to accel's property in this case.

However, "kernel_irqchip" is only valid on "machine", but not on "accel".

For this KVM unit test issue, do we need to add workaround to keep your (work-by-accident) usage working? or just kill it?

Nah, just switch to "accel" and call it good. I'm likely the one and only user of kernel_irqchip.

#6 lore raw
Quoted 48 lines · Sean Christopherson
Quoted 47 lines · Xiaoyao Li
Quoted 30 lines · Xiaoyao Li
Quoted 29 lines · Sean Christopherson
Quoted 22 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify- vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi

  pit="-global kvm-pit.lost_tick_policy=discard" command="${qemu} --no-reboot -nodefaults $pit $pc_testdev

x86/run fi · line 46

Quoted 3 lines
x86/run +1 -2
-display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

Quoted 6 lines
Quoted 2 lines

   qemu: -accel kvm,kernel_irqchip=split: Property 'kvm- accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

This needs to be fixed on QEMU side. I'll look at it.

Well, I feel hard to justify a QEMU "fix" for it.

"kernel_irqchip" was a property of "machine" in old QEMU, and QEMU switched it to "kernel-irqchip" automatically.

Then QEMU moved it to be a property of "accel", while keeping the compatibility when users configure it via "machine" that QEMU internally setting it to accel's property in this case.

Quoted 7 lines
Quoted 4 lines

However, "kernel_irqchip" is only valid on "machine", but not on "accel".

For this KVM unit test issue, do we need to add workaround to keep your (work-by-accident) usage working? or just kill it?

Nah, just switch to "accel" and call it good. I'm likely the one and only user of kernel_irqchip.

There's another problem: the CET and LAM tests force -enable-kvm:

[cet]
file = cet.flat
arch = x86_64
smp = 2
qemu_params = -enable-kvm -m 2048 -cpu host

[lam]
file = lam.flat
arch = x86_64
qemu_params = -enable-kvm -cpu max

Which apparently is wired up to "-machine accel=" under the hood, because they get skipped with:

SKIP cet (qemu: The -accel and "-machine accel=" options are incompatible) SKIP lam (qemu: The -accel and "-machine accel=" options are incompatible)

author
#7 lore raw
Quoted 70 lines · Sean Christopherson
Quoted 48 lines · Sean Christopherson
Quoted 47 lines · Xiaoyao Li
Quoted 30 lines · Xiaoyao Li
Quoted 29 lines · Sean Christopherson
Quoted 22 lines · Xiaoyao Li

When configuring accelerator via machine's "accel" property, it cannot pass additional ACCEL_PROPS. For example, it hits following error when configuring KVM with "notify-vmexit":

   # ACCEL="kvm,notify-vmexit=internal-error" ./x86-run x86/apic.c #   qemu-system-x86_64: Property 'pc-i440fx-11.1-machine.notify- vmexit' not found

Switch to use separate "-accel" option to configure the accelerator.

---
  x86/run | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
x86/run +0 -0
index dd38f14c871f..a68d469dd1b8 100755
@@ -43,7 +43,7 @@ fi

  pit="-global kvm-pit.lost_tick_policy=discard" command="${qemu} --no-reboot -nodefaults $pit $pc_testdev

x86/run fi · line 46

Quoted 3 lines
x86/run +1 -2
-display none -serial stdio $pci_testdev"
-command+=" -machine accel=$ACCEL$ACCEL_PROPS"
+command+=" -accel $ACCEL$ACCEL_PROPS"

This breaks my setup for specifying kernel_irqchip=split.

Quoted 6 lines
Quoted 2 lines

   qemu: -accel kvm,kernel_irqchip=split: Property 'kvm- accel.kernel_irqchip' not found

If you switch "kernel_irqchip" to "kernel-irqchip", it should work again.

This needs to be fixed on QEMU side. I'll look at it.

Well, I feel hard to justify a QEMU "fix" for it.

"kernel_irqchip" was a property of "machine" in old QEMU, and QEMU switched it to "kernel-irqchip" automatically.

Then QEMU moved it to be a property of "accel", while keeping the compatibility when users configure it via "machine" that QEMU internally setting it to accel's property in this case.

Quoted 7 lines
Quoted 4 lines

However, "kernel_irqchip" is only valid on "machine", but not on "accel".

For this KVM unit test issue, do we need to add workaround to keep your (work-by-accident) usage working? or just kill it?

Nah, just switch to "accel" and call it good. I'm likely the one and only user of kernel_irqchip.

There's another problem: the CET and LAM tests force -enable-kvm:

[cet]
file = cet.flat
arch = x86_64
smp = 2
qemu_params = -enable-kvm -m 2048 -cpu host

[lam]
file = lam.flat
arch = x86_64
qemu_params = -enable-kvm -cpu max

Quoted 5 lines

Which apparently is wired up to "-machine accel=" under the hood, because they get skipped with:

SKIP cet (qemu: The -accel and "-machine accel=" options are incompatible) SKIP lam (qemu: The -accel and "-machine accel=" options are incompatible)

Oh, sorry for not respond. I didn't see this mail until I decided to ping you for this patch after I noticed you were queuing kvm-unit-test patches.

I just sent a v2, which adds one patch to handle cet and lam tests:

https://lore.kernel.org/all/[email protected]/