Re: [PATCH v2 4/7] kvm/mips: rework guest entry logic

From: Paolo Bonzini
Date: Thu Jan 20 2022 - 12:30:35 EST


On 1/20/22 18:15, Mark Rutland wrote:
As above, we'll also need the guest_state_{enter,exit}() calls
surrounding this (e.g. before that local_irq_enable() at the start of
kvm_mips_handle_exit(),

Oh, indeed. And there is also an interrupt-enabled area similar to s390's, in both vcpu_run and the exception handler entry point (which falls through to the exit handler created by kvm_mips_build_exit). For example:

/* Setup status register for running guest in UM */
uasm_i_ori(&p, V1, V1, ST0_EXL | KSU_USER | ST0_IE);
UASM_i_LA(&p, AT, ~(ST0_CU0 | ST0_MX | ST0_SX | ST0_UX));
uasm_i_and(&p, V1, V1, AT);
uasm_i_mtc0(&p, V1, C0_STATUS);
uasm_i_ehb(&p);

I'd rather get rid altogether of the EQS for MIPS.

and that needs to happen in noinstr code, etc.

There are bigger problems with instrumentation, because the runtime-generated code as far as I can tell is not noinstr.

Paolo