What is an “irqchip”?
Asked Answered
L

1

8

In reference to the QEMU x86_64 machine option kernel_irqchip=on|off, the description reads:

Controls in-kernel irqchip support for the chosen accelerator when available

What is an "irqchip"?

Lannielanning answered 22/5, 2020 at 11:3 Comment(2)
terenceli.github.io/%E6%8A%80%E6%9C%AF/2018/09/06/…Maraca
@Maraca this is great, thanks!Lannielanning
P
20

An "irqchip" is KVM's name for what is more usually called an "interrupt controller". This is a piece of hardware which takes lots of interrupt signals (from devices like a USB controller, disk controller, PCI cards, serial port, etc) and presents them to the CPU in a way that lets the CPU control which interrupts are enabled, be notified when a new interrupt arrives, dismiss a handled interrupt, and so on.

An emulated system (VM) needs an emulated interrupt controller, in the same way that real hardware has a real hardware interrupt controller. In a KVM VM, it is possible to have this emulated device be in userspace (ie QEMU) like all the other emulated devices. But because the interrupt controller is so closely involved with the handling of simulated interrupts, having to go back and forth between the kernel and userspace frequently as the guest manipulates the interrupt controller is bad for performance. So KVM provides an emulation of an interrupt controller in the kernel (the "in-kernel irqchip") which QEMU can use instead of providing its own version in userspace. (On at least some architectures the in-kernel irqchip is also able to use hardware assists for virtualization of interrupt handling which the userspace version cannot, which further improves VM performance.)

The default QEMU setting is to use the in-kernel irqchip, and this gives the best performance. So you don't need to do anything with this command line option unless you know you have a specific reason why the in-kernel irqchip will not work for you.

Pm answered 27/5, 2020 at 15:23 Comment(1)
Thank you for the thorough answer-- this is exactly the information I was looking for!Lannielanning

© 2022 - 2024 — McMap. All rights reserved.