Are "info pic" and "info irq" still of any use?
These commands look like bit-rotted development aids to me.
They're limited to just a few interrupt controllers. For the most common machine types and accelerators, they do nothing.
They complicate David Gibson's work on disentangling dependencies on ISA.
I'm cc'ing the maintainers of all machines that can be configured in a way that makes these commands do something. Please speak up if you think they provide value.
The gory details:
Only some targets provide "info pic" and "info irq", namely:
#if defined(TARGET_I386) || defined(TARGET_PPC) || defined(TARGET_MIPS) || \
defined(TARGET_LM32) || (defined(TARGET_SPARC) && !defined(TARGET_SPARC64))They're HMP-only. Their documentation in full:
info pic -- show i8259 (PIC) state
info irq -- show the interrupts statistics (if available)
The first line is a lie: as we'll see, it's not just i8259, but it isn't all PICs, either. Not even all i8259.
Three separate implementations:
* sparc-softmmu
This is sun4m_hmp_info_pic(), sun4m_hmp_info_irq(). Both do nothing when !slavio_intctl. Set by sun4m_hw_init(). Thus, two cases:
- The sun4m machine types
These are SS-5, SS-10, SS-600MP, SS-20, Voyager, LX, SS-4, SPARCclassic, SPARCbook. Their board initialization runs sun4m_hw_init().
"info pic" prints selected registers of the "slavio_intctl" device model. This isn't a i8259.
"info irq" prints "irq statistic code not compiled" unless you manually enable DEBUG_IRQ_COUNT to make slavio_set_irq() count IRQs. Then it prints IRQ counts.
- The other machine types
These are leon3_generic and none.
Both commands do nothing.
* lm32-softmmu
This is lm32_hmp_info_pic(), lm32_hmp_info_irq(). Both do nothing when !pic. Set by init() method of "lm32-pic". Thus, two cases:
- Machines sporting an "lm32-pic"
These are lm32-evr, lm32-uclinux, milkymist.
"info pic" prints selected registers of the "lm32-pic" device model realized last. Fortunately, all machines have just one. This isn't a i8259.
"info irq" prints its IRQ counts.
- Other machine types
This is just none right now.
Both commands do nothing.
* {i386,mips,mips64,mips64el,mipsel,ppc,ppc64,ppcemb,x86_64}-softmmu
This is hmp_info_pic(), hmp_info_irq().
hmp_info_pic() does nothing when !isa_pic. Set by the i8259_init() helper that creates a master/slave pair of the "isa-i8259" device model. Cases:
- Machines using the helper
These are
alpha clipper
i386 & x86_64 pc*, isapc when accel=tcg or kernel_irqchip=off mips* magnum, pica64, malta, mips
mips64el fulong2e
ppc & ppc64 prep
"info pic" prints selected registers of the last "isa-i8259" master/slave pair created with i8259_init(). I can't see a machine creating more than one.
For the pc machine types, the pair of i8259s is just a piece of legacy crap hanging off LAPIC or I/O APIC. The commands are thus of dubious utility there.
"info irq" prints "irq statistic code not compiled" unless you manually enable DEBUG_IRQ_COUNT to make pic_set_irq() count IRQs. Then it prints IRQ counts for *all* "isa-i8259", whether they're created with i8259_init() or not. Looks like all are.
- Machines not using the helper
These include i386 & x86_64 pc*, isapc when accel=kvm and kernel_irqchip=on (this is the default).
Both commands do nothing. Even when the machine has in fact a pair of i8259 implemented by device model "kvm-i8259".
Quoted 11 lines · Markus Armbruster
These commands look like bit-rotted development aids to me.
They're limited to just a few interrupt controllers. For the most common machine types and accelerators, they do nothing.
They complicate David Gibson's work on disentangling dependencies on ISA.
I'm cc'ing the maintainers of all machines that can be configured in a way that makes these commands do something. Please speak up if you think they provide value.
For x86, they can be removed. However, it would be nice to provide access to the same information via QOM, especially for "info pic". This is the old QIDL project.
Paolo
Am 2015-03-31 11:56, schrieb Markus Armbruster:
[..]
Quoted 13 lines
* lm32-softmmu
This is
lm32_hmp_info_pic(),lm32_hmp_info_irq(). Both do nothing when !pic. Set byinit()method of "lm32-pic". Thus, two cases:- Machines sporting an "lm32-pic"
These are lm32-evr, lm32-uclinux, milkymist.
"info pic" prints selected registers of the "lm32-pic" device model realized last. Fortunately, all machines have just one. This isn't a i8259.
Quoted 7 lines
"info irq" prints its IRQ counts.
- Other machine types
This is just none right now.
Both commands do nothing.
Can be removed. Is there another way to make these information visible? Esp. the irq counters.
-michael
Quoted 9 lines · Paolo Bonzini
Quoted 8 lines · Markus Armbruster
These commands look like bit-rotted development aids to me.
They're limited to just a few interrupt controllers. For the most common machine types and accelerators, they do nothing.
They complicate David Gibson's work on disentangling dependencies on ISA.
Quoted 7 lines
Quoted 3 lines
I'm cc'ing the maintainers of all machines that can be configured in a way that makes these commands do something. Please speak up if you think they provide value.
For x86, they can be removed. However, it would be nice to provide access to the same information via QOM, especially for "info pic". This is the old QIDL project.
I guess you mean introspecting device state via QOM, thus QMP. Would be nice indeed, and much more useful than on-off hacks like "info pic".
Should be no harder than serializing device state, which we already do for migration. At least in theory. In practice, ...
Am 31.03.2015 um 11:56 hat Markus Armbruster geschrieben:
Quoted 11 lines
These commands look like bit-rotted development aids to me.
They're limited to just a few interrupt controllers. For the most common machine types and accelerators, they do nothing.
They complicate David Gibson's work on disentangling dependencies on ISA.
I'm cc'ing the maintainers of all machines that can be configured in a way that makes these commands do something. Please speak up if you think they provide value.
I've used 'info pic' before (on i386) and I think it has helped me a bit in debugging a guest. Definitely not mainstream usage, but there is some value.
It's not specifically this feature, but in my experience TCG guests are much friendlier for debugging (or I just don't know how to do it right for KVM guests - which would mean that for TCG the features are more discoverable and therefore friendlier again), so I actively avoid KVM when doing that.
I would appreciate if the disparity would be solved by KVM guests getting friendlier instead of TCG guests becoming harder to debug.
That said, if there are good replacements, there is nothing that should stop us from removing old HMP commands when they are worse than newer commands.
Kevin