ppc/spapr: KVM should not enable FWNMI until the guest requests it
RFC PATCH 13/13 ppc/spapr: KVM should not enable FWNMI until the guest requests it
QEMU should not enable KVM FWNMI handling until the guest has requested it. Although the QEMU NMI delivery will deliver interrupts as non-FWNMI, KVM would like to know whether or not the guest is FWNMI capable because in case of !FWNMI guests it may decide to take over some recovery tasks (e.g., flush and reload SLB in case of a multi-hit) if the guest is not FWNMI capable.
XXX: does this deal with machine resets properly, disabling it again on the KVM side? Is synchronisation okay?
XXX: this is just an RFC, we could probably go either way here.
--- hw/ppc/spapr_caps.c | 2 +- hw/ppc/spapr_rtas.c | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-)
hw/ppc/spapr_caps.c +1 -1
@@ -517,7 +517,7 @@ static void cap_fwnmi_apply(SpaprMachineState *spapr, uint8_t val, }if (kvm_enabled ()) { -if (kvmppc_set_fwnmi () <0 ) { +if (!kvmppc_get_fwnmi ()) {error_setg (errp,"Firmware Assisted Non-Maskable Interrupts(FWNMI) " "not supported by KVM, " "try appending -machine cap-fwnmi=off" );
hw/ppc/spapr_rtas.c +7 -0
@@ -437,6 +437,13 @@ static void rtas_ibm_nmi_register(PowerPCCPU *cpu,return ; } +if (kvm_enabled ()) { +if (kvmppc_set_fwnmi () <0 ) { +rtas_st (rets,0 ,RTAS_OUT_NOT_SUPPORTED ); +return ; + } + } + spapr->fwnmi_system_reset_addr = sreset_addr; spapr->fwnmi_machine_check_addr = mce_addr;
Signature · 1 line
2.23.0